spend: one floor for a sub-cent figure, so the Spending tab says a tiny day one way - #1542
Merged
Merged
Conversation
…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>
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.
The full tmux suite on dev
baa1dd7f2passed 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:
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.0001under a hundredth of a cent everywhere.Why. The surface's money word (
tui3'ssubCent, used bydollarsandrailFigure) has the floor.config.SpentFigurewrites the receipts beside the limits, the headless run's footer,codeaf doctorand the notebook, and it kept a bare%.4f.Now. The rule lives once, in
config.SubCentwithconfig.MoneyFloor.SpentFigureuses it, andtui3'ssubCentdelegates to it. Figures at or above the floor are unchanged (TestTheMoneyFloorMovesNoFigureAboveIt).Proof.
TestTheSpendingTabSaysOneTinyDayOneWayrenders the tab'stodayrow and both receipts for a tiny day. The receipt row added toTestAPositiveCostIsNeverDrawnAsZerosand the new<$0.0001row inTestTheFooterWritesASpendTheWayEverythingElseDoescover the other outputs. All three fail on the old code with the$0.0000seen on screen.make pr-ready:internal/tui3(8 shards) andinternal/configpassed.cmd/codeafhad one red:TestTheChatsJudgeAsksWithTheKeyPastedAfterBootfailed onTempDir RemoveAll cleanup: directory not empty, because another test's leftover goroutine wrote under itsCODEAF_HOME. That test is unrelated to this change and passes 8 of 8 alone.🤖 Generated with Claude Code