From 60069b14f6a28d76e64f0f3e0502f495ee2c9f56 Mon Sep 17 00:00:00 2001 From: fireshaper Date: Mon, 5 Oct 2026 12:02:57 -0400 Subject: [PATCH] Step 10M.5: CR-013 plan amendments and regression Co-Authored-By: Claude Opus 5.5 --- DECISIONS.md | 6 ++++++ memory-bank/change-requests/CR-001-faster-start.md | 6 +++++- .../change-requests/CR-010-veteran-pilot-profit-share.md | 4 ++++ memory-bank/change-requests/CR-012-lighter-clipper-range.md | 1 + memory-bank/implementation-plan.md | 3 ++- memory-bank/progress.md | 4 +++- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index 56155c4..1cb3e83 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1228,3 +1228,9 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md` - **"Twelve years" lives in the bio, not the sentence**: the CR's example sentence ("who's flown that Clipper for twelve years") is split so the sentence uses only names (veteran, ships, bay) and the bio carries the history, which also shows on the pilot card. - **The loan shown is `content.dealLoanAmount`**; before the deal the player has no loan in state, so "matching state" is tested as the offer equalling the balance the after-deal state reports. + +## Step 10M.5 + +- **Open balance issue, not changed here (needs a design call):** right after the deal a fresh player has ~890 cr, but fuelling both ships from Earth to the Moon costs ~921 cr (Courier 0.384 × 200 × 3 = 230; Clipper 0.384 × 600 × 3 = 691). So "dispatch the Courier and the Clipper at the same time" isn't possible on a fresh account without first earning more. The scripted check used a 1,000 cr developer top-up. Candidate fixes: more cash with the deal, a lower Clipper fuel rate, or a smaller Earth launch multiplier. +- **Short Clipper hops can lose money:** in the check, a Priority Mail job to the Moon paid 373 cr against 691 cr of fuel (pilot share 0). Another run (Medical Supplies) paid 1,083. The Clipper's 600 cr/M km fuel with Earth's ×3 launch cost makes Earth→Moon marginal; its payoff is long, fast legs. Left for the balance pass (Step 12.1). +- **The balance-script checks wait for the script** (Step 12.1), where the amended targets and the Lighter-first / Freighter-first policies are recorded. diff --git a/memory-bank/change-requests/CR-001-faster-start.md b/memory-bank/change-requests/CR-001-faster-start.md index 74df2b3..6815caf 100644 --- a/memory-bank/change-requests/CR-001-faster-start.md +++ b/memory-bank/change-requests/CR-001-faster-start.md @@ -22,8 +22,9 @@ This change keeps the employee opening but cuts it to about four quick runs, giv | First dispatch | Under 30 seconds from "Start your company" | | First real choice between contracts | Under 2 minutes | | Own a ship (deal accepted) | Under 10 minutes | -| Buy a second ship *(changed by CR-010; was: Hire first pilot)* | 30–45 minutes | +| Buy a ship from the Market *(changed by CR-013; was: Buy a second ship (CR-010), Hire first pilot)* | 45–75 minutes | | First discovery | Within 90 minutes | +| Loan paid off *(added by CR-013)* | Within roughly the first two sessions (under 4 hours of active play) | ### New opening, in order 1. Player taps "Start your company" and lands straight on the tutorial contract board with a two-line intro. @@ -100,6 +101,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5. 6. Pay off your loan. - **Test:** For each goal, a state summary just short of the condition reports it incomplete, and a summary that meets it reports it complete. Results are identical for identical inputs. - **Amended by CR-010:** Goal 4 "Hire your first pilot" is now "Fly a contract with [veteran's name]" (`veteran-contract`, Step 10J.3). +- **Amended by CR-013:** Goal 3 is "Buy a ship from the Market" (ships from the deal don't count) and goal 4 is "Complete a Priority contract" (Step 10M.2). ### Step 10A.6 — Schema and database - Add to the database: company loan balance; tutorial runs completed; a deal-accepted flag; claimed goals per player; the repayment amount on each dispatch record; the `purchasable` flag reflected wherever ship models are listed. @@ -123,6 +125,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5. - This replaces Step 6.7. Remove the old automatic tutorial-end rule and its tests. - **Test:** Accepting when available produces exactly that state: one owned Courier at Earth crewed by the avatar, one Earth bay, the configured loan balance, tutorial off, no loaner. Accepting when not available fails with no changes. Accepting twice fails the second time. Two simultaneous accepts produce exactly one deal. - **Amended by CR-010:** Accepting the deal also creates the veteran pilot at Earth, unassigned (decision 0.5.70, Step 10J.4). +- **Amended by CR-013:** The deal also creates the Clipper at Earth, crewed by the veteran; the loan is Courier + Clipper + Earth bay lease (Steps 10M.1, 10M.3). ### Step 10A.9 — Server: loan repayment - Resolution applies the repayment from Step 10A.4: reduce the loan balance, add only the net to credits, and store the repayment on the dispatch. @@ -150,6 +153,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5. - After accepting, go to HQ. - **Test:** Component test: the modal appears only when state says the deal is available; it shows the configured loan amount and share; the button calls accept and navigates to HQ. - **Amended by CR-010:** The deal modal lists the veteran by name with their bio line (Step 10J.5). +- **Amended by CR-013:** The modal lists the Courier, the Clipper, the Earth bay and the veteran, with the larger loan (Step 10M.4). ### Step 10A.14 — Client: loan on HQ - Replace the old "save up for your first ship" goal on HQ (Step 9.1) with the loan: balance, a paid-off progress bar, and a "Pay down" action with an amount input. diff --git a/memory-bank/change-requests/CR-010-veteran-pilot-profit-share.md b/memory-bank/change-requests/CR-010-veteran-pilot-profit-share.md index 509b979..c16445d 100644 --- a/memory-bank/change-requests/CR-010-veteran-pilot-profit-share.md +++ b/memory-bank/change-requests/CR-010-veteran-pilot-profit-share.md @@ -65,6 +65,7 @@ Record these in `DECISIONS.md` and `implementation-plan.md` §0.5. - Replace the GameConfig field "pilot pay per delivery (flat fee)" with "pilot profit share" (default 0.25, must be between 0 and 1). - Add a veteran pilot entry: name, short bio line, starting level (2), and starting skill allocation (Heavy Cargo 1). - **Test:** Config validates; the profit share is between 0 and 1. The veteran's starting skill allocation does not exceed the skill points a level-2 pilot has. The veteran's skill references an existing skill. +- **Amended by CR-013:** The veteran's starting skill is Expensive Cargo 1 (Step 10M.1). ### Step 10G.2 — Sim: profit-share pay - Replace the flat fee in dispatch resolution with the profit-share formula (decision 0.5.12) and apply the deduction order (decision 0.5.51). @@ -73,10 +74,12 @@ Record these in `DECISIONS.md` and `implementation-plan.md` §0.5. ### Step 10G.3 — Sim: goal change - Change goal 4 in the onboarding goals (CR-001 Step 10A.5) to "Fly a contract with the veteran": complete when any contract delivered by the veteran has resolved. - **Test:** The goal is incomplete when only the avatar has delivered and complete after one resolved contract flown by the veteran. A deadhead by the veteran does not complete it. +- **Amended by CR-013:** Goal 4 is now "Complete a Priority contract", by any pilot (Step 10M.2). ### Step 10G.4 — Server: veteran on the deal - Accepting the deal (CR-001 Step 10A.8) also creates the veteran per §2, in the same transaction. - **Test:** After accepting, state has exactly two pilots at Earth: the avatar crewing the Courier, and the veteran unassigned at level 2 with Heavy Cargo 1 and the correct number of unspent skill points. The veteran is not exempt from pilot pay. A failed or repeated accept creates no veteran. When the avatar must rest at Earth, the avatar can be unassigned and the veteran assigned to the Courier and dispatched immediately. +- **Amended by CR-013:** The veteran starts crewing the deal's Clipper, not unassigned (Step 10M.3). ### Step 10G.5 — Client: deal modal and pilot card - The deal modal (CR-001 Step 10A.13) lists the veteran by name with their bio line, for example "…and Rosa Kell, who's flown for me for twelve years." @@ -92,6 +95,7 @@ Record these in `DECISIONS.md` and `implementation-plan.md` §0.5. - Apply the amendments in §6 to `implementation-plan.md` and CR-001's text. - Run the full suite. - **Test:** CI is green. Manual check: on a fresh account, accept the deal and confirm the veteran is at Earth; fly the avatar until mandatory rest at Earth; swap in the veteran, take a Heavy contract the avatar couldn't, and confirm the summary shows the pilot share and goal 4 becomes claimable. +- **Amended by CR-013:** The rest-and-swap manual check is replaced by CR-013's: accept the deal on a fresh account, dispatch the Courier and the Clipper at the same time, and complete a Priority contract with the Clipper to unlock goal 4 (Step 10M.5). ## 6. Amendments diff --git a/memory-bank/change-requests/CR-012-lighter-clipper-range.md b/memory-bank/change-requests/CR-012-lighter-clipper-range.md index b272f98..91fa7b8 100644 --- a/memory-bank/change-requests/CR-012-lighter-clipper-range.md +++ b/memory-bank/change-requests/CR-012-lighter-clipper-range.md @@ -136,6 +136,7 @@ Record these in `DECISIONS.md` and `implementation-plan.md` §0.5. - Apply the amendments in §7 to `implementation-plan.md` and earlier change requests. - Run the full suite. - **Test:** CI is green. The balance script (once it exists) runs two policies, Lighter-first and Clipper-first for the second ship; both reach "own three ships" within 25% of each other's time. Manual check: buy a Clipper, discover Mars, deadhead or take work to Mars, then take a first-contact contract to Ceres from the Mars board on a date when it's in range. +- **Amended by CR-013:** The second-ship balance check (Lighter-first vs Clipper-first) is replaced by CR-013's first-purchase check: Lighter-first vs Freighter-first, both reaching "own four ships" within 25 % of each other's time (Step 10M.5). ## 7. Amendments diff --git a/memory-bank/implementation-plan.md b/memory-bank/implementation-plan.md index 3ac6d7a..2b04a76 100644 --- a/memory-bank/implementation-plan.md +++ b/memory-bank/implementation-plan.md @@ -671,7 +671,8 @@ Steps 10M.1–10M.5 are specified in `memory-bank/change-requests/CR-013-veteran - **Amended by CR-007:** The simulated player considers Priority contracts and skips ones its ships are too slow for. Re-check all timing targets; adjust content values, not thresholds. - **Amended by CR-009:** The simulated player may buy upgrades: when it can't yet afford its next planned ship, it buys the cheapest available upgrade on its most-used ship, preferring cargo bay and engines. Re-check all timing targets; adjust content values, not thresholds. - **Amended by CR-010:** Replace "first pilot hired between 30 and 45 minutes" with "second ship bought between 30 and 45 minutes". Add a check that the veteran flies at least one contract in the first session. Re-check all targets with profit-share pay; adjust content values, not thresholds. -- **Amended by CR-012:** The script runs two second-ship policies, Lighter-first and Clipper-first; both must reach "own three ships" within 25 % of each other's time. +- **Amended by CR-012:** The script runs two second-ship policies, Lighter-first and Clipper-first; both must reach "own three ships" within 25 % of each other's time. *(Replaced by CR-013, below.)* +- **Amended by CR-013:** The player starts with two ships (Courier and Clipper) and a 66,600 cr loan; re-check every timing target with them. Targets: first Market purchase 45–75 minutes, first discovery under 90 minutes, loan paid off in under 4 hours of active play. Run two first-purchase policies, Lighter-first and Freighter-first; both must reach "own four ships" within 25 % of each other's time. ### Step 12.2 — Revisit the tutorial economy test - Replace the placeholder average in the Step 2.5 test with the average tutorial payout measured by the balance script. diff --git a/memory-bank/progress.md b/memory-bank/progress.md index ddfe67b..363f26b 100644 --- a/memory-bank/progress.md +++ b/memory-bank/progress.md @@ -291,4 +291,6 @@ Spec: `memory-bank/change-requests/CR-013-veterans-clipper.md` (received as "CR- - [x] **Step 10M.2 — Sim: goal changes.** Goal 3 is now `market-ship` "Buy a ship from the Market" (condition `market-ships-bought` 1) and goal 4 `priority-contract` "Complete a Priority contract" (`priority-deliveries` 1, any pilot); the `veteran-contracts` condition is gone. `GoalProgress` gains `marketShipsBought` and `priorityDeliveries` (drops `veteranContracts`). Server: `ships.from_deal` (migration 0009, backfilling each player's first ship), set on the deal's ship; goal progress counts non-deal ships and resolved non-tutorial dispatches whose contract is Priority. Tests: sim (the deal's two ships don't complete goal 3, a bought Lighter does; Standard deliveries don't complete goal 4, a Priority one does), server goals (buying a Lighter; a Standard then a Priority delivery), web goal list ids. - [x] **Step 10M.3 — Server: deal creates the Clipper.** `acceptDeal` reads `config.deal` and inserts both deal ships at Earth (Courier, then Clipper, consecutive seeded names, `from_deal`), assigns the avatar to the Courier and the veteran to the Clipper (location follows the ship), sets the 66,600 cr loan. Tests: `deal.test.ts` (two crewed ships at Earth, one bay, the loan; two simultaneous accepts still give two ships, not four; refused and repeated accepts change nothing), `veteran.test.ts` (veteran crewing the Clipper, level 2, Expensive Cargo 1; the Courier and the Clipper dispatched at the same time, the veteran's run paying their profit share). - [x] **Step 10M.4 — Client: deal modal.** The modal shows both ship sprites and reads "Old Halvorsen is retiring. He'll sell you his Courier, his Clipper, and his Earth bay — and Rosa Kell, who flies that Clipper. Pay him back out of every job."; "You get" lists "A Courier for you, a Clipper for Rosa Kell, and a bay at Earth"; the Pilot row keeps name and bio. Ship, bay and pilot names come from content (`config.deal`, `veteranPilot`); the veteran's bio is now "Has flown Halvorsen's Clipper for twelve years." Tests (`deal-modal.test.tsx`): both ships, the veteran's name and bio, and the loan offered equal to the loan in the after-deal state. -- [ ] Step 10M.5 — Plan amendments and regression +- [x] **Step 10M.5 — Plan amendments and regression.** CR-013 §6 applied: CR-001 §2 targets (first Market purchase 45–75 min, loan payoff under 4 h) and Steps 10A.5, 10A.8, 10A.13; CR-010 Steps 10G.1, 10G.3, 10G.4, 10G.7 (manual check replaced); CR-012 Step 10I.11 (balance policies replaced); plan Step 12.1 (re-check targets with two ships and the larger loan; Lighter-first vs Freighter-first to "own four ships"). Full suite 941 passing. Scripted manual check on a fresh account: deal gives Courier (avatar) + Clipper (Rosa Kell, Expensive Cargo 1) and a 66,600 cr loan; goals 3 and 4 incomplete; Courier and Clipper in flight at the same time (Clipper on a Priority Mail job to the Moon); on delivery goal 4 is ready. **Needed a 1,000 cr developer top-up:** after the deal the player has ~890 cr, and fuel for both ships Earth→Moon is ~921 cr (Courier 230 + Clipper 691). + +**Phase 10M complete — waiting for review.**