Repository navigation
test(e2e): make an empty mutation list and a convergence re-run assert something - #601
Conversation
…t something Three assertions of the e2e harness passed on anything. `mutations: []` was read as an empty subsequence, which every write log contains, so the scenarios that say "this run writes nothing" passed on a run that wrote. An empty list now means the run sent no write; only an absent key asserts nothing. A fixpoint proof's check re-run was judged on exit code, writes, and mock violations alone, so under on-missing-permission: warn a re-run that skipped every section passed. The check now has to have verified something: it reports clean, or every section it skipped has a read the mock's permission gate denied in that re-run and at least one section reads clean. The apply-idempotence proof ends in the same verdict. Six cases of the invalid-settings catalog expected a token that the rejection's own boilerplate also contains (the known-sections list, the directive advice), so the check passed whichever key the run refused. Each token now carries the wording around its own key, and a decoy rejection that names only other keys pins the class. Two dead fields go. `tiers` was parsed and read by nothing, so `tiers: [live]` ran on the mock silently; the strict schema now refuses the key. `writeDeniedSections` and `mayWrite` were predicted by the fuzz oracle and read only by its own test: the prediction reads the section's permission while endpoints carry their own overrides, so it could not be asserted as written.
File size check0 over a hard cap (fails), 6 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
Member shape check1 finding(s).
Add the blank lines, make the comment one line directly above the item, comment every field or none, or list the path in 4 generated file(s) skipped. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes strengthening end-to-end test assertions.
No open issues 🎉
What changed in this PR
Strengthens the end-to-end test harness for GitHub Settings as Code so empty mutation expectations and fixpoint checks cannot pass without meaningful assertions.
Changes:
- Makes
mutations: []require zero writes and adds evidence checks to convergence and apply-idempotence reruns. - Makes rejection tokens key-specific and adds regression tests against unrelated error messages.
- Removes unused scenario
tiersand write-permission predictions.
| File | Description |
|---|---|
test/e2e/scenario.ts |
Documents stronger assertions and removes tiers from the schema. |
test/e2e/runner/runner.ts |
Enforces empty mutation expectations and checks fixpoint evidence. |
test/e2e/runner/runner.test.ts |
Tests no-write expectations and verified versus unverified checks. |
test/e2e/runner/apply-idempotence-proof.ts |
Applies the shared evidence check after the second apply. |
test/e2e/generators/single-scenario.ts |
Removes tiers from single-repository scenarios. |
test/e2e/generators/oracle.ts |
Removes unused mayWrite and writeDeniedSections predictions. |
test/e2e/generators/oracle.test.ts |
Updates oracle tests for the reduced prediction model. |
test/e2e/generators/multi-scenario.ts |
Removes tiers from multi-repository scenarios. |
test/e2e/generators/merge-scenario.ts |
Removes tiers from layered-settings scenarios. |
test/e2e/generators/invalid-settings.ts |
Tightens rejection tokens to identify their offending keys. |
test/e2e/generators/generators.test.ts |
Checks that unrelated rejection messages cannot satisfy tokens. |
test/e2e/generators/discovery-scenario.ts |
Removes tiers from discovery scenarios. |
test/e2e/fuzz.ts |
Removes tiers from fuzz-generated scenarios. |
test/e2e/foundation.test.ts |
Adds a schema test rejecting the removed tiers key. |
Review effort: Balanced
Before
After
How
mutations: []means the run sent no write. Only an absent key asserts nothing.clean, or every section it skipped has a read the mock's permission gate denied in that re-run's log and at least one section row readsclean.tiersis deleted. A scenario file that writes it is refused at load. No file does.writeDeniedSectionsandmayWriteare deleted. Nothing asserted them. For the owner: the fuzz still does not check that a denied write leaves state alone.tableRowsintest/docs/markdown.ts, covers reading the summary's rows.Proof
mutations: []send no write. None changed.373/373 passed.25/25 iterations ok.Technical details
must-fail.mtsis a scratch script that feeds five scenario documents to the runner'sparseScenarioandrunScenario, withTMPDIRpointed at a scratch directory.origin/mainatfaf72dab, After on this branch.unknown-top-level-keycase ofINVALID_SETTINGS_CASESbuilds for the typolabel, read from the tree under test.origin/main,requestLogFailures({ mutations: [] }, <a log with one PATCH>)returns[].origin/maina rejection of{ zzz_decoy: [], _zzz: "x" }contains the token of six catalog cases.unknown-top-level-key(label,milestone,branch),unknown-underscore-key(_layerin,_undeclared),array-section-wrong-type,record-section-wrong-type,pages-wrong-type,interaction-limits-wrong-type(each a bare section key).unknown top-level section: <typo> (known:,unknown underscore key: <key>.,_undeclared must be one of, and<section>:, the start of the section's own issue.genInvalidSettings > no token is satisfied by a rejection that names only other keys, with a control that the barelabeland_layerinare found in the decoy.mutations: []: 372 scenarios, 137 setexpect.mutations, 3 set it to[](empty-settings,policy-matrix-apply-fail,secret-scanning-patterns-bootstrap-fail), read fromloadScenarios(scenarioRoots()).bun test/e2e/run.ts --scenario <name>under the new rule:1/1 passed.tiers, onorigin/main:grep -rnE '\.tiers\b' test src .github --include='*.ts'finds 0 readers,grep -rnE 'tiers: \["mock"\]'finds 12 literals,grep -rlE '^tiers:' test --include='*.yml'finds 0 files..fixpointfinds 12.test/e2e/foundation.test.ts:Unrecognized key: "tiers".origin/main:writeDeniedSectionsandmayWriteeach appear 0 times outsidetest/e2e/generators/{oracle.ts,oracle.test.ts}.allowedExitCodes, a prediction the fuzz does read, appears 6 times outside them.endpointPermission), so "no write lands in a section without a write grant" is not sound as written.bun test/e2e/run.ts --sections all, 372 scenarios and the corpus witness line.FUZZ_SEED=20261111 bun test/e2e/fuzz.ts --iterations 25, afterbun run build:schema.bun test test/e2e/runner test/e2e/generators test/e2e/foundation.test.ts test/e2e/fuzz.test.ts test/e2e/run.test.ts, 8 files.test/e2e/runner/{runner.ts,apply-idempotence-proof.ts,runner.test.ts},test/e2e/{scenario.ts,foundation.test.ts,fuzz.ts},test/e2e/generators/{invalid-settings.ts,generators.test.ts,oracle.ts,oracle.test.ts,single-scenario.ts,multi-scenario.ts,merge-scenario.ts,discovery-scenario.ts}.