Skip to content

Keep crew ashore on the payroll after the last boat is sold - #243

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/pay-crew-ashore-without-a-fleet
Oct 30, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/pay-crew-ashore-without-a-fleet

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • src/business/boats.py — runDailyProduction no longer returns early on an empty fleet. Its guard is now just player.workers <= 0, so crew left ashore by selling the last boat are charged wages and walk off when unpaid, like any other idle hand. With no boats there is nothing to earn, so the boat loop simply does nothing.
  • src/location/docks.py — manageFleet now offers "Dismiss a Worker" when the fleet is empty but crew are still hired (an elif after the boats block, so the menu order with boats is unchanged). Before this, those crew could not be let go from the fleet menu.

The intended behaviour was already stated in the sale message ("still on the payroll until you give them another berth or let them go"), needsAttention ("ashore on full wages"), the runDailyProduction docstring and README (Boats section). Only the code disagreed.

One visible consequence: on a night with crew ashore and no boats, the overnight report reads "Overnight the fleet brought in nothing, and paid $N in wages." That is the existing describeDay wording for a wages-only day.

Closes #242

Test plan

  • tests/business/test_boats.py: new tests check that crew ashore after the last sale draw wages (summary, money, totalWagesPaid) and that the named hand walks off when unpaid.
  • tests/location/test_docks.py: Dismiss is reachable from manageFleet after the last boat is sold. A guard test checks that an empty fleet with no crew still shows only Buy / Back.
  • Stash-and-run: with the src/ changes stashed, the three regression tests fail; restored, they pass.
  • Full suite with dummy SDL drivers: 1069 passed (1065 on main + 4 new).
  • black --check clean on all four changed files.
  • No changes to persisted fields, schemas/*.json, *JsonReaderWriter or saveFileManager.py.

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

Selling the last boat left her crew hired, but runDailyProduction
returned early on an empty fleet, so they drew no wages and never
walked off, and the fleet menu hid "Dismiss a Worker" behind the
same check. Charge wages whenever anyone is hired, and offer Dismiss
with no fleet, as the sale message, needsAttention and the README
already promised.

Closes #242

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

Copy link
Copy Markdown
Member Author

Self-review rubric (head 53a2e5d, CI test + docker green on that SHA):

  • Scope: PASS. Two source files changed: runDailyProduction's guard and an elif branch in manageFleet. These are the two causes named in Crew left ashore after the last boat is sold draw no wages and can't be dismissed #242. The two test files hold only the new tests.
  • Tests-new: PASS. No new public functions. The behaviour changes are covered by 4 new tests: 2 in test_boats.py, plus the Dismiss reachability test and a no-crew guard test in test_docks.py.
  • Tests-fix: PASS. Run empirically: with src/business/boats.py and src/location/docks.py stashed, the three regression tests failed (3 failed, 214 passed). With them restored, all pass. The guard test passes either way by design.
  • Sibling structure: PASS. The tests follow the # prepare / # call / # check layout and the label-driven fleetChooser helper that sibling manageFleet tests use.
  • Sibling renames: PASS. Nothing was renamed.
  • Docs: PASS. README (Boats section) already says crew from a sold boat "stay on the payroll until you give them another berth or let them go". The code now matches. No schema, PLANNING or version change applies.
  • Issue resolution: PASS. Both surfaces in Crew left ashore after the last boat is sold draw no wages and can't be dismissed #242 are changed: wages and walk-off with an empty fleet, and Dismiss reachable with an empty fleet.
  • CI: PASS. gh pr checks 243 shows test pass (1m20s) and docker pass.
  • Schema-sync: PASS (n/a). No persisted field was added or changed.
  • Money-format: PASS (n/a). No new money display.
  • Deterministic-tests: PASS. The no-boat path never reaches the random-using role handlers, so the new tests have no randomness to patch.
  • Headless-pygame: PASS (n/a). No pygame code was touched.
  • camelCase: PASS. No new identifiers.

Judgment calls, folded in here rather than anchored inline:

  • src/business/boats.py:478-480: on a night with crew ashore and no boats, the stats block now also increments stats.daysInBusiness, which is shown as "Days in Business" on the home stats screen. This was left as is, since the business is still carrying a payroll that day. It is a behaviour change worth knowing about, though.
  • src/business/boats.py:557: the overnight report for such a night reads "Overnight the fleet brought in nothing, and paid $N in wages." Strictly there is no fleet. The existing wages-only wording was kept rather than adding a fleetless variant in this PR.
  • The walk-off order in _shedCrew (unnamed hands, then idle named crew) already handles an empty fleet, so no change was needed there.

Overall: a narrow fix aligning the code with what the sale message, needsAttention and README already promise. Ready to merge on green CI.

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 77b6482 into main Oct 30, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/pay-crew-ashore-without-a-fleet branch October 30, 2026 03:22
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.

Crew left ashore after the last boat is sold draw no wages and can't be dismissed

1 participant