Skip to content

test(client): the envelope caller census never enters .cache/ - #22196

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-22153-census-skips-cache
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-22153-census-skips-cache

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #22153
Clause-②: no

What changed

One file, a test, which publishes nothing: packages/client/src/envelope-caller-census.test.ts.

  • SKIP_DIRS gains .cache. A docblock says why: when there is no ../objectui sibling, pnpm objectui:build (scripts/build-console.sh) shallow-clones the objectui source tree into .cache/objectui-SHA/. That tree contains objectui's own SDK call site.
  • Section 1 gains a pin, [#22153] never enters .cache/. It runs on a throwaway root under the system temp directory: mkdtempSync(join(tmpdir(), 'os-census-cache-')), removed in finally.
    • A planted .cache/objectui-0123456789ab/ checkout leaves scanCallSites deep-equal: the same sites, the same receiver split and the same files-scanned count.
    • A positive control shows that the same walk and matcher do count the planted site when they are given it directly. So the equality comes from the skip, not from a fixture the census could never read.
    • The fixture text is built from parts. Section 6 gives the reason: this file sits inside the tree the census walks, so a whole call shape in it would itself be counted.

Why SKIP_DIRS and not a tracked-files walk (PM reading H2)

Triage's direction allows either. Measured at 8f395597:

  • It is the shape this repo already uses. 34 of the 86 one-line node_modules skip sets in the tree already list .cache. Examples: every packages/spec/src/**/*-retirement.test.ts and scripts/check-agent-test-spelling.mjs.
  • It drops nothing the census counts. .cache/ is gitignored (.gitignore:44), and git ls-files | grep -cE '(^|/)\.cache/' returns 0. Control: the same pattern for .github/ returns 45.
  • A git ls-files walk would add a git dependency this test does not have today. Of the 12 tests in the tree that spawn git, none is in packages/client. It would also change whether an untracked file is counted before it is staged. No measured case needs either change.

Reproduction and proof (PM reading H1 confirmed)

I planted .cache/objectui-test/packages/x/src/index.ts, holding one this.client.analytics.query(q) call, in the worktree. Then I ran pnpm --filter @objectstack/client exec vitest run --maxWorkers=2 src/envelope-caller-census.test.ts:

tree result
base 6ed0c0f3, planted file present 3 failed, 17 passed (20). expected 29 to be 28; the enumeration gains .cache/objectui-test/packages/x/src/index.ts (analytics.query, sdk)
this branch 8f395597, planted file present 21 passed (21)

The planted file was removed afterwards.

Ablation. Run from the committed state with node scripts/ablation-replace.mjs. Anchor 'out', '.cache', became 'out', 'ABLATED-22153',: the anchor count went 1 → 0 and the blob cbf54580cb85 → c2a77abdd38a. After the restore the blob equals HEAD and git diff HEAD is empty.

  • Clean tree, no planted file: 1 failed, 20 passed. Only the new section-1 pin goes red (filesScanned 1 → 2, and the planted site appears). CI never has a .cache/, so it still catches the skip being removed.
  • Planted file present: 4 failed, 17 passed. The new pin goes red, and so do the three section-3 assertions.
  • A first attempt used the replacement 'out',. The tool refused it before any test ran, because the replacement is a substring of the anchor (count 1 → 1). That attempt produced no reading.

Tests and gates, head 8f395597

  • pnpm --filter @objectstack/client test: 51 files, 653 passed. That is the 652 from before plus the new pin.
  • pnpm --filter @objectstack/client typecheck: exit 0. check:test-typecheck reports OK with 0 errors. The census file is in the tsconfig.test.json program (tsc --listFilesOnly finds it once).
  • dispatch-gates --commands over this diff derives 54 gates, the same list the dispatch named; pnpm lint (full repo) was run on top. All exit 0.
    • check:skill-examples and check:dual-build-cjs-loads first exited 3 (PREREQUISITE NOT MET, no dist/). After turbo run build --filter=!@objectstack/docs, both re-ran and exited 0.
    • dispatch-gates --ran: 54 derived, 54 run, 0 NOT-MEASURED, 0 UNRUN.
  • No changeset: a test file publishes nothing.

Acceptance notes

  • Scope (PM reading H3). The card's full pnpm test, with the checkout present, turned only @objectstack/client#test red. No other test suite has a reproduced instance. The repo-root walkers under scripts/ whose skip sets lack .cache have not been measured against a planted checkout. That is inference only, so nothing was filed.
  • Source of the hazard. scripts/build-console.sh clones into the repo root. Cloning outside the tree, or printing the rm -rf .cache advice, would retire the whole class. Not touched here: it is outside the claim's file surface.
  • New scratch-dir site. One mkdtempSync(join(tmpdir(), ...)) under the system temp directory, removed in finally.

Generated by Claude Code

`pnpm objectui:build` shallow-clones objectui into `.cache/objectui-<sha>/`
when there is no `../objectui` sibling. The census walk started at the repo
root and skipped only build and VCS directories, so it counted objectui's own
SDK call site as a 29th site of this repo and three section-3 assertions went
red on an untouched main.

Add `.cache` to SKIP_DIRS, the house skip-set shape most repo walkers here
already carry, and pin it in section 1 on a throwaway temp root: a planted
`.cache/objectui-*` checkout leaves the sites, their receiver split and the
files scanned unchanged, with a positive control proving the same walk counts
the planted site once it is handed it.

Claude-Session: https://claude.ai/code/session_01RWZbGvPFcRKvUqASZtunCU
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 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 13aea189591b935d81eb306f9be8a50c9045f661 → packageMentionDocs.

@github-actions github-actions Bot added the tests label Oct 8, 2026
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 8, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 8, 2026 06:29
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 8, 2026 06:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit b8feb55 Oct 8, 2026
39 of 40 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-22153-census-skips-cache branch October 8, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

2 participants