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

6.6 KiB

M42 Contract Choice Page View Refactor

Status

  • Plan: M42_CONTRACT_CHOICE_PAGE_VIEW_REFACTOR
  • Status: COMPLETE
  • Activated: 2026-08-26
  • Baseline: 1eea779 (M41_MARKET_PAGE_VIEW_PILOT_COMPLETE)
  • Owner authorization: continuation of the Owner-authorized layered Passive View + Presenter/ViewData + Domain/Application Service architecture. The next extraction is the existing M19 Contract Choice surface, before the larger Guild surface.

Objective

Extract the first-cycle Contract Choice page from entry_shell.gd into a passive, UI-only ABGContractChoicePageView while preserving the current framed composition, Company portraits, First Windglass Crossing facts, four difficulty options, local selection, Cancel-to-Guild behavior, one-receipt Contract creation boundary and normal 100% output.

This is a structural View migration, not a Contract/economy, Guild, Market, Save, localization or visual redesign.

Target boundary

EntryShell / composition root
  -> ContractChoicePageController.snapshot()
  -> presentation-ready ViewData
  -> ABGContractChoicePageView.render(ViewData)
  -> explicit View intents
  -> EntryShell application command boundary
  -> existing difficulty / Back / create_contract commands

M42-A — Architecture contract and inventory (COMPLETE)

Freeze the current Contract Choice stopping point before product code changes:

  • ContractChoiceLayout, ContractChoiceBody, ContractBoardScene, ContractCompanyScene, ContractCompanyMember_0/1, ContractReview, ContractDifficultySegments, ContractDifficultyWayfinder, ContractDifficultyStandard, ContractDifficultyStormbound, ContractDifficultyIronOath, ContractDifficultyCopy, ContractCreationFacts, ContractNotice, ContractChoiceFooter, ContractCancel and ContractConfirm are the frozen semantic nodes.
  • The View receives copied ContractChoicePageController.snapshot() data: Company/recruit presentation, route title/copy, starting Coin, Line capacity, 3/4/3 Market counts, localized difficulty options, selected difficulty and Confirm eligibility.
  • The View emits only explicit select_difficulty, confirm and back intents. No new visible Settings control is introduced by this milestone; existing Settings/context behavior remains outside the page extraction unless the inventory finds an already-approved hit area.
  • GuildContractService.create_contract remains the only transaction and persistence authority. Difficulty selection is local and must not mutate Company, Coin or Contract state; Cancel returns to Guild without a receipt.
  • Forbidden View dependencies are GuildContractService, persistence, RuntimeContentRegistry, compatibility facade, current_screen and EntryShell globals.
  • The normal 100% equivalence target is the existing M19 Contract Choice capture family at 760x360/zh_CN, 844x390/en, 1280x720/zh_CN and 1280x720/en; 130% remains non-blocking.

Activation baseline: source-bound attempt m42-contract-choice-baseline/20260826T011055Z-61940 passes ABG_M19_CONTRACT_CHOICE_CONTROLLER_OK, ABG_DEV3_GUILD_OK and ABG_M19_CONTRACT_CHOICE_CAPTURE_OK exactly once with strict diagnostics 0, four normal capture frames and owned cleanup. Evidence archive SHA-256: be4bd5ea328abde9516b6688cd7e9db3291e239d216c10421c838236f5d52e45.

M42-A is complete at the activation boundary. The current Contract Choice composition, focus/touch inventory, copied Controller snapshot, explicit three-intent boundary, invalid/missing Company fallback and Guild -> Contract Choice -> Market route are frozen without Runtime product changes.

Acceptance for M42-A

  • The current show_contract_choice() node tree, focus order, touch targets, invalid/missing Company fallback and Guild -> Contract Choice -> Market route are recorded before Runtime changes.
  • Existing markers remain green: ABG_M19_CONTRACT_CHOICE_CONTROLLER_OK, ABG_DEV3_GUILD_OK, ABG_DEV3_MARKET_OK and ABG_MVP_FIRST_CYCLE_AUDIT_OK.
  • A focused activation commit is pushed before M42-B product code.

Later steps

M42-B — Passive View extraction (COMPLETE)

  • Add runtime/entry/views/contract_choice_page_view.gd and an isolated View contract test.
  • Move only Contract Choice node construction/presentation into the View; keep Controller, GuildContractService, persistence and route semantics in their existing boundaries.
  • Translate deferred difficulty/confirm/back intents in EntryShell.

Closure: source 885506f adds ABGContractChoicePageView, mounts it from EntryShell, removes the former Contract Choice UI builders and translates only the deferred difficulty/confirm/back intents. The isolated View contract, M19 controller, DEV-3 Guild flow and four normal capture fixtures pass; the captured frames are byte-equivalent to the M42 activation baseline.

M42-C — Focused verification (COMPLETE)

  • Run the View contract, M19 controller, DEV-3 Guild/Market/Hire regressions, source-bound DEV-3 candidate and full MVP audit with strict diagnostics 0.
  • Compare normal Contract Choice captures with the M19 baseline at all four required fixtures and confirm byte-equivalence.

Closure: source da94e8a passes the isolated View contract, M19 controller, DEV-3 Guild/Market/Hire regressions, source-bound DEV-3 candidate and full MVP first-cycle audit with strict diagnostics 0, exact-once markers and owned cleanup. The four normal 100% Contract Choice captures are byte-equivalent to the M19 baseline. Evidence is recorded in docs/runtime/M42_CONTRACT_CHOICE_PAGE_VIEW_VISUAL_AUDIT.md.

M42-D — Handoff (COMPLETE)

  • Record source-bound evidence in docs/runtime/M42_CONTRACT_CHOICE_PAGE_VIEW_VISUAL_AUDIT.md.
  • Close only Contract Choice. Guild, Company/Roster, Battle, Economy, Save, packaging and release remain outside this plan.
  • Update the checkpoint and development ledger, then push the focused closure.

Closure: source da94e8a records the source-bound audit, strict diagnostics, four-fixture byte-equivalence and bounded scope. M42 is complete; Contract Choice is now a passive View and no later migration is activated by this plan.

Frozen scope

  • No GuildContractService, Contract/economy, Company, Market, Hire, Battle, Save or localization semantic changes.
  • No visible visual redesign, asset generation or static-master editing.
  • No mass rewrite of entry_shell.gd, global event bus or binding layer.
  • No deletion or staging of compatibility/history files, .uid, .import or prototype_incremental/.
  • No packaging, iOS export, signing, deployment, store or release work.

Final handoff

ABG M42 CONTRACT CHOICE VIEW PILOT COMPLETE