You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5cbf7f
Browse filesBrowse the repository at this point in the historyBrowse files
authored
test: scope the tree-wide pin scans to the extensions they judge, one shared scan per file (#25410)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DTUQ4EBM66nvHr5WDUjGwSA)_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](https://claude.ai/code/session_01J61suxUmEiTYnKbc7EKFYs)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01J61suxUmEiTYnKbc7EKFYs
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nitjsefnie <zmatek.peter@gmail.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
0 commit comments