Repository navigation
feat(workboard): measure each run's turn-end context against the smart zone - #51
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ion history Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 13, 2026
tomorrowflow
added a commit
that referenced
this pull request
Oct 13, 2026
* style(workboard): bring store-card-helpers back under the 700-line cap #51 and #52 each stayed under the cap and together reached 701 lines on main. The attempt rebuild carries contextTokens in one line. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(workboard): run git diff --check at node-ticket import Both of dev's defect verdicts in the Phase 4 window were a failing `git diff --check` that the session reported done anyway. The host clone now runs it over the imported range before it creates the ticket branch. A failure adds a failed `import check` proof entry and blocks the card with the command and output first, so the re-run session reads them and fixes them with a new commit in the same node worktree. A rework round checks only its own commits: the rework record gains `startCommit`, the branch tip the round started from, so a reviewer's commits or an "Update branch" merge of main never block the session. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(workboard): leave a failed import's pending record to the re-run A re-run claims the card while it still carries the pending handoff of the failed import, and the handoff sweep fires on that claim. It then imported the old head again: an import-check failure blocked the re-run before its session could fix it, and a generic failure jumped to review mid-start. A pending record older than the card's claim now belongs to the start that replaces it. The rework round's starting tip is checked as a commit id before it reaches host git. The start queue tests move to their own file to keep the handoff tests under the line cap. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Draft D16 sizes every ticket to the smart zone (about 150k tokens, roughly 20% of the window). It also asks for that to be measured, as context use at turn end per run plus breaches, and fed into the trust KPIs and the retro. Workboard recorded nothing about context, so a class with oversized tickets was invisible.
Solution
syncWorkboardAgentEndedreads the context of the run's last model call from theagent_endmessages. It stamps that value ascontextTokenson every card attempt carrying the run'srunId, viarecordAttemptContext. The stamp happens after the lifecycle write, so an attempt linked only by session key has already received its run id.agent_endmessages also carry the session's earlier runs.contextUsage.promptTokens(Codex sums usage across the turn's calls), that value wins. Otherwise the value is input + cacheRead + cacheWrite.workboard_card_attempts.context_tokens, added with the existingensureColumnpattern. The rebuild of an attempt from its execution now keeps the field, where before it dropped it on the next update.contextMeasuredandsmartZoneBreaches(runs aboveSMART_ZONE_TOKENS, 150,000). The weekly bucket gainsmedianContextTokens, and the result carriessmartZoneTokens.Impact
ALTER TABLE ADD COLUMNon the STRICT table. A fresh database creates it inCREATE TABLE.Evidence
lifecycle-sync.context.test.tsruns through the real node-ticket start andagent_endpath:contextUsagewins over summed usage.no column named context_tokenswhenensureColumnis removed.trust-kpis.test.tscovers breaches, unmeasured legacy attempts, and the weekly medians.pnpm test extensions/workboard: 32 files, 458 tests pass. The new file runs in about 11 s wall with--maxWorkers=1.tsgo:extensions,tsgo:extensions:testandtsgo:uishow no new errors (only the existing qa-labcrabbox-providermodule errors). oxlint and oxfmt are clean.🤖 Generated with Claude Code