|
| 1 | +// SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | +// SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 3 | += Cluster C11 (UI and accessibility coprocessors) — migration evidence (2026-06-05) |
| 4 | +:toc: macro |
| 5 | + |
| 6 | +[IMPORTANT] |
| 7 | +==== |
| 8 | +*Verdict: NO_NEW_BRAINS — wiring/senses cluster.* All 10 files are host-side |
| 9 | +senses (PixiJS UI components, coprocessor bridges, float-physics wiring). No |
| 10 | +new AffineScript kernels are required because: |
| 11 | +
|
| 12 | +1. The integer brain of `DualAlert.res` (alert-level ordinals, escalation, |
| 13 | + trigger-milli, scrub, overall-threat, dispatch predicates) was already |
| 14 | + extracted in *cluster C6* (`DualAlert.affine`, 613/613 parity, LOSSLESS |
| 15 | + boundary proof). `DualAlertCoprocessor.res` is the existing ReScript |
| 16 | + bridge to that wasm. |
| 17 | +2. `ForceLayoutCoprocessor.res` is a bridge to `forcelayout.wasm` (a |
| 18 | + float-only physics kernel — euclidean distance, repulsion/attraction |
| 19 | + velocity deltas, velocity decay, position integration, alpha cooling). |
| 20 | + The brain is f64-only; the float-wall convention defers it to host-side. |
| 21 | +3. `Button`, `HubButton`, `NavButton`, `Label`, `VolumeSlider`, |
| 22 | + `InventoryUI`, `HardwareWiring` are pure PixiJS/PixiUI components with |
| 23 | + zero separable integer computation. |
| 24 | +
|
| 25 | +No 4-gate recipe is applied; no new wasm is produced. |
| 26 | +==== |
| 27 | + |
| 28 | +toc::[] |
| 29 | + |
| 30 | +== File-by-file disposition |
| 31 | + |
| 32 | +[cols="3,1,4",options="header"] |
| 33 | +|=== |
| 34 | +| File | Disposition | Reason |
| 35 | +| `src/app/ui/DualAlert.res` | SENSES (brain in C6) | Integer core (`levelValue`, `levelColor`, `escalateLevel`, `scrubStep`, trigger-milli, cooldown-milli, `overallThreat`, `shouldDispatchAntiHacker`, `guardsCheckingTerminals`) already lives in `DualAlert.affine` (C6, 613/613 parity). Float progress/trigger-severity orchestration stays host-side. |
| 36 | +| `src/app/ui/DualAlertCoprocessor.res` | SENSES (bridge) | ReScript FFI wrapping `DualAlertCoprocessorBridge.js` → `dualalert.wasm`. Pure `external` declarations; no logic. |
| 37 | +| `src/app/popups/ForceLayoutCoprocessor.res` | SENSES (float-brain bridge) | Wraps `forcelayout.wasm` float kernel (euclidean, repelDv, attractDv, decayVelocity, integratePosition, decayAlpha). All f64 primitives; float-wall convention: brain deferred to host-side. |
| 38 | +| `src/app/ui/Button.res` | SENSES (PixiJS) | FancyButton nine-slice wrapper + FontScale + Audio SFX. Zero integer computation. |
| 39 | +| `src/app/ui/HardwareWiring.res` | SENSES (PixiJS) | Interactive patch-panel with float catenary sag (`computeSagLocal`), quadratic Bézier cable rendering, pointer-event wiring, string template port IDs. No separable integer brain. |
| 40 | +| `src/app/ui/HubButton.res` | SENSES (PixiJS) | Programmatic Graphics FancyButton variant. Zero integer computation. |
| 41 | +| `src/app/ui/InventoryUI.res` | SENSES (UI) | `formatQuickbar` maps inventory slots to HUD display records. No integer computation. |
| 42 | +| `src/app/ui/Label.res` | SENSES (PixiJS) | `Text.make` wrapper with centered anchor. Zero integer computation. |
| 43 | +| `src/app/ui/NavButton.res` | SENSES (PixiJS) | Sidebar navigation FancyButton with active-indicator Graphics. Zero integer computation. |
| 44 | +| `src/app/ui/VolumeSlider.res` | SENSES (PixiJS) | PixiUI Slider component factory. Zero integer computation. |
| 45 | +|=== |
| 46 | + |
| 47 | +== DualAlert — de-duplication verification |
| 48 | + |
| 49 | +The C11 cluster description names `src/app/ui/DualAlert.res` as a source file. |
| 50 | +C6's kernel inventory entry is: |
| 51 | + |
| 52 | +---- |
| 53 | +DualAlert.affine | DualAlert.res — dual-threat alert level machine |
| 54 | +---- |
| 55 | + |
| 56 | +Cross-check of C6 evidence versus C11 `DualAlert.res` content: |
| 57 | + |
| 58 | +* C6 `DualAlert.affine` exports: `level_value`, `level_color`, `escalate_level`, |
| 59 | + `scrub_step`, `trigger_escalates`, `trigger_progress`, `trigger_level`, |
| 60 | + `cooldown_progress`, `overall_threat`, `should_dispatch_anti_hacker`, |
| 61 | + `guards_checking_terminals`. |
| 62 | +* C11 `DualAlertCoprocessor.res` bridge methods: `levelValue`, `levelColour`, |
| 63 | + `escalateLevel`, `scrubStep`, `triggerEscalates`, `triggerProgress`, |
| 64 | + `triggerLevel`, `cooldownProgress`, `overallThreat`, `shouldDispatchAntiHacker`, |
| 65 | + `guardsCheckingTerminals` — exact semantic correspondence. |
| 66 | +* The float functions in `DualAlert.res` (`physicalSeverity`, `cyberSeverity`, |
| 67 | + `triggerPhysical`, `triggerCyber`, `updateCooldown`) operate on the mutable |
| 68 | + `alertState` record (float progress/cooldown fields) — these are host-side |
| 69 | + orchestration that feeds integer primitives to the wasm. |
| 70 | + |
| 71 | +Verdict: *no new brain needed*; C6's `DualAlert.affine` covers the integer surface. |
| 72 | +C6 evidence: `proposals/idaptik/migrated/EVIDENCE-C6.adoc` (Gate 2: 613/613 parity, |
| 73 | +Gate 3: LOSSLESS boundary proof, Gate 4: clean). |
| 74 | + |
| 75 | +== Host-side senses: ForceLayout physics |
| 76 | + |
| 77 | +`ForceLayoutCoprocessor.res` bridges the following float-only exports of |
| 78 | +`forcelayout.wasm`: |
| 79 | + |
| 80 | +* `euclidean(bridge, x1, y1, x2, y2): float` — Euclidean distance |
| 81 | +* `repelDv(bridge, dist, d, strength, radius): float` — repulsion velocity delta |
| 82 | +* `attractDv(bridge, dist, d, strength): float` — attraction velocity delta |
| 83 | +* `decayVelocity(bridge, v, decay): float` — velocity damping |
| 84 | +* `integratePosition(bridge, pos, v, alpha): float` — position integration step |
| 85 | +* `decayAlpha(bridge, alpha, alphaDecay): float` — simulation cooling |
| 86 | + |
| 87 | +All parameters and return values are `float`. This is a pure f64 physics |
| 88 | +kernel; the float-wall convention requires the brain to remain host-side |
| 89 | +(the AffineScript wasm backend has no f64 sqrt or general float codegen). |
| 90 | +No integer decomposition is applicable — the physics simulation requires |
| 91 | +continuous-domain arithmetic throughout. |
| 92 | + |
| 93 | +== Impact on remaining clusters |
| 94 | + |
| 95 | +C11 being NO_NEW_BRAINS does not affect the C9/C10/C12 roadmap. The |
| 96 | +`DualAlertCoprocessor` wasm is already live; the UI components remain host-side |
| 97 | +ReScript throughout Phase Ω. The completion-drive directive proceeds to *C9*. |
0 commit comments