Skip to content

Don't advance the clock on the turn that ends the run - #269

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/quit-does-not-tick
Nov 8, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/quit-does-not-tick

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • _runGameLoop no longer calls timeService.increaseTime() on the iteration whose location returned LocationType.NONE (quitting from Home or the Docks, or retiring). Leaving the game is no longer counted as an hour spent, and a day can no longer roll over on that turn, so its news is no longer saved on a prompt that is never shown again.
  • The rest of that iteration is unchanged: milestones, unlocks and the goal announcement are still evaluated, and the game is still saved.
  • The three tests that relied on the tick running on the quitting iteration (test_play_appends_eviction_message, test_play_appends_the_overnight_fleet_report, test_play_appends_the_fleet_report_and_the_eviction_together) now run one ordinary turn before quitting, as the issue's test note suggested.

Closes #267

Test plan

  • New test_play_does_not_advance_the_clock_on_quitting, test_play_does_not_drop_a_day_report_on_quitting and test_play_ticks_every_turn_before_the_one_that_ends_the_run were confirmed to fail with the src/fishE.py change stashed (3 failed) and to pass with it restored.
  • Full suite run headlessly with dummy SDL drivers: 1106 passed locally.
  • black --check passes on both changed files.
  • README and PLANNING.md contain no claim about quitting or the per-action clock that this changes.

Skipped issues

No protected paths are modified by this PR.

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

Quitting or retiring ran the hourly tick, so each load-then-quit cost
an in-game hour and a day rolled at 07:00 was saved with its report on
a prompt never shown again. Skip the tick once running is cleared.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (CI green on head: test 1m18s, docker 21s):

  • Scope: PASS — only src/fishE.py (the guarded tick) and tests/test_fishE.py change; both are needed for Quitting advances the clock and can drop a day's report #267.
  • Tests-new: PASS — no new public functions; the changed loop branch is exercised by three new tests.
  • Tests-fix: PASS — with src/fishE.py stashed, the three new tests failed (3 failed); with it restored, they passed. Full suite: 1106 passed locally.
  • Sibling structure: PASS — new tests follow the createGameForPlay() factory and # prepare / # call / # check layout of their neighbours.
  • Sibling renames: PASS — nothing renamed.
  • Docs: PASS — README and PLANNING.md make no claim about quitting or the per-action clock (scanned for quit, hour, every action); no schema or persisted field changes.
  • Issue resolution: PASS — the "Expected" branch "leaving the game does not advance the clock" is implemented at the cited src/fishE.py tick. The three tests named in the issue's test note were reworked into two-iteration setups.
  • CI: PASS — both checks green on the PR head.
  • Schema-sync: PASS (not applicable) — no persisted fields touched.
  • Money-format: PASS (not applicable) — no money displays added.
  • Deterministic-tests: PASS — the new tests use a mocked timeService and no randomness.
  • Headless-pygame: PASS (not applicable) — no pygame code path touched.
  • camelCase: PASS — no new identifiers outside test names, which follow the existing test_play_* style.

src/fishE.py:301 — judgement note: the milestone, unlock and goal blocks still run on the quitting iteration and append to a prompt that is not shown again. Quitting changes no stats, so it cannot earn a milestone. A second unlock queued by the previous action (one is announced per screen) would still be marked unlocked there, and its announcement lost. That is a narrow, pre-existing edge outside #267, so it was left alone here.

retire() (src/location/home.py:294) was checked as well: it does not depend on the hourly tick, so skipping the tick on the retiring turn changes nothing there.

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 e96610f into main Nov 8, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/quit-does-not-tick branch November 8, 2026 05:38
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.

Quitting advances the clock and can drop a day's report

1 participant