orbit/.pi/goals/archived/goal_2026092703260806_muj5o...

137 lines
19 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": "muj5okb0-s2mwh3",
"objective": "Introduce the skill layer to Orbit: a data-driven per-class Skill Tree (full-screen console opened from the ship console's Skill Tree door) where banked skill points rank skills up to their max, spend-through-unlock edges gate further skills, player-assigned active skills occupy seats 1–8 of the combat bar and spend energy on cooldown, passives apply automatically — with the first two Vanguard skills wired end-to-end: \"Ramming Charge\" (Offense, 60 energy, 6s recharge, 5 points, dash past the nearest hostile and blast it for 4x weapon damage, +2x per additional point) and \"Reinforced Plating\" (Passive, 0/0, 5 points, +5% hull pool, +5% per additional point).\n\nSuccess criteria:\n- data/skills.json (listed in data/manifest.json) defines the Vanguard tree with exactly those two skills carrying the stated ids/labels/type/energy/recharge/maxPoints/effect copy and icon frames off assets/images/skills.png (frame 0 = Ramming Charge, frame 1 = Reinforced Plating); code owns behavior, JSON owns every number and string.\n- Picking Vanguard makes both skills immediately spendable; points can be added one at a time up to 5/5 each, the bank (ClassState.skillPoints) debits/pays back correctly, and rank is saved and restored with the run. A skill at rank 0 is inert; rank ≥1 is live.\n- The Skill Tree console shows for each skill: icon, label, type, cost/recharge, rank \"n/5\", effect text, affordability + locked/unlocked state via the `requires` edges, and a spend action (with refund/respec explicitly absent-but-not-broken).\n- Clicking an active skill then a combat-bar seat binds it; bindings persist across save/load; defaults come from data. Only activatable skills are seatable — Reinforced Plating never occupies a seat and is visibly \"PASSIVE\" in the tree.\n- In live combat with Ramming Charge at rank 1: pressing its seat (or key) consumes 60 energy, applies a 6s cooldown shown on the seat, dashes the ship toward a point past the nearest hostile at 3x speed for 1 second, and the arrival blast in a data-driven radius deals 4x regular weapon damage — 6x at rank 2, 12x at rank 5 (verified by numbers, not eyeball). Energy is refusable at cost > current energy; data/combat.json → energy.regen is on (default 6/s) so the skill is fight-usable again in ~7s.\n- Reinforced Plating at rank n raises max hull to base × (1 + 0.05n) with the orbs/bar reflecting the bigger pool, surviving save/load, level-up armor bumps and combat restart without double-counting.\n- Evidence: node dev/run-all.mjs fully green including new dev/skills.test.mjs (pure data/model/ledger/save), dev/skills-combat.test.mjs (energy/cooldown/dash/blast damage per rank/hull scaling), a browser-level check, plus a screenshot pass in dev/shots/ showing the tree and armed bar seats.\n\nBoundaries:\nIN SCOPE: data/skills.json + manifest; js/skills/SkillModel.js + js/skills/SkillState.js (pure, save-integrated as record.playerSkills); skill runtime inside CombatSystem (cast pipeline, cooldowns, energy spend, dash + blast, hull passive); data/combat.json → energy.regen on; js/ui/SkillWindow.js full-screen console in the research-console idiom; ShipWindow's Skill Tree tab switching from OFFLINE standby to that door; combat-bar seat art/states (icon, rank, cooldown sweep, not-enough-energy, unbound) + click-to-assign flow; dev hooks (?skill / grant-points + max-rank for testing); docs/README updates; renaming assets/images/skills → assets/images/skills.png so it loads like every other sheet.\nOUT OF SCOPE: any skills beyond these two (further Vanguard skills and all Wraith skills are a later install), respec/refund-for-cost, class changing, drag-and-drop rebinding, skill-point income changes (the grant stays 5 at pick — dev hook supplies test points), energy-cost rebalancing beyond enabling regen, post-cap XP currency, audio/voice for the tree, and any video feed authoring (a missing clip keeps the NO SIGNAL plate and the console still works).\n\nConstraints:\n- Plain ES6 modules, no build step, no package manager; third parties stay vendored. Phaser imported only via js/vendor/phaser.js.\n- One class per file, standalone-constructible, scenes stay thin: no balance numbers in code — every tunable lives in data/*.json with a sane fallback on reads.\n- Determinism rules still apply (Rng, never Math.random() in generation paths) and nothing may break the seeded-galaxy contract.\n- Save-compat is sacred: older saves must load unchanged (absent record.playerSkills = fresh ledger), ledgers are plain data with validating restore.\n- Skills are strictly data-driven so adding skill #3 is a JSON edit plus, at most, one new effect handler — no re-plumbing.\n- Do NOT run git commit; leave the work in the working tree with a suggested commit message (Brian commits manually).\n\n\nIf blocked: stop and ask the user.",
"status": "complete",
"autoContinue": true,
"usage": {
"tokensUsed": 1223595,
"activeSeconds": 23262
},
"sisyphus": false,
"revision": 440,
"createdAt": "2026-09-27T01:44:41.676Z",
"updatedAt": "2026-09-27T09:26:08.077Z",
"scheduler": {
"version": 1,
"owner": "01a0e078-2d4d-73f4-af9e-b921d1ff301f",
"generation": "74192e90-52db-42e2-b4b4-1523b6b1f9a6",
"used": 4,
"phase": "running",
"repairUsed": false,
"decision": {
"kind": "ready",
"nextAction": "Continue pursuing the goal, then verify and complete it when satisfied.",
"purpose": "ready"
},
"dispatch": {
"id": "00358876-6ccd-43e9-b7a5-7512fb4b5104",
"kind": "ready",
"claimedAt": 1790482349945
}
},
"verificationContract": "node dev/run-all.mjs passes end-to-end (0 failures) including the new skills tests; each new test asserts real numbers read from data/skills.json rather than private copies; browser check confirms the console opens from the ship tab, spends points, binds a seat, and that key press fires the dash with visible energy/cooldown movement on the bar; re-read the two authored skill specs and confirm every stated field (type, energy cost, recharge, max points, effect scaling) matches the shipped data and combat math.",
"taskList": {
"tasks": [
{
"id": "task-1",
"title": "Skill data layer: data/skills.json (+ manifest) and the skills.png sheet",
"status": "complete",
"verificationContract": "data/skills.json exists, is listed in data/manifest.json, and holds a per-class tree with Ramming Charge (type Offense, energy 60, recharge 6s, maxPoints 5, effect copy + damage numbers 4x/+2x-per-point, dash 3x speed / 1s / blast radius) and Reinforced Plating (type Passive, 0/0, maxPoints 5, +5%/+5%-per-point hull). Icon frames reference assets/images/skills.png frame 0/1; the extensionless assets/images/skills is renamed to skills.png. A data-contract test asserts shape, manifest membership and that no code path restates these numbers.",
"completedAt": "2026-09-27T02:05:55.144Z",
"evidence": "data/skills.json authored (types taxonomy w/ passive flag, seats table, vanguard+wraith trees, window copy); manifest registers it; assets/images/skills.png 1024x512 verified, frames 0=ram 1=plate. de"
},
{
"id": "task-2",
"title": "Pure skill model + ledger: js/skills/SkillModel.js, js/skills/SkillState.js, save round-trip",
"status": "complete",
"verificationContract": "SkillModel normalizes data/skills.json into per-class skill records (id, label, type, energyCost, cooldown, maxPoints, requires[], rank-independent effect numbers, icon frame, copy) with fallbacks and junk dropping. SkillState tracks points-per-skill + seat bindings, derives spendability from the ClassState bank and `requires` edges (rank 0 inert, rank ≥1 live), guards over-spend/over-max/no-class, and applies passives as queryable modifiers. record.playerSkills captures/restores cleanly; a save with no field loads as an empty ledger. Node test proves: spend to 5/5 max, refusal at max/bank-short, unlock-through-parent-points, and save/load round-trip.",
"subtasks": [
{
"id": "task-3",
"title": "Combat runtime: energy regen, cast pipeline, Ramming Charge dash+blast, Reinforced Plating hull passive",
"status": "complete",
"verificationContract": "CombatSystem.cast(index) resolves seat→skill, refuses when rank 0 / no energy / on cooldown, spends energy and starts a per-skill cooldown ticked in update(). Ramming Charge dashes toward a point past the nearest hostile at 3x speed for 1s (player input locked during the dash), then applies a radius blast: 4x base weapon damage at rank 1 scaling +2x per additional point (asserted numerically at ranks 1, 2 and 5). Reinforced Plating multiplies max hull by 1+0.05n with the bar/orbs showing the grown pool, idempotent across combat restart, level-up armor bump and save/load. data/combat.json → energy.regen defaults to ~6/s and is read from data. Headless mechanics test (dev/skills-combat.test.mjs) asserts the numbers.",
"completedAt": "2026-09-27T03:42:06.831Z",
"evidence": "dev/skills-combat.test.mjs 75 checks pass; run-all: ALL 75 TESTS PASSED. cast() refuses inert/energy/cooldown/passive/dashing, spends 60e, per-skill recharge ticked in update(). Dash 3x maxSpeed for 1"
},
{
"id": "task-4",
"title": "Combat bar seats: player-assigned skills, icons, cooldown and affordability states",
"status": "complete",
"verificationContract": "Clicking a seitable skill in the tree then a bar seat (1–8) binds it; data supplies default bindings; bindings persist through save/load and across combat start/stop. Each bound seat draws its skill icon from assets/images/skills.png plus key number, rank, a cooldown sweep with remaining seconds, a dimmed 'not enough energy' state, and an empty reserved look when unbound; keys 1–8 still cast. Only activatable skills are seatable — passives cannot take a seat. Unbinding (to make room) works and is saved.",
"completedAt": "2026-09-27T05:55:54.517Z",
"evidence": "dev/skills-bar-browser.test.mjs (real clicks+keys): seat binds via tree→seat handoff & Digit keys, icons from skills.png, rank stamp, cooldown sweep w/ seconds, noEnergy veil, empty seats, right-click"
},
{
"id": "task-5",
"title": "Skill Tree console: js/ui/SkillWindow.js + the ship console's Skill Tree door goes live",
"status": "complete",
"verificationContract": "A full-screen console in the existing cabinet idiom (left feed with NO SIGNAL fallback if no clip, right plate over the class's tree) shows every skill of the current class: icon, label, TYPE, energy/recharge, rank 'n/5', effect text, and LOCKED/AVAILABLE/MAXED/NO POINTS state driven by requires + bank. A SPEND action adds one point (with sfx + toast), spending is refused with a clear message when locked or broke, and the bank readout decrements live. ShipWindow's Skill Tree tab is no longer `standby` — it opens this window (and stays an honest door when there is no class on file). Dev-console-adjacent windows paint above the world without stealing the frozen-scene contract.",
"completedAt": "2026-09-27T05:57:06.693Z",
"evidence": "js/ui/SkillWindow.js (depth 80 cabinet idiom) + ShipWindow door: skills tab lights when snapshot.skillDoor, opens console; rows show icon/TYPE/energy-recharge/rank n/max/effect/seat state, RANK UP spe"
}
],
"completedAt": "2026-09-27T06:16:49.708Z",
"evidence": "SkillModel.js normalizes data/skills.json (fallbacks, junk rows dropped); SkillState.js ledger ranks/seats/points + bind/clear/auto-bind/hullBonus/effectTotal; SaveData round-trips it and an old save "
},
{
"id": "task-6",
"title": "Dev hooks, evidence and docs: ?skill boot flags, browser/screenshot pass, README + PROJECT_NOTES",
"status": "complete",
"verificationContract": "A dev hook (?skill / an alias) starts a run with the class chosen, points granted and skills rankable/maxed so the layer is testable without grinding, and is inert in normal play. A browser-level check drives: open tree from ship console → spend points into both skills → bind Ramming Charge to a seat → press the key and see energy drain, cooldown sweep, dash and blast damage; captured screenshots land in dev/shots/. README gains the skill-layer section and docs/PROJECT_NOTES.md records the data-vs-code rule and extension pattern for adding skill #3. node dev/run-all.mjs is green; work left uncommitted with a suggested commit message.",
"completedAt": "2026-09-27T06:23:12.506Z",
"evidence": "?skill/?skills/?skill=<class>/?skill=max|all/?skilltree verified + inert with no flag and under ?noclass (dev/skills-devdoor-browser.test.mjs). Window test drives ship tab → console → rank up BOTH ski"
}
],
"blockCompletion": true,
"proposedAt": "2026-09-27T01:44:25.192Z"
},
"stopReason": "agent",
"archivedPath": ".pi/goals/archived/goal_2026092703260806_muj5okb0-s2mwh3.md"
}
# Goal Prompt
Introduce the skill layer to Orbit: a data-driven per-class Skill Tree (full-screen console opened from the ship console's Skill Tree door) where banked skill points rank skills up to their max, spend-through-unlock edges gate further skills, player-assigned active skills occupy seats 1–8 of the combat bar and spend energy on cooldown, passives apply automatically — with the first two Vanguard skills wired end-to-end: "Ramming Charge" (Offense, 60 energy, 6s recharge, 5 points, dash past the nearest hostile and blast it for 4x weapon damage, +2x per additional point) and "Reinforced Plating" (Passive, 0/0, 5 points, +5% hull pool, +5% per additional point).
Success criteria:
- data/skills.json (listed in data/manifest.json) defines the Vanguard tree with exactly those two skills carrying the stated ids/labels/type/energy/recharge/maxPoints/effect copy and icon frames off assets/images/skills.png (frame 0 = Ramming Charge, frame 1 = Reinforced Plating); code owns behavior, JSON owns every number and string.
- Picking Vanguard makes both skills immediately spendable; points can be added one at a time up to 5/5 each, the bank (ClassState.skillPoints) debits/pays back correctly, and rank is saved and restored with the run. A skill at rank 0 is inert; rank ≥1 is live.
- The Skill Tree console shows for each skill: icon, label, type, cost/recharge, rank "n/5", effect text, affordability + locked/unlocked state via the `requires` edges, and a spend action (with refund/respec explicitly absent-but-not-broken).
- Clicking an active skill then a combat-bar seat binds it; bindings persist across save/load; defaults come from data. Only activatable skills are seatable — Reinforced Plating never occupies a seat and is visibly "PASSIVE" in the tree.
- In live combat with Ramming Charge at rank 1: pressing its seat (or key) consumes 60 energy, applies a 6s cooldown shown on the seat, dashes the ship toward a point past the nearest hostile at 3x speed for 1 second, and the arrival blast in a data-driven radius deals 4x regular weapon damage — 6x at rank 2, 12x at rank 5 (verified by numbers, not eyeball). Energy is refusable at cost > current energy; data/combat.json → energy.regen is on (default 6/s) so the skill is fight-usable again in ~7s.
- Reinforced Plating at rank n raises max hull to base × (1 + 0.05n) with the orbs/bar reflecting the bigger pool, surviving save/load, level-up armor bumps and combat restart without double-counting.
- Evidence: node dev/run-all.mjs fully green including new dev/skills.test.mjs (pure data/model/ledger/save), dev/skills-combat.test.mjs (energy/cooldown/dash/blast damage per rank/hull scaling), a browser-level check, plus a screenshot pass in dev/shots/ showing the tree and armed bar seats.
Boundaries:
IN SCOPE: data/skills.json + manifest; js/skills/SkillModel.js + js/skills/SkillState.js (pure, save-integrated as record.playerSkills); skill runtime inside CombatSystem (cast pipeline, cooldowns, energy spend, dash + blast, hull passive); data/combat.json → energy.regen on; js/ui/SkillWindow.js full-screen console in the research-console idiom; ShipWindow's Skill Tree tab switching from OFFLINE standby to that door; combat-bar seat art/states (icon, rank, cooldown sweep, not-enough-energy, unbound) + click-to-assign flow; dev hooks (?skill / grant-points + max-rank for testing); docs/README updates; renaming assets/images/skills → assets/images/skills.png so it loads like every other sheet.
OUT OF SCOPE: any skills beyond these two (further Vanguard skills and all Wraith skills are a later install), respec/refund-for-cost, class changing, drag-and-drop rebinding, skill-point income changes (the grant stays 5 at pick — dev hook supplies test points), energy-cost rebalancing beyond enabling regen, post-cap XP currency, audio/voice for the tree, and any video feed authoring (a missing clip keeps the NO SIGNAL plate and the console still works).
Constraints:
- Plain ES6 modules, no build step, no package manager; third parties stay vendored. Phaser imported only via js/vendor/phaser.js.
- One class per file, standalone-constructible, scenes stay thin: no balance numbers in code — every tunable lives in data/*.json with a sane fallback on reads.
- Determinism rules still apply (Rng, never Math.random() in generation paths) and nothing may break the seeded-galaxy contract.
- Save-compat is sacred: older saves must load unchanged (absent record.playerSkills = fresh ledger), ledgers are plain data with validating restore.
- Skills are strictly data-driven so adding skill #3 is a JSON edit plus, at most, one new effect handler — no re-plumbing.
- Do NOT run git commit; leave the work in the working tree with a suggested commit message (Brian commits manually).
If blocked: stop and ask the user.
## Progress
- Status: complete
- Auto-continue: on
- Sisyphus mode: no
- Time spent: 6h27m42s
- Tokens used: 1.2M (1,223,595) tokens
- Verification contract: node dev/run-all.mjs passes end-to-end (0 failures) including the new skills tests; each new test asserts real numbers read from data/skills.json rather than private copies; browser check confirms the console opens from the ship tab, spends points, binds a seat, and that key press fires the dash with visible energy/cooldown movement on the bar; re-read the two authored skill specs and confirm every stated field (type, energy cost, recharge, max points, effect scaling) matches the shipped data and combat math.
## Tasks
<!-- blockCompletion: true -->
- [x] task-1: Skill data layer: data/skills.json (+ manifest) and the skills.png sheet — evidence: data/skills.json authored (types taxonomy w/ passive flag, seats table, vanguard+wraith trees, window copy); manifest registers it; assets/images/skills.png 1024x512 verified, frames 0=ram 1=plate. de
- [x] task-2: Pure skill model + ledger: js/skills/SkillModel.js, js/skills/SkillState.js, save round-trip — evidence: SkillModel.js normalizes data/skills.json (fallbacks, junk rows dropped); SkillState.js ledger ranks/seats/points + bind/clear/auto-bind/hullBonus/effectTotal; SaveData round-trips it and an old save
- [x] task-6: Dev hooks, evidence and docs: ?skill boot flags, browser/screenshot pass, README + PROJECT_NOTES — evidence: ?skill/?skills/?skill=<class>/?skill=max|all/?skilltree verified + inert with no flag and under ?noclass (dev/skills-devdoor-browser.test.mjs). Window test drives ship tab → console → rank up BOTH ski