{"slug":"quality-gates-evidence-contract","title":"quality-gates-evidence-contract","summary":"Use when producing or verifying the structured evidence log that attests quality gates (tests, build, lint, no-mocks, commits, RED/GREEN integrity, frontend screenshots). Tech-agnostic schema. Loaded by software-engineer (writer) at COMMIT phase and by quality-gates-lens (reader)","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-29T00:42:33.347076Z","repo":{"url":"https://github.com/SebastienDegodez/skraft-plugin","stars":17,"forks":3,"license":"GPL-3.0","updatedAt":"2026-11-29T00:18:21Z"},"bodyHtml":"<hr>\n<h2>name: quality-gates-evidence-contract\ndescription: Use when producing or verifying the structured evidence log that attests quality gates (tests, build, lint, no-mocks, commits, RED/GREEN integrity, frontend screenshots). Tech-agnostic schema. Loaded by software-engineer (writer) at COMMIT phase and by quality-gates-lens (reader) during review.</h2>\n<h1>Quality Gates Evidence Contract</h1>\n<p>A tech-agnostic schema that attests quality gates with <strong>verdicts written by scripts and facts\nread from Git</strong>, never with prose.</p>\n<h2>Why this exists</h2>\n<p>Truth #6 (HARNESSES BRIDGE): the LLM cannot prove a test passed by saying so.\nSo no agent ever writes a gate status: the stack adapter's scripts run each command and record\nits exit code in the log, and <code>qg-verify</code>\n(<code>node \"&lt;skill&gt;/scripts/qg-verify/cli/qg-verify.mjs\" --log &lt;path&gt;</code>, bundled in this skill;\n<code>&lt;skill&gt;</code> is the folder holding this SKILL.md) derives everything else from Git — the commits\nsince the DELIVER base and every RED acceptance test — and judges the verdict. Nobody re-runs a\ngate; the project's CI runs them again on the pull request.</p>\n<h2>Where the artifacts live — never in Git</h2>\n<p>One directory per story, never shared with another story, <strong>ignored by Git</strong>. It holds the log\nand, for a frontend story, its screenshots — nothing else:</p>\n<pre><code>.copilot-tracking/skraft-plans/{projectSlug}/evidence/{date}/{story}/\n├── qg-{story}.json      # the evidence log (this contract): verdicts only\n└── screenshots/         # evidence.screenshots, frontend stories\n</code></pre>\n<p>The consumer project's <code>.gitignore</code> holds this line:</p>\n<pre><code>.copilot-tracking/skraft-plans/*/evidence/\n</code></pre>\n<p>Nothing under <code>evidence/</code> is ever committed: not the log, not a screenshot. No tool output,\nexit-code or hash file is written either. <code>qg-verify</code> fails a v7 log whose evidence directory\nholds a file Git tracks.</p>\n<p>A screenshot <code>ref</code> is relative to the project's tracking directory\n(<code>evidence/{date}/{story}/screenshots/home.png</code>). Tool run folders (Stryker HTML, TRX, logs)\nnever land here.</p>\n<p>The test plan (<code>details/{date}/test-plan-{story}.md</code>, written by DISTILL) stays where it is: with\nthe screenshots, it is what the QA reads.</p>\n<h2>Schema (`qg-</h2>\n<p>The stack adapter's scripts write it — <code>capture.mjs</code> and the no-mocks scan for each gate,\n<code>gate-log.mjs</code> for screenshots and <code>not_applicable</code> gates, or <code>qg-collect.mjs</code> for all of them on\n.NET. Each write stamps <code>repo_root_rev</code> with <code>HEAD</code> and <code>produced_at</code> with the time.</p>\n<pre><code>{\n  \"$schema\": \"quality-gates-evidence/v7\",\n  \"story\": \"string — story identifier, from the file name qg-{story}.json\",\n  \"produced_at\": \"ISO-8601 UTC timestamp\",\n  \"producer\": \"software-engineer\",\n  \"tech_adapter\": \"string — the quality-gates-&lt;tech&gt; skill whose scripts wrote it\",\n  \"repo_root_rev\": \"string — git rev-parse HEAD (the last work commit)\",\n  \"gates\": [\n    {\n      \"id\": \"test.acceptance\",\n      \"label\": \"Acceptance test(s) pass\",\n      \"status\": \"pass | fail | not_applicable\",\n      \"command_executed\": \"the command the script ran\",\n      \"summary\": \"last line of its output, e.g. Passed! - Failed: 0, Passed: 15\",\n      \"metrics\": { \"tests_total\": 15, \"tests_passed\": 15, \"tests_failed\": 0 }\n    },\n    {\n      \"id\": \"evidence.screenshots\",\n      \"label\": \"Frontend screenshots captured\",\n      \"status\": \"pass\",\n      \"screenshots\": [\n        { \"ref\": \"evidence/{date}/{story}/screenshots/home-rejected.png\", \"sha256\": \"hex sha256 of the PNG bytes\" }\n      ]\n    }\n  ]\n}\n</code></pre>\n<p><code>metrics</code> is optional (the .NET adapter reads it from the TRX report). A <code>not_applicable</code> gate\ncarries a <code>rationale</code> instead of a command.</p>\n<h2>Gates (fixed identifiers, <code>type.description</code>)</h2>\n<p>The <code>id</code> field uses a fixed taxonomy. Tech adapters MAP their tools to these ids;\nthey do NOT invent new ones. Adding a gate id is a contract change (new schema version).</p>\n<table>\n<thead>\n<tr>\n<th>id</th>\n<th>label</th>\n<th>what it attests</th>\n<th>before v7</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>test.acceptance</code></td>\n<td>Acceptance test(s) pass</td>\n<td>the BDD/acceptance scenario for the active story is green</td>\n<td>G1</td>\n</tr>\n<tr>\n<td><code>test.unit</code></td>\n<td>All unit tests pass</td>\n<td>the full unit suite is green; on .NET it includes the architecture tests</td>\n<td>G2</td>\n</tr>\n<tr>\n<td><code>build.compile</code></td>\n<td>Build passes</td>\n<td>compilation / static type-check succeeded</td>\n<td>G3</td>\n</tr>\n<tr>\n<td><code>build.lint</code></td>\n<td>Static analysis pass</td>\n<td>linter / analyzer reported no blocking issue; carries the boundary rules of the stack (ESLint <code>boundaries/*</code>, Python <code>import-linter</code>)</td>\n<td>G4</td>\n</tr>\n<tr>\n<td><code>test.no-mocks-core</code></td>\n<td>No mocks in Domain/Application core</td>\n<td>the adapter's scan of the Domain/Application projects and their unit tests found nothing</td>\n<td>G7</td>\n</tr>\n<tr>\n<td><code>evidence.screenshots</code></td>\n<td>Frontend screenshots captured</td>\n<td>the story's frontend outcome is shown by at least one hashed screenshot; required for a frontend story</td>\n<td>—</td>\n</tr>\n<tr>\n<td><code>commit.convention</code></td>\n<td>Conventional commit policy</td>\n<td><em>derived by <code>qg-verify</code>, never in the log</em>: every commit since the DELIVER base satisfies the shared policy below</td>\n<td>G8</td>\n</tr>\n<tr>\n<td><code>test.integrity</code></td>\n<td>No test tampering (RED→GREEN integrity)</td>\n<td><em>derived by <code>qg-verify</code>, never in the log</em>: every test file a <code>test</code> commit holds only grows afterwards</td>\n<td>G9</td>\n</tr>\n</tbody>\n</table>\n<p>Architecture, coverage and mutation are not pipeline gates. The project's CI runs them\n(coverage with a minimal bar and no exclusion, mutation as its own step); the developer runs\n<code>/skraft-mutation</code> by hand. A v7 log never carries <code>arch.boundaries</code>, <code>ci.coverage</code>,\n<code>ci.mutation</code> nor any <code>G&lt;N&gt;</code> id: <code>qg-verify</code> reports an unknown id as <code>inconclusive</code>, and a\nderived id (<code>commit.convention</code>, <code>test.integrity</code>) recorded in the log as <code>inconclusive</code> too.</p>\n<p>The RED is DISTILL's <code>test</code> commit: every acceptance test, committed before DELIVER starts and\nbefore the code that makes it pass. No RED run is captured, no snapshot is written, and the\nproducer lists no commit and no cycle: <code>qg-verify</code> reads them from Git.</p>\n<p>A gate that is genuinely irrelevant for the story uses <code>status: \"not_applicable\"</code> and\nMUST include a <code>rationale</code> field explaining why. <code>not_applicable</code> is <strong>never</strong> a substitute\nfor <code>fail</code> or for missing evidence.</p>\n<h2>Frontend stories — screenshots are mandatory</h2>\n<p>A story is frontend when a commit since the DELIVER base touches at least one of:</p>\n<ul>\n<li>a <code>.feature</code> file holding a <code>@visual</code> scenario;</li>\n<li>a path under <code>tests/e2e/</code>;</li>\n<li>a <code>package.json</code> declaring <code>react</code> (dependencies, devDependencies or peerDependencies);</li>\n<li>a <code>playwright.config.*</code> file.</li>\n</ul>\n<p>A frontend story records <code>evidence.screenshots</code> with <code>status: \"pass\"</code> and at least one\nscreenshot — <code>node \"&lt;adapter&gt;/scripts/gate-log.mjs\" --log \"$EV/qg-{story}.json\" --screenshot &lt;png&gt;</code>\ncopies each PNG into <code>evidence/{date}/{story}/screenshots/</code> and records its <code>ref</code> and the sha256\nof its bytes. Any other story omits the gate or records it <code>not_applicable</code> with a rationale.</p>\n<h2>Falsification surface (what qg-verify checks)</h2>\n<p><code>qg-verify</code> takes the DELIVER base (<code>--base</code>, default: the one the pipeline recorded) and the\nDISTILL base (<code>--red-base</code>, default: idem). The quality-gates lens reports its verdict and checks\nonly the commit policy it cannot (approved feature scope, <code>Refs</code>/<code>Closes</code> issue line).</p>\n<table>\n<thead>\n<tr>\n<th>What</th>\n<th>How it is falsified</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>repo_root_rev</code></td>\n<td>resolves, and is <code>HEAD</code></td>\n</tr>\n<tr>\n<td>evidence directory</td>\n<td>no file under it is tracked by Git</td>\n</tr>\n<tr>\n<td><code>gates[].status</code></td>\n<td>written by a script from an exit code; <code>fail</code> fails the log</td>\n</tr>\n<tr>\n<td><code>gates[].metrics.tests_failed</code></td>\n<td>for <code>status: \"pass\"</code> MUST be <code>0</code></td>\n</tr>\n<tr>\n<td><code>gates[].screenshots[]</code></td>\n<td>each file MUST exist; the sha256 of its bytes MUST equal the declared value</td>\n</tr>\n<tr>\n<td><code>commit.convention</code></td>\n<td>every commit of <code>base..repo_root_rev</code>, read from Git</td>\n</tr>\n<tr>\n<td><code>test.integrity</code></td>\n<td>the test files of the <code>test</code> commits since the DISTILL base are guarded: each later commit that touches one may only ADD lines (<code>git show</code> of its parent against <code>git show</code> of the commit), unless its message records <code>PLAN_DEVIATION:</code></td>\n</tr>\n<tr>\n<td>frontend detection</td>\n<td>computed from the files of <code>base..repo_root_rev</code> at <code>repo_root_rev</code></td>\n</tr>\n</tbody>\n</table>\n<p>A test file is a <code>.feature</code>, a file under a <code>test</code>, <code>tests</code>, <code>__tests__</code>, <code>spec</code>, <code>specs</code> or <code>e2e</code>\nfolder, or a file named as a test (<code>*.test.*</code>, <code>*.spec.*</code>, <code>*Tests.cs</code>, <code>test_*.py</code>, <code>*_test.py</code>).\nThe production stubs DISTILL commits with the RED are not guarded: the GREEN rewrites them.</p>\n<h2>commit.convention — Full-message verification</h2>\n<p>Each commit's actual Git message: <code>type(feature): subject</code>, with the\napproved feature scope and <code>Signed-off-by</code> trailer from <code>git commit -s</code>. For a\nknown issue, the final body line is <code>Refs: #N</code> for intermediate work or\n<code>Closes #N</code> only when the whole issue is genuinely finished and all required\ngates pass. Omit the issue line when unknown.</p>\n<p><code>qg-verify</code> checks the syntax and the sign-off; the lens checks the feature scope and the issue\nline from the full messages. A verified violation is <code>fail</code>; a message nobody can read is\n<code>inconclusive</code>.</p>\n<h2>Producer rules (software-engineer side)</h2>\n<ul>\n<li>Record the gates <strong>once</strong>, at the end of the story, after every work commit landed; each\nscript stamps <code>repo_root_rev</code> with that last work commit, <code>HEAD</code>. Nothing is committed after it.</li>\n<li>The scripts refuse a log path Git does not ignore; append\n<code>.copilot-tracking/skraft-plans/*/evidence/</code> to the project's <code>.gitignore</code> in a work commit.</li>\n<li>Never write or edit the JSON by hand: every status comes from a script.</li>\n<li>Run <code>qg-verify</code> on the log before handing over; a <code>fail</code> or <code>inconclusive</code> is yours to fix.</li>\n<li>A failing gate is recorded <code>fail</code> and the log is still written. Do NOT delete the log to hide a\nfailure — a missing log is <code>inconclusive</code> (NEEDS_REWORK), so hiding fails harder than disclosing.</li>\n</ul>\n<h2>Verifier rules (qg-verify)</h2>\n<ul>\n<li><code>qg-verify</code> exits <code>0</code> pass, <code>1</code> fail, <code>2</code> inconclusive; the producer runs it on its own log\nbefore handing over, the reviewer runs it again, the lens reports its result.</li>\n<li>Any of the following → <code>verdict: inconclusive</code> (never <code>pass</code>):\n<ul>\n<li>the JSON is missing, or a required field is absent or malformed</li>\n<li>a gate id is not a v7 gate (<code>GATE_UNKNOWN</code>), or a derived gate is recorded (<code>GATE_DERIVED</code>)</li>\n<li>a screenshot does not exist, or its <code>sha256</code> does not match its bytes</li>\n<li><code>repo_root_rev</code> is not <code>HEAD</code> (the log describes an older tree)</li>\n<li>no DELIVER base (<code>BASE_UNKNOWN</code>) or no DISTILL base (<code>RED_BASE_UNKNOWN</code>) is known</li>\n<li>no <code>test</code> commit since the DISTILL base holds a test, while <code>test.acceptance</code> applies</li>\n<li>a commit cannot be read</li>\n</ul>\n</li>\n<li>Any of the following → <code>verdict: fail</code>:\n<ul>\n<li>a gate has <code>status: \"fail\"</code></li>\n<li><code>metrics.tests_failed &gt; 0</code> while <code>status: \"pass\"</code> (internal contradiction)</li>\n<li>a commit since the DELIVER base violates the shared <code>commit.convention</code> policy</li>\n<li>a guarded test file lost or changed a line without a <code>PLAN_DEVIATION:</code> in the commit\n(a <code>PLAN_DEVIATION</code> is reported as a <code>notice</code> for the lens to judge)</li>\n<li>a file of the evidence directory is tracked by Git (<code>EVIDENCE_COMMITTED</code>)</li>\n<li>a frontend story records no screenshot (<code>SCREENSHOTS_MISSING</code>)</li>\n</ul>\n</li>\n</ul>\n<h2>Schema versioning</h2>\n<p><code>$schema: \"quality-gates-evidence/v7\"</code> is part of the contract. Bump the version\nwhen adding/removing gates or fields; old logs MUST still be parseable with their\ndeclared version.</p>\n<ul>\n<li><p><strong>v7</strong> — gate ids become <code>type.description</code> (<code>test.acceptance</code>, <code>test.unit</code>, <code>build.compile</code>,\n<code>build.lint</code>, <code>test.no-mocks-core</code>; <code>commit.convention</code> and <code>test.integrity</code> derived from Git).\nRemoves <code>G5</code> (architecture: covered by <code>test.unit</code> on .NET and <code>build.lint</code> on TypeScript and\nPython), <code>G6</code> (mutation: the project's CI, <code>/skraft-mutation</code> by hand) and <code>G11</code> (coverage: the\nproject's CI). The log holds verdicts only: no <code>stdout_ref</code>, <code>stdout_sha256</code>, <code>stdout_tail</code>,\n<code>exit_code_ref</code>, <code>commits_covered</code> nor <code>test_integrity</code> — scripts write each status, and\n<code>qg-verify</code> reads the commits and the RED tests from Git. Adds <code>evidence.screenshots</code>, required\nfor a frontend story. The log and the screenshots live in a Git-ignored directory;\n<code>repo_root_rev</code> is <code>HEAD</code>. v1–v6 logs still verify with their <code>G&lt;N&gt;</code> ids, captures, snapshots\nand evidence-only commit.</p>\n</li>\n<li><p><strong>v6</strong> — removes gate <code>G10</code> and the per-cycle fields <code>red_stdout_ref</code>, <code>red_stdout_sha256</code>,\n<code>red_exit_code_ref</code>: the <code>test</code> commit is the RED, so no RED run is captured. G6 may still be\n<code>not_run</code>. v2–v5 logs still verify their G10.</p>\n</li>\n<li><p><strong>v5</strong> — G6 is one global entry again: the developer's declared mutation commands, judged\ntogether against one bar. G6 alone may be <code>not_run</code>, with a rationale, when no command is\ndeclared. v4 logs still verify with their two scoped entries.</p>\n</li>\n<li><p><strong>v4</strong> — G6 is recorded once per mutation scope with a <code>scope</code> field (<code>core</code>, <code>boundary</code>);\nits runner reads the break threshold from the checked-in config, so no <code>--break-at</code> flag is\nexpected in <code>command_executed</code>. Evidence lives in one directory per story.\n<code>repo_root_rev</code> may be the parent of the evidence-only commit.</p>\n</li>\n<li><p><strong>v3</strong> — adds gate <code>G11</code> (line coverage meets the bar) and restates <code>G6</code> as an exit-code attestation rather than a score comparison: the runner's <code>--break-at</code> decides, so a log no longer records a number a reader must judge. Removes the <code>depthTier</code> reference, which no longer exists.</p>\n</li>\n<li><p><strong>v2</strong> — adds gate <code>G10</code> (RED observed) and the three per-cycle fields <code>red_stdout_ref</code>, <code>red_stdout_sha256</code>, <code>red_exit_code_ref</code>; everything a <code>v1</code> log declares is unchanged.</p>\n</li>\n</ul>\n","files":[{"path":"scripts/qg-verify/adapters/infrastructure/active-slug-store.mjs","sizeBytes":902,"isText":false},{"path":"scripts/qg-verify/adapters/infrastructure/git-repository.mjs","sizeBytes":1853,"isText":false},{"path":"scripts/qg-verify/adapters/infrastructure/tracking-root-resolver.mjs","sizeBytes":1626,"isText":false},{"path":"scripts/qg-verify/application/evidence-verification-service.mjs","sizeBytes":4756,"isText":false},{"path":"scripts/qg-verify/cli/qg-verify.mjs","sizeBytes":2576,"isText":false},{"path":"scripts/qg-verify/domain/commit-convention.mjs","sizeBytes":744,"isText":false},{"path":"scripts/qg-verify/domain/config-schema.mjs","sizeBytes":1669,"isText":false},{"path":"scripts/qg-verify/domain/evidence-verification-policy.mjs","sizeBytes":22578,"isText":false},{"path":"scripts/qg-verify/domain/result.mjs","sizeBytes":325,"isText":false},{"path":"scripts/qg-verify/domain/tracking-layout-policy.mjs","sizeBytes":957,"isText":false},{"path":"scripts/qg-verify/domain/value-objects.mjs","sizeBytes":1636,"isText":false},{"path":"scripts/qg-verify/GENERATED.md","sizeBytes":684,"isText":true},{"path":"SKILL.md","sizeBytes":13318,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-29T00:44:23.211392Z","sha256":"9115C82D0A67046CCDB31653834801837E420D1447CB2C898CC2CF8AE6AF462E","sizeBytes":22324},"review":null,"source":{"repositoryUrl":"https://github.com/SebastienDegodez/skraft-plugin","path":"plugins/skraft-framework/skills/quality-gates-evidence-contract","license":"GPL-3.0","commit":"c6117c6236a25490bf1916b131866069740c9b22","subtreeSha":"877245EB0200D6BEFE462C782BB4A321DA0523BCEC57AFDC52DA4CAFC3176C7E","lastSyncedAt":"2026-11-29T00:42:27.348488Z"},"reviewedAt":"2026-11-29T00:48:16.494258Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/SebastienDegodez/skraft-plugin/tree/main/plugins/skraft-framework/skills/quality-gates-evidence-contract"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sebastiendegodez-skraft-plugin@llmmart"},{"target":"git","command":"git clone https://github.com/SebastienDegodez/skraft-plugin.git"}]}