orbit/.pi/goals/archived/goal_2026092020063121_mu9xz...

133 lines
18 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"version": 3,
"id": "mu9xzeqf-e5m5ej",
"objective": "Turn the job board's offline `bounty` category into a live **BOUNTY HUNT** side quest: a level-2+ contract posted only in Neutral systems that sends the ship on a strictly sequential 3-waypoint patrol of a pirate leader's known travel lanes, resolving to a hidden-bounty encounter chain (20% at waypoint 1 → else 20% at waypoint 2 → else guaranteed at waypoint 3, with an independent 50% raiders-only skirmish rolled on each pre-bounty leg), culminating in a rolling wave of 9 (8 frame-0 raiders + the named bounty flying its story's frame 1–7 craft at double health / double damage); killing the bounty halts all further deployments, auto-checks the remaining waypoints, and completes the contract for claim — backed by 20 written Neutral leader dossiers, data-driven so levels 6+ can be extended later.\n\nSUCCESS CRITERIA (observable evidence)\n1. Board: a BOUNTY HUNT row appears on Neutral system boards; below combat level 2 it renders greyed/LOCKED with \"REQUIRES LEVEL 2\" and its accept is refused by the scene; at level 2+ it accepts normally. Faction (Apex/MindWeave/Zenith) boards never draw one, and their pool stays a documented empty stub.\n2. Contract readout shows the dossier — title, issuer, wanted leader (name/epithet/crime), payout CR + XP, waypoint progress (\"WAYPOINT 1 OF 3 LOGGED\") — and nowhere reveals which waypoint holds the bounty or a raid wave (no red contact beacon, no contact count line, no spoiler string).\n3. Route: exactly 3 waypoints, built through the existing seeded tether-safe route builder; only the next waypoint in sequence can be logged, and compass/beacon point at that one only.\n4. Encounter chain matches spec over a seeded distribution test: bounty at wp1 ≈20%, wp2 ≈16% (i.e. 20% of the remainder), wp3 = every remaining contract; each pre-bounty leg independently rolls 50% for a raid wave; no raid wave rolls on the bounty leg or after resolution.\n5. Waves: pre-bounty skirmish = one rolling wave, 6 frame-0 raiders, 3 concurrent (replace-per-kill). Bounty engagement = one rolling wave of 9, 3 concurrent — exactly 8 raiders plus 1 elite of the dossier's declared frame (frames 1–7), deployed with the opening group, carrying ×2 hull/shields and ×2 weapon damage, visually distinguished and named in the toast/comms.\n6. Termination: killing the elite stops all further deployments/replacements; surviving on-screen fighters stay hostile and must be killed; when the last one drops, the contract is COMPLETE, every unvisited waypoint is checked off, no further waves fire, and the claim pays credits + XP exactly once (idempotent). Dying or leaving mid-fight re-arms the same engagement at that waypoint (the combatDone precedent).\n7. Patrol missions are untouched: patrol generation, any-order check-ins, contact markers/waves, XP and claims all still pass their existing tests.\n8. Verification evidence exists: `node dev/bounty-hunts.test.mjs` plus every pre-existing `dev/*.test.mjs` pass clean, and an in-browser run (dev server) is recorded with the accepted → locked → hunt → bounty kill → claim path exercised.\n\nBOUNDARIES\nIn scope: data/sidequests.json (bounty category + 20 Neutral dossiers + UI copy), js/quests/SideQuests.js (availability, posting fields, plan derivation, wave scripts, XP, completion rule, SideQuestState record normalization/save), the minimal combat seam for a buffed elite unit and \"stop deployments, keep survivors alive\" (js/combat/Waves.js, CombatSystem.js, EnemyShip.js if needed), js/scenes/GameScene.js hunt wiring, js/ui/JobBoardWindow.js row/dossier/locked states, dev tests, docs/PROJECT_NOTES.md entry.\nOut of scope: faction-voice bounty hunt copy; level 6+ difficulty tuning (data band stubbed, not tuned); new art/audio assets; the delivery and escort categories; reworking patrol rules or its encounter odds; save-format migrations beyond additive route fields; git commits (Brian commits).\n\nCONSTRAINTS\n- Plain ES6 modules, no build step, no packages; third-party stays vendored. Tunable numbers, copy, colors, odds and the 20 dossiers live in data/*.json — code owns behavior only, with config fallbacks so a missing key never throws.\n- Determinism: all draws ride labelled Rng.derive(seed, 'sidequests', <sysId>, 'bounty', <slot>/…) forks; the plan is rolled at accept and fixed on the route record (\"a signed contract is a signed contract\") — re-tuning data never re-rolls a standing contract.\n- Scenes stay thin (no balance numbers in js/scenes/); pure rules exported for Node tests; layers follow docs/PROJECT_NOTES.md.\n- The bounty plan is player-hidden: no UI, map marker, compass entry or toast exposes which leg holds the bounty or a raid wave before it fires.\n- Old saves and old ledgers must load (additive fields only); patrol path stays byte-for-byte behaviorally identical.\n- Reuse existing seams (buildPatrolRoute, CombatSystem.startWaves/cancelWaves, XpManager 'sidequest' grant) rather than duplicating combat or ledger machinery.\n\nVERIFICATION CONTRACT\n- `node dev/bounty-hunts.test.mjs` passes: level gate, Neutral-only availability, locked-posting shape, 20-dossier pool integrity (unique leaders, frames spread across 1–7 and all valid vs data/combat.json enemyTypes), seeded distribution (20/16/64 + 50% skirmish on pre-bounty legs only), determinism across calls/restarts, route-record save round-trip (toJSON/fromJSON preserves the plan), wave-script shapes (skirmish 6/3 raiders; bounty total 9 / concurrent 3 / 8 raiders + 1 elite of the dossier frame with ×2 scales), XP payout, sequential waypoint rule, and completion only via bounty kill.\n- All pre-existing dev tests still pass (`for f in dev/*.test.mjs; do node \"$f\"; done`) — patrol's suite is the regression guard for the shared code.\n- In-browser evidence via `node dev/server.mjs` + the existing CDP/dev-check pattern: locked row at level 1, hunt posted and accepted at level 2+, sequential check-ins, a wp1 bounty and a wp3-guaranteed case, elite buff (visible double tank/damage), no-more-waves-after-kill, completion + single claim.\n- grep confirms no bounty waypoint/index leaks into board/compass/toast copy, and re-read the spec above to confirm every numbered item is addressed before marking tasks done.\n\nIF BLOCKED: stop and ask the user (no silent scope cuts, no committing). Notable risk to flag rather than work around quietly: any combat-engine change that would alter patrol or sandbox fight behavior.",
"status": "paused",
"autoContinue": false,
"usage": {
"tokensUsed": 2268421,
"activeSeconds": 32892
},
"sisyphus": false,
"revision": 545,
"createdAt": "2026-09-20T14:59:15.159Z",
"updatedAt": "2026-09-21T02:06:53.246Z",
"scheduler": {
"version": 1,
"owner": "01a0bf31-2d52-7483-b17d-490a1e3debc8",
"generation": "e3ef3ae6-f23a-4b29-9178-c86a8cb868fa",
"used": 7,
"phase": "idle",
"repairUsed": false
},
"taskList": {
"tasks": [
{
"id": "task-1",
"title": "Data contract: enable + spec the BOUNTY HUNT category (data/sidequests.json)",
"status": "complete",
"evidence": "data/sidequests.json parses (node JSON.parse + python json). categories.bounty = {enabled:true,label:\"BOUNTY HUNT\",accent:#ff2d6f,minLevel:2,contexts:[\"neutral\"]}; sidequests.bounty rules block: waypo",
"completedAt": "2026-09-20T15:34:27.959Z"
},
{
"id": "task-2",
"title": "20 Neutral pirate-leader dossiers (data/sidequests.json → descriptions.neutral.bounty)",
"status": "complete",
"evidence": "descriptions.neutral.bounty = 20 dossiers (Vanturi, Halvardson, Ondaine, Spidleau sisters, Drumm, Vane, Sekh, Marlowe, Nkemdi, Costa, Dax, Ferreira, Adu, Bellamy, Vowell, Fisk, Tui, Vance, Vohl, Alkan",
"completedAt": "2026-09-20T15:34:27.959Z"
},
{
"id": "task-3",
"title": "Model: availability, postings, plan derivation, scripts, completion (js/quests/SideQuests.js)",
"status": "complete",
"evidence": "SideQuests.js: context/level gating (enabledSideQuestCategories('faction')=['patrol'], sideQuestAcceptable locked below lvl2), dossier postings with per-board dedupe, deriveBountyPlan (seeded fork, bo",
"completedAt": "2026-09-20T17:05:25.435Z"
},
{
"id": "task-4",
"title": "Combat seam: buffed elite unit + halt-deployments termination (js/combat/Waves.js, CombatSystem.js, EnemyShip.js)",
"status": "complete",
"evidence": "Waves.js normalizeWave preserves elite {type,healthScale,damageScale,name}; resolveRoster puts exactly ONE mark at the head of the spawn order (its weight removed from the escort draw) — non-elite wav",
"completedAt": "2026-09-20T17:43:03.432Z"
},
{
"id": "task-5",
"title": "Scene wiring: accept, sequential check-ins, engagement chain, completion + claim (js/scenes/GameScene.js)",
"status": "complete",
"evidence": "GameScene: onKill hands the enemy to handleCombatKill (elite-only witness → haltWaves + bountyDown); _establishBountyHunt rolls plan→route (buildPatrolRoute opts {waypoints:[legs,legs], fork:'bounty'}",
"completedAt": "2026-09-20T20:27:38.321Z"
},
{
"id": "task-6",
"title": "Board UI: dossier readout, locked state, spoiler-free progress (js/ui/JobBoardWindow.js)",
"status": "complete",
"evidence": "JobBoardWindow.js: _rowState 'locked'; greyed row + LOCKED — REQUIRES LEVEL {level} badge (fillLevel); dossier block (WANTED/epithet/CHARGES/CRAFT) via ui.dossier* with dynamic body-line cap; hunt rou",
"completedAt": "2026-09-20T22:01:54.071Z"
},
{
"id": "task-7",
"title": "Verification suite + docs (dev/bounty-hunts.test.mjs, run all dev tests, in-browser check, docs/PROJECT_NOTES.md)",
"status": "pending"
}
],
"blockCompletion": true,
"proposedAt": "2026-09-21T01:52:04.548Z"
},
"currentTaskId": "task-7",
"stopReason": "user",
"archivedPath": ".pi/goals/archived/goal_2026092020063121_mu9xzeqf-e5m5ej.md"
}
# Goal Prompt
Turn the job board's offline `bounty` category into a live **BOUNTY HUNT** side quest: a level-2+ contract posted only in Neutral systems that sends the ship on a strictly sequential 3-waypoint patrol of a pirate leader's known travel lanes, resolving to a hidden-bounty encounter chain (20% at waypoint 1 → else 20% at waypoint 2 → else guaranteed at waypoint 3, with an independent 50% raiders-only skirmish rolled on each pre-bounty leg), culminating in a rolling wave of 9 (8 frame-0 raiders + the named bounty flying its story's frame 1–7 craft at double health / double damage); killing the bounty halts all further deployments, auto-checks the remaining waypoints, and completes the contract for claim — backed by 20 written Neutral leader dossiers, data-driven so levels 6+ can be extended later.
SUCCESS CRITERIA (observable evidence)
1. Board: a BOUNTY HUNT row appears on Neutral system boards; below combat level 2 it renders greyed/LOCKED with "REQUIRES LEVEL 2" and its accept is refused by the scene; at level 2+ it accepts normally. Faction (Apex/MindWeave/Zenith) boards never draw one, and their pool stays a documented empty stub.
2. Contract readout shows the dossier — title, issuer, wanted leader (name/epithet/crime), payout CR + XP, waypoint progress ("WAYPOINT 1 OF 3 LOGGED") — and nowhere reveals which waypoint holds the bounty or a raid wave (no red contact beacon, no contact count line, no spoiler string).
3. Route: exactly 3 waypoints, built through the existing seeded tether-safe route builder; only the next waypoint in sequence can be logged, and compass/beacon point at that one only.
4. Encounter chain matches spec over a seeded distribution test: bounty at wp1 ≈20%, wp2 ≈16% (i.e. 20% of the remainder), wp3 = every remaining contract; each pre-bounty leg independently rolls 50% for a raid wave; no raid wave rolls on the bounty leg or after resolution.
5. Waves: pre-bounty skirmish = one rolling wave, 6 frame-0 raiders, 3 concurrent (replace-per-kill). Bounty engagement = one rolling wave of 9, 3 concurrent — exactly 8 raiders plus 1 elite of the dossier's declared frame (frames 1–7), deployed with the opening group, carrying ×2 hull/shields and ×2 weapon damage, visually distinguished and named in the toast/comms.
6. Termination: killing the elite stops all further deployments/replacements; surviving on-screen fighters stay hostile and must be killed; when the last one drops, the contract is COMPLETE, every unvisited waypoint is checked off, no further waves fire, and the claim pays credits + XP exactly once (idempotent). Dying or leaving mid-fight re-arms the same engagement at that waypoint (the combatDone precedent).
7. Patrol missions are untouched: patrol generation, any-order check-ins, contact markers/waves, XP and claims all still pass their existing tests.
8. Verification evidence exists: `node dev/bounty-hunts.test.mjs` plus every pre-existing `dev/*.test.mjs` pass clean, and an in-browser run (dev server) is recorded with the accepted → locked → hunt → bounty kill → claim path exercised.
BOUNDARIES
In scope: data/sidequests.json (bounty category + 20 Neutral dossiers + UI copy), js/quests/SideQuests.js (availability, posting fields, plan derivation, wave scripts, XP, completion rule, SideQuestState record normalization/save), the minimal combat seam for a buffed elite unit and "stop deployments, keep survivors alive" (js/combat/Waves.js, CombatSystem.js, EnemyShip.js if needed), js/scenes/GameScene.js hunt wiring, js/ui/JobBoardWindow.js row/dossier/locked states, dev tests, docs/PROJECT_NOTES.md entry.
Out of scope: faction-voice bounty hunt copy; level 6+ difficulty tuning (data band stubbed, not tuned); new art/audio assets; the delivery and escort categories; reworking patrol rules or its encounter odds; save-format migrations beyond additive route fields; git commits (Brian commits).
CONSTRAINTS
- Plain ES6 modules, no build step, no packages; third-party stays vendored. Tunable numbers, copy, colors, odds and the 20 dossiers live in data/*.json — code owns behavior only, with config fallbacks so a missing key never throws.
- Determinism: all draws ride labelled Rng.derive(seed, 'sidequests', <sysId>, 'bounty', <slot>/…) forks; the plan is rolled at accept and fixed on the route record ("a signed contract is a signed contract") — re-tuning data never re-rolls a standing contract.
- Scenes stay thin (no balance numbers in js/scenes/); pure rules exported for Node tests; layers follow docs/PROJECT_NOTES.md.
- The bounty plan is player-hidden: no UI, map marker, compass entry or toast exposes which leg holds the bounty or a raid wave before it fires.
- Old saves and old ledgers must load (additive fields only); patrol path stays byte-for-byte behaviorally identical.
- Reuse existing seams (buildPatrolRoute, CombatSystem.startWaves/cancelWaves, XpManager 'sidequest' grant) rather than duplicating combat or ledger machinery.
VERIFICATION CONTRACT
- `node dev/bounty-hunts.test.mjs` passes: level gate, Neutral-only availability, locked-posting shape, 20-dossier pool integrity (unique leaders, frames spread across 1–7 and all valid vs data/combat.json enemyTypes), seeded distribution (20/16/64 + 50% skirmish on pre-bounty legs only), determinism across calls/restarts, route-record save round-trip (toJSON/fromJSON preserves the plan), wave-script shapes (skirmish 6/3 raiders; bounty total 9 / concurrent 3 / 8 raiders + 1 elite of the dossier frame with ×2 scales), XP payout, sequential waypoint rule, and completion only via bounty kill.
- All pre-existing dev tests still pass (`for f in dev/*.test.mjs; do node "$f"; done`) — patrol's suite is the regression guard for the shared code.
- In-browser evidence via `node dev/server.mjs` + the existing CDP/dev-check pattern: locked row at level 1, hunt posted and accepted at level 2+, sequential check-ins, a wp1 bounty and a wp3-guaranteed case, elite buff (visible double tank/damage), no-more-waves-after-kill, completion + single claim.
- grep confirms no bounty waypoint/index leaks into board/compass/toast copy, and re-read the spec above to confirm every numbered item is addressed before marking tasks done.
IF BLOCKED: stop and ask the user (no silent scope cuts, no committing). Notable risk to flag rather than work around quietly: any combat-engine change that would alter patrol or sandbox fight behavior.
## Progress
- Status: paused
- Auto-continue: off
- Sisyphus mode: no
- Time spent: 9h08m12s
- Tokens used: 2.3M (2,268,421) tokens
## Tasks
<!-- blockCompletion: true -->
- [x] task-1: Data contract: enable + spec the BOUNTY HUNT category (data/sidequests.json) — evidence: data/sidequests.json parses (node JSON.parse + python json). categories.bounty = {enabled:true,label:"BOUNTY HUNT",accent:#ff2d6f,minLevel:2,contexts:["neutral"]}; sidequests.bounty rules block: waypo
- [x] task-2: 20 Neutral pirate-leader dossiers (data/sidequests.json → descriptions.neutral.bounty) — evidence: descriptions.neutral.bounty = 20 dossiers (Vanturi, Halvardson, Ondaine, Spidleau sisters, Drumm, Vane, Sekh, Marlowe, Nkemdi, Costa, Dax, Ferreira, Adu, Bellamy, Vowell, Fisk, Tui, Vance, Vohl, Alkan
- [x] task-3: Model: availability, postings, plan derivation, scripts, completion (js/quests/SideQuests.js) — evidence: SideQuests.js: context/level gating (enabledSideQuestCategories('faction')=['patrol'], sideQuestAcceptable locked below lvl2), dossier postings with per-board dedupe, deriveBountyPlan (seeded fork, bo
- [x] task-4: Combat seam: buffed elite unit + halt-deployments termination (js/combat/Waves.js, CombatSystem.js, EnemyShip.js) — evidence: Waves.js normalizeWave preserves elite {type,healthScale,damageScale,name}; resolveRoster puts exactly ONE mark at the head of the spawn order (its weight removed from the escort draw) — non-elite wav
- [x] task-5: Scene wiring: accept, sequential check-ins, engagement chain, completion + claim (js/scenes/GameScene.js) — evidence: GameScene: onKill hands the enemy to handleCombatKill (elite-only witness → haltWaves + bountyDown); _establishBountyHunt rolls plan→route (buildPatrolRoute opts {waypoints:[legs,legs], fork:'bounty'}
- [x] task-6: Board UI: dossier readout, locked state, spoiler-free progress (js/ui/JobBoardWindow.js) — evidence: JobBoardWindow.js: _rowState 'locked'; greyed row + LOCKED — REQUIRES LEVEL {level} badge (fillLevel); dossier block (WANTED/epithet/CHARGES/CRAFT) via ui.dossier* with dynamic body-line cap; hunt rou
- [ ] task-7: Verification suite + docs (dev/bounty-hunts.test.mjs, run all dev tests, in-browser check, docs/PROJECT_NOTES.md)