Uh oh!
There was an error while loading. Please reload this page.
test(scripts): instrument check-route-envelope's declared-vs-discovered correspondence - #12080
Merged
yinlianghui merged 1 commit intoAug 25, 2026
Conversation
…ed correspondence The gate reconciles discovered route modules against four declaration tables by exact path key, in both directions. Measured on f7b25c5: loosening exact equality to a basename credit left BOTH the production run and --self-test green at every one of those sites -- the four forward lookups, the three reverse `includes` checks, and the two `MODULES[rel]` predicates that route a file to its surface. Positive control (narrowing discover()'s convention) reddens the production run, so the double-greens are a property of this rule, not of a harness that cannot red. Structural reason: green means the finding set is empty, loosening only shrinks that set, and on a clean tree every discovered module already has an exact declaration -- so the fallback never fires and the verdict cannot move. Route every site through two pure exported functions -- declarationFor() and unfoundDeclarations() -- and drive them from --self-test over the adversarial population a clean tree by construction cannot supply: a route module moved to another package keeping its file name. Under exact equality that is two findings at once; under a basename credit it is silently zero. The gate's rules are unchanged: same live verdicts, same diagnostics, same tables. Part of #11920
yinlianghui
marked this pull request as ready for review
August 25, 2026 08:15
Uh oh!
There was an error while loading. Please reload this page.
yinlianghui
deleted the
claude/issue-11920-route-envelope-correspondence-instrument
branch
August 25, 2026 08:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#11920
Gives
check-route-envelope.mjs's declared-vs-discovered correspondence the instrument it had none of — and closes the whole class rather than the one lookup the card measured.The measurement — the card's scope was one lookup of nine
The card ablated one site (
MODULES[file]). The dispatch asked whether the two sibling lookups carried the same defect. They do, and so does every other site that decides this correspondence. Measured onf7b25c546, one ablation per site, each mutation confirmed on disk (anchor 1 to 0, injected marker 0 to 1) before any reading was taken, each restored under a trap withgit statusclean afterwards:--self-testMODULES[file](surface 1, the card's)PLUGIN_ROUTE_MODULES[file](surface 3)EXPRESS_RESPONSE_MODULES[file](surface 4)DISPATCHER_DOMAINS[name](surface 2)discovered.includes(file)(surface 1 reverse)honoRoutes.includes(file)(surface 3 reverse)expressRoutes.includes(file)(surface 4 reverse)MODULES[rel]indiscoverHonoRoutes(surface routing)Positive control, reproduced — same harness, same gate, a different mutation. Narrowing
discover()'s convention so some modules stop being discovered:So the harness can redden this gate, and the eight double-greens are a property of the rule rather than of a broken probe.
The reverse-direction and surface-routing rows are new: they do not match the
const declared = TABLE[file]shape the card and the dispatch both grepped for, and they carry the identical defect.Why the live run can never see it
Green means the finding set is empty; loosening a correspondence can only shrink that set; the empty set is the fixed point of shrinking. On a clean tree every discovered module already has an exact declaration, so a fallback never fires and the verdict is identical before and after the rule breaks.
--self-testsupplies the adversarial population a clean tree by construction cannot contain, and is the only instrument this rule has. That is the #11150 family shape.What changed
Two pure exported functions become the one place the correspondence is decided, and every site above routes through them:
declarationFor(table, key)— the declaration a discovered key is credited with, by exact key.Object.hasOwnrather than a bare index read, so a key naming something onObject.prototypeanswersundefinedinstead of a truthy inherited function.unfoundDeclarations(table, discovered)— the other direction, by exact key, in the table's own key order.--self-testthen drives them over the population the card names: a route module moved to another package keeping its file name. Under exact equality that is two findings at once —NOT DECLAREDfor the new path anddeclared ... but not foundfor the old one. Under a basename credit it is silently zero, each missing finding covering for the other's absence. Every negative case is paired with a positive control, both boundaries (#10534's longer-sibling shape and the prototype shape) are pinned, and a live-population case asserts the helper is wired to the real table rather than only to fixtures.Reverse verification, from the committed state
Re-ablated at the extracted decision point, mutation confirmed on disk each time, restored from the commit:
--self-testdeclarationForto a basename fallbacka discovered path was credited to a same-named declaration at ANOTHER pathunfoundDeclarationsto a basename comparisonthe abandoned declaration must read as not founddeclarationForto a bare index reada declaration table answered from Object.prototypeProduction staying green under all three is the point, not a defect: it is the card's thesis, now carried by an instrument.
The gate's rules did not move
Strengthening only, as the card and the dispatch require. Proof rather than assertion:
origin/main's gate and this branch's gate were both run over the same tree and their production output is byte-identical (diffexit 0, both exit 0). Same verdicts, same diagnostics, same tables, same counts — 10 route modules, 16 dispatcher domains, 12 Hono modules, the express walk unchanged.Verification
All gates re-run on the final commit
86b5c3a2c, exit codes captured before any pipe:Gate verdict lines, quoted from the gates themselves:
The family list was derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstackagainst this branch's own diff, not inherited.Lint — a measured narrowing, not a skip. Ran on the changed file rather than the repo, with the three readings that make the narrowing checkable: (1) the receiving population read from eslint's own
--print-config— 2 active rules,parserOptions.projectandprojectServiceboth null, so type-aware linting is not enabled; (2)--format jsonreports 1 file linted, 0 errors, 0 warnings, exit 0; (3) with type-aware linting off, each file's verdict is computed from its own source plus the flat config, and this diff touches one file and no config file — so no untouched file's verdict can move. The repo-wide sweep is CI's run.Determinations
scripts/pm/bare-root-worklist.mjs): does not apply. Verified rather than assumed — the sweep was run against this changed tree and reports0 untriaged row(s), andcheck-route-envelope.mjsappears in no row. The change assembles no new scan root;discover(),discoverResponseWritersanddiscoverDomainsare untouched in their root assembly.skip-changeset, derived from the workflow's own prescription rather than inherited —lint.ymlstates that "this PR edits a CI-internal script" is the textbook case, since such a PR releases nothing. The diff is one CI-internal script under rootscripts/; no package, no published surface, noskills/file moves.docs/adr/, no.claude/, noskills/, no root instruction file. Left draft for the PM seat to review and land.Generated by Claude Code