Repository navigation
fix(ui): keep budget declarations stable after turns (#325) - #326
Merged
Merged
Conversation
PeterGuy326
previously approved these changes
Sep 18, 2026
PeterGuy326
left a comment
Contributor
There was a problem hiding this comment.
APPROVE
独立复核当前 head 3a02150:
- CI 必需检查全绿(含 Node 24 Linux/macOS、两端 staging smoke、installer/layout parity、CodeQL 与安全基线)。
- 隔离工作树复跑
npx vitest run --config packages/ui/vitest.config.ts packages/ui/test/budget-bar.test.tsx packages/ui/test/position-card.test.tsx:2 files / 13 tests passed。 npm run typecheck:ui与npm run typecheck:renderer均通过,git diff --check通过。- Diff、CHANGELOG、控制面规格和 309% 回归断言与 PR 的 AC/validation ledger 一致;已披露的全量仓库环境阻塞不涉及本 PR 改动。
LGTM。PR 当前仍 BEHIND main,合并前请先 rebase/update branch 后再按仓库流程 squash。
Keep employee-card budget declarations independent from turn usage, and bound over-budget meter fills while preserving the truthful percentage in reports.\n\nRefs #325\nConsumed revision: R2
Bindy-lbb
force-pushed
the
fix/325-codex-usage-accounting
branch
from
September 18, 2026 06:57
3a02150 to
a299f1d
Compare
waterbro-8
approved these changes
Sep 18, 2026
waterbro-8
left a comment
Collaborator
There was a problem hiding this comment.
Re-review after the post-#331 rebase (a299f1d). Over-budget fill is clamped to the track while the label and aria-valuetext stay truthful (e.g. 309%). CI is green. PositionCard no longer takes a unused consumption prop — matches the budget-bar-only contract.
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.
Tracking record
Closes #325
Consumed requirement revision: R2 (
DEC-ROLEWEAVE-325-002).Summary
aria-valuenowto 100%; expose the actual percentage through visible text andaria-valuetext.Token accounting and persisted turn records are intentionally unchanged: the observed 309% is the truthful ratio of 61,765 recorded tokens to the declared 20,000-token per-task cap.
Environment and reproduction
Reported desktop reproduction
问题研究员).4ce8fa66-3e2d-41d1-80cb-3d40a5ad886d(UI suffixa5ad886d).1cb04174-d451-4575-af3f-668f8493c6e6, with one usage event: 60,855 input + 910 output = 61,765 total tokens.Steps:
309%, and the red fill escapes its track. After this fix, the employee card retains both declarations; Reports → Usage & budgets still shows the truthful309%, with a fill bounded to the track.Local validation environment
5.15.146.1-microsoft-standard-WSL2, x86_64.v22.23.2, npm10.9.8; 20 logical processors and 31.2 GiB RAM;CIunset./root/projects/fullstack-ai-infra/org-workbenchwith a real sibling/root/projects/fullstack-ai-infra/design-systemcheckout.3a02150d7dc5b184089b3817f65544449c58cb9e; exact PR base used by the completed checks:eb01db298bb4b7b37840b288e03671a6b5fc5982.Acceptance criteria
App/PositionCard; covered byposition-card.test.tsx.BudgetBarvisible text still renders the unbounded percentage; existing D4 report test passes.aria-valuenoware 100%budget-bar.test.tsxasserts the exact 309% regression.aria-valuetextaria-valuetext="309%".Validation ledger
npx vitest run --config packages/ui/vitest.config.ts packages/ui/test/budget-bar.test.tsx packages/ui/test/position-card.test.tsxnpm run test:ui-t "renders D4 tabs")npm run typecheck:uiandnpm run typecheck:renderernpm run test:desktop-mainnpm run security:checknpm run checkon the local environment abovetest:scriptsbefore product testsdedupe-react.test.mjsexpects its synthetic “no design-system ancestor” layout, but discovers the real/root/projects/fullstack-ai-infra/design-system; this also leaves two dangling test-created React links, restored withnode scripts/dedupe-react.mjs.node --test --test-timeout=120000 "apps/server/dist/test/*.test.js"--test-concurrency=1produces the same totals and failing set, so this is not changed by serialization.git diff --quiet eb01db2 HEAD -- apps/server packages/shared scripts package.json package-lock.jsonexits 0.apps/servertree is9ae0bbd5...andpackages/sharedtree is09fe0a70...at both commits. The same server sources, fixtures, scripts, manifest, and lockfile are used by base and head.git grep -i geminireturns no server/package matches at eithereb01db2orHEAD. Gemini server fixtures exist only on the unmergedorigin/feat/315-gemini-cli-agent-hostbranch, so they cannot be a #326 head-vs-base regression.App.test.tsxrunTests and coverage
Change classification
Risk and rollback
PositionCard.consumptionis removed from this internal monorepo component; no persisted data, API, usage accounting, privacy, or performance behavior changes.3a02150; no data migration is required.Breaking or security notes
None.
Author checklist
GOVERNANCE.md.Reviewer notes
Please independently verify the separation between declaration and consumption: the employee card should keep the configured caps after a turn, while Reports → Usage & budgets should still show the truthful over-budget percentage. Also inspect the 309% meter's visible text, bounded fill, and ARIA attributes.
The local full-gate limitations above are environment-specific and explicitly not claimed as a green baseline. The hosted Node 24 checks are green. If the six Gemini fixture failures were produced from a synthetic merge with
feat/315-gemini-cli-agent-host, please provide that merge SHA or command so the same tree can be reproduced; neither the PR head nor its exact base contains those fixtures.