1## Context23The engine scans words after controlled and automated movement, transforms objects, then resolves one contact pass. `resolveContacts()` can remove word entities but currently rebuilds indexes against the old `state.rules`. That leaves `state.rules`, `state.sentences`, object properties, automata carriers, and rule deltas describing a board that no longer exists. Tidewater's sunk `STOP` word demonstrates the resulting blocked next move.45## Goals / Non-Goals67**Goals:**89- Make every settled state and event describe rules physically present after destruction.10- Keep the existing one-pass contact order and deterministic turn boundary.11- Preserve exact Undo, reset, and restore behavior for the new settled state.1213**Non-Goals:**1415- A second contact cascade or another noun transformation after a rule word is destroyed.16- Changes to rule precedence, AND parsing, FLOAT, gates, or switch semantics.17- A new serialized field or a change to authored level data.1819## Decisions2021### Refresh derivations at the end of contact removal2223Contact effects use the rule set captured immediately before the contact pass. After removing entities, call the existing rule refresh path to parse surviving words and rebuild indexes and automata carriers. Reusing this path keeps reset, `step`, and `wait` consistent. Rebuilding only the cell index would retain the phantom rule; repeating the entire turn resolver would introduce contact cascades and transformation chains outside this fix.2425### Evaluate final victory from surviving entities and final properties2627Destruction is determined under pre-contact properties. The final victory check considers surviving entities and the refreshed rule set. Thus a destroyed `WIN` word cannot grant a phantom win; a destroyed `YOU` word updates control loss. This follows the existing promise that the settled event describes the surviving board. Contact destruction itself is not repeated if a refreshed rule changes `SINK` or `DEFEAT`.2829### Keep rule deltas relative to the pre-turn snapshot3031The event builder already compares the pre-turn and settled rule maps. Refreshing before that comparison reports a rule removed by destruction as `rulesRemoved`, including its original source IDs. No intermediate rule table becomes a public state.3233## Risks / Trade-offs3435- [Risk] A rule removed by SINK changes properties after contact effects have run. → Treat contact effects as a single pass; specify this boundary and add a fixture.36- [Risk] A final WIN check changes outcomes in levels that relied on a word destroyed during the same turn. → Require survivor-based WIN and run bundled proof and Tidewater solver checks.37- [Risk] Undo restores rules but indexes reference discarded objects. → Keep the existing index rebuild on Undo and add a destruction/Undo regression.3839## Migration Plan40411. Add a failing W8 fixture and the final-state rule contract.422. Refresh rule derivations after contact removals; verify step, wait, reset, Undo, and restore.433. Run the Node and browser suites, then ask the world team to re-solve Tidewater's seven proofs.4445## Open Questions4647None for this bounded fix. Broader contact cascades belong to a separate rule-order change.