4.0 KiB
P9.2 Authoritative Battle Implementation Plan
Status:
ACTIVEActive step:P9.2-STEP-1 AUTHORITATIVE_DOMAINBaseline:b43e73e439f786e59aefdd97f3ec6c9d76908b93Goal:docs/goals/PHASE9_2_AUTHORITATIVE_BATTLE_GOAL.mdContract:docs/runtime/PHASE9_2_AUTHORITATIVE_BATTLE_CONTRACT.mdProcess:docs/runtime/PLAN_DRIVEN_DEVELOPMENT_PROTOCOL.mdLedger:docs/reviews/PHASE9_GODOT_VERTICAL_SLICE_LEDGER.md
Player-Visible Stopping Point
P9.2 ends when the P9.1 final result can continue into one real horizontal automatic battle. The player sees both lines move, melee collide, rear roles act, HP change and one deterministic outcome. Pause, speed, inspect and legal retreat work through real touch. The result explains cause, survivors and next action.
Ordered Steps
| Step | Status | Player outcome | Verification | Commit boundary |
|---|---|---|---|---|
| P9.2-STEP-0 Contract and baseline | COMPLETE |
The next playable boundary and frozen scope are unambiguous. | Goal/contract/plan/checkpoint links; exact baseline; one active step. | Planning commit. |
| P9.2-STEP-1 Authoritative domain | IN_PROGRESS |
One fixed encounter resolves movement, contact, profession actions, HP, victory/defeat/timeout and retreat identically from the same inputs. | Domain marker; deterministic hashes; pause/speed/inspect invariance; retreat negative/duplicate boundaries. | Domain files and one focused test, pushed. |
| P9.2-STEP-2 Horizontal battle runtime | PENDING |
The player enters from the P9.1 result and watches real state drive the battlefield and HUD. | 844x390 normal render; event-to-actor bindings; no scripted phase authority. | Runtime/presentation files and focused test, pushed. |
| P9.2-STEP-3 Controls and result | PENDING |
Pause, 1x/2x, inspect and retreat are understandable; result gives cause/survivors/next. | Parsed touch; pre-tick retreat disabled; duplicate receipt; outcome pages zh/en 130%. | UI/result files and focused tests, pushed. |
| P9.2-STEP-4 Integrated gate and H5 | PENDING |
Owner can play the complete new encounter through a stable private H5. | Five profiles, three layouts, accessibility, strict logs, normal recording, runtime-only export and remote checks. | Evidence/delivery closure, pushed. |
| P9.2-STEP-5 Owner review | PENDING |
Owner judges movement, causality, controls and retreat decision without coaching. | Owner observations and at most one bounded repair batch. | Final closure, pushed. |
Current Step Contract
P9.2-STEP-1 AUTHORITATIVE_DOMAIN
Owned files:
runtime/domain/p9_2/battle_rules.gd
runtime/domain/p9_2/battle_state.gd
runtime/domain/p9_2/battle_service.gd
runtime/tests/p9_2/authoritative_battle_domain_test.gd
Required acceptance:
- fixed
100 msticks and exact actor/event order; - movement/contact and stable-ID profession actions;
- victory, defeat, timeout and retreat reachability;
- pause/inspect are mutation-free and speed is outside domain authority;
- retreat rejects before tick 50, is idempotent, resolves after 20 accepted ticks and loses to an earlier terminal outcome;
- same fixture/seed/retreat tick produces byte-identical snapshots and hashes;
- rejected commands preserve every public and internal state field;
- no edits to
runtime/main.gdin this step.
Issue Register
| ID | Status | Boundary | Disposition |
|---|---|---|---|
| P92-I01 | OPEN |
P9.1 battles are deterministic presentation fixtures rather than a reusable authoritative combat loop. | Step 1 builds an isolated P9.2 domain without rewriting P9.1. |
| P92-I02 | OPEN |
Existing product authorities contain later full-game casualty/save rules beyond this milestone. | P9.2 freezes permanent settlement and records only run-local survivors. |
| P92-I03 | OPEN |
P9.1 H5 cold start is multi-minute. | Do not optimize until Step 4; gameplay source remains the current priority. |
Stopping Rule
Finish one step, run its checks, commit and push before changing the next step to
IN_PROGRESS. A failure keeps the same step active. P9.3 casualty/recovery/save
does not begin inside this plan.