Repository navigation
test(core): give the vouched-reference census pin a scan budget and declare its census imports as inputs - #31105
Conversation
…eclare the census's imports Both tests of vouched-reference-callers.pin.test.ts spawn the census under vitest's default 5 s timeout; the --ts-only scan reads every .ts file under packages/ and can overrun that on a busy runner, failing before any assertion runs. Each test now takes SCAN_TIMEOUT_MS (60 s), the budget of the sibling operation-private-keys scan pin. The census imports scripts/js-comment-mask.mjs and scripts/invoked-as.mjs, so an edit to either moves the pin's verdict; both are now @objectstack/core inputs in cross-package-test-inputs.mjs and core#test:repo in turbo.json. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
… imports check:cross-package-test-inputs cannot see the census's own relative imports from the pin, which quotes only the census path, so it read the two new globs as unheld. The pin is the test that loads them (through the spawned child); record it as their heldBy witness. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
📓 Docs Drift CheckNothing 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): |
|
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc Contract reviewServed-tier: Reviewed 2026-11-07T09:44Z. Face: declaration, read off the PR's three paths with ① Derived judgmentsThe budget is the sibling's shape, and 60 s is the right value. The inputs are complete and nothing extra is declared. The census's import closure on The
No required context and no test behaviour changes. The two assertions are byte-identical to ② Semver levelNone. No released package's published surface moves; the PR correctly ships no changeset and carries ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc 席位核对ACCEPT · 2026-11-07T09:59Z · head
Generated by Claude Code |
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc
Clause-②: no
Metadata-protocol: none
维护者速读
SCAN_TIMEOUT_MS = 60_000(与同目录 operation-private-keys 扫描 pin 同值);普查脚本 import 的scripts/js-comment-mask.mjs与scripts/invoked-as.mjs登记为@objectstack/core的跨包测试输入(声明表 +turbo.json的core#test:repo),并在声明表里以该 pin 作heldBy见证。--ts-only扫描读packages/下全部.ts,闲机约 1 秒;繁忙 runner 上会越过 vitest 默认 5 秒,测试在任何断言前超时,把无关 PR 和合并队列批次一起拖红。另外普查导入的两个模块一改,pin 的判定就会变,但此前改它们不会重跑这个 pin,也不会让 turbo 缓存失效。packages/core/src/security/vouched-reference-callers.pin.test.ts的SCAN_TIMEOUT_MS及两处it末参;②scripts/cross-package-test-inputs.mjs的@objectstack/core条目(globs与新增heldBy);③turbo.json的@objectstack/core#test:repoinputs。pnpm check:cross-package-test-inputs,预期末行OK: 32 package(s) read outside themselves, all declared, and turbo.json hashes every declared glob。What changes
Scan budget. Both tests in
vouched-reference-callers.pin.test.tsspawn the census (--self-test, then--ts-only) and ran under vitest's default 5000 ms test timeout. The--ts-onlyscan reads every.tsfile underpackages/. On a runner that is building the monorepo at the same time, it can overrun that timeout, and the test then fails withTest timed out in 5000msbefore any assertion runs. Eachitnow passesSCAN_TIMEOUT_MS(60 s), and a one-paragraph docblock gives the reason. This is the same constant name, value and shape as the sibling scan pinoperation-private-keys.pin.test.ts. No repo gate registers or spells per-test timeouts. The file-level// test-budget:header grammar inscripts/measure-test-shard-timings.mjsis for files over the 10 s wall line, and this file runs in about 1.2 s, so it does not apply.Census imports declared as inputs. The census imports
./js-comment-mask.mjs, which decides what counts as prose, and./invoked-as.mjs, which decides whether its dispatch runs.js-comment-mask.mjsalso importsinvoked-as.mjs. An edit to either file moves the pin's verdict, so both are now:@objectstack/coreentry inscripts/cross-package-test-inputs.mjs, next to the census script itself;@objectstack/core#test:repointurbo.json.The review asked for
js-comment-mask.mjs.invoked-as.mjsbelongs to the same import closure, so it is included as the same omission.heldBywitness.check:cross-package-test-inputscannot see from the pin's quoted paths that it reads these two files, because only the spawned child loads them. On the first commit it flagged both globs as "held by nothing". The entry now names the pin as theirheldBywitness, which is that gate's second disposition: the read is real, and the scan cannot name it.Tests
repoproject once6158a02f: 7 files and 96 tests pass. The two pin tests take 91 ms (--self-test) and 1091 ms (--ts-only) on a 4-core container while other gates run.--self-testtakes 0.09 s and passes 39 cases.--ts-onlytakes 1.07 s to 1.15 s over 3 runs and stays green atfile-attachment-service.ts (2). The scan is not restructured in this PR.pnpm --filter @objectstack/core typecheck: exit 0. The test layer holds at its pinned 4 signatures.Acceptance notes
*.test.tsin@objectstack/core, which ships onlydist, plus root config (turbo.json,scripts/). Nothing published moves, soskip-changesetapplies, the same as for the census PR. The label is not applied here; the seat applies it.check:dual-build-cjs-loadsis NOT MEASURED locally. It needs every package'sdist(PREREQUISITE NOT MET, exit 3) and is left to CI'sLint & Repo Gates.Verification
Derived gates on ce6158a: 69 derived, 68 exit 0, 1 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commands(change set vs merge base465c2bea3, 3 files) derived 69 commands. Every one was run once6158a02f, and the exit code was captured before any pipe. 68 exited 0.pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET). Reconciliation:pnpm check:cross-package-test-inputs, which was red on the first commit and is green after theheldBywitness:Generated by Claude Code