Files
Dune/docs/ECAZ_OCCUPANCY_IMPLEMENTATION.md
T
2026-09-08 07:37:52 +10:00

8.6 KiB
Raw Blame History

Ecaz territorial occupancy checkpoint

7 September 2026. This implements territorial co-occupation during movement within the existing gated Ecaz development scope. Full Ecaz, Advanced and expansion acceptance remain unfinished. The source contract and pre-change runtime review distinguish this rule from combined combat, collection and victory.

Behavior

Ecaz and its reciprocal ally count as one occupying faction when entering or passing through a board stronghold. They may share a territory permanently. Ordinary shipment, ground movement, Guild transport and the dedicated Fremen/Guild Ambassador destinations now use one public occupancy calculation. A third unrelated occupying faction is still excluded; BG advisors do not fill a stronghold. A concealed No-Field supplies public presence without exposing or reading its denomination.

Ending movement no longer sends a co-occupying Ecaz partner's forces to the Tanks merely because the ally already completed its turn. The table explains retained co-occupation in the chronicle and emits the existing optional Ecaz-coloured Occupy notice. Other alliances retain their existing departure rule. Shipment costs, physical ownership, elite allocation, movement limits, storm, mobile-stronghold admission and arrival interruptions keep their own checks. Explicit homeworld identity never inherits the territorial exception.

BG's established advisors may request fighters beside an Ecaz ally when the ordinary conditions allow it, including the start-of-movement battle preparation opportunity. New accompaniment locks remain binding. The AI uses the same occupancy checks for ordinary and marker destinations, ground paths and Ornithopter paths; its destination scoring no longer eliminates Ecaz's legal allied targets before candidate selection.

Implementation and evidence

Surface Implementation Verification
Public faction identity game/ecaz-occupy.ts: strict complete roster, reciprocal pair, explicit territory/homeworld identity, detached collision-free keys Nine identity tests in tests/ecaz-occupy.test.ts
Public board capacity game/occupancy.ts: fighter side count, allied destination restriction, route capacity Real entry, third-side, advisor and concealed-marker scenarios
Authoritative actions game/engine.ts: entry, route, completed turn, fighter requests and notice; game/movement-phase-quote.ts: advisor preparation Nineteen cases in tests/ecaz-occupy-movement.test.ts, including printed and BG-converted Baliset cancellation
Ambassador consistency game/fremen-ambassador.ts, game/guild-ambassador.ts: shared destination check with source-specific error wrappers Existing physical, advisor, cancellation and engine suites
Human and AI controls Existing forms; game/bot-mobility.ts, game/bots.ts; internal movement/faction guidance in game/reference.ts All four difficulty candidate lists and atomic retries; desktop/phone/keyboard browser journey
Persistence Existing authoritative room action and versioned SQL update Three production SQLite tests in tests/ecaz-occupy-recovery.test.ts: six isolated fixtures, both entering directions, private refresh, CAS races and zero-write invalid-alliance rejection

The broad suite exposed one actual preview regression: strict occupancy validation threw for a malformed alliance instead of returning an unavailable transport. The public transport eligibility wrapper now returns false for the typed identity error, while the authoritative action rejects the invalid roster. Two old tests had created duplicate Emperor factions when changing a recipient's unit type; those fixtures now swap native faction seats while retaining IDs, the intended alliance and all subtype assertions. Several existing assertions were updated for the shared capacity/error wording. Root reviewed all new helper and regression files and the independent integration report.

2,730 rules/client/component tests and 242 multiplayer tests pass: 2,972 total. This includes the eleven previously reviewed Tleilaxu force-helper tests; that helper still has no engine activation. TypeScript, lint and production build pass. Final logs are /tmp/dune-ecaz-occupancy-{rules,multiplayer,type,lint,build}-final.log. The focused post-fix run passed 79 tests in /tmp/dune-ecaz-occupancy-fixes.log. Twenty Basic games completed across two through six players and all four homogeneous AI levels with 11,446 accepted actions, zero rejected candidates/stalls/exceptions/invariant failures and 515 JSON round trips. The run took 120.514 seconds with seed 20261022; /tmp/dune-ecaz-occupancy-fullgames-final.{json,log} records its exact settings and results. The combined source fingerprint stayed 5f2df171f1c5399053fb968715c68ec51c2beead5dd5f8c5bc6e8f8cf7278bea throughout. This matrix checks Basic compatibility, not Ecaz full-game completion or comparative difficulty strength.

Browser and stored games

The named private QA room 8S3MRDEK was backed up at v109 and staged at v110. Through actual browser controls, Ecaz shipped two forces to Carthag beside its Emperor ally and Harkonnen, paid exactly two spice, moved two more from Imperial Basin and ended its turn. Carthag retained Ecaz four, Emperor one and Harkonnen one; Ecaz retained sixteen reserves, zero Tanks and eight spice. The next actor remained Harkonnen in phase five. Refresh restored the same forces/resources. On a 390×844 phone layout the form was readable, keyboard Tab focused Finish movement, and Return submitted it.

The completed QA was saved at v113, then only its pre-finish decision was restaged at v114 to inspect the subsequently added notice. Actual completion produced one Occupy notice and one explanatory chronicle entry at v115. The phone screenshot showed the notice without blocking the controls; a subsequent desktop refresh restored the same final table. The viewport was reset and the tab left available. Restricted artifacts are /tmp/dune-occupy-qa-{before,staged,completed-first,final}.json, /tmp/dune-occupy-notice-qa-staged.json and /tmp/dune-occupy-other-rooms.json.

All 2,496 pre-existing non-QA room versions and state hashes remain unchanged. The regression runs added test rooms; 2,527 rooms existed at the final read-only verification. No human game was modified. The previous 11:51 UTC controlled restart preserved all 2,497 then-existing rooms; the next hourly restart is due at 12:51 UTC during active development, subject to human-play safety. The removed automation remains removed.

Deliberate boundaries

This is not complete Occupy. Combined battle selection, dial ownership, support, casualty allocation, shared desert allocation, Collection cancellation and the three-co-occupied victory condition still require their own integration. The source audit's proposed numerical correction was found to be a community comment, not a designer ruling; the document now records the unresolved printed rounding conflict accurately. The separately verified designer explanation of territorial entry remains applicable.

No new mode gate was opened. These tests and the staged browser position do not establish a complete Ecaz or expansion game, nor AI strength calibration. The full application goal remains active.