Context
PR #14925 makes the changed-topology reconciler correct and fail-closed, but its exact-head DockTopologyReconciler.assignSlots() implementation explores every skip/pair branch in the window-assignment space. Direct dense probes at 72da2822baad921c86404ae8a4d7be59fe748783 measured approximately 431 ms for 8×8 and 5.4 s for 9×9. That cost is not a merge-safety defect while there is no runtime consumer; it becomes one before Demo-B scene G4 consumes the result.
Live latest-open sweep: checked the latest 20 open issues plus GitHub search, repository issue/discussion artifacts, Knowledge Base tickets, and the latest 30 A2A messages at 2026-07-10T05:57:03.906Z; no equivalent successor was found.
The Problem
The current exhaustive search is a useful correctness oracle, but its combinatorial growth makes ordinary multi-window restore latency unpredictable. Replacing it carelessly would reintroduce the greedy trap already disproved during review or weaken the deterministic tie contract that makes topology restore permutation-stable.
The Architectural Reality
src/dashboard/DockTopologyReconciler.mjs owns a pure Body-side assignment boundary. Its ordered objective is part of the contract:
- maximize mapped-slot cardinality;
- maximize summed Jaccard affinity;
- maximize summed structural affinity;
- choose the lexicographically smallest content signature;
- use live-index order only for content-identical candidates.
The solver must remain id-free, preserve workspace-global uniqueness and captured-item conservation, create no windows, and leave the planner/reconciliation result vocabulary unchanged. ADR 0029 §2.2 and #14668 remain the authorities; #14590 is the first planned consumer.
The Fix
Replace the production exhaustive traversal with a polynomial/scalable assignment solver that preserves the full ordered objective. Keep a bounded form of the current exhaustive algorithm in tests as an independent oracle for small matrices. Add randomized equivalence and permutation probes, plus a reproducible dense-topology benchmark that demonstrates the runtime curve before the Demo-B integration is enabled.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
DockTopologyReconciler.assignSlots(capturedDocs, liveDocs) |
ADR 0029 §2.2 + #14668 |
Same mapping/unmapped/unmatchedLive contract and exact objective ordering, implemented with a documented polynomial bound |
Existing fail-closed validation and reason classes remain unchanged |
Update method JSDoc with the chosen algorithm and complexity |
Exhaustive-oracle equivalence, permutation properties, focused dashboard specs, dense benchmark |
Decision Record impact: aligned-with ADR 0029.
Acceptance Criteria
Out of Scope
Changing affinity semantics; adding IDs; changing restore result shapes; UI work; window spawning; weakening validation; broad dashboard refactors.
Avoided Traps
- Do not restore the greedy captured-order algorithm; the existing greedy-trap spec is authoritative.
- Do not gain speed by dropping deterministic content ties or workspace-global invariants.
- Do not turn a benchmark into a hardware-fragile wall-clock CI gate; correctness properties remain the merge gate and benchmark evidence records the scale curve.
- Do not broaden this into Demo-B UI delivery.
Related
Parent: #13158
Related: #14668 #14925 #14590
Origin Session ID: de713f27-0e82-4960-b4c6-f281e0c36449
Retrieval Hint: "DockTopologyReconciler exhaustive assignment 8x8 9x9 polynomial solver content-stable tie conservation"
Context
PR #14925 makes the changed-topology reconciler correct and fail-closed, but its exact-head
DockTopologyReconciler.assignSlots()implementation explores every skip/pair branch in the window-assignment space. Direct dense probes at72da2822baad921c86404ae8a4d7be59fe748783measured approximately 431 ms for 8×8 and 5.4 s for 9×9. That cost is not a merge-safety defect while there is no runtime consumer; it becomes one before Demo-B scene G4 consumes the result.Live latest-open sweep: checked the latest 20 open issues plus GitHub search, repository issue/discussion artifacts, Knowledge Base tickets, and the latest 30 A2A messages at 2026-07-10T05:57:03.906Z; no equivalent successor was found.
The Problem
The current exhaustive search is a useful correctness oracle, but its combinatorial growth makes ordinary multi-window restore latency unpredictable. Replacing it carelessly would reintroduce the greedy trap already disproved during review or weaken the deterministic tie contract that makes topology restore permutation-stable.
The Architectural Reality
src/dashboard/DockTopologyReconciler.mjsowns a pure Body-side assignment boundary. Its ordered objective is part of the contract:The solver must remain id-free, preserve workspace-global uniqueness and captured-item conservation, create no windows, and leave the planner/reconciliation result vocabulary unchanged. ADR 0029 §2.2 and #14668 remain the authorities; #14590 is the first planned consumer.
The Fix
Replace the production exhaustive traversal with a polynomial/scalable assignment solver that preserves the full ordered objective. Keep a bounded form of the current exhaustive algorithm in tests as an independent oracle for small matrices. Add randomized equivalence and permutation probes, plus a reproducible dense-topology benchmark that demonstrates the runtime curve before the Demo-B integration is enabled.
Contract Ledger
DockTopologyReconciler.assignSlots(capturedDocs, liveDocs)Decision Record impact: aligned-with ADR 0029.
Acceptance Criteria
Out of Scope
Changing affinity semantics; adding IDs; changing restore result shapes; UI work; window spawning; weakening validation; broad dashboard refactors.
Avoided Traps
Related
Parent: #13158
Related: #14668 #14925 #14590
Origin Session ID: de713f27-0e82-4960-b4c6-f281e0c36449
Retrieval Hint: "DockTopologyReconciler exhaustive assignment 8x8 9x9 polynomial solver content-stable tie conservation"