Skip to content

test: scope the tree-wide pin scans to the extensions they judge, one shared scan per file - #25410

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-37l85m
Oct 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-37l85m

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #25321

Clause-②: no
Metadata-protocol: none

The four tree-scan pins that still handed git grep all of packages/ and filtered to .ts afterwards now give git the pathspec of the extension they judge, and run that scan once per file, shared by every assertion that reads it. This is the shape PR #25319 gave the @objectstack/runtime twin. SCAN_TIMEOUT_MS = 60_000 is unchanged in every file: this is not a timeout raise.

Test-only; skip-changeset (all four files are src/**/*.test.ts, which neither package ships: both files[] ship dist).

Adopted from a fork PR

The core of this diff is the fork PR #25389 by Nitjsefnie, adopted onto an internal branch per the repository's card-first rule for outside contributions. Its first commit carries their diff unchanged, with Co-authored-by: Nitjsefnie. The fork PR itself is not landed; it is closed with thanks when this card closes.

The second commit is the review change. The fork made the @objectstack/objectql twin one scan too, but kept a second file read per symbol and dropped the attribution check. That file now carries the runtime twin's half D as it stands on main:

  • one multi-needle git grep over SCANNED_PATHSPECS in the describe's beforeAll;
  • the candidate files are read once, recording each symbol's lines;
  • a file git lists but the read cannot attribute throws (a broken scan, never a clean file);
  • the two tree tests drop their own SCAN_TIMEOUT_MS, because they no longer scan;
  • SCAN_TIMEOUT_MS keeps the runtime twin's "not a dial" note.

The two copies are kept parallel on purpose (PR #25319's acceptance note). The remaining differences from the runtime twin are the package-specific ones (findUp for the CJS root, PIN_FILES[0], the runtime site as the reach target, no half lettering) and comment wording that already differed on main.

Per file

file before after
packages/objectql/src/action-owner-key-single-source.test.ts 3 greps over packages 1 grep, :(glob)packages/**/*.ts, both needles
packages/core/src/security/row-serving-door-exposure.pin.test.ts 2 greps over packages 1 grep, *.ts, in beforeAll
packages/core/src/security/second-object-read-exposure.pin.test.ts 2 greps over packages 1 grep, *.ts, in beforeAll
packages/core/src/security/operation-private-keys.pin.test.ts 4 prefilter greps over packages (+3 ls-files) 1 prefilter grep, *.ts + *.tsx, in beforeAll (the ls-files census is untouched)
packages/core/src/security/granted-permissions-not-enforced.pin.test.ts already *.ts + *.mts unchanged

operation-private-keys keeps .tsx in its prefilter on purpose: the boundary-expiry assertion judges .tsx declarations, so that population must still be read.

Readings (local container, base 830a63a, head 98ac499)

Bytes are rchar from /proc/PID/io for the git processes each file starts, with the test's own arguments. Wall is the vitest JSON reporter's file duration, 3 runs each, under scripts/pm/os-verify-lock.sh.

file git invocations bytes git reads file wall (3 runs)
objectql twin 3 → 1 639.7 → 151.8 MB 391 / 405 / 402 → 156 / 181 / 176 ms
row-serving 2 → 1 426.5 → 151.8 MB 374 / 337 / 371 → 141 / 139 / 120 ms
second-object 2 → 1 426.5 → 151.8 MB 501 / 475 / 467 → 233 / 259 / 231 ms
operation-private-keys 4 greps + 3 ls-files → 1 + 3 852.9 → 151.9 MB 856 / 863 / 892 → 142 / 151 / 145 ms
granted-permissions (unchanged) 7 1,065.3 MB 529 / 519 / 509 → 547 / 533 / 545 ms

The local wall cannot reproduce a loaded shard. Estimate, not measured on a shard: if a shard's cost scales with the bytes read, as the runtime twin's 86.24 s across three walks suggests, each edited file now reads what one walk read there.

The judged file set did not shrink: measured

Old shape (grep over packages, then the file's own filter) against new shape (pathspec grep, then the same filter), on the head tree plus untracked plants under packages/zz-eq-25321/ holding every needle: top.ts (depth 1), a/b/deep.ts, a/b/deep.d.ts, a/b/z.test.ts, a/b/x.tsx, a/b/y.mts, a/b/note.md (depth 3).

pin judged set old new plants kept
objectql twin actionObjectKey 6 6 identical top.ts, deep.ts, deep.d.ts, z.test.ts
objectql twin standaloneActionOwnerKey 15 15 identical the same four
row-serving canReadObject 19 19 identical top.ts, deep.ts
second-object referenceTargetOf 24 24 identical top.ts, deep.ts
operation-private-keys offender population (.ts minus .d.ts) 17 17 identical top.ts, deep.ts, z.test.ts
operation-private-keys boundary population (.tsx) 1 1 identical x.tsx

The plants were removed by a trap, and git status was clean afterwards.

A planted mention in a still-scanned path goes red

Predicted direction: red, naming the planted file. Each leg plants one untracked file under packages/plugins/plugin-auth/src/zz-ablation-25321/deep/er/ and runs that pin file alone at head 98ac499, after the fix was committed.

pin plant result
objectql twin planted.ts, a comment naming actionObjectKey 1 failed, 4 passed: "is named nowhere outside the release record…", listing …/deep/er/planted.ts:1
objectql twin control: the same text as planted.md 5 passed
row-serving planted.ts calling svc.canReadObject(…) 1 failed, 2 passed: "every caller of the read admission is classified…", listing the plant
row-serving control: .md 3 passed
second-object planted.ts calling referenceTargetOf(…) 1 failed, 3 passed: "every caller of the reference-target arbiter is classified…", listing the plant
second-object control: .md 4 passed
operation-private-keys planted.ts declaring OPERATION_PRIVATE_KEY_PREFIX 1 failed, 4 passed: "is declared in exactly one file…", listing the plant
operation-private-keys the same declaration as planted.tsx 1 failed, 4 passed: the boundary assertion "the extension boundary is .ts alone…", listing the plant; the offender assertion stays green
operation-private-keys control: .md 5 passed

The plant directory was removed by a trap after every leg; git status --porcelain and git diff HEAD were empty afterwards.

Local verification (head 98ac499)

  • The five pin files pass: objectql 5/5, row-serving 3/3, second-object 4/4, operation-private-keys 5/5, granted-permissions 6/6 (vitest run --project repo, per file).
  • pnpm --filter @objectstack/core run typecheck: exit 0. pnpm --filter @objectstack/objectql run typecheck: exit 0.
  • pnpm exec eslint --no-inline-config on the four files: exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands derived 58 families; --ran reconciliation: 58 accounted for, 53 run, 5 NOT MEASURED (exit 3, no dist/ in this container: check:dts-closure, check:dual-build-cjs-loads, check:lean-entry-closure, check:sourcemap-no-sources-content; check-plugin-teardown-shape --self-test, whose pinned fixture commit is outside the shallow clone). check-engine-split-ratio --days 90 exited 2, refusing the shallow clone's 90-day window: also NOT MEASURED here. Their verdicts are this PR's CI checks.
  • scripts/pm/check-governed-merges.mjs --test on the four paths: 0 of 4 hit the register, NOT governed.

Acceptance notes

  • granted-permissions-not-enforced.pin.test.ts is left unchanged, as the card asks (its pathspecs are already .ts + .mts). It is now the largest reader of the five: seven separate scoped greps, 1,065.3 MB per file run. The test "leaves the fs and network grant classes with no enforcement surface at all" runs three of them (about 456 MB) inside one 60 s budget, which is more than the 426 MB a single test of the runtime twin read before it timed out on a loaded shard. It has not been seen red. The same one-shared-scan shape would fit it. Noted, not filed; carrier: none.
  • The fork PR showed 0 check runs at its head f38d888, read as NOT MEASURED. This branch's CI is the first measurement of the adopted diff.
  • Branch name. This PR's branch is claude/project-thread-37l85m, the name the session was given, not claude/issue-25321-…. The Duplicate Fix Guard may say so. The claim (comment 6364199079) names it.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01J61suxUmEiTYnKbc7EKFYs

claude and others added 2 commits October 23, 2026 11:50
Adopts the diff of the fork pull request from Nitjsefnie as proposed: each
pin's scan hands git the pathspec of the extension it judges and shares one
scan across its assertions, with SCAN_TIMEOUT_MS unchanged.

Co-authored-by: Nitjsefnie <zmatek.peter@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J61suxUmEiTYnKbc7EKFYs
… one-scan shape

The adopted diff scoped the objectql twin's scan to `.ts` but kept a second
file read per symbol and no attribution check. This ports the runtime twin's
half D as it stands on main: one multi-needle `git grep` over
SCANNED_PATHSPECS in the describe's beforeAll, per-symbol line attribution read
once, a throw when git lists a file the read cannot attribute, and the
per-test budgets dropped because the tests no longer scan. SCAN_TIMEOUT_MS
stays 60_000 and keeps the runtime twin's "not a dial" note.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J61suxUmEiTYnKbc7EKFYs
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 23, 2026
@github-actions github-actions Bot added the tests label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ea33919f56a9879f95a00d45418385ff7dbb974f → packageMentionDocs.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 23, 2026 15:42
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 23, 2026 15:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit c5cbf7f Oct 23, 2026
41 of 42 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-37l85m branch October 23, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

2 participants