Skip to content

Report and count unnamed hands lost on a captained voyage - #278

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/count-unnamed-hands-lost-on-voyage
Nov 13, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/count-unnamed-hands-lost-on-voyage

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • adventures.finishVoyage now records unnamed legacy hands who didn't come back as summary["handsLost"], and adds them to stats.crewLostToPiracy (the ledger's "Crew Lost at Sea" row) alongside named villagers.
  • Docks._voyageReport reads that count back next to any names ("Owen Brackish and 2 unnamed hands did not come back"). A voyage that lost only unnamed hands is therefore no longer reported as "all hands accounted for". .get("handsLost", 0) keeps hand-built summaries working.
  • No persisted fields, schemas or reader/writers are touched.

Closes #277

Skipped open issues

Test plan

  • New tests/business/test_adventures.py tests: the summary and the stats count unnamed hands lost, and a voyage with everyone home counts 0.
  • New tests/location/test_docks.py tests: singular "1 unnamed hand", named and unnamed losses together in the plural, and a real finishVoyage summary fed into the report.
  • Stash check: with the source changes stashed, all 5 new tests fail. With the changes restored, they pass.
  • Full suite run locally under the dummy SDL drivers: 1121 passed.
  • black --check passes on all four changed files.

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

finishVoyage took lost unnamed legacy hands off the boat and the
headcount but left them out of the summary, so the homecoming report
said "all hands accounted for" and the ledger's Crew Lost at Sea row
missed them. Carry the count as summary["handsLost"], add it to
crewLostToPiracy, and read it back beside any names in the report.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 43368602435: test and docker both pass, 1121 tests passed):

  • Scope: PASS. Only src/business/adventures.py (summary field and stats count), src/location/docks.py (report line) and their mirrored test files are changed, and each change is needed for An unnamed hand lost on a captained voyage is reported as "all hands accounted for" and not counted on the ledger #277.
  • Tests-new: PASS. No new public functions were added. The new handsLost summary key is covered by 2 adventures tests and 3 docks tests.
  • Tests-fix: PASS. With the two source files stashed, all 5 new tests failed. With the stash popped, all 5 passed.
  • Sibling structure: PASS. The new tests follow the neighbouring # prepare / # call / # check layout and reuse createVoyage / createSailingDocks.
  • Sibling renames: PASS. Nothing is renamed.
  • Docs: PASS. The README has no line about the homecoming crew line or the "Crew Lost at Sea" row. No schema changes, because handsLost is a transient summary key and is never persisted. PLANNING.md and version.txt are not affected.
  • Issue resolution: PASS. Both surfaces named in An unnamed hand lost on a captained voyage is reported as "all hands accounted for" and not counted on the ledger #277 are changed: the report (docks.py) and the ledger count (adventures.py).
  • CI: PASS. Green on the PR head.
  • Schema-sync: PASS (not applicable). No persisted field changed.
  • Money-format: PASS (not applicable). No money displays were added.
  • Deterministic-tests: PASS. The new tests call loseCrew on voyages with no names, which takes the deterministic hands -= 1 branch and never reaches random.choice.
  • Headless-pygame: PASS (not applicable).
  • camelCase: PASS. handsLost and lost follow the existing naming.

Notes found outside the diff, with no change made:

  • src/business/adventures.py:672: the stat is still called crewLostToPiracy, although it now counts every loss at sea (it already counted named crew lost to starvation and sickness). Renaming it would touch the protected statsJsonReaderWriter/schema, so it is left alone.
  • src/location/docks.py:956: when the crew runs out on a foundered voyage, the report still says "The hull gives". That is already tracked in A voyage that loses its whole crew is reported as a hull failure and comes home at 92 damage #276 and is out of scope here.

Every rubric item passes after an adversarial read. The one judgment call is the wording "N unnamed hand(s)", which matches how the docks crew menus already refer to legacy hands ("Put an unnamed hand aboard", "%d unnamed hand(s)", docks.py:382,550,557).

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


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit b0ea3cd into main Nov 13, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/count-unnamed-hands-lost-on-voyage branch November 13, 2026 04: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.

An unnamed hand lost on a captained voyage is reported as "all hands accounted for" and not counted on the ledger

1 participant