Uh oh!
There was an error while loading. Please reload this page.
fix(devx): check:cross-package-test-inputs sees the new URL, argument-position and climb-and-descend path spellings - #8899
Merged
os-project-manager merged 3 commits intoAug 15, 2026
Conversation
…ment-position path spellings The detector was blind in two independent ways. It recognised only `dirname(fileURLToPath(import.meta.url))` and `__dirname` seeds bound to a declaration, and it judged a binding by its FINAL depth — so a path that climbs past the package root and descends into a sibling scored positive and was never flagged. Adds `new URL(<rel>, import.meta.url)` (bare and under fileURLToPath) as a seed and chain step, scans path expressions in argument position to an fs read, and switches the escape criterion to the shallowest depth the path reaches. WIP: declarations for what it now finds still to come.
…e what the widened detector finds Closes the same class one spelling further: import.meta.dirname is the modern form of the two existing seeds and no test uses it yet, which is exactly why it is worth accepting now — the first author to reach for it would otherwise get silence rather than a declaration. Declares the reads the widened detector newly sees (formula, metadata-protocol, downstream-contract; wider globs for spec and dogfood) with matching turbo.json inputs, and publishes the recognised spellings in the failure text + AGENTS.md.
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-project-manager
marked this pull request as ready for review
August 15, 2026 16:00
This was referenced Aug 15, 2026
Uh oh!
There was an error while loading. Please reload this page.
os-project-manager
deleted the
claude/issue-8698-cross-package-url-seed
branch
August 15, 2026 16:08
This was referenced Aug 15, 2026
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#8698
Verification union re-run at
7f605e543(tree clean), quoted throughout.What the card asked, and what measuring it changed
The card offered three directions and the grading made direction 3 mandatory (name the recognised spellings where an author will see them) with 1 and 2 "bounded". Measuring them moved the answer:
Directions 1 and 2, implemented literally, do not fix the card's own headline example. The detector had a second, deeper blind spot the card does not name — it judged a binding by its final depth. A path that climbs past the package root and then descends into a sibling ends at a positive depth while addressing another package entirely, so it scored "inside" no matter how the seed was spelled. Adding a
new URLseed on top of final-depth arithmetic catches one file repo-wide and still lets the card's spelling (1) through.So the fix is three parts, all of which the card's example needs at once:
new URL('…', import.meta.url)as a seed and chain step, bare or underfileURLToPath.readFileSync(resolve(HERE, '…'))binds file contents, never a path, so a declaration-only scan sees no path at all in the line that does the escaping.Plus, closing the same class one spelling further:
import.meta.dirname/dirname(import.meta.filename). No test uses them today — which is the reason to accept them now rather than file them: the first author to reach for the modern seed would otherwise get silence.Direction 3 (mandatory) — where an author actually looks
The recognised list is now a published constant (
RECOGNISED_PATH_SPELLINGS), printed in the gate's failure text and mirrored in AGENTS.md under Build & Test, with the reason stated: a source scan sees only what it knows, so an unrecognised spelling yields no flag, which means no declaration, silently. Both places tell the author to extend the detector with a--self-testcase rather than route around it.Proof by ablation, not by a green run
A green gate proves nothing about what it can see, so every leg below is a mutation with the mutant verified real (sha + byte delta) and restoration proven byte-identical.
Control —
main's detector over the same source tree,main'sturbo.json:That green is over three packages with live, genuinely undeclared cross-package reads. This is not a synthetic ablation —
mainships it today.The card's exact two spellings, end-to-end through the real gate. A probe file in the undeclared
@objectstack/objectql, reading a sibling package:main's detectorOK: 9 package(s) … all declared— exit 0@objectstack/objectql— exit 1readFileSync(fileURLToPath(new URL(…)), 'utf8')readFileSync(resolve(HERE, …), 'utf8')Per-package ablation — delete one declaration, confirm the gate goes red for the right reason, naming the right test:
Same shape for
@objectstack/formula(names both of its tests) and@objectstack/downstream-contract. Each isolates a different newly-recognised mechanism: metadata-protocol the multi-linenew URLin argument position, the other two the shallowest-depth criterion. All three re-confirmed at7f605e543, tree clean after.What the widened detector found — live defects, not hypotheticals
The escaping-package count moves 9 → 12. Every new flag was checked by hand against the source; zero false positives. The most consequential:
packages/metadata-protocol/src/sys-metadata-repository.draft-drain.test.ts:451readsscripts/check-durability-degradation-log-level.mjs— a pin on a root gate's source, undeclared, so a change to that gate never re-ran it. Exactly the defect this gate exists to prevent, live onmain.packages/formula/src/rls-predicate.test.ts:188pinspackages/spec/src/security/rls.zod.ts;skill-catalog-sync.test.ts:19pins the published formula skill.packages/qa/downstream-contract/test/source-resolution.pin.test.ts:87resolves every spec specifier against spec's real source tree.packages/spec/scripts/file-description.test.ts:1001andcategory-title.test.ts:44walk the wholecontent/docs/referencestree; spec declared onlyindex.mdx.Each newly declared glob is pinned to the read that justifies it, in a comment naming the test, per the file's existing convention.
turbo.jsongains matching#testinputs so Layer B hashes them — written from the remedy the gate itself prints.Two things are deliberately not flagged, both documented in the code and AGENTS.md: a path landing in
node_modules(an installed dependency is not a repo source input and no turbo glob can name it), and a path that climbs out and comes straight back in.--self-test12 → 26 cases. Every newly recognised spelling gained a pin, and so did every deliberate non-flag; the 12 pre-existing cases are untouched and still pass. A newly recognised shape with no pin is the next silent regression, so the constant and the pins move together.
Verification at
7f605e543(tree clean)Gate families re-derived from the actual diff via
scripts/pm/dispatch-gates.mjs— it returned exactly the two the dispatch named, adding none forAGENTS.mdorturbo.json.No package sources are touched, so no package test suite is in scope and ESLint was not run locally — the worktree has no
node_modulesand a full install for lint-only value is a poor trade in a shared container. CI runs the farm.Notes for the reviewer
scripts/check-cross-package-test-inputs.mjs+AGENTS.md.turbo.jsonis added because the gate requires it — a declaration without matching#testinputs fails Layer B, so the detector change cannot land green without it. No third option leavesmaingreen.skip-changeset: rootscripts/,AGENTS.mdandturbo.jsonare not published package sources.@objectstack/metadata-protocol's new glob namesscripts/check-durability-degradation-log-level.mjsby path — the file check-durability-degradation-log-level: the read-seam invention rule keys onreturn, so acatchthat degrades by FALLING THROUGH into an empty accumulator is structurally invisible #8845 is editing. A rename there makes the glob stale (and breaks the pin itself). The metadata door accepts a dashboard widget dataset binding that names nothing — 200 on both save and publish, referential integrity enforced only at runtime #7529 and check-durability-degradation-log-level: the read-seam invention rule keys onreturn, so acatchthat degrades by FALLING THROUGH into an empty accumulator is structurally invisible #8845 had no open PR at the time of writing, so their exposure could not be measured directly; the extension was not weakened for either.Generated by Claude Code