docs(ticketmill): document pre-pool byStage invariant at aggregateTokens reconciles line - #190
Conversation
#120) Insert a terse comment above the reconciles line in aggregateTokens() recording (a) the invariant that every byStage bucket is sampled outside runPool() via addStage()/STAGE_TOKENS bracketing, exact at any CONCURRENCY, (b) the consequence that this is the only reason !anyTracked may claim reconciles:true above concurrency 1 (issue #65, fixed by #119), and (c) the obligation on anyone adding a byStage bucket sampled inside the pool to revisit this line. Synced .claude/workflows/ticketmill.js via node scripts/lint-engine.js --fix. No executable logic changed.
Spec Review (Iteration 1)Verdict: approved Issue #120 asked for a terse point-of-risk comment above the Verified against the diff (
No missing acceptance criteria; no scope-creep concerns. Approving with no required changes. |
Code Review (Iteration 1)Verdict: approved — no blocking, major, or minor findings. Diff reviewed: Correctness of the comment's claims (verified against the code, not taken on trust):
Persona checklist:
The comment does not duplicate the existing prose at :1650-1656 and :1715-1724 — it points at it from the point of risk, which is exactly the gap issue #120 describes. |
Implementation CompleteBranch
No deferred suggestions were collected during implementation, so there is no follow-up section for this PR. |
* docs(engine): note pre-pool byStage invariant at reconciles definition (#120) (#190) Insert a terse comment above the reconciles line in aggregateTokens() recording (a) the invariant that every byStage bucket is sampled outside runPool() via addStage()/STAGE_TOKENS bracketing, exact at any CONCURRENCY, (b) the consequence that this is the only reason !anyTracked may claim reconciles:true above concurrency 1 (issue #65, fixed by #119), and (c) the obligation on anyone adding a byStage bucket sampled inside the pool to revisit this line. Synced .claude/workflows/ticketmill.js via node scripts/lint-engine.js --fix. No executable logic changed. * chore(release): v0.2.3
Closes #120
Summary
Adds a terse 3-5 line
//comment immediately above thereconcilesdefinition inaggregateTokens()(workflows/ticketmill.js, ~line 2297) documenting the point-of-risk invariant flagged during issue #65's review (fixed via PR #119) but never folded into the shipped fix.The comment records:
byStagebucket is sampled outsiderunPool(), the only concurrent region, viaaddStage()/STAGE_TOKENSbracketing — making byStage exact at anyCONCURRENCY.!anyTracked(stage-buckets-only breakdown) may safely claimreconciles: trueabove concurrency 1..claude/workflows/ticketmill.jswas regenerated byte-identically vianode scripts/lint-engine.js --fixin the same commit.Key decisions
git diff -U0showing only added//lines.node --check,node scripts/lint-engine.js(clean, lockstep confirmed viacmp), barenode --test(781/781 green, incl. token-reconcile/token-usage/sandbox-lint/architecture-provenance).Token usage (approximate, this issue only): 71654 output tokens