Skip to content

Keep bank and tavern rows off the ledger until they count something - #272

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/ledger-hide-zero-rows
Nov 11, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
feature/ledger-hide-zero-rows

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Home._statsLines now shows the Money Made From Interest, Times Gotten Drunk and Money Lost Gambling rows only when they are non-zero. This is the rule Money Lost While Drunk and _careerBlock already follow. The ledger (progression.JOURNAL, 15 hours of fishing) usually opens before the bank and the tavern are revealed, so the zero rows named places the player hadn't been shown yet.
  • The four rows stay in the same order and format once they have something to count.
  • README See Stats paragraph updated to say the bank and tavern rows are revealed the same way.

Closes #271

Skipped issues

Test plan

  • Full suite run headlessly with dummy SDL drivers: 1112 passed
  • New test test_displayStats_omits_bank_and_tavern_rows_until_they_count_something fails with the home.py fix stashed and passes with it restored
  • test_displayStats_bank_and_tavern_rows_keep_their_order_once_earned pins the order and format of the rows
  • The existing dollar-sign test asserted Times Gotten Drunk: 0, a zero row that is now hidden. It was updated to a non-zero count (7).
  • black --check is clean on the changed Python files
  • CI green on the PR head

No protected paths are touched (no schema, save-manager, reader/writer or workflow changes).

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

dmccoystephenson and others added 2 commits November 10, 2026 22:33
The journal unlocks after 15 hours of fishing, usually before the bank
and the tavern, yet the ledger always listed interest, drinking and
gambling at zero - naming places the player hadn't been shown. Those
rows now follow the same skip-the-zero rule as Money Lost While Drunk
and the career blocks.

Closes #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The account's starting cent earns a rounded-up dollar every night, so
moneyMadeFromInterest is non-zero long before the bank unlocks and the
skip-the-zero rule alone brought the row back after the first sleep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (head after commit 2, CI test + docker green):

  • Scope: PASS. Three files: src/location/home.py (the fix), tests/location/test_home.py (tests), README.md (the See Stats sentence). There is no unrelated churn.
  • Tests-new: PASS. No new public method. _statsLines behaviour is covered by two new tests and one updated test.
  • Tests-fix: PASS. This was checked by stashing the fix and running the test. With the fix stashed, test_displayStats_omits_bank_and_tavern_rows_until_they_count_something failed against main, and it also failed against commit 1's nonzero-only version. It passes with the fix restored.
  • Sibling structure: PASS. The (label, value, format) list with a skip-on-falsy loop mirrors _careerBlock in the same file.
  • Sibling renames: PASS. Nothing was renamed.
  • Docs: PASS. The README See Stats paragraph now names the bank and tavern rows. Schemas, PLANNING and version.txt are unaffected, because nothing persisted changed.
  • Issue resolution: PASS. All three rows named in Ledger lists interest, drinking and gambling rows at zero before the bank and tavern are revealed #271 are now gated.
  • CI: PASS. test and docker are green on the PR head. Locally, 1112 passed under the dummy SDL drivers.
  • Schema-sync: PASS, not applicable. No persisted field changed.
  • Money-format: PASS. The $%d formats are kept as they were. All three money totals accumulate ints (ceil interest, int(amount) bets, int(...) drunk losses).
  • Deterministic-tests: PASS. The new tests involve no randomness.
  • Headless-pygame: PASS, not applicable.
  • camelCase: PASS. The only new local is interest.

FAIL found and fixed in commit 2: the first version gated the interest row on non-zero only. moneyInBank starts at $0.01, and ceil(0.01 * 0.02) credits $1 a night from day one, so the row came back after the first sleep while the bank was still hidden. The row now also waits for progression.BANK, and the regression test uses a journal-only player with $3 of accrued interest. The free dollar itself is a separate gameplay question and is filed as #273 rather than changed here.

Judgment call left visible: a player who has the bank unlocked but has earned $0 interest also has no interest row. That matches the skip-the-zero rule used everywhere else on the ledger.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit a4e9228 into main Nov 11, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/ledger-hide-zero-rows branch November 11, 2026 05:40
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.

Ledger lists interest, drinking and gambling rows at zero before the bank and tavern are revealed

1 participant