Files
aetherbound-guild/docs/plans/M19_CONTRACT_CHOICE_CONTROLLER_PILOT.md
T

6.2 KiB

M19 Contract Choice Controller Pilot

Status

  • Plan: M19_CONTRACT_CHOICE_CONTROLLER_PILOT
  • Status: COMPLETE
  • Activated: 2026-08-25
  • Baseline: 17274a2 (M18_RECRUIT_REVIEW_CONTROLLER_PILOT_COMPLETE)
  • Owner authorization: the Owner authorized direct migration to the new code architecture; this is the next smallest first-cycle page seam after Market and Recruit Review.

Objective

Move the first-cycle Contract Choice page onto an explicit, UI-independent controller while preserving the accepted Guild -> Contract Choice -> Market route, difficulty selection, Cancel behavior, one-receipt Contract creation, visuals, economy and Save semantics.

Player/System Stopping Point

  • Contract Choice opens only for a Company with no active Contract and returns to the same Guild state when cancelled;
  • the controller owns copied Company/recruit facts, the First Windglass Crossing descriptor, difficulty options, selected-difficulty normalization, creation facts and the explicit confirm boundary;
  • GuildContractService.create_contract remains the transaction and persistence authority;
  • the existing Contract Choice View keeps its authored composition, node names, input targets, focus order and localization helpers;
  • no accepted page or gameplay rule changes.

Architecture Contract

Guild / Entry route
  -> ContractChoicePageController (view-data assembly)
  -> ContractChoiceViewData (deep-copied snapshot)
  -> Existing Godot Contract Choice View
  -> Existing GuildContractService.create_contract command

The controller receives a Company snapshot, selected difficulty and explicit locale inputs. It never loads, saves or mutates persistence and never accesses Godot nodes, current_screen, facade or Entry Shell globals. It does not duplicate Contract generation, receipt, hash or Save rules.

Ordered Steps

M19-A — Plan and boundary (COMPLETE)

  • Record the Contract Choice stopping point and frozen semantics.
  • Inventory the current show_contract_choice, difficulty, Cancel and Confirm branches.
  • Commit and push this activation boundary before product code.

Closure: source 29319d5 records the bounded Contract Choice migration boundary and freezes accepted page semantics, visuals and transaction service behavior before product code changes.

M19-B — Additive controller (COMPLETE)

Add runtime/entry/contract_choice_page_controller.gd and a focused test for:

  • missing Company and active-Contract rejection;
  • copied Company/recruit facts and First Windglass Crossing metadata;
  • all four difficulties, selected fallback and localized difficulty copy;
  • starting Coin, Line capacity and 3/4/3 Market creation facts;
  • confirm eligibility and explicit blocked reason;
  • deep-copy isolation from the supplied Company snapshot.

Closure: source 5758272 adds ABGContractChoicePageController and the focused ABG_M19_CONTRACT_CHOICE_CONTROLLER_OK test. The controller assembles copied Company/recruit facts, First Windglass Crossing metadata, localized difficulty options, creation facts and an explicit Confirm boundary without Godot-node, persistence or Contract-generation dependencies.

M19-C — View integration (COMPLETE)

  • Inject one controller through Entry Shell/AppServices.
  • Make Contract Choice rendering, selection and Confirm guard consume controller output.
  • Preserve existing visuals, node names, focus, callbacks and service calls.

Closure: source 43ab397 injects ABGContractChoicePageController through Entry Shell/AppServices and makes Contract Choice rendering, difficulty selection and Confirm guards consume copied controller output. Existing Guild -> Contract Choice -> Market behavior and GuildContractService.create_contract calls remain unchanged.

M19-D — Verification and handoff (COMPLETE)

  • Run the focused controller and existing Guild/Contract/Market regressions.
  • Run normal 100% Contract Choice captures at the required landscape fixtures.
  • Run the full MVP first-cycle audit and require strict diagnostics 0.
  • Close with a focused pushed commit and update the checkpoint.

Closure: source-bound verification from 43ab397 passes the focused Contract Choice controller, Guild, Contract, Market, Hire and Recruit Review regressions with exact-once markers and strict diagnostics 0; the retained archive is /private/tmp/aetherbound-guild-test-evidence/m19-contract-choice-source-bound/20260825T050013Z-4766. The normal 100% Contract Choice capture passes all four required fixtures at 760x360, 844x390 and 1280x720 in zh_CN/en; the retained archive is /private/tmp/aetherbound-guild-test-evidence/m19-contract-choice-capture-source-bound/20260825T050241Z-6553. The full source-bound MVP first-cycle audit passes ABG_MVP_FIRST_CYCLE_AUDIT_OK exactly once with 128 normal 100% frames, strict diagnostics 0, parsed touch coverage and owned workspace/process cleanup; the retained archive is /private/tmp/aetherbound-guild-test-evidence/m19-mvp-audit/20260825T050357Z-7383. Contract Choice now crosses the Controller/View boundary without changing accepted visuals, input, difficulty semantics, Contract receipts, economy, Save behavior or the Guild -> Market handoff.

Frozen Scope

  • No visual redesign or new assets/audio/animation.
  • No changes to GuildContractService, receipts, prices, Coin, Company, Contract generation, Save or Market semantics.
  • No migration of Guild, Party, Risk, Battle, Result or Recovery pages.
  • No mass rewrite or deletion of compatibility/history files.
  • No packaging, signing, store or release work.

Acceptance Checks

  • ABG_M19_CONTRACT_CHOICE_CONTROLLER_OK exactly once.
  • Existing ABG_DEV3_GUILD_OK, ABG_DEV3_CONTRACT_OK, Market, Recruit Review and Hire markers remain green.
  • Normal 100% captures, 48px targets, same-Guild Cancel and focus behavior remain green.
  • ABG_MVP_FIRST_CYCLE_AUDIT_OK remains green.

Commit Boundaries

  • M19-A: plan/checkpoint activation.
  • M19-B: controller and focused unit test.
  • M19-C: Entry Shell integration.
  • M19-D: evidence and closure.

Each boundary must pass its narrowest focused checks and be pushed before the next step becomes IN_PROGRESS; a failed check keeps the same step active.

Final Handoff

ABG M19 CONTRACT CHOICE CONTROLLER MIGRATION READY