docs: plan P9.7 Windglass Market expansion

This commit is contained in:
2026-08-14 23:01:36 +08:00
parent 583fb1e92b
commit 80986a021d
5 changed files with 474 additions and 5 deletions
@@ -0,0 +1,157 @@
# P9.7 Windglass Market Expansion Contract
> Revision: `p9.7-contract-r1`
> Baseline: `583fb1e`
## Entry And Stopping Point
P9.7 begins only from a settled P9.6 Hall after Rift Tide victory and any
required injury recovery. The entry preserves the exact Company, personal
levels/XP, current HP, equipped item and Coin. Four cleared ordinary Rounds are
recorded, so the authoritative capacity formula yields:
```text
line_capacity(4) = min(10, 4 + floor(4/2)) = 6
```
The milestone stops after Rounds 5, 6 and 7 are settled, the Windglass Relay is
visibly restored, and Market 8 can be reloaded with the same living Company,
Reserve, inventory, equipment, Coin, capacity and route history. It does not
claim a twelve-Round Contract clear or boss victory.
## Data-Driven Runtime Slice
One P9.7 content authority owns profession, Recruit, equipment, enemy, route
and Market-board rows. Runtime services consume stable IDs and validate all
references before a board can open. Presentation may localize and arrange these
rows but cannot own prices, stats, targets, rewards or availability.
### Professions And Recruit Offers
The existing four profession IDs remain valid. P9.7 adds these base rows:
| Profession | Runtime role | Distinct battle behavior | Primary counter cost |
|---|---|---|---|
| `PF-B02` Edgehand | fast contact pressure | Alternates living targets and converts overkill into one accelerated next action. | Projectile screens waste its short reach before contact. |
| `PF-B03` Longspoke | reach-two control | Acts before contact and strikes through the front into the next enemy when aligned. | Forced movement removes its next pierce. |
| `PF-B06` Riftcaller | slow area pressure | A completed wind-up damages the first two living enemies. | Elite command interrupts clear the current wind-up. |
| `PF-B08` Bondwright | mixed-role enable | Alternating action tags advances the slower adjacent ally. | Repeated same-role lines provide no advance. |
| `PF-B09` Coilsmith | construct support | Every second basic deploys one rear Needle Post shot. | Rear pressure destroys the pending post before it fires. |
| `PF-B11` Bellkeeper | tempo control | Every third action delays the longest enemy wind-up. | Fast uniform enemies reduce the delay value. |
Each Market exposes exactly three deterministic Recruit records. Every record
stores offer ID, generation seed, display-name tokens, profession ID, one
Trait, level, current XP, max/current HP, one starting item or empty slot,
Coin price paid, survival count and canonical output hash. Offer level for
Rounds 5-7 is level 2 and a base Recruit list price is 18 Coin. Presentation
tokens never alter combat values.
The three boards use six profession rows without rerolling on reload:
| Market | Recruit professions |
|---:|---|
| 5 | Edgehand, Longspoke, Riftcaller |
| 6 | Bondwright, Coilsmith, Bellkeeper |
| 7 | the three unowned rows with the lowest stable offer IDs; owned rows are replaced deterministically by the next unowned base row |
### Equipment
Every P9.7 Market exposes four level-appropriate Region-band-0 tier-0 items at
12 Coin. One Recruit owns at most one equipped item; replaced equipment returns
to inventory.
| ID | Implemented decision behavior |
|---|---|
| `EQ-021` | First basic prefers the enemy with the longest shown wind-up; with no wind-up it waits one tick. |
| `EQ-023` | First legal reach-2 attack targets the rearmost enemy and gives up its normal rider. |
| `EQ-028` | First basic prefers a protecting enemy but cannot defeat it on that hit. |
| `EQ-036` | First legal area action centers on two adjacent enemies; a single enemy does not consume the trigger. |
Unknown, incompatible, duplicate, unaffordable or stale-board transactions
mutate nothing.
## Market And Roster Operations
Market 5, 6 and 7 each show three Recruit, four equipment and three battle
offers in the world. Actor bodies, item pedestals and route gates are direct
touch targets of at least 48 logical pixels. Detail appears beside the selected
world object; no full-screen list, card grid or form is introduced.
- Hire transfers one fixed offer for 18 Coin and stores one receipt.
- Company may exceed Line capacity; only the committed deployed line enters
battle and all others are visible Reserve.
- Deploy/reorder commits an ordered subset of living Recruits whose footprint
does not exceed current Line capacity. Auto-order remains available.
- Dismiss is Market-only, requires an explicit preview/confirm, returns the
equipped item, and follows the existing 25%-after-two-survivals rebate rule.
The final living Recruit is never dismissible.
- Buy/equip and dismiss are atomic and duplicate-safe. This milestone keeps
refresh/lock controls visible as future-locked with a precise reason rather
than implementing an incomplete random reroll.
## Three Round Boards
Every board has one steady (`Q0`), one pressured (`Q1`) and one elite (`Q2`)
offer. Enemy IDs, order, pressure and reward are visible before commitment.
Rewards use Region band 0 and the authoritative formula.
| Round | Route | Risk | Composition | Main pressure | Coin |
|---:|---|---:|---|---|---:|
| 5 | Glassway Patrol | 0 | `EN-R1-01`, `EN-R1-02` | front bite plus rear projectile | 28 |
| 5 | Prism Wind | 1 | `EN-R1-05`, `EN-R1-03`, `EN-R1-02` | projectile screen plus push | 35 |
| 5 | Rootglass Spur | 2 | `EN-R1-08`, `EN-R1-01`, `EN-R1-11` | growing screen plus Stand Order | 42 |
| 6 | Terrace Escort | 0 | `EN-R1-03`, `EN-R1-01` | braced front replacement | 30 |
| 6 | Shardback Bend | 1 | `EN-R1-05`, `EN-R1-08`, `EN-R1-02` | screen rotation and rear shot | 37 |
| 6 | Bailiff's Order | 2 | `EN-R1-11`, `EN-R1-03`, `EN-R1-01` | indexed order plus push | 44 |
| 7 | Finch Crossing | 0 | `EN-R1-02`, `EN-R1-01`, `EN-R1-08` | rear pressure before growth | 32 |
| 7 | Broken Prism | 1 | `EN-R1-05`, `EN-R1-03`, `EN-R1-08` | target-family screen plus push | 39 |
| 7 | Relay Reclamation | 2 | `EN-R1-11`, `EN-R1-05`, `EN-R1-03` | command interrupt, screen and push | 46 |
The implementation must prove at least these counterfactuals on fixed boards:
- Farstring without a screen answer is worse on Prism Wind than an Edgehand or
Longspoke line; `EQ-023` makes Longspoke a rational rear-pressure answer.
- Riftcaller's area completion is high value against Rootglass Spur, while the
Bailiff can interrupt an unprotected wind-up.
- Hearthguard/Longspoke resists and exploits push pressure; a fragile all-rear
line cannot dominate all nine offers.
- The steady route is safer but pays less; at least one pressured/elite route is
rational when the Company owns its visible counter.
## Settlement, Growth And Persistence
- Victory grants battle Coin and individual XP exactly once. XP is
`10 + 2*Round + 4*Risk`; only living deployed Recruits receive it.
- Current HP carries into the next Market. Existing P9.6 recovery remains the
only bounded healing fallback in this milestone; no free round heal is added.
- Cleared-Round count increments once. Line capacity becomes 7 only after Round
6 settlement and remains 7 after Round 7.
- Defeat returns to the same stable Market checkpoint with no Coin/XP and uses
the accepted recover-and-retry behavior; this slice does not implement death
Credit or permanent casualty.
- Save schema becomes version 2. Version 1 migrates by deriving four clears,
capacity 6, the deterministic Market-5 board, deployment from living Company,
empty Reserve/inventory where absent, and no Relay restoration.
- Market board hashes, purchase/dismiss/equip/deploy receipts, route history,
clear count and Relay state persist. Reload never redraws a board or reapplies
settlement. Battle interruption restores its pre-battle Market checkpoint.
## Presentation And Accessibility
- Landscape world remains full bleed and world/actors occupy at least 82%.
- Market uses the accepted Guild Hall background with a quartermaster lane,
standing Recruits, item pedestals and three route gates. Selection adds one
bounded contextual ribbon, not repeated cards.
- Reserve Recruits remain visibly staged behind the active line; capacity,
Company and deployed counts are separate labels.
- New professions may use current source-bound body rigs with deterministic
profession overlays and palette accents for this runtime slice. They may not
be claimed as final character art.
- Normal render covers Market 5 before/after hire, inventory/equip, Reserve,
each route family, role actions, defeat/retry, three settlements, Relay
restoration and Market 8 continuation.
- Both languages, 130% text, reduced motion, mute, low power, small/reference/
large landscape and portrait rotate notice remain bounded.
Human comprehension, fun, final visuals/listening, devices, packaging and
release remain open.
+188
View File
@@ -0,0 +1,188 @@
# P9.7 Windglass Market Expansion Implementation Plan
> Status: `ACTIVE`
> Active step: `P9.7-STEP-1 CONTENT AUTHORITY`
> 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 | `IN_PROGRESS` | Every future Market object and route resolves from validated data with readable names and effects. | Content registry, validator and focused tests pushed. |
| P9.7-STEP-2 Market domain | `PENDING` | Hire, dismiss, inventory, equip, deployment, Reserve and board progression commit atomically. | State/service/save-v2 migration and focused tests pushed. |
| P9.7-STEP-3 Battle expansion | `PENDING` | Six new professions, six enemies, four items and nine compositions create route-dependent outcomes. | Battle rules/service, counterfactual tests and regressions pushed. |
| P9.7-STEP-4 In-world runtime | `PENDING` | The player performs the complete Market and preparation flow through actor, pedestal and route-gate touches. | Controller/presentation, parsed-touch and normal-frame evidence pushed. |
| P9.7-STEP-5 Three-round continuation | `PENDING` | 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; six 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, receipts; version-2 migration and interruption-safe stable saves.
OUT OF SCOPE: new battle behavior and presentation.
OWNED FILES: runtime/p9_3 core state/service; runtime/p9_6 save service;
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: runtime/p9_3 controller and bounded presentation helpers/assets;
runtime/tests/p9_7 runtime/touch/capture tests; P9.7 status.
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 | `OPEN_STEP_2` | Current save version 1 does not store boards, deployment, inventory or route history. Step 2 owns an adjacent v1-to-v2 migration. |
| P97-I04 | `OPEN_STEP_4` | New profession rows do not yet have final bespoke sprite sets. P9.7 may use clearly labeled source-bound rig overlays; final content production remains open. |
## Current Evidence
- Baseline `583fb1e` is clean and upstream-equal.
- P9.6 local terminal and evidence remain unchanged.
- P9.7 has planning authority only until Step 1 code and focused tests commit.