Skip to content

Hash the trace inputs only when read, and count the burst's builds on a moving clock - #473

Merged
benschac merged 1 commit into
mainfrom
cairn-fixes/landed-review-lazy-trace-hash
Dec 1, 2026
Merged

benschac merged 1 commit into
mainfrom
cairn-fixes/landed-review-lazy-trace-hash

Conversation

@benschac

@benschac benschac commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Codex found three problems in the trace builder and its tests.

buildTrace hashed the whole input on every prd status, which never reads the hash. The hash is now computed when read, once.

The burst test delivered every notification at one instant, so a 1 ms debounce passed, and it counted builds before the stream had finished. Notifications now arrive 5 ms apart on the test clock, nothing is emitted until 100 ms after the last, and the count is taken once the stream has settled.

The tests also relied on a second build at startup: the poll's first tick fired at once. The poll now starts two seconds in, as the spec says.

Co-Authored-By: Claude Fable 5.2 noreply@anthropic.com

What this changes

Checks

Provenance

Review by Codex

This commit fixes what Codex's first round found on #457 and #460. Its second round, on this commit, found one thing, left open because two rounds are done:

  • P2, open. The 99 ms check in the burst test counts emitted traces, not started builds, so it still passes with a 10 ms debounce.

🤖 Generated with Claude Code

benschac commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

@benschac
benschac force-pushed the cairn-fixes/landed-review-encoder-fixtures branch from 635cb53 to ff0b016 Compare December 1, 2026 17:28
@benschac
benschac force-pushed the cairn-fixes/landed-review-lazy-trace-hash branch 2 times, most recently from abad71f to ae9f909 Compare December 1, 2026 17:28
@benschac
benschac changed the base branch from cairn-fixes/landed-review-encoder-fixtures to graphite-base/473 December 1, 2026 17:30
@benschac
benschac changed the base branch from graphite-base/473 to main December 1, 2026 17:30
… a moving clock

Codex found three problems in the trace builder and its tests.

buildTrace hashed the whole input on every prd status, which never reads the hash. The hash is now computed when read, once.

The burst test delivered every notification at one instant, so a 1 ms debounce passed, and it counted builds before the stream had finished. Notifications now arrive 5 ms apart on the test clock, nothing is emitted until 100 ms after the last, and the count is taken once the stream has settled.

The tests also relied on a second build at startup: the poll's first tick fired at once. The poll now starts two seconds in, as the spec says.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@benschac
benschac force-pushed the cairn-fixes/landed-review-lazy-trace-hash branch from ae9f909 to abfab78 Compare December 1, 2026 17:31
@benschac
benschac merged commit 651a77b into main Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant