17 KiB
{
"version": 3,
"id": "munfk6gc-xfi6jf",
"objective": "Make faction-controlled star systems play as active war zones: hostile encounters come only from the two opposing factions (never neutrals or pirates), local-faction fighters join the player in combat against them, planet reputation on faction worlds is governed by standing with the controlling faction (starting neutral), faction worlds' job boards post only faction missions, and the three live side-quest types are reworked to the faction war model — patrol (inside the issuing system vs. a sighted opposing faction), bounty (hunting a wanted opposing-faction target in a nearby hostile faction system, gated on jump-gate access to that system), and escort (rescuing a trapped friendly transport in a nearby hostile faction system and flying the convoy physically through the jump gate into friendly territory).\n\nSuccess criteria:\n- In any faction-controlled system: no neutral ships or pirate ships ever spawn as ambient encounters; only ships of the two opposing factions do, and they are hostile to the player on sight. Neutral wild space behavior (pirates/neutrals) is unchanged.\n- While the player fights opposing-faction ships inside faction A's territory, one or more faction A fighters join the fight as player allies (engage the enemy NPCs, never the player).\n- Reputation standingFor() on a faction-owned world resolves to the player's standing with that faction; a new player has neutral (0) standing with all three factions; faction standings are persisted in saves. (Mechanics that CHANGE standing are explicitly out of scope — the seam is in place.)\n- Job boards on faction worlds post only faction-context postings (patrol/bounty/escort, generic placeholder descriptions with faction labels); neutral-world boards keep posting neutral missions.\n- Patrol: route is always built inside the issuing system; the encounter enemy is one of the two opposing factions (seeded per posting); description is a generic "reports of in-system" placeholder.\n- Bounty: target system is a nearby opposing-faction system whose owner matches the wanted target's faction; the posting is locked/unacceptable until the player's jump-gate capability is unlocked for that system (existing gate lock mechanics); combat is the wanted target + escorts owned by that system's faction.\n- Escort: the friendly transport + escort fighters stand in a nearby hostile faction system behind the first waypoint; finding them arms the escort lane (mixed enemy-faction attacks along the way); the convoy follows and must physically fly through the jump gate into the issuing friendly faction system — completion only on arrival.\n- Delivery remains offline (category gate stays off).\n- Determinism contract preserved: same seed ⇒ same postings, routes, targets (labelled Rng forks); dev/.test.mjs suites pass.\n\nBoundaries:\n- In scope: encounter director context for faction systems, ally-fighter join mechanic, factionStanding() implementation + save persistence, job-board context filtering, patrol/bounty/escort rework per above, generic description placeholders, node tests.\n- Out of scope: anything that changes faction standing over time (reputation-gain/loss rules), delivery category, faction-specific flavor text (placeholders now), NPC-vs-NPC auto-resolved combat, diplomacy/trade effects of standing.\n\nConstraints:\n- Keep modules pure where they are today (SideQuests.js, Encounters.js, Reputation.js testable in bare Node; scene owns spawning/Phaser).\n- Preserve the worldgen determinism contract (seeded, labelled Rng forks; same seed ⇒ same output).\n- Respect existing save compatibility patterns: new save fields load as sane defaults in old saves (existing fromJSON fallback style); in-flight quest ledger rules follow the documented Path A precedent where they conflict.\n- Player's home system stays safe space — no hostiles ever placed there.\n- No new art assets; use existing faction fighter rosters (EnemyTypes / DuelPicker rosters) and the existing TransportShip.\n\nVerification contract:\n- Run all dev/.test.mjs node test suites (0 failures), including updated patrol/bounty/escort/encounters/reputation tests.\n- Manual checklist via the dev boot flags where they exist: spawn into a faction system (no neutral/pirate spawns; opposing-faction hostiles; ally join on engagement), neutral system (pirates/neutrals still spawn), faction job board (only faction postings, patrol route in-system, bounty gated on gate access, escort find-then-fly-through-gate completion), neutral board unchanged, old save loads without error with neutral faction standings.\n- Re-read this goal's requirements and confirm every item is addressed before marking complete.\n\nIf blocked: stop and ask the user.",
"status": "complete",
"autoContinue": true,
"usage": {
"tokensUsed": 20479313,
"activeSeconds": 4724
},
"sisyphus": false,
"revision": 306,
"createdAt": "2026-09-30T01:32:17.964Z",
"updatedAt": "2026-09-30T03:07:31.585Z",
"scheduler": {
"version": 1,
"owner": "01a0efeb-794f-75c1-ab86-375a32984c6e",
"generation": "ba7c0cd9-889a-481c-b926-1851d42f83af",
"used": 1,
"phase": "running",
"repairUsed": false,
"decision": {
"kind": "ready",
"nextAction": "Continue pursuing the goal, then verify and complete it when satisfied.",
"purpose": "ready"
},
"dispatch": {
"id": "a6a203f5-1406-4744-83f8-e5530332ece5",
"kind": "ready",
"claimedAt": 1790731938027
}
},
"taskList": {
"tasks": [
{
"id": "task-1",
"title": "Faction encounters + ally join",
"status": "complete",
"verificationContract": "Encounter director rolls opposing-faction kinds (B and C) in faction A systems and never pirates/neutrals there; neutral-space rolls unchanged; faction A fighters spawn as allies when the player engages B/C in A's territory, fight enemy NPCs, never the player; node tests for the pure roll/composition rules pass.",
"completedAt": "2026-09-30T01:43:00.803Z",
"evidence": "Encounters.compose gains faction context (opposing-faction roll, band-sized, seeded); encounterAllowed admits factionContext; GameScene passes encounterContext + spawnFactionEncounter (hostiles from"
},
{
"id": "task-2",
"title": "Faction standing in reputation + saves",
"status": "complete",
"verificationContract": "factionStanding() returns stored per-faction standing (neutral 0 for a new player); standingFor() on faction worlds resolves via faction standing; standings serialize in toJSON/fromJSON with old-save fallback to neutral; reputation.test.mjs passes.",
"completedAt": "2026-09-30T01:35:02.798Z",
"evidence": "reputation.test.mjs 80 checks pass incl. new faction-standing checks; toJSON/fromJSON carry factions with old-save fallback; commsTargetFor passes {id,owner} to standingFor."
},
{
"id": "task-3",
"title": "Job board context filtering + generic faction descriptions",
"status": "complete",
"verificationContract": "Faction worlds post only patrol/bounty/escort faction-context postings with generic placeholder text ({faction}/{issuer}/{enemies} resolved); neutral worlds post unchanged neutral missions; delivery stays offline; postings remain deterministic per seed/world.",
"completedAt": "2026-09-30T02:51:55.026Z",
"evidence": "buildPosting faction branch posts patrol/bounty/escort with enemyFaction; enabledSideQuestCategories filters by contexts (delivery offline); neutral boards unchanged; {enemy} placeholders resolve to t"
},
{
"id": "task-4",
"title": "Patrol: in-system vs sighted opposing faction",
"status": "complete",
"verificationContract": "patrolTargetSystem always resolves to the issuing system; encounter enemy is one seeded opposing faction (not both, not neutral/pirate); generic sighting-report description; buildPatrolRoute/encounter tests updated and passing.",
"completedAt": "2026-09-30T02:52:12.995Z",
"evidence": "patrolTargetSystem → issuing system always; seededOpposingFaction picks one rival (never pirate/both); derivePatrolEncounters roster = that faction's types (apex/zenith verified, no raider/bomber); "
},
{
"id": "task-5",
"title": "Bounty: hostile-system hunt gated on jump-gate access",
"status": "complete",
"verificationContract": "Bounty target system is a nearby system owned by the target's own (opposing) faction; posting locked/unacceptable until gate access to that system is unlocked; combat = wanted target + escorts of that faction; bounty tests updated and passing.",
"completedAt": "2026-09-30T02:52:30.658Z",
"evidence": "hostileNeighborSystem picks a gate-reachable rival system (owner = target's faction); buildPosting sets targetSystemId=ground.id + gateLevel; sideQuestAcceptable gates on gateLevel (target-driven gate"
},
{
"id": "task-6",
"title": "Escort: rescue + convoy through the gate into friendly space",
"status": "complete",
"verificationContract": "Escort posting arms only when a reachable hostile-system leg stands; first waypoint → trapped transport + escort fighters; escort lane (mixed opposing-faction attacks) active during the leg; convoy physically flies through the jump gate into the issuing friendly faction system and completion fires only on arrival; escort tests updated and passing.",
"completedAt": "2026-09-30T02:52:48.889Z",
"evidence": "buildPosting faction escort: enemySystemId=hostile neighbor (rendezvous), destSystemId=board's own friendly system; _establishEscort faction branch (origin=hostile, dest=friendly via escortFriendlyDes"
},
{
"id": "task-7",
"title": "Full verification pass",
"status": "complete",
"verificationContract": "All dev/.test.mjs suites run with 0 failures; manual checklist from the goal's verification contract executed (faction/neutral spawn rules, ally join, boards, gate-gated bounty, escort gate fly-through, old save load); every objective item re-checked against the requirements.",
"completedAt": "2026-09-30T02:57:43.411Z",
"evidence": "Final run: 79/79 dev/.test.mjs suites PASS, 0 failures (5 browser suites with dev server up). Syntax OK on all 5 modified modules. Manual checklist re-verified against code: faction/neutral spawn (en"
}
],
"blockCompletion": true,
"proposedAt": "2026-09-30T01:31:39.493Z"
},
"stopReason": "agent",
"archivedPath": ".pi/goals/archived/goal_2026092921073158_munfk6gc-xfi6jf.md"
}
Goal Prompt
Make faction-controlled star systems play as active war zones: hostile encounters come only from the two opposing factions (never neutrals or pirates), local-faction fighters join the player in combat against them, planet reputation on faction worlds is governed by standing with the controlling faction (starting neutral), faction worlds' job boards post only faction missions, and the three live side-quest types are reworked to the faction war model — patrol (inside the issuing system vs. a sighted opposing faction), bounty (hunting a wanted opposing-faction target in a nearby hostile faction system, gated on jump-gate access to that system), and escort (rescuing a trapped friendly transport in a nearby hostile faction system and flying the convoy physically through the jump gate into friendly territory).
Success criteria:
- In any faction-controlled system: no neutral ships or pirate ships ever spawn as ambient encounters; only ships of the two opposing factions do, and they are hostile to the player on sight. Neutral wild space behavior (pirates/neutrals) is unchanged.
- While the player fights opposing-faction ships inside faction A's territory, one or more faction A fighters join the fight as player allies (engage the enemy NPCs, never the player).
- Reputation standingFor() on a faction-owned world resolves to the player's standing with that faction; a new player has neutral (0) standing with all three factions; faction standings are persisted in saves. (Mechanics that CHANGE standing are explicitly out of scope — the seam is in place.)
- Job boards on faction worlds post only faction-context postings (patrol/bounty/escort, generic placeholder descriptions with faction labels); neutral-world boards keep posting neutral missions.
- Patrol: route is always built inside the issuing system; the encounter enemy is one of the two opposing factions (seeded per posting); description is a generic "reports of in-system" placeholder.
- Bounty: target system is a nearby opposing-faction system whose owner matches the wanted target's faction; the posting is locked/unacceptable until the player's jump-gate capability is unlocked for that system (existing gate lock mechanics); combat is the wanted target + escorts owned by that system's faction.
- Escort: the friendly transport + escort fighters stand in a nearby hostile faction system behind the first waypoint; finding them arms the escort lane (mixed enemy-faction attacks along the way); the convoy follows and must physically fly through the jump gate into the issuing friendly faction system — completion only on arrival.
- Delivery remains offline (category gate stays off).
- Determinism contract preserved: same seed ⇒ same postings, routes, targets (labelled Rng forks); dev/*.test.mjs suites pass.
Boundaries:
- In scope: encounter director context for faction systems, ally-fighter join mechanic, factionStanding() implementation + save persistence, job-board context filtering, patrol/bounty/escort rework per above, generic description placeholders, node tests.
- Out of scope: anything that changes faction standing over time (reputation-gain/loss rules), delivery category, faction-specific flavor text (placeholders now), NPC-vs-NPC auto-resolved combat, diplomacy/trade effects of standing.
Constraints:
- Keep modules pure where they are today (SideQuests.js, Encounters.js, Reputation.js testable in bare Node; scene owns spawning/Phaser).
- Preserve the worldgen determinism contract (seeded, labelled Rng forks; same seed ⇒ same output).
- Respect existing save compatibility patterns: new save fields load as sane defaults in old saves (existing fromJSON fallback style); in-flight quest ledger rules follow the documented Path A precedent where they conflict.
- Player's home system stays safe space — no hostiles ever placed there.
- No new art assets; use existing faction fighter rosters (EnemyTypes / DuelPicker rosters) and the existing TransportShip.
Verification contract:
- Run all dev/*.test.mjs node test suites (0 failures), including updated patrol/bounty/escort/encounters/reputation tests.
- Manual checklist via the dev boot flags where they exist: spawn into a faction system (no neutral/pirate spawns; opposing-faction hostiles; ally join on engagement), neutral system (pirates/neutrals still spawn), faction job board (only faction postings, patrol route in-system, bounty gated on gate access, escort find-then-fly-through-gate completion), neutral board unchanged, old save loads without error with neutral faction standings.
- Re-read this goal's requirements and confirm every item is addressed before marking complete.
If blocked: stop and ask the user.
Progress
- Status: complete
- Auto-continue: on
- Sisyphus mode: no
- Time spent: 1h18m44s
- Tokens used: 20M (20,479,313) tokens
Tasks
- task-1: Faction encounters + ally join — evidence: Encounters.compose gains faction context (opposing-faction roll, band-sized, seeded); encounterAllowed admits factionContext; GameScene passes _encounterContext + _spawnFactionEncounter (hostiles from
- task-2: Faction standing in reputation + saves — evidence: reputation.test.mjs 80 checks pass incl. new faction-standing checks; toJSON/fromJSON carry
factionswith old-save fallback; commsTargetFor passes {id,owner} to standingFor. - task-3: Job board context filtering + generic faction descriptions — evidence: buildPosting faction branch posts patrol/bounty/escort with enemyFaction; enabledSideQuestCategories filters by contexts (delivery offline); neutral boards unchanged; {enemy} placeholders resolve to t
- task-4: Patrol: in-system vs sighted opposing faction — evidence: patrolTargetSystem → issuing system always; seededOpposingFaction picks one rival (never pirate/both); derivePatrolEncounters roster = that faction's types (apex_/zenith_ verified, no raider/bomber);
- task-5: Bounty: hostile-system hunt gated on jump-gate access — evidence: hostileNeighborSystem picks a gate-reachable rival system (owner = target's faction); buildPosting sets targetSystemId=ground.id + gateLevel; sideQuestAcceptable gates on gateLevel (target-driven gate
- task-6: Escort: rescue + convoy through the gate into friendly space — evidence: buildPosting faction escort: enemySystemId=hostile neighbor (rendezvous), destSystemId=board's own friendly system; _establishEscort faction branch (origin=hostile, dest=friendly via escortFriendlyDes
- task-7: Full verification pass — evidence: Final run: 79/79 dev/*.test.mjs suites PASS, 0 failures (5 browser suites with dev server up). Syntax OK on all 5 modified modules. Manual checklist re-verified against code: faction/neutral spawn (en