Files
aetherbound-guild/docs/runtime/p9_7/IMPLEMENTATION_PLAN.md
T

242 lines
15 KiB
Markdown

# P9.7 Windglass Market Expansion Implementation Plan
> Status: `ACTIVE`
> Active step: `P9.7-STEP-5 THREE-ROUND CONTINUATION`
> Baseline: `583fb1e`
> Goal: `docs/goals/PHASE9_7_WINDGLASS_MARKET_EXPANSION_GOAL.md`
> Contract: `docs/runtime/PHASE9_7_WINDGLASS_MARKET_EXPANSION_CONTRACT.md`
## Player-Visible Stopping Point
Starting from the P9.6 Rift Tide return, the player can use a real Market to
grow and prepare the Company, complete three decision-bearing Windglass rounds,
restore the Relay, reload, and enter the next Market with the actual roster,
Reserve, equipment, HP, Coin, capacity and route history intact.
No Owner H5 review is requested before Step 6 closes. Internal steps remain
runnable, focused, committed and pushed.
## Ordered Steps
| Step | Status | Player outcome | Commit boundary |
|---|---|---|---|
| P9.7-STEP-0 Contract | `COMPLETE` | The larger three-round scope and exact stopping point are frozen. | Goal, contract, plan, checkpoint and ledger commit. |
| P9.7-STEP-1 Content authority | `COMPLETE` | Every future Market object and route resolves from validated data with readable names and effects. | Source `ceb126b`; content marker, ten negative cases and P9.6 regression pass strict-clean. |
| P9.7-STEP-2 Market domain | `COMPLETE` | Hire, dismiss, inventory, equip, deployment, Reserve and board lineage commit atomically. | Source `665ec7e`; Market/persistence/content/P9.6 markers pass strict-clean. |
| P9.7-STEP-3 Battle expansion | `COMPLETE` | Six new professions, six enemies, four items and nine compositions create route-dependent outcomes. | Source `86e939c`; 27 paths, 15 exact counterfactuals, settlement and P9.3-P9.6 regressions pass strict-clean. |
| P9.7-STEP-4 In-world runtime | `COMPLETE` | The player performs the complete Market and preparation flow through actor, pedestal and route-gate touches. | Source `dff7d84`; 20 parsed touches, 17 normal frames and prior-flow regressions pass strict-clean. |
| P9.7-STEP-5 Three-round continuation | `IN_PROGRESS` | Rounds 5-7 settle with growth, recovery, capacity and Relay transformation, then reload into Market 8. | Full-flow, persistence, five-profile and layout evidence pushed. |
| P9.7-STEP-6 H5 and closure | `PENDING` | One source-bound cached H5 exposes the complete larger milestone for Owner testing. | Runtime-only export, one Gallery item and docs-only closure pushed. |
## Step Contracts
### P9.7-STEP-1 CONTENT AUTHORITY
```text
ID: P9.7-STEP-1 CONTENT AUTHORITY
PLAYER OUTCOME: Future Market offers and routes have stable readable identities,
exact effects and deterministic board membership instead of controller-owned
hard-coded branches.
IN SCOPE: one P9.7 runtime content registry; six new base professions; six
Windglass enemies; four equipment items; nine deterministic Recruit records;
nine battle offers; three Market boards; localized display fields; reference,
duplicate, compatibility, price, risk and reward validation; focused tests.
OUT OF SCOPE: state mutations, Market UI, battle mechanics, persistence changes,
paid media, H5 and packaging.
OWNED FILES: runtime/content/p9_7_content.gd and UID; runtime/tests/p9_7/
content_authority_test.gd and UID; P9.7 plan/checkpoint/ledger status.
ACCEPTANCE CHECKS: every stable ID is unique; all references resolve; each board
contains exactly 3 Recruit, 4 equipment and 3 battle rows; risk set is 0/1/2;
rewards equal the economy formula; offer levels/prices are exact; generation
and board hashes are deterministic across repeated construction and locale;
malformed in-memory fixtures are rejected; P9.6 domain regression passes.
EVIDENCE LEVEL EXPECTED: automated_verified for data authority only.
COMMIT BOUNDARY: focused content/test/status commit pushed before Step 2 opens.
LEGAL TERMINAL: P9.7 Step 1 content authority ready, or redesign required at the
earliest schema/reference/determinism boundary.
NEXT STEP: implement atomic Market state, receipts and save-v2 migration.
```
### P9.7-STEP-2 MARKET DOMAIN
```text
ID: P9.7-STEP-2 MARKET DOMAIN
PLAYER OUTCOME: The player can grow a Company beyond the active line, equip one
item per Recruit, dismiss safely and commit a legal deployment.
IN SCOPE: P9.7 state fields; content-backed offers; hire, dismiss preview/confirm,
buy, equip, inventory replacement, auto-order, manual deploy, Reserve, board
lineage and receipts; version-2 migration and interruption-safe stable saves.
OUT OF SCOPE: new battle behavior and presentation.
OWNED FILES: runtime/p9_7 Market state/service/save composition layer;
runtime/tests/p9_7 Market/persistence tests; P9.7 durable status.
ACCEPTANCE CHECKS: success increments once; every rejection preserves complete
snapshots; final-Recruit dismissal is blocked; equipment returns atomically;
Company/deployed/Reserve/capacity remain distinct; v1-to-v2 and corruption,
duplicate, rollback and pre-battle checkpoint regressions pass.
EVIDENCE LEVEL EXPECTED: automated_verified.
COMMIT BOUNDARY: focused domain/persistence/status commit pushed.
LEGAL TERMINAL: P9.7 Step 2 Market domain ready, or redesign required at the
earliest transaction/migration boundary.
NEXT STEP: bind P9.7 content to authoritative battle behavior.
```
### P9.7-STEP-3 BATTLE EXPANSION
```text
ID: P9.7-STEP-3 BATTLE EXPANSION
PLAYER OUTCOME: Recruit, equipment and route choices visibly alter who acts,
what is countered and whether a higher-risk route is worth its reward.
IN SCOPE: data-fed member/enemy definitions and compositions; six profession
behaviors; six enemy pressures; four item triggers; Rounds 5-7 settlement;
exact fixed-board counterfactuals and P9.3-P9.6 regressions.
OUT OF SCOPE: final AI breadth, advanced professions, boss, permanent casualty,
new presentation assets and H5.
OWNED FILES: runtime/domain/p9_2 battle files; core service integration;
runtime/tests/p9_7 battle/settlement tests; P9.7 status.
ACCEPTANCE CHECKS: all nine offers terminate in bounds; stable speed-independent
outcomes; required counterfactuals hold; invalid composition/item targets are
inert; reward/XP/clear/capacity commit once; prior tests retain exact markers.
EVIDENCE LEVEL EXPECTED: automated_verified plus simulation-ready domain.
COMMIT BOUNDARY: focused battle/status commit pushed.
LEGAL TERMINAL: P9.7 Step 3 battle expansion ready, or redesign required at the
earliest choice/counterfactual/settlement boundary.
NEXT STEP: expose the flow as direct-touch landscape gameplay.
```
### P9.7-STEP-4 IN-WORLD RUNTIME
```text
ID: P9.7-STEP-4 IN-WORLD RUNTIME
PLAYER OUTCOME: The Market reads as a game world: tap a standing Recruit, item
pedestal, Company actor or route gate, see the exact consequence, then act.
IN SCOPE: Hall Market composition, profession overlays, Reserve staging,
contextual compare ribbon, route telegraphs, expanded battle actors/events,
settlement and Relay states; parsed ScreenTouch; normal-render fixtures.
OUT OF SCOPE: unrelated front door, final art/audio, H5 and native package.
OWNED FILES: one isolated runtime/p9_7 runtime controller plus bounded
presentation helpers/assets; runtime/tests/p9_7 runtime/touch/capture tests;
P9.7 status. P9.3 controller and main entry integration remain deferred to
Step 5 after this runtime surface is proven.
ACCEPTANCE CHECKS: controls follow world objects and are >=48px; no repeated
cards/forms; complete route uses Input.parse_input_event ScreenTouch with
fallback/direct zero; representative frames are nonblank, bounded and causal;
old P9.6 flow remains strict-clean.
EVIDENCE LEVEL EXPECTED: runtime_verified, agent visual review supporting only.
COMMIT BOUNDARY: focused runtime/test/status commit pushed.
LEGAL TERMINAL: P9.7 Step 4 in-world runtime ready, or redesign required at the
earliest touch/readability/visual-causality boundary.
NEXT STEP: verify complete three-round continuation and persistence.
```
### P9.7-STEP-5 THREE-ROUND CONTINUATION
```text
ID: P9.7-STEP-5 THREE-ROUND CONTINUATION
PLAYER OUTCOME: Three rounds form one readable arc, restore the Relay and start
a strategically different saved next cycle.
IN SCOPE: complete-flow test; five profiles and decision timestamps; save and
retry profiles; layouts/locales/accessibility/low-power; final regression;
source-bound evidence inventory.
OUT OF SCOPE: product changes unless the earliest declared gate fails; H5,
packaging, devices and release.
OWNED FILES: runtime/tests/p9_7 evidence tests/runners; P9.7 durable status.
ACCEPTANCE CHECKS: five profiles show different rational plans and no dominant
buy/route; longest no-decision gap remains bounded; all three settlements and
Market-8 reload are exact; seven layout/accessibility fixtures pass; strict
diagnostics and owned-process cleanup are zero.
EVIDENCE LEVEL EXPECTED: simulation_verified plus runtime_verified.
COMMIT BOUNDARY: focused evidence/status commit pushed.
LEGAL TERMINAL: P9.7 Step 5 three-round continuation ready, or redesign required
at the earliest pacing/save/layout/regression boundary.
NEXT STEP: publish one fresh H5 and close the milestone.
```
### P9.7-STEP-6 H5 AND CLOSURE
```text
ID: P9.7-STEP-6 H5 AND CLOSURE
PLAYER OUTCOME: The Owner can test the whole larger playable section from one
cached private landscape H5.
IN SCOPE: fresh runtime-only Web export, stable caching, one Gallery delivery,
source hashes, delivery document and durable closure.
OUT OF SCOPE: gameplay changes, native packages, devices, TestFlight, stores,
release and other games.
OWNED FILES: ignored source-bound Web output, docs/runtime/p9_7/H5_DELIVERY.md,
P9.7 Goal/plan/checkpoint/ledger.
ACCEPTANCE CHECKS: exact source binding; tests/docs/evidence absent from PCK;
local and remote MIME/bytes/cache checks pass; repository is clean/upstream;
owned processes zero; one legal terminal is recorded.
EVIDENCE LEVEL EXPECTED: runtime_verified delivery; human gates remain open.
COMMIT BOUNDARY: docs-only closure pushed after immutable export/delivery.
LEGAL TERMINAL: Aetherbound Guild P9.7 Windglass Market expansion candidate
ready, or redesign required at the earliest Web/delivery boundary.
NEXT STEP: Owner completes one uncoached playthrough and reports the earliest
unclear or uninteresting Market/route decision.
```
## Issue Register
| ID | Status | Finding |
|---|---|---|
| P97-I01 | `RESOLVED_IN_CONTRACT` | Calling three more fights a complete Chapter would contradict the twelve-Round-plus-boss authority. The milestone ends at Relay restoration and Market 8, not Contract clear. |
| P97-I02 | `RESOLVED_IN_CONTRACT` | P9.6 displayed Company `/10` as if it were deployment capacity. P9.7 stores Company, Line capacity, deployed line and Reserve separately. |
| P97-I03 | `RESOLVED_STEP_2` | Source `665ec7e` adds save version 2 with Market state, board hashes, operation receipts and tested v0/v1 migration. |
| P97-I04 | `OPEN_FINAL_ART` | Step 4 source `dff7d84` integrates source-bound rigs, profession labels and deterministic palette overlays as temporary runtime art. Bespoke profession and enemy sprite production remains a later final-art gate. |
| P97-I05 | `RESOLVED_STEP_1_AUTHORITY` | A Recruit with an empty starting slot contradicted generated-Recruit authority, and a Market-7 pool based only on unowned professions could exhaust. All nine fixed Recruit instances now carry one equipment instance, while duplicate professions remain legal. |
| P97-I06 | `RESOLVED_STEP_3_THRESHOLD` | Content authority intentionally owns only three `3/4/3` boards, so Round 7 cannot invent a normal empty Market. Source `86e939c` opens a reload-stable `P97-MARKET-8-THRESHOLD` with preserved Company state, restored Relay and an explicit future-content lock. |
| P97-I07 | `RESOLVED_STEP_4_ARCHITECTURE` | Editing the accepted 1,300-line P9.3 controller while building a new Market would couple old and new regressions. Step 4 uses one isolated P9.7 controller with accepted assets/helpers; Step 5 alone may bind the verified surface into the continuous main flow. |
## Current Evidence
- Baseline `583fb1e` is clean and upstream-equal.
- P9.6 local terminal and evidence remain unchanged.
- Step 1 source is `ceb126b`; root is
`/private/tmp/abg-p97-ceb126b-step1-r1/`.
- Exact marker: `ABG_P9_7_CONTENT_AUTHORITY_OK professions=6 recruits=9
traits=8 equipment=4 equipment_offers=12 enemies=6 routes=9 boards=3
board_shape=3,4,3 risks=0,1,2
rewards=28,35,42,30,37,44,32,39,46 hashes=deterministic
locale_hash_drift=0 negative_cases=10`.
- P9.6 risk/recovery marker remains exact; strict diagnostics are zero.
- Evidence inventory SHA-256:
`6949924ed3b1302be0843f3825d2795de960df7ebbe4a528842e91f0b6e823b0`
(4/4 verified).
- Step 2 source is `665ec7e`; root is
`/private/tmp/abg-p97-665ec7e-step2-r1/`.
- Exact Market marker records migration to Market 5, clear count four, capacity
six, 18-Coin hire, one starting item, separate Company/Reserve, 12-Coin buy,
one-slot equip, ordered deployment, `0/3` dismissal rebates, blocked final
Recruit, idempotent operations and zero invalid mutations.
- Exact persistence marker records version 2, v0/v1 migration, 13 cases, stable
board hash, operation preservation, corruption/backup/rollback and zero
offline rewards. P9.7 content and P9.6 persistence regressions also pass.
- Evidence inventory SHA-256:
`763101067dd32b1c7d5b407c7e4532fdb65e061086a022aa7f4ea05755182b3d`
(6/6 verified).
- Step 3 now owns battle definitions, content-fed composition, item/profession
behaviors and atomic Round settlement.
- Step 3 source is `86e939c`; formal evidence root is
`/private/tmp/abg-p97-86e939c-step3-r3/`.
- Exact markers cover 27 deterministic battle paths, 15 fixed
counterfactuals, three atomic settlements, save-v2 interruption/migration and
unchanged P9.3-P9.6 domain/persistence results. Strict diagnostics are zero.
- Evidence inventory SHA-256 is
`b5a9c9bccfb91a49242e2e2a6f91b53310a127a95d35123b17c38dbab131102d`
(13/13 verified). R1 and R2 remain append-only invalid harness attempts.
- Step 4 source is `dff7d84`; formal evidence root is
`/private/tmp/abg-p97-dff7d84-step4-r2/`.
- Twenty parsed ScreenTouch events cover Recruit focus/hire, equipment focus/
buy/equip, Company/Line changes, route commit, victory, defeat, settlement,
8-Coin recovery and dismissal with fallback/direct callbacks zero.
- Seventeen normal frames cover Market, focus, equip, route pressure, battle
pressure/result, defeat/recovery, Relay restoration, both languages, 130%
text, reduced motion, mute, low power and four viewport sizes. Windglass
battle composition, bounded lanes and result cleanup pass agent visual review.
- Fourteen logs retain exact P9.7 and P9.3-P9.6 markers with strict diagnostics
zero. Inventory SHA-256 is
`421e24cb3db761b55d2e8ca67bcdd782d4e3239d9af4a1ecc05f79e27c066bff`
and verifies 36/36. R1 is append-only `INVALID_MISSING_NORMAL_LOG` and is not
reused.
- Step 5 is active for the complete three-round continuation, five profiles,
persistence/retry and final source-bound runtime evidence. H5 remains closed.