Skip to content

spend: one floor for a sub-cent figure, so the Spending tab says a tiny day one way - #1542

Merged
AbirAbbas merged 3 commits into
devfrom
fix/one-money-floor-2026-09-26
Sep 26, 2026
Merged

AbirAbbas merged 3 commits into
devfrom
fix/one-money-floor-2026-09-26

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

The full tmux suite on dev baa1dd7f2 passed 18 of 19. The one red, one_figure_on_every_spend_surface, is a real inconsistency the suite catches only when an interrupted turn spends less than $0.00005.

What a person saw. One Spending tab, one machine with one conversation:

 today              <$0.0001 of $500 · resets at midnight
 per day            $500 · $0.0000 today
 per conversation   no limit · this one $0.0000

The same spend is spelled two ways, and the second spelling is four zeros for money that was spent. The manual (screen.md, "A real amount is never drawn as zeros") promises <$0.0001 under a hundredth of a cent everywhere.

Why. The surface's money word (tui3's subCent, used by dollars and railFigure) has the floor. config.SpentFigure writes the receipts beside the limits, the headless run's footer, codeaf doctor and the notebook, and it kept a bare %.4f.

Now. The rule lives once, in config.SubCent with config.MoneyFloor. SpentFigure uses it, and tui3's subCent delegates to it. Figures at or above the floor are unchanged (TestTheMoneyFloorMovesNoFigureAboveIt).

Proof.

  • TestTheSpendingTabSaysOneTinyDayOneWay renders the tab's today row and both receipts for a tiny day. The receipt row added to TestAPositiveCostIsNeverDrawnAsZeros and the new <$0.0001 row in TestTheFooterWritesASpendTheWayEverythingElseDoes cover the other outputs. All three fail on the old code with the $0.0000 seen on screen.
  • make pr-ready: internal/tui3 (8 shards) and internal/config passed. cmd/codeaf had one red: TestTheChatsJudgeAsksWithTheKeyPastedAfterBoot failed on TempDir RemoveAll cleanup: directory not empty, because another test's leftover goroutine wrote under its CODEAF_HOME. That test is unrelated to this change and passes 8 of 8 alone.

🤖 Generated with Claude Code

AbirAbbas and others added 3 commits September 26, 2026 10:42
…ny day one way

After an interrupted turn that spent under a hundredth of a cent, the
Spending tab read `today <$0.0001` on one row and `$0.0000 today` and
`this one $0.0000` on the next two. The surface's own money word had a
floor; config.SpentFigure, which writes the receipts beside the limits and
the spend a headless run and doctor print, kept a bare four places. The rule
now lives once in internal/config and the surface reads it. The tmux suite's
one_figure_on_every_spend_surface caught it whenever the interrupted turn
spent that little.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit b58a750 into dev Sep 26, 2026
4 checks passed
@AbirAbbas
AbirAbbas deleted the fix/one-money-floor-2026-09-26 branch September 26, 2026 14:58
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