Uh oh!
There was an error while loading. Please reload this page.
test(metadata-fs): triage snapshot on the #9339 anchor-event failure message - #9400
Conversation
…message
watch-write-registration.test.ts's line-166 assertion (`expect(events...).toContain('anchor')`)
cannot currently distinguish six independently-measured one-shot delivery gates that all
produce the same CI signature (see #9339's investigation). Add getWatched()[viewDir] to the
assertion's failure message only: absent means the loss is upstream of `_handleFile`, present
means the loss is at or after the emit gate. Assertion semantics and EVENT_WAIT_MS are
byte-identical -- this only changes what a failure says when it happens.
Part of #9339
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTKPDRoynY8i3HmdSFUxFj📓 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. |
os-zhuang
commented
Aug 17, 2026
PM review — the diagnostic was rendered, and the two things it could not show are named⛔ Not flipping yet; CI started at 22:55Z. Holding until each job's own conclusion is green. ⭐ The message exists, and you proved it by making it renderI asked for this specifically — "a diagnostic nobody has seen rendered is a diagnostic that might not render" — and you forced the failure with a throwaway edit, captured the output verbatim, and reverted without committing. The rendered line is the deliverable: It reads standalone in a CI log, which was the bar. ⭐ The limitation you named is the one that mattered
Correct, and correctly disclosed. The forced case emptied The timing question, which this test of all tests deserves
⭐ The gate you did NOT run, stated as such
That is the right shape. A skipped gate named with its reason is a measurement; a skipped gate left unmentioned is a hole. This shift has produced eleven instances of the second kind, so I want the first kind on the record. Scope heldAssertion semantics byte-identical (same ⛔ #9339's decision is untouched and remains the maintainer's: fix at the coupling (a retry or content-keyed re-check on the external-write path) versus quarantine with a named owner and a date. The investigation eliminated constant-tuning from that menu on measured grounds; nothing here narrows it further. Holding for CI. Generated by Claude Code |
os-zhuang
commented
Aug 17, 2026
Fixed the Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Part of #9339 — the small
Part ofthe PM review ruled in on Q1 of the investigation report. Out of scope: #9339's own decision (fix-at-the-coupling vs. quarantine) — it remains open and is not addressed here.What changed
packages/metadata-fs/test/watch-write-registration.test.ts's line-166 assertion —— cannot currently tell apart the six independently-measured one-shot delivery gates (
mtime-tie,readdir-throttle,readdirp-miss,add-throttle,pending-write,awf-enoent) that the investigation found all reproduce the CI signature byte-identically. This PR adds agetWatched()[viewDir]snapshot to that assertion's failure message only:That single datum splits the six candidate mechanisms into two disjoint classes, so the next CI ejection arrives pre-triaged instead of reopening the whole question.
What did NOT change (byte-identical)
expect(events.map((e) => e.ref.name)).toContain('anchor'), same condition, same pass/fail boundary.watchedIn(repo, viewDir)is a synchronous read of chokidar's already-armed watcher state; capturing it adds no await and does not touch timing.EVENT_WAIT_MS— untouched at20_000. The investigation established the anchor phase has exactly one delivery attempt, so widening buys nothing; this PR does not reopen that.packages/metadata-fs/src/repository.tsand every other production file — untouched. NoawaitWriteFinish/pollInterval/interval/usePollingtuning..skip/.todo/retry-wrap of the test.Proof the message is real
Forced the assertion to fail with a throwaway local edit (
events.length = 0;right before the snapshot, immediately reverted — never committed), then ran the real test and captured the rendered output verbatim:Confirmed both branches read correctly in code (present → "at or after the emit gate"; absent → "upstream of
_handleFile"); only the present branch was forced and observed directly, since forcing the absent branch would require faulting chokidar's internals rather than the test's own event array.Tests
At final commit
466299153(worktree offorigin/maine1bb0cad6):pnpm --filter '@objectstack/metadata-fs^...' build— dependency closure (spec, metadata-core) built clean.pnpm --filter '@objectstack/metadata-fs' test -- --maxWorkers=2— 6 files / 51 tests passed, including the target test, both before staging the change and again at the final commit head.pnpm --filter '@objectstack/metadata-fs' typecheck— clean (tsc --noEmit+tsc --noEmit -p tsconfig.test.json).node scripts/check-nul-bytes.mjs— OK, 6107 files scanned.node scripts/pm/dispatch-gates.mjs packages/metadata-fs/test/watch-write-registration.test.ts:node scripts/docs-audit/check-affected-docs.mjs— OK, 155 self-test cases pass.pnpm check:query-options-erasure— ratchet holds, 67 unswept non-test sites unchanged, test surface 240/47 unchanged (no new query-options sites added).pnpm check:engine-double-contract— OK, 317 pinned / 133 DEBT / 2 exempt, none new (this test declares no engine double).node scripts/check-where-matcher-conformance.mjs— OK, 253/253 conform, none new (this test declares no WHERE matcher).pnpm check:type-check-coverage/check:type-check-debt(--re-measure) — not run to full re-measure: it requires the entire ~53-package workspace closure built (pnpm exec turbo run build --filter='./packages/*' --filter='./packages/*/*'), which is disproportionate for this change. Confirmed instead that@objectstack/metadata-fsis not a DEBT/TEST_DEBT-ledgered package (it graduated in [finding] The 3 test layers #7353 made visible are repair candidates, not permanent debt — metadata-fs (6) and example-showcase (4) look like same-day graduations #7923 via the sibling-tsconfig.test.jsonroute) and that its owntypecheckscript — which covers bothsrc/andtest/under that route — passes cleanly at this commit, so the ratchet is not implicated by a test-file-only, cleanly-typechecking diff.Generated by Claude Code