Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
docs(verse): plan the Unreal Verse and freeze its contracts (#1096)
Ruben Lütke6a149c0b14bb
diff --git a/docs/verse/unreal/README.md b/docs/verse/unreal/README.mdnew file mode 100644index 0000000000..659b8082de--- /dev/null+++ b/docs/verse/unreal/README.md@@ -0,0 +1,62 @@+# Verse on Unreal Engine++The whole Verse moves from three.js to Unreal Engine 5.7. Deck 4 (the hangar)+becomes a destructible 1v1 battlefield against a single, much stronger bot.+The three.js Verse keeps running until the Unreal Verse reaches parity+(`parity.md`); one pull request then deletes it.++This folder is the source of truth for that work. Every agent working on the+Unreal Verse reads this file first, then its work package in+`work-packages.md`, then the contracts it touches in `contracts/`.++| File | What it holds |+|---|---|+| `README.md` | Decisions (this file) |+| `architecture.md` | Modules, process model, networking, bridge |+| `contracts/` | Frozen interfaces every package codes against |+| `work-packages.md` | The 22 fan-out packages: scope, owned paths, acceptance |+| `orchestration.md` | Phases, gates, rules for parallel agents |+| `parity.md` | Checklist the Unreal Verse must pass before three.js is deleted |++## Decisions++| Area | Decision |+|---|---|+| Scope | The whole Verse (bridge, ops, engineering, hangar). three.js stays until parity, then is deleted in one PR |+| Platforms | Windows and Linux built together (Linux cross-compiled from Windows); macOS later. No GPU means no Verse; the app itself keeps working |+| Hosting | `Verse.exe` runs as its own borderless window, launched and supervised by the Dodaios backend, linked by a local token-guarded WebSocket bridge. Never a child window (`SetParent`) |+| IDE side panel | Pixel Streaming of an Unreal view into the panel, running only while the panel is visible |+| Live terminals | Desk screens in Unreal show the pane's terminal cells, served by the backend. Taking over a desk brings the app to the front on that terminal |+| Repo | Public main repo, open source, under `unreal/`. Art as code plus Git LFS for unavoidable binaries. One File Per Actor. Never engine source, never Fab or Megascans content |+| Assets | Own work or CC0 only (`art/verse/LICENSES.md` stays the ledger) |+| Look | Photoreal (Lumen, Nanite), new style "Military-Industrial Noir": black steel, concrete, oil, wear, hard work lights, dust and haze. Accents sparse in amber, red, gold. Never cyan or violet |+| Camera | Duel: first person only; third person only for kill cam and finisher. Elsewhere overview, third and first person as today |+| Projectiles | Visible laser bolts at about 300 m/s, no drop. Own bolts amber, the opponent's red |+| Ammo | Magazines; tactical reload (round chambered) faster than empty reload |+| Recoil | Learnable pattern per weapon plus about 15 % random, camera kick, first-shot accuracy, recovery slower than the kick so sustained fire really climbs |+| Arsenal | Start: assault rifle, pistol, knife, Bulwark (deployable energy barricade), breach charge. Then SMG and DMR, later a large arsenal. All weapons fully black, fictional names, modelled on no real firearm |+| Movement | Walk, sprint, crouch, prone, lean left/right, slide, jump, mantle. Per-bone hit zones |+| Melee | Frontal: fast knife strike, high damage, not a one-shot. From behind or the flank within 1.5 m: a finisher, a guaranteed kill (about 2.5 s: throw to the ground, struggle as animation only, knife to the throat), paired animation with motion warping |+| Gore | Heavy blood, spatter on walls and floor, wounds at the hit location, pools, bloody finishers. No dismemberment. A setting switches to reduced (no blood, finishers cut away); the default is full |+| Destruction | Full physics: walls, cover, containers, glass, catwalks and ceiling panels break; the hall floor does not. The server decides every break; clients simulate debris. Repair drones rebuild broken parts after about 60 s |+| Arena | A dense zone of about 50 x 40 m inside the 100 x 62 m hall, three height levels. The hangar is a normal deck day to day and turns into the arena on demand |+| Mode | Endless 1v1 deathmatch. Respawn after 3 s at the spawn farthest from and out of sight of the opponent, short spawn protection that ends on the first own shot. Game mode logic is swappable for future modes |+| Networking | Server-authoritative from day one, also against the local bot (the bot is a player with its own controller). Online PvP later without a rewrite |+| Bot | Full movement including finishers, shoots through walls only at heard or believed positions, breaches, uses Bulwark and gadgets, learns the player within a match. Fair perception, no wallhack. Tiers normal, hard, elite plus an adaptive mode. Higher skill wins more often, never always |+| Duel entry | Armoury station in the hangar plus a quick-start button in the Verse bar |+| Progression | Duel wins award commander XP; duel statistics (wins, K/D, headshots, finishers) in the service record |+| Delivery | The Verse ships inside the normal installer; the updater's size cap is raised; Verse updates are delivered as delta packages |+| Testing | Fully autonomous: builds, tests, headless bot-vs-bot runs, screenshots, performance. The user plays at the end of integration |+| Legal | No names of other games, studios or real firearm makes or models anywhere: code, assets, commits, PRs, docs |++## What carries over from the three.js duel++Only rules and concepts carry over, never numbers. The numbers were tuned+for the reactor-shaft arena on deck 3 and for a heat-only blaster.++- The bot's fair-perception contract (`combat/observe.ts`, test `bot.test.ts:32-46`).+- The Ornstein-Uhlenbeck aim wander (`combat/bot/aim.ts`).+- Utility selection with hysteresis (`combat/bot/brain.ts`).+- Tiers as data (`combat/bot/tiers.ts`).+- The balance harness gates (`combat/harness/*`): no single trick beats hard,+ a skilled player model wins about 40 % against elite.diff --git a/docs/verse/unreal/architecture.md b/docs/verse/unreal/architecture.mdnew file mode 100644index 0000000000..edbc6a8e91--- /dev/null+++ b/docs/verse/unreal/architecture.md@@ -0,0 +1,468 @@+# Verse on Unreal: architecture++Target: Unreal Engine 5.7.1 (binary install, `C:/Program Files/Epic Games/UE_5.7`).+Project: `unreal/Verse/Verse.uproject`. Decisions it builds on are in+`README.md`; frozen interfaces go in `contracts/`. Facts about today's code+carry a file reference; everything else here is a design decision and says so.++## 1. Process model++Three parties, each its own process. The Dodaios desktop process (pywebview ++FastAPI backend in one process) owns everything; `Verse.exe` is a supervised+child that can die without taking the app down.++```mermaid+flowchart LR+ subgraph App["Dodaios desktop process"]+ UI["Web UI (WebView2)\nVerse launcher card, IDE side panel"]+ BE["FastAPI backend"]+ VH["verse host\n(dodaios/verse_host/)"]+ UI <-->|"/ws bus, REST"| BE+ BE --- VH+ end+ V["Verse.exe\nlisten server + local player + bot"]+ VH -->|"spawn, job object, env token"| V+ V <-->|"WS 127.0.0.1 /api/verse/bridge"| VH+ V -.->|"WebRTC loopback (panel only)"| UI+```++### 1.1 The verse host (new backend package)++| Piece | Path (planned) | Job |+|---|---|---|+| Supervisor | `dodaios/verse_host/supervisor.py` | Spawn, watch, restart, stop `Verse.exe` |+| Bridge server | `dodaios/verse_host/bridge.py` | The one WebSocket `Verse.exe` talks to |+| Relays | `dodaios/verse_host/relays/*.py` | Turn backend state and bus events into bridge topics |+| Capability probe | `dodaios/verse_host/probe.py` | GPU check, install check, "can this machine run the Verse" |+| Routes | `dodaios/ui/web/verse_routes.py` | `GET /api/verse/status`, `POST /api/verse/{launch,show,hide,stop}`, `POST /api/verse/settings/import` (one-time import of browser-stored settings, `contracts/bridge-protocol.md` §14), `WS /api/verse/bridge`, `WS /api/verse/signal` |++Supervisor rules:++| Rule | Value |+|---|---|+| Launch | Lazily, on the first `show` (Verse view opened, the launcher card's quick-start duel, IDE panel becomes visible). Never at app start |+| Containment | Windows job object with `KILL_ON_JOB_CLOSE`, so an app crash or quit kills `Verse.exe`. Linux: `prctl(PR_SET_PDEATHSIG)` plus process group. Never kill by parent PID (memory: `feedback_never_kill_process_tree_by_parent_pid_windows`) |+| Token | 256-bit, minted per launch, passed in the environment (`DODAIOS_VERSE_TOKEN`), never on the command line (command lines are readable by every process of the user and land in crash reports) |+| Liveness | Bridge heartbeat every 1 s; 5 s of silence = hung. Hung or exited: restart with backoff 1 s, 4 s, 15 s; after 3 crashes in 5 min stop: status `crashed`, the launcher card shows "Verse stopped, open the crash report" |+| Crash data | `<DATA_DIR>/verse/crashes/` (minidump + last log). Never uploaded automatically |+| Single instance | A named mutex in `Verse.exe`; a second launch hands its arguments to the first and exits |+| No GPU | Probe fails (no D3D12 SM6 adapter or under 6 GB dedicated VRAM; on Linux no Vulkan 1.3 device): status `unsupported`, the launcher card says so, the rest of the app is untouched |++`GET /api/verse/status` returns `{status, state, pid, vram_mb, fps, crash_report}`. `status` is one of `not_installed`, `unsupported`, `stopped` (not running, may launch), `running`, `crashed` (crash loop, needs a manual launch); `state` is the lifecycle state of section 1.3 while `running`, else `null`. The launcher card (WP17) and the parity checks (A-08, A-09) read these values.++### 1.2 Window and focus++| Topic | Decision |+|---|---|+| Window | Own top-level window, borderless windowed fullscreen (`r.FullScreenMode=1`) on the monitor the app window is on. No owner window, never `SetParent` / `WS_CHILD` (README Hosting) |+| Exclusive fullscreen | Not offered. Borderless keeps alt-tab instant and lets app popups and toasts stay visible |+| Show | Backend sends `lifecycle.show {monitor, reason}` (`contracts/bridge-protocol.md` §12); the desktop process, which holds the foreground, calls `AllowSetForegroundWindow(verse_pid)` first so Verse can take focus (Windows foreground lock) |+| Back to the app | One key inside the Verse (default `F10`, rebindable; `Esc` stays the in-game menu). Verse calls `AllowSetForegroundWindow(app_pid)`, sends `focus.return_to_app`, hides its window. The desktop process raises the app window. No global keyboard hook |+| Hidden means paused | On hide, minimize or focus loss to the app: the match pauses (design decision that keeps today's behaviour, `VerseStage.tsx:795`), rendering stops, audio mutes |+| Desk takeover | Verse sends `ide.focus_terminal {pane_id}`, hides itself; the backend publishes a bus event the web UI handles by opening the IDE on that pane, the desktop process raises the window |+| Linux | X11: `_NET_ACTIVE_WINDOW`. Wayland: an `xdg-activation` token handed over the bridge. See risk RK7 |++### 1.3 Lifecycle states of `Verse.exe`++```mermaid+stateDiagram-v2+ [*] --> Booting: launch+ Booting --> Visible: bridge welcome + first frame+ Visible --> Dormant: hide / focus back to app+ Dormant --> Visible: show (target under 300 ms)+ Dormant --> Panel: IDE side panel visible, full view hidden+ Panel --> Dormant: panel hidden+ Panel --> Visible: show full view+ Dormant --> Exiting: hidden 10 min, or GPU pressure, or app quit+ Visible --> Exiting: app quit+ Exiting --> [*]: state saved+```++| State | Rendering | Simulation | VRAM target |+|---|---|---|---|+| Visible | Full window | Full | at most 6 GB |+| Panel | Offscreen at panel size, streamed (section 6) | Decks only, no match | at most 3 GB |+| Dormant | Off (`bDisableWorldRendering`, viewport hidden, `t.MaxFPS 2`) | Paused; bridge ticks at 2 Hz | at most 2 GB (streaming pools trimmed) |+| Exiting | Off | Save match-free state (deck, position, settings), quit | 0 |++GPU pressure: the backend already knows when a Blender cook, local STT or a+local model wants the GPU (memory: dictation slow on a busy GPU). The verse+host sends `gpu.yield`; a Dormant Verse exits at once, a Visible one drops to+the Low scalability tier until the pressure ends.++## 2. Module map++C++ first, Blueprints only as thin data and presentation (design decision). One primary+game module, `Verse`, wires the others and is the only module allowed to+depend on everything; it holds the game instance, default classes and the+settings object. It is added to the planned list because a primary module is+required and keeping it thin stops any feature module from becoming the hub.++| Module | Type | Owns | May depend on (besides engine) |+|---|---|---|---|+| `VerseCore` | Runtime | Coordinate conversion (three.js y-up metres, yaw 0 = +Z, to Unreal Z-up centimetres), gameplay tags, log categories, seeded RNG, shared event structs (`FVerseHitEvent`, `FVerseFractureEvent`, `FVerseNoiseEvent`, `FVerseGadgetEvent`, `FVerseArenaSwitchEvent`, `FVerseSetSummary`), `FVerseInputFrame`, DataAsset schemas (tiers, weapons, gadgets, melee, penetration table, audibility), the event hub subsystem | nothing |+| `VerseBridge` | Runtime | WS client, `verse.bridge/1` codec, token hello, reconnect, topic subscriptions, typed feed subsystems (roster, panes, screens, progression), command sender | Core |+| `VerseMovement` | Runtime | Character class, custom movement modes, lean, prone, mantle, slide, per-bone hit zones on the physics asset | Core |+| `VerseDestruction` | Runtime | Destructible piece actors, piece state machine, server fracture authority, client debris, repair drones, penetration queries, navmesh updates | Core |+| `VerseCombat` | Runtime | Weapons, magazines, recoil, projectile sim, lag compensation, damage, melee and finisher, gadgets (Bulwark, breach charge) as abilities, game mode and rules (swappable `UVerseRuleset`) | Core, Movement, Destruction |+| `VerseGore` | Runtime (client cosmetic) | Blood decals, spatter, pools, wound masks, finisher gore, the reduced setting | Core (listens to `FVerseHitEvent` on the hub; never includes Combat) |+| `VerseDecks` | Runtime | Deck loading via World Partition and data layers, stations, the hangar day/arena switch, deck manifest import | Core, Bridge |+| `VerseCrew` | Runtime | Officers and technicians as pawns from roster and pane data, duty status, ranks, crew life loops | Core, Bridge, Decks |+| `VerseScreens` | Runtime | Desk monitors: terminal cell grids into render targets, chat tails, takeover trigger | Core, Bridge, Decks |+| `VerseBot` | Runtime (server only code paths) | `AVerseBotController` (an `AAIController`), fair perception, belief map, utility brain with hysteresis, StateTree tactics, aim model, tiers, in-match learning | Core, Movement, Combat, Destruction |+| `VerseUI` | Runtime (client) | HUD, menus, Verse bar, kill cam, service record, settings (gore, keys, `F10`) | Core, Bridge, Combat, Crew, Decks |+| `VerseStream` | Runtime | Pixel Streaming 2 session for the IDE side panel, panel camera, input mapping | Core, Bridge |+| `VerseHarness` | DeveloperTool (not in Shipping) | Automation tests, Gauntlet controllers, bot-vs-bot runs, screenshot and perf capture, balance gates | every runtime module |+| `Verse` | Runtime, primary | Game instance, default pawn/controller/mode classes, module startup | every runtime module except Harness |++```mermaid+flowchart BT+ Core[VerseCore]+ Bridge[VerseBridge] --> Core+ Move[VerseMovement] --> Core+ Dest[VerseDestruction] --> Core+ Gore[VerseGore] --> Core+ Stream[VerseStream] --> Core+ Stream --> Bridge+ Decks[VerseDecks] --> Core+ Decks --> Bridge+ Combat[VerseCombat] --> Move+ Combat --> Dest+ Crew[VerseCrew] --> Decks+ Screens[VerseScreens] --> Decks+ Bot[VerseBot] --> Combat+ UI[VerseUI] --> Combat+ UI --> Crew+ Verse[Verse primary] --> UI+ Verse --> Bot+ Verse --> Screens+ Verse --> Gore+ Verse --> Stream+ Harness[VerseHarness] --> Verse+```++DAG rules, enforced by a CI script that parses every `*.Build.cs`:++1. No edge that is not in the table. A new edge is a `contracts/` change.+2. Cross-module talk that goes "up" (Combat telling Gore about a hit,+ Destruction telling the Bot a wall broke) goes through Core event structs+ on the hub subsystem, never through an include.+3. `VerseBot` sees the world only through Combat's perception events and+ Destruction's piece-state queries; it never reads the opponent pawn's+ transform directly (fair perception contract, `combat/observe.ts`,+ `bot.test.ts:32-46`).+4. Plugins used: Chaos (Geometry Collection), GameplayAbilities, StateTree,+ EnhancedInput, PixelStreaming2, Iris, WebSockets. Mover and+ NetworkPrediction stay disabled (section 3.3).++## 3. Networking++### 3.1 Topology++Server-authoritative from day one (README). One code path, three ways to run it:++| Run | How | Used for |+|---|---|---|+| Local duel (shipped) | `Verse.exe` as a listen server; the person is the host's local player; the bot is a second pawn possessed by `AVerseBotController` on the server | Every normal session |+| Netcode test | `UnrealEditor-Cmd.exe Verse.uproject -server` plus two `-game` clients with `PktLag=60 PktLagVariance=10 PktLoss=1` | CI, so the person's pawn really runs as an autonomous proxy with prediction and correction |+| Online PvP (later) | A `VerseServer` target | Needs a source-built engine on the runner (binary installs cannot build Server targets); out of scope until PvP |++The listen-server host predicts nothing for itself, so the netcode test is+the only proof that prediction works; it is a required CI gate from the+first playable build (section 8).++Every gameplay mutation is behind `HasAuthority()`. Clients send input+(movement through the movement component, fire/ability through server RPCs+with a client timestamp), the server simulates and replicates state.++### 3.2 Replication++| Topic | Decision |+|---|---|+| System | Iris (`bUseIris = true` in `Verse.Target.cs`, `net.Iris.UseIrisReplication 1`) |+| Property style | Push model everywhere (`MARK_PROPERTY_DIRTY_FROM_NAME`); the same code then also runs on the generic system if Iris has to be switched off (risk RK2) |+| Server tick | `NetServerMaxTickRate=60`; pawns replicate at 60 Hz, pieces and pickups on change |+| Client frame rate | Uncapped up to the display (120+ target) |+| Collections | `FFastArraySerializer` for piece states, magazines in the world, match score |+| Projectiles | Not actors. The server runs a projectile manager that steps bolt segments (300 m/s, no drop) each tick. A fire event (shooter, weapon, seed, origin, direction, server time) goes out as an unreliable multicast; clients draw the bolt from it. The firing client draws its own bolt at once (predicted) and reconciles on the server's hit result |+| Hit validation | Server rewinds per-bone hit boxes to the shooter's view time (ring buffer, 1 s, every server tick), caps rewind at 250 ms |+| Abilities | GAS for health/armor attributes, damage effects, gadgets and the finisher; local prediction keys for gadgets. Weapon fire stays custom C++ (cheaper and deterministic per seed) |++### 3.3 Movement: CharacterMovementComponent, not Mover++Choice: `UVerseCharacterMovement` (a `UCharacterMovementComponent` subclass)+with custom modes. Mover 2.0 is not used in 5.7.++| Criterion | CMC with custom modes | Mover 2.0 |+|---|---|---|+| Networked prediction maturity | Production-proven saved moves, corrections, smoothing | Built on NetworkPrediction, both still marked experimental/beta in 5.7 |+| Iris | Supported path | NetworkPrediction's Iris path is newer and thinly documented |+| Root-motion sources (mantle) | `FRootMotionSource_MoveToForce` is predicted and replicated | Layered moves exist but less exercised over the network |+| Extra input (lean, prone) | `FCharacterNetworkMoveData` subclass via `FCharacterNetworkMoveDataContainer` | Native input structs (cleaner) |+| Capsule changes (prone) | Crouch path generalised to a second half-height | Free-form shapes (cleaner) |+| Risk if wrong | Contained: `VerseMovement` exposes `IVerseMovementQuery`; nothing else touches CMC | A plugin-level bug would block the whole duel |++Per move:++| Move | Implementation | Networked as |+|---|---|---|+| Walk, sprint, crouch, jump | Stock CMC; sprint as a compressed flag | Saved-move flags |+| Slide | `MOVE_Custom` + `CMOVE_Slide`: entered from sprint + crouch above a speed floor, low friction, decays to crouch | Custom mode in saved move |+| Mantle | Server and client both detect the ledge from the same trace at the same move time; a predicted root-motion source moves the capsule | Root-motion source id in move data |+| Prone | Capsule half height reduced like crouch, plus a horizontal "prone body" box for hits; turn rate and speed capped; prone needs floor clearance checks | Flag + capsule state |+| Lean | Not a movement mode: a quantised lean value (-1..1, 8 bits) in custom move data; drives the spine and camera offset, and the server uses the same value when it rewinds hit boxes | Move data field |++Hit zones are physics-asset bodies on the skeleton (head, neck, upper/lower+torso, arms, legs), so lean and prone change them automatically.++### 3.4 The bot as a player++`AVerseBotController` possesses an ordinary `AVerseCharacter`; it produces the+same input the local player produces (movement vector, look, fire, ability)+through a virtual input device on the server. No shortcuts: the bot moves,+reloads and mantles through the same code. The bot exists only on the server;+clients see a normal simulated proxy.++## 4. Destruction networking++```mermaid+sequenceDiagram+ participant S as Server (listen host)+ participant C as Client(s)+ participant B as Bot (server)+ S->>S: damage on piece P (bolt, breach charge, melee)+ S->>S: piece state machine: Intact -> Holed (seed, impulse)+ S-->>C: FastArray item P {state, health_q, seed, impulse, t}+ S-->>C: unreliable multicast FVerseFractureEvent (for instant debris)+ C->>C: apply same strain pattern locally, spawn debris (cosmetic)+ S->>S: swap P's gameplay collision to the authored "Holed" proxy+ S->>B: hub event: piece P changed (cover/LOS caches dirty)+ S->>S: navmesh tiles around P rebuilt+ Note over S,C: about 60 s later a repair drone: Repairing -> Intact, same path+```++| Topic | Decision |+|---|---|+| Authority | Only the server applies damage to pieces and decides a state change |+| Piece | One `AVerseDestructible` per breakable thing (wall panel, container wall, glass pane, catwalk segment, ceiling panel); stable id from One File Per Actor GUID |+| Gameplay state | Discrete enum per piece: `Intact, Damaged, Holed, Breached, Destroyed, Repairing`, plus quantised health (8 bit) and the last impact seed. Replicated in one `FFastArraySerializer`; only changed pieces cost bandwidth; late joiners get the array and spawn the broken look without debris |+| Gameplay collision | Comes from authored per-state proxy meshes, never from simulated debris. Server and clients then agree on line of sight, penetration and nav, and the bot's cover logic stays deterministic |+| Debris | Chaos Geometry Collection simulated on each client only. GC replication off. Debris ignores the pawn and weapon trace channels, sleeps after 3 s, despawns after 10 s, capped (section 7) |+| Determinism | Not required for debris. The seed and impulse make the break look the same on all clients most of the time; a different crack pattern is cosmetic and allowed |+| Penetration | A material table in Core (`DA_PenetrationTable`: material, thickness, damage falloff); the server traces through pieces using the proxy geometry |+| Bot | Hears breaks as noise events with position error; updates cover and belief map from piece states it can perceive; may shoot through a piece only at a heard or believed position |+| Repair | Server timer per piece; drone flight is cosmetic, the state change is authoritative |+| Never breaks | The hall floor (README) |++## 5. The bridge++### 5.1 Transport++| Topic | Decision |+|---|---|+| Endpoint | `ws://127.0.0.1:<backend port>/api/verse/bridge`, served by the existing FastAPI app. No second port: the backend port is already passed around and guarded |+| Peer check | Loopback peers only, even when the backend is bound wider for remote mode |+| Auth | First frame `hello {token, protocol: "verse.bridge/1", build}`; token checked against the launch token (same hello pattern as the mission socket, `missions_ws_routes.py:223-259`); wrong or late (5 s): close 4401 / 4400 |+| One client | A second authenticated connection replaces the first (Verse restarted) |+| Frames | JSON text frames for control and feeds; binary frames for terminal cell deltas |+| Ordering | Every server frame carries `seq`; on reconnect Verse sends `last_seq` and gets a fresh snapshot per topic (no replay log) |+| Back pressure | Bounded queue per topic; screens drop to the newest frame, events never drop (they are small) |+| Spec | `contracts/bridge-protocol.md` (frozen before fan-out) |++### 5.2 Topics: what the backend has today and what is missing++| Topic | Backend source today | Today's delivery | Must add |+|---|---|---|---|+| `roster` | `GET /api/society/agents` (`society_routes.py:378`): rows with `run_state` paused/waiting/working/idle and `waiting_reason` | Poll (web Verse: 30 s plus invalidation 5-6.5 s) | Relay that snapshots on subscribe and re-reads on `SocietyRoomChanged`, `SocietyMessageSent`, `SocietyResultPosted`, `SocietyTeamChanged` (`core/events.py:2514-2616`), 30 s safety re-read |+| `panes` | `GET /api/agentic-ide/panes`; `AgenticIdePaneActivity` already carries the row's activity half (`core/events.py:984`); `AgenticIdeTerminalsAdded/Closed`, `AgenticIdeWorkspaceChanged` | Push on `/ws` (bus `subscribe_all`, `server.py:1832-1859`) plus 4 s poll | Relay that forwards these events as-is plus a snapshot |+| `screens` | `GET /api/agentic-ide/screens` (`agentic_ide_routes.py:4518`) reads `screen_feed.collect_screens`: plain text rows, cursor, `at`; caps 8 panes, 60 rows, 240 cols (`agentic_ide/screen_feed.py:28-35`) | Poll, about 450 ms | See 5.3 |+| `chat_tails` | The desk chat tail the web Verse polls (2.5 s, at most 6 agents) | Poll | Relay on `SocietyMessageSent` instead of polling |+| `meetings`, `groups` | Existing meeting and group reads | Leased poller plus socket events | Relay, same events |+| `progression` | `GET /api/progression` (`progression_routes.py:73`), `ProgressionAwarded` event | Read plus event | Relay; plus duel stats (below) |+| `locale` | Frontend i18n chunk `ship`, 5 locales | Bundled in the web app | Sent in `welcome` from the same JSON files, so a string change needs no Unreal rebuild |+| `companion` | Active pet id and look (`companionPetStore` source today) | Read by the web Verse | Relay `companion.snapshot` / `companion.update` (`contracts/bridge-protocol.md` §14) |++Commands Verse sends (all mapped onto existing backend calls, executed by the+relay in-process, not via HTTP):++| Command | Backend action |+|---|---|+| `agent.create` | Same code as `POST /api/society/agents` (`society_routes.py:434`) |+| `pane.open`, `agent.open`, `ide.focus_terminal` | New bus event the web UI handles (open view, focus pane); desktop process raises the window |+| `launcher.start` | Same code the web launcher uses (opens panes, sends briefs) |+| `progression.action` | `POST /api/progression/actions` (`progression_routes.py:100`): `daily_visit`, `deck_discovered`, `inspection`, `walk_together`, `team_briefing`, `simulator_round`, `simulator_record` |+| `duel.result` | New: one result per finished set (plus one `unfinished` result when the person leaves mid-set), server-paid `duel_won` / `duel_lost` rules and a duel stats store (wins, K/D, headshots, finishers) for the service record. Today no XP rule mentions a duel (`dodaios/progression/rules.py:131-146`) |+| `agents.open_list`, `group.open`, `simulator.open`, `ide.open`, `launcher.cancel`, `settings.set`, `progression.told` | `contracts/bridge-protocol.md` §14 |+| `lifecycle.state`, `lifecycle.ready`, `lifecycle.bye`, `window.state`, `focus.return_to_app`, `panel.stream_state` | verse host (`contracts/bridge-protocol.md` §12) |++### 5.3 Terminal cells across the process boundary++Today's in-world screens paint the IDE's in-page xterm buffers+(`lib/liveTerminals.ts`); that memory lives in WebView2 and cannot reach+`Verse.exe`. The backend already keeps its own replayed screen per pane:+`ScreenBuffer` (`agentic_ide/screen.py:52`) is fed by every PTY's output,+also for remote panes, and is what `/screens` reads. What it lacks:++| Gap | Why it matters | Addition |+|---|---|---|+| No colour or style: SGR is parsed and dropped (`screen.py` docstring) | Monitors would show grey text, unlike the IDE | A styled mirror: a second, attribute-keeping buffer (fg/bg as 256-colour or RGB, bold, dim, inverse, underline) created only for panes the Verse subscribes to, seeded from the pane's replay bytes and fed from the same output callback as a non-claiming viewer (the PTY socket already has a `claim=0` bystander mode, `agentic_ide_routes.py:5567+`). The base buffer stays dependency-free and untouched |+| Poll only | 450 ms latency, full rows every time | Push: per pane, dirty rows only, coalesced to at most 10 Hz, as a binary frame (pane id, row index, run-length cells) |+| Cap of 8 panes | Fine for now | Verse subscribes only to desks within view distance and changes the set as the camera moves; cap stays 8 |+| No geometry events | Monitor needs cols/rows | Size sent with each snapshot and on resize |++Takeover stays out of process: Unreal never hosts a live terminal. Taking over+a desk brings the app to the front on that pane (README).++Rendering on the Unreal side: one glyph atlas (the IDE's font, licence+checked, 13 px reference size) and one render target per monitor; dirty rows+are drawn with a canvas or a material quad; a monitor far from the camera+updates at 2 Hz.++### 5.4 Data flow++```mermaid+flowchart LR+ PTY["Pane PTYs\n(local and remote)"] --> SB["ScreenBuffer per pane\n(existing)"]+ PTY --> SM["Styled mirror\n(new, subscribed panes only)"]+ Bus["Event bus\nSociety*, AgenticIde*, ProgressionAwarded"] --> R+ Roster["Society runtime roster"] --> R+ Prog["Progression store"] --> R+ SM --> R["verse host relays"]+ R -->|"verse.bridge/1 snapshots + deltas"| VB["VerseBridge subsystems"]+ VB --> Crew["VerseCrew"]+ VB --> Screens["VerseScreens"]+ VB --> UI["VerseUI"]+ UI -->|"commands"| R+ R --> Act["create agent, open pane, progression actions, duel result"]+```++## 6. Pixel Streaming for the IDE side panel++The compact Verse in the IDE side panel (`OfficeTab.tsx:57`, engineering+deck) becomes a Pixel Streaming 2 view of `Verse.exe`.++| Topic | Decision |+|---|---|+| Process | The same `Verse.exe`, no second instance. In the Panel state it renders offscreen at the panel's size with the panel camera |+| Both visible at once | The full window wins. The panel shows the last streamed frame with "Verse is open" and stops the stream, so the GPU never renders two views |+| When | Stream starts when the panel becomes visible and stops within 1 s of it being hidden, scrolled away or the app minimised (`IntersectionObserver` + page visibility). A stopped stream plus a hidden full view lets the Verse go Dormant |+| Signalling | Served by the backend (`WS /api/verse/signal`, same token rules), so no extra Node process ships. Loopback ICE host candidates only, no STUN/TURN |+| Codec | Hardware encoder, H.264 (AV1 when the encoder offers it), 30 fps, bitrate cap 8 Mbit/s |+| Frontend | The Pixel Streaming frontend library (MIT) inside the panel component |+| Input | Mouse and keys over the data channel; panel is overview and walking only. The duel never runs in the panel (design decision: the stream adds latency that twitch input cannot hide) |+| Fallback | Stream fails or Verse unsupported: the panel shows the plain card it would show without a GPU |++## 7. Performance budgets++Reference box: RTX 5070 Ti 16 GB, Ryzen 7 7800X3D (8 cores, 16 threads), 32 GB RAM, monitors 2560x1440+(primary) and 3840x2160 (`reference_hardware.md`). The GPU is shared with+local STT, local models, Blender cooks and WebView2, so VRAM is the hard limit,+not frame time.++| Budget | Target on the reference box | Measured by |+|---|---|---|+| Frame rate, 1440p native (TSR at 100 %), "High" scalability preset with Lumen and Nanite | 120 fps average, p99 frame at most 11 ms in the duel | Harness perf capture, fixed bot-vs-bot replay |+| Frame rate, 4K output (TSR from about 1440p) | 90 fps average, p99 at most 14 ms | same |+| GPU frame split at 1440p (8.3 ms) | Nanite + base pass 2.0, Lumen GI + reflections 2.5, virtual shadow maps 1.2, translucency/VFX/decals 0.8, post + TSR 1.0, headroom 0.8 | `stat gpu` / Insights |+| Game thread | at most 4 ms (bot at most 0.5 ms per server tick) | Insights |+| Physics | at most 2 ms with the debris cap hit | Insights |+| VRAM, Visible | at most 6 GB (`r.Streaming.PoolSize` and Nanite pool capped) | `stat rhi`, NVML via harness |+| VRAM, Panel / Dormant | at most 3 GB / 2 GB | same |+| System RAM | at most 4 GB working set Visible, 1.5 GB Dormant | Harness |+| Dormant CPU | under 1 % of one core, zero GPU frames | Harness |+| Cold start to first frame | at most 8 s (PSO precache plus a shipped PSO cache) | Harness timer |+| Dormant to Visible | at most 300 ms | Harness timer |+| Panel stream | at most 1.5 ms GPU per frame at 960x600, glass-to-glass under 80 ms | Harness |+| Bridge | screens at most 200 KB/s total; Unreal monitor updates at most 0.3 ms game thread per frame | Bridge counters |+| Destruction | at most 400 active debris bodies, at most 64 fracture events/s, about 64 bytes per event | Counters |+| Network (future online) | server to client at most 128 kbit/s steady, bursts on destruction | Netcode test |+| Size | Verse payload at most 2 GB compressed at parity; a typical update delta at most 300 MB (IoStore chunking by deck) | Package step |+| Floor | D3D12 SM6 or Vulkan 1.3, 6 GB VRAM: Low preset 60 fps at 1080p | Probe + manual |++A budget breach fails the nightly perf job; the PR lanes only check what they+can (size, memory under `-nullrhi`).++## 8. Build and CI++### 8.1 Toolchain++| Item | Decision |+|---|---|+| Engine | Binary 5.7.1 install, never in the repo (engine EULA). Version pinned in `Verse.uproject` and checked by CI |+| Windows compiler | Visual Studio 2022 Build Tools with the MSVC and Windows SDK versions 5.7 requires; not installed on the dev box on 2026-11-02, first setup step |+| Linux | The engine's clang cross-compile toolchain for 5.7, installed on the dev box, `LINUX_MULTIARCH_ROOT` set; version pinned in `unreal/Toolchain/toolchains.json`. Linux Game target built from Windows; tests run in a Linux container or VM on the same box |+| DDC | Local Zen DDC on `C:` capped at 40 GB (106 GB free on 2026-11-02, `orchestration.md` §4); `-ddc=` policy in `unreal/Toolchain/ddc.json`. No shared cloud DDC |+| Repo | `unreal/` with a nested `unreal/Verse/.gitattributes` routing `*.uasset`, `*.umap` and the few other allowed binaries to LFS; One File Per Actor; a nested `unreal/Verse/.gitignore` ignores `Binaries/`, `Intermediate/`, `Saved/`, `DerivedDataCache/`. All repo gate rules are in section 8.4 |+| Targets | `Verse.Target.cs` (Game) and `VerseEditor.Target.cs` only. `VerseHarness` is listed only in the Editor target; the `VerseServer.Target.cs` that exists today is deleted in G0 (binary installs cannot build Server targets, section 3.1) |++### 8.2 Runner and lock++| Item | Decision |+|---|---|+| Runner | One self-hosted GitHub Actions runner on the dev box, labels `self-hosted, windows, unreal`, running as a dedicated low-privilege user |+| Public repo safety | Self-hosted jobs never run for pull requests from forks. They run on `merge_group`, pushes to `main`, nightly, and same-repo PRs that touch `unreal/**` (checked by `github.event.pull_request.head.repo.full_name`) |+| Workflow policy | Every `unreal-*.yml` declares `permissions:` (least privilege) and pins each action to a 40-character commit SHA (`scripts/ci/check_workflow_policy.py`). A lane that must block merges is wired into the one required check, `CI gate`: it becomes a job in `ci.yml` listed under `gate.needs` that reports success without work when the change touches no `unreal/**`, `art/verse/**` or `docs/verse/unreal/**` path. A separate path-filtered workflow is never made a required check (it would block every PR that does not trigger it) |+| Concurrency | Workflow `concurrency: unreal-build` plus a machine-wide lock file (`C:/demo/.locks/gpu-heavy.lock`) taken by `scripts/unreal/with_lock.py`. The same lock wraps local agent builds, cooks and `scripts/verse/cook.py` Blender cooks, so at most one compile/cook/bake uses the box at a time. Waiters queue, they do not fail |+| Quiet hours | GPU perf captures run only in the nightly window and skip when the person is active (input in the last 5 min) |+| Agents | Parallel work-package agents never invoke UBT/UAT directly; they call `scripts/unreal/build.py`, which takes the lock |++### 8.3 Lanes++| Lane | Where | Runs |+|---|---|---|+| `unreal-static` | GitHub-hosted, every PR touching `unreal/**`, `art/verse/**` or `docs/verse/unreal/**` | `Build.cs` DAG check (section 2), forbidden-name scan (README Legal, hashed list, section 8.4), LFS pointer check, per-file size gate, forbidden folder names (section 8.4), clang-format, asset licence ledger check |+| `unreal-build` | Self-hosted, PR + merge queue | Win64 Development Editor + Game, Linux Game (cross), automation tests under `-nullrhi`, netcode test (dedicated + 2 lagged clients, 2 min smoke) |+| `unreal-gauntlet` | Self-hosted, merge queue (short) + nightly (long) | Headless bot-vs-bot balance runs and gates (no trick beats hard, skilled model about 40 % vs elite) |+| `unreal-perf` | Self-hosted, nightly | Fixed replay on the GPU, screenshots, the budgets in section 7 |+| `unreal-package` | Self-hosted, release tags | BuildCookRun for Win64 and Linux, IoStore + delta packaging, hand-off of unsigned binaries to the existing signing workflow |++Done gate for Unreal work: the lane that covers the change is green, and for a+visible change a harness screenshot of the running build is attached to the+PR (the Unreal counterpart of "visible in the running app").++### 8.4 Repo gates the Unreal work must pass++The repo's commit hooks (`.githooks/*`, calling `scripts/ci/*`) and the CI+gates in `scripts/ci/run_gates.py` apply to every Unreal change. These rules+keep the first and every later Unreal PR green. G0.12 (`work-packages.md`)+lands the repo changes in one PR by the integration owner.++| Topic | Rule |+|---|---|+| Git LFS upload | `core.hooksPath` points at a shared `.githooks/`, so `git lfs install` cannot add its own pre-push hook and a plain `git push` uploads pointers without objects. G0.12 adds `git lfs pre-push "$remote_name" "$remote_url" < "$refs_file"` to `.githooks/pre-push`, guarded by `command -v git-lfs`; `scripts/agent_land.py` also runs `git lfs push origin <branch>` before `git push` when the diff holds an LFS path. The `unreal-static` LFS pointer check fails a PR whose objects are missing on the remote |+| LFS for users | A committed `.lfsconfig` with `[lfs] fetchexclude = unreal/**` keeps installs and updates from downloading Unreal binaries (installer `git clone --depth 1`, updater fetches in `dodaios/core/main_follow.py` and `dodaios/ui/web/update_routes.py`). The dev box, agent worktrees and the self-hosted runner override it with `git config lfs.fetchexclude ""`. WP22 also sets `GIT_LFS_SKIP_SMUDGE=1` in those git calls |+| Release source archive | The root `.gitattributes` gets `unreal/** export-ignore`, so the `git archive` source tarball (`scripts/ci/release_assets.py`) never carries the Unreal tree; the Verse ships as its own package (README Delivery) |+| Ignored folders | The root `.gitignore` ignores the folder names `build/`, `models/`, `env/`, `logs/`, `dist/`, `secrets/`, `credentials/`, `traces/`, `blobs/` and file names `Screenshot *`; Windows matches them case-insensitively, Linux CI does not. Rule: no folder under `unreal/` or `art/verse/` carries one of these names, in any case. The only exception is the engine-required `unreal/Verse/Build/` (platform icons and resources), which the nested `unreal/Verse/.gitignore` re-includes with `!Build/`. Toolchain pins live in `unreal/Toolchain/`, not `unreal/Build/` |+| Nested ignore | `unreal/Verse/.gitignore`: `Binaries/`, `Intermediate/`, `Saved/`, `DerivedDataCache/`, `**/Binaries/`, `**/Intermediate/`, `*.sln`, `*.VC.db`, `.vs/`, then `!Build/` |+| Junk gate | `scripts/ci/check_repo_junk.py` blocks `.mp4 .mov .webm .mkv .avi .gif .wav .flac .aif .aiff .blend .psd .kra .xcf .exr .fbx .zip .7z .rar .tar .gz .bak .orig` anywhere, any path segment named `video`, `videos`, `film`, `films`, `renders`, `evidence`, `recordings` or `screenshots` (any case), and any file over 5 MB that is not an LFS pointer. Rule: source `.fbx`, `.wav`, `.exr` and recordings are never committed, only the imported `.uasset`; no folder carries one of those names (evidence goes to `Saved/Harness/proof/`, screenshot ground truth to `unreal/Verse/Tests/GroundTruth/`). The 5 MB cap stays as the backstop for a binary committed without LFS. A true exception goes into `scripts/ci/repo-junk-allowlist.txt` with a reason, in the same PR |+| Language | `scripts/ci/check_no_new_german.py` scans added lines of `.md`, `.json`, `.ini`, `.py`, `.ts` and other text files: English only. `.cpp`, `.h`, `.cs`, `.uproject` and `.uplugin` are not scanned, so reviewers check them |+| Design references | `scripts/ci/check_design_references.py` fails a design verb ("inspired by", "modelled on", "adapted from", "borrowed from", "copied from") within 60 characters of a software product name, and "<Product>-style" or "<Product>-like". Never put those verbs near a capitalised product word (the skin name "Arc Storm" counts) |+| Docs privacy | `scripts/ci/docs_privacy_scan.py` scans every tracked `docs/` file: no user-profile paths (Windows `Users` folders, including short 8.3 temp paths, POSIX home folders), no consumer email addresses, no account SIDs, no maintainer name. The engine install path under `Program Files` is fine |+| Doc location | Unreal docs stay under `docs/verse/unreal/`. `docs/plans/**`, `docs/superpowers/**`, `docs/qa/**`, `docs/handoffs/**` and `docs/diagnostics/**` are withheld from the public tree; `docs/product/**` needs a front-matter manifest |+| Agent files | No `CLAUDE.md` or `CLAUDE.local.md` anywhere under `unreal/`, `art/` or `docs/` (`scripts/ci/check_agents_md.py`) |+| Keys | No `*.key`, `*.key.enc` or PEM blocks; no secrets in `Config/*.ini` (`check_no_private_keys.py`, `privacy_pre_push.py`) |+| Shell scripts | Every tracked `*.sh` must parse under bash 3.2 |+| Persona words | `tests/unit/brain/test_persona_no_trademark.py` scans `dodaios/**` and `art/**`, so art builders under `art/verse/` follow it |+| Forbidden names | No gate in the repo scans for names of games, studios, franchises or firearm makes and models, and `.cpp`, `.h`, `.cs` and `.uasset` metadata are not text-scanned. `scripts/unreal/check_forbidden_names.py` (WP10) closes that gap in `unreal-static` and the pre-commit run of `build.py`. Its list is stored only as SHA-256 hashes of normalised single words and two- and three-word sequences (`scripts/unreal/forbidden_names.sha256`), so the repo never contains the names it forbids; the integration owner maintains the list outside the repo |+| PR titles | Conventional Commits, `type(verse): subject`, lower case, imperative (`feat(verse): …`, `docs(verse): …`). On a branch with several commits `gh pr create --fill` uses the branch name, so run `gh pr edit <n> --title "…"` straight after landing |++## 9. Open technical risks++| # | Risk | Why | Mitigation / decision point |+|---|---|---|---|+| RK1 | Balance net lost | The TS harness ran 16,800 duels in 1.5 min; Unreal headless is far slower | Gauntlet runner in the first phase; run at `-nullrhi`, fixed 60 Hz, several processes in parallel under the lock; decide the run count per gate from measured speed |+| RK2 | Iris maturity in 5.7 | Some engine features and plugins still assume the generic replication system | Push model only, so switching Iris off is one setting; netcode test runs on both nightly |+| RK3 | CMC custom moves desync | Mantle and prone are the classic correction sources | Correction counters in the netcode test with a gate (corrections per minute); revisit Mover at the next engine upgrade behind `IVerseMovementQuery` |+| RK4 | Listen server hides prediction bugs | The host never predicts | Netcode test is a required gate, not optional |+| RK5 | Destruction vs bot and nav | Holes change cover, LOS and paths | Per-state proxy collision, nav tile rebuild per state change, bot belief map; harness scenario "wall opened mid-fight" |+| RK6 | VRAM contention | 16 GB shared with STT, models, Blender | Hard pool caps, Dormant/exit policy, `gpu.yield`; measure with real dictation running |+| RK7 | Foreground and focus | Windows foreground lock, Linux Wayland activation | `AllowSetForegroundWindow` hand-off both ways; manual test matrix; Wayland via `xdg-activation` token |+| RK8 | Linux build untested | Cross-compile with a binary engine, Vulkan drivers, Wayland | Linux Game target in `unreal-build` from the first commit; a Linux VM smoke run nightly |+| RK9 | Pixel Streaming protocol drift | Frontend library and backend signalling must match PS2 in 5.7 | Pin library version; signalling contract test against the plugin |+| RK10 | Styled mirror cost | A second parser per subscribed pane on the event loop | Only for subscribed panes, at most 8; measure loop time with 8 busy panes |+| RK11 | Token and loopback | Any local process of the user can connect to loopback | Per-launch token, loopback-only peer check, one client; no secrets ever cross the bridge (no API keys, no credentials) |+| RK12 | Self-hosted runner on a public repo | Untrusted code on the person's own machine | Fork PRs never reach it; dedicated user; no signing keys on the runner |+| RK13 | Disk | 106 GB free (2026-11-02); engine, DDC, LFS, two platform builds | DDC cap, `Intermediate` pruning in `build.py`, alert below 40 GB free |+| RK14 | Binary asset merges | `.uasset` cannot merge across parallel agents | One File Per Actor, zone ownership in `work-packages.md`, C++ and DataAssets as text-like surfaces, LFS locking for shared maps |+| RK15 | Install size vs updater | 1.5 GB cap today (`installer_update.py:106`) | IoStore chunk per deck, delta packages, raise the cap (README) |+| RK16 | Gore and paired finisher animation | No rig with weapon/IK bones today, no clips with root motion | New rig early in the art track; finisher gated on motion warping working over the network |diff --git a/docs/verse/unreal/contracts/art-pipeline.md b/docs/verse/unreal/contracts/art-pipeline.mdnew file mode 100644index 0000000000..e3c0bf230e--- /dev/null+++ b/docs/verse/unreal/contracts/art-pipeline.md@@ -0,0 +1,637 @@+# Contract: art pipeline (Blender art-as-code to Unreal)++Status: draft for freeze before fan-out. Target: Unreal Engine 5.7.1, project+`unreal/Verse/Verse.uproject`. Builds on `../README.md` (decisions) and+`../architecture.md` (modules, OFPA, LFS, budgets). Facts about today's code+carry a file reference; everything else is a design decision of this contract.++Owner: the integration owner (orchestration.md). Consumers: every package+that adds meshes, textures, materials, characters, weapons, destructible+pieces or deck content (VerseDecks, VerseCrew, VerseScreens, VerseCombat,+VerseDestruction, VerseGore, VerseUI).++## 1. What carries over and what does not++| Today (fact) | In Unreal |+|---|---|+| Blender 5.0.1 Python builders under `art/verse/` are the source of truth; `.blend` is derived and git-ignored (`art/verse/kit/README.md`, `.gitignore:130,531`) | Unchanged. Builders stay the source; `.blend` stays ignored |+| Kit: pieces on a 1.2 m module, placed as collection instances (`lib/kit.py`, `kit/README.md`) | Each kit master exports once as its own mesh; every placement becomes one OFPA actor |+| Names `SM_ SK_ A_ M_ MI_ T_*_BC/_N/_ORM/_E/_M`, `UCX_`, `SOCKET_`, `ROOM_`, `LV_`, `BP_` (`lib/naming.py`) | Kept and extended (section 3). `UCX_` and `SOCKET_` change meaning on the Unreal side and are remapped |+| ~50 procedural Cycles materials, no UVs (object/world coordinates, `kit/README.md` "lib/materials.py") | Rebuilt as instances of a few master materials, triplanar where a piece has no UVs (section 7) |+| Baked lighting: rgbm2 lightmaps, probes, plates, `nav.png`, `realtime/scene.glb` | **Never imported.** Lumen, Recast and Unreal collision replace them |+| Character skeleton: 25 bones, one bone for four fingers, no IK or weapon bones (`characters/README.md`, "Skeleton") | Replaced by a new original FPS rig (section 12) |+| CC0-only ledger `art/verse/LICENSES.md`, append-only | Stays the one ledger; Unreal imports cite its rows (section 11) |++## 2. Flow++```mermaid+flowchart LR+ B["Blender builders\nart/verse/**.py"] -->|"scripts/verse/export_unreal.py\n(Blender, under the GPU lock)"| X["Export cache (ignored)\nart/verse/.cache/unreal/**.fbx, T_*.png"]+ B --> P["Placement JSON (committed text)\nunreal/Verse/Art/Placements/<deck>/<zone>.placement.json"]+ B --> R["Import records + MI recipes (committed text)\nunreal/Verse/Art/Import/**, Art/Materials/**"]+ X -->|"scripts/unreal/import_art.py\n(UnrealEditor-Cmd + verse_pipeline)"| U["uassets (Git LFS)\nunreal/Verse/Content/Verse/**"]+ R --> U+ P -->|"verse_pipeline.sync_placements"| O["OFPA actors (Git LFS)\nContent/__ExternalActors__/**"]+ U --> O+ V["verse_pipeline.validate_assets\n(unreal-build lane)"] -.-> U+ V -.-> O+```++| Step | Command (planned) | Runs where | Lock |+|---|---|---|---|+| Export | `python scripts/verse/export_unreal.py {piece <SM_Name> \| deck <deck> [--zone <zone>] \| characters \| weapons \| textures}` | Blender via `scripts/verse/blender.py` | `scripts/unreal/with_lock.py` (the machine-wide `gpu-heavy.lock`, architecture 8.2) |+| Import | `python scripts/unreal/import_art.py {assets \| placements} [--deck D --zone Z] [--only NAME,...]` | `UnrealEditor-Cmd.exe unreal/Verse/Verse.uproject -run=pythonscript -script=verse_pipeline.cli -unattended -nosplash -nullrhi` | same lock |+| Validate | `python scripts/unreal/import_art.py validate` | same commandlet; also in `unreal-build` | same lock |+| Static check (no engine) | `python scripts/unreal/check_art_text.py` | `unreal-static` lane, GitHub-hosted, LFS not fetched | none |++Parallel agents call only these scripts, never Blender or UnrealEditor+directly (architecture 8.2). If an importer turns out to need a GPU device,+`import_art.py` drops `-nullrhi`; it still runs under the lock.++## 3. Naming++Names are ASCII, `PascalCase` segments joined by `_`, at most 64 characters;+a full object path stays under 180 characters (Windows path limit with the+`__ExternalActors__` hash folders on top). Dimensions in names are+centimetres (`SM_Wall_480_H540`), as today.++| Prefix / suffix | Asset | Notes |+|---|---|---|+| `SM_` | Static mesh | One kit master or prop per asset |+| `SM_<Piece>_Proxy_<State>` | Collision-only static mesh for a destructible state | Never rendered; section 5 |+| `SM_<Piece>_Frac` | Fracture chunk set exported for a geometry collection | Import input only |+| `GC_` | Chaos geometry collection | Built by the import script |+| `SK_` | Skeletal mesh | Characters, weapons with moving parts |+| `SKEL_` | Skeleton | `SKEL_Verse_Human`, `SKEL_Weapon_<Class>` |+| `PHYS_` | Physics asset | Hit-zone bodies (architecture 3.3) |+| `IKRig_`, `RTG_` | IK rig, retargeter | Rig package only |+| `A_` | Animation sequence | Kept from `lib/naming.py`: `A_` is animation, not audio |+| `AM_`, `BS_`, `ABP_` | Montage, blend space, animation blueprint | |+| `M_` | Master material | Only the masters in section 7 |+| `MF_` | Material function | |+| `MI_` | Material instance | One per Blender material name it replaces |+| `T_<Set>_BC` | Base colour, sRGB | |+| `T_<Set>_N` | Normal, authored OpenGL (+Y), flipped on import | Section 6 |+| `T_<Set>_ORM` | Packed R = AO, G = roughness, B = metallic, linear | |+| `T_<Set>_E` | Emissive, sRGB | |+| `T_<Set>_M` | Mask, linear | |+| `SW_`, `MS_` | Sound wave, MetaSound source | Audio is outside this contract except the LFS and licence rules |+| `NS_` | Niagara system | |+| `DA_` | Data asset | e.g. `DA_PenetrationTable` (architecture 4) |+| `LV_<Deck>` | Deck level (World Partition map) | Kept from `lib/naming.py` |+| `DL_<Deck>_<Layer>` | Data layer | `DL_Hangar_Day`, `DL_Hangar_Arena` |+| `BP_` | Blueprint | Thin data and presentation only (architecture 2) |++### 3.1 The `UCX_` and `SOCKET_` conflict++In Blender these prefixes mean something else than in the Unreal mesh importer.++| Blender name today | Blender meaning (fact) | Unreal importer meaning | Rule |+|---|---|---|---|+| `UCX_<name>` | Depth proxy that hides characters in the 60° plate (`kit.occluder`, `naming.OCCLUDER`) | Custom convex collision of the mesh it is named after | **Never exported.** The export drops every object in the `Occluders` collection and every `UCX_*` object. Plates do not exist in Unreal |+| `SOCKET_<kind>_<id>` | World-space empty for seats, screens, spawns, stations (`naming.SOCKET_KINDS`) | Static mesh socket | **Never exported inside a mesh.** World sockets go to the placement JSON `sockets[]` (section 4) |+| (new) `UECOL_<Box\|Sphere\|Capsule\|Convex>_<nn>` | Unreal collision primitive authored in a piece builder | | Renamed at export to `UBX_/USP_/UCP_/UCX_<SM_Name>_<nn>` |+| (new) `UESOCKET_<name>` | Mesh-local socket an asset needs at runtime (muzzle, grip, sight) | | Renamed at export to `SOCKET_<name>` |++The exporter fails (exit 1) if any `UCX_`, `UBX_`, `USP_`, `UCP_` or `SOCKET_`+name reaches an FBX file by any other route.++## 4. Placement JSON: `verse.placement/1`++One file per deck zone: `unreal/Verse/Art/Placements/<deck>/<zone>.placement.json`.+Committed text, LF, sorted keys, 2-space indent, arrays in stable order (by+`id`), so diffs are minimal and reviewable. JSON Schema:+`art/verse/schema/placement.schema.json` (next to `deck.schema.json`).++### 4.1 Space++All transforms are already in **Unreal space**: Z up, X forward, Y right+(left-handed), centimetres. Blender space is Z up, X = bow, metres,+right-handed (`kit/README.md`, "Axes").++| Quantity | Blender to Unreal |+|---|---|+| Location | `(x, y, z) m` to `(100 x, -100 y, 100 z) cm` |+| Rotation (quaternion w, x, y, z) | to `[x, y, z, w] = [-x, y, -z, w]` (mirror across the XZ plane) |+| Yaw about Z | `ue_yaw = -blender_rot_z` |+| Scale | unchanged |+| three.js `(x, y, z) m`, y up (VerseCore's input) | `(100 x, 100 z, 100 y) cm`; consistent with the row above because three.js `z = -blender y` |++One Python function does this (`art/verse/lib/ue_space.py`), twin of the+VerseCore C++ conversion. Both are tested against the same vector file,+`unreal/Verse/Art/space_vectors.json` (pytest and a UE automation test).++### 4.2 Fields++Top level:++| Field | Type | Required | Meaning |+|---|---|---|---|+| `schema` | `"verse.placement/1"` | yes | |+| `deck` | string, `^[a-z][a-z0-9_]*$` | yes | Deck id from `DECK_IDS` (`decks.ts:7`) |+| `zone` | string, `^[a-z][a-z0-9_]*$` | yes | Zone id, unique per deck; list and owners in `work-packages.md` |+| `bounds_cm` | `{min:[x,y,z], max:[x,y,z]}` | yes | Zone box; every placement origin lies inside |+| `level` | string | yes | `/Game/Verse/Decks/<Deck>/LV_<Deck>` |+| `source` | `{builder: path, sha256: hex}` | yes | Builder file and hash of the builder plus its imported `art/verse/lib` and `kit` modules |+| `generator` | `{script, version, blender}` | yes | e.g. `export_unreal.py`, `1`, `5.0.1` |+| `placements` | array | yes | Below |+| `sockets` | array | yes (may be empty) | Below |+| `rooms` | array | yes (may be empty) | Below |++`placements[]`:++| Field | Type | Required | Meaning |+|---|---|---|---|+| `id` | string `^[a-z0-9_]+$` | yes | Stable within the zone. Builder `id=` wins; otherwise `<piece lower>_<x>_<y>_<z>_<yaw>` from the transform snapped to 15 cm and 1°; duplicates get `_2`, `_3`. Moving an unnamed piece makes a new id (new actor file); name pieces that move often |+| `piece` | string | yes | Asset name, e.g. `SM_Wall_480` or `GC_ContainerWall_240` |+| `asset` | string | yes | Object path, e.g. `/Game/Verse/Kit/Architecture/SM_Wall_480.SM_Wall_480` |+| `location` | `[x, y, z]` cm | yes | Unreal space |+| `rotation` | `[x, y, z, w]` | yes | Unit quaternion, Unreal space |+| `scale` | `[x, y, z]` | yes | Non-uniform only for pieces whose record allows it |+| `room` | string or null | yes | `ROOM_` id this placement belongs to |+| `nav` | `"walk" \| "block" \| "none"` | yes | From the `nav` property (`naming.NAV_VALUES`); drives the nav modifier and the `CanEverAffectNavigation` flag |+| `mobility` | `"static" \| "movable"` | yes | `movable` for destructibles, doors, anything that moves |+| `data_layer` | string | yes | `DL_<Deck>_Base`, or `DL_Hangar_Day` / `DL_Hangar_Arena` for the hangar switch (VerseDecks) |+| `collision` | string | yes | Profile name from section 5 |+| `material_overrides` | `{slot: MI object path}` | no | Slot names as in the import record |+| `destructible` | object or null | yes | `{actor_class, penetration_material, health, states:[...], proxies:{State: SM path}, repair_s}`; `null` for static pieces. `actor_class` is an `AVerseDestructible` subclass (architecture 4); `penetration_material` is a key of `DA_PenetrationTable` |+| `station` | `{id, kind}` or null | yes | Kept from the builder's `station` / `station_kind` |+| `owner` | string | yes | Work package id that owns this zone (e.g. `WP11` for `arena_canyon`) |+| `tags` | string array | no | Extra gameplay tags, `Verse.*` namespace only |++`sockets[]` (world sockets, from today's `SOCKET_<kind>_<id>`):++| Field | Type | Required | Meaning |+|---|---|---|---|+| `id` | string | yes | `<placement id>__<local id>` as today (`kit/README.md`, "Socket ids") |+| `kind` | enum | yes | `naming.SOCKET_KINDS`: screen, seat, stand, bunk, holo, light, door, spawn, lift, station, waypoint |+| `location`, `rotation` | as placements | yes | A character standing on it faces the socket's local +X in Unreal |+| `room`, `station` | as placements | yes | |+| `size_cm` | `[w, h]` | screen only | Screen plane size |+| `light` | object | light only | `{type: "spot"\|"rect"\|"point", kelvin, intensity_lm, attenuation_cm, cone_deg?, source_size_cm?, shadows: true}`; Movable always |+| `spawn` | object | spawn only | `{team: "any"\|"a"\|"b", duel: bool}` |+| `props` | object | no | Free key/value strings for the consuming package |++`rooms[]`: `{id, name, polygon_cm: [[x, y], ...], z_cm, main: bool}`; same+meaning as `ROOM_` polygons today (`kit.room`).++### 4.3 Sync rules++`verse_pipeline.sync_placements` makes the level match the JSON:++1. An actor belongs to a placement by its tags `verse.zone:<zone>` and+ `verse.pid:<id>`. Its label is `<zone>.<id>`.+2. Existing actor: transform, mesh, overrides and flags are updated in place,+ so its OFPA file keeps its name (no churn).+3. Placement gone: the actor is deleted. New placement: an actor is created.+4. The sync touches only actors tagged with the zone it was given, and saves+ only their external actor files. It never saves the `.umap`.+5. Hand-placed actors are allowed only with the tag `verse.manual`; sync+ ignores them. They count against the owning zone like any other.++## 5. Collision++Gameplay collision is always simple collision (authored primitives or proxy+meshes). Never "use complex as simple" for pawn or weapon traces: the server+traces bolts and penetration through proxies (architecture 4), so thickness+must be well defined. Channel names are owned by VerseCore; this contract+fixes only the profiles.++| Profile | Used by | Collision source | Pawn | Weapon trace | Notes |+|---|---|---|---|---|---|+| `Verse_Architecture` | Walls, floors, stairs, catwalks, columns | `UECOL_` primitives; else an auto box per piece if the record says `auto_box` | block | block | Floors: one box per walkable slab. Stairs: a ramp box plus step boxes for feet IK |+| `Verse_Destructible` | Breakable walls, container walls, catwalk segments, ceiling panels | `SM_<Piece>_Proxy_<State>` per state; swapped by the server | block | block (penetrable per table) | Required states: `Intact`, `Holed`, `Breached`, `Destroyed`; `Damaged` reuses `Intact` |+| `Verse_Glass` | Glazing, booth windows | one box, at least 2 cm thick | block | block, breaks | |+| `Verse_Prop` | Props over 30 cm | `UECOL_` or auto box | block | block | |+| `Verse_PropSmall` | Props under 30 cm in every axis | none for pawns | ignore | block | Clutter does not snag movement |+| `Verse_Debris` | Geometry collection chunks | GC convex | ignore | ignore | Architecture 4: debris never affects gameplay |+| `Verse_ProxyOnly` | Proxy meshes themselves | the mesh | per state | per state | Hidden in game |+| `Verse_NoCollision` | Decals, cables, light cards | none | ignore | ignore | |++Per piece limits: at most 16 primitives, convex hulls at most 32 vertices+each. A piece with `nav: "walk"` must have a top surface in collision. Walls+that a person can stand behind are solid and at least 20 cm thick in+collision even where the visual is thinner.++## 6. Mesh, Nanite, LOD, lightmaps, textures++### 6.1 Export format++Decision: **FBX binary (7.4) for every mesh, skeleton and animation.** glTF+stays the three.js path. Reason: the Unreal importer's name-prefix rules for+collision and sockets and its skeletal and animation import are the most+exercised on FBX; one format means one calibration.++| Rule | Value |+|---|---|+| Scope | One FBX per asset (one kit master, prop, character, weapon or clip set); piece space as authored (origin on the floor, centred, `kit/README.md`) |+| Export settings | One frozen settings set, id `fbx-ue/1`, in `art/verse/lib/unreal_export.py` (unit scale, axes, smoothing by face, tangent space, no leaf bones, no embedded textures, deform bones only). It is frozen when the calibration test passes |+| Calibration | `SM_Calib_Axes` (an asymmetric arrow: long +X, short +Y, tall +Z, one chamfer) and `SK_Calib_Rig`; a UE automation test checks bounds, facing and the first bone's rest transform against `space_vectors.json`. Any change to `fbx-ue/1` reruns it |+| Mesh hygiene | Manifold where the piece is destructible, no zero-area faces, no doubled faces, normals out, bevels as real geometry (style bible §3 "bevel everything"), no single-sided planes in architecture |+| UV0 | Box-projected in real metres by the builder (1 UV unit = 1 m) when the piece has no authored UVs; authored UVs for characters, weapons, hero props |+| UV1 | Not exported (no lightmaps) |+| Vertex colour | Optional; channel meanings per master material (section 7) |++### 6.2 Nanite and LOD++| Asset class | Nanite | LOD | Triangle cap (source) |+|---|---|---|---|+| Architecture kit masters | on | none (Nanite) | 500 k per piece |+| Props, opaque | on above 300 triangles, off below | none / LOD0 only | 200 k |+| Geometry collections (`GC_`) | on (rendering) | none | 300 k across chunks |+| Glass, translucent | off | LOD0 + auto 50 % | 5 k |+| Proxy meshes | n/a (never rendered) | none | 2 k |+| Third-person characters `SK_` | off | LOD0 + auto 50 / 25 / 12.5 %, screen sizes 1.0 / 0.5 / 0.25 / 0.12 | 80 k LOD0 |+| First-person body and arms (same `SK_`, section 12) | off | LOD0 only in first person | counted in the character |+| First-person weapons `SK_Weapon_*` | off | LOD0 only | 60 k |+| World weapons (pickups, racks) `SM_Weapon_*` | on | none | 150 k |++Nanite fallback: engine default relative error, except architecture pieces+that are seen at grazing angles on the Low preset, where the record may set+a tighter value. Masked and world-position-offset materials stay off Nanite+meshes unless the record justifies them (cost).++### 6.3 Lightmaps and lighting: none++| Item | Rule |+|---|---|+| Static lighting | Off project-wide (`r.AllowStaticLighting=0`); Lumen GI and reflections (architecture 7) |+| Lightmap UVs | Not generated, not exported; import sets "Generate Lightmap UVs" off |+| Light actors | All Movable, from `light` sockets (section 4.2) or hand-placed with `verse.manual` |+| Distance fields | Generated for all static meshes (software Lumen fallback on the 6 GB floor, architecture 7) |+| Wall thickness | At least 10 cm visual for anything that separates a lit and an unlit space (thin walls leak Lumen light) |+| Emissive | Emissive fixtures stay emissive meshes; a fixture that must light the room also gets a light actor. No emissive-only lighting of play spaces |+| Today's bakes | rgbm2 lightmaps, probes, env HDRs and plates are not imported |++### 6.4 Textures++| Rule | Value |+|---|---|+| Source | PNG 8-bit (16-bit for `_N` and height bakes), from builders' bakes (`characters/paint.py`) or CC0 scans fetched by `lookdev/fetch_textures.py` into `art/verse/.cache/`; sources are not committed |+| Size | at most 2048 on any side; 4096 only for first-person weapon and first-person arms sets, named in the record |+| Power of two | required |+| `_BC` | sRGB on, compression Default (BC7 for first-person sets) |+| `_N` | Normal map compression, sRGB off, **flip green on import** (`flip_green_channel = True`): sources are OpenGL convention (Blender bakes, CC0 `nor_gl` files in the ledger) and Unreal expects DirectX. Pixels are never edited |+| `_ORM` | Masks compression, sRGB off; R AO, G roughness, B metallic |+| `_E` | sRGB on |+| `_M` | Masks compression, sRGB off; channel meanings in the record |+| Texture groups | `World`, `WorldNormalMap`, `Character`, `CharacterNormalMap`, `Weapon` (first person), `UI` |+| Virtual textures | Off by default; a record may turn it on for sets over 2048 |++## 7. Materials++A small set of master materials, authored by WP14, `lockable` in Git LFS;+the integration owner holds the lock and merges every change to them.+Everything else is a material instance described as text.++| Master | Use | Key switches and parameters |+|---|---|---|+| `M_Verse_Surface` | Opaque hard surface: steel, concrete, paint, rubber | Static switch `UseTriplanar` (object-space triplanar with a per-instance random offset, as Blender uses object coordinates today); `BaseTint`, `RoughnessMin/Max`, `Metallic`, wear and grime masks (world-space noise plus vertex colour R = edge wear, G = grime), up to 3 texture sets in triplanar mode |+| `M_Verse_Floor` | Floors and decks | World-space mapping so seams run on one global grid (as today, `kit/README.md`); gloss and wear lanes; receives decals |+| `M_Verse_Emissive` | Light panels, indicators, work lamps | `EmissiveColor` (palette-checked), `EmissiveNits` |+| `M_Verse_Glass` | Glazing | Translucent, thin; breakable glass uses the same master on the GC |+| `M_Verse_Screen` | Desk monitors | Render target input from VerseScreens (architecture 5.3) |+| `M_Verse_Character` | Skin, cloth, gear | Skin subsurface profile, cloth sheen; UV0 must be stable for wound masks (VerseGore) |+| `M_Verse_Weapon` | All weapons | Black only (section 8.2), wear on edges, no emissive except the sight reticle |+| `M_Verse_Decal` | Markings, stencils, grime | DBuffer decal; VerseGore owns its own blood decal master |++| Rule | Value |+|---|---|+| Triplanar | Only where a piece has no usable UVs. New pieces get box-projected UV0 (section 6.1) and use `UseTriplanar=false`. Triplanar instances are capped at 3 texture sets |+| Recipes | One file per instance: `unreal/Verse/Art/Materials/MI_<Name>.mi.json` = `{schema: "verse.mi/1", name, parent, scalars{}, vectors{name: [r,g,b,a] linear}, textures{name: T path}, switches{}, owner, replaces: "<Blender M_ name>"}`. `verse_pipeline.materials` creates or updates the `.uasset` from it |+| Mapping | `art/verse/lib/unreal_materials.py` maps each Blender `M_` name (`lib/materials.py`) to its `MI_`; the export writes the MI path into each mesh's slot list |+| Decals | Every opaque world master has "receive decals" on (gore spatter, scorch, markings) |+| Tone map | Fixed manual exposure per deck; a grade LUT `T_Verse_Grade_LUT` approximates the AgX view transform of today's Blender renders. Accepted when a palette chart rendered in Unreal matches the Blender render within ΔE 5 on the greys |++## 8. Military-Industrial Noir: palette and look++Derived from `art/verse/style-bible.md` §5: same greys, a darker and dirtier+floor, and the accent set narrowed to amber, red and gold (README "Look").+Info blue and status green from §5.1 are dropped from the world.++### 8.1 Palette (share of a typical non-combat frame)++| Role | sRGB hex | Share | Origin |+|---|---|---|---|+| Void black | #0B0C0E | 25–45 % | §5.1 |+| Blackened steel | #16171A | 15–30 % | §3 black grating |+| Graphite | #2A2D31 | 10–25 % | §5.1 |+| Gunmetal | #3B3F47 | 5–15 % | §5.1 |+| Concrete | #5E6368, raw concrete #6A6C6B | 5–20 % | §5.1 mid grey; raw concrete new |+| Oil and grime | #121212 | layer only | §3 leather black |+| Worn bare steel (edges) | #A9ADB2 | ≤ 3 % | §3 brushed steel |+| Work-light white (sources) | #F2F4F5, #D9DDE0 | 3–8 % | §5.1 |+| Signal red (lamps, opponent bolts) | #E3242B | ≤ 1.5 % | §5.1 |+| Amber (lamps, screens, own bolts) | #F2A33A | ≤ 0.8 % | §5.1 |+| Hazard yellow (worn bands only) | #D9B23A | ≤ 1 % | §3 |+| Brand gold (rank, commander marks only) | #C8A24A | ≤ 0.5 % | §5.1 |++Shares are measured by the harness on fixed reference views per deck+without combat. Bolt, muzzle and gore VFX are excluded from the caps but+use only the hues above (gore: dark, desaturated reds owned by VerseGore).++### 8.2 Look rules++| Topic | Rule |+|---|---|+| Surfaces | Black steel, concrete, oil, wear: every surface carries roughness variation and a wear or grime mask (style bible §3 "no plastic-toy look") |+| Light | Hard work lights, 4300–6500 K, shadows on, deep falloff into darkness; amber and red only as small practical lamps. Key-to-shadow at least 8 : 1 in play spaces |+| Haze | Exponential height fog plus volumetric fog, neutral grey scattering, density tuned per deck; never coloured fog (§5.3) |+| Gold | Never on weapons or architecture; only the §5.1 brand-gold rule |+| Weapons | Fully black (README Arsenal): base tint ≤ #1A1A1B, metallic or polymer, edge wear to #3B3F47 at most |+| Shapes | 45° chamfers, brutalist grid on the 0.6 m module (§0, §1) |++### 8.3 Never colours (checked)++| Ban | Test applied to MI vector parameters, emissive textures and light colours |+|---|---|+| Cyan | hue 160–210° with saturation > 0.35 |+| Violet, purple, magenta | hue 250–330° with saturation > 0.2 |+| Saturated green light | hue 90–160° with saturation > 0.5 in any emissive or light |+| Info blue in the world | hue 210–250° with saturation > 0.4 in any emissive or light (UI is exempt, owned by VerseUI) |+| Coloured fog | fog and volumetric albedo saturation > 0.1 |+| Gold outside its rule | `#C8A24A` ± ΔE 6 on any asset not listed in `art/verse/gold_allowlist.txt` |++`validate_assets` fails on any hit. Light colours set by temperature are+exempt from the hue tests.++Rendered-pixel rule (for screenshots, not asset parameters): in a reference+view or a VFX frame captured with the UI hidden, a pixel is banned when its+HSV hue lies in 160–330° with saturation above 0.25 and value above 0.08.+Acceptance tests that check rendered frames (WP03, WP11, WP12, WP14 in+`work-packages.md`) count banned pixels with this rule and pass at 0.++## 9. Ownership: One File Per Actor and zones++Binary files never merge, so no two agents may ever write the same binary.++| Rule | Detail |+|---|---|+| Levels | One World Partition map per deck, `LV_<Deck>`, One File Per Actor on. The `.umap` and its world settings belong to the integration owner only; zone owners never save it |+| Zones | Each deck is split into zones (box `bounds_cm`). One work package owns a zone; the list is in `work-packages.md`. Example for the hangar: `shell`, `arena_canyon`, `arena_shuttle`, `arena_booth`, `arena_catwalks`, `armoury`, `lift_lobby`, `day_stations` |+| Actor files | A zone owner writes only the `__ExternalActors__` files of actors tagged `verse.zone:<its zone>`, through `sync_placements` or with `verse.manual` |+| Content folders | One owner per folder (table below). An agent saves assets only in folders it owns |+| Ownership check | `verse_pipeline.validate_ownership` (in `unreal-build`) maps every changed `.uasset` / external actor file of a PR to its folder or zone tag and fails if the PR's work package (branch `claude/verse-wp<nn>-*` or the `Work-Package:` line in the PR body) does not own it |+| Shared assets | Masters, the human skeleton, `PHYS_`, `IKRig_`, data layers: `lockable` in `.gitattributes`; the authoring package (table below) edits them under a `git lfs lock` the integration owner takes, and the integration owner merges |+| Text records | An import record (`Art/Import/**`) or MI recipe (`Art/Materials/**`) belongs to the owner of the content folder its asset lives in (table below); its `owner` field names that package and `validate_ownership` checks it. Placement JSON belongs to the zone owner |+| Redirectors | Never committed. Renames and moves of assets are integration-owner work: fix up redirectors in the same PR |+| Text first | Change placements through builders and the placement JSON, materials through `.mi.json`; binaries follow from text wherever possible |++| Content folder | Owner (`work-packages.md`) |+|---|---|+| `/Game/Verse/Materials/Master/` | WP14 authors, integration owner locks and merges |+| `/Game/Verse/Materials/Instances/Weapons/` | WP14 |+| `/Game/Verse/Materials/Instances/Characters/` | WP13 |+| `/Game/Verse/Materials/Instances/Screens/` | WP16 |+| `/Game/Verse/Materials/Instances/<other group>/` | WP12 (kit and props) |+| `/Game/Verse/Kit/**` | WP12 |+| `/Game/Verse/Textures/<Set>/` | The package that creates the set; a set a second package needs stays with its creator, the second package asks |+| `/Game/Verse/Characters/Rig/` | WP13 authors, integration owner locks and merges |+| `/Game/Verse/Characters/<Body>/`, `/Game/Verse/Animations/**` | WP13 |+| `/Game/Verse/Weapons/**`, `/Game/Verse/VFX/Weapons/**`, `/Game/Verse/PostProcess/**` | WP14 |+| `/Game/Verse/Combat/Abilities/**` | WP02 |+| `/Game/Verse/Combat/Finisher/**` | WP04 |+| `/Game/Verse/Movement/**` | WP01 |+| `/Game/Verse/Destruction/**` except `_Holes/` | WP06 (`_Holes/` WP03) |+| `/Game/Verse/Gore/**` | WP05 |+| `/Game/Verse/Bot/**` except `Tiers/` | WP08 (`Tiers/` WP09, generated from `tiers.json`) |+| `/Game/Verse/Crew/**` | WP15 |+| `/Game/Verse/Screens/**`, `/Game/Verse/UI/Stations/**` | WP16 |+| `/Game/Verse/UI/ServiceRecord/**` | WP21 |+| `/Game/Verse/UI/**` (rest) | WP18 |+| `/Game/Verse/Audio/**` | WP19 |+| `/Game/Verse/Test/WP<nn>/` | That package |+| `/Game/Verse/Decks/<Deck>/LV_<Deck>.umap`, `/Game/Verse/Decks/<Deck>/DataLayers/` | integration owner |+| `/Game/Verse/Decks/<Deck>/<Zone>/` | zone owner (`work-packages.md` section 3) |++## 10. Repository layout, Git LFS, size budgets++### 10.1 Layout++| Path | Content | Storage |+|---|---|---|+| `art/verse/lib/unreal_export.py`, `ue_space.py`, `unreal_materials.py` | Export side (bpy and pure Python) | text |+| `scripts/verse/export_unreal.py` | Export entry | text |+| `scripts/unreal/import_art.py`, `check_art_text.py` | Import and static check entries | text |+| `unreal/Verse/Content/Python/verse_pipeline/` | Editor Python: `cli.py`, `import_meshes.py`, `import_textures.py`, `import_skeletal.py`, `materials.py`, `geometry_collections.py`, `sync_placements.py`, `validate_assets.py`, `validate_ownership.py`, `calib.py` (Unreal puts `Content/Python` on `sys.path`; it is not cooked) | text |+| `unreal/Verse/Art/Placements/<deck>/<zone>.placement.json` | Section 4 | text |+| `unreal/Verse/Art/Import/<kind>/<Asset>.import.json` | Import records (10.3) | text |+| `unreal/Verse/Art/Materials/MI_*.mi.json` | Section 7 | text |+| `unreal/Verse/Art/space_vectors.json` | Section 4.1 | text |+| `unreal/Verse/Content/Verse/**` | `.uasset`, `.umap` | LFS |+| `unreal/Verse/Content/__ExternalActors__/**`, `__ExternalObjects__/**` | OFPA | LFS |+| `unreal/Verse/Tests/Data/**` | Golden data (coordinates, bridge fixtures used by automation tests) | text |+| `unreal/Verse/Tests/GroundTruth/<Platform>/` | Screenshot ground truth (`orchestration.md` 5.3) | LFS (`.png`) |+| `unreal/Verse/.gitattributes`, `unreal/Verse/.gitignore` | Section 10.2, `architecture.md` 8.4 | text |+| `unreal/Toolchain/` | `toolchains.json`, `ddc.json` (WP22) | text |+| `art/verse/.cache/unreal/**` | FBX and PNG exports | ignored |++Folder names: no folder under `unreal/` or `art/verse/` is named `Build`+(except the engine-required `unreal/Verse/Build/`, re-included by the nested+ignore file), `Models`, `Env`, `Logs`, `Dist`, `Secrets`, `Credentials`,+`Traces`, `Blobs`, `Video(s)`, `Film(s)`, `Renders`, `Evidence`,+`Recordings` or `Screenshots`, in any case (`architecture.md` 8.4: the root+ignore rules and the repo junk gate).++### 10.2 `.gitattributes` lines++A nested `unreal/Verse/.gitattributes` (patterns relative to `unreal/Verse/`),+so nothing else in the repo changes. `.fbx`, `.wav` and `.exr` are not in+it on purpose: the repo junk gate blocks those extensions anywhere, so their+sources stay in ignored caches and only the imported `.uasset` is committed.++```gitattributes+# Unreal binaries (Verse). Text sources stay plain Git.+*.uasset filter=lfs diff=lfs merge=lfs -text+*.umap filter=lfs diff=lfs merge=lfs -text lockable+*.png filter=lfs diff=lfs merge=lfs -text+*.bmp filter=lfs diff=lfs merge=lfs -text+*.ico filter=lfs diff=lfs merge=lfs -text+*.ttf filter=lfs diff=lfs merge=lfs -text+*.otf filter=lfs diff=lfs merge=lfs -text+# Shared assets: edited under a `git lfs lock` the integration owner holds.+Content/Verse/Materials/Master/** lockable+Content/Verse/Characters/Rig/** lockable+Content/Verse/Decks/*/DataLayers/** lockable+# Contract text: byte-stable on every platform.+Art/**/*.json text eol=lf+Tests/Data/**/*.json text eol=lf+Content/Python/**/*.py text eol=lf+```++The root `.gitattributes` gets one line, `unreal/** export-ignore`, and the+repo root gets `.lfsconfig` with `[lfs] fetchexclude = unreal/**`+(`architecture.md` 8.4).++| Consequence | Rule |+|---|---|+| Installer and updater | The installer (`install/install.sh` `git clone --depth 1`, `install.ps1`) and the in-app updater (`dodaios/core/main_follow.py`, `dodaios/ui/web/update_routes.py`) never download Unreal binaries: the committed `.lfsconfig` excludes `unreal/**`, and WP22 also sets `GIT_LFS_SKIP_SMUDGE=1` in those git calls. The Verse ships as a package (README Delivery) |+| Release source archive | `unreal/** export-ignore` keeps the Unreal tree out of the `git archive` tarball |+| Developers and runner | `git config lfs.fetchexclude ""` in agent worktrees, on the dev box and on the self-hosted runner |+| `unreal-static` lane | Checkout with LFS off; checks pointers (every `.uasset` and `.umap` under `unreal/` is a valid pointer whose object exists on the remote), never content |+| 5 MB repo gate | Unchanged. `scripts/ci/check_repo_junk.py` reads sizes from the index, where an LFS file is a ~130-byte pointer, so LFS objects pass; a binary committed without LFS fails at 5 MB, which is the wanted backstop. The LFS budgets below are enforced by `scripts/unreal/check_lfs.py` in `unreal-static` |+| Junk extensions | Never commit `.fbx`, `.wav`, `.flac`, `.exr`, `.gif`, `.blend`, `.psd`, video or archive files; an exception needs a reasoned line in `scripts/ci/repo-junk-allowlist.txt` in the same PR |+| LFS quota | Every version of every LFS object counts against the account's LFS storage and bandwidth. Reimport only when an import record's `export.sha256` changed; never re-save untouched assets |++### 10.3 Import record: `verse.import/1`++| Field | Meaning |+|---|---|+| `schema`, `name`, `asset_path`, `kind` | `static_mesh`, `skeletal_mesh`, `skeleton`, `physics_asset`, `animation`, `texture`, `geometry_collection`, `proxy_mesh` |+| `source` | `{builder, function, args}` |+| `export` | `{format: "fbx", settings_id: "fbx-ue/1", file, sha256, blender: "5.0.1"}` |+| `mesh` | `{triangles, vertices, bounds_cm, uv_sets, material_slots: [{slot, mi}]}` |+| `nanite` | `{enabled, fallback_relative_error?}` |+| `collision` | `{profile, source: "authored" \| "auto_box" \| "proxy_states" \| "none", primitives}` |+| `lod` | `{mode: "nanite" \| "auto" \| "single", screen_sizes?}` |+| `lightmap` | always `"none"` |+| `texture` | `{group, max_size, srgb, compression, flip_green, channels?}` (textures only) |+| `license` | `{kind: "own" \| "ledger", ledger_sha256: [..]}` (section 11) |+| `owner` | Work package id |+| `budget_override` | `{field, value, reason, approved_by}`; only the integration owner approves |++`check_art_text.py` fails when a `.uasset` under `Content/Verse/` has no+record, a record has no asset, a name breaks section 3, or a cap below is+exceeded according to the record.++### 10.4 Size budgets++| Budget | Limit |+|---|---|+| One LFS object | warn 20 MB, fail 50 MB |+| LFS growth per PR | 200 MB, above it the integration owner approves |+| Deck content (`/Game/Verse/Decks/<Deck>/` plus its kit share) | 600 MB on disk |+| All Verse content in LFS at parity | 3 GB on disk (shipping payload stays ≤ 2 GB compressed, architecture 7) |+| Placement JSON per zone | 2 MB |+| Triangles | Section 6.2 |+| Bones | 200 per character skeleton, 24 per weapon skeleton |+| Texture size | Section 6.4 |+| Resident texture memory per deck at 1440p High | 1.2 GB, measured by `unreal-perf` inside the 6 GB VRAM Visible cap |++## 11. Licences: CC0-only ledger++| Rule | Detail |+|---|---|+| Ledger | `art/verse/LICENSES.md` stays the single ledger: CC0 only (plus the public-domain rows already in it), append-only, one row per file with source URL and SHA-256 (as today) |+| Own work | Everything a builder makes from code is `license.kind: "own"`; no ledger row |+| Third-party | `license.kind: "ledger"`, with the SHA-256 of every ledger row used. `check_art_text.py` fails on a missing or unknown hash |+| Forbidden | Fab content of any kind (marketplace or scan libraries), engine Starter Content, engine sample and template content (including the mannequin, section 12), anything under a licence other than CC0 or public domain, assets from model sites unless the exact file is CC0 and ledgered, AI-generated meshes or textures (provenance unclear) |+| Scan | `unreal-static` rejects paths and names from engine content packs (`/Game/StarterContent`, `/Game/Characters/Mannequins`, `SKM_Manny*`, `SKM_Quinn*`, `SK_Mannequin*`) and any `.uasset` whose import record is missing |+| Checks owed | Elevation data terms for the Earth view are checked separately before it moves and recorded in the ledger. Fonts are not art assets: their licence is owned by VerseScreens/VerseUI with the integration owner and recorded outside this ledger |+| Names | No asset, folder, tag or record names another game, studio, franchise or real firearm make or model (README Legal); `unreal-static` runs `scripts/unreal/check_forbidden_names.py` over `unreal/**`, `art/verse/**` and `docs/verse/unreal/**`, including names inside `.uasset` import records. The list is kept only as SHA-256 hashes (`architecture.md` 8.4), so the repo never spells the names it forbids |++## 12. FPS character skeleton++Today's 25-bone rig (`characters/README.md`) cannot hold a weapon in first+person: one bone drives four fingers, there are no twist, IK or weapon+bones, and clips are in place. A new rig is built from code in Blender,+`art/verse/characters/rig_fps.py` (planned), on the CC0 base meshes already+in the ledger.++### 12.1 Requirements++| Area | Requirement |+|---|---|+| Asset | One skeleton `SKEL_Verse_Human` for both body variants and every human (player, bot, crew); paired finisher clips need both actors on the same skeleton |+| Scale and pose | Centimetres in Unreal, origin on the floor between the feet, A-pose rest (as today) |+| Root | `Root` at the floor, parent of `Hips`; carries root motion (finisher, kill cam moves, slide and mantle presentation) |+| Spine | `Spine_01`, `Spine_02`, `Spine_03` (lean and aim offsets spread over three bones), `Neck`, `Head` |+| Arms | `Clavicle_L/R`, `UpperArm_L/R`, `LowerArm_L/R`, `Hand_L/R`, twist bones `UpperArm_Twist_L/R`, `LowerArm_Twist_L/R` (wrist roll in first person without candy-wrapping) |+| Fingers | Five per hand, three joints each: `Thumb_01..03`, `Index_01..03`, `Middle_01..03`, `Ring_01..03`, `Pinky_01..03` (`_L/_R`); trigger finger and grip must pose independently |+| Legs | `Thigh_L/R`, `Calf_L/R`, `Foot_L/R`, `Ball_L/R`, `Thigh_Twist_L/R`, `Calf_Twist_L/R` |+| IK bones | `IK_Foot_Root` > `IK_Foot_L/R`; `IK_Hand_Root` > `IK_Hand_Gun` > `IK_Hand_L/R`. Animated to follow their FK targets in every clip, so runtime IK (foot placement, off-hand on the weapon) has stable targets |+| Weapon bones | `Weapon_R` (child of `Hand_R`, the weapon's grip attach point) and `Weapon_L` (child of `Hand_L`, off-hand hold for the knife and gadgets) |+| Camera | `Camera` bone (child of `Head`) for first-person camera motion in clips; kill cam and finisher read it |+| Hit zones | `PHYS_Verse_Human` bodies on head, neck, upper torso, lower torso, upper/lower arms, upper/lower legs (architecture 3.3); lean and prone move them with the bones |+| Influences | at most 8 per vertex, normalised |+| First person | The full body is the first-person body (head hidden for the owner); arms and weapon use the engine's first-person rendering so they do not clip walls. If that proves unstable, a separate arms mesh on the same skeleton |+| Retargeting | `IKRig_Verse_Human` with chains (spine, neck, arms, legs, five fingers) so CC0 or own clips can be retargeted onto the rig |+| Bone names | Our own (above), stable once frozen; animation code addresses bones only by these names |++### 12.2 Weapon skeletons++| Bone / socket | Purpose |+|---|---|+| `Root` | Aligned so that `Root` on `Weapon_R` gives the correct grip |+| `Magazine` | Detach and drop for reloads (tactical and empty differ, README Ammo) |+| `Bolt` or `Slide` | Cycling and charging |+| `Trigger` | Trigger pull |+| `SOCKET_Muzzle` | Bolt spawn and flash (exported from `UESOCKET_Muzzle`) |+| `SOCKET_Sight` | ADS alignment to the camera |+| `SOCKET_Support` | Off-hand IK target (`IK_Hand_L`) |+| `SOCKET_Eject` | Casing or vent effect |++Knife: `Root`, `SOCKET_Tip`. Bulwark and breach charge: static meshes or+two-bone skeletons, owned by VerseCombat. Weapon clips sample at 60 fps+(recoil and reload detail); body clips at 30 fps as today.++### 12.3 Why not the engine mannequin++The engine's mannequin meshes, skeleton and animations are engine vendor+content under the Unreal Engine EULA. As we read it, that content may be shipped+inside a packaged product but not redistributed in source form to people+who are not engine licensees, and a public repository is open to everyone;+the repository's own open-source licence cannot relicense it; and it is not+CC0, so it can never enter the ledger (section 11). Using it only on a+developer's machine to compare proportions is fine; committing it, or+anything exported from it, is not. The exact EULA reading is an open legal+question for the user; this contract takes the safe side until then. The+original rig also removes a dependency on engine sample content between+engine upgrades.++## 13. Destructible art++| Item | Rule |+|---|---|+| Geometry | Solid, closed, with the thickness of its penetration material's reference thickness within 10 % (`contracts/destruction.md` 9; today's thin double-plane walls cannot fracture or measure thickness). The 10 cm (6.3) and 20 cm (5) minimums are for non-destructible architecture only |+| Fracture | Authored as code in Blender (Voronoi cells with a recorded seed) and exported as `SM_<Piece>_Frac`; `verse_pipeline.geometry_collections` builds `GC_<Piece>`. VerseDestruction proves this route in its first spike; fallback: the import script runs the editor's fracture tool with the same seed |+| Proxies | `SM_<Piece>_Proxy_<State>` for every state in section 5, exported from the same builder so they match the visual |+| Penetration | Each destructible names its `penetration_material` (section 4.2) |+| Never breaks | The hall floor: `Verse_Architecture`, no `destructible` block |++## 14. Validation gates++| Gate | Lane | Fails on |+|---|---|---|+| Placement and record schemas | `unreal-static` | Schema errors, ids out of zone bounds, unknown asset paths |+| Names, folders, ownership text | `unreal-static` | Section 3, section 9 table, forbidden names, engine-content paths |+| LFS pointers and size | `unreal-static` | Non-pointer binaries, budgets in 10.4 |+| Licence | `unreal-static` | Section 11 |+| Space calibration | `unreal-build` | `SM_Calib_Axes` / `SK_Calib_Rig` mismatch with `space_vectors.json` |+| Asset settings | `unreal-build` (`validate_assets`) | Nanite, collision, LOD, texture and lightmap settings differing from the record; MI parent not a master; palette bans (8.3) |+| Ownership | `unreal-build` (`validate_ownership`) | Section 9 |+| Reproducibility | nightly | Re-export from builders changes an `export.sha256` without a matching reimport |+| Palette shares | `unreal-perf` | 8.1 caps on reference views |++## Frozen interface++Other packages may rely on these and only these:++1. The Blender-to-Unreal space conversion in 4.1 and `space_vectors.json`.+2. The `verse.placement/1` schema (4.2) and the sync rules (4.3), including+ actor tags `verse.zone:`, `verse.pid:`, `verse.manual` and labels+ `<zone>.<id>`.+3. The `verse.import/1` and `verse.mi/1` record schemas (10.3, 7).+4. The prefixes and suffixes in section 3 and the `UCX_` / `SOCKET_`+ remapping in 3.1.+5. The collision profile names and their meaning (section 5) and the+ destructible state names `Intact, Damaged, Holed, Breached, Destroyed,+ Repairing` (architecture 4).+6. The master material names and their documented parameters (section 7).+7. The palette table and the colour bans (section 8).+8. The content folder layout and ownership (section 9) and the paths in 10.1.+9. The `.gitattributes` lines in 10.2 and the budgets in 10.4.+10. The bone and socket names of `SKEL_Verse_Human` and weapon skeletons (12).+11. The entry commands in section 2 and their arguments.++## Change rule++Changes to anything in "Frozen interface" go through the integration owner+only: a PR that edits this file and the code it describes together, labelled+`contract-change`, with every affected work package listed. Schema changes+bump the version (`verse.placement/2`, `fbx-ue/2`) and ship a migration script+that rewrites the committed JSON in the same PR. Additions that change no+existing meaning (a new master parameter, a new socket kind, a new collision+profile, a new optional field) still go through the integration owner but+need no version bump. Budget overrides use `budget_override` in a record,+approved by the integration owner.diff --git a/docs/verse/unreal/contracts/bot.md b/docs/verse/unreal/contracts/bot.mdnew file mode 100644index 0000000000..8ea0b9477b--- /dev/null+++ b/docs/verse/unreal/contracts/bot.md@@ -0,0 +1,585 @@+# Contract: the duel bot and the balance harness++Owner module: `VerseBot` (brain, belief, learning, aim, tiers at runtime) and+`VerseHarness` (headless runs, gates). Producers it codes against:+`VerseCombat` (perception service, input path, abilities), `VerseDestruction`+(`IVersePieceQuery`, `IVersePenetrationQuery`, navmesh, `contracts/destruction.md`+section 6), `VerseCore` (tier DataAsset schema, `FVerseNoiseEvent`).++Units: this file uses metres, seconds and degrees. Code uses Unreal+centimetres through the `VerseCore` conversion helpers. Facts about today's+three.js bot carry a file reference (paths relative to+`dodaios/ui/web/frontend/src/components/society/verse/combat/`); everything+else is a design decision.++## 1. Invariants++| # | Invariant | Checked by |+|---|---|---|+| B1 | The bot is a player. `AVerseBotController` possesses an ordinary `AVerseCharacter` and acts only through the same input frame a person produces (move, look delta, buttons), on the server (architecture 3.4) | Code review, `check_bot_isolation.py` |+| B2 | Fair perception. The bot knows only what a person at the screen could know: its own HUD, what is in its eye-level view cone with line of sight, what it hears (with error), and public rules. It never reads the opponent pawn, the opponent's health, ammo or controller, or a piece state it has not perceived (destruction DR6) | Fairness suite F1-F7 (section 10) |+| B3 | Wall shots only at heard or believed positions. A shot at a target not in sight needs a percept-backed belief (section 4.5) | F4 fire audit |+| B4 | Human limits. Every action that answers a stimulus waits a sampled reaction time; aim is speed-limited and noisy; decisions run a few times a second, not every tick | Unit tests on the aim model, harness reaction metrics |+| B5 | Deterministic core. Given the seed, the tier, the percept stream and the world-query answers, the brain's output is bit-identical. The engine around it may be non-deterministic; the brain may not | Replay test BR1 |+| B6 | Higher skill wins more often, never always. Each tier beats the one below it clearly, and still loses kills to it | Gates BG1-BG3 |+| B7 | No dominant trick. No one-trick strategy beats hard | Gate BG4 |+| B8 | Learning is per match. What the bot learns about the person lives in server memory for one match and is dropped at match end. Never persisted, never sent over the bridge | Test L1 (section 10), gate BG9 |++Concepts carried over from today (README "What carries over"), numbers not:+fair perception (`observe.ts`, `bot/bot.test.ts:32-46`), OU aim wander+(`bot/aim.ts`), utility selection with hysteresis +0.18 and U(0, 0.08) noise+(`bot/brain.ts:376-397`), tiers as data (`bot/tiers.ts`), harness gates+(`harness/balance.ts`, `harness/exploits.test.ts`). Dropped with their+mechanics: personal shield, parry, block, dodge roll, heat and vent, bait and+punish (`tiers.ts` fields `heatCap`, `ventTimingSdMs`, `parryChance`,+`parryTimingSdMs`, `blockChance`, `dodgeChance`, `baitPunish`; about 40 % of+`brain.ts`).++## 2. Process and timing++| Layer | Runs | Budget | Notes |+|---|---|---|---|+| Perception (Combat's service) | Every server tick, 60 Hz | in the 0.5 ms bot budget | Builds one `FVersePerceptFrame` per registered observer |+| Belief update | 10 Hz (every 6th tick) plus at once on a percept | 0.05 ms | Grid, section 4 |+| Reflexes and aim | Every server tick | 0.1 ms | Fire gate, ADS, stance, lean, reload interrupts, melee trigger |+| Decision (StateTree evaluation + utility) | Every `DecisionMs` x U(0.8, 1.2), plus forced re-decide on hit taken, sight gained or lost, magazine empty, own death/respawn | 0.1 ms | Section 5 |+| EQS | Async, at most 2 queries in flight, results used on the next decision | 0.2 ms amortised | Section 6 |+| Nav | Recast queries with the belief filter (6.1) | in EQS/decision budget | Server only, destruction 6.1 |++Total bot cost at most 0.5 ms server game thread per tick (architecture 7).++```mermaid+flowchart LR+ W["World truth\n(server)"] --> P["UVersePerceptionService\n(VerseCombat)"]+ P -->|"FVersePerceptFrame\n(sight, bolts, heard, hurt, HUD)"| B["Belief grid\n+ piece belief"]+ B --> D["StateTree + utility"]+ D --> E["EQS (belief contexts)"]+ E --> D+ M["Match memory\n(learning)"] --> E+ M --> B+ P --> M+ D --> R["Reflexes + aim"]+ R -->|"input frame"| C["AVerseCharacter\n(same path as a person)"]+```++The arrow from world truth to the bot exists only through the perception+service. The service is the fairness boundary: it owns the observer's error+RNG stream and applies all perception error before a percept leaves it.++## 3. Perception inputs++### 3.1 Sight++| Rule | Value |+|---|---|+| Eye | The `Camera` bone of `SKEL_Verse_Human` (`contracts/art-pipeline.md` 12.1), the same bone the person's first-person camera uses. Moves with stance, lean, slide, mantle |+| View cone | Half-angle = half of the shipped default horizontal FOV (100 deg, so 50 deg) + 5 deg margin = 55 deg. ADS: half the ADS FOV + 3 deg. Vertical half-angle 40 deg (35 deg ADS) |+| Peripheral band | 55-80 deg off the view axis: only a target moving faster than 2 m/s or firing is noticed, with reaction x `PeripheralReactionMul` |+| Awareness radius | Within 2 m the opponent is noticed in any direction (felt, heard) |+| Line of sight | Up to 8 sample points on the target's hit-zone bodies: head, neck, upper torso, pelvis, both shoulders, both knees. Trace eye to point on `VerseSight` via `IVersePenetrationQuery::TestSight` (holes honoured, intact glass and grating see-through). Pawn capsules of the observer are ignored; the target's own body is the target |+| Exposure | `VisibleMask` (bit per sample point). 1-2 points visible = partial: acquire delay x `PartialExposureAcquireMul` |+| Range | No hard cap inside the arena (about 50 x 40 m); dark zones (arena data `VisibilityFactor` < 1) multiply acquire delay by 1 / factor |+| Bolts | An opponent bolt segment inside the cone with line of sight to any point of it is a bolt percept: position, direction. The bolt line is evidence for the shooter |+| Pieces | A piece with part of its bounds in the cone and line of sight is "seen": its true state enters the piece belief (destruction 6.2) |+| Not seen | Gore decals, the opponent's HUD, opponent's crosshair, nameplates (none exist) |++What a sighting carries (`FVerseSightPercept`): percept id, pelvis+location, velocity, facing yaw and pitch, stance, lean, ADS flag, held weapon+class, reloading flag (the animation is visible), spawn-protected flag (the+effect is visible), `VisibleMask`, peripheral flag. Never health, ammo count,+tier, controller type, or intent.++### 3.2 Hearing++One audibility table drives both the bot's hearing and the person's audio+attenuation (the sound designer tunes it in one place, `DA_Audibility` in+`VerseCore`). Error is applied by the perception service with the observer's+tier parameters.++| Noise | Tag (frozen) | Audible to | Position error sd |+|---|---|---|---|+| Weapon shot | `Noise.Shot` | Whole arena | base + per-metre x distance |+| Sprint footsteps | `Noise.Footstep.Sprint` | 20 m | as above x 1.3 |+| Run footsteps | `Noise.Footstep.Run` | 10 m | x 1.3 |+| Walk footsteps | `Noise.Footstep.Walk` | 4 m | x 1.5 |+| Crouch walk, prone crawl, still | none (no event is raised) | never | - |+| Slide, land from a jump or drop, mantle | `Noise.Move.Slide`, `Noise.Move.Land`, `Noise.Move.Mantle` | 12 m | x 1.2 |+| Reload (tactical, empty) | `Noise.Reload` | 7 m | x 1.0 |+| Bulwark deploy, Bulwark hum | `Noise.Gadget.BulwarkDeploy`, `Noise.Gadget.BulwarkHum` | 15 m / 5 m | x 1.0 |+| Breach charge plant / detonation | `Noise.Gadget.BreachPlant`, `Noise.Gadget.BreachDetonate` | 10 m / whole arena | x 1.0 / x 0.5 |+| Piece fracture (destruction 6.2 loudness) | `Noise.Fracture` | loudness x 40 m | x 1.0 |+| Repair drone flight and weld | `Noise.Drone` | 0.15 x 40 m = 6 m | x 1.0 |+| Knife strike, finisher | `Noise.Melee`, `Noise.Finisher` | 8 m | x 1.0 |+| Bolt impact near the bot (within 3 m) | `Noise.Impact` | always | 0 (impact point); shooter direction from the bolt line |+| Hit taken | none (a hurt percept, not a noise) | always | Direction of the incoming bolt, +-8 deg |++Error model: sd = `HearingErrorBaseM` + `HearingErrorPerM` x distance,+multiplied by 1.5 when no line of sight from the bot's eye to the source.+The level (floor, mid, upper) is reported correctly with probability 0.9+when the source is within 1 level, else 0.7; the rest is a neighbouring+level. An `FVerseHeardPercept` carries the noisy location, the sd used, the+level guess, the tag and the server time. It never carries the true location+or the instigator controller.++### 3.3 HUD and public rules++| Known | Source |+|---|---|+| Own health, armour, magazine, reserve, gadget charges, cooldowns, stance | Own pawn (it is on the HUD) |+| Kill feed: who died, by what (weapon, finisher, wall shot), and where the killer stood if the kill cam shows it | `FVerseHudEvent` |+| Hit markers on own hits (hit, headshot, kill) | `FVerseHudEvent` |+| Damage direction indicator | Hurt percept |+| Opponent respawned (the kill feed says so) and spawn rule (farthest from and out of sight of the opponent) | Ruleset |+| Arena layout, cover, zones, spawn points, piece materials | Static arena data (a person learns the map) |+| Opponent health | Not known. Estimated from confirmed own damage since the opponent's last full health (hit markers), plus the ruleset's regeneration if any |+| Opponent ammo | Not known. Estimated from heard shots since the last heard or seen reload |++## 4. Belief map++### 4.1 Grid++| Property | Value |+|---|---|+| Cells | 1 x 1 m columns over the arena zone, one cell per walkable navmesh level in that column (3 levels, README). About 2,000 x 3 = 6,000 cells at most; only nav-backed cells exist |+| Per cell | `P` (probability the opponent is here, sums to 1 while alive), `LastSupport` (time and kind of the last positive percept that touched it: seen, heard, inferred), `LastCleared` (last time the bot saw the cell empty) |+| Adjacency | 8-neighbour on the same level plus stair, ladder, mantle, jump and drop links from the navmesh; rebuilt for affected cells when nav tiles change and the change is in the piece belief |+| Opponent facing | A separate small estimate: last seen yaw, its time, and a heard-reload flag; used by flank and finisher queries |++### 4.2 Update rules++Applied in this order at every belief step (10 Hz) and at once for a+positive percept:++| Step | Rule |+|---|---|+| Predict | Diffuse mass to reachable neighbours: each cell keeps `1 - a`, spreads `a` over neighbours within `v dt`, with `v` = 4.5 m/s (typical speed) and the neighbour weight biased by the learned zone-transition prior (7.2). Links cost their traversal time |+| Clear | Each cell in the current view cone with line of sight from the eye to the cell at 1.0 m and 1.6 m (0.4 m for prone-capable cells) is multiplied by `1 - Pd`, `Pd` = 0.95 at up to 30 m falling to 0.7 at 50 m, x `VisibilityFactor`. Sets `LastCleared` |+| Sighting | Replace the grid with a Gaussian, sd 0.5 m, at the sighted position (level known). Facing estimate updated |+| Heard | Multiply by `eps + exp(-d^2 / 2 sd^2)` with the percept's sd and level weights (0.9 / 0.1 split), `eps` = 0.02. Sets `LastSupport = heard` within 2 sd |+| Hurt / bolt seen | Multiply by a wedge likelihood along the incoming bolt line traced back (+-8 deg, up to the first opaque piece in the bot's piece belief) |+| Kill feed | Opponent dead: grid cleared, belief "dead". Opponent respawned: prior over the spawn points ranked by the public rule from the bot's own position, top 3 weighted 0.5 / 0.3 / 0.2, sd 1.5 m |+| Normalise | Renormalise to 1; mix in 1 % of the learned heatmap prior (7.2) so no cell is ever exactly 0 |++### 4.3 Decay and confidence++Belief decays by diffusion; there is no separate timer. Derived values the+decision layer reads:++| Value | Definition |+|---|---|+| `TopCluster` | The 3 m radius disc with the highest mass; its centre, level and mass |+| `Confidence` | Mass of `TopCluster` (0-1) |+| `SupportAge` | Seconds since the newest seen or heard support inside `TopCluster` |+| `Spread` | Weighted sd of the top 90 % of mass, metres |+| States | Known (sighting now), Tracked (`Confidence` >= 0.5), Rough (0.2-0.5), Lost (< 0.2) |++### 4.4 Piece belief++A copy of piece states (destruction 6.2). Updated only on sight, on a heard+fracture (marks the piece "changed, state unknown" and rescores dependent+cover points) and on own actions. Reset on the destruction full reset, which+both players see.++### 4.5 Wall-shot authority++A shot at a point not in sight is allowed only if all hold:++| Condition | Value |+|---|---|+| Aim point | Inside `TopCluster`, or within 2 sd of a heard percept younger than `SupportAge` cap |+| Belief | Mass within 1.5 m of the aim point >= `WallbangMinBelief` (tier) and never below the contract floor 0.25 |+| Support | `SupportAge` <= `WallbangMaxSourceAgeS` (tier) and never above the contract cap 4 s; prior-only mass never authorises |+| Path | `IVersePenetrationQuery::TraceBolt` through the believed pieces leaves at least `WallbangMinDamageFrac` of the weapon's damage (and at most 3 pieces, destruction section 2) |++Suppression and prefire are the two other no-sight fire modes (section 8.4).++## 5. Decision layer++A StateTree (`ST_VerseDuelBot`, schema `UVerseBotStateTreeSchema`, evaluated+by `UStateTreeAIComponent` on the bot controller). Root children are picked+by utility (StateTree utility selection with per-state considerations); the+current state gets +0.18 hysteresis and every state gets U(0, `UtilityNoise`)+per decision. Each state has a minimum dwell of 0.4 s except for interrupts.+Reflexes (section 8) run outside the tree every tick.++### 5.1 States++| State | Utility (main terms) | Does | EQS |+|---|---|---|---|+| Attack | Known or seen < 0.5 s ago; + health lead; + `Aggression` | Holds a preferred range band, strafes (`StrafeMs`), fires; closes in only with a reason (opponent reloading, estimated low, out of range), as `brain.ts:621-633` | Cover (as fallback) |+| Hold | Tracked belief moving toward the bot, good cover with a sightline on `TopCluster`; + `CoverUse` | Go to cover, then Hide / Peek cycle (substates), pre-aims the believed entry angle | Cover, PeekCorner |+| Flank | Tracked or Rough belief, no sight 1.5-8 s; opponent holding still or behind a Bulwark; + `FlankUse` | Route that stays out of the believed sightlines to a point 90-130 deg off the opponent's believed facing | Cover (flank mode) |+| StalkForFinisher | Tracked, `Spread` < 2 m, opponent believed static or facing away (last seen facing < 2 s old, or heard reload); a hidden path to within 1.5 m of the rear arc exists; + `StalkUse` | Crouch-walks the approach (silent), aborts on being seen or on `Spread` growing; triggers the finisher ability through input when in range | FinisherApproach |+| Retreat | Own health low vs estimated opponent health, or both magazine and pistol low; + `CoverUse` | Breaks line of sight, goes to far cover, recovers (reload, regeneration if the ruleset has it) | Cover (far mode) |+| Reload | Magazine <= `TacticalReloadAtFrac`, no sight, `Confidence` of a near threat low or cover reached | Reloads in cover; tactical when a round is chambered | Cover (near) |+| DeployBulwark | Wants to Hold or Retreat but no cover within 6 m, or crossing open ground toward the belief; charge available; + `BulwarkUse` | Deploys facing `TopCluster`, then Holds behind it | Cover (Bulwark-able spots) |+| Breach | A breachable piece (piece belief Intact) whose breach shortens the path to `TopCluster` or opens a flank angle on it; + `BreachUse` | Plants out of the believed sightline, steps back, waits for detonation, then Attack through the opening | BreachSpot |+| Wallbang | Wall-shot authority (4.5) holds; bot is in cover or unseen; + `WallbangUse` | Fires bursts through the piece at the authorised point, re-checks authority every burst | WallbangSpot |+| Search | Belief Rough or Lost | Walks toward the highest mass per path metre, sweeping the view to clear cells (information gain), sound discipline by tier | Cover (route waypoints) |++Search is added to the asked list because Lost belief needs a state; it+replaces today's `hunt` (`brain.ts:61`).++### 5.2 Transitions and interrupts++| Trigger | Effect |+|---|---|+| Sighting acquired (after reaction) | Force a decision; Attack gains +0.4 for this decision |+| Sight lost | Attack keeps 0.35 s of suppression (8.4), then a decision |+| Hit taken | Force a decision; Retreat and Hold gain + (damage / max health) |+| Magazine empty with a target in sight | Reflex: switch to pistol with probability `PistolSwitchChance`, else to Retreat |+| Opponent within 2 m frontal | Reflex: knife if magazine empty or `KnifeChoice` roll; else shoot |+| Opponent within 1.5 m in the rear or flank arc and the finisher ability can activate | Reflex: finisher, in every state |+| Piece in a dependency set changed (belief) | Rescore dependent cover; re-decide if the current spot is affected |+| Own death | Tree stops; belief and plan cleared; match memory kept |+| Own respawn | Tree restarts in Search with the spawn prior; adaptive skill applied (9) |+| Spawn protection (own) | Bot may fire; firing ends protection (ruleset) |+| Spawn protection (opponent, visible) | Bot holds fire at that target, pre-aims instead |++Hold substates: `Go -> Hide -> Peek -> Hide`, with hide times+U(0.5, 1.1) s and peek times U(0.7, 1.5) s (from `brain.ts:575-590`), peek+only when magazine and health thresholds pass. The peek type (lean,+crouch-rise, step-out, jump-peek) comes from PeekCorner.++## 6. EQS queries++All queries run with belief contexts only: `UEnvQueryContext_BeliefTop`+(`TopCluster` centre and level), `UEnvQueryContext_BeliefCells` (top 8+cells by mass), `UEnvQueryContext_BeliefFacing`. No VerseBot context may+resolve to the opponent actor (F1). Sight tests use `TestSight` against the+piece belief, not truth. Every item score is `(1 - w) x base + w x learned`,+`w` from 7.3.++### 6.1 Navigation filter++`UVerseBeliefNavFilter`: nav polys created by a breach or destruction+(tagged by piece) are excluded while the piece belief says Intact; polys+of pieces believed intact but truly gone are used until the bot sees them+(it then re-plans). Link costs x `NavLinkCostMul`.++### 6.2 Queries++| Query | Generator | Tests (filter, score) |+|---|---|---|+| `EQS_Cover` | Authored and auto cover points (high 1.7 m, low 1.0 m, Bulwark-able) within 25 m path distance; modes near, far, flank | Filter: hidden from every `BeliefCells` item at 1.65 m and 1.1 m eye; piece belief not Holed/Breached/Destroyed. Score: path distance (-), path exposure to `BeliefCells` (-), distance to preferred range band (-), material penetration cost (+, thin sheet loses), peek option present (+), learned danger heat (-) |+| `EQS_PeekCorner` | From the current cover point: lean left/right at the edge, crouch-rise over low cover, step-out 1.2 / 2.0 / 2.8 m (from `brain.ts:416-425`), jump-peek | Filter: line of sight from the peek eye to `BeliefTop`. Score: exposed sample points to `BeliefCells` (-, lean exposes least), angle to pre-aim (-), learned "person holds this angle" (-), repeat of own last 3 peeks (- x `PeekRepeatPenalty`) |+| `EQS_WallbangSpot` | Points on the bot's side of penetrable pieces between it and `BeliefTop`, within 1 m of its position or reachable cover points | Filter: wall-shot authority (4.5). Score: belief mass in the 1.5 m disc behind the piece (+), damage left after penetration (+), own exposure at the firing spot (-) |+| `EQS_BreachSpot` | Breachable pieces (piece belief Intact) within 30 m path distance | Filter: plant point hidden from `BeliefCells`; not inside the charge's self-damage radius from the waiting point. Score: path shortening to `BeliefTop` (+), new angle on `BeliefTop` off its believed facing (+), plant noise heard by the believed opponent (-), fuse time vs `Spread` growth (-) |+| `EQS_FinisherApproach` | Points within 1.5 m of `BeliefTop` in the arc more than 100 deg from `BeliefFacing`, plus path waypoints | Filter: `Confidence` >= `FinisherCommitConfidence`; whole crouch path outside the believed view cone (55 deg); arrival time <= `MaxStalkS`. Score: path length (-), path exposure (-), noise along the path (-) |++## 7. Per-match learning++`UVerseBotMatchMemory`, one per bot per match. Inputs are percepts only:+the bot learns from what it saw and heard, never from truth.++### 7.1 What it records++| Model | Content | Update |+|---|---|---|+| Position heatmap | Belief-grid layer of counts: sighted positions weight 1, heard 0.3, first-contact positions 2 | Each percept; exponential decay with half-life `HabitHalfLifeS` of match time |+| Shooting spots | Heatmap layer of positions the person fired from (seen or heard shots) | Same |+| Peek habits | Per cover edge (arena data id) and peek type: how often the person appeared there, how fast they re-peeked (< 3 s), jump-peek and lean share | On each sighting that starts at a cover edge |+| Preferred ranges | Histogram of engagement ranges, bins 0-5, 5-10, 10-20, 20-35, 35+ m, with who won each engagement | Each engagement end (kill or contact lost 3 s) |+| Routes | Markov counts of zone-to-zone moves between percepts (about 20 zones, arena data) | Each new zone percept |+| Habits | After-kill reload, Bulwark placement spots, finisher attempts, slide and prone shares | Event-driven counters |++### 7.2 How it biases the bot++| Consumer | Bias |+|---|---|+| Belief predict | Neighbour weights x (1 + 0.5 x zone-transition probability); 1 % prior mix from the position heatmap (4.2) |+| `EQS_Cover` | Danger heat from shooting spots (-) |+| `EQS_PeekCorner` | Avoid angles the person holds; prefer peeks onto their frequent spots |+| Prefire | Pre-aims the person's top 2 peek edges near `TopCluster` |+| Range | Preferred range band moves toward the bin where the person's engagement win share is lowest (at most +-1 bin) |+| Breach / flank | Prefer targets that cut the person's most used route |++### 7.3 Bounds and reset++| Rule | Value |+|---|---|+| Weight | `w = LearnWeightMax x n / (n + LearnSamplesHalf)`, `n` = decayed samples behind the item; `LearnWeightMax` at most 0.35 by contract |+| Exploration | With probability `ExplorationRate` a decision ignores the learned term |+| Fairness | Learned terms never authorise a wall shot or a prefire on their own (4.5) |+| Reset | On match end: duel exit, hangar switches back from arena, tier or adaptive mode changed, `Verse.exe` exit. Never written to disk, never sent over the bridge (B8) |++## 8. Aim model and reflexes++### 8.1 Aim controller++Port of the concept in `bot/aim.ts`, in first person, on look input:++| Part | Rule |+|---|---|+| Reaction | Stimulus to first action: N(`ReactionMs`), floor 0.6 x mean (`brain.ts:144-147`); sound x 0.9, peripheral x `PeripheralReactionMul`, partial exposure x `PartialExposureAcquireMul` |+| Track latency | Aim follows the sighting `TrackLatencyMs` old, extrapolated with `LeadSkill` (`brain.ts:206-238`); `MotionWindowMs` averages strafing reversals |+| Acquire error | On a new target: random direction, magnitude abs(N(1, 0.35)) x `AcquireErrorDeg`, pitch x 0.5, fading with tau `AcquireMs` / 3 |+| OU wander | `x += -k x dt + sd sqrt(2 k dt) N(0,1)`, `k = AimNoiseRate`, `sd = AimNoiseDeg`, pitch x 0.6 |+| Turn rate | Look step capped at `TurnRateDegS`; settles with `1 - exp(-AimStiffness dt)`; floor 0.02 deg per tick |+| Lead | Bolt flight time (300 m/s) x `LeadSkill` x (1 + N(0, `LeadNoise`)) |+| Aim point | Head with `HeadAimChance` per engagement, else upper torso; if only some sample points are visible, the visible one closest to the chosen point |+| Recoil | The weapon's pattern part is pulled down predictively by `RecoilPatternComp` (the bot "knows" the pattern as a practised person does); the random part (about 15 %, README) is corrected only after `TrackLatencyMs`, with gain `RecoilResidualGain`, through the normal aim controller |+| Fire tolerance | Fires when the aim error is within `FireTolerance` x the target's angular half-width (`brain.ts:878-882`) |++### 8.2 Fire discipline++| Rule | Value |+|---|---|+| Bursts | Beyond `BurstRangeM`: bursts of at most `MaxBurstShots`, then wait for recovery to settle |+| ADS | Beyond `AdsRangeM`, not while sprinting or sliding |+| First-shot | Elite taps (single shots) beyond 30 m |+| Spawn-protected target | No fire |++### 8.3 Stance and movement reflexes++Lean on peeks (`LeanUse`), crouch behind low cover when hit+(`CrouchPeekUse`), slide to cross open ground (`SlideUse`), prone only in+Hold at long range (`ProneUse`), walk or crouch-walk when `TopCluster` is+within 15 m (`SoundDiscipline`). All through the movement input of+`VerseMovement`; mantle and jumps follow nav links.++### 8.4 Fire modes without sight++| Mode | Allowed when |+|---|---|+| Suppression | Within 0.35 s after losing sight, aim within 2 m of the last seen position |+| Prefire | A heard percept within the last 2 s within 6 m of a peek edge, and belief mass at the edge >= `WallbangMinBelief`; with `PrefireChance` per approach |+| Wall shot | Authority 4.5 |++Any other shot is a contract violation (F4).++## 9. Tier data asset++### 9.1 Schema++`UVerseBotTier : UPrimaryDataAsset` in `VerseCore`, one asset per tier:+`/Game/Verse/Bot/Tiers/DA_BotTier_Normal`, `_Hard`, `_Elite`. Source of truth is+the text file `unreal/Verse/Data/bot/tiers.json` (diffable, patchable by the+harness like today's tuning patch in `harness/cli.ts`); the commandlet+`VerseImportBotTiers` writes the assets from it and CI fails if they+differ. Values below are starting values: anchors were re-chosen for first+person and 300 m/s bolts, spacing keeps today's tier ratios (`tiers.ts:66-160`).+`tiers.ts` ratio column: hard/normal and elite/normal of the matching+today field, where one exists.++| Group | Field | Type | Normal | Hard | Elite | From `tiers.ts` |+|---|---|---|---|---|---|---|+| Perception | `ReactionMs` (mean, sd) | float2 | 320, 60 | 270, 50 | 225, 40 | 305/255/215: 0.84, 0.70 |+| | `PeripheralReactionMul` | float | 1.6 | 1.5 | 1.4 | new |+| | `PartialExposureAcquireMul` | float | 1.5 | 1.35 | 1.25 | new |+| | `TrackLatencyMs` | float | 150 | 120 | 95 | same |+| | `HearingErrorBaseM` | float | 3.0 | 1.9 | 1.1 | 4/2.5/1.5: 0.63, 0.38 |+| | `HearingErrorPerM` | float | 0.10 | 0.065 | 0.04 | same ratios |+| Aim | `AimNoiseDeg` | float | 1.4 | 1.0 | 0.8 | 1.6/1.15/0.92: 0.72, 0.58 |+| | `AimNoiseRate` (1/s) | float | 1.6 | 1.9 | 2.2 | same |+| | `AcquireErrorDeg` | float | 6.0 | 3.9 | 3.1 | 7/4.5/3.6: 0.64, 0.51 |+| | `AcquireMs` | float | 650 | 450 | 340 | same |+| | `TurnRateDegS` | float | 450 | 620 | 850 | 380/520/720: 1.37, 1.89 |+| | `AimStiffness` (1/s) | float | 8 | 12 | 17 | same |+| | `LeadSkill` | float | 0.6 | 0.8 | 0.9 | same |+| | `LeadNoise` | float | 0.35 | 0.22 | 0.14 | same |+| | `MotionWindowMs` | float | 0 | 200 | 300 | same |+| | `RecoilPatternComp` | float | 0.35 | 0.70 | 0.85 | `recoilComp` same |+| | `RecoilResidualGain` | float | 0.3 | 0.5 | 0.65 | new |+| | `FireTolerance` | float | 2.0 | 1.6 | 1.3 | same |+| | `HeadAimChance` | float | 0.05 | 0.20 | 0.35 | 0/0.15/0.25, shifted up for per-bone zones |+| | `AdsRangeM` | float | 12 | 9 | 7 | 13/10/9 |+| | `BurstRangeM` | float | 30 | 22 | 16 | new |+| | `MaxBurstShots` | int | 8 | 5 | 4 | new |+| Decision | `DecisionMs` | float | 320 | 220 | 160 | same |+| | `UtilityNoise` | float | 0.08 | 0.06 | 0.05 | 0.08 for all today |+| | `Aggression` | float | 0.5 | 0.6 | 0.7 | same |+| | `CoverUse` | float | 0.4 | 0.65 | 0.85 | same |+| | `FlankUse` | float | 0.2 | 0.45 | 0.7 | same |+| | `PreferredRangeM` | float | 14 | 12 | 11 | `15 - 7 x aggression` concept |+| | `StrafeMs` (min, max) | float2 | 700, 1500 | 450, 1050 | 300, 820 | same |+| Movement | `LeanUse` | float | 0.2 | 0.6 | 0.9 | new |+| | `CrouchPeekUse` | float | 0.2 | 0.5 | 0.7 | new |+| | `ProneUse` | float | 0.05 | 0.10 | 0.15 | new |+| | `SlideUse` | float | 0.1 | 0.3 | 0.45 | new |+| | `NavLinkCostMul` | float | 2.0 | 1.3 | 1.0 | new |+| | `SoundDiscipline` | float | 0.1 | 0.5 | 0.85 | new |+| | `PeekRepeatPenalty` | float | 0.1 | 0.4 | 0.7 | new |+| Gadgets and walls | `BulwarkUse` | float | 0.2 | 0.5 | 0.8 | new |+| | `BreachUse` | float | 0.1 | 0.4 | 0.7 | new |+| | `WallbangUse` | float | 0.15 | 0.5 | 0.8 | new |+| | `WallbangMinBelief` (floor 0.25) | float | 0.55 | 0.40 | 0.30 | new |+| | `WallbangMaxSourceAgeS` (cap 4) | float | 1.5 | 2.5 | 3.5 | new |+| | `WallbangMinDamageFrac` | float | 0.3 | 0.3 | 0.3 | new |+| | `PrefireChance` | float | 0.1 | 0.35 | 0.6 | new |+| Melee and reload | `StalkUse` | float | 0.1 | 0.35 | 0.6 | new |+| | `MaxStalkS` | float | 4 | 6 | 8 | new |+| | `FinisherCommitConfidence` | float | 0.8 | 0.7 | 0.6 | new |+| | `KnifeChoice` | float | 0.2 | 0.35 | 0.5 | new |+| | `TacticalReloadAtFrac` | float | 0.25 | 0.35 | 0.45 | new |+| | `ReloadOnlyWhenSafe` | float | 0.3 | 0.7 | 0.9 | new |+| | `PistolSwitchChance` | float | 0.2 | 0.6 | 0.85 | new |+| Learning | `LearnWeightMax` (cap 0.35) | float | 0.10 | 0.22 | 0.35 | new |+| | `LearnSamplesHalf` | float | 12 | 8 | 6 | new |+| | `HabitHalfLifeS` | float | 180 | 300 | 420 | new |+| | `ExplorationRate` | float | 0.25 | 0.15 | 0.10 | new |++Fixed for all tiers (physics, not skill): view cone, audibility ranges,+hysteresis 0.18, the contract floors and caps above.++### 9.2 Adaptive mode++`UVerseBotAdaptiveConfig` (`unreal/Verse/Data/bot/adaptive.json`, asset+`/Game/Verse/Bot/Tiers/DA_BotAdaptive`). A+continuous skill `s` in [0, 1]: `s` = 0 is normal, 0.5 hard, 1 elite. Every+numeric field is interpolated piecewise linearly (normal to hard on [0, 0.5],+hard to elite on [0.5, 1]); int fields round. Never below normal, never+above elite.++| Field | Start value | Meaning |+|---|---|---|+| `StartSkill` | 0.5 | Hard at match start |+| `WindowKills` | 10 | Rolling window of the last kills (either side) |+| `TargetPersonShare` | 0.5 | Person's share of kills in the window the controller aims for |+| `Deadband` | 0.08 | No change while the share is within 0.42-0.58 |+| `Gain` | 0.25 | `ds = Gain x (share - target)` |+| `MaxStepPerKill` | 0.05 | Bound on `abs(ds)` |+| `WarmupKills` | 4 | No adjustment before this many kills |+| `ApplyAt` | bot respawn | Never during an engagement |++Learning (section 7) keeps running in adaptive mode with the interpolated+learning fields. The service record shows the tier as "adaptive"; the+current `s` is visible in the duel's end screen. The bot writes its tier and+`s` into `AVersePlayerState::BotTier` and `BotEffectiveSkill`+(`contracts/combat-state.md` 2.1), which is how `VerseUI` reads them.++## 10. Fairness suite++| Test | Kind | Pass |+|---|---|---|+| F1 Isolation | `scripts/unreal/check_bot_isolation.py` in `unreal-static` | `Source/VerseBot/**` uses none of: `GetPlayerPawn`, `GetPlayerController`, `TActorIterator<AVerseCharacter>`, `GetAllActorsOfClass` on pawns, `GetPawn()` on a controller other than its own, attribute reads on a non-own ability component, `IVersePieceQuery::GetPieceState` outside `FVersePieceBelief`. No EQS context in VerseBot returns an `AVerseCharacter`. Sight traces the bot issues ignore pawn capsules |+| F2 Percept boundary | Automation tests in `VerseCombat` with fixture maps | Opponent behind an opaque piece, silent: no sighting, no heard percept. Behind a hole: seen only if `TestSight` passes. Crouch-walking at 3 m: not heard. Heard percepts never equal the true location (error sd > 0) |+| F3 Counterfactual invariance | Automation test on a dedicated `-nullrhi` server, 20 seeds | A silent, still opponent placed at hidden spot A vs hidden spot B: the bot's input frames are bit-identical up to the first tick at which the two percept streams differ. Requires B5 and F1 |+| F4 Fire audit | Every harness bout | Every bot shot is logged as `FVerseBotFireAudit` and classified Visible, Suppression, Prefire or WallShot (8.4). Unclassified shots: 0. Successor of `bot.test.ts:32-46` |+| F5 Hidden-bearing statistic | Nightly, at least 2,000 windows | Windows with no percept for >= 10 s: rate of facing within 15 deg of the opponent's true bearing minus the rate against a decoy (the opponent's own trajectory shifted by 60 s) <= 0.05 |+| F6 Symmetry | Static check | Person models in the harness and bots read the same `FVersePerceptFrame`; the bot's hearing ranges are read from `DA_Audibility`, the same asset the person's audio uses |+| F7 Piece truth | Harness scenario `wall_opened_unseen` | A wall breached out of sight and earshot of the bot: no bot plan uses the opening until it sees it (destruction 6.2, DR6) |+| BR1 Replay | Unit test, no world | Recorded percept stream + recorded world-query answers + seed fed to `FVerseBotBrainCore` twice: identical outputs |+| L1 No persistence | Harness scan after a 30-minute match | No file written under `Saved/` or the data dir holds match-memory content, and no bridge frame carries any field of `UVerseBotMatchMemory` (B8) |++## 11. Headless harness++### 11.1 How it runs++| Topic | Decision |+|---|---|+| Process | `UnrealEditor-Cmd.exe unreal/Verse/Verse.uproject /Game/Verse/Decks/Hangar/LV_Hangar -server -nullrhi -nosound -unattended -benchmark -fps=60 -VerseHarness=<scenario.json>` (fixed 60 Hz step run as fast as the CPU allows). Binary installs cannot build Server targets (architecture 3.1), so the editor runs as dedicated server |+| Players | Both slots possessed on the server: a bot (`AVerseBotController`) or a person model (`AVerseModelController`, the same brain with person parameters and optional trick overrides). No client connection |+| Network variant | Nightly small set: one model on a real `-game` client with `PktLag=60 PktLagVariance=10 PktLoss=1`, so lag compensation is in the loop |+| Controller | Gauntlet controller `UVerseBalanceGauntletController` in `VerseHarness`; scenario files in `unreal/Verse/Harness/balance/*.json` |+| Driver | `scripts/unreal/balance.py --set ladder|humans|tricks|elite|cross|learning|adaptive|fairness|all --bouts N --seed S --patch tiers_patch.json --jobs J`; takes the GPU-heavy lock (architecture 8.2); `--jobs` parallel processes, each pairing seeded as in a sequential run |+| Bout | Endless deathmatch cut into bouts: first to 15 kills or 10 minutes of match time. Slots alternate spawn sides per bout. Destruction resets between bouts |+| Output | `Saved/Harness/balance/<run>/report.json`, schema `verse.balance/1`, one record per pairing plus the run's gates, and the fire-audit log |+| Speed | Unknown until measured (architecture risk RK1). Target at least 20x real time per process. Bout counts per lane are set from the measured speed so the gates' 95 % intervals are no wider than +-0.06 |++### 11.2 Person models and tricks++Person models (`unreal/Verse/Data/bot/person_models.json`), like+`harness/strategies.ts:44-126`:++| Model | Character | Key numbers |+|---|---|---|+| `skilled` | A practised person: reaction 225 +- 18 ms, fast flicks, good recoil control, learns like the hard tier | Between hard and elite on paper; `TurnRateDegS` 1000, `RecoilPatternComp` 0.8, `HeadAimChance` 0.3 |+| `average` | Slower (270 +- 40 ms), looser aim, recoil control 0.5, little learning | Near normal |++Both are uncalibrated until the person plays (README Testing). After the+first playtest, local duel telemetry (reaction to first shot, accuracy,+TTK, engagement ranges) refits them; the telemetry stays on the machine.++Tricks (base hard unless named; `skilled+<trick>` for the elite set):++| Trick | Behaviour |+|---|---|+| `spray` | Holds the trigger on sight, never bursts, reloads only on empty |+| `camper` | Holds cover near its spawn |+| `rusher` | Runs straight at the belief |+| `slider` | Slides on every approach and every peek |+| `jumppeek` | Peeks only by jumping |+| `leanspam` | Flips lean every 150-300 ms while exposed |+| `prone` | Fights prone from long range |+| `wallspam` | Fires through every penetrable piece toward the belief, with authority off for the trick only (the bot under test keeps it) |+| `turtle` | Lives behind Bulwarks, redeploys on cooldown |+| `breacher` | Breaches every breachable piece on its route |+| `knife` | Closes in for knife strikes only |+| `finisher` | Only stalks for finishers |+| `kiter` | Keeps 30 m away |+| `watcher` | Holds a pre-aimed angle onto the bot's likely spawn |+| `silent` | Crouch-walks everywhere |+| `repeek` | Re-peeks the same angle within 2 s every time |+| `hider` | Avoids every fight |++### 11.3 Metrics per pairing++| Metric | Meaning |+|---|---|+| `boutWinRateA` | Share of bouts A won |+| `killShareA` | A's kills / all kills, with Wilson 95 % interval |+| `kd`, `ttkS`, `timeToContactS` | Per side |+| `accuracy`, `headshotShare`, `wallKillShare`, `finisherShare`, `knifeShare` | Per side |+| `bulwarkUses`, `breachUses`, `reloadsInFight` | Per side, per life |+| `engagementRangeHist` | Bins as 7.1 |+| `spawnKills` | Kills within 3 s of a respawn |+| `fireAudit` | Shots by mode; unclassified count |+| `learningDelta` | Bot's kill share in the second half of the match minus the first (habit models) |+| `adaptiveTrace` | `s` after every kill |+| `botMsP99`, `stuckEvents`, `navFailures` | Cost and health |++### 11.4 Gates++| Gate | Set | Pass |+|---|---|---|+| BG1 Ladder | hard vs normal | `boutWinRateA` >= 0.75 and `killShareA` lower bound >= 0.56 |+| BG2 Ladder | elite vs hard | `boutWinRateA` >= 0.75 and `killShareA` lower bound >= 0.56 |+| BG3 Never always | elite vs normal | `boutWinRateA` >= 0.90 and `killShareA` <= 0.85 (normal still kills); mirrors 0.5 +- 0.06 for same-tier pairings and spawn side 0.5 +- 0.06 |+| BG4 No single trick | every trick vs hard | Trick `boutWinRateA` <= 0.50 and `killShareA` upper bound <= 0.55 |+| BG5 Tricks vs elite | `skilled+<trick>` vs elite | Kill share no more than 0.05 above plain `skilled` vs elite |+| BG6 Skilled person | skilled vs elite | `killShareA` 0.40 +- 0.06 (README: about 40 %); skilled vs normal `killShareA` >= 0.70 |+| BG7 Average person | average vs normal | `killShareA` 0.45-0.65 |+| BG8 Learning | hard vs `repeek`, `watcher`, `camper` | `learningDelta` >= +0.05; and the same pairing with learning off is at least 0.03 worse for the bot |+| BG9 Reset | Two matches back to back, hard vs `repeek` | First 5 minutes of match 2 equal match 1 within the interval (nothing carried over) |+| BG10 Adaptive | adaptive vs skilled, adaptive vs average | Person kill share over kills 30-60 within 0.40-0.60; `s` stays within [0, 1]; no step above 0.05 |+| BG11 Fairness | F3, F4 every lane; F5, F7 and L1 nightly | As section 10 |+| BG12 Health | all | `timeToContactS` median <= 25 s (hider found); `stuckEvents` <= 1 per 10 min; `botMsP99` <= 0.5 |++Lanes (architecture 8.3): merge queue runs BG1, BG2, BG4 for `spray`,+`camper`, `rusher`, `wallspam`, BG11 (F3, F4) with the short bout count;+nightly runs everything. The `BG` prefix keeps these balance gates apart+from the phase gates G0-G3 of `orchestration.md`.++## Frozen interface++Other packages may rely on exactly these:++| Item | Where |+|---|---|+| `UVerseBotTier` field names, types and groups (9.1); `tiers.json` as source of truth; contract floors and caps (`WallbangMinBelief` >= 0.25, `WallbangMaxSourceAgeS` <= 4, `LearnWeightMax` <= 0.35) | `VerseCore` |+| `UVerseBotAdaptiveConfig` fields and the interpolation rule (9.2) | `VerseCore` |+| `FVersePerceptFrame { ServerTimeMs, Self, Sightings[], Bolts[], Heard[], Hurt?, Hud[] }`, `FVerseSightPercept`, `FVerseHeardPercept`, `FVerseBoltPercept`, `FVerseHurtPercept`, `FVerseHudEvent` with the fields in section 3; never a true location of anything unperceived | `VerseCore` structs, produced by `VerseCombat` |+| `UVersePerceptionService` (server world subsystem): `RegisterObserver(AController*, const FVersePerceptionProfile&)`, `UnregisterObserver`, delegate `OnPerceptFrame(AController*, const FVersePerceptFrame&)`; the profile carries the tier's hearing and acquisition fields and the RNG seed | `VerseCombat` |+| `DA_Audibility` rows (noise tag, range, error multiplier) feeding bot hearing and person audio | `VerseCore` |+| Gameplay tags `Noise.*` (3.2) and `Bot.State.*` (one per state in 5.1) | `VerseCore` |+| `AVerseBotController`: `SetTier(const UVerseBotTier*)`, `SetAdaptive(bool)`, `GetEffectiveSkill() -> float`, `GetPresentation() -> FVerseBotPresentation` (state, cover spot, peek point; presentation only) | `VerseBot` |+| `FVerseBotBrainCore::Think(const FVersePerceptFrame&, IVerseBotWorldQueries&) -> FVerseInputFrame` with determinism B5; `FVerseInputFrame` as defined in `contracts/combat-state.md` 11.1 | `VerseBot` |+| `FVerseBotFireAudit { ServerTimeMs, Mode, bTargetVisible, PerceptIds, BeliefMassAtAim, SupportAgeS }` and its log format | `VerseBot` |+| Match option `?BotTier=normal|hard|elite|adaptive`, read by the ruleset | `VerseCombat` passes, `VerseBot` applies |+| `AVerseModelController`, `person_models.json` and the trick ids in 11.2 | `VerseHarness` |+| `scripts/unreal/balance.py` arguments, scenario file schema, report schema `verse.balance/1`, gate ids BG1-BG12, fairness ids F1-F7, L1 and BR1 | `VerseHarness` |++Starting values in 9.1, 9.2, 11.2 and the thresholds of the belief and EQS+rules may be retuned; field names, types, structs, function shapes, tags,+floors and caps, gate and test ids may not.++## Change rule++Every change to this contract, including a retuned tier value, goes through+the integration owner only: a PR that edits this file and `tiers.json` (or+`adaptive.json`, `person_models.json`) together, with a green full+`unreal-gauntlet` nightly run (all of BG1-BG12) attached. A change that loosens+a fairness rule (B2, B3, F1-F7, L1, a floor or a cap) also needs the person's+approval. Packages that need something new ask the integration owner; they+never extend the structs, tags, interfaces or the percept frame themselves.diff --git a/docs/verse/unreal/contracts/bridge-protocol.md b/docs/verse/unreal/contracts/bridge-protocol.mdnew file mode 100644index 0000000000..a98027e831--- /dev/null+++ b/docs/verse/unreal/contracts/bridge-protocol.md@@ -0,0 +1,543 @@+# Contract: app <-> Verse bridge protocol (`verse.bridge/1`)++Owner: integration owner. Implemented by `dodaios/verse_host/bridge.py` ++`dodaios/verse_host/relays/*.py` (backend side) and the `VerseBridge` module+(Unreal side). Builds on `architecture.md` section 5.++Status legend used below: **[E]** exists in the backend today (file reference+given), **[A]** must be added. Every feed names the web Verse consumer it+replaces, so parity can be checked feed by feed.++## 1. Transport++| Topic | Rule |+|---|---|+| Endpoint | `ws://127.0.0.1:<backend port>/api/verse/bridge`, a route of the existing FastAPI app **[A]** (`dodaios/ui/web/verse_routes.py`). No second port |+| Port discovery | The supervisor passes the full URL in `DODAIOS_VERSE_BRIDGE` (for example `ws://127.0.0.1:8765/api/verse/bridge`) and the token in `DODAIOS_VERSE_TOKEN`, both in the child environment, never on the command line. `VerseBridge` reads only these two variables |+| Dev discovery | Editor or standalone runs without a supervisor: when the backend config has `verse.dev_bridge = true` it writes `<DATA_DIR>/verse/bridge.json` `{url, token, pid}` (user-only file ACL, deleted on shutdown). `VerseBridge` falls back to it only in non-Shipping builds |+| Peer check | Loopback peers only (`127.0.0.1`, `::1`), checked before the handshake, also when the backend listens wider for remote mode. Other peers: close `4403` |+| Handshake | First frame from Verse is `hello` (section 3.1) within 5 s. Missing or malformed: close `4400`. Wrong token: close `4401`. Unsupported protocol: close `4426` with `welcome`-shaped reason text naming the supported versions. Same pattern as the mission socket hello (`dodaios/ui/web/missions_ws_routes.py:223-259`) **[E]** |+| Token | 256-bit, random per launch, compared in constant time. A token is valid only while the `Verse.exe` it was minted for is alive |+| One client | A second authenticated connection replaces the first (the first gets close `4409 replaced`) |+| Frames | UTF-8 JSON text frames for everything except terminal cells; binary frames for terminal cells (section 5.4). Max frame 1 MiB; larger: close `1009` |+| Heartbeat | Verse sends `ping` every 1 s; the server answers `pong`. The server treats 5 s without any frame as hung and reports it to the supervisor (restart policy in `architecture.md` 1.1). Verse treats 5 s without any frame as a dead link and reconnects |+| Reconnect | Verse retries with backoff 250 ms, 1 s, 2 s, 4 s, then every 5 s, with the same token. `hello.last_seq` is informational: the server never replays; it sends a fresh snapshot for every topic Verse resubscribes to. Close `4401` on reconnect means the launch is over: Verse saves state and quits |+| Back pressure | One bounded queue per topic on the server. `screens` keeps only the newest frame per pane; `roster`, `panes`, `chat_tails`, `meetings` coalesce deltas into the next snapshot when their queue overflows; events (`progression.awarded`, `lifecycle.*`, `reply`) are never dropped |+| Ordering | Every server frame carries `seq`, one counter per connection, strictly increasing. A delta carries `base` = the `seq` of the snapshot or delta it applies to; Verse that sees a gap requests `resync {topic}` |+| Secrets | Never cross the bridge: no API keys, no credentials, no full chat bodies beyond the tail limits below, no file contents |++## 2. Envelope and versioning++Every JSON frame is one object:++```json+{ "type": "roster.delta", "seq": 4182, "ts": 1793612345.120, "data": { } }+```++| Field | Direction | Meaning |+|---|---|---|+| `type` | both | Message type, `<area>.<verb>`; table in section 8 |+| `seq` | server -> Verse | Per-connection sequence number |+| `ts` | both | Sender's wall clock, epoch seconds (float) |+| `id` | Verse -> server | Request id (`"c-17"`), present on every command; unique per connection |+| `re` | server -> Verse | On `reply`: the `id` it answers |+| `base` | server -> Verse | On deltas: the `seq` the delta applies on top of |+| `data` | both | Payload; schemas below |++| Versioning rule | |+|---|---|+| Protocol id | `verse.bridge/1`. The major number changes only on a breaking change |+| Additive changes | New message types, new optional fields and new enum values are allowed within `/1`. They are announced in `welcome.features` so either side can tell what the other speaks |+| Unknown input | Unknown `type`: ignored (logged once per type). Unknown field: ignored. Unknown enum value in a feed: treated as the documented fallback (`unknown`, `idle`) |+| Breaking change | Goes to `verse.bridge/2`. The backend accepts N and N-1 for at least one app release; `hello.protocols` lists what Verse speaks, `welcome.protocol` names the one picked |+| Build pairing | `welcome.app_version` and `hello.build` are logged on both sides; a mismatch is never fatal by itself |++Replies: every command gets exactly one `reply`.++```json+{ "type": "reply", "seq": 4190, "ts": 1793612345.5, "re": "c-17", "data": { "ok": true, "result": { } } }+{ "type": "reply", "seq": 4191, "ts": 1793612345.6, "re": "c-18", "data": { "ok": false, "error": { "code": "not_found", "message": "Pane is gone." } } }+```++Error codes: `bad_request`, `not_found`, `conflict`, `busy` (a single-flight command is already running, section 14), `unavailable` (feature off or backend part not running), `rate_limited`, `internal`. `message` is English and for logs only; Verse shows its own localised text keyed by `code`.++## 3. Handshake and subscriptions++### 3.1 `hello` (Verse -> server, first frame)++```json+{ "type": "hello", "ts": 1793612340.0, "data": {+ "token": "b64url-43-chars",+ "protocols": ["verse.bridge/1"],+ "build": { "version": "0.1.0", "changelist": "a1b2c3d", "config": "Shipping", "platform": "Win64" },+ "pid": 23144,+ "last_seq": 0,+ "encodings": { "screens": ["cells.bin/1", "cells.json/1"] },+ "capabilities": { "panel_stream": true, "duel": true }+} }+```++### 3.2 `welcome` (server -> Verse)++```json+{ "type": "welcome", "seq": 1, "ts": 1793612340.1, "data": {+ "protocol": "verse.bridge/1",+ "app_version": "4.1.1",+ "app_pid": 9120,+ "session": "vb-3f2c",+ "features": ["roster", "panes", "screens", "chat_tails", "meetings", "groups", "progression", "duel_stats", "companion", "lifecycle", "panel"],+ "encoding": { "screens": "cells.bin/1" },+ "limits": { "screens_max_panes": 8, "screens_max_rows": 60, "screens_max_cols": 240, "screens_max_hz": 10, "chat_tails_max_agents": 6, "chat_tail_lines": 12 },+ "locale": { "lang": "en", "fallback": "en", "strings": { "verse.ranks.duty.working": "On duty" } },+ "settings": { "gore": "full", "reduced_motion": false, "return_key": "F10", "ui_sound": true, "level_sound": true,+ "uniform": "standard", "view": { "mode": "third", "sensitivity": 1.0, "invert_y": false, "fov_third": 70, "fov_first": 85, "quality": "auto", "volume": 0.7 } },+ "decks": ["bridge", "ops", "engineering", "hangar"],+ "state": { "visibility": "visible", "panel": "hidden", "gpu": "free" }+} }+```++| Field | Source | Status |+|---|---|---|+| `locale.strings` | The frontend i18n chunk `ship` for the person's language, read from the same JSON files the web app bundles (5 locales); a string change needs no Unreal rebuild | **[A]** loader in the relay |+| `settings.*` | New `verse.*` keys in the app config (`verse.gore`, `verse.return_key`, `verse.reduced_motion`, `verse.ui_sound`, `verse.level_sound`, `verse.uniform`, `verse.view.*`); changed live with `settings.changed`, written by Verse with `settings.set` (section 14). Duel-only Unreal settings (duel FOV, key bindings other than the return key, scalability) stay in Unreal's own user settings file | **[A]** |+| `decks` | `VERSE_DECKS` (`dodaios/progression/rules.py:51`) | **[E]** |++### 3.3 `subscribe` / `unsubscribe` / `resync` (Verse -> server)++```json+{ "type": "subscribe", "id": "c-1", "ts": 1793612340.2, "data": { "topics": ["roster", "panes", "progression", "meetings", "groups"] } }+{ "type": "resync", "id": "c-9", "ts": 1793612399.0, "data": { "topic": "roster" } }+```++Each subscribed topic answers with a `<topic>.snapshot` before any delta. `screens` and `chat_tails` take explicit watch lists instead (sections 5.2, 6). Topics not in `welcome.features` reply `unavailable`.++## 4. Roster: agents, panes, ranks, duty status++One topic `roster` carries the crew as the Verse needs it: society agents (officers), coding panes (technicians), each with rank and a **duty status the backend computes**, so Unreal never re-implements the precedence rules.++### 4.1 Sources++| Piece | Backend source | Today's web consumer | Status |+|---|---|---|---|+| Agents | `GET /api/society/agents` (`dodaios/ui/web/society_routes.py:378`): row + `run_state` (`paused`/`waiting`/`working`/`idle`) + `waiting_reason` | `useSocietyRoster` via `life/useCrewLife.ts:57-65` (30 s + invalidation every 5-6.5 s) | **[E]** read; **[A]** relay |+| Panes | `GET /api/agentic-ide/panes` (`dodaios/ui/web/agentic_ide_routes.py:1643`), row shape `WorkspacePaneRow` (`frontend/src/lib/agenticIdeApi.ts:891`) | `crewFeeds/codingFloor.ts` (4 s poll) | **[E]** read; **[A]** relay |+| Push triggers | `SocietyRoomChanged`, `SocietyMessageSent`, `SocietyResultPosted`, `SocietyTeamChanged`, `SocietyCheckpointChanged` (`dodaios/core/events.py:2481-2616`); `AgenticIdePaneActivity`, `AgenticIdeTerminalsAdded`, `AgenticIdeTerminalsClosed`, `AgenticIdeWorkspaceChanged` (`events.py:927-1010`) | `/ws` bus forward (`dodaios/ui/web/server.py:1808`, `subscribe_all` at `:1859`) | **[E]** events; **[A]** relay subscribes |+| Error signal | `SocietyResultPosted.status == "blocked"` | `ranks/useRanks.ts` duty board | **[E]** event; **[A]** relay keeps last status per agent |+| Ranks | `GET /api/progression` subjects (`agent:<id>`, `person`), `RANKS` ladder (`rules.py:185`) | `ranks/ranks.ts` `rankForLevel` | **[E]**; **[A]** relay joins level to rank |+| Duty status | Precedence `paused > waiting > working > error > idle` (`ranks/dutyStatus.ts`) | `ranks/dutyStatus.ts` `dutyOf` and the pane variant | **[A]** Python port `dodaios/verse_host/duty.py` with a parity test against the TS table |++Relay cadence: snapshot on subscribe; re-read agents on any society trigger (coalesced to at most 2 Hz); patch panes in place from `AgenticIdePaneActivity` (its payload is the activity half of a pane row); re-read panes on `TerminalsAdded/Closed/WorkspaceChanged`; safety re-read every 30 s. A delta is sent only when a field Verse sees changed.++### 4.2 `roster.snapshot`++```json+{ "type": "roster.snapshot", "seq": 12, "ts": 1793612340.4, "data": {+ "commander": { "subject_id": "person", "level": 14, "rank": "lieutenant", "title": "Lieutenant", "uniform": "standard" },+ "agents": [+ { "agent_id": "ag_7f1", "name": "Mara", "title": "Research scout", "tier": "specialist",+ "lifecycle": "active", "run_state": "waiting", "waiting_reason": "question",+ "duty": "waiting", "level": 6, "rank": "ensign", "look": "look_02",+ "figure": { "archetype": "engineer", "palette": "graphite" }, "team_ids": ["grp_a"], "pane": null }+ ],+ "panes": [+ { "pane_id": "ws_91:T1", "workspace_id": "ws_91", "key": "T1", "history_id": "h_55", "name": "T1",+ "display_name": "Claude Code", "agent": "claude", "title": "Fix the login retry",+ "status": "live", "activity": "working", "activity_since": 1793612301.0, "worked": true,+ "duty": "working", "workspace_active": true, "cols": 132, "rows": 40 }+ ]+} }+```++| Field | Values | Fallback |+|---|---|---|+| `agents[].duty`, `panes[].duty` | `working`, `waiting`, `idle`, `paused`, `error` (`DUTY_STATUSES`) | `idle` |+| `agents[].run_state` | `paused`, `waiting`, `working`, `idle` | `idle` |+| `agents[].lifecycle` | `active`, `paused` (archived agents are never sent) | `active` |+| `panes[].status` | `pending`, `live`, `exited`, `error` | `pending` |+| `panes[].activity` | `starting`, `working`, `waiting`, `asking`, `failed`, `exited`, `stopped`, `unknown`, `""` (`PaneActivity`) | `unknown` |+| `rank` | ids of `RANK_IDS` (`rules.py:203`) | first rank |+| `pane_id` | `<workspace_id>:<key>`, the same id `/api/agentic-ide/screens` takes | |++Only the fields above cross the bridge; prompts, standing instructions, provider and model settings stay in the app.++### 4.3 `roster.delta`++```json+{ "type": "roster.delta", "seq": 57, "base": 49, "ts": 1793612351.0, "data": {+ "upsert": { "agents": [ { "agent_id": "ag_7f1", "run_state": "working", "duty": "working", "waiting_reason": null } ],+ "panes": [ { "pane_id": "ws_91:T1", "activity": "waiting", "duty": "waiting", "activity_since": 1793612350.8 } ] },+ "remove": { "agents": [], "panes": ["ws_91:T3"] },+ "commander": null+} }+```++Upserts are partial: only `agent_id` / `pane_id` plus the changed fields. An id Verse does not hold arrives complete. `commander` is null when unchanged.++## 5. Terminal screen cells++### 5.1 Sources++| Piece | Backend source | Today's web consumer | Status |+|---|---|---|---|+| Plain screen | `ScreenBuffer` per pane (`dodaios/agentic_ide/screen.py:52`), read by `GET /api/agentic-ide/screens` (`agentic_ide_routes.py:4518`) via `screen_feed.collect_screens`; caps 8 panes, 60 rows, 240 cols (`agentic_ide/screen_feed.py:30-35`) | `crewFeeds/usePaneScreens.ts`, `lib/paneScreensApi.ts` (~450 ms poll) | **[E]** |+| Coloured cells | In-page xterm buffers (`frontend/src/lib/liveTerminals.ts`), painted by `effects/terminalCanvas.ts` | `effects/useScreenFaces.ts`, `effects/ScreensLayer.tsx` | **[E]** in the web page only; cannot cross the process boundary |+| Styled mirror | Attribute-keeping buffer per watched pane, seeded from replay bytes, fed from the PTY output callback as a non-claiming viewer (the PTY socket's `claim=0` bystander mode, `agentic_ide_routes.py:5567`, `:5609`) | none | **[A]** `dodaios/verse_host/relays/screens.py` + `styled_screen.py` |+| Push of dirty rows | none | none | **[A]** |++Fallback: when the styled mirror is not available for a pane (feature flag off, parser error), the relay sends the plain `ScreenBuffer` rows as cells with default colours and `style: "plain"` in the snapshot. Verse draws both the same way.++### 5.2 `screens.watch` (Verse -> server)++Verse names the desks it wants, nearest first; the set replaces the previous one. At most `limits.screens_max_panes` (8) are served; extra ids reply `ok` with `"dropped": [...]`.++```json+{ "type": "screens.watch", "id": "c-30", "ts": 1793612360.0, "data": {+ "panes": [ { "pane_id": "ws_91:T1", "hz": 10 }, { "pane_id": "ws_91:T2", "hz": 2 } ] } }+```++```json+{ "type": "reply", "seq": 80, "re": "c-30", "ts": 1793612360.01, "data": { "ok": true, "result": {+ "bound": [ { "pane_id": "ws_91:T1", "ref": 1 }, { "pane_id": "ws_91:T2", "ref": 2 } ], "dropped": [], "missing": [] } } }+```++`ref` is a small integer the binary frames use instead of the string id; it is valid until the next `screens.watch` reply or reconnect. `hz` is a requested ceiling, 1 to 10 (far desks ask for 2).++### 5.3 Rate and size limits++| Limit | Value |+|---|---|+| Frames per pane | at most `min(hz, 10)` per second, coalesced: rows dirtied in between merge into one frame |+| Total screens bandwidth | 200 KB/s across all panes; above it the relay lowers the rate of the farthest panes first (last in the watch list) |+| Rows / cols | 60 / 240 (larger panes are cut, `cut: true` in the snapshot) |+| Snapshot | On bind, on resize, after `resync {topic: "screens", pane_id}`, and every 30 s as a safety net |+| Idle | A pane without output sends nothing |++### 5.4 Cell format++A cell is `char`, `fg`, `bg`, `attrs`. Rows are sent as runs of cells with the same `fg`, `bg`, `attrs`.++| Element | Encoding |+|---|---|+| `char` | One grapheme cluster (UTF-8). A wide glyph sets `attrs.wide` and covers two columns; the second column is not sent. Empty cells at the end of a row are not sent (Verse clears to the default background) |+| Colour (`fg`, `bg`) | u32: high byte = mode (`0` default, `1` palette index 0-255 in the low byte, `2` RGB in the low 24 bits). JSON form: `null`, `{"i": 9}`, or `"#e3242b"` |+| `attrs` | u16 bit set: 0 bold, 1 dim, 2 italic, 3 underline, 4 inverse, 5 strikethrough, 6 invisible, 7 blink, 8 wide. JSON form: array of names |+| Palette | The 16 base colours are not sent; Verse uses the IDE terminal theme shipped as a DataAsset (same values as the web xterm theme) so screens match the IDE |++**Binary frame `cells.bin/1`** (little endian):++| Offset | Type | Field |+|---|---|---|+| 0 | u8[2] | magic `"VC"` |+| 2 | u8 | format version `1` |+| 3 | u8 | kind: `1` snapshot, `2` delta |+| 4 | u16 | `ref` from `screens.watch` |+| 6 | u32 | `seq` (same counter as JSON frames) |+| 10 | u32 | `base` seq (delta) or `0` (snapshot) |+| 14 | u16 | cols |+| 16 | u16 | rows |+| 18 | i16, i16 | cursor row, col (`-1, -1` = hidden) |+| 22 | u16 | row record count |+| 24 | ... | row records |++Row record: `u16 row`, `u16 run_count`, then runs. Run: `u16 col`, `u16 cells`, `u32 fg`, `u32 bg`, `u16 attrs`, `u16 text_bytes`, `text_bytes` of UTF-8 holding exactly `cells` grapheme clusters (wide glyphs count one cluster, two columns). A row record replaces that row completely. In a snapshot every non-empty row is present and missing rows are blank.++**JSON debug form `cells.json/1`** (tests, harness, and when Verse asks for it in `hello.encodings`):++```json+{ "type": "screens.frame", "seq": 91, "base": 88, "ts": 1793612361.2, "data": {+ "pane_id": "ws_91:T1", "kind": "delta", "cols": 132, "rows": 40, "cursor": [39, 2], "style": "styled",+ "rows_changed": [+ { "row": 38, "runs": [+ { "col": 0, "text": "✔ tests passed", "fg": "#4fb86a", "bg": null, "attrs": ["bold"] },+ { "col": 14, "text": " (42)", "fg": { "i": 8 }, "bg": null, "attrs": [] } ] } ] } }+```++Snapshot extras (JSON form and a companion `screens.meta` text frame sent before each binary snapshot): `{pane_id, ref, cols, rows, style: "styled" | "plain", cut, at}` where `at` is the pane's last output time.++Gone panes: `screens.gone {pane_id, reason: "closed" | "exited" | "not_found"}`.++## 6. Chat tails++| Piece | Backend source | Today's web consumer | Status |+|---|---|---|---|+| Tail read | `GET /api/agent-chat/sessions/{session_id}?tail=60` (`dodaios/ui/web/agent_chat_routes.py`, router prefix `:111`) | `crewFeeds/useDeskChats.ts` (2.5 s + jitter, at most 6 agents), filtered by `crewFeeds/deskChat.ts` `chatLines` | **[E]** read; **[A]** relay + Python port of `chatLines` |+| Push | No agent-chat bus event exists today | | **[A]** relay polls at 2.5 s per watched agent, at most 6 in flight, as today |++```json+{ "type": "chat_tails.watch", "id": "c-41", "ts": 1793612370.0, "data": { "agents": ["ag_7f1", "ag_02c"] } }+```++```json+{ "type": "chat_tails.update", "seq": 120, "ts": 1793612372.6, "data": {+ "agent_id": "ag_7f1", "version": "evt_01J…", "lines": [+ { "kind": "user", "text": "Check the retry window." },+ { "kind": "tool", "text": "Read login.py" },+ { "kind": "agent", "text": "The retry waits 30 s; I changed it to back off." } ] } }+```++`kind`: `user`, `agent`, `tool`, `notice`, `error`. At most 12 lines, each cut on a word boundary at 160 characters (tool 80, notice and error 100, as `deskChat.ts`). Sent only when `version` changes. An agent without a chat session yields `{"agent_id": ..., "lines": [], "version": ""}` once.++## 7. Meetings and groups++| Piece | Backend source | Today's web consumer | Status |+|---|---|---|---|+| Groups | `GET /api/society/chat-groups` (`society_routes.py:754`) | `lib/societyChatGroups.ts` | **[E]** |+| Meeting transcript | `GET /api/society/chat-groups/{id}/meeting` (`society_routes.py:761`, `rt.meetings.snapshot`: `messages`, `running`, `room`) | `crewFeeds/useTeamRounds.ts` (2.4 s tick, 18 s board refresh, 60 s sweep) | **[E]** |+| Team board | `GET /api/society/chat-groups/{id}/team` (`society_routes.py:888`) | `crewFeeds/teamwork.ts` | **[E]** |+| Triggers | `SocietyRoomChanged` (open/settle), `SocietyMessageSent` (room lines), `SocietyTeamChanged` | `/ws` | **[E]**; **[A]** relay |++```json+{ "type": "groups.snapshot", "seq": 14, "ts": 1793612340.5, "data": {+ "groups": [ { "group_id": "grp_a", "name": "Release crew", "members": ["ag_7f1", "ag_02c"], "lead": "ag_02c", "goal": { "goal_id": "g_9", "state": "running" } } ] } }+```++```json+{ "type": "meetings.update", "seq": 133, "ts": 1793612380.0, "data": {+ "group_id": "grp_a", "running": true, "round": 2, "speaker": "ag_02c",+ "room": { "room_id": "room_44", "phase": "open", "topic": "Ship 4.2?", "rounds": 2, "max_rounds": 4 },+ "messages": [ { "id": "evt_01J…", "speaker": "ag_02c", "text": "Tests are green; docs lag." } ] } }+```++`messages` holds the last 8, text cut at 200 characters. `meetings.update` is pushed on every trigger for a group with a running room, and once with `running: false` when it settles (`reason` from `SocietyRoomChanged`). A `groups.delta` follows the roster delta rules.++Commands: `meeting.start {group_id, text}` maps onto `POST /chat-groups/{id}/meeting` (`:770`), `meeting.stop {group_id}` onto `:783`. Both are marked dangerous in the app; the relay asks the app's normal confirmation path and replies `conflict` if the person declines.++## 8. Message catalogue++| Type | Dir | Purpose | Backend status |+|---|---|---|---|+| `hello` / `welcome` | V->S / S->V | Handshake | **[A]** route; pattern **[E]** |+| `ping` / `pong` | V->S / S->V | Heartbeat | **[A]** |+| `subscribe`, `unsubscribe`, `resync` | V->S | Topic control | **[A]** |+| `roster.snapshot`, `roster.delta` | S->V | Section 4 | **[A]** relay over **[E]** sources |+| `screens.watch`, `screens.meta`, `screens.frame` (+ binary), `screens.gone` | both | Section 5 | **[A]** styled mirror + relay |+| `chat_tails.watch`, `chat_tails.update` | both | Section 6 | **[A]** relay over **[E]** read |+| `groups.snapshot`, `groups.delta`, `meetings.update` | S->V | Section 7 | **[A]** relay over **[E]** reads |+| `meeting.start`, `meeting.stop` | V->S | Section 7 | **[E]** backend calls |+| `progression.snapshot`, `progression.awarded`, `progression.action` | both | Section 9 | **[E]** read/event/action; **[A]** relay |+| `duel.result` | V->S | Section 10 | **[A]** rules + stats store |+| `pane.open`, `agent.open`, `ide.focus_terminal`, `agent.create`, `launcher.start` | V->S | Section 11 | mixed, see 11 |+| `lifecycle.*`, `window.*`, `focus.return_to_app`, `panel.*`, `gpu.*`, `settings.changed` | both | Section 12 | **[A]** verse host |+| `agents.open_list`, `group.open`, `simulator.open`, `ide.open`, `launcher.cancel`, `settings.set`, `progression.told`, `qa.exec` | V->S | Section 14 | **[A]** |+| `companion.snapshot`, `companion.update` | S->V | Section 14 | **[A]** relay over **[E]** pet read |+| `reply` | S->V | Command result | **[A]** |+| `log` | V->S | Verse warnings worth keeping in the app log (`level`, `category`, `message`), at most 10/s | **[A]** |++## 9. Progression: read and world actions++| Piece | Backend source | Today's web consumer | Status |+|---|---|---|---|+| Read | `GET /api/progression` (`dodaios/ui/web/progression_routes.py:73`): `subjects`, `pet_id`, `recent`, `latest_seq`, rulebook (`rewards`, `ranks`, `decks`, `looks`, `titles`) | `progression/progressionStore.ts`, `progressionApi.ts:147`, `ranks/useRanks.ts` | **[E]** |+| Awards | `ProgressionAwarded` (`events.py:2590`) | `/ws` -> progression store, `ranks/PromotionNotice.tsx` | **[E]** |+| World actions | `POST /api/progression/actions` `{action, ref}` (`progression_routes.py:100`), validated against `WORLD_ACTIONS` (`rules.py:152`); 422 on unknown | `progressionApi.ts:179` `reportWorldAction` | **[E]** |++```json+{ "type": "progression.snapshot", "seq": 15, "ts": 1793612340.6, "data": {+ "subjects": [ { "subject_id": "person", "kind": "person", "level": 14, "total_xp": 5230, "into_level": 130, "for_next": 600, "title": "Lieutenant" } ],+ "pet_id": "drone", "latest_seq": 902, "told_seq": 897,+ "rulebook": { "ranks": [ { "id": "recruit", "level": 1, "tier": "enlisted" } ], "rewards": [], "looks": [], "titles": {} },+ "duel_stats": { "matches": 12, "wins": 7, "losses": 5, "kills": 96, "deaths": 81, "headshots": 31, "finishers": 4, "best_streak": 6, "by_tier": { "hard": { "wins": 5, "losses": 3 } } }+} }+```++```json+{ "type": "progression.awarded", "seq": 140, "ts": 1793612390.0, "data": {+ "seq": 903, "subject_id": "person", "subject_kind": "person", "xp_source": "duel_won", "xp": 40,+ "total_xp": 5270, "level": 14, "previous_level": 14, "title": "Lieutenant", "unlocked": [], "unlocked_looks": [] } }+```++`progression.awarded.data` is the `ProgressionAwarded` event as it is, so the relay forwards it field for field.++World action (Verse -> server):++```json+{ "type": "progression.action", "id": "c-52", "ts": 1793612395.0, "data": { "action": "inspection", "ref": "hangar" } }+```++| `action` | `ref` | Who reports it in Unreal | Rule today (`rules.py:131-146`) |+|---|---|---|---|+| `daily_visit` | ignored, the server uses its own day (`progression/service.py:182`) | `VerseDecks`, on the first Visible state of a launch | 25 XP, once per day |+| `deck_discovered` | deck id from `VERSE_DECKS` | `VerseDecks`, first arrival on a deck | 20 XP, once per deck |+| `inspection` | deck id | `VerseDecks`, every room of the deck visited (port of `life/useWorldActions.ts`) | 15 XP, once per deck, cap 30/day |+| `walk_together` | `""` | `VerseCrew`, every 50 m with the drone within 2.5 m | pet 3 XP, cooldown 20 s, cap 60/day |+| `team_briefing` | team (group) id | `VerseCrew`, a team round running while the commander is on the bridge | 10 XP, cooldown 600 s, cap 40/day |+| `simulator_round` | game id | `VerseUI` simulator | 8 XP, cooldown 45 s, cap 80/day |+| `simulator_record` | game id (`"asteroid-run"` today, `hud/SimulatorPanel.tsx:39`) | `VerseUI` simulator | 15 XP, cooldown 45 s, cap 60/day |++Reply: `{"ok": true, "result": {"awarded": <award or null>}}` (null when a cap or cooldown ate it). Reporting twice is harmless; the server meters. `duel_won` and `duel_lost` are not world actions and are refused here (`bad_request`); they go through `duel.result`.++## 10. Duel result and stats++Today no XP rule mentions a duel and the duel reports nothing (`dodaios/progression/rules.py:131-146`). Everything in this section is **[A]**.++One `duel.result` per set (`contracts/combat-state.md` 9.1): each finished+set (first to 10 kills) sends one with `outcome` `won` or `lost`; leaving the+arena mid-set, or Verse quitting, sends the unfinished set with `outcome`+`unfinished`. The payload is `FVerseSetSummary` (`contracts/combat-state.md`+11.1) field for field.++```json+{ "type": "duel.result", "id": "c-60", "ts": 1793612500.0, "data": {+ "match_id": "m_01JD…", "session_id": "s_01JD…", "set_index": 3, "mode": "deathmatch_1v1", "ruleset": "endless/1",+ "opponent": { "kind": "bot", "tier": "hard", "adaptive": false },+ "started_at": 1793612200.0, "ended_at": 1793612500.0, "match_time_s": 296.4, "end_reason": "set_complete",+ "outcome": "won",+ "score": { "player": 10, "opponent": 7 },+ "stats": { "kills": 10, "deaths": 7, "headshots": 4, "finishers": 1, "melee_kills": 1,+ "shots_fired": 540, "shots_hit": 201, "damage_dealt": 2760, "damage_taken": 2210,+ "walls_breached": 2, "bulwarks_placed": 3, "best_streak": 4 },+ "weapons": [ { "weapon_id": "graveline", "kills": 8, "headshots": 4, "shots_fired": 410, "shots_hit": 152 } ],+ "build": { "version": "0.1.0", "changelist": "a1b2c3d" }+} }+```++| Field | Rule |+|---|---|+| `match_id` | Unique per result (one set); a second `duel.result` with the same id replies `ok` with the first result (idempotent) |+| `session_id`, `set_index` | The arena session the set belongs to and its 1-based index in it |+| `mode` / `ruleset` | From the swappable game mode (`UVerseRuleset`); only `deathmatch_1v1` pays XP in `/1` |+| `outcome` | `won`, `lost` (finished set) or `unfinished` (the person left or Verse quit mid-set). A `won` or `lost` set with `match_time_s` under 60 pays no XP; `unfinished` never pays XP. Every result counts in the statistics |+| `end_reason` | `set_complete`, `player_left`, `verse_quit`, `crash_recovered` (sent on the next launch from the saved pending result), `app_quit` |+| `match_time_s` | Match time of the set, paused time excluded |+| `stats` | Integers, non-negative; the server clamps implausible values (more than 1 kill per 2 s of match time) and logs them |+| `weapons[].weapon_id` | Ids from the weapon DataAsset (fictional names only) |++Backend additions:++| Addition | Where | What |+|---|---|---|+| XP rules | `dodaios/progression/rules.py` `RULES` | `XpRule("duel_won", "person", 40, "server", daily_cap=200)`, `XpRule("duel_lost", "person", 10, "server", daily_cap=50)`, `XpRule("duel_finisher", "person", 5, "server", daily_cap=25)` (per finisher in a paying set). Tier multiplier on `duel_won`: normal 1.0, hard 1.5, elite 2.0, adaptive 1.5. Trigger `server`, so `POST /actions` cannot pay them. Numbers are a starting point owned by the progression owner; changing them is not a protocol change |+| Frontend parity | `tests/unit/progression/test_frontend_parity.py` | Covers the new sources the web ranks code lists |+| Stats store | `dodaios/progression/duel_stats.py` (new table next to the progression ledger) | One row per result + running totals: sets, wins, losses, unfinished, kills, deaths, K/D, headshots, finishers, best streak, per tier and per weapon |+| Read | `GET /api/progression` gains `duel_stats` (totals); `GET /api/progression/duels?limit=20` lists recent matches | For the web service record (`ranks/ServiceRecord.tsx`) and the Unreal one |+| Service | `ProgressionService.record_duel(result)` | Stores the row, pays rules, publishes `ProgressionAwarded` per award (existing path) and a new `VerseDuelRecorded {match_id, outcome, kills, deaths}` bus event |++Reply:++```json+{ "type": "reply", "seq": 171, "re": "c-60", "ts": 1793612500.2, "data": { "ok": true, "result": {+ "recorded": true, "awards": [ { "xp_source": "duel_won", "xp": 60 } ], "duel_stats": { "matches": 13, "wins": 8 } } } }+```++## 11. Station commands++| Command | Args | Backend action | Status |+|---|---|---|---|+| `pane.open` | `{pane_id, open?: "changes"}` | New bus event `VerseOpenRequested {target: "pane", workspace_id, name}`; the web UI runs the same code as `crewFeeds/codingNavigate.ts` `openPaneSession` (IDE section, pane maximised, side panel un-maximised); the desktop process raises the app window. Verse hides itself (`lifecycle.hidden` follows) | **[A]** event + web handler; open logic **[E]** |+| `agent.open` | `{agent_id}` | `VerseOpenRequested {target: "agent", agent_id}`; web UI opens the agent card, as `VerseStage.tsx:332-337` `openCrew` | **[A]** event + handler |+| `ide.focus_terminal` | `{pane_id}` | Desk takeover. Same as `pane.open` but the pane gets keyboard focus at once (the web Verse's `hud/TakeoverPanel.tsx` moves the DOM; Unreal never hosts a live terminal) | **[A]** |+| `agent.create` | `{name?, title?, figure?}` | Same code as `POST /api/society/agents` (`society_routes.py:434`); reply carries `{agent_id}`; the new agent then arrives in `roster.delta` | **[E]** backend; **[A]** relay call |+| `launcher.start` | `{workspace_id?, agents: [{agent, count}], brief}` | Same sequence the web launcher runs (`hud/LauncherPanel.tsx`): `POST /api/agentic-ide/terminals` (`openTerminal`), `.../terminals/{name}/start`, `.../terminals/{name}/prompt` with the brief. Reply lists the created `pane_id`s and per pane `submitted` (the honest three-way answer, as `AgenticIdePromptSent`) | **[E]** endpoints; **[A]** relay moves the sequence into the backend so both callers share it |+| `launcher.options` | `{}` | Reads `GET /api/agentic-ide/state` and the IDE agent list (`fetchIdeState`, `fetchIdeAgents`); reply `{workspaces, agents}` for the station UI | **[E]** reads; **[A]** relay |++```json+{ "type": "launcher.start", "id": "c-71", "ts": 1793612600.0, "data": {+ "workspace_id": "ws_91", "agents": [ { "agent": "claude", "count": 2 } ], "brief": "Write the bridge relay tests." } }+```++```json+{ "type": "reply", "seq": 190, "re": "c-71", "ts": 1793612603.4, "data": { "ok": true, "result": {+ "panes": [ { "pane_id": "ws_91:T4", "submitted": true }, { "pane_id": "ws_91:T5", "submitted": null } ] } } }+```++Rate limits: `agent.create` 1 per 5 s, `launcher.start` 1 per 10 s, open commands 4/s; above that `rate_limited`.++## 12. Lifecycle, window and panel++State machine as `architecture.md` 1.3: `Booting`, `Visible`, `Panel`, `Dormant`, `Exiting`.++Server -> Verse:++| Type | Data | Verse does |+|---|---|---|+| `lifecycle.show` | `{monitor: {x, y, w, h, dpi}, reason: "verse_view" \| "quick_start_duel" \| "station"}` | Sent after the desktop process called `AllowSetForegroundWindow(verse_pid)`. Show window, take focus, resume. `quick_start_duel` goes straight to the arena |+| `lifecycle.hide` | `{reason: "app_focus" \| "user" \| "minimised"}` | Hide window, pause the match, stop rendering, mute; go Dormant (or Panel if the panel streams) |+| `lifecycle.pause` / `lifecycle.resume` | `{reason}` | Pause or resume simulation and audio without changing the window (system dialogs, screen lock) |+| `lifecycle.quit` | `{reason: "app_quit" \| "idle_10min" \| "gpu_pressure" \| "update", deadline_ms: 3000}` | Save match-free state, send any pending `duel.result`, reply `lifecycle.bye`, exit before the deadline; the job object kills it after |+| `panel.visibility` | `{visible: bool, w, h, dpr}` | The IDE side panel became visible or hidden (`IntersectionObserver` + page visibility in `OfficeTab.tsx`). Visible and no full view: enter Panel, start the Pixel Streaming session. Hidden: stop within 1 s |+| `panel.resize` | `{w, h, dpr}` | Resize the offscreen panel target |+| `gpu.yield` / `gpu.free` | `{by: "blender_cook" \| "local_stt" \| "local_model" \| "other"}` | Dormant: quit at once. Visible: drop to Low scalability until `gpu.free` |+| `settings.changed` | `{gore?, return_key?, reduced_motion?, lang?, strings?}` | Apply live |+| `focus.app_took` | `{}` | The app came to the front by itself (alt-tab, click); same as `lifecycle.hide {reason: "app_focus"}` |++Verse -> server:++| Type | Data | Server does |+|---|---|---|+| `lifecycle.state` | `{state, vram_mb, fps}` | On every state change; feeds `GET /api/verse/status` and the launcher card |+| `lifecycle.ready` | `{first_frame_ms}` | After the first frame; the supervisor marks the launch healthy |+| `focus.return_to_app` | `{reason: "return_key" \| "station" \| "esc_menu"}` | Verse has called `AllowSetForegroundWindow(app_pid)` and hidden itself; the desktop process raises the app window |+| `window.state` | `{visible, minimised, monitor}` | Keeps the host in sync after OS-driven changes |+| `panel.stream_state` | `{state: "starting" \| "streaming" \| "stopped" \| "failed", error?}` | The panel shows the stream, the last frame with "Verse is open", or the fallback card |+| `lifecycle.bye` | `{saved: bool}` | Answer to `lifecycle.quit` |++On Linux Wayland, `lifecycle.show` and `focus.return_to_app` carry `activation_token` (`xdg-activation`), per `architecture.md` 1.2.++## 13. Backend work list++| # | Piece | Path | Status |+|---|---|---|---|+| BW1 | Route, loopback check, hello, one-client rule, heartbeat | `dodaios/ui/web/verse_routes.py`, `dodaios/verse_host/bridge.py` | **[A]** |+| BW2 | Supervisor env (`DODAIOS_VERSE_BRIDGE`, `DODAIOS_VERSE_TOKEN`), dev `bridge.json` | `dodaios/verse_host/supervisor.py` | **[A]** |+| BW3 | Roster relay with duty port and rank join | `relays/roster.py`, `verse_host/duty.py` | **[A]** over **[E]** reads/events |+| BW4 | Styled screen mirror + screens relay + binary codec | `relays/screens.py`, `verse_host/styled_screen.py`, `verse_host/cells_codec.py` | **[A]** |+| BW5 | Chat tail relay with `chatLines` port | `relays/chat_tails.py` | **[A]** over **[E]** read |+| BW6 | Groups and meetings relay | `relays/meetings.py` | **[A]** over **[E]** reads/events |+| BW7 | Progression relay (snapshot, awarded forward, actions) | `relays/progression.py` | **[A]** over **[E]** |+| BW8 | Duel rules, stats store, `record_duel`, `GET /api/progression/duels`, `VerseDuelRecorded` | `dodaios/progression/*`, `core/events.py` | **[A]** |+| BW9 | `VerseOpenRequested` bus event + web handler, launcher sequence moved into the backend | `core/events.py`, `frontend/src/hooks/useWebSocket.ts`, `dodaios/agentic_ide/` | **[A]** |+| BW10 | Locale and `verse.*` settings in `welcome` and `settings.changed` | `relays/settings.py` | **[A]** |+| BW11 | Contract tests: golden JSON for every message here, binary codec round trip, parity tests duty/chatLines vs TS. The golden fixtures and `scripts/unreal/fake_bridge.py` exist from G0 (`work-packages.md` G0.11) | `tests/unit/verse_host/fixtures/`, `scripts/unreal/fake_bridge.py` | **[A]** |+| BW12 | Section 14 additions: open commands, launcher single flight, `settings.set` and the settings import route, `told_seq`, `companion` topic, `qa.exec` | `relays/*.py`, `dodaios/ui/web/verse_routes.py` | **[A]** |++The `BW` prefix keeps these items apart from the bot invariants B1-B8 of+`contracts/bot.md`.++## 14. Parity additions++These close the gaps `parity.md` section 20 found. They are part of+`verse.bridge/1` from the first freeze, so no package waits on a contract+change for them.++| Message | Dir | Data | Backend action | Parity rows |+|---|---|---|---|---|+| `agents.open_list` | V->S | `{}` | `VerseOpenRequested {target: "agents"}`: the web UI opens the Agents ledger (side panel Agents tab); Verse hides | S-02 |+| `group.open` | V->S | `{group_id}` | `VerseOpenRequested {target: "group", group_id}`; `not_found` when the group is gone | S-03 |+| `simulator.open` | V->S | `{programme}` | `VerseOpenRequested {target: "simulator", programme}`: the web arcade (`src/components/society/arcade/*`) opens and reports its own `simulator_round` / `simulator_record` actions | S-07, W-06 |+| `ide.open` | V->S | `{}` | `VerseOpenRequested {target: "ide"}`: the IDE section without a pane | X-06 |+| `launcher.start` (rule) | V->S | as section 11 | Single flight: while a batch runs, a second `launcher.start` replies `busy` | X-04 |+| `launcher.cancel` | V->S | `{}` | Stops starting further panes of the running batch; panes already open stay; reply `{stopped: n}` | X-04 |+| `pane.open` `open: "changes"` | V->S | `{pane_id, open: "changes"}` | The web handler opens the pane's changes view (`requestPane(..., {open: "changes"})`) | X-08 |+| `progression.told` | V->S | `{seq}` | Stores the highest award seq Verse has shown to the person; `progression.snapshot.told_seq` carries it, so a level-up shown once is not shown again | F-13 |+| `companion.snapshot`, `companion.update` | S->V | `{pet_id, look, style}` | Topic `companion` from the active pet read (`companionPetStore` source) and the overlay style; an update within 2 s of a change | F-14 |+| `settings.set` | V->S | any subset of `welcome.settings` | Validates and writes the `verse.*` config keys, then sends `settings.changed` with the result to Verse (and to the web UI through the bus). Unknown keys: `bad_request` | F-18, R-12, V-21, T-01, T-04, Z-14 |+| `qa.exec` | V->S, S->V | `{command, args}` / reply `{result}` | Runs a `Verse.QA.*` console command in a Shipping build. The backend forwards it only when it runs with `DODAIOS_VERSE_QA=1`; otherwise every `qa.exec` replies `unavailable` | Q-01..Q-12 |++`POST /api/verse/settings/import` (REST, web app to backend, once): the web+app posts the browser-stored values `dodaios.verse.view.v1`,+`dodaios.verse.uniform.v1`, `jarvis.verse.level.sound.v1`,+`jarvis.verse.levels.seen.v1` and `jarvis.office.arcade.asteroids.best`; the+backend writes the matching `verse.*` keys and `told_seq` only where they are+still unset, and answers `{imported: [...]}`. A second call imports nothing.++## Frozen interface++Other packages may rely on exactly this:++1. Transport: one WebSocket at `/api/verse/bridge` on the backend port, URL and token from `DODAIOS_VERSE_BRIDGE` / `DODAIOS_VERSE_TOKEN`, loopback only, `hello` first, close codes `4400`, `4401`, `4403`, `4409`, `4426`, 1 s ping, 5 s dead-link rule, snapshot-on-reconnect (no replay).+2. The envelope (`type`, `seq`, `ts`, `id`, `re`, `base`, `data`) and the `reply` shape with its error codes.+3. Every message type in section 8 with the fields shown in its example, their meaning and their enum values with fallbacks.+4. `pane_id = <workspace_id>:<key>`, `agent_id` as the society roster's id, `subject_id` as the progression store's id.+5. Duty status is computed by the backend; values `working`, `waiting`, `idle`, `paused`, `error`.+6. The cell model (`char`, `fg`, `bg`, `attrs`), the colour and attribute encodings, the `cells.bin/1` layout, the `cells.json/1` form, and the limits 8 panes / 60 rows / 240 cols / 10 Hz / 200 KB/s.+7. The world action list and `ref` meanings in section 9, and that `duel_*` XP only comes through `duel.result`.+8. The `duel.result` schema and its idempotency on `match_id`.+9. Lifecycle and panel messages in section 12 and their mapping onto the states in `architecture.md` 1.3.+10. The section 14 messages, their data, the `busy` error code and the settings import route.+11. One `duel.result` per set with `outcome` `won`, `lost` or `unfinished` (section 10).++Not frozen: XP amounts and caps, relay cadences inside the stated ceilings, internal backend file layout, log text.++## Change rule++Changes to this contract go through the integration owner only. A work package that needs a change opens a request against `docs/verse/unreal/contracts/` naming the message, the reason and both consumers; the integration owner updates this file, the golden test fixtures (BW11) and the `VerseBridge` codec in one pull request. Additive changes stay in `verse.bridge/1` and are announced in `welcome.features`; anything that renames, removes or changes the meaning of a field, an enum value or a binary offset is `verse.bridge/2` and keeps `/1` served for one app release.diff --git a/docs/verse/unreal/contracts/combat-state.md b/docs/verse/unreal/contracts/combat-state.mdnew file mode 100644index 0000000000..504dbb98c6--- /dev/null+++ b/docs/verse/unreal/contracts/combat-state.md@@ -0,0 +1,981 @@+# Contract: combat state and events++Status: frozen before fan-out. Owner: integration owner (see `orchestration.md`).+Modules: types in `VerseCore` (shared, no dependencies), behaviour in+`VerseCombat`. Read by `VerseMovement`, `VerseDestruction`, `VerseBot`,+`VerseGore`, `VerseUI`, `VerseHarness`.++This contract fixes the shape of combat: what is replicated, what a weapon+is, how recoil, projectiles, penetration, melee, finishers, gore events and+the deathmatch rules behave, and the interface a future game mode plugs into.+Numbers in tables marked "start value" are tuning, owned by the balance+harness; the fields, units, formulas and invariants are frozen.++Units: data assets use metres, m/s, seconds and degrees (`meta=(Units=...)`).+Runtime code works in Unreal centimetres, Z-up; conversion goes only through+`VerseCore`'s coordinate module (`architecture.md` section 2). Server tick is+60 Hz (`architecture.md` 3.2); "tick" below means a server tick.++## 1. Authority and flow++| Rule | Decision |+|---|---|+| Authority | Every gameplay mutation (health, ammo, phase, score, spawn) runs behind `HasAuthority()` on the server. Clients predict only their own fire, ammo count, recoil and reload timing |+| Bot | `AVerseBotController` drives an ordinary `AVerseCharacter` through the same input path; it gets no state a player would not get (`architecture.md` 3.4, fair perception) |+| Event hub | All cross-module combat traffic goes through `UVerseEventHub` (Core world subsystem). Combat never includes Gore, UI or Bot; they subscribe |+| Prediction keys | Fire and reload carry a client shot counter (`uint16`, wraps) and client server-time estimate; the server answers with the authoritative result keyed by that counter |+| Lag compensation | Server rewinds per-bone hit bodies to the shooter's view time from a 1 s ring buffer, rewind capped at 250 ms (`architecture.md` 3.2). Melee and finisher checks use the same rewind |++```mermaid+sequenceDiagram+ participant C as Owning client+ participant S as Server+ participant O as Other clients+ participant H as Event hub (server and each client)+ C->>C: predict shot: ammo-1, recoil kick, draw own bolt+ C->>S: ServerFire(shot#, seed, origin, dir, client time)+ S->>S: validate, spend ammo, spawn bolt in projectile manager+ S-->>O: multicast FVerseFireEvent (unreliable)+ S->>H: FVerseFireEvent, FVerseNoiseEvent(Noise.Shot)+ S->>S: step bolt 5 m per tick, trace rewound bodies and piece proxies+ S->>H: FVersePenetrationEvent / FVerseHitEvent / FVerseDeathEvent+ S-->>C: ClientConfirmShot(shot#, result) (reliable, owner)+ S-->>O: multicast cosmetic FVerseHitEvent (unreliable)+```++## 2. Replicated player state++### 2.1 Where each value lives++| Value | Owner object | Type | Replicated to | Notes |+|---|---|---|---|---|+| Health, MaxHealth | `UVerseHealthSet` (GAS attribute set) on the character | float | Owner only | Opponent health is not shown; hit markers only. Start: 100 |+| Armor, MaxArmor | `UVerseHealthSet` | float | Owner only | Exists for future modes. Deathmatch sets MaxArmor = 0, so armor is inert |+| Stance | `UVerseCharacterMovement` (VerseMovement), read through `IVerseMovementQuery` | `EVerseStance` | All (saved moves) | Stand, Crouch, Prone, Slide. Combat never writes it |+| Sprinting, airborne, mantling | `IVerseMovementQuery` | flags | All | Mantling and sprinting block firing |+| Lean | Movement custom move data | `int8` (-127..127 = -1..1) | All | The server uses the same value when it rewinds hit bodies |+| ADS | `UVerseWeaponComponent` | `uint8` 0..255 = 0..1 blend | All | Drives spread, recoil multiplier, speed |+| Active slot | `UVerseInventoryComponent` | `EVerseLoadoutSlot` | All | For third-person and kill-cam animation |+| Per-slot weapon state (definition id, magazine, chambered, reserve, reload phase) | `UVerseInventoryComponent::Slots` (`FFastArraySerializer`) | `FVerseWeaponSlotState` | Owner only | The opponent learns of a reload only through the reload noise event |+| Reloading (bool) | `UVerseInventoryComponent` | bool | All | Animation only; carries no round count |+| Combat phase | `UVerseCombatStateComponent` (VerseCombat) on the character | `EVerseCombatPhase` | All | Alive, Dead, FinisherAttacker, FinisherVictim. `AVerseCharacter` itself is a VerseMovement class (architecture 2), so combat state lives in this component |+| Spawn protection | `UVerseCombatStateComponent` | `float SpawnProtectedUntil` (server time) + `bool bSpawnProtected` | All | Ends early on the first own offensive action (section 9.3) |+| Score (kills, deaths, headshots, finishers, set score) | `AVersePlayerState` | `int32` each | All | Push model, `MARK_PROPERTY_DIRTY_FROM_NAME` |+| Bot tier and effective skill | `AVersePlayerState` | `FName BotTier` (`normal`, `hard`, `elite`, `adaptive`; `None` for a person), `float BotEffectiveSkill` (adaptive `s`, `-1` for a person) | All | Written by `VerseBot` on the server; read by the HUD and end screen (`VerseUI` never includes `VerseBot`). Public: the person chose the tier |+| Respawn at | `AVersePlayerState` | `float RespawnAt` (server time) | All | UI countdown and kill cam length |+| Recoil accumulator, bloom, shot index | `FVerseRecoilState` in `UVerseWeaponComponent` | struct | Not replicated | Simulated identically on server and owning client from the same seed (section 4) |++All properties use the push model (`architecture.md` 3.2).++### 2.2 Loadout++| Slot | Start item | Kind |+|---|---|---|+| Primary | Graveline (assault rifle) | Firearm |+| Secondary | Tallow (pistol) | Firearm |+| Melee | Hookbill (knife) | Melee, also used by the finisher |+| GadgetA | Bulwark (deployable energy barricade) | GAS ability, section 2.3 |+| GadgetB | Breach charge | GAS ability, section 2.3 |++Later firearms on the same schema: Skitter (SMG), Longsight (DMR). All names+are fictional and model no real firearm; all weapons are fully black+(README). Both players get the same loadout in deathmatch; the armoury may+offer a choice later through `UVerseRuleset::GetLoadout`. Gadget damage+reaches health through the same `FVerseHitEvent` with `Source = Gadget`.++### 2.3 Gadgets++`UVerseGadgetDefinition : UPrimaryDataAsset` in `VerseCore`, one asset per+gadget (`DA_Gadget_Bulwark`, `DA_Gadget_BreachCharge`), text surface+`unreal/Verse/Data/weapons/gadgets.json`. Abilities `UVerseGA_Bulwark` and+`UVerseGA_BreachCharge` (VerseCombat, GAS) run on the server; the owning+client predicts only the deploy or plant animation with a prediction key.+The spawned actors (`AVerseBulwark`, `AVerseBreachCharge`) exist on the server+and replicate to all.++| Field | Type / unit | Bulwark start value | Breach charge start value |+|---|---|---|---|+| `GadgetId` | `FName` | `bulwark` | `breach_charge` |+| `Charges` | int, per life | 1 | 2 |+| `Cooldown` | s, after the actor is gone | 20 | 0 (charges only) |+| `UseTime` | s, deploy or plant, interruptible by taking damage | 0.6 | 1.0 |+| `PlaceRange` | m from the eye | 1.5 (floor in front, needs 1.8 m free width) | 1.5 (on a piece whose material is breakable by breach, destruction 2) |+| `Lifetime` / `FuseTime` | s | 25 | 2.5 after the plant completes |+| `MaxHealth` | hp | 400 | n/a (cannot be shot or defused) |+| `Size` | m (w x h x d) | 1.8 x 1.4 x 0.1 | 0.3 x 0.3 x 0.1 |+| `PawnDamage` | hp at centre, linear falloff to 0 at `PawnRadius` | n/a | 120, `PawnRadius` 3.0 m |+| `PieceBreachRadius` | cm | n/a | 150 (destruction 3.2) |+| `bSelfDamage` | bool | n/a | true: the owner takes the same damage |++| Rule | Bulwark | Breach charge |+|---|---|---|+| Collision | Blocks pawns and the `VerseBolt` channel; ignores `VerseSight` (a translucent amber field: both sides see through it, nobody shoots through it) | No pawn collision; ignores bolts and sight |+| Bolts | Stop at the field; the bolt's damage after all factors goes to the Bulwark's health; never penetrates, no `TraceBolt` call | Not a bolt target |+| Damage to pawns | None | At detonation every pawn whose pelvis is within `PawnRadius` and in line of sight on `VerseBolt` from the charge (current proxies) takes `PawnDamage x (1 - r / PawnRadius)`, `Source = Gadget`, zone multiplier 1.0 |+| Damage to pieces | None | `IVersePieceDamage::ApplyPieceDamage` with `Cause = Breach` and `PieceBreachRadius` (destruction 3.2) |+| End | Health 0, `Lifetime` over, owner death, or a breach detonation within 3 m: actor removed, cooldown starts | After detonation |+| One active | A second deploy removes the first | Up to `Charges` planted at once |+| Spawn blocking | Counts as "Bulwark within 3 m" for spawn selection (9.2) | Counts as "armed breach charge within 3 m" until detonation |+| Noise (bot 3.2) | `Noise.Gadget.BulwarkDeploy` on deploy, `Noise.Gadget.BulwarkHum` while active | `Noise.Gadget.BreachPlant`, `Noise.Gadget.BreachDetonate` |+| Events | `FVerseGadgetEvent` (11.1) on the hub and as an unreliable multicast: `Deploy`, `Destroyed`, `Expired` | `Plant`, `Detonate` |++Invariants, each an automation test in `Verse.Combat.Gadget.*`: GD1 a+Bulwark stops 100 % of bolts until its health reaches 0, and 0 % of sight+traces; GD2 a breach charge detonates `FuseTime` after the plant within 1+tick; GD3 pawn damage at 0, 1.5 and 3.0 m equals the falloff formula to+1e-4 hp, including the owner; GD4 a planted charge always drives its target+piece to its breach result.++## 3. Weapon definition++`UVerseWeaponDefinition : UPrimaryDataAsset` in `VerseCore`, one asset per+weapon (`DA_Weapon_<Name>`). Text-diffable via the asset's JSON export in+`unreal/Verse/Data/weapons/*.json`, which is the merge surface.++| Field | Type / unit | Meaning |+|---|---|---|+| `WeaponId` | `FName` | Stable id, used in events and stats |+| `DisplayName` | `FText` | Fictional name only |+| `Slot` | `EVerseLoadoutSlot` | Primary or Secondary |+| `FireMode` | `EVerseFireMode` | Semi, Burst, Auto |+| `BurstCount` | int | Rounds per burst (Burst only) |+| `RPM` | rounds/min | Cyclic rate; `FireInterval = 60 / RPM` |+| `MagazineSize` | int | Rounds in a full magazine, not counting the chamber |+| `bClosedBolt` | bool | True: a tactical reload keeps one round chambered (magazine + 1) |+| `ReserveRounds` | int | Spare rounds at spawn |+| `ReloadTactical` | s | Reload with a round chambered |+| `ReloadEmpty` | s | Reload from empty (includes chambering) |+| `ReloadCommitFraction` | 0..1 | Point in the reload when the rounds move; cancelling earlier keeps the old magazine |+| `EquipTime`, `HolsterTime` | s | Slot switch |+| `BaseDamage` | hp | Body damage at full range |+| `ZoneMultipliers` | map `EVerseHitZone` to float | Head, Neck, UpperTorso, LowerTorso, Arm, Leg |+| `FalloffStart`, `FalloffEnd` | m | Full damage up to start, linear to `FalloffMinFraction` at end |+| `FalloffMinFraction` | 0..1 | Damage fraction beyond `FalloffEnd` |+| `ProjectileSpeed` | m/s | About 300, no drop |+| `MaxRange` | m | Bolt despawns after this distance |+| `PenetrationPower` | power units, 100 = the assault rifle (destruction 2) | Budget spent by pieces (section 6) |+| `MaxPenetrations` | int, at most 3 (destruction 2) | Pieces a bolt may pass |+| `PieceDamage` | piece hp | Damage applied to a destructible piece per hit; anchor 10 for the rifle (destruction 3.2) |+| `HoleRadiusMm` | mm | Radius of the bolt hole this weapon leaves (destruction 5); anchor 15 for the rifle |+| `RecoilPitchCurve`, `RecoilYawCurve` | `FRuntimeFloatCurve`, x = shot index, y = deg | The learnable pattern `P(n)` |+| `RecoilRandomFraction` | 0..1 | `f`, start 0.15 |+| `RecoilKickTime` | s | Time over which one kick is applied (`t_k`) |+| `RecoilRecoveryRate` | deg/s | `rho` |+| `RecoilRecoveryDelay` | s | `d_r`, time after a shot before recovery runs |+| `PatternResetTime` | s | Pause after which the shot index returns to 0 |+| `RecoilStanceMultiplier` | map `EVerseStance` to float | Stand 1.0, Crouch 0.85, Prone 0.65, Slide 1.3 (start values) |+| `RecoilAdsMultiplier` | float | Applied at full ADS blend |+| `ViewPunchScale` | float | Visual-only camera shake per shot; never moves the aim |+| `AdsTime` | s | Hip to full ADS |+| `AdsFov` | deg | First-person FOV at full ADS |+| `AdsMoveSpeedMultiplier` | float | Movement speed at full ADS |+| `SpreadBase` | map `EVerseStance` x {Hip, Ads} to deg | Cone half-angle at rest |+| `FirstShotSpread` | {Hip, Ads} deg | Spread of the first shot after `FirstShotRestTime` |+| `FirstShotRestTime` | s | Rest that restores first-shot accuracy |+| `SpreadMovePerMps` | deg per m/s | Added per m/s of horizontal speed |+| `SpreadAirborne` | deg | Added while airborne |+| `BloomPerShot`, `BloomMax` | deg | Spread growth per shot and cap |+| `BloomRecoveryRate`, `BloomRecoveryDelay` | deg/s, s | Bloom decay |+| `NoiseLoudness` | 0..1 | Used for the bot's hearing (`FVerseNoiseEvent`) |+| `BoltColorOwn`, `BoltColorFoe` | presentation tags | Amber own, red opponent (README) |++### 3.1 Start values (tuning, not frozen)++| Field | Graveline (AR) | Tallow (pistol) |+|---|---|---|+| FireMode / RPM | Auto / 690 | Semi / 380 (cap) |+| MagazineSize / closed bolt | 30 / yes | 15 / yes |+| ReloadTactical / ReloadEmpty | 2.1 s / 2.8 s | 1.5 s / 1.9 s |+| BaseDamage | 28 | 34 |+| Zones (Head, Neck, Upper, Lower, Arm, Leg) | 2.5, 1.5, 1.0, 0.9, 0.75, 0.7 | 2.2, 1.4, 1.0, 0.9, 0.75, 0.7 |+| Falloff start / end / min | 25 m / 45 m / 0.75 | 12 m / 30 m / 0.6 |+| ProjectileSpeed / MaxRange | 300 m/s / 150 m | 300 m/s / 100 m |+| PenetrationPower / MaxPenetrations | 100 / 3 | 50 / 2 |+| PieceDamage / HoleRadiusMm | 10 / 15 | 6 / 12 |+| Recoil pitch `P_p(n)` | 0.45° rising to 0.62° by shot 8, hold | 1.2° |+| Recoil yaw `P_y(n)` | +0.10° drifting right to shot 10, then -0.15° left | ±0.15° alternating |+| f / t_k / rho / d_r | 0.15 / 0.035 s / 5°/s / 0.12 s | 0.15 / 0.04 s / 6°/s / 0.10 s |+| PatternResetTime | 0.35 s | 0.3 s |+| FirstShotSpread hip / ADS | 0.9° / 0.0° | 0.7° / 0.0° |++These values satisfy the invariants of section 4.3; the harness re-checks+them on every data change.++## 4. Recoil model++### 4.1 Per-shot kick++Shot index `n` counts from 0 within a spray and resets to 0 when no shot was+fired for `PatternResetTime`.++```+P(n) = (P_p(n), P_y(n)) pattern from the curves; beyond the curve end the last value holds+m = RecoilStanceMultiplier[stance] * lerp(1, RecoilAdsMultiplier, ads)+u_n = point uniformly sampled in the unit disk from VerseRng(seed, n)+k_n = m * ( P(n) + f * |P(n)| * u_n ) f = RecoilRandomFraction (0.15)+```++The pattern part is identical every spray (learnable); the random part is+bounded by `f * |P(n)|`. `k_n` is added to the control rotation over+`RecoilKickTime` with an ease-out, so the camera follows the kick 1:1 and the+crosshair stays on the bolt's true direction. `ViewPunchScale` adds a+separate visual shake that never changes where bolts go.++### 4.2 Accumulator and recovery++`A = (A_p, A_y)` is recoil that has been applied and not yet recovered or+compensated.++```+on shot n: A += k_n+on player look input: if input pitch is downward: A_p = max(0, A_p - |input pitch|) (pulling down compensates)+ same rule for yaw against the sign of A_y+each tick, if now - t_last_shot >= d_r:+ step = min(|A|, rho * dt)+ A -= step * A/|A|, and the same step is removed from the control rotation+```++Recovery therefore never pulls the aim past where the player put it, and it+only returns what the weapon added.++### 4.3 Invariants (each is an automation test in `VerseHarness`)++| Id | Invariant | Test |+|---|---|---|+| R1 | **Recovery slower than kick, so sustained fire climbs.** For every shot index `n >= 1` up to `MagazineSize`: `rho * max(0, FireInterval - d_r) <= 0.5 * k_min_p`, where `k_min_p = min_n ( m_min * (P_p(n) - f * |P(n)|) )` and `m_min` is the smallest stance x ADS multiplier | `Verse.Combat.Recoil.RecoveryBelowKick`: evaluate the inequality for every weapon asset; then simulate a full-magazine spray at max RPM with no look input and assert `A_p` rises after every shot and ends `>= 0.5 * sum(k_n,p)` |+| R2 | Kick is fast, recovery is slow: `min_n |k_n| / RecoilKickTime >= 10 * rho` | `Verse.Combat.Recoil.KickRate` |+| R3 | Random part bounded: `|k_n - m * P(n)| <= f * m * |P(n)| + 1e-4` deg | `Verse.Combat.Recoil.RandomBound`, 10,000 seeded sprays |+| R4 | Pattern learnable: mean of `k_n` over 10,000 seeds is within 1 % of `m * P(n)` | `Verse.Combat.Recoil.PatternMean` |+| R5 | Deterministic: same seed, stance, ADS and inputs give the same `k_n` on server and owning client (tolerance 1e-4 deg) | `Verse.Combat.Recoil.ClientServerMatch` in the netcode test |+| R6 | First-shot accuracy: the first shot after `FirstShotRestTime` uses `FirstShotSpread` and `n = 0` | `Verse.Combat.Spread.FirstShot` |++**Today's bug, stated against R1.** The three.js blaster kicks 0.55° per hip+shot at 5 shots/s, and recovery runs at 9°/s from the 4th tick after a shot+(`combat/tuning.ts:239-242`, `combat/sim.ts:466`, `combat/sim.ts:667-670`).+So `FireInterval = 0.2 s`, `d_r = 4/60 s`, and recovery between shots is+`9 * (0.2 - 0.067) = 1.2°`, against a kick of 0.55°. The left side of R1 is+2.18 times the kick; R1 requires at most 0.5 times. Recovery outruns the+kick, `A_p` returns to zero before every shot, and the gun never climbs. With+the Graveline start values the left side is `5 * max(0, 0.087 - 0.12) = 0`:+no recovery at all during sustained fire.++### 4.4 Spread++```+sigma = SpreadBase[stance][hip/ads blend] + SpreadMovePerMps * horizontal_speed+ + (airborne ? SpreadAirborne : 0) + bloom+bloom = min(BloomMax, bloom + BloomPerShot) on each shot; decays at BloomRecoveryRate after BloomRecoveryDelay+first shot after FirstShotRestTime: sigma = FirstShotSpread[hip/ads blend], bloom = 0+dir = sample uniformly in a cone of half-angle sigma around (control rotation forward), from VerseRng(seed, n, salt=Spread)+```++`seed` per shot is `Hash(shooter net id, shot counter, match seed)`; client+and server derive the same direction. The server rejects a fire request whose+origin is more than 30 cm from the rewound eye point or whose direction is+more than `sigma + 1.5°` off the server's control rotation at that time, and+answers the client with `Rejected`, which removes the predicted bolt.++## 5. Projectiles and hits++| Topic | Decision |+|---|---|+| Representation | Not actors. `UVerseProjectileManager` (server world subsystem) holds bolts and steps them each tick: 300 m/s = 5 m per tick, straight, no drop (README) |+| Latency | A new bolt is advanced by the shooter's latency (capped 250 ms) in its first step; that segment traces rewound hit bodies. Later steps trace current bodies |+| Trace | Per step: piece proxies and world (channel `VerseBolt`), then per-bone hit bodies (channel `VerseHitBody`, frozen in `contracts/destruction.md`). Debris ignores both channels (`architecture.md` 4) |+| Zone | The physics body hit maps to `EVerseHitZone` through a bone table in the character's physics asset |+| Damage | `D = BaseDamage * ZoneMultipliers[zone] * falloff(distance) * penetration_factor`, falloff linear between `FalloffStart` and `FalloffEnd` down to `FalloffMinFraction`. Applied by a GAS damage effect on the server; armor (if MaxArmor > 0) absorbs first |+| Self and friendly | No self-damage from bolts; breach charge self-damage is the gadget contract's call |+| Client draw | Owner draws its own bolt at fire time (predicted, amber); others draw from `FVerseFireEvent` (red for the opponent). Impact VFX play from the cosmetic hit event, never from the client's own trace |+| Hit confirm | `ClientConfirmShot` (reliable, owner): shot counter, result (`Miss`, `HitBody`, `HitPiece`, `Blocked`, `Rejected`), zone, killing blow |++### 5.1 Fire, hit and death events++| Event | Raised on | Transport to clients | Consumers |+|---|---|---|---|+| `FVerseFireEvent` | Server; owner predicts its own | Unreliable multicast (skip owner) | Bolt VFX, audio, Bot (via noise) |+| `FVerseNoiseEvent` | Server only | None | Bot hearing. One `Noise.*` gameplay tag per event; the frozen tag list and ranges are in `contracts/bot.md` 3.2 and `DA_Audibility` |+| `FVerseHitEvent` | Server | Unreliable multicast (cosmetic copy); reliable to victim (damage direction) | Gore, UI, Bot (own hits only, as hit confirm), stats |+| `FVersePenetrationEvent` | Server | Unreliable multicast | Exit-hole VFX, Bot (noise), Destruction already informed by the piece damage call |+| `FVerseDeathEvent` | Server | Reliable multicast | Score, kill cam, Gore, Bot, respawn timer |+| `FVerseReloadEvent` | Server; owner predicts | Owner only | UI; a `FVerseNoiseEvent` with `Noise.Reload` goes to the bot |+| `FVerseGadgetEvent` | Server | Unreliable multicast | VFX, audio, UI, Bot (via noise), kill feed |+| `FVerseSetSummary` | Server, at each set end and for the unfinished set when the person leaves | None (the listen-server host's `VerseBridge` reads it from the hub) | `duel.result` reporter (WP21), end-of-set screen |++## 6. Penetration++The table, its columns, the cost formula and the power scale are owned by+`contracts/destruction.md` section 2 (`DA_PenetrationTable`, Core). Combat+uses them as they are; this section only says how the projectile manager+calls them.++```+power = PenetrationPower (100 = assault rifle), factor = 1, passes = 0+for each piece the step segment enters (IVersePenetrationQuery::TraceBolt, current-state proxies):+ cost = row.cost * clamp(traced_thickness / row.ref_thickness, 0.5, 3.0)+ ApplyPieceDamage(PieceDamage, Cause = Bolt) always, pass or not (server)+ stop if power < cost or passes == min(MaxPenetrations, 3)+ power -= cost; factor *= row.damage_multiplier; passes += 1+```++A passing bolt raises `FVersePenetrationEvent` and continues at the same+speed with damage multiplied by `factor`. Non-destructible world geometry+(hall floor, concrete, armor steel) maps to table rows through physical+materials (`concrete` cost 400 and `armor_steel` 10000, so nothing passes);+the Bulwark is not a table row and always stops a bolt (2.3). The interface+names are `IVersePenetrationQuery` and `IVersePieceDamage` (destruction,+frozen interface). Penetration always uses the authored per-state proxy,+never debris, so server, clients and bot agree.++## 7. Melee and finisher++### 7.1 Angles++All on the horizontal plane, using rewound transforms at the attacker's view+time.++| Symbol | Definition |+|---|---|+| `d` | Unit vector from victim to attacker (Z removed) |+| `theta` | Angle between the victim's facing (pawn yaw) and `d`, 0..180°. 0 = attacker straight in front |+| Front | `theta <= 60°` |+| Flank | `60° < theta <= 120°` |+| Back | `theta > 120°` |+| `phi` | Angle between the attacker's facing and `-d`, 0..180° (attacker looks at the victim when small) |+| `r` | Horizontal distance between capsule centres |+| `dz` | Height difference between capsule bases |++### 7.2 Which action a melee press becomes++The server decides; the client only predicts the swing animation.++| Condition (all must hold) | Result |+|---|---|+| Flank or back, `r <= 1.5 m`, `phi <= 45°`, `|dz| <= 0.6 m`, clear capsule sweep between them, victim Alive, not spawn protected, not prone, not mantling, attacker grounded and not prone | Finisher |+| Otherwise, a target within 2.0 m and inside the attacker's ±30° strike cone | Front strike |+| Otherwise | Whiff |++### 7.3 Front strike++| Field (`UVerseMeleeDefinition`, Core) | Start value |+|---|---|+| `StrikeDamage` | 55 (not a one-shot: two strikes kill) |+| `StrikeHitDelay` | 0.15 s from press to damage |+| `StrikeRange`, `StrikeConeHalfAngle` | 2.0 m, 30° |+| `StrikeCooldown` | 0.7 s |+| `StrikeZone` | Damage uses zone multiplier 1.0 regardless of bone |++The strike is a hit (`FVerseHitEvent`, `Source = Melee`). Whiffs and strikes+raise `FVerseNoiseEvent` with `Noise.Melee`.++### 7.4 Finisher state machine++Paired, server-driven, 2.5 s. Both pawns switch to third person (README).+Motion warping aligns the attacker to the victim's `Warp_Finisher` target.++```mermaid+stateDiagram-v2+ [*] --> Idle+ Idle --> Validate: melee press+ Validate --> Idle: fails 7.2 (becomes strike or whiff)+ Validate --> Locked: passes+ Locked --> Takedown: t = 0.25 s (warp done)+ Takedown --> Struggle: t = 0.9 s (victim on the ground)+ Struggle --> Kill: t = 1.8 s+ Kill --> Recover: t = 2.1 s (death applied)+ Recover --> Idle: t = 2.5 s+ Locked --> Aborted: attacker dies+ Takedown --> Aborted: attacker dies+ Struggle --> Aborted: attacker dies+ Aborted --> Idle: both released, victim keeps health+```++| Phase | Attacker | Victim |+|---|---|---|+| Locked to Recover | Phase `FinisherAttacker`, no input except look-free camera, cannot fire, **can take damage** (bolts already in flight, a placed breach charge, future teammates) | Phase `FinisherVictim`, no input, cannot fire, takes no other damage, cannot be hit by a second finisher |+| Struggle | Animation only, no input decides anything | Animation only |+| Kill (t = 2.1 s) | Gets the kill (`Finisher` flag, counts in stats) | Dies; `FVerseDeathEvent` with `Cause = Finisher`. Guaranteed once Locked unless the attacker died first |+| Recover | Returns to first person at 2.5 s with the active weapon re-equipped | Respawn timer started at death |++Server time stamps every phase in `FVerseFinisherEvent` (reliable multicast)+so clients play the paired clips in sync; the victim's client snaps to the+paired pose on `Locked`. `FVerseNoiseEvent` with `Noise.Finisher` is raised at Takedown.+With gore set to Reduced, the client cuts away to black from Takedown to+Recover (section 8).++## 8. Gore events++Gore is client cosmetic and decoupled from gameplay.++| Rule | Decision |+|---|---|+| Source | `VerseGore` subscribes on the hub to `FVerseHitEvent`, `FVerseDeathEvent`, `FVerseFinisherEvent`. It includes only Core, never Combat (`architecture.md` 2) |+| Direction | One way. Gore never changes health, phase, collision, line of sight or navigation, and gameplay never waits for gore. Blood decals and pools have no collision and are invisible to traces and to the bot |+| Where it runs | Every client with a viewport; a dedicated server and `-nullrhi` harness runs skip the module's work |+| Data it gets | Bone, zone, impact point in bone space, bolt direction, damage, killing blow, finisher phase. Spatter traces onto walls and floor are done by Gore itself, on the visibility channel |+| Setting | `EVerseGoreLevel` in `UVerseSettings` (local per viewer, never replicated): `Full` (default) or `Reduced` |+| Full | Blood bursts, wall and floor spatter, wound masks at the hit location, pools under bodies, bloody finisher. No dismemberment at any level (README) |+| Reduced | No blood, spatter, wounds or pools; hits show a neutral impact flash; finishers cut to black from Takedown to Recover |+| Budget | Decals and pools capped and recycled (oldest first); counts reported to the harness |++## 9. Deathmatch rules++### 9.1 Loop++| Rule | Value |+|---|---|+| Players | 2 (person and bot, or two people later) |+| Length | Endless while the duel is open; a hidden or paused stage pauses the match (`architecture.md` 1.2) |+| Score | Kill +1. A finisher and a headshot kill count +1 and are tracked separately |+| Sets | Score is counted in sets of first to 10 kills (start value). Each finished set raises `FVerseSetSummary` on the hub and sends one `duel.result` (`outcome` `won` or `lost`, `contracts/bridge-protocol.md` §10) with that set's numbers, then the set score resets. The match itself never ends |+| Health regeneration | Off (ruleset field, start 0 hp/s) |+| Respawn delay | 3.0 s from death; the kill cam fills it |+| Respawn loadout | Full loadout, full magazines and reserve |+| Leaving | Leaving mid-set (or Verse quitting) sends the unfinished set as `outcome: "unfinished"`: it counts in the duel statistics and pays no XP |++### 9.2 Spawn selection++Spawn points are `AVerseSpawnPoint` actors in the arena data layer.++```+candidates = spawn points not blocked (no pawn, Bulwark or armed breach charge within 3 m)+for each candidate c:+ visible(c) = any line from the opponent's current eye point to c's probe points+ (0.3 m, 1.0 m, 1.65 m above the floor) is clear on the VerseBolt channel+ (current piece proxies, so a broken wall counts as open)+ dist(c) = navmesh path length from the opponent to c (Euclidean if no path)+pool = candidates with !visible(c); if empty, pool = candidates+pick = argmax dist(c) over pool; ties within 1 m broken by VerseRng(match seed, death count)+```++The opponent is the only other player in 1v1; with more players a ruleset+uses the nearest enemy. Spawn selection runs at respawn time, not at death.++### 9.3 Spawn protection++| Rule | Value |+|---|---|+| Starts | On spawn |+| Ends | At `SpawnProtectionMax` (start 2.0 s) or at the first own offensive action: a fire request, melee press, or gadget activation. Reload, ADS, movement and slot switches do not end it |+| Effect | Incoming damage is ignored; the hit event is still raised with `bBlockedBySpawnProtection` so the shooter sees a "blocked" marker. Cannot be a finisher target |+| Visible | `bSpawnProtected` replicated to all; presentation shows it |++### 9.4 Invariants (harness tests)++| Id | Invariant |+|---|---|+| D1 | Respawn happens 3.0 s (±1 tick) after death |+| D2 | The chosen spawn is out of the opponent's sight whenever any candidate is |+| D3 | Among out-of-sight candidates the chosen one has the largest path distance |+| D4 | A protected player takes zero damage; the first own shot ends protection on that tick |+| D5 | Once `Locked`, a finisher kills the victim unless the attacker dies before t = 2.1 s |+| D6 | No gore event, setting or decal changes any replicated gameplay value (run the same seeded bot-vs-bot match with Full and Reduced; replicated state hashes match per tick) |++## 10. Swappable game mode++`AVerseGameMode` is thin and owns no rules. It instantiates one+`UVerseRuleset` from `UVerseRulesetConfig` (data asset) at match start and+forwards every rule question to it. Deathmatch is `UVerseRuleset_Deathmatch`.+A new mode is a new ruleset subclass plus a config asset; no other module+changes.++| Call | Asked when | Deathmatch answer |+|---|---|---|+| `OnMatchStart` | Arena switched on (`FVerseArenaSwitchEvent` on the hub) | Reset scores, spawn both |+| `GetLoadout(Player)` | Spawn | The fixed loadout of 2.2 |+| `CanDamage(Ctx)` | Before any damage | False when the victim is spawn protected or `FinisherVictim` (except the finisher's own kill) |+| `ModifyDamage(Ctx, Damage)` | After the formula | Unchanged |+| `OnPlayerAction(Player, Action)` | Fire, melee, gadget | Ends spawn protection on offensive actions |+| `OnKill(DeathEvent)` | Death | Score, start respawn timer, check set end |+| `GetRespawnDelay(Player)` | Death | 3.0 s |+| `ChooseSpawn(Player)` | Respawn | Section 9.2 |+| `GetSpawnProtection(Player)` | Spawn | 2.0 s, ends on first offensive action |+| `IsSetOver(OutWinner)` | After each kill | First to 10 |+| `BuildSetSummary(Out)` | Set end, and on leave for the unfinished set | Fills `FVerseSetSummary` (11.1) |++## 11. C++ type sketches++### 11.1 VerseCore++```cpp+// VerseCore/Public/Combat/VerseCombatTypes.h+UENUM(BlueprintType) enum class EVerseStance : uint8 { Stand, Crouch, Prone, Slide };+UENUM(BlueprintType) enum class EVerseHitZone : uint8 { None, Head, Neck, UpperTorso, LowerTorso, Arm, Leg };+UENUM(BlueprintType) enum class EVerseFireMode : uint8 { Semi, Burst, Auto };+UENUM(BlueprintType) enum class EVerseLoadoutSlot : uint8 { Primary, Secondary, Melee, GadgetA, GadgetB };+UENUM(BlueprintType) enum class EVerseCombatPhase : uint8 { Alive, Dead, FinisherAttacker, FinisherVictim };+UENUM(BlueprintType) enum class EVerseDamageSource : uint8 { Bolt, Melee, Finisher, Gadget, World };+UENUM(BlueprintType) enum class EVerseShotResult : uint8 { Miss, HitBody, HitPiece, Blocked, Rejected };+UENUM(BlueprintType) enum class EVerseFinisherPhase : uint8 { Locked, Takedown, Struggle, Kill, Recover, Aborted };+UENUM(BlueprintType) enum class EVerseGoreLevel : uint8 { Full, Reduced };+UENUM(BlueprintType) enum class EVerseGadgetEventKind : uint8 { Deploy, Destroyed, Expired, Plant, Detonate };+UENUM(BlueprintType) enum class EVerseSetOutcome : uint8 { Won, Lost, Unfinished };+UENUM(BlueprintType) enum class EVerseInputButton : uint32 { // bit flags in FVerseInputFrame::Buttons+ None = 0, Fire = 1 << 0, Ads = 1 << 1, Reload = 1 << 2, Melee = 1 << 3, Jump = 1 << 4,+ Crouch = 1 << 5, Prone = 1 << 6, Sprint = 1 << 7, LeanLeft = 1 << 8, LeanRight = 1 << 9,+ GadgetA = 1 << 10, GadgetB = 1 << 11, SlotPrimary = 1 << 12, SlotSecondary = 1 << 13,+ SlotMelee = 1 << 14, Interact = 1 << 15 };++// The one input path for persons, bots and harness models (bot.md B1).+USTRUCT(BlueprintType) struct FVerseInputFrame {+ GENERATED_BODY()+ UPROPERTY() FVector2f Move = FVector2f::ZeroVector; // -1..1, X forward, Y right (pawn space)+ UPROPERTY() FVector2f LookDeltaDeg = FVector2f::ZeroVector; // pitch, yaw added this tick+ UPROPERTY() uint32 Buttons = 0; // EVerseInputButton bits held this tick+ UPROPERTY() uint32 Pressed = 0; // bits that went down this tick+ UPROPERTY() uint32 ServerTimeMs = 0;+};++USTRUCT(BlueprintType) struct FVerseFireEvent {+ GENERATED_BODY()+ UPROPERTY() int32 ShooterId = 0; // player state id+ UPROPERTY() FName WeaponId;+ UPROPERTY() uint16 ShotCounter = 0;+ UPROPERTY() uint32 Seed = 0;+ UPROPERTY() FVector_NetQuantize10 Origin; // cm+ UPROPERTY() FVector_NetQuantizeNormal Direction;+ UPROPERTY() float ServerTime = 0.f;+};++USTRUCT(BlueprintType) struct FVerseHitEvent {+ GENERATED_BODY()+ UPROPERTY() int32 InstigatorId = 0;+ UPROPERTY() int32 VictimId = 0;+ UPROPERTY() FName WeaponId;+ UPROPERTY() EVerseDamageSource Source = EVerseDamageSource::Bolt;+ UPROPERTY() uint16 ShotCounter = 0;+ UPROPERTY() EVerseHitZone Zone = EVerseHitZone::None;+ UPROPERTY() FName Bone;+ UPROPERTY() FVector_NetQuantize10 ImpactWorld; // cm+ UPROPERTY() FVector_NetQuantize10 ImpactBoneLocal;+ UPROPERTY() FVector_NetQuantizeNormal Direction;+ UPROPERTY() float DistanceM = 0.f;+ UPROPERTY() float Damage = 0.f; // after all factors+ UPROPERTY() uint8 PenetrationCount = 0;+ UPROPERTY() uint8 bHeadshot : 1;+ UPROPERTY() uint8 bKillingBlow : 1;+ UPROPERTY() uint8 bBlockedBySpawnProtection : 1;+ UPROPERTY() float ServerTime = 0.f;+};++USTRUCT(BlueprintType) struct FVersePenetrationEvent {+ GENERATED_BODY()+ UPROPERTY() int32 ShooterId = 0;+ UPROPERTY() uint16 ShotCounter = 0;+ UPROPERTY() uint16 PieceIndex = 0; // DA_PieceManifest index (destruction 8)+ UPROPERTY() uint8 MaterialWireId = 0; // DA_PenetrationTable wire id (destruction 2)+ UPROPERTY() FVector_NetQuantize10 Entry;+ UPROPERTY() FVector_NetQuantize10 Exit;+ UPROPERTY() float ThicknessCm = 0.f;+ UPROPERTY() float PowerBefore = 0.f, PowerAfter = 0.f, DamageFactorAfter = 1.f;+ UPROPERTY() bool bPassed = false;+};++USTRUCT(BlueprintType) struct FVerseDeathEvent {+ GENERATED_BODY()+ UPROPERTY() int32 VictimId = 0;+ UPROPERTY() int32 KillerId = 0;+ UPROPERTY() EVerseDamageSource Cause = EVerseDamageSource::Bolt;+ UPROPERTY() FName WeaponId;+ UPROPERTY() EVerseHitZone LastZone = EVerseHitZone::None;+ UPROPERTY() float ServerTime = 0.f;+ UPROPERTY() float RespawnAt = 0.f;+};++USTRUCT(BlueprintType) struct FVerseFinisherEvent {+ GENERATED_BODY()+ UPROPERTY() int32 AttackerId = 0;+ UPROPERTY() int32 VictimId = 0;+ UPROPERTY() EVerseFinisherPhase Phase = EVerseFinisherPhase::Locked;+ UPROPERTY() float SequenceStartServerTime = 0.f; // phases derive from this + fixed offsets+ UPROPERTY() FTransform WarpTarget;+};++USTRUCT(BlueprintType) struct FVerseNoiseEvent { // declared in architecture.md; fields frozen here for combat+ GENERATED_BODY()+ UPROPERTY() FGameplayTag Noise; // one Noise.* tag of bot.md 3.2, the DA_Audibility row key+ UPROPERTY() int32 SourceId = 0; // player state id, -1 = world (pieces, drones)+ UPROPERTY() FVector Location; // true position; the bot's perception adds error+ UPROPERTY() float Loudness = 1.f; // destruction 6.2 loudness for Noise.Fracture, else 1+ UPROPERTY() float ServerTime = 0.f;+};++USTRUCT(BlueprintType) struct FVerseReloadEvent {+ GENERATED_BODY()+ UPROPERTY() int32 PlayerId = 0;+ UPROPERTY() FName WeaponId;+ UPROPERTY() bool bTactical = true; // a round was chambered+ UPROPERTY() float StartServerTime = 0.f, EndServerTime = 0.f;+ UPROPERTY() bool bCancelled = false;+};++USTRUCT(BlueprintType) struct FVerseGadgetEvent {+ GENERATED_BODY()+ UPROPERTY() EVerseGadgetEventKind Kind = EVerseGadgetEventKind::Deploy;+ UPROPERTY() FName GadgetId;+ UPROPERTY() int32 OwnerId = 0;+ UPROPERTY() FVector_NetQuantize10 Location;+ UPROPERTY() float ServerTime = 0.f;+};++USTRUCT(BlueprintType) struct FVerseArenaSwitchEvent { // raised by VerseDecks (hangar switch)+ GENERATED_BODY()+ UPROPERTY() bool bArenaOn = false;+ UPROPERTY() FName Deck; // "hangar"+ UPROPERTY() float ServerTime = 0.f;+};++USTRUCT(BlueprintType) struct FVerseStationUsedEvent { // raised by VerseDecks stations; VerseUI opens the matching view+ GENERATED_BODY()+ UPROPERTY() FName StationId;+ UPROPERTY() FName Kind; // station kind (parity S-01), e.g. "armoury"+ UPROPERTY() int32 UserId = 0; // player state id+};++USTRUCT(BlueprintType) struct FVerseSetLine { // one player's numbers in one set+ GENERATED_BODY()+ UPROPERTY() int32 PlayerId = 0;+ UPROPERTY() bool bIsBot = false;+ UPROPERTY() int32 Kills = 0, Deaths = 0, Headshots = 0, Finishers = 0, MeleeKills = 0;+ UPROPERTY() int32 ShotsFired = 0, ShotsHit = 0, DamageDealt = 0, DamageTaken = 0;+ UPROPERTY() int32 WallsBreached = 0, BulwarksPlaced = 0, BestStreak = 0;+ UPROPERTY() TMap<FName, FIntVector4> PerWeapon; // weapon id -> (kills, headshots, shots fired, shots hit)+};++USTRUCT(BlueprintType) struct FVerseSetSummary { // payload of duel.result (bridge-protocol 10)+ GENERATED_BODY()+ UPROPERTY() FString MatchId; // unique per set result, idempotency key+ UPROPERTY() FString SessionId; // one arena session+ UPROPERTY() int32 SetIndex = 0;+ UPROPERTY() FName RulesetId; // "endless/1"+ UPROPERTY() FName BotTier; // as AVersePlayerState::BotTier+ UPROPERTY() EVerseSetOutcome Outcome = EVerseSetOutcome::Unfinished; // from the person's side+ UPROPERTY() double StartedAtUnix = 0.0, EndedAtUnix = 0.0;+ UPROPERTY() float MatchTimeS = 0.f; // paused time excluded+ UPROPERTY() FVerseSetLine Person, Opponent;+};++UCLASS() class VERSECORE_API UVerseWeaponDefinition : public UPrimaryDataAsset {+ GENERATED_BODY()+public:+ UPROPERTY(EditDefaultsOnly) FName WeaponId;+ UPROPERTY(EditDefaultsOnly) FText DisplayName;+ UPROPERTY(EditDefaultsOnly) EVerseLoadoutSlot Slot;+ UPROPERTY(EditDefaultsOnly) EVerseFireMode FireMode;+ UPROPERTY(EditDefaultsOnly) int32 BurstCount = 3;+ UPROPERTY(EditDefaultsOnly) float RPM = 600.f;+ UPROPERTY(EditDefaultsOnly) int32 MagazineSize = 30;+ UPROPERTY(EditDefaultsOnly) bool bClosedBolt = true;+ UPROPERTY(EditDefaultsOnly) int32 ReserveRounds = 90;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float ReloadTactical = 2.f, ReloadEmpty = 2.7f;+ UPROPERTY(EditDefaultsOnly) float ReloadCommitFraction = 0.6f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float EquipTime = 0.5f, HolsterTime = 0.3f;+ UPROPERTY(EditDefaultsOnly) float BaseDamage = 25.f;+ UPROPERTY(EditDefaultsOnly) TMap<EVerseHitZone, float> ZoneMultipliers;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float FalloffStart = 20.f, FalloffEnd = 40.f;+ UPROPERTY(EditDefaultsOnly) float FalloffMinFraction = 0.7f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m/s")) float ProjectileSpeed = 300.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float MaxRange = 150.f;+ UPROPERTY(EditDefaultsOnly) float PenetrationPower = 100.f; // 100 = assault rifle (destruction 2)+ UPROPERTY(EditDefaultsOnly) int32 MaxPenetrations = 3; // clamped to 3+ UPROPERTY(EditDefaultsOnly) float PieceDamage = 10.f;+ UPROPERTY(EditDefaultsOnly) uint8 HoleRadiusMm = 15;+ UPROPERTY(EditDefaultsOnly) FRuntimeFloatCurve RecoilPitchCurve, RecoilYawCurve;+ UPROPERTY(EditDefaultsOnly) float RecoilRandomFraction = 0.15f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float RecoilKickTime = 0.035f;+ UPROPERTY(EditDefaultsOnly) float RecoilRecoveryRate = 5.f; // deg/s+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float RecoilRecoveryDelay = 0.12f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float PatternResetTime = 0.35f;+ UPROPERTY(EditDefaultsOnly) TMap<EVerseStance, float> RecoilStanceMultiplier;+ UPROPERTY(EditDefaultsOnly) float RecoilAdsMultiplier = 0.8f;+ UPROPERTY(EditDefaultsOnly) float ViewPunchScale = 1.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float AdsTime = 0.25f;+ UPROPERTY(EditDefaultsOnly) float AdsFov = 60.f, AdsMoveSpeedMultiplier = 0.6f;+ UPROPERTY(EditDefaultsOnly) TMap<EVerseStance, FVector2f> SpreadBase; // X = hip, Y = ADS, deg+ UPROPERTY(EditDefaultsOnly) FVector2f FirstShotSpread; // hip, ADS+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float FirstShotRestTime = 0.3f;+ UPROPERTY(EditDefaultsOnly) float SpreadMovePerMps = 0.2f, SpreadAirborne = 3.f;+ UPROPERTY(EditDefaultsOnly) float BloomPerShot = 0.15f, BloomMax = 2.f;+ UPROPERTY(EditDefaultsOnly) float BloomRecoveryRate = 4.f, BloomRecoveryDelay = 0.1f;+ UPROPERTY(EditDefaultsOnly) float NoiseLoudness = 1.f;++ float FireInterval() const { return 60.f / RPM; }+ // R1 as code; the harness calls it for every asset.+ bool SatisfiesRecoveryBelowKick(float MinMultiplier, int32 MaxShot) const;+};++UCLASS() class VERSECORE_API UVerseMeleeDefinition : public UPrimaryDataAsset {+ GENERATED_BODY()+public:+ UPROPERTY(EditDefaultsOnly) float StrikeDamage = 55.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float StrikeHitDelay = 0.15f, StrikeCooldown = 0.7f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float StrikeRange = 2.f;+ UPROPERTY(EditDefaultsOnly) float StrikeConeHalfAngle = 30.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float FinisherRange = 1.5f, FinisherMaxHeightDelta = 0.6f;+ UPROPERTY(EditDefaultsOnly) float FrontHalfAngle = 60.f, AttackerFacingMax = 45.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float FinisherDuration = 2.5f, FinisherKillTime = 2.1f;+};++UCLASS() class VERSECORE_API UVerseGadgetDefinition : public UPrimaryDataAsset {+ GENERATED_BODY()+public:+ UPROPERTY(EditDefaultsOnly) FName GadgetId;+ UPROPERTY(EditDefaultsOnly) FText DisplayName;+ UPROPERTY(EditDefaultsOnly) int32 Charges = 1;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float Cooldown = 20.f, UseTime = 0.6f, Lifetime = 25.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float PlaceRange = 1.5f;+ UPROPERTY(EditDefaultsOnly) float MaxHealth = 400.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) FVector3f Size = FVector3f(1.8f, 1.4f, 0.1f);+ UPROPERTY(EditDefaultsOnly) float PawnDamage = 0.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="m")) float PawnRadius = 0.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="cm")) float PieceBreachRadius = 0.f;+ UPROPERTY(EditDefaultsOnly) bool bSelfDamage = false;+};++DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseFire, const FVerseFireEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseHit, const FVerseHitEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVersePenetration, const FVersePenetrationEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseDeath, const FVerseDeathEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseFinisher, const FVerseFinisherEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseNoise, const FVerseNoiseEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseReload, const FVerseReloadEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseGadget, const FVerseGadgetEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseFracture, const FVerseFractureEvent&); // destruction 4+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseArenaSwitch, const FVerseArenaSwitchEvent&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseSetEnded, const FVerseSetSummary&);+DECLARE_MULTICAST_DELEGATE_OneParam(FOnVerseStationUsed, const FVerseStationUsedEvent&);++UCLASS() class VERSECORE_API UVerseEventHub : public UWorldSubsystem {+ GENERATED_BODY()+public:+ FOnVerseFire OnFire; FOnVerseHit OnHit; FOnVersePenetration OnPenetration;+ FOnVerseDeath OnDeath; FOnVerseFinisher OnFinisher;+ FOnVerseNoise OnNoise; // server only; Bot listens+ FOnVerseReload OnReload; FOnVerseGadget OnGadget;+ FOnVerseFracture OnFracture; // server and clients+ FOnVerseArenaSwitch OnArenaSwitch; // Decks raises; Combat rules, Destruction reset, Crew, Bot listen+ FOnVerseSetEnded OnSetEnded; // server; the Bridge duel reporter and the UI listen+ FOnVerseStationUsed OnStationUsed; // local; Decks raises, UI and Screens listen (no Decks -> UI include)+};+```++### 11.2 VerseCombat++```cpp+// GAS attributes+UCLASS() class VERSECOMBAT_API UVerseHealthSet : public UAttributeSet {+ GENERATED_BODY()+public:+ UPROPERTY(ReplicatedUsing=OnRep_Health) FGameplayAttributeData Health; // COND_OwnerOnly+ UPROPERTY(Replicated) FGameplayAttributeData MaxHealth;+ UPROPERTY(Replicated) FGameplayAttributeData Armor; // 0 in deathmatch+ UPROPERTY(Replicated) FGameplayAttributeData MaxArmor;+ UPROPERTY() FGameplayAttributeData IncomingDamage; // meta, server only+};++UENUM() enum class EVerseReloadPhase : uint8 { None, Tactical, Empty };++USTRUCT() struct FVerseWeaponSlotState : public FFastArraySerializerItem {+ GENERATED_BODY()+ UPROPERTY() EVerseLoadoutSlot Slot;+ UPROPERTY() TObjectPtr<const UVerseWeaponDefinition> Definition;+ UPROPERTY() uint8 Magazine = 0;+ UPROPERTY() bool bChambered = false;+ UPROPERTY() uint16 Reserve = 0;+ UPROPERTY() EVerseReloadPhase Reload = EVerseReloadPhase::None;+ UPROPERTY() float ReloadEndsAt = 0.f; // server time+};++USTRUCT() struct FVerseWeaponSlotArray : public FFastArraySerializer {+ GENERATED_BODY()+ UPROPERTY() TArray<FVerseWeaponSlotState> Items;+ bool NetDeltaSerialize(FNetDeltaSerializeInfo& P) {+ return FastArrayDeltaSerialize<FVerseWeaponSlotState, FVerseWeaponSlotArray>(Items, P, *this);+ }+};++UCLASS() class VERSECOMBAT_API UVerseInventoryComponent : public UActorComponent {+ GENERATED_BODY()+public:+ UPROPERTY(Replicated) FVerseWeaponSlotArray Slots; // COND_OwnerOnly+ UPROPERTY(Replicated) EVerseLoadoutSlot ActiveSlot; // all+ UPROPERTY(Replicated) bool bReloading = false; // all, animation only+ UFUNCTION(Server, Reliable) void ServerReload(uint16 ClientCounter);+ UFUNCTION(Server, Reliable) void ServerSwitchSlot(EVerseLoadoutSlot NewSlot);+};++struct FVerseRecoilState { // not replicated; simulated on server and owner+ int32 ShotIndex = 0;+ float LastShotTime = -1000.f;+ FVector2f Accumulated = FVector2f::ZeroVector; // A, degrees (pitch, yaw)+ float Bloom = 0.f;+ FVector2f KickFor(const UVerseWeaponDefinition& W, float Multiplier, uint32 Seed) const; // k_n+ void OnShot(const FVector2f& Kick, float Now);+ void OnLookInput(FVector2f& InOutDelta); // compensation rule of 4.2+ FVector2f TickRecovery(const UVerseWeaponDefinition& W, float Now, float Dt); // returns rotation to remove+};++UCLASS() class VERSECOMBAT_API UVerseWeaponComponent : public UActorComponent {+ GENERATED_BODY()+public:+ UPROPERTY(Replicated) uint8 AdsBlend = 0;+ UFUNCTION(Server, Unreliable) void ServerFire(uint16 ShotCounter, uint32 Seed,+ FVector_NetQuantize10 Origin, FVector_NetQuantizeNormal Dir, float ClientServerTime);+ UFUNCTION(Client, Reliable) void ClientConfirmShot(uint16 ShotCounter, EVerseShotResult Result,+ EVerseHitZone Zone, bool bKillingBlow);+ UFUNCTION(NetMulticast, Unreliable) void MulticastFire(const FVerseFireEvent& E);+ UFUNCTION(NetMulticast, Unreliable) void MulticastHitCosmetic(const FVerseHitEvent& E);+private:+ FVerseRecoilState Recoil;+};++UCLASS() class VERSECOMBAT_API UVerseProjectileManager : public UTickableWorldSubsystem {+ GENERATED_BODY() // server: steps bolts 5 m per tick, traces, applies damage, raises hub events+public:+ void SpawnBolt(const FVerseFireEvent& Fire, const UVerseWeaponDefinition& Weapon, float LatencyS);+};++UENUM() enum class EVerseMeleeOutcome : uint8 { Whiff, Strike, Finisher };++UCLASS() class VERSECOMBAT_API UVerseMeleeComponent : public UActorComponent {+ GENERATED_BODY()+public:+ UFUNCTION(Server, Reliable) void ServerMelee(float ClientServerTime);+ UFUNCTION(NetMulticast, Reliable) void MulticastFinisher(const FVerseFinisherEvent& E);+ static EVerseMeleeOutcome Classify(const FTransform& Attacker, const FTransform& Victim,+ const UVerseMeleeDefinition& Def, bool bVictimEligible, bool bSweepClear); // 7.2, pure, unit-tested+};++UCLASS() class VERSECOMBAT_API AVersePlayerState : public APlayerState {+ GENERATED_BODY()+public:+ UPROPERTY(Replicated) int32 Kills = 0, Deaths = 0, Headshots = 0, Finishers = 0;+ UPROPERTY(Replicated) int32 SetKills = 0, SetsWon = 0;+ UPROPERTY(Replicated) float RespawnAt = 0.f;+ UPROPERTY(Replicated) FName BotTier; // None for a person+ UPROPERTY(Replicated) float BotEffectiveSkill = -1.f; // adaptive s; -1 for a person+};++// Combat state on the pawn. AVerseCharacter is a VerseMovement class; the primary+// module's default pawn adds this component (architecture 2).+UCLASS() class VERSECOMBAT_API UVerseCombatStateComponent : public UActorComponent {+ GENERATED_BODY()+public:+ UPROPERTY(Replicated) EVerseCombatPhase Phase = EVerseCombatPhase::Alive;+ UPROPERTY(Replicated) bool bSpawnProtected = false;+ UPROPERTY(Replicated) float SpawnProtectedUntil = 0.f;+};++UCLASS() class VERSECOMBAT_API AVerseSpawnPoint : public APlayerStart {+ GENERATED_BODY()+public:+ UPROPERTY(EditInstanceOnly) TArray<float> ProbeHeightsM = {0.3f, 1.0f, 1.65f};+};++USTRUCT() struct FVerseDamageContext {+ GENERATED_BODY()+ UPROPERTY() TObjectPtr<AController> Instigator;+ UPROPERTY() TObjectPtr<APawn> Victim;+ UPROPERTY() EVerseDamageSource Source;+ UPROPERTY() EVerseHitZone Zone;+};++UENUM() enum class EVersePlayerAction : uint8 { Fire, Melee, Gadget, Reload, Ads, SwitchSlot };++UCLASS() class VERSECOMBAT_API UVerseRulesetConfig : public UPrimaryDataAsset {+ GENERATED_BODY()+public:+ UPROPERTY(EditDefaultsOnly) TSubclassOf<class UVerseRuleset> RulesetClass;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float RespawnDelay = 3.f;+ UPROPERTY(EditDefaultsOnly, meta=(Units="s")) float SpawnProtectionMax = 2.f;+ UPROPERTY(EditDefaultsOnly) int32 KillsPerSet = 10;+ UPROPERTY(EditDefaultsOnly) float HealthRegenPerSec = 0.f;+ UPROPERTY(EditDefaultsOnly) float MaxArmor = 0.f;+ UPROPERTY(EditDefaultsOnly) TMap<EVerseLoadoutSlot, TSoftObjectPtr<UPrimaryDataAsset>> Loadout;+};++UCLASS(Abstract) class VERSECOMBAT_API UVerseRuleset : public UObject {+ GENERATED_BODY()+public:+ virtual void Init(class AVerseGameMode* Mode, const UVerseRulesetConfig* Config);+ virtual void OnMatchStart() PURE_VIRTUAL(UVerseRuleset::OnMatchStart, );+ virtual void GetLoadout(const AVersePlayerState* P, TMap<EVerseLoadoutSlot, const UPrimaryDataAsset*>& Out) const;+ virtual bool CanDamage(const FVerseDamageContext& Ctx) const { return true; }+ virtual float ModifyDamage(const FVerseDamageContext& Ctx, float Damage) const { return Damage; }+ virtual void OnPlayerAction(AVersePlayerState* P, EVersePlayerAction Action) {}+ virtual void OnKill(const FVerseDeathEvent& E) PURE_VIRTUAL(UVerseRuleset::OnKill, );+ virtual float GetRespawnDelay(const AVersePlayerState* P) const;+ virtual AVerseSpawnPoint* ChooseSpawn(const AVersePlayerState* P) PURE_VIRTUAL(UVerseRuleset::ChooseSpawn, return nullptr; );+ virtual float GetSpawnProtection(const AVersePlayerState* P) const;+ virtual bool IsSetOver(AVersePlayerState*& OutWinner) const { return false; }+ virtual void BuildSetSummary(FVerseSetSummary& Out) const {}+};++UCLASS() class VERSECOMBAT_API UVerseRuleset_Deathmatch : public UVerseRuleset { GENERATED_BODY() /* sections 9.1-9.3 */ };++UCLASS() class VERSECOMBAT_API AVerseGameMode : public AGameModeBase {+ GENERATED_BODY() // thin: owns the ruleset instance, forwards rule questions, never decides itself+public:+ UPROPERTY(EditDefaultsOnly) TObjectPtr<UVerseRulesetConfig> RulesetConfig;+ UPROPERTY(Transient) TObjectPtr<UVerseRuleset> Ruleset;+};+```++`FVerseSetSummary` and `FVerseSetLine` (Core) are the payload the bridge+maps field for field onto `duel.result` (`contracts/bridge-protocol.md` §10);+`VerseBridge` reads them from `UVerseEventHub::OnSetEnded` and never includes+`VerseCombat`.++## 12. Acceptance tests owned by this contract++| Test | Lane |+|---|---|+| `Verse.Combat.Recoil.*` (R1-R6) | `unreal-build`, `-nullrhi` |+| `Verse.Combat.Spread.FirstShot` | `unreal-build` |+| `Verse.Combat.Damage.ZonesAndFalloff`: table-driven, every weapon and zone at 0, start, mid, end, beyond | `unreal-build` |+| `Verse.Combat.Penetration.Budget`: power and factor per surface and thickness; floor never passes | `unreal-build` |+| `Verse.Combat.Melee.Classify`: angle grid 0-180° x distance 0-2.5 m x height, against 7.2 | `unreal-build` |+| `Verse.Combat.Finisher.Timeline`: phases at 0.25/0.9/1.8/2.1/2.5 s, abort on attacker death, D5 | netcode test |+| `Verse.Combat.Deathmatch.*` (D1-D4) | `unreal-build` |+| `Verse.Gore.NoGameplayEffect` (D6) | `unreal-gauntlet` |+| `Verse.Combat.Prediction.FireReconcile`: lagged client, predicted bolts reconcile, rejected shots removed | netcode test |+| `Verse.Combat.Gadget.*` (GD1 to GD4, section 2.3) | `unreal-build` |+| Forbidden-name scan over weapon assets and JSON exports | `unreal-static` |++## Frozen interface++Other packages may rely on these without asking:++- The enums, event structs and their fields in 11.1, the `UVerseEventHub`+ delegates, and which side raises each event and how it travels (5.1).+- The `UVerseWeaponDefinition`, `UVerseMeleeDefinition` and+ `UVerseGadgetDefinition` field names, types and units (sections 3, 7.3,+ 2.3), the gadget rules of 2.3, `FVerseInputFrame` and its button bits, and+ the formulas for recoil (4.1-4.2), spread (4.4), damage (5), the+ penetration call order (6, on top of destruction 2) and spawn selection+ (9.2).+- The recoil invariants R1-R6 and the deathmatch invariants D1-D6 as tests+ that must stay green.+- The replication table in 2.1: which object holds a value and who receives+ it (owner only vs all), including `UVerseCombatStateComponent` and the bot+ fields on `AVersePlayerState`.+- `FVerseSetSummary` / `FVerseSetLine` and the per-set result rule of 9.1.+- The melee angle definitions (7.1), the classification rules (7.2), the+ finisher phases, their offsets and who is vulnerable (7.4).+- The gore rules of section 8: one-way, Core-only includes, the two levels,+ `Full` as default.+- The `UVerseRuleset` virtual interface and `UVerseRulesetConfig` fields+ (section 10); `AVerseGameMode` stays a forwarder.++Not frozen: every start value in tables marked as such, the curve shapes,+and the set size; the balance harness owns them, changes land as data-asset+edits that keep R1-R6 green.++## Change rule++Any change to the frozen interface goes through the integration owner only:+a pull request that edits this file first, names every package affected,+and updates the tests in section 12 in the same change. Work-package agents+never change a frozen type, field, formula or invariant on their own; they+open a request to the integration owner and code against the current+contract until it lands. Tuning values change through data assets and the+harness, not through this file.diff --git a/docs/verse/unreal/contracts/coordinates.md b/docs/verse/unreal/contracts/coordinates.mdnew file mode 100644index 0000000000..61056ed342--- /dev/null+++ b/docs/verse/unreal/contracts/coordinates.md@@ -0,0 +1,303 @@+# Contract: coordinates and units++Owner: integration owner. Implemented in `VerseCore` (architecture section 2).+Every package that reads a three.js-era number (deck manifests, `ArenaDef`+data, art builders, bridge payloads, golden test data) converts it through this+contract and nowhere else.++## 1. The two frames++| | three.js Verse today (source frame, "T") | Unreal Verse (target frame, "U") |+|---|---|---|+| Length unit | metre | centimetre |+| Handedness | right-handed | left-handed |+| Up | +Y | +Z |+| Other axes | +X = screen right (plan east), +Z = toward the plate camera (plan south, screen bottom) | +X = forward (engine convention), +Y = right |+| Floor | deck floor at y = 0 | deck floor at Z = 0 (deck-local) |+| Plan origin | `x = 0` left hull wall, `z = 0` far (hero) hull wall (`art/verse/LEVELS.md`) | same point, deck-local origin |+| Yaw | radians about +Y, 0 faces +Z, 90° faces +X (`combat/math.ts:2-4`, `yawOf = atan2(dx, dz)`); manifests store `yaw_deg` with the same meaning (`content/loadDeck.ts:47`, `arena.ts` spoke `yawDeg`) | degrees about +Z, 0 faces +X, +90 faces +Y; range (-180, 180] (`FRotator::NormalizeAxis`) |+| Pitch | radians, positive looks up (`combat/math.ts:4`) | degrees, positive looks up |+| Mesh front | actor roots turn by `rotation.y = yaw` (`actors/actor.ts:688`), so models face local +Z | a pawn's gameplay forward is +X; an imported skeletal or static mesh's front is local +Y (section 3.3) |+| Blender (art builders) | Blender = (x, -z, y) of T (`art/verse/BRIEF.md` §4, `hangar_layout.py:B`) | reached through glTF, never directly |++Source of the mapping. Unreal's own glTF importer and exporter swap Y and Z and+scale metres by 100 (`Plugins/Interchange/Runtime/Source/Parsers/GLTFCore/Private/GLTF/ConversionUtilities.h:16-42`,+`Import/Private/Gltf/InterchangeGltfPrivate.h:24` `GltfUnitConversionMultiplier = 100`).+Our realtime exports are glTF with +Y up, which is frame T. Choosing the same+mapping means imported meshes, converted manifest sockets and converted sim+data land on the same spot with no per-asset fix-up. This is a decision.++## 2. Formulas++### 2.1 Positions, lengths, directions++Let `M` be the axis permutation T→U (Y and Z swapped, determinant -1, so the+handedness flips):++```+M = | 1 0 0 | U = 100 · M · T + O_deck (positions)+ | 0 0 1 | U = M · T (directions, normals: no scale, no offset)+ | 0 1 0 | T = M · (U - O_deck) / 100 (M is its own inverse)+```++Per component:++| Quantity | T to U | U to T |+|---|---|---|+| Position | `X = 100·x + Ox`, `Y = 100·z + Oy`, `Z = 100·y + Oz` | `x = (X-Ox)/100`, `y = (Z-Oz)/100`, `z = (Y-Oy)/100` |+| Direction, normal, velocity direction | `(x, z, y)` | `(X, Z, Y)` |+| Length, radius, height, distance | `·100` | `/100` |+| Speed (m/s), acceleration (m/s²) | `·100` (cm/s, cm/s²) | `/100` |+| Area, volume | `·10⁴`, `·10⁶` | `/10⁴`, `/10⁶` |+| Time, mass, damage, health, angles in a cone (±44° sight) | unchanged | unchanged |+| Axis-aligned box `x0..x1, y0..y1, z0..z1` | `Min = 100·(x0, z0, y0) + O`, `Max = 100·(x1, z1, y1) + O` (no negation, so min stays min) | inverse |+| Vertical cylinder `(x, z, r, y0..y1)` | centre `100·(x, z)`, radius `100·r`, `Z` span `100·y0..100·y1` | inverse |+| Cross product | `M(a × b) = -(Ma × Mb)`: a three.js cross product changes sign after conversion. Convert the operands, then cross in U; never convert a T cross product | |++`O_deck` is the deck's world origin in centimetres, owned by `VerseDecks`. It+is a pure translation: no rotation, no scale, ever. Deck-local code passes+`FVerseDeckFrame::Local()` (zero offset).++### 2.2 Heading (gameplay yaw)++A heading is where an actor, controller, spawn, console or camera points.+three.js forward is `(sin ψ, 0, cos ψ)`; Unreal forward of yaw `φ` is+`(cos φ, sin φ, 0)`. Through `M`:++```+φ_deg = Normalize( 90 - ψ_deg ) ψ_deg = ψ_rad · 180/π+ψ_rad = WrapPi( (90 - φ_deg) · π/180 ) Normalize → (-180, 180], WrapPi → (-π, π]+```++- Sense flips: three.js yaw grows counter-clockwise on the LEVELS plan+ (x right, z down); Unreal yaw grows clockwise seen from above. Yaw *rates*+ therefore flip sign: `φ̇ = -ψ̇` (deg/s from rad/s: `-ψ̇·180/π`).+- three.js "right" (`rightX = -cos ψ`, `rightZ = sin ψ`, `combat/math.ts:47-48`)+ maps exactly to Unreal's right axis (`FRotationMatrix(R).GetUnitAxis(EAxis::Y)`).+ Lean sign is defined in U: lean > 0 moves toward the pawn's right axis.+- Pitch: `θ_U_deg = θ_T_rad · 180/π`, same sign. View rotation = `FRotator(θ, φ, 0)`.+ Then `FRotator(θ, φ, 0).Vector() == M · dirFromAngles(ψ, θ)` (`combat/math.ts:51-54`).++### 2.3 Object rotation (geometry placed as authored)++For a rotation operator (an Object3D quaternion, a glTF node rotation), the+conversion is the one Unreal's glTF importer uses:++```+q_U = ( -q_T.x, -q_T.z, -q_T.y, q_T.w ) q_T = ( -q_U.x, -q_U.z, -q_U.y, q_U.w )+```++so that `q_U.RotateVector(M·v) == M·(q_T · v)`. A pure three.js yaw `ψ` becomes+a Unreal yaw of `-ψ_deg`: this is the **mesh yaw**, and it always equals+`heading - 90°`. Consequences:++| Use | Function | Value for manifest `yaw_deg = a` |+|---|---|---|+| Actor, pawn, controller, spawn point, console facing, AI facing | `ToUnrealHeadingDeg` | `Normalize(90 - a)` |+| Static geometry imported from the realtime glTF and placed by its socket | `ToUnrealMeshYawDeg` | `Normalize(-a)` |+| Skeletal mesh on a pawn | mesh component relative yaw is the fixed `-90°` | (heading - 90 = mesh yaw) |++Never convert a three.js **camera** quaternion: a three.js camera looks down+local -Z, a Unreal camera down local +X. Convert the camera's (yaw, pitch)+with section 2.2 instead. Never convert a three.js Euler triple+(`actor.ts:684` uses order `YXZ`, and `Object3D.rotation.x > 0` tilts a +Z-facing+model *down*, the opposite of combat pitch); build the quaternion first.++### 2.4 Precision++- All conversion math is `double` (`FVector` is double under large world coordinates).+- Converting at most once: data stays in T until the decoding edge+ (`VerseDecks` manifest import, `VerseBridge` codec, harness golden loaders),+ then lives in U. Nothing converts back except the bridge encoder and tests.+- Quantisation for the network (Iris quantised vectors) happens after+ conversion, in U units. three.js snapshot quantisation (`math.ts:q`) does+ not carry over.++## 3. Worked examples++### 3.1 Hangar (deck 4) positions, deck-local (`O_deck = 0`)++Data from `art/verse/decks/hangar/hangar_layout.py` and+`public/verse/decks/hangar/manifest.json`.++| Point | T (x, y, z) m | U (X, Y, Z) cm |+|---|---|---|+| Floor corner, far-left (hero wall, west) | (0, 0, 0) | (0, 0, 0) |+| Floor corner, far-right (hero wall, east) | (100, 0, 0) | (10000, 0, 0) |+| Floor corner, near-left (near wall, west) | (0, 0, 62) | (0, 6200, 0) |+| Floor corner, near-right | (100, 0, 62) | (10000, 6200, 0) |+| Ceiling slab, near-right corner | (100, 21, 62) | (10000, 6200, 2100) |+| Hero wall top above the blast door centre (wall face z 1.5) | (50, 22, 1.5) | (5000, 150, 2200) |+| Launch well floor, first corner (26 m deep) | (8, -26, 8) | (800, 800, -2600) |+| Launch well floor, opposite corner | (38, -26, 20) | (3800, 2000, -2600) |+| Shuttle piece origin (pad centre) | (50, 0, 23.6) | (5000, 2360, 0) |+| Booth floor corner (raised 1.2 m) | (3, 1.2, 47.2) | (300, 4720, 120) |+| Lift door `lift_a` | (68, 0, 50.72) | (6800, 5072, 0) |+| Holo `Shuttle__tactical` | (50, 2.53, 24.6) | (5000, 2460, 253) |+| Eye height above the floor (`shoulderRig.ts`) | (·, 1.65, ·) | (·, ·, 165) |++### 3.2 Spawns++| Spawn | T position, yaw | U position | U heading | U mesh yaw |+|---|---|---|---|---|+| Hangar `commander` (`lift_lobby`) | (70, 0, 54.2), `yaw_deg` 0 (faces +z, toward the near wall) | (7000, 5420, 0) | 90 | 0 |+| Hangar `SOCKET_spawn_arrival` (ramp foot) | (50, 0, 38.1) | (5000, 3810, 0) | per socket | per socket |+| Reactor side 0 (`arenaReactor.ts:82`) | (38.8, 0, 22), yaw π/2 | (3880, 2200, 0) | 0 | -90 |+| Reactor side 1 (`arenaReactor.ts:83`) | (69.2, 0, 22), yaw -π/2 | (6920, 2200, 0) | 180 | 90 |++The feet-on-floor point converts as above; a `ACharacter` location is its+capsule centre, so `VerseMovement` adds the capsule half-height in Z. That+offset is Movement's, not part of this contract.++### 3.3 Yaw, pitch, directions, quaternions++| T input | T forward (x, y, z) | U heading / rotator | U forward (X, Y, Z) | U mesh yaw |+|---|---|---|---|---|+| ψ = 0 | (0, 0, 1) | 90 | (0, 1, 0) | 0 |+| ψ = 90° | (1, 0, 0) | 0 | (1, 0, 0) | -90 |+| ψ = -90° | (-1, 0, 0) | 180 (not -180) | (-1, 0, 0) | 90 |+| ψ = 180° | (0, 0, -1) | -90 | (0, -1, 0) | 180 |+| ψ = 135° (reactor `ring_1`) | (0.7071, 0, -0.7071) | -45 | (0.7071, -0.7071, 0) | -135 |+| ψ = -135° (reactor `ring_2`) | (-0.7071, 0, -0.7071) | -135 | (-0.7071, -0.7071, 0) | 135 |+| ψ = 90°, θ = 10° | (0.9848, 0.1736, 0) | `FRotator(10, 0, 0)` | (0.9848, 0, 0.1736) | |+| Plate view direction `D` (BRIEF §4) | (0, -0.8660, -0.5) | | (0, -0.5, -0.8660) | |+| Quaternion, yaw 90° about +Y: (0, 0.7071, 0, 0.7071) | | q_U = (0, 0, -0.7071, 0.7071) = yaw -90 | | -90 |+| Yaw rate +2 rad/s | | -114.59 deg/s | | |+| Run speed 4.8 m/s; bolt 300 m/s | | 480 cm/s; 30000 cm/s | | |++## 4. C++ API (VerseCore)++File: `unreal/Verse/Source/VerseCore/Public/VerseCoords.h`. A plain C+++namespace for hot paths, a thin Blueprint library for data and tools.++```cpp+#pragma once+#include "CoreMinimal.h"+#include "Kismet/BlueprintFunctionLibrary.h"+#include "VerseCoords.generated.h"++/** A point or vector in the three.js Verse frame: metres, +Y up, +Z toward the plate camera.+ * A distinct type so a metre value can never be passed where an Unreal FVector is expected. */+USTRUCT(BlueprintType)+struct VERSECORE_API FVerseThreeVector+{+ GENERATED_BODY()+ UPROPERTY(EditAnywhere, BlueprintReadWrite) double X = 0.0;+ UPROPERTY(EditAnywhere, BlueprintReadWrite) double Y = 0.0;+ UPROPERTY(EditAnywhere, BlueprintReadWrite) double Z = 0.0;+};++/** A deck's world placement: translation only, in centimetres. Owned by VerseDecks. */+USTRUCT(BlueprintType)+struct VERSECORE_API FVerseDeckFrame+{+ GENERATED_BODY()+ UPROPERTY(EditAnywhere, BlueprintReadWrite) FVector OriginCm = FVector::ZeroVector;+ static FVerseDeckFrame Local() { return FVerseDeckFrame(); }+};++namespace Verse::Coords+{+ inline constexpr double CmPerMetre = 100.0;++ // Scalars+ VERSECORE_API double MetresToCm(double Metres);+ VERSECORE_API double CmToMetres(double Cm);++ // Points (scaled and offset) and directions (swapped only)+ VERSECORE_API FVector ToUnrealPosition(const FVerseThreeVector& P, const FVerseDeckFrame& Deck = FVerseDeckFrame::Local());+ VERSECORE_API FVerseThreeVector ToThreePosition(const FVector& PCm, const FVerseDeckFrame& Deck = FVerseDeckFrame::Local());+ VERSECORE_API FVector ToUnrealDirection(const FVerseThreeVector& D);+ VERSECORE_API FVerseThreeVector ToThreeDirection(const FVector& D);+ VERSECORE_API FBox ToUnrealBox(double X0, double X1, double Y0, double Y1, double Z0, double Z1,+ const FVerseDeckFrame& Deck = FVerseDeckFrame::Local());++ // Heading (gameplay forward, +X)+ VERSECORE_API double ToUnrealHeadingDeg(double ThreeYawRad); // Normalize(90 - deg(yaw))+ VERSECORE_API double ToUnrealHeadingDegFromDeg(double ThreeYawDeg); // manifest yaw_deg+ VERSECORE_API double ToThreeYawRad(double UnrealYawDeg); // WrapPi(rad(90 - yaw))+ VERSECORE_API double ToUnrealYawRateDeg(double ThreeYawRateRad); // sign flips+ VERSECORE_API FRotator ToUnrealViewRotation(double ThreeYawRad, double ThreePitchRad);++ // Object rotation (geometry as authored; mesh front = local +Y)+ VERSECORE_API double ToUnrealMeshYawDeg(double ThreeYawRad); // Normalize(-deg(yaw)) == heading - 90+ VERSECORE_API FQuat ToUnrealQuat(const FQuat& ThreeQuat); // (-x, -z, -y, w)+ VERSECORE_API FQuat ToThreeQuat(const FQuat& UnrealQuat); // (-x, -z, -y, w)++ // Manifest sockets: position + yaw_deg in one step+ enum class ESocketUse : uint8 { Heading, Mesh };+ VERSECORE_API FTransform ToUnrealSocketTransform(const FVerseThreeVector& P, double ThreeYawDeg, ESocketUse Use,+ const FVerseDeckFrame& Deck = FVerseDeckFrame::Local());+}++/** Blueprint and editor-utility access; same functions, no extra logic. */+UCLASS()+class VERSECORE_API UVerseCoordsLibrary : public UBlueprintFunctionLibrary+{+ GENERATED_BODY()+public:+ UFUNCTION(BlueprintPure, Category = "Verse|Coords") static FVector ThreeToUnrealPosition(const FVerseThreeVector& P, const FVerseDeckFrame& Deck);+ UFUNCTION(BlueprintPure, Category = "Verse|Coords") static FVerseThreeVector UnrealToThreePosition(const FVector& PCm, const FVerseDeckFrame& Deck);+ UFUNCTION(BlueprintPure, Category = "Verse|Coords") static double ThreeYawDegToUnrealHeading(double ThreeYawDeg);+ UFUNCTION(BlueprintPure, Category = "Verse|Coords") static double ThreeYawDegToUnrealMeshYaw(double ThreeYawDeg);+};+```++Rules for callers:++- The literal `100` (or `0.01`) for metre/centimetre never appears outside+ `VerseCoords.cpp`; callers use `MetresToCm`. New tuning data is authored+ in U units directly (README: numbers do not carry over), so most gameplay+ code never calls this API at all.+- No module re-derives the mapping (no local `FVector(x, z, y)`).++## 5. Required tests++Low-level automation tests in `VerseCore/Private/Tests/VerseCoordsTest.cpp`+(`WITH_DEV_AUTOMATION_TESTS`, filter `Verse.Contract.Coords.*`, so they run with+every `Verse.Contract.*` filter of `orchestration.md` 3.3), run headless in+`unreal-build`. Tolerances: positions 1e-6 cm, directions and quaternion+components 1e-12, angles 1e-9 deg.++| # | Test | Asserts |+|---|---|---|+| 1 | `Basis` | T +X → U (100, 0, 0); T +Y → (0, 0, 100); T +Z → (0, 100, 0) |+| 2 | `Handedness` | `M(a × b) == -(Ma × Mb)` for 1,000 seeded pairs; det(M) = -1 |+| 3 | `RoundTripPosition` | 10,000 seeded points in ±10 km and random deck offsets: T→U→T and U→T→U within tolerance |+| 4 | `HangarGolden` | every row of table 3.1 and 3.2 exactly |+| 5 | `HeadingMatchesDirFromAngles` | for 10,000 seeded (ψ, θ): `ToUnrealViewRotation(ψ, θ).Vector() == ToUnrealDirection(dirFromAngles(ψ, θ))` |+| 6 | `RightAxisParity` | `ToUnrealDirection((-cos ψ, 0, sin ψ)) == FRotationMatrix(FRotator(0, φ, 0)).GetUnitAxis(EAxis::Y)` |+| 7 | `YawWrap` | outputs in (-180, 180]; ψ = -90° → 180; ψ = 180° → -90; `ToThreeYawRad` outputs in (-π, π]; round trip of every table 3.3 row |+| 8 | `QuatConjugation` | `ToUnrealQuat(q).RotateVector(Mv) == M(q·v)` for 10,000 seeded unit quaternions and vectors; `ToThreeQuat(ToUnrealQuat(q)) == q` |+| 9 | `MeshYawIsHeadingMinus90` | `Normalize(heading - 90) == ToUnrealMeshYawDeg` for all ψ; yaw-only quaternion route gives the same mesh yaw |+| 10 | `BoxOrder` | `ToUnrealBox` min ≤ max on every axis for every `ArenaBox` in the golden file |+| 11 | `DeckFrameTranslationOnly` | an offset frame changes positions by exactly `OriginCm` and leaves directions, headings and quaternions untouched |+| 12 | `YawRateSign` | `ToUnrealYawRateDeg(+1 rad/s) == -57.2957795…` |+| 13 | `CrossLanguageGolden` | reads `unreal/Verse/Tests/Data/coords_golden.json` (T inputs plus expected U outputs); a vitest in the frontend reads the same file and checks the T side with `combat/math.ts`, so both languages agree on one file |+| 14 | `NoStrayScale` (CI script, not C++) | grep fails the build on `* 100`/`/ 100`/`0.01` next to position or metre identifiers outside `VerseCoords.cpp`, and on `FVector(.*\.X, .*\.Z, .*\.Y)` patterns outside it |++## Frozen interface++Other packages may rely on all of the following, and nothing else:++- The mapping `U = 100 · (x, z, y) + O_deck` for points, `(x, z, y)` for+ directions, and its inverse; deck frames are translation-only.+- Heading `φ = Normalize(90 - ψ_deg)`, pitch unchanged in sign, yaw rates+ negated, ranges (-180, 180] and (-π, π].+- Mesh yaw `= -ψ_deg = heading - 90`; quaternions `(-x, -z, -y, w)` both ways;+ pawn skeletal mesh relative yaw `-90°`.+- Deck-local origin at the plan's (x = 0, z = 0) floor point, floor at Z = 0.+- The types `FVerseThreeVector`, `FVerseDeckFrame`, the functions in+ `Verse::Coords` and `UVerseCoordsLibrary` with the signatures in section 4,+ and the golden file `unreal/Verse/Tests/Data/coords_golden.json`.+- Manifests and bridge payloads stay in T units; conversion happens once at+ the `VerseDecks` and `VerseBridge` decoding edge.++## Change rule++Changes go through the integration owner only. A change is a pull request that+edits this file, `VerseCoords.h/.cpp`, the golden file and the tests together,+lists every consumer it affects (`VerseDecks`, `VerseBridge`, `VerseCrew`,+`VerseScreens`, `VerseBot`, `VerseHarness` at least), and lands before any+consumer relies on it. Adding a new function is allowed by the same rule;+changing the meaning of an existing one is not, it gets a new name instead.diff --git a/docs/verse/unreal/contracts/destruction.md b/docs/verse/unreal/contracts/destruction.mdnew file mode 100644index 0000000000..2055397155--- /dev/null+++ b/docs/verse/unreal/contracts/destruction.md@@ -0,0 +1,312 @@+# Contract: destruction and penetration++Owner module: `VerseDestruction` (pieces, state machine, fracture authority,+debris, holes, repair drones, penetration queries, nav updates). Shared types+live in `VerseCore` (architecture §2). Consumers: `VerseCombat` (bolts,+breach charge, melee), `VerseBot` (perception, cover, wall shots), `VerseGore`+(decal cleanup), `VerseUI` (kill cam replay), `VerseHarness` (gates).++Units: Unreal centimetres, Z-up, server time in milliseconds. Everything in+this file builds on README "Destruction" and architecture §4 and §7; where a+number repeats from there it must stay equal.++## 1. Rules that hold everywhere++| # | Rule |+|---|---|+| DR1 | Only the server applies piece damage and decides a state change (`HasAuthority()`). Clients never change a piece state, not even predicted |+| DR2 | Gameplay collision (movement, bolts, sight, nav) comes only from the authored per-state proxy meshes and the replicated hole records. Simulated debris never blocks anything gameplay-relevant |+| DR3 | Debris is client-side cosmetic (Chaos Geometry Collection, GC replication off). A dedicated server and every `-nullrhi` run spawn no debris |+| DR4 | The hall floor, concrete and armor steel never change state |+| DR5 | Breakable pieces are solid, closed volume meshes with real thickness. Never double planes, never open shells (section 9) |+| DR6 | The bot learns of a piece change only by perceiving it (sight, sound, its own action). It never reads piece truth it could not have perceived (section 6) |++## 2. Material penetration table++`DA_PenetrationTable` in `VerseCore`, one row per material. Material ids are+gameplay tags `Verse.Material.<Id>` plus a `uint8` wire id in the order below+(order is frozen; new materials append).++Power scale: a bolt starts with its weapon's `PenetrationPower`. **100 = the+assault rifle**; the combat contract sets every other weapon against that+anchor. Passing a piece costs `cost x clamp(traced_thickness / ref_thickness,+0.5, 3.0)`, where `traced_thickness` is the distance between the entry and exit+hit on the piece's current proxy. The bolt passes if its remaining power is+at least that cost; its remaining damage is then multiplied by the row's+multiplier. A bolt passes at most 3 pieces; the 4th stops it. A weapon may+lower that limit with its `MaxPenetrations` (combat contract, 3); it never+raises it.++| Wire | Material id | Ref thickness cm | Penetration cost | Damage multiplier after passing | Breakable by bullets | Breakable by breach | Debris type |+|---|---|---|---|---|---|---|---|+| 0 | `sheet_metal` | 0.3 | 15 | 0.85 | y | y | `MetalShards` (rigid) + sparks |+| 1 | `container_wall` | 0.4 (corrugated) | 25 | 0.75 | y | y | `CorrugatedChunks` (rigid) + sparks |+| 2 | `glass` | 2.4 (laminated) | 5 | 0.95 | y | y | `GlassShards` (Niagara only, no rigid bodies) |+| 3 | `cladding_panel` | 4.0 (composite) | 30 | 0.70 | y | y | `PanelChunks` (rigid) + insulation dust |+| 4 | `catwalk_grating` | 3.0 (bar grating) | 10 | 0.90 | n | y | `GratingTwisted` (rigid, few large pieces) |+| 5 | `ceiling_panel` | 2.5 (metal tile) | 8 | 0.90 | y | y | `CeilingTile` (rigid, whole tile falls) + dust |+| 6 | `concrete` | 30 | 400 | 0.00 | n | n | `DustChips` (Niagara only) |+| 7 | `armor_steel` | 2.5 | 10000 (impassable) | 0.00 | n | n | Sparks only |++Reading the table at reference thickness: the rifle (100) passes two+container walls (25 + 25) and keeps 0.75 x 0.75 = 0.5625 of its damage; the+pistol (50, two passes) passes one container wall, or glass and sheet metal;+nothing passes concrete or armor steel. Non-destructible world geometry gets+its row through its physical material (the hall floor and structural walls+are `concrete`, structural beams `armor_steel`).+"Breakable by bullets n" means bolts may still pass (grating) or scorch, but+never change the piece state.++Sight and bolts use different channels (section 5): Intact glass and grating+let sight through and stop or charge bolts as the table says.++## 3. Piece classes and damage states++### 3.1 States++`EVersePieceState : uint8`, values and order frozen:++| Value | State | Gameplay proxy | Meaning |+|---|---|---|---|+| 0 | `Intact` | Full solid | As built |+| 1 | `Damaged` | Full solid + bolt holes (section 5) | Scorches, dents, cracks, small holes |+| 2 | `Holed` | Authored hole variant | Openings to see and shoot through, not to walk through |+| 3 | `Breached` | Authored breach variant | Opening a standing pawn walks through (at least 90 cm x 200 cm), or a low breach to mantle through |+| 4 | `Destroyed` | None, plus optional authored `Remains` proxy on the floor | Piece gone (glass shattered, tile or segment fallen) |+| 5 | `Repairing` | The proxy of the state it repairs from | A drone is rebuilding it (section 7) |++Holed and Breached each have up to 4 authored variants per piece. The server+picks the variant whose opening centroid is closest to the damage centroid+(Holed) or the charge position (Breached) and replicates its index.++### 3.2 Classes++Piece HP is per piece, quantised to 8 bits in replication (`HealthQ =+round(255 x hp / maxHp)`). Piece damage per bolt and per breach charge comes+from the combat contract; the anchor is 10 piece damage per rifle bolt.++| Class | Material | Max HP | Intact to Damaged | to Holed | to Breached | to Destroyed | Repair time s |+|---|---|---|---|---|---|---|---|+| Wall panel | `sheet_metal` | 200 | first hit | HP at or below 100 (bullets) | breach charge | never | 8 |+| Cladding wall | `cladding_panel` | 250 | first hit | HP at or below 125 (bullets) | breach charge | never | 8 |+| Container wall | `container_wall` | 300 | first hit | HP at or below 150 (bullets) | breach charge | never | 8 |+| Glass pane | `glass` | 20 | first hit (crack web) | never | never | HP 0, breach charge, melee on Damaged glass | 4 |+| Catwalk segment | `catwalk_grating` | n/a | never | never | never | breach charge only | 10 |+| Ceiling panel | `ceiling_panel` | 60 | first hit | never | never | HP 0 (bullets), breach charge | 5 |++Breach charge radius effect (server, one detonation): the target piece goes+to its breach result; other breakable pieces with any proxy vertex within+150 cm go to Holed (walls) or Destroyed (glass, ceiling). Bullets never take+a wall past Holed. Melee changes only glass. Transitions only move forward+(towards Destroyed); only Repairing and Reset move back.++### 3.3 Replicated state++One `FFastArraySerializer` on `AVerseDestructionManager` (one per arena world+partition cell set, always relevant), push model, items change only on a+state change, an HP change of at least 1 quantum, or a hole.++| Field | Type | Notes |+|---|---|---|+| `PieceIndex` | `uint16` | Index into `DA_PieceManifest` (section 8), same on server and clients |+| `State` | `EVersePieceState` | |+| `HealthQ` | `uint8` | 0..255 |+| `Variant` | `uint8` | Holed or Breached variant, else 0 |+| `RepairFrom` | `EVersePieceState` | Valid while `Repairing` |+| `LastSeed` | `uint32` | Seed of the last fracture |+| `LastImpulse` | 3 x `int16` | Last fracture impulse, 1 unit = 0.1 N s |+| `LastLocation` | 3 x `int16` | Piece-local, 1 mm |+| `StateTimeMs` | `uint32` | Server time of the last state change |+| `Epoch` | `uint16` | Destruction epoch (section 11) |++Bolt holes replicate in a second fast array (section 5). Late joiners+receive both arrays and build the broken look directly, without debris and+with holes already cooled.++## 4. Fracture event++`FVerseFractureEvent` in `VerseCore`. Sent as an unreliable multicast for+instant debris and published on the event hub (server and clients) for every+state change, repair and reset. The fast array (section 3.3) is the truth; a+lost event only costs that client its debris burst.++| Field | Type | Notes |+|---|---|---|+| `PieceIndex` | `uint16` | `0xFFFF` = all pieces (reset only) |+| `FromState`, `ToState` | `EVersePieceState` | |+| `Cause` | `uint8` enum | `Bolt, Breach, Melee, Repair, Reset` |+| `Variant` | `uint8` | Chosen proxy variant |+| `Seed` | `uint32` | Server RNG draw; drives the Chaos strain pattern and Niagara seeds |+| `Impulse` | 3 x `int16` | World space, 0.1 N s per unit |+| `Location` | 3 x `int16` | Piece-local, 1 mm; impact or charge point |+| `Radius` | `uint8` | cm; strain field radius |+| `Instigator` | `uint8` | Player slot, `0xFF` = world (repair, reset) |+| `ServerTimeMs` | `uint32` | |+| `Epoch` | `uint16` | Events with an old epoch are dropped |++About 30 bytes on the wire, under the 64-byte budget (architecture §7).+Clients apply the same strain field at the same location with the same seed;+a different crack pattern on another client is allowed (architecture §4).++## 5. Bolt holes as sightlines++A bolt that passes a `Damaged`-capable piece (sheet metal, container wall,+cladding, glass, ceiling) leaves a hole at entry and exit. A bolt that stops+in it leaves a dent decal and no hole. Concrete and armor steel get scorch+decals only.++| Topic | Rule |+|---|---|+| Record | `FVerseBoltHole`: `PieceIndex uint16`, axis position piece-local 3 x `int16` (1 mm), axis direction octahedral 2 x `int8`, `RadiusMm uint8`, `ServerTimeMs uint32`, `Epoch uint16` (about 16 bytes) |+| Radius | From the weapon (combat contract); anchor 15 mm for the rifle |+| Caps | 24 holes per piece, 512 per arena. Hole 25 on a wall piece turns it `Holed` (variant from the hole centroid) and clears its holes; at the arena cap the oldest hole of the piece with the most holes is dropped |+| Sightline test | A sight or bolt ray through a piece with holes passes only if both its entry and exit points lie within the radius of one hole's axis. Thin sheet metal gives a wide view cone through a hole, a 4 cm panel a narrow one. Server and bot use exactly this test; the client renders the same records, so what the person sees through a hole is what the bot can see |+| Rendering | Per-piece hole mask (opacity mask in piece UV space, 256 x 256 render target, created on the first hole) plus a rim decal. No dynamic light per hole |+| Glow | Emissive rim, incandescent white-amber at impact, exponential cooling with tau 1.2 s, dull red at about 2.5 s, glow ends at 4 s; then a permanent charred rim. At most 128 glowing holes rendered, oldest cools first. Never cyan or violet |+| Lifetime | The hole itself lasts until its piece changes to `Holed`/`Breached`/`Destroyed`, is repaired, or reset |+| Cue | A hole appearing in the bot's view cone is a perception stimulus (shot origin hint with error), the same cue the person gets from the glow |++Damaged glass (crack web) blocks sight except through its holes; Intact glass+and grating never block sight. Dust and smoke from breaks are cosmetic and+never block sight.++## 6. Navmesh and bot perception++### 6.1 Navmesh (server only; the bot is the only nav user)++| Topic | Rule |+|---|---|+| Generation | Recast, runtime generation `Dynamic`, tile size 32 x 32 cells at 10 cm cells; agents `Stand` (radius 34, height 180) and `Crouch` (height 110) |+| Trigger | On every state change the manager marks the piece's old and new proxy bounds (+50 cm) dirty |+| Budget | At most 4 tiles rebuilding at once; a change is navigable within 100 ms (gate) |+| Breached | Opening becomes walkable nav; low breaches get a mantle nav link |+| Destroyed catwalk | Its polys and links vanish; drop-down links to the floor below are added from authored link points |+| Holed, Damaged | No nav change (not passable) |+| Path invalidation | Paths crossing a dirtied tile are re-planned on the next bot decision tick |++### 6.2 Bot perception++`VerseBot` keeps a belief copy of piece states. Truth is available through+`IVersePieceQuery`, but the bot's perception layer may write a piece into its+belief only when one of these holds:++| Channel | Condition | Error |+|---|---|---|+| Sight | Part of the piece is in the bot's first-person view cone with line of sight (sight channel, holes honoured) | None on state; the bot sees what is there |+| Sound | A fracture produces an `FVerseNoiseEvent` with tag `Noise.Fracture` and `Loudness` by cause: breach 1.0, wall break 0.7, glass 0.6, tile 0.5, bolt hole 0.2 (audible range = loudness x 40 m, `contracts/bot.md` 3.2) | Position error per tier, as for shots |+| Own action | The bot caused the change | None |++Unperceived pieces keep their believed state. Cover points (EQS-generated)+record which pieces they depend on; a belief change rescores only those+points. Wall shots: the bot fires through a piece only at a heard or believed+opponent position, and only if its believed piece state and this table say a+bolt passes. Harness gate: no bot action ever depends on a piece state the+bot has not perceived (extends `bot.test.ts:32-46` into Unreal).++## 7. Repair drones++| Topic | Rule |+|---|---|+| Delay | 60 s after the piece's last state-changing or hole-making damage. Any further damage restarts the 60 s |+| Dispatch | Server picks the free drone nearest the piece. At most 3 drones active in the arena; others wait in the queue |+| Order | Queue sorted by class first: catwalk segments, then walls and container walls, then glass, then ceiling panels; within a class the longest-broken first |+| Flight | Drone actor flies dock to piece (cosmetic path, replicated movement); `Repairing` starts on arrival |+| Repair | Duration per class (table 3.2). Visual rebuild is cosmetic (amber weld sparks, panels sliding in). Gameplay proxy stays the pre-repair proxy until completion, then switches to `Intact` in one tick, holes cleared |+| Encroachment | Completion waits while any pawn overlaps the Intact proxy bounds +10 cm; re-checked every 0.5 s |+| Interruptible | Yes. Any damage to the piece while `Repairing` cancels the repair: the piece returns to `RepairFrom`, the drone leaves, the 60 s restarts |+| Can be shot | Yes. 30 HP, its own hit box on the bolt channel, stops bolts (no penetration). Downing it cancels the repair as above and drops it as client debris; the dock dispatches a new drone when the timer fires again. No score, no XP |+| Harm | Drones never damage or block pawns |+| Noise | Flight and welding emit `Noise.Drone` events with loudness 0.15 the bot may hear |++## 8. Piece identity++| Topic | Rule |+|---|---|+| Stable id | The One File Per Actor GUID of the `AVerseDestructible` actor |+| Wire id | `PieceIndex` = position of the GUID in `DA_PieceManifest`, sorted by GUID at cook time, per arena; checked by hash in the server welcome |+| Limit | At most 2,000 pieces per deck (the arena zone targets about 600) |++## 9. Geometry rule and validation++Breakable pieces are solid, closed (watertight, manifold) volume meshes whose+thickness matches the material's reference thickness within 10 %. Never two+coincident planes, never one-sided shells. Penetration needs a real entry and+exit hit to measure `traced_thickness`, and Chaos fracture needs volume. This+rule governs every destructible piece, its render mesh and its proxies; the+minimum thicknesses of `contracts/art-pipeline.md` (10 cm visual in 6.3,+20 cm collision in 5) apply only to non-destructible architecture. A+destructible piece that separates a lit from an unlit space sits in front of+a non-destructible backing or accepts the Lumen leak; that choice is the+zone owner's.++Each piece ships: a Nanite render mesh, a Geometry Collection fractured from+the same solid, proxy meshes for every reachable state and variant, the+material id, the class.++Checks, both blocking: the art builder validator (`scripts/verse/cook.py`+step, before export) and the editor validator `UVerseDestructibleValidator`+in `unreal-static`/`unreal-build` (watertight, thickness by inward ray+sampling, all proxies present, GC present, material id set, piece in the+manifest).++## 10. Performance budget++| Budget | Value |+|---|---|+| Active debris rigid bodies | at most 400 on High (architecture §7), 150 on Low; oldest removed first with a 0.3 s fade |+| Bodies per fracture | at most 40; fragments under 5 cm are Niagara particles, not rigid bodies |+| Debris lifetime | sleeps after 3 s, despawns at 10 s (6 s on Low) |+| Geometry Collection actors | pooled, at most 32 alive |+| Fracture events | at most 64 per s; above that the server coalesces per piece per tick |+| Physics | at most 2 ms per frame with the debris cap hit |+| Penetration traces | at most 0.3 ms server game thread per tick |+| Holes | 24 per piece, 512 per arena, 128 glowing |+| Nav rebuild | at most 4 tiles in flight, navigable within 100 ms |+| Bandwidth | state item about 20 bytes per change; full reset burst under 16 KB |++Harness scenario `destruction_storm`: two breach charges plus a full magazine+into a container row every 2 s for 60 s; all budgets must hold.++## 11. Reset++The mode is endless deathmatch, so respawns never reset the world; drones are+the running reset.++| Moment | Effect |+|---|---|+| Arena on (hangar switches from day deck to arena) | Full reset |+| Arena off (back to the day deck), match end | Full reset, so the normal deck is always intact |+| Round boundary | Only if the ruleset asks: `UVerseRuleset::ShouldResetDestruction(EVerseBoundary)`; deathmatch returns false |+| Full reset | Server bumps `Epoch`, sets every item `Intact`/full HP, clears holes, recalls drones, rebuilds dirty nav tiles, multicasts `FVerseFractureEvent{PieceIndex=0xFFFF, Cause=Reset}`. Clients purge debris, hole masks and decals on pieces; the bot's belief resets to Intact (it is told, like the person sees the reset) |++## Frozen interface++Other packages may rely on exactly these:++| Item | Where |+|---|---|+| `EVersePieceState` values and order (section 3.1) | `VerseCore` |+| Material ids, wire order, columns of `DA_PenetrationTable`, the cost formula, 3-piece limit, power anchor 100 = assault rifle (section 2) | `VerseCore` |+| `FVerseFractureEvent` fields and semantics (section 4) | `VerseCore` |+| `FVerseBoltHole` record and the two-point sightline test (section 5) | `VerseCore` |+| Noise loudness per destruction cause (section 6.2), carried in `FVerseNoiseEvent` | `VerseCore` |+| `IVersePenetrationQuery`: `TraceBolt(Origin, Dir, MaxDist, Power, Damage, RadiusMm, MaxPieces) -> TArray<FVersePenetrationHit>` (piece index, material wire id, entry, exit, traced thickness, power and damage left, passed) and `TestSight(Eye, Target) -> bool` (holes honoured, glass and grating see-through) | `VerseDestruction` |+| `IVersePieceDamage::ApplyPieceDamage(FVersePieceDamage)` server only: piece, amount, cause, location, direction, instigator, breach radius | `VerseDestruction` |+| `IVersePieceQuery`: `GetPieceState`, `GetPieceMaterial`, `GetPieceBounds`, `GetPiecesInBox`; bot use only behind its perception gate | `VerseDestruction` |+| Trace channels `VerseBolt` (pieces, world, Bulwark, drones), `VerseSight` (sight traces; `TestSight` applies the per-state glass, grating and hole rules of section 5; the Bulwark field ignores it) and `VerseHitBody` (per-bone hit bodies only; pieces, world and debris ignore it); object channel `VerseDebris` (ignores pawns, bolts, sight, hit bodies) | Project collision profile (integration owner) |+| `AVerseRepairDrone` is a bolt-channel target with 30 HP | `VerseDestruction` |+| `DA_PieceManifest` index rule (section 8) and the geometry rule (section 9) | `VerseDestruction`, art pipeline |+| Reset semantics and `UVerseRuleset::ShouldResetDestruction` (section 11) | `VerseCombat` calls, `VerseDestruction` executes |++Numbers marked as thresholds, HP, times and budgets live in+`DA_PenetrationTable` and `DA_DestructionTuning` and may be retuned; the+columns, fields, enums, channels and function shapes above may not.++## Change rule++Every change to this contract, including a retuned number in the DataAssets+above, goes through the integration owner only: a PR that edits this file+and the DataAsset together, with a green `unreal-gauntlet` run and the+`destruction_storm` perf scenario attached. Packages that need something new+ask the integration owner; they never extend the structs, enums or+interfaces themselves.diff --git a/docs/verse/unreal/orchestration.md b/docs/verse/unreal/orchestration.mdnew file mode 100644index 0000000000..deb654859c--- /dev/null+++ b/docs/verse/unreal/orchestration.md@@ -0,0 +1,369 @@+# Verse on Unreal: orchestration++How the Unreal Verse gets built by many agents at once: phases and their+gates, the rules every parallel agent follows, the machine limits, the+verification recipe for Unreal changes, and the prompt template for a+sub-task agent. Builds on `README.md` (decisions), `architecture.md`+(modules, lanes, lock) and `contracts/`. The packages themselves are in+`work-packages.md`; this file never redefines their scope.++## 1. Roles++| Role | Count | Owns | Never does |+|---|---|---|---|+| Orchestrator | 1 | Phase plan, scheduling, the sub-task queue, gate verdicts | Writes product code |+| Integration owner | 1 (one session at a time, handed over in writing) | `docs/verse/unreal/contracts/**`, `unreal/Verse/Source/VerseCore/**`, `unreal/Verse/Source/Verse/**` (primary module), every `*.Build.cs` and `*.Target.cs`, `unreal/Verse/Verse.uproject`, `unreal/Verse/Config/**`, every `.gitattributes`, `.gitignore` and `.lfsconfig`, `.githooks/**`, levels and data layers, the LFS locks of shared assets (master materials are authored by WP14, rig and physics assets by WP13; the integration owner takes the lock and merges), `scripts/unreal/**` except the scripts a package owns in `work-packages.md` (WP10, WP22), the G0.11 fake bridge and golden fixtures, screenshot ground truth, and the G0 workflows until G0.10 hands them to WP10 | Lands a contract change without its contract tests |+| Package lead | 1 per package (22) | The package's owned paths and acceptance list in `work-packages.md`; assigns the sub-tasks listed there (`WP<nn>.<k>`) and may split one further into `WP<nn>.<k>a`, `b`, each with a subset of its paths | Touches another package's paths |+| Sub-task agent | Many per package | One sub-task: a subset of its package's owned paths | Edits outside its assigned paths, changes a contract, merges by hand |+| Verifier | 1 per sub-task PR, fresh context | An adversarial check of one PR (section 5.4) | Pushes to the branch it verifies |++## 2. Phases and gates++Phases run strictly in order. A gate is a checklist the orchestrator+evaluates from evidence (CI runs, reports, screenshots), never from an+agent's own claim. A failed gate item reopens the work that owns it; the+next phase does not start early "for the parts that are ready".++### Phase 0: foundation (serial, integration owner plus a few agents)++The steps below produce the G0 items of `work-packages.md` section 1; the+column "G0 items" maps them.++| Step | Output | G0 items | Notes |+|---|---|---|---|+| 0.1 Toolchain | Visual Studio 2022 Build Tools with the MSVC and Windows SDK versions 5.7 requires; the engine's Linux cross-compile toolchain, `LINUX_MULTIARCH_ROOT`; git-lfs; `unreal/Toolchain/toolchains.json` pinning all versions; `scripts/unreal/doctor.py` that checks them | G0.1 | The installers need an elevated, one-time install the person approves. Nothing in phase 0 after 0.1 starts before `doctor.py` is green |+| 0.2 Project skeleton | `unreal/Verse/Verse.uproject` pinned to 5.7.1; the primary module plus the 13 feature modules, each compiling empty; `VerseServer.Target.cs` deleted, `VerseHarness` only in the Editor target; plugins per architecture §2 rule 4; World Partition with One File Per Actor; one empty map per deck; the nested `unreal/Verse/.gitattributes` and `.gitignore` and the other repo changes of architecture §8.4 | G0.4, G0.5, G0.8, G0.12 | Every module ships a `Verse.<Module>.Smoke` automation test that passes |+| 0.3 Contracts frozen | Every file in `contracts/` moves to "Status: frozen v1". Each one becomes code: shared types, enums, interfaces and DataAsset schemas in `VerseCore`; a null implementation (stub) of every interface so any package can build and test against it; golden data files (`space_vectors.json`, bridge schema JSON, penetration table) | G0.2, G0.3, G0.9, G0.11 | A contract is frozen only when its contract tests exist and pass |+| 0.4 Contract tests | `Verse.Contract.*` automation tests (coordinates round trip, enum order, struct sizes and field order of replicated types, bridge codec against the JSON schemas, interface stubs answer as specified); pytest on the backend side of `verse.bridge/1` against the same schema files | G0.3, G0.11 | Both sides read the same files; no hand-copied numbers |+| 0.5 Scripts | `scripts/unreal/with_lock.py` (section 4), `build.py`, `test.py`, `smoke.py`, `screenshot.py`, `balance.py` (skeleton), `fake_bridge.py`, `worktree.py {new,remove}`, `doctor.py` | G0.6, G0.11 | Agents call these, never UBT, UAT or the editor directly |+| 0.6 Self-hosted runner | The runner, lanes `unreal-static` and `unreal-build` from architecture §8.3, wired into the one required check `CI gate` as jobs under `gate.needs` that pass without work when no Unreal path changed (architecture §8.2) | G0.10 | Fork PRs never reach the runner (architecture §8.2) |+| 0.7 Headless test runner | `test.py` runs automation under `-nullrhi` and fails on any failed, skipped-unexpectedly or crashed test; a Gauntlet skeleton runs two placeholder bots in an empty map for 60 s and exits cleanly | G0.6 | Measures headless speed (architecture risk RK1) |+| 0.8 Baselines | Measured on the reference box: clean and incremental editor build time, game build time, `Intermediate/` + `Binaries/` size of one worktree, warm DDC size, headless sim speed (x real time per process), RAM per headless process | G0.13 | These numbers replace the "start values" in section 4 in the same PR |+| 0.9 Pilot | One throwaway sub-task (a test-only change in `VerseCore`) goes the full path: worktree, PR, LFS push, queue, verifier, done gate | G0.13 | Proves the pipeline before 22 packages hit it |++**Gate G0** (all must hold):++| # | Check | Evidence |+|---|---|---|+| GC0.1 | `doctor.py` green on the dev box and the runner | Log in the gate issue |+| GC0.2 | `unreal-build` green on `main`: Win64 Development Editor, Win64 Development Game, Linux Development Game | CI run link |+| GC0.3 | All `Verse.Contract.*` and `Verse.*.Smoke` tests green under `-nullrhi`; backend contract pytest green, including the G0.11 golden fixtures | `index.json` report counts |+| GC0.4 | `unreal-static` green: DAG check, forbidden-name scan, LFS pointer check, size gate, licence ledger; the repo gates of architecture §8.4 green on the same PR (junk, language, design references, docs privacy) | CI run link |+| GC0.5 | Every contract file says "frozen v1" and names its tests | Grep in the gate issue |+| GC0.6 | The pilot reached `agent_done_gate.py` DONE, and a fresh clone of `main` with LFS on gets every object the pilot pushed | Gate output, clone log |+| GC0.7 | Section 4 limits replaced by measured values | The PR that did it |++Gate check ids carry the `GC` prefix so they never read as the G0 items of+`work-packages.md` section 1.++### Phase 1: fan-out (all 22 packages in parallel)++| Rule | Value |+|---|---|+| Start | All 22 package leads start together after G0. Each publishes its package's sub-tasks (`work-packages.md`; one sub-task = one PR, about a day of agent work at most) in the package's tracking issue with the owned paths per sub-task |+| Isolation | Packages code against the frozen contracts and the stubs of the other packages, never against another package's unfinished code. A package that needs behaviour another package has not landed tests against the stub |+| Dependencies | Inside a package, sub-tasks may depend on each other; across packages only via contracts. A cross-package need that the contract does not cover is a contract change request (section 3.4) |+| Art | Art sub-tasks follow `contracts/art-pipeline.md`: builders under `art/verse/`, export and import under the lock, placements only in the zone the sub-task owns |+| Cadence | The orchestrator keeps the sub-task queue full up to the session limit in section 4 and schedules builds so the lock stays busy but never deep (queue depth above 8 waiters: stop starting build-heavy sub-tasks) |++**Gate G1:**++| # | Check |+|---|---|+| GC1.1 | Every package's acceptance list in `work-packages.md` is green with its own tests, under `-nullrhi` where no GPU is needed and under the visual lane where it is |+| GC1.2 | No open contract change request; contract tests still green |+| GC1.3 | Every invariant named in `contracts/` (recoil R1-R6, gadgets GD1 to GD4, deathmatch D1-D6, destruction DR1-DR6, bot B1-B8, fairness F1-F7, L1, BR1) has a test, and the test is green or explicitly marked as needing integration (listed, not silent) |+| GC1.4 | `main` builds all three targets; no package still depends on a stub of its own interface |+| GC1.5 | Forbidden-name scan zero over `unreal/`, `art/verse/`, `docs/verse/`, commit messages and PR titles of the phase |++### Phase 2: integration and autonomous playtests++| Step | Output |+|---|---|+| 2.1 Wire up | The integration owner replaces stubs with the real implementations in the primary module's default classes, one package at a time, each its own PR, the full automation suite green after each |+| 2.2 Hangar arena | The day/arena switch, the arena zone, spawns, the armoury station, the in-Verse Verse bar quick start and the web launcher card quick start working end to end in a packaged build |+| 2.3 App link | `dodaios/verse_host/` against a real `Verse.exe`: launch, show, hide, dormant, crash restart, token, heartbeat, feeds, desk screens, takeover, Pixel Streaming panel. Checked in a dev instance of the app with synthetic data (section 5.6) |+| 2.4 Autonomous playtests | Gauntlet bot-vs-bot at scale per `contracts/bot.md` §11 (ladder, tricks, elite, fairness, learning, adaptive); netcode test with lagged clients; destruction scenarios (`wall_opened_unseen` and the destruction contract's set); a 2 h soak of endless deathmatch with destruction and repair |+| 2.5 Perf | Nightly `unreal-perf` fixed replay against architecture §7 budgets, with dictation running on the GPU for the VRAM check |+| 2.6 Person playtest | The person plays (README Testing) on a packaged build. Feedback becomes issues; the person-model refit from local duel telemetry (`contracts/bot.md` §11.2) runs after it |++**Gate G2:**++| # | Check |+|---|---|+| GC2.1 | All lanes (`unreal-static`, `unreal-build`, `unreal-gauntlet` long, `unreal-perf`) green on `main` three nights in a row |+| GC2.2 | Balance gates BG1-BG12 pass: no single trick beats hard; skilled model about 40 % vs elite inside the 95 % interval; fairness tests F1-F7 and L1 green |+| GC2.3 | Soak: zero crashes, zero ensures, no memory growth over 50 MB per hour, desync corrections within the netcode gate |+| GC2.4 | Every budget in architecture §7 met or a named exception the person accepted |+| GC2.5 | App-link matrix (2.3) green in the dev instance, with screenshots |+| GC2.6 | The person has played; each feedback item is fixed, or deferred by the person |++### Phase 3: parity, three.js deletion, release++| Step | Output |+|---|---|+| 3.1 Parity | Every line of `parity.md` checked with evidence (screenshot, test, or recorded run) against the Unreal Verse in the packaged build |+| 3.2 Deletion | One PR deletes the three.js Verse (`dodaios/ui/web/frontend/src/components/society/verse/**`, its tests, its public assets, its feeds that nothing else reads) and switches both mounts to the Unreal launcher and the Pixel Streaming panel. The frontend is rebuilt (`npm run build`) and the change is checked visible in the running desktop app |+| 3.3 Release | `unreal-package` for Win64 and Linux, IoStore chunks per deck, delta packages, the raised updater cap, signing through the existing workflow, installer smoke on a fresh sandbox, release cut from a commit |++**Gate G3:** parity checklist 100 % with evidence; deletion PR merged and+visible in the running app; release tag built and signed; installer smoke+green on Windows and Linux; no-GPU path shows "unsupported" and the rest of+the app works; `agent_done_gate.py` DONE for every branch of the phase.++## 3. Rules for parallel agents++### 3.1 Git++| Rule | Detail |+|---|---|+| One worktree per sub-task | `python scripts/unreal/worktree.py new wp<nn>-<k>-<slug>` runs `git fetch origin`, `git worktree add -b claude/verse-wp<nn>-<k>-<slug> C:/demo/wt/<short-id> origin/main` and `git config lfs.fetchexclude ""` in the new worktree. Worktree paths stay short (Unreal paths under `Intermediate/` hit the Windows path limit); `<short-id>` is at most 12 characters |+| Branch prefix | `claude/verse-wp<nn>-<k>-<slug>` for every sub-task (the pattern `validate_ownership` reads, `contracts/art-pipeline.md` 9); integration branches `claude/verse-int-<slug>` |+| Base | Always `origin/main`, never local `main` (a mirror, never committed on), never another agent's branch |+| Shared trees | Never `git stash` or `stash pop` in a tree another session may use; never touch the person's main checkout. Rebase only your own branch |+| Owned paths | Each sub-task's prompt lists its exact paths. A diff that touches anything else is refused by the verifier, whatever the reason. Generated files under `Saved/`, `Intermediate/`, `Binaries/` are never committed |+| Binary assets | `.uasset`/`.umap` only inside owned paths; One File Per Actor means each placed actor is its own file. Shared `lockable` assets need `git lfs lock` by the integration owner |+| Small PRs | One sub-task, one package, one topic. Target under 400 changed lines of hand-written code and under 30 binary files; split anything larger |+| Landing | `python scripts/agent_land.py` (rebase on latest main, static gates, reachable tests, `git lfs push` then push, PR labelled `auto-merge` for the merge queue). Then set the title with `gh pr edit <n> --title "type(verse): subject"` when the branch has more than one commit. After the merge bot pushes to the branch, `git fetch` before pushing again and re-request auto-merge. Never a manual merge, never a force-push to someone else's branch |+| Removing a worktree | 1. `python scripts/unreal/build.py clean` (deletes that worktree's `Binaries/`, `Intermediate/`, `Saved/`; never the shared DDC). 2. Unlink any `node_modules` junction first (`cmd /c rmdir <path>\node_modules`), never delete through it. 3. `git worktree remove <path>`. `worktree.py remove` does all three in this order |++### 3.2 Writing rules++English everywhere. Never name other games, studios, franchises or real+firearm makes or models: code, asset names, comments, commits, PR titles and+bodies, docs, test names. Weapons are fictional and modelled on no real+firearm. Assets are own work or CC0, recorded in `art/verse/LICENSES.md`.+The `unreal-static` forbidden-name scan enforces this; a hit blocks the PR.+No repo gate checks names in `.cpp`, `.h`, `.cs` or `.uasset` metadata, so+agents run `scripts/unreal/check_forbidden_names.py` on their diff before+each commit. The repo-wide rules (no `.fbx`, `.wav`, `.exr` or video, banned+folder names, English in `.ini` files, no user-profile paths in docs) are in+architecture §8.4.++### 3.3 Build discipline++| Rule | Detail |+|---|---|+| Wrapper only | Builds, cooks, commandlets, automation, screenshots, Blender exports and balance runs go through `scripts/unreal/*.py`, which take the lock (section 4) |+| Build when it pays | Write the whole change, then build once; fix compile errors in one more build. No build per edit |+| Targeted tests | Run your package's test filter (`Verse.<Module>.*`) plus `Verse.Contract.*`; the full suite runs in CI. Never run the repo's full Python suite locally (it dirties the worktree) |+| No GUI editor | Agents never open the interactive editor or any window on the person's desktop and never send input to the person's windows. Commandlets and `-unattended` only |+| Shared DDC | One local Zen DDC for the whole machine (`unreal/Toolchain/ddc.json`, 40 GB cap); every worktree and the runner use it. No per-worktree local DDC, no cloud DDC |++### 3.4 Contract changes++A contract is frozen at the start of phase 1. A sub-task agent that needs a+change writes a contract change request (CCR) as an issue labelled+`verse-contract`: the contract file and section, the change, why the frozen+version cannot work, every package it affects. It then stops that part of its+work (and continues the rest). Only the integration owner decides. An+accepted CCR lands as one PR by the integration owner that changes the+contract doc, the `VerseCore` types, the stubs, the contract tests and every+existing caller together, and bumps the contract's minor version. Packages+rebase after it lands. Tuning values marked "start value" are not contract+and change through the balance harness.++### 3.5 Done++A sub-task is done only when all of these hold, in this order:++1. **Build** green for the targets the change reaches (`build.py`).+2. **Tests** green: the package filter plus `Verse.Contract.*`, new tests for+ every new behaviour, and the visual lane when something visible changed.+3. **Adversarial verify** by a separate verifier agent (section 5.4): PASS.+4. **Evidence** in the PR body (section 5.5).+5. **`python scripts/agent_done_gate.py`** says DONE: PR merged through the+ queue, CI green on `main`, local `main` contains it.++## 4. Machine limits++Reference box: AMD Ryzen 7 7800X3D (8 cores, 16 threads), 32 GB RAM,+RTX 5070 Ti 16 GB, one drive `C:` (106 GB free on 2026-11-02, measured). The+GPU is shared with dictation, local models, Blender and WebView2; RAM is the+first limit for parallel compiles, VRAM for anything rendered, disk for+worktrees. These are start values; step 0.8 replaces them with measured ones.++| Limit | Value | Why |+|---|---|---|+| `gpu-heavy.lock` holders | **1** | Architecture §8.2: one compile, cook, package, commandlet, Blender export, rendered test or balance run at a time. Waiters queue in FIFO order, they never fail |+| UBT parallel actions inside a build | **10** (`-MaxParallelActions=10`) | About 1.5 GB RAM per compile action; leaves 6 threads and about 15 GB for the app, voice and agent sessions |+| Shader compile workers | **10** (`NumUnusedShaderCompilingThreads=6`, below-normal priority) | Same headroom as UBT |+| Headless (`-nullrhi`) processes inside one lock hold | **4** (`balance.py --jobs 4`, `test.py --jobs 4`) | About 2.5 GB RAM each; CPU-bound, no GPU |+| Rendered processes (screenshots, perf, packaged smoke with RHI) | **1**, Verse VRAM capped at 6 GB | Leaves 10 GB for dictation and local models |+| GPU perf captures | Nightly window only, skipped when the person used the machine in the last 5 min | Architecture §8.2 quiet hours |+| Running agent sessions on the box | **20** | About 0.4 GB each plus tools; together with one build stays under 32 GB |+| Worktrees holding Unreal build output | **12** | About 4 GB each for `Binaries/` + `Intermediate/` (to be measured); `build.py` refuses a new build below 40 GB free and asks the orchestrator to clean merged worktrees |+| Lock queue depth | Stop scheduling build-heavy sub-tasks above **8** waiters | Keeps an agent's wait for a build under about half an hour |++Hundreds of sub-tasks therefore run in waves of at most 20 sessions, and+builds are serial. Throughput is set by build time (step 0.8): with+incremental editor builds of a few minutes the box serves roughly 15-25+builds an hour, which is why agents build once per change (section 3.3).+Static checks and documentation-only work need no lock.++`with_lock.py` holds the lock as an OS file lock on+`C:/demo/.locks/gpu-heavy.lock` (released by the OS when the holder dies),+writes holder, command, start time and PID beside it for the queue view, and+times out a hold after 90 minutes with a loud log line, never by killing+other processes.++## 5. Verification recipe for Unreal changes++All commands run from the worktree root. `<UE>` is+`C:/Program Files/Epic Games/UE_5.7`; `<P>` is the absolute path of+`unreal/Verse/Verse.uproject` in the worktree. The scripts wrap exactly+these commands under the lock.++### 5.1 Build++```text+python scripts/unreal/build.py editor # VerseEditor Win64 Development+python scripts/unreal/build.py game # Verse Win64 Development+python scripts/unreal/build.py linux # Verse Linux Development (cross)++# what build.py runs+"<UE>/Engine/Build/BatchFiles/Build.bat" VerseEditor Win64 Development -Project="<P>" -WaitMutex -NoHotReloadFromIDE -MaxParallelActions=10+```++Pass: exit code 0, no warning that the DAG check or `-WarningsAsErrors` for+`Verse*` modules turns into an error.++### 5.2 Headless automation tests++```text+python scripts/unreal/test.py "Verse.Combat+Verse.Contract"++# what test.py runs+"<UE>/Engine/Binaries/Win64/UnrealEditor-Cmd.exe" "<P>" -ExecCmds="Automation RunTests Verse.Combat+Verse.Contract; Quit" -TestExit="Automation Test Queue Empty" -unattended -nullrhi -nosound -nosplash -NoP4 -stdout -FullStdOutLogOutput -ReportExportPath="<worktree>/unreal/Verse/Saved/Automation/<run>" -log="<run>.log"+```++| Topic | Rule |+|---|---|+| Names | `Verse.<Module>.<Area>.<Case>`; contract tests `Verse.Contract.*`; smoke `Verse.<Module>.Smoke`; visual `Verse.Visual.*` (5.3) |+| Kinds | Unit-style `IMPLEMENT_SIMPLE_AUTOMATION_TEST` for pure logic; latent tests with a world for gameplay; `AFunctionalTest` actors in the package's `/Game/Verse/Test/WP<nn>/` maps for scenarios; Gauntlet for multi-process (netcode, balance) |+| Pass | `test.py` parses `index.json`: zero failed, zero not-run among the requested tests, the requested filter matched at least one test, no `Fatal`, `Ensure` or crash in the log |+| Determinism | Tests seed `VerseCore` RNG; flaky is failed. A test that fails once in CI is quarantined only by the integration owner, with an issue |++Multi-process runs use the commands in `contracts/bot.md` §11.1 through+`balance.py` and the netcode test (dedicated server via the editor plus two+`-game -nullrhi` clients with `PktLag=60 PktLagVariance=10 PktLoss=1`).++### 5.3 Screenshot capture (anything visible)++```text+python scripts/unreal/screenshot.py --suite Verse.Visual.Hangar++# what screenshot.py runs (needs the GPU, under the lock)+"<UE>/Engine/Binaries/Win64/UnrealEditor-Cmd.exe" "<P>" -game -d3d12 -windowed -ResX=1920 -ResY=1080 -ExecCmds="Automation RunTests Verse.Visual.Hangar; Quit" -TestExit="Automation Test Queue Empty" -unattended -nosound -benchmark -fps=30 -ReportExportPath="<run dir>"+```++| Topic | Rule |+|---|---|+| Shots | Visual tests place the camera at named bookmarks per deck and zone and call the automation screenshot function; the harness waits for shader compile and streaming to finish before each shot |+| Comparison | Against ground truth in `unreal/Verse/Tests/GroundTruth/Win64/` (never a folder named `Screenshots`, architecture §8.4), tolerance "low". A new or changed ground truth is approved only by the integration owner, after looking at it |+| Offscreen | The window is created off the person's monitors or minimised to them; agents never capture the person's desktop |+| Content | Visual tests run against `fake_bridge.py` with synthetic roster, pane and terminal data. No real terminal content, names or chats in any screenshot |+| Output | `Saved/Harness/proof/<branch>/` locally (never committed); in CI, a workflow artifact the PR body links |++### 5.4 Adversarial verify++A verifier agent with fresh context checks out the PR head in its own+worktree (read-only, never pushes) and gets the sub-task prompt, the diff and+the acceptance list. It must:++1. Confirm every changed path is in the sub-task's owned paths.+2. Rebuild and rerun the evidence commands itself; never trust pasted output.+3. Try to break the change: edge inputs, server vs client, `-nullrhi` vs+ rendered, destroyed or missing actors, contract invariants it touches.+ It writes at least one probing test; a probe that exposes a bug is handed+ to the author to keep.+4. Run the forbidden-name scan and the licence ledger check on the diff.+5. Answer `PASS` or `FAIL` with reproduction steps.++Two `FAIL` rounds on the same sub-task go to the package lead.++### 5.5 Evidence block (PR body)++```text+## Evidence+Sub-task: WP<nn>.<k> Owned paths: <list>+Build: editor OK, game OK, linux OK|n/a (build.py, <date>, <minutes>)+Tests: Verse.<Module>.* 41/41, Verse.Contract.* 18/18 report: <CI artifact link>+Visual: Verse.Visual.<Suite> 6/6 vs ground truth | n/a screenshots: <artifact link>+Packaged smoke: OK | n/a+Verifier: PASS (<verifier session>), probes added: <test names>+Contract: unchanged | CCR #<n>+```++### 5.6 Packaged-build smoke test++For changes to startup, maps, packaging, the bridge, the window or anything+cooked, and nightly on `main`:++```text+python scripts/unreal/smoke.py++# what smoke.py runs+"<UE>/Engine/Build/BatchFiles/RunUAT.bat" BuildCookRun -project="<P>" -platform=Win64 -clientconfig=Development -build -cook -stage -pak -iostore -archive -archivedirectory="<worktree>/unreal/Verse/Saved/Smoke" -unattended -utf8output -nocompileeditor+python scripts/unreal/fake_bridge.py --token <random> & # verse.bridge/1, synthetic data+DODAIOS_VERSE_TOKEN=<random> Saved/Smoke/Windows/Verse.exe -windowed -ResX=1280 -ResY=720 -VerseSmoke=boot,hangar,arena30s -log+```++Pass: first frame within 8 s; `hello`/`welcome` handshake and heartbeats on+the fake bridge; the hangar loads, switches to arena, 30 s of bot-vs-bot run;+`dormant`, `show` and `stop` commands behave as architecture §1.3 says; one+screenshot per stage; exit code 0; no `Fatal`, `Ensure` or crash in the log.+A `-nullrhi` variant of the same run covers the runner when the GPU is busy.+For app-link work (phase 2.3 on), the same build is launched by a dev+instance of the desktop app (its own port and data dir, never the person's+running app) through `POST /api/verse/launch`.++## 6. Sub-task agent prompt template++The package lead fills every `<...>`. A prompt missing any field is not sent.++```text+You are a sub-task agent for the Unreal Verse.++Read first, in order: docs/verse/unreal/README.md (binding decisions),+docs/verse/unreal/orchestration.md (these rules), your package in+docs/verse/unreal/work-packages.md (<WP-id>), and these contracts:+<contract files and sections>.++Goal: <one or two sentences: the outcome, not the implementation>.++Acceptance (all must be true and shown by tests):+- <criterion, with the test name that proves it>+- <criterion ...>++Owned paths (you may change only these):+- <path globs>+Read-only context: <paths worth reading>.+Stubs you code against: <interfaces from other packages>.++Setup: python scripts/unreal/worktree.py new wp<nn>-<k>-<slug>+Work only in that worktree, on branch claude/verse-wp<nn>-<k>-<slug> off origin/main.++Rules:+- English only. Never name other games, studios, franchises or real firearm+ makes or models anywhere, including commits and PR text.+- Own or CC0 assets only, recorded in art/verse/LICENSES.md.+- Builds, tests, cooks and screenshots only through scripts/unreal/*.py (they+ take the machine lock). Build once per change, not per edit.+- No interactive editor, no input to the person's windows, no git stash.+- Repo gates (architecture §8.4): never commit .fbx, .wav, .exr or video;+ no folder named Build, Models, Env, Logs, Dist, Video, Renders, Evidence,+ Recordings or Screenshots; no user-profile paths in docs; run+ scripts/unreal/check_forbidden_names.py on the diff before each commit.+- PR title: type(verse): subject, lower case, imperative.+- Need a contract change? Open a verse-contract issue (orchestration §3.4),+ stop that part, continue the rest.++Verify: build.py <targets>; test.py "<filters>+Verse.Contract";+<screenshot.py --suite ... | smoke.py | none>.+Land: python scripts/agent_land.py, with the evidence block (§5.5) in the PR.+Done when: a verifier answered PASS and python scripts/agent_done_gate.py+says DONE. Then remove the worktree with worktree.py remove.++Return: PR link, test counts, verifier verdict, open issues you created.+```diff --git a/docs/verse/unreal/parity.md b/docs/verse/unreal/parity.mdnew file mode 100644index 0000000000..9846df600d--- /dev/null+++ b/docs/verse/unreal/parity.md@@ -0,0 +1,472 @@+# Verse on Unreal: parity checklist++The three.js Verse is deleted in one pull request, and only once every row+below passes on the Unreal Verse (README, "Scope"). The rows come from+today's code. Paths in the "Today" column are relative to+`dodaios/ui/web/frontend/src/components/society/verse/` unless they start+with `src/`, `dodaios/`, `art/`, `scripts/` or `tests/`.++## 1. How a row passes++Every row has an automated check. A row passes when its check is green on+`main` in the lane named below (architecture §8.3). Nobody ticks a row by hand.++| Kind | What it is | Lane |+|---|---|---|+| `AT` | Unreal automation test `Verse.Parity.<Section>.<Id>`, `-nullrhi` unless marked GPU | `unreal-build` |+| `GT` | Gauntlet run of the real `Verse.exe` (`-nullrhi`) against a real backend with a fake bus and seeded roster/panes (`tests/unit/verse_host/fixtures/`, G0.11) | `unreal-build` (smoke), `unreal-gauntlet` |+| `BT` | Backend pytest with a scripted fake Verse peer on `WS /api/verse/bridge` (`tests/unit/verse_host/`) | Python CI |+| `VT` | Vitest of the web pieces that stay (launcher card, panel stream, bus handlers) | Frontend CI |+| `SS` | Harness screenshot of a fixed camera on the GPU build, compared with a stored reference (SSIM ≥ 0.9) plus the palette-share check of `contracts/art-pipeline.md` | `unreal-perf` |+| `ST` | Static check over files (schema, key coverage, forbidden names) | `unreal-static` |++`scripts/unreal/parity_report.py` (new) reads the row ids in this file,+matches them to test results by id (`Verse.Parity.D.07` ↔ row `D-07`) and+prints `n/N green`. The deletion PR (section 21) is allowed only when it+prints `N/N`, and it links the report.++A check cell that names only a kind (for example just `AT`) asserts the+row's Feature column exactly, with every number that column states (times,+counts, ranges, defaults), against the Today reference; the test name ends in+the row id. A row whose Feature column states no number asserts the+behaviour on at least one scripted case per state it names.++A row marked **[gap]** needed a bridge message or a config key that the+first draft of `contracts/bridge-protocol.md` lacked. Section 20 lists them;+all of them are now defined in `contracts/bridge-protocol.md` §14, frozen with+`verse.bridge/1`, so no package waits on them.++A row marked **[changed]** keeps the behaviour under a different form,+because a README decision changed it (an own window instead of a canvas in+the page, the hangar duel instead of the reactor duel). The acceptance+column states the new form.++## 2. Mounts, hosting and lifecycle++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| A-01 | Full Verse under Agents > Verse tab | `src/views/DodaiosAgentsView.tsx:24`, `src/views/society/SocietyView.tsx:33` | `VT`: selecting the Verse tab sends `POST /api/verse/show {reason:"verse_view"}`; `GT`: Verse reaches `Visible` and sends `lifecycle.ready` |+| A-02 | Compact Verse in the IDE side panel, opens on engineering | `src/components/agentic/sidePanel/OfficeTab.tsx:57` | `GT`: `panel.visibility {visible:true}` puts Verse in `Panel` state with deck `engineering`; `VT`: the panel component starts the stream |+| A-03 | IDE layout switch "Verse" maximizes the side panel and gives it back on leave | `src/components/agentic/threads/IdeLayoutSwitch.tsx:44-68` | `VT`: choosing "Verse" sends `show`; leaving restores the panel layout exactly as `IdeLayoutSwitch.test.tsx:26` asserts today |+| A-04 | Both mounts awake at once, each its own runtime | `VerseStage.tsx:156-159` | **[changed]** `GT`: panel visible + full view shown at once → one `Verse.exe`, the panel shows the last frame and "Verse is open", stream stopped (architecture §6) |+| A-05 | A visited stage keeps its renderer while hidden (`active=false`) | `VerseStage.tsx:98-99`, `src/hooks/useCanvasAwake.ts` | **[changed]** `GT`: hide → `Dormant` within 1 s, zero GPU frames; show again → `Visible` within 300 ms with the same deck and commander pose |+| A-06 | Hidden stage renders nothing (`frameloop: never`) | `VerseStage.tsx:930` | `GT`: in `Dormant` the harness counts 0 rendered frames over 10 s and CPU under 1 % of one core |+| A-07 | Loading screen: key art, tip, progress bar, fades out once the first deck is on screen | `VerseLoadingScreen.tsx`, `verseLoading.css` | `AT`: boot shows the loading widget until the deck's first frame, then fades in under 600 ms; `GT`: cold start to first frame ≤ 8 s |+| A-08 | No WebGL: "Verse unavailable" text, the app keeps working | `VerseStage.tsx:912,920` (`useWebglSupported`) | `BT`: probe reports `unsupported` (no D3D12 SM6 / Vulkan 1.3 / under 6 GB VRAM); `VT`: the launcher card shows the localized unsupported text; no `Verse.exe` spawned |+| A-09 | Renderer crash stays inside the Verse (error boundary, tab retry) | `VerseStage.tsx:105-110`, `OfficeTab.tsx:11-38` | `BT`: kill `Verse.exe` → supervisor restarts with backoff 1/4/15 s; 3 crashes in 5 min → status `crashed`, card offers the crash report; app process unaffected |+| A-10 | Deck missing or failed: status line "deck missing" | `VerseStage.tsx:964-968` | `AT`: a deck whose data layer fails to load shows the localized `verse.stage.deck_missing` text and the lift still works |+| A-11 | Eye-level scene fails: the deck falls back to the plate | `VerseStage.tsx:903-908` | **[changed]** no plate exists; `AT`: a failed World Partition cell load logs to the bridge (`log`), retries once, then shows A-10 |+| A-12 | WebGL context loss rebuilds the canvas (`generation`) | `src/hooks/useWebglSurface.ts`, `VerseStage.tsx:162` | `AT`: simulated device-removed (RHI lost) → Verse exits cleanly with a crash report; `BT`: supervisor relaunch restores deck and pose from saved state |+| A-13 | App quit or crash ends the Verse | n/a today (same process) | `BT`: closing the job object kills `Verse.exe`; app quit sends `lifecycle.quit` and Verse exits within 3 s with state saved |++## 3. Decks and content++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| B-01 | Four decks in order bridge, ops, engineering, hangar | `decks.ts:7` | `ST`: the deck DataAsset list equals `VERSE_DECKS` (`dodaios/progression/rules.py:51`) in order; `AT`: each loads and shows its first frame |+| B-02 | Deck number shown one-based on the lift and the title | `decks.ts:16-18`, `hud/DeckBar.tsx` | `AT`: title widget for hangar reads "04" and the localized `verse.deck.label` with n=4 |+| B-03 | `testbed` deck exists for pipeline smoke but never ships | `.gitignore:532-533`, `content/useDeck.ts` | `ST`: Shipping pak contains no `testbed` map; `AT`: Development build loads it with `-VerseDeck=testbed` |+| B-04 | Rooms, stations, sockets, routes from the cooked manifest (`verse.deck/1`) | `content/manifest.ts`, `art/verse/schema/deck.schema.json` | `ST`: every room, station, socket and route id of today's four manifests has a placed actor or volume with the same id (`contracts/art-pipeline.md` placement import); `AT` loads and counts them |+| B-05 | Deck cache: riding back to a deck is instant | `content/useDeck.ts` | `AT`: ride bridge→ops→bridge; the second arrival shows its first frame under 500 ms |+| B-06 | Commander spawn: first visit at the deck spawn, after a ride out of the lift | `life/commander.ts`, `life/cast.ts:91-95` | `AT`: first load places the commander at the `spawn` socket; after a lift ride at the lift socket |+| B-07 | A walk order belongs to the deck it was given on | `life/commander.ts`, `VerseStage.tsx:339-344` | `AT`: order a walk, ride the lift, come back: the commander stands at the lift, not walking to the old target |+| B-08 | Hangar is a normal deck day to day; the duel zone hides the crew | `VerseStage.tsx:785`, `actors/ActorsLayer.tsx:254-256` | **[changed]** `AT`: arena mode on → no crew pawn inside the arena bounds, the deck's stations outside it still work; arena off → crew back |++## 4. Turbolift++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| L-01 | Lift panel lists the decks top to bottom, current one marked and focused | `hud/LiftPanel.tsx` | `AT`: open lift UI → 4 rows in `DECK_IDS` order, current row has keyboard focus and the "current" state |+| L-02 | Choosing a deck shuts the doors, rides, opens them on the new deck | `VerseStage.tsx:346-357`, `verse-doors` | `AT`: ride → door widget closed for ≥ 400 ms, deck changes, doors open within 150 ms of the first frame of the new deck |+| L-03 | Doors give up and open after 5 s | `VerseStage.tsx:301-306` (`DOORS_GIVE_UP_MS`) | `AT`: block the deck load → doors open at 5 s ± 0.2 s with A-10 shown |+| L-04 | Reduced motion skips the door animation | `VerseStage.tsx:354` | `AT`: `reduced_motion=true` (from `settings.changed`) → ride switches decks with no door phase |+| L-05 | Same deck chosen: panel closes, nothing rides | `VerseStage.tsx:349` | `AT` |+| L-06 | Lift opens from the lift station, the deck title switch and the tool rail | `VerseStage.tsx:396,976,981` | `AT`: each of the three opens the lift UI |+| L-07 | Lift ride sound (doors, ride) | `audio/useStageAudio.ts` | `AT`: a ride emits the door-close, ride and door-open cues (audio event log) |++## 5. Feeds the Verse consumes++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| F-01 | Roster of society agents (name, tier, created, run state) | `life/useCrewLife.ts` → `../data` `useSocietyRoster` (`GET /api/society/agents`) | `BT`: `roster.snapshot` on subscribe matches `GET /api/society/agents`; `GT`: a seeded agent appears as an officer pawn |+| F-02 | Roster freshness: refresh every 5-6.5 s while awake, 30 s base | `life/useCrewLife.ts:52-60` | `BT`: `SocietyRoomChanged`/`SocietyMessageSent`/`SocietyResultPosted`/`SocietyTeamChanged` trigger `roster.delta` within 1 s; a 30 s safety re-read happens; nothing is read while Verse is `Dormant` |+| F-03 | Coding panes as technicians (workspace, call sign, dot, state) | `../crewFeeds/codingFloor.ts`, `src/store/workspacePanes` | `BT`: `roster.snapshot.panes[]` matches `GET /api/agentic-ide/panes`; `AgenticIdeTerminalsAdded/Closed` → `roster.delta` within 1 s |+| F-04 | Pane look stable per pane lifetime (`history_id` hash) | `../crewFeeds/codingFloor.ts` | `AT`: the same `history_id` dresses the same body and accent across relaunches |+| F-05 | Pane screens, about 450 ms, at most 6 seated | `../crewFeeds/usePaneScreens.ts` | `BT`: `screens.watch` for ≤ 8 panes pushes dirty rows at ≤ 10 Hz; latency PTY→frame ≤ 200 ms p95 |+| F-06 | In-page xterm buffers with colours and attributes | `src/lib/liveTerminals.ts`, `effects/terminalCanvas.ts` | `BT`: the styled mirror yields fg/bg/bold/dim/inverse/underline per cell for a scripted ANSI stream, equal to xterm's reading (golden file) |+| F-07 | Plain replay for a pane the IDE has not mounted | `effects/terminalCanvas.ts` `snapshotText` | `BT`: a pane with no web client still streams cells (styled mirror seeded from replay bytes) |+| F-08 | Desk chat tails, every 2.5 s, at most 6 agents | `../crewFeeds/useDeskChats.ts` | `BT`: `chat_tails.watch` → `chat_tails.update` on `SocietyMessageSent` within 1 s; at most 6 agents watched |+| F-09 | Chat groups (teams) | `src/lib/societyChatGroups.ts`, `life/useCrewLife.ts` | `BT`: `groups.snapshot` matches the group read; a new group → `groups.delta` |+| F-10 | Team meetings and rounds (who speaks, transcript), leased poller plus socket | `../crewFeeds/useTeamRounds.ts`, `../crewFeeds/teamwork.ts` | `BT`: a round opened/settled and each line said → `meetings.update` with speaker and transcript tail; a round running before connect is in the snapshot |+| F-11 | `/ws` bus events Society* and ProgressionAwarded | `life/useCrewLife.ts`, `../progression/useProgressionSync.ts` | `BT`: each of the four event types reaches the right topic (roster, meetings, progression) once, in order, with `seq` |+| F-12 | Progression read plus slow re-read | `../progression/useProgressionSync.ts` | `BT`: `progression.snapshot` on subscribe equals `GET /api/progression`; `ProgressionAwarded` → `progression.awarded` |+| F-13 | Level-ups that happened while the Verse was closed are told once | `../progression/progressionStore.ts:158-190` (`jarvis.verse.levels.seen.v1`) | **[gap]** `BT`: the backend keeps the last seen award seq per person; `GT`: one missed promotion is shown once on the next show, not again on the one after |+| F-14 | Companion pet (chosen pet, mascot style pet) | `../companion/companionPetStore.ts:59-75` (`useSyncCompanionPet`) | **[gap]** `BT`: a `companion` topic carries the active pet id and look; `AT`: the pet pawn uses that look; a change applies within 2 s |+| F-15 | IDE state and IDE agent list for the launcher | `hud/LauncherPanel.tsx` (`fetchIdeState`, `fetchIdeAgents`) | `BT`: `launcher.options` reply lists workspaces (active first) and agents from the same endpoints |+| F-16 | Static content from `public/verse` | `content/loadDeck.ts`, `actors/characters.ts`, `audio/verseAudio.ts` | `ST`: every asset the Unreal build needs is cooked into its paks; `GT`: Verse runs with `public/verse` absent |+| F-17 | i18n chunk `ship` for the person's language | `src/i18n/index.ts:215`, `src/i18n/locales/ship/*.json` | `BT`: `welcome.locale.strings` carries `ship/verse.<lang>.json` + `ship/ranks.<lang>.json` for the app language; see section 18 |+| F-18 | Commander rank and uniform | `ranks/useRanks.ts` (`useCommanderRank`, `useCommanderUniform`), `../progression/cosmetics.ts:84` | `AT`: the commander's plate tiles and uniform tier follow `progression.snapshot`; **[gap]** the uniform choice (today `localStorage dodaios.verse.uniform.v1`) moves to app config and arrives in `welcome` |+| F-19 | No feed is read while the Verse is hidden | `useCanvasAwake` gating in every feed hook | `BT`: in `Dormant` the bridge carries only heartbeats and events, no screen frames; screens unsubscribed |++## 6. Crew life++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| C-01 | Duty status from run state, pane dot and live signals | `ranks/dutyStatus.ts` | `AT`: table test over every `(run_state, asking, last result, pane dot)` row of `ranks/ranks.test.ts` gives the same status |+| C-02 | Precedence paused > waiting > working > error > idle; working never shown in error | `ranks/dutyStatus.ts:21-24` | `AT`: same table test |+| C-03 | Officer working: bridge console, seated typing | `life/planner.ts` `intentOf` | `GT`: a seeded working agent sits at a bridge console playing the typing loop |+| C-04 | Officer waiting: stands at console, turns to the commander | `life/planner.ts` | `GT`: waiting agent stands at its console and its yaw tracks the commander within 15° |+| C-05 | Officer error: at console, alert, not typing | `life/planner.ts` | `GT` |+| C-06 | Officer paused: in a bunk on ops, asleep | `life/planner.ts` | `GT` |+| C-07 | Officer idle: seeded off-duty routine, 6 min slots (mess 5, corridor 2, viewport 3) | `life/planner.ts:40-63` | `AT`: `idleVenueOf(id, t)` port gives today's venue for 1,000 seeded `(id, t)` pairs (golden table exported from the TS function) |+| C-08 | Technician working/waiting/error at an engineering terminal; idle in the workshop | `life/planner.ts:68-75` | `GT`: one pane per state lands at the right venue and activity |+| C-09 | Home consoles handed out in service order (lead first, then arrival, then id), stable when others leave | `life/planner.ts:11-14`, `life/crew.ts` `byServiceOrder` | `AT`: golden placement for a 12-member roster; removing one idle member changes no other console |+| C-10 | Nobody shares a seat; previous socket kept across refreshes | `life/planner.ts` `placeOnDeck` | `AT`: 100 random roster refreshes → no socket twice, ≥ 95 % of members keep their socket |+| C-11 | Team round: speaker at the briefing table talks, free members listen | `life/planner.ts:77-82`, `../crewFeeds/teamwork.ts` | `GT`: a scripted round with 3 members → 1 talking at briefing, 2 listening; speaker change moves the talk clip |+| C-12 | Agent-to-agent message: the sender walks to the receiver once free | `../crewFeeds/teamwork.ts:13-17` | `GT`: a `SocietyMessageSent` ASSIGN between two idle agents → the sender's pawn reaches within 1.5 m of the receiver |+| C-13 | New agent arrives at the hangar shuttle and walks to the lift for 40 s | `life/cast.ts:81-89`, `life/useCrewLife.ts:28` | `GT`: create an agent while on hangar → a pawn spawns at the shuttle and reaches the lift socket |+| C-14 | Members on the deck when it opens stand in place; others come by lift | `life/cast.ts:77` (`entry`) | `AT` |+| C-15 | Leavers walk to the lift and vanish | `actors/ActorsLayer.tsx` | `GT`: a member whose venue moves off deck walks to the lift and despawns |+| C-16 | Re-plan every 20 s for off-duty moves | `life/useCrewLife.ts:26` | `AT`: idle slot boundary crossed → the member moves within 21 s |+| C-17 | Own walk pace per member 1.2-1.45 m/s; commander 1.45 | `life/cast.ts:58-61` | `AT`: pace from the same hash as `walkPace` |+| C-18 | Paths: A* with string pulling, local avoidance, no corner cutting | `nav/pathfind.ts`, `actors/locomotion.ts` | `AT`: Recast path on each deck between all station pairs exists; 20 pawns crossing a corridor → no overlap of capsules over 1 s |+| C-19 | Commander salute: the crew salutes on a promotion | `VerseStage.tsx:200` (`cheerUntil`), `actors/ActorsLayer.tsx` | `GT`: `progression.awarded` with a commander promotion → every visible crew pawn plays the salute within 1 s |+| C-20 | Ship's company: up to 3 troopers on patrol routes, sentry posts, up to 2 utility drones | `life/cast.ts:20-21,104-124` | `AT`: on each deck the counts match today's manifest routes and posts, capped 3/2 |+| C-21 | Companion drone follows the commander at heel | `life/cast.ts:96-100` | `AT`: walk 30 m → companion stays within 2.5 m after 2 s |+| C-22 | Rank looks: uniform by tier, accent colour, lit plate tiles, cap for capped tiers | `actors/look.ts`, `ranks/ranks.ts` | `AT`: for each of the 15 ranks the plate's lit tiles equal `plateTiles(id)`; uniform material equals the tier's |+| C-23 | Room light: people lit by the room they stand in, eased over 0.5 s | `actors/roomLight.ts` | `SS` GPU: an officer walking from bridge to mess shows the mess's colour on the reference shot; Lumen covers it |+| C-24 | Dev override of a member's duty | `life/devOverrides.ts` | `AT`: `Verse.QA.SetDuty <id> working` forces the status; `none` releases it (section 19) |++## 7. Stations and the use key++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| S-01 | Station kinds: agents_list, team, service_record, mess_call, games, quartermaster, coding_launcher, create_agent, lift | `content/deck.ts:38-40` | `ST`: the station enum has exactly these nine plus `armoury`; every manifest station is placed |+| S-02 | `agents_list` opens the agent ledger in the app | `VerseStage.tsx:368-370` | **[gap]** `BT`: `agents.open_list` → web UI opens the Agents ledger (side panel: Agents tab, `OfficeTab.tsx:57`); Verse hides |+| S-03 | `team` opens the group of the running team, else the first team; none → notice | `VerseStage.tsx:359-375` | **[gap]** `BT`: `group.open {group_id}` → web UI opens that group; `AT`: no team → localized `verse.notice.no_team` |+| S-04 | `service_record` in the records hall opens the ladder, elsewhere the record | `VerseStage.tsx:377` | `AT`: records hall station opens the service record on "Ladder", ready room desk on "Record" |+| S-05 | `quartermaster` opens the record on "Rewards" | `VerseStage.tsx:378` | `AT` |+| S-06 | `mess_call` calls idle officers to the mess for 90 s; again ends it; nobody → notice | `VerseStage.tsx:379-387` | `GT`: 3 idle officers → all head to the mess, notice `verse.notice.mess_called` count 3; second use ends it; 0 idle → `mess_nobody` |+| S-07 | `games` opens the simulator: list of programmes, retro arcade, asteroid run | `hud/SimulatorPanel.tsx` | **[gap]** `BT`: `simulator.open {programme}` → the web arcade opens (`src/components/society/arcade/*` stays web); a new best reports `simulator_record "asteroid-run"` |+| S-08 | `coding_launcher` opens the launcher | `VerseStage.tsx:390`, `hud/LauncherPanel.tsx` | `AT` + section 8 |+| S-09 | `create_agent` creates an agent (or the host's own create flow); one at a time | `VerseStage.tsx:322-329` | `BT`: `agent.create` runs the same code as `POST /api/society/agents`; a second call within 5 s → `rate_limited`; cancel is no error |+| S-10 | `lift` walks there and opens the lift | `VerseStage.tsx:392` | `AT` |+| S-11 | Using a station walks the commander to its spot first | `VerseStage.tsx:367` | `AT`: activate from 10 m away → commander path ends at the station spot |+| S-12 | E works what the crosshair is on, else the station within reach, the one in front preferred | `VerseStage.tsx:639-643,445-455`, `life/control.ts` `stationWithin` | `AT`: port of `eyeLevelGame.test.tsx:182-192` cases (nearest without facing, front with facing, behind when alone) |+| S-13 | Station within reach checked 5 times a second, offered as a prompt with its key below the view centre | `VerseStage.tsx:466-479`, `hud/FloatingLabels.tsx` | `AT`: walk into reach → prompt with localized name, action and "E" within 250 ms; never drawn on the commander's back |+| S-14 | Station labels on hover (name + action, no key) | `VerseStage.tsx:862-876` | `AT`: hovering a station in overview shows name and action without the key glyph |+| S-15 | Desk takeover stations: each desk monitor showing exactly one pane | `VerseStage.tsx:423-437` | `AT`: desks with 0 or 2+ panes, and the master station, offer no takeover |+| S-16 | Takeover label is the pane's title, action "take over" | `VerseStage.tsx:868-870` | `AT` |+| S-17 | Armoury station starts the duel (successor of the 4 reactor ring consoles) | `VerseStage.tsx:412-416` (ring consoles) | **[changed]** `AT`: E at the armoury opens the duel panel; the ring consoles are gone |+| S-18 | Clicking a station in overview activates it | `VerseStage.tsx:550-554` | `AT` |++## 8. Actions into the app++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| X-01 | Open a pane from a technician's card | `VerseStage.tsx:331-334`, `../crewFeeds/codingNavigate.ts` | `BT`: `pane.open {pane_id}` → `VerseOpenRequested` → web opens the IDE on that pane, side panel un-maximized; Verse hides |+| X-02 | Open an agent from an officer's card | `VerseStage.tsx:335-336` | `BT`: `agent.open` → web opens the agent (host `onSelectAgent`, else Agents section) |+| X-03 | Launcher: pick workspace, CLI agent, count 1-4, brief; opens panes and briefs them | `hud/LauncherPanel.tsx:14-17,79-94` | `BT`: `launcher.start` with count 3 → 3 panes opened, started, briefed; reply per pane `submitted` |+| X-04 | Launcher: one batch at a time, closing stops the batch | `hud/LauncherPanel.tsx:9-10`, `hud/hudDialogs.test.tsx:79` | **[gap]** `BT`: second `launcher.start` while one runs → `busy`; `launcher.cancel` stops further panes |+| X-05 | Launcher: start timeout 30 s, poll 0.6 s, failure line with reason | `hud/LauncherPanel.tsx:16-17,71` | `BT`: a pane that never goes live → reply `submitted:false` after 30 s; `AT`: the localized failure line shows the reason |+| X-06 | Launcher "Open IDE" button | `VerseStage.tsx:993` | `BT`: maps to `pane.open` without a pane (IDE section) **[gap]** `ide.open` |+| X-07 | Desk takeover: the real terminal at 1:1, keys land on the pane | `hud/TakeoverPanel.tsx` | **[changed]** `BT`: `ide.focus_terminal {pane_id}` → web opens the IDE on that pane with keyboard focus in its xterm; desktop raises the app; Verse hides |+| X-08 | Takeover "Changes" opens the pane's changes | `hud/TakeoverPanel.tsx:85-92` | **[gap]** `BT`: `pane.open {pane_id, open:"changes"}` → `requestPane(..., {open:"changes"})` |+| X-09 | Takeover of a pane the IDE grid has not mounted opens it; never a second copy | `hud/TakeoverPanel.tsx:15-20`, `takeover.test.tsx:142-165` | `BT`: focus on an unmounted pane mounts it once; on a mounted pane no new terminal |+| X-10 | Takeover leaves on Ctrl+Q; Escape belongs to the agent | `hud/TakeoverPanel.tsx:74-84` | **[changed]** n/a in Verse (no terminal inside it); `VT`: after `ide.focus_terminal`, Escape reaches the xterm |+| X-11 | All app actions are idempotent and rate-limited | n/a | `BT`: open commands 4/s, `agent.create` 1 per 5 s, `launcher.start` 1 per 10 s (`contracts/bridge-protocol.md` §11) |++## 9. World actions (progression)++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| W-01 | `daily_visit` on the first awake moment | `../progression/useProgressionSync.ts:90` | `GT`: first `Visible` of a launch sends one `progression.action daily_visit`; later shows do not |+| W-02 | `deck_discovered` per deck on arrival | `../progression/useProgressionSync.ts:91` | `GT`: arriving on each deck sends one action with the deck id |+| W-03 | `inspection`: every room of the deck visited, once per deck per day | `life/useWorldActions.ts:31-48` | `GT`: harness walks the commander through every room volume → one action with the deck id; a second tour that day sends none |+| W-04 | `walk_together`: every 50 m with the companion within 2.5 m, 0.5 s tick | `life/useWorldActions.ts:20-23,49-58` | `AT`: 120 m at heel → exactly 2 actions; 120 m with the drone held back → 0 |+| W-05 | `team_briefing`: a round running while on the bridge, once per round | `life/useWorldActions.ts:62-71` | `GT`: a round runs, commander on bridge → 1 action with the team id; the round ends and runs again → 1 more |+| W-06 | `simulator_record` when the asteroid best rises | `hud/SimulatorPanel.tsx:39` | `BT` with S-07 |+| W-07 | Reporting twice is harmless (server meters) | `life/useWorldActions.ts:2-3` | `BT`: duplicate actions pay once (existing `progression/service.py` rules) |+| W-08 | `duel_won` / `duel_lost` and duel stats in the service record | none today (`rules.py:134`) | `BT`: one `duel.result` per set (`won`, `lost`, `unfinished`), idempotent per `match_id`; `won` and `lost` sets of 60 s or more pay commander XP, every result updates `duel_stats` (wins, K/D, headshots, finishers); `AT`: service record shows them |++## 10. Screens and in-world effects++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| E-01 | Bridge console shows its officer's chat tail | `effects/useScreenFaces.ts` | `GT`: a `SocietyMessageSent` for an officer appears on its console render target within 2 s |+| E-02 | Console belongs to its officer whether or not they sit there; an empty console says so | `effects/useScreenFaces.ts:8-9` | `AT`: officer at the mess → console still shows their tail; no owner → localized empty text |+| E-03 | Engineering terminal shows its pane cell for cell, colours and box drawing | `effects/terminalCanvas.ts` | `SS` GPU: golden pane (ANSI colours, box-drawing frame, wide glyph) on a monitor matches the reference; `AT`: cell-to-glyph mapping on the render target equals the bridge cells |+| E-04 | Bottom block of rows that fits is shown; width fills the tile | `effects/terminalCanvas.ts:8-10` | `AT`: 60-row pane on a 24-row monitor shows rows 37-60 |+| E-05 | Engineering master station: every coding pane in a grid | `effects/useScreenFaces.ts:6-7` | `GT`: 5 panes → master screen shows 5 tiles |+| E-06 | Briefing wall screen: the running round's transcript | `effects/useScreenFaces.ts:7-8` | `GT`: lines of a scripted round appear in order |+| E-07 | Any other screen: standby page | `effects/useScreenFaces.ts:8` | `AT` |+| E-08 | Screen colours: green live work, amber needs the commander, red fault, dim blue standby; header strip with station and status; faint scanlines | `effects/screenPainter.ts:2-7` | `SS` GPU per state; `AT`: header text equals the localized status |+| E-09 | Cursor blink; redraw only on change, a few screens per frame | `effects/ScreensLayer.tsx:5-6` | `AT`: game-thread cost of monitors ≤ 0.3 ms/frame with 8 busy panes; far monitors update at 2 Hz (architecture §5.3) |+| E-10 | Status beacon over each crew head: steady (working), slow pulse amber (waiting), slow pulse red (error), none (idle, paused) | `effects/BeaconsLayer.tsx`, `ranks/dutyStatus.ts:5-11` | `AT`: beacon component state per status; `SS` GPU for colour |+| E-11 | Floor ring at each crew member's feet in the status colour, grey off duty; constant few pixels, drawn over everything | `effects/BeaconsLayer.tsx:6-12` | `AT`: ring screen size within ±1 px at 5 m and 40 m in overview; visible through a console (custom depth) |+| E-12 | Holo tables: projection lit during a team round (briefing table) or always (strategy table) | `effects/HoloLayer.tsx`, `VerseStage.tsx:845-855` | `AT`: briefing holo off without a round, on with one; strategy holo always on |+| E-13 | Lamps blink at their cooked rate; alarm lamps blink only while someone on the deck has a fault; reactor core breathes; occasional fixture dip | `effects/LightsLayer.tsx` | `AT`: an `error` member on the deck turns alarm lamps on, clearing it turns them off; blink rates equal the manifest's `blink_hz` ± 5 % |+| E-14 | Reduced motion keeps every state but drops pulses and movement | `effects/*` `reduced` props | `AT`: `reduced_motion` → beacons steady, holo rings still, no fixture dips |+| E-15 | Labels hidden behind walls and behind the camera at eye level | `hud/FloatingLabels.tsx:7-10`, `eyeLevelGame.test.tsx:349-376` | `AT`: port of the three cases |++## 11. HUD, cards and notices++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| H-01 | Deck title top left: number, name, aboard / working / waiting counts | `hud/DeckBar.tsx` `DeckTitle` | `GT`: seeded 4 aboard, 2 working, 1 waiting (+ error counts as waiting) → widget shows 4/2/1 |+| H-02 | Rank card beside the title (compact variant in the panel) opens the service record | `ranks/RankCard.tsx` | `AT`: click opens the record on "Record" |+| H-03 | Tool rail: view switch, lift, hoverboard, commander, duel, settings, help | `hud/DeckBar.tsx:67-120` | `AT`: Verse bar has each control with its key hint; duel hidden in the panel, settings only where eye level is possible |+| H-04 | Name plate on hover/selection: name, rank (or "terminal" for technicians), status, accent | `VerseStage.tsx:861-873` | `AT` |+| H-05 | Crew card: name, plate, rank, status, post; open chat/terminal, show, walk over; close | `hud/CrewCard.tsx` | `AT`: open → X-01/X-02; show turns the camera to them; walk sends the commander to a walkable spot 0.9 m in front; show/walk hidden when not on this deck |+| H-06 | First click selects a crew member, a second click on the same one opens them | `VerseStage.tsx:514-518,537-541` | `AT` |+| H-07 | Notices: one line, 4.2 s; help text 15 s | `VerseStage.tsx:117-120,311-314` | `AT`: notice lifetime 4.2 s ± 0.1; help 15 s |+| H-08 | Help text differs at eye level and in overview, plus the duel line | `VerseStage.tsx:988` | `AT`: `verse.stage.help_eye` vs `verse.stage.help` + `verse.stage.help_duel` |+| H-09 | Reticle at eye level, marked when something usable is under it | `VerseStage.tsx:990` | `AT` |+| H-10 | Hint "click to look" while the mouse is free at eye level | `VerseStage.tsx:991-993` | **[changed]** `AT`: shown when the Verse window has focus but no mouse capture |+| H-11 | Hint "click for keys" while the keys go elsewhere | `VerseStage.tsx:995-997` | **[changed]** `AT` (panel stream): shown in the panel until a click on it routes input to the stream |+| H-12 | Dialogs: modal, focus trapped, Escape or scrim closes, focus returns to the opener | `hud/VerseDialog.tsx`, `hud/hudDialogs.test.tsx:53` | `AT`: every Verse menu traps keyboard/gamepad navigation, Esc closes, focus returns to the previous widget |+| H-13 | Opening a dialog releases mouse look | `VerseStage.tsx:672-674` | `AT`: opening any menu shows the cursor and stops look input |+| H-14 | A HUD panel open/close click sound | `audio/useStageAudio.ts:4` | `AT`: audio event log has the click |++## 12. Ranks and the service record++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| R-01 | 15 ranks in 4 tiers, mirrored from `rules.py RANKS` | `ranks/ranks.ts:21-60` | `ST`: the rank DataAsset equals `rules.py` `RANKS` (ids, levels, tiers, plate patterns); replaces `tests/unit/progression/test_frontend_parity.py:74` |+| R-02 | Rank derived from level, never the server's rank id | `ranks/ranks.ts:6-8` | `AT`: a snapshot with a stale rank id and level 23 shows the level-23 rank |+| R-03 | Rank plate: six hexagon tiles, unique pattern per rank | `ranks/ranks.ts:10-18`, `ranks/RankPlate.tsx` | `AT`: all 15 patterns distinct and symmetric |+| R-04 | Service record dialog with five pages: Record, Ladder, Quartermaster, How to earn, Crew | `ranks/ServiceRecord.tsx:1-14,56-67` | `AT`: five tabs in that order, each opens by `openRecord(tab)` equivalent |+| R-05 | Record page: plate, rank, level, XP, next rank and what is missing, ribbons, recent log, bell | `ranks/ServiceRecord.tsx` `RecordPage` | `GT`: seeded progression → every field matches the snapshot |+| R-06 | Ladder: held ranks plain, current marked red, ahead dimmed with XP missing | `ranks/ServiceRecord.tsx` `LadderPage` | `AT` |+| R-07 | Quartermaster: uniforms by tier, pick one or the highest issued; ribbons with levels | `ranks/ServiceRecord.tsx` `QuartermasterPage`, `../progression/cosmetics.ts` | `AT`: picking a uniform changes the commander's material at once and persists (F-18) |+| R-08 | How to earn: every rule the running server pays, with limits | `ranks/ServiceRecord.tsx` `EarnPage`, `ranks/rankModel.ts` | `GT`: rules list equals the snapshot's `rewards` with cooldowns and caps |+| R-09 | Crew page: every officer's rank, highest first, and the companion | `ranks/ServiceRecord.tsx` `CrewPage` | `AT` |+| R-10 | Promotion notice for commander/companion: plate tiles laid one by one, rank, level, salute line, issued items; closes on acknowledge, Escape or 7 s; never takes focus | `ranks/PromotionNotice.tsx:2-8` | `AT`: notice lasts 7 s, does not take input focus from gameplay |+| R-11 | Other level-ups: a quiet corner line, 5 s or a click | `ranks/PromotionNotice.tsx:9-10` | `AT` |+| R-12 | Level bell sound on award, switchable | `../progression/levelSounds.ts:11` (`jarvis.verse.level.sound.v1`) | **[gap]** setting moves to app config; `AT`: off → no bell |+| R-13 | Overlay drawn only while the Verse is visible; the queue is kept | `ranks/RanksOverlay.tsx:13-14` | `GT`: award while `Dormant` → shown on the next show |+| R-14 | Rank words localized (`verse.ranks.rank.<id>`) in 5 locales | `ranks/ranksLocales.test.ts` | `ST` with N-02 |++## 13. Views, camera and input++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| V-01 | Three views: overview (bird's-eye), third person, first person | `engine/realtime/viewMode.ts` | `AT`: `Verse.QA.View.Set` to each; state reports it |+| V-02 | V cycles overview → third → first, skipping what cannot show | `viewMode.ts` `cycleView`, `views.test.tsx:31` | `AT`: port of the test |+| V-03 | 1/2/3 (top row and keypad) pick a view | `viewMode.ts:28-32` | `AT` |+| V-04 | Wheel moves third person 1.2-5 m eased; pushing past the closest hands over to first; scrolling out of first returns to third | `engine/realtime/shoulderRig.ts:6-10,50-51`, `views.test.tsx:67-108` | `AT`: ports of the five wheel cases |+| V-05 | Third person: commander lower right third, camera a little above the head, looking down slightly; never through walls (pulled in at once, eased out) | `shoulderRig.ts:4-6,20-21` | `AT`: framing ratio test; camera spring arm probe never inside geometry over a scripted wall-hug walk |+| V-06 | First person: eyes at 1.65 m just in front of the face, no sideways lag, segment test keeps it out of walls | `shoulderRig.ts:12-15,59` | `AT`: eye height 165 cm ± 2; facing a wall at 0.1 m the camera stays outside it |+| V-07 | Shoulder↔eyes blend over about 0.2 s, FOV included | `shoulderRig.ts:15-16`, `views.test.tsx:141` | `AT` |+| V-08 | First person pitch range wider than third, clamped back on return | `views.test.tsx:161` | `AT` |+| V-09 | FOV defaults 70° third, 85° first, settable in range | `shoulderRig.ts:40-42`, `engine/realtime/viewSettings.ts` | `AT` |+| V-10 | Sensitivity and inverted Y applied the same way in every view and in the duel | `engine/realtime/mouseLook.ts`, `views.test.tsx:183-190` | `AT`: same mouse delta turns the deck view and the duel camera by the same angle |+| V-11 | Raw mouse input where available | `mouseLook.ts`, `views.test.tsx:206` | `AT`: Enhanced Input uses raw mouse deltas (no OS acceleration) |+| V-12 | Commander walks relative to the view, faces it walking, leans ≤ 45° into a strafe, walks backwards facing the view | `views.test.tsx:222-237` | `AT`: ports of the three cases |+| V-13 | Shift hurries | `VerseStage.tsx:684` | `AT` |+| V-14 | Overview: WASD/arrows pan, +/- zoom about the centre, wheel zooms, drag looks | `VerseStage.tsx:700-707`, `engine/pointerInput.ts` | `AT` |+| V-15 | Click on the floor walks the commander there (overview and eye level, nearest walkable within 1.2 m) | `VerseStage.tsx:545-565`, `nav/floorPick.ts` | `AT`: click on floor → path to the projected point; on a wall → nothing (`eyeLevelGame.test.tsx:141`) |+| V-16 | Clicks pick a crew member in plain view, never one behind a wall | `engine/realtime/eyePick.ts`, `eyeLevelGame.test.tsx:133` | `AT` |+| V-17 | Commander button: third person reframes, overview focuses the commander | `VerseStage.tsx:984` | `AT` |+| V-18 | Show a crew member: turn toward them at eye level, else centre the map | `VerseStage.tsx:842-853` | `AT` |+| V-19 | L toggles mouse look | `VerseStage.tsx:631-637,712` | `AT`: L toggles mouse capture at eye level |+| V-20 | Choosing third/first takes the mouse at once, overview gives it back | `VerseStage.tsx:399-411` | `AT` |+| V-21 | The view last chosen is kept (default third) | `viewSettings.ts` (`dodaios.verse.view.v1`) | `AT`: relaunch restores the view; **[gap]** one-time import of today's localStorage values (section 20) |+| V-22 | A new deck frames the commander where they come aboard | `VerseStage.tsx:226-236` | `AT` |+| V-23 | Compact panel: overview and walking only; small panel stays overview | `engine/stageView.ts`, `VerseStage.tsx:246-262` | **[changed]** `GT`: in `Panel` state the stream offers overview and third person, never first person or the duel (architecture §6) |+| V-24 | Panel quality "auto" renders at the low tier | `VerseStage.tsx:291-292` | `GT`: panel stream renders with Low scalability; GPU ≤ 1.5 ms per frame at 960x600 |+| V-25 | Quality auto/high/low; auto drops to low under ~45 fps | `engine/realtime/RealtimeBackdrop.tsx:14-17`, `viewSettings.ts` | `AT`: forced slow frames on auto → Low scalability after the window; pinned High stays |+| V-26 | Frame stats readable by QA in every build | `VerseStage.tsx:210` (`__verseStats`), `runtime.ts` | `AT`: `Verse.QA.Stats` returns fps, tier and frame ms (section 19) |++## 14. Focus, keys and Escape++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| K-01 | The Verse reads its keys only while it has focus; never from a text field | `engine/stageFocus.ts:1-6`, `stageFocus.test.tsx:29-50` | **[changed]** `AT`: keys act only while the Verse window has OS focus; `VT`: the panel stream forwards keys only after a click on it, never while an input or xterm in the page has focus |+| K-02 | The stage never pulls focus on its own | `stageFocus.ts:24-31`, `stageFocus.test.tsx:62` | `BT`: Verse takes foreground only after `lifecycle.show` (with `AllowSetForegroundWindow` from the app); never on boot, never on an event |+| K-03 | The full stage takes the keyboard when opened, unless someone is typing; the panel never takes it | `VerseStage.tsx:622-628` | `BT`: `show` while a text field in the app has focus and `reason:"verse_view"` still shows (explicit user act); the panel never sends a focus request |+| K-04 | Ctrl/Meta/Alt chords are never the Verse's | `VerseStage.tsx:672-675` | `AT`: Alt+Tab, Ctrl+anything pass to the OS and bind nothing |+| K-05 | Escape order: end mouse look, else close the card or panel, else let it through (leaves the Verse) | `VerseStage.tsx:677-688` | `AT`: with capture → Esc releases it; with a menu → closes it; with nothing open → opens the in-game menu that offers "Back to the app" |+| K-06 | One key back to the app | none today (Escape leaves the Agents view) | `AT`+`BT`: F10 (rebindable) sends `focus.return_to_app`, Verse hides, app raised within 300 ms |+| K-07 | Losing focus clears held keys and stops Arc Storm | `VerseStage.tsx:725` (`blur`) | `AT`: focus loss while W and F held → commander stops, storm ends |+| K-08 | Focus loss pauses a running duel | `VerseStage.tsx:657-668,795` | `AT`: focus loss mid-match → match paused, resumes only on explicit resume |+| K-09 | Key map: WASD/arrows, Shift, V, 1/2/3, E, L, F (hold), B, +/-, F9 (dev) | `VerseStage.tsx:690-718` | `ST`: Enhanced Input mapping context contains each binding; `AT`: each fires its action |+| K-10 | Pointer lock released by the OS pauses the duel | `VerseStage.tsx:657-668` | `AT`: mouse capture loss mid-match → pause |+| K-11 | Workspace first, leaving is one key away; hidden pauses | product rule (README Hosting, `architecture.md` 1.2) | `GT`: from any state (menu, duel, takeover prompt) F10 returns to the app in ≤ 300 ms |++## 15. Extras++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| Z-01 | Sovereign skin: the commander's body in every view (deck, duel, first-person arms) | `actors/characters.ts:15-21`, `life/cast.ts:93` | `AT`: commander pawn mesh is the Sovereign skeletal mesh in deck, duel and first person; an install without it falls back to the officer body |+| Z-02 | Sovereign cloak: three spring columns, two segments, pitch lifts walking, roll swings on strafe/turn, hem lags on stop, flutter while moving | `actors/cloak.ts`, `abilities/sovereign.test.ts:36-90` | `AT`: port of the cloak tests (still at rest, lift on walk, sideways on strafe, lower lags upper) on the cloak bones `Cloak_{R,C,L}{1,2}` |+| Z-03 | First-person arms cut from the commander's own body; Sovereign sleeves black velvet with a gold cuff | `viewmodel/viewmodel.ts:11-17`, `viewmodel/ViewmodelLayer.tsx:39-43` | `AT`: first-person arms use the commander mesh's arm section; `SS` GPU arms on the reference shot; gold only on the cuff |+| Z-04 | Arms hang loose and swing with the walk on the deck; never sink into walls; do not stretch with FOV | `viewmodel/viewmodel.ts:7-10,22-24` | `AT`: arms drawn with own FOV; facing a wall at 0.1 m no arm pixel is hidden by it |+| Z-05 | Arc Storm: hold F, lightning from both hands toward the aim; arms rise; bolts re-strike many times a second; light flickers; sparks where they land | `abilities/arcStorm.ts`, `actors/ActorsLayer.tsx:240-251` | `AT`: hold F → storm level rises, both hand sockets emit, aim follows the view at eye level and the body's facing in overview; release → fades |+| Z-06 | Arc Storm bolt geometry: from hand to target, fixed segment count, near the line, same seed same bolt | `abilities/sovereign.test.ts:5-33` | `AT`: port of the three bolt tests on the Niagara beam's control points |+| Z-07 | Arc Storm sound: low hum plus crackle that jumps with each strike; silent without audio | `abilities/arcSound.ts` | `AT`: audio log has hum on press, crackle level tied to strikes, stop on release |+| Z-08 | Arc Storm colour follows the palette | `abilities/arcStorm.ts:2-8` (violet-white today) | **[changed]** `SS`: palette check finds no violet or cyan; core cool white, glow from the allowed accents (README "Look") |+| Z-09 | Hoverboard on B: folds out, glide 5.5 m/s, speeds up toward the held direction, coasts to a stop, loses speed on a wall, hover bob, lean into speed and turns; notice on/off | `actors/hoverboard.ts:18-19`, `actors/hoverboard.test.ts`, `VerseStage.tsx:414-422` | `AT`: port of `hoverboard.test.ts`; top speed 550 cm/s ± 5 %; localized `verse.board.on/off` |+| Z-10 | Arc Storm and hoverboard never in the duel | `VerseStage.tsx:415`, `ActorsLayer.tsx:241` | `AT`: in arena mode F and B do nothing and the board folds away |+| Z-11 | Earth view outside the hull: Earth in low orbit below and ahead of the viewports, sun, stars; turns at about orbital speed; no parallax walking past a window | `engine/realtime/spaceView.ts:1-13,64,345` | `AT`: Earth actor rotation rate equals today's `ORBIT_RAD_PER_S × orbitSpeed` ± 5 %; space rendered at infinity (sky sphere / separate scene capture); `SS` from each deck's viewport |+| Z-12 | Space only through glass; gaps the deck left open are painted hull dark | `engine/realtime/hullMask.ts` | `SS`: per deck, no star or Earth pixel outside glass masks on 6 reference shots |+| Z-13 | Earth textures from NASA public-domain imagery (day, night lights, clouds, relief) | `scripts/verse/earth.py` | `ST`: Unreal Earth textures cite `art/verse/LICENSES.md` rows; the GEBCO elevation terms are checked and recorded in the ledger (`contracts/art-pipeline.md` 11) |+| Z-14 | Deck ambience loops, quiet; stop while hidden; volume setting; app-wide UI sound off silences the Verse | `audio/useStageAudio.ts`, `audio/verseAudio.ts:12-14` | `AT`: each deck plays its loop; `Dormant` mutes; volume 0 silences; **[gap]** `settings.changed {ui_sound:false}` mutes |+| Z-15 | Sound variants and random pitch/level, never the same take twice in a row; placed sounds panned and attenuated | `audio/verseAudio.ts:7-12`, `audio/verseAudio.test.ts` | `AT`: 20 plays of a cue never repeat a variant consecutively |+| Z-16 | Recorded CC0 sounds credited | `public/verse/audio/CREDITS.md`, `public/THIRD_PARTY_NOTICES.txt:571-576` | `ST`: every Unreal sound wave cites a ledger row; notices updated |++## 16. The duel (app-level parity)++The reactor duel's mechanics are replaced, not ported (README). Its rules+live on in `contracts/combat-state.md` and `contracts/bot.md`; these rows only+hold what the app and the person rely on.++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| D-01 | Duel start panel: what it is, three opponents, controls; choosing starts at once | `hud/DuelPanel.tsx` | `AT`: panel lists normal, hard, elite and adaptive with the controls table; choosing starts the match |+| D-02 | Last difficulty remembered and focused (default hard) | `VerseStage.tsx:748`, `duel/duelController.ts:51` | `AT`: relaunch → last tier focused |+| D-03 | Entry from the tool rail (Duel button) | `VerseStage.tsx:986` | **[changed]** `AT`: the Verse bar's quick start (the in-Verse tool rail, WP18.7) starts the duel; `BT`+`GT`: the web launcher card's quick start → `POST /api/verse/show {reason:"quick_start_duel"}` → `lifecycle.show {reason:"quick_start_duel"}` → commander in the hangar, arena mode on, match running |+| D-04 | Entry from the world (arena marker, ring consoles) | `VerseStage.tsx:412-421`, `hud/duelDiscovery.test.tsx` | **[changed]** `AT`: armoury station has a marker visible from overview and near it; E opens D-01 |+| D-05 | Started elsewhere, the lift rides to the arena deck first, then the match starts once the scene is there | `VerseStage.tsx:767-783` | `AT`: start from bridge → ride to hangar, match starts after the arena is loaded |+| D-06 | No duel in the compact panel | `VerseStage.tsx:418,986` | `GT`: no duel entry in `Panel` state |+| D-07 | Overview switches to a person view on start | `VerseStage.tsx:756` | **[changed]** `AT`: first person forced in the duel (README "Camera"); third person only in kill cam and finisher |+| D-08 | Hidden stage pauses the match | `VerseStage.tsx:795` | `GT`: `lifecycle.hide` mid-match → paused; `show` → pause menu, not running |+| D-09 | Escape mid-match pauses; pause menu resume / leave | `VerseStage.tsx:575-578`, `hud/DuelHud.tsx` | `AT` |+| D-10 | Result screen with rematch; leave mid-match says so | `hud/DuelHud.tsx`, `VerseStage.tsx:796-800` | **[changed]** endless mode in sets of first to 10: `AT`: each set end shows the end-of-set screen (kills, deaths, headshots, finishers, adaptive `s`); leave shows the session summary and "again"; mid-set leave shows `verse.duel.notice.left` and sends the `unfinished` result (W-08) |+| D-11 | Leaving puts the commander back on the deck where the duel ended, keys cleared, camera reframed | `VerseStage.tsx:784-793`, `ActorsLayer.tsx:231-238` | `AT`: leave → arena mode off, commander on walkable floor near the armoury |+| D-12 | HUD: score, clock, own health, crosshair with spread, hit markers (headshot distinct, kill), damage direction arcs, call-outs, countdown and banners | `hud/DuelHud.tsx:2-12`, `hud/duelHud.test.tsx` | `AT` against `contracts/combat-state.md` HUD fields; ammo replaces heat |+| D-13 | Crew hidden inside the arena; the rest of the deck unchanged | `ActorsLayer.tsx:254-256` | Same as B-08 |+| D-14 | Mouse look shared with the deck views (sensitivity, invert, FOV) | `VerseStage.tsx:285-298` | V-10 |+| D-15 | Fair perception: no bot shot without a sighting or a heard/believed position | `combat/observe.ts`, `combat/bot/bot.test.ts:32-46` | `GT`: `contracts/bot.md` F4 fire audit, 0 unclassified shots |+| D-16 | Balance gates: no single trick beats hard; skilled model about 40 % vs elite; higher tier wins more, never always | `combat/harness/balance.ts`, `combat/harness/exploits.test.ts` | `GT` (`unreal-gauntlet`): gates of `contracts/bot.md` §10-11 green |+| D-17 | Duel sound set preloaded on entry | `audio/verseAudio.ts` `preload` | `AT`: no cue missing on the first shot (audio log) |+| D-18 | Duel result reaches progression | none today | W-08 |++## 17. Settings++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| T-01 | Settings panel: sensitivity, invert Y, FOV third, FOV first, volume, quality, reset; apply at once | `hud/ViewSettingsPanel.tsx`, `viewSettings.ts:38-41` | `AT`: each control changes the live value; reset restores sensitivity 1, invert off, quality auto, FOV 70/85, volume 0.7, view third |+| T-02 | Current render tier shown in the panel | `VerseStage.tsx:1001` | `AT` |+| T-03 | Stored settings survive restarts; bad stored values read as valid | `viewSettings.ts`, `eyeLevelGame.test.tsx:251-261` | `AT`: corrupt the settings file → defaults, no crash |+| T-04 | New settings: gore full/reduced, return key | README "Gore", architecture §1.2 | `BT`: `settings.gore`, `settings.return_key` in `welcome`; `settings.changed` applies live |++## 18. i18n++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| N-01 | Five locales: en, de, es, pt, zh | `src/i18n/locales/ship/verse.{en,de,es,pt,zh}.json` | `ST`: every string id the Unreal UI uses exists in all five files |+| N-02 | Keys: 206 under `verse.*` (stage, deck, state, crew, station, card, post, tools, settings, lift, notice, screen, launcher, games, duel, board, takeover) and 142 under `verse.ranks.*` | `src/i18n/locales/ship/verse.en.json`, `ranks.en.json` | `ST`: Unreal string table ids ⊆ these files; no hard-coded user-facing English in `unreal/**` (scan of `FText::FromString`/`NSLOCTEXT` literals) |+| N-03 | Strings come from the app, a string change needs no Verse rebuild | `useLocaleChunk("ship")` | `BT`: edit a value in `verse.de.json` → `welcome.locale.strings` carries it; `AT`: UI shows it |+| N-04 | Live language change | `src/i18n` `useT` re-render | `BT`+`AT`: `settings.changed {lang, strings}` re-texts every open widget without a restart |+| N-05 | German umlauts and deck names render | `hud/duelDiscovery.test.tsx:109` | `SS`: a German-locale shot with the umlaut and sharp-s glyphs (U+00E4, U+00F6, U+00FC, U+00DF) renders with no tofu; zh shot renders CJK (font fallback in the UI font asset) |+| N-06 | Placeholders `{n}`, `{count}`, `{reason}` filled | `src/i18n` `fill` | `AT`: every key with a placeholder renders with sample values and no braces left |+| N-07 | App-level Verse strings stay in the app | `src/i18n/locales/*.json` (`society.shell.mode_verse`, `society.world.mode_map`, `ide_side_panel.office.*`, `ide_threads.layout_verse`) | `VT`: launcher card and panel use these keys plus new `verse_host.*` keys in all five locales |++## 19. QA hooks++Today's hooks live on `window`; three of them (`__verseStats`, `__verseDuel`,+`__verseView`) ship in built bundles. Their successors are console commands+in Development and Test builds and, in Shipping, the same commands reached+through a bridge `qa.exec` frame that the backend only accepts when it runs+with `DODAIOS_VERSE_QA=1` **[gap]**.++| Id | Feature | Today | Unreal acceptance check |+|---|---|---|---|+| Q-01 | Frame numbers | `__verseStats` (`VerseStage.tsx:210`) | `AT`: `Verse.QA.Stats` → JSON `{fps, frame_ms, tier, state}`; `BT`: reachable in Shipping via `qa.exec` with the flag, refused without |+| Q-02 | Stage handle: runtime, camera, actor poses, live crew, set duty (dev) | `__verse` (`VerseStage.tsx:211-219`), `life/devOverrides.ts` | `AT`: `Verse.QA.Dump` (camera, every pawn pose, crew statuses) and `Verse.QA.SetDuty` |+| Q-03 | Duel driver: start(tier), leave, place, look, hold, press, state | `__verseDuel` (`VerseStage.tsx:804-819`) | `AT`: `Verse.QA.Duel.{Start,Leave,Place,Look,Hold,Press,State}`; a harness test drives a full session with them, no mouse |+| Q-04 | Duellist bodies' animation state | `__verseDuelBodies` (`duel/figure.ts:125-128`) | `AT`: `Verse.QA.Duel.Bodies` |+| Q-05 | View driver: set, look, zoom, state (person, distance, hfov, yaw, pitch, commander hidden, locked) | `__verseView` (`VerseStage.tsx:822-837`) | `AT`: `Verse.QA.View.{Set,Look,Zoom,State}` with the same state fields |+| Q-06 | Post and material tuning, loaded material names | `__verseTune`, `__verseMaterials` (`engine/realtime/RealtimeBackdrop.tsx:73-99`) | `AT`: `Verse.QA.Tune` (exposure, bloom) and `Verse.QA.Materials` |+| Q-07 | Space look override and state | `__verseSpace`, `__verseSpaceState` (`spaceView.ts:91`, `RealtimeBackdrop.tsx:169`) | `AT`: `Verse.QA.Space.{Set,State}` |+| Q-08 | Viewmodel layout retune (dev) | `__verseViewmodel` (`viewmodel/ViewmodelLayer.tsx:58`) | `AT`: `Verse.QA.Viewmodel` (non-shipping) |+| Q-09 | Content override for every deck (dev) | `?verseContent=` / `localStorage verse.content` (`content/useDeck.ts`) | `AT`: `-VerseDeck=<id>` command line (non-shipping) |+| Q-10 | Duel on any deck (testing) | `localStorage verse.duel.anyDeck` (`VerseStage.tsx:131-138`) | Retired: the arena is part of the hangar. `ST`: no such switch exists |+| Q-11 | Alignment overlay on F9 (dev) and frame readout | `engine/DebugOverlay.tsx`, `hud/DeckBar.tsx` `StatsReadout` | `AT`: `Verse.Debug.Overlay` toggles nav, sockets and station markers (non-shipping); `stat unit` readout |+| Q-12 | Headless check without pointer lock | `__verseView` docstring (`VerseStage.tsx:821`) | `GT`: the whole of sections 13-16 runs under `-nullrhi` with QA commands only |++## 20. Contract gaps to close first++These rows depended on messages or config the first contract draft lacked.+All are now in `contracts/bridge-protocol.md` §14 (and the `busy` error code+in §2); the "Proposed addition" column is what §14 defines.++| Gap | Rows | Proposed addition |+|---|---|---|+| Open the agent ledger | S-02 | Command `agents.open_list {}` → `VerseOpenRequested {target:"agents"}` |+| Open a group | S-03 | Command `group.open {group_id}` |+| Simulator programmes | S-07, W-06 | Command `simulator.open {programme}`; the arcade stays web code and reports its own rounds |+| Launcher batch control | X-04, X-06 | Reply `busy` for a second `launcher.start`; command `launcher.cancel {}`; command `ide.open {}` |+| Pane changes view | X-08 | `pane.open` gains optional `open: "changes"` |+| Seen-award marker | F-13 | Backend keeps the last told award seq per person; `progression.snapshot` carries `told_seq` |+| Companion pet | F-14 | Topic `companion` with `{pet_id, look}` from the pets endpoint and the overlay style |+| Settings moved out of browser storage | F-18, R-12, V-21, T-01, Z-14 | Config keys `verse.view.*`, `verse.uniform`, `verse.level_sound`, plus `ui_sound` in `welcome` and `settings.changed`. One-time import: on first `show`, the web app posts `dodaios.verse.view.v1`, `dodaios.verse.uniform.v1`, `jarvis.verse.level.sound.v1`, `jarvis.verse.levels.seen.v1` and `jarvis.office.arcade.asteroids.best` from its localStorage to `POST /api/verse/settings/import` |+| QA in Shipping | Q-01..Q-12 | Frame `qa.exec {command}` accepted only with `DODAIOS_VERSE_QA=1` |++## 21. The deletion pull request++Opened only after `parity_report.py` prints `N/N`. One PR, title+"Remove the three.js Verse". It must leave `npm run build`, the frontend+tests, the Python tests and `scripts/agent_done_gate.py` green, and it must+be visible in the running app: the Verse tab and the IDE panel open the+Unreal Verse.++### 21.1 Removed++| Path | What it is |+|---|---|+| `dodaios/ui/web/frontend/src/components/society/verse/` (whole folder, 27.6k lines, 53 test files) | The three.js Verse: stage, engine, actors, life, nav, effects, hud, ranks, duel, combat, viewmodel, abilities, audio, content, testing |+| `dodaios/ui/web/frontend/src/components/society/crewFeeds/` | Verse-only feed hooks (desk chats, pane screens, team rounds, coding floor, navigate); no importer outside the Verse. `openPaneSession` moves first (21.2) |+| `dodaios/ui/web/frontend/public/verse/decks/`, `characters/`, `space/`, `loading.webp` | Cooked plates, AVIF tiles, `scene.glb`, lightmaps, nav PNGs, glTF characters, Earth WebP, loading art |+| `dodaios/ui/web/frontend/public/verse/audio/` | Removed once the same CC0 files are imported into `unreal/Verse/Content` with ledger rows (Z-16); `CREDITS.md` moves with them |+| `scripts/verse/cook.py`, `_cook_entry.py`, `package.py`, `package_realtime.py`, `_realtime_entry.py`, `eyeview.py`, `_eyeview_entry.py`, `closeup.py`, `_closeup_entry.py`, `avif_test.py`, `meshopt_pack.mjs`, `textures.py`, `validate.py` | Plate and realtime glTF cook for three.js. `blender.py`, `_bootstrap.py`, `mcp_bridge.py` and `earth.py` stay if `export_unreal.py` uses them (`contracts/art-pipeline.md` §2) |+| `art/verse/lib/cook.py`, `plate_post.py`, `realtime.py`, `navgrid.py`, `lightmap.py` | three.js-only cook stages (plate, glTF export, nav PNG, lightmap bake). Builders, kit, characters, schema, `LICENSES.md`, style bible stay |+| `art/verse/decks/*/` plate and nav outputs | Only generated plate/nav files; deck builders stay |+| `docs/verse/realtime.md`, `docs/verse/pipeline.md`, `docs/verse/combat.md`, `docs/verse/sovereign.md` | Docs of the removed runtime. Their doctrines already live in `contracts/` (combat, bot); `docs/verse/README.md` is rewritten to point at `docs/verse/unreal/` |++Kept on purpose: `src/i18n/locales/ship/*.json` (the backend serves them to Unreal, N-03), `art/verse/` builders, kit, characters, schema, `LICENSES.md` and style bible, `src/components/society/progression/` and `arcade/`.++### 21.2 Frontend references to rewire++| File | Today | After |+|---|---|---|+| `src/views/DodaiosAgentsView.tsx:8-9` | Renders `VerseStage`, `VerseLoadingScreen` | Renders the Verse launcher card (status from `GET /api/verse/status`, show/stop, unsupported, crashed) and calls `POST /api/verse/show` while the tab is active |+| `src/views/DodaiosAgentsView.test.tsx:8` | Mocks `VerseStage` | Mocks the launcher card |+| `src/views/society/SocietyView.tsx:36-37` | `VerseLoadingScreen`, `preloadLoadingArt` as lazy fallback | Plain fallback; no Verse art preload |+| `src/views/society/SocietyView*.test.tsx` | Tab `society.shell.mode_verse` | Unchanged label; assert the card instead of the stage |+| `src/components/agentic/sidePanel/OfficeTab.tsx:5,9,57` | Lazy `VerseStage compact initialDeck="engineering"` | Pixel Streaming view component (`panel.visibility`, `panel.resize`, signalling on `WS /api/verse/signal`) with the no-GPU card fallback |+| `src/components/agentic/sidePanel/IdeSidePanel.test.tsx:19,275` | Mocks `VerseStage` | Mocks the stream view; keeps "Dodaios Verse tab shows engineering" |+| `src/components/agentic/threads/IdeLayoutSwitch.tsx:12-68` | "verse" maximizes the side panel | Same switch; maximized panel hosts the stream, or (decision of the bridge package) sends `show` for the full window |+| `src/components/society/progression/cosmetics.ts:13`, `progressionApi.ts:12`, `progressionStore.ts:16`, `useProgressionSync.ts:16-17`, `verseDecks.test.ts:11` | Import `../verse/ranks/ranks` (`RANK_TIERS`, `isPromotion`) and `../verse/decks` (`DECK_IDS`) | Move `ranks/ranks.ts` (pure, no three.js) to `src/components/society/progression/ranks.ts` and `decks.ts` to `progression/decks.ts` before the deletion; re-point the imports. `useProgressionSync` (world actions, bell) loses its Verse-only half: `daily_visit` and `deck_discovered` are reported by Unreal (W-01, W-02) |+| `src/components/society/progression/useProgressionSync.ts:90-91` | Reports `daily_visit`, `deck_discovered` | Removed (Unreal reports them); the award listener stays for the app's own level UI |+| `src/components/society/progression/levelSounds.ts`, `progressionStore.ts:158` | localStorage settings | Read once for the import (section 20), then from config |+| `src/components/society/crewFeeds/codingNavigate.ts` `openPaneSession` | Used by the Verse's crew card | Moves to `src/components/agentic/openPaneSession.ts`; the `VerseOpenRequested` bus handler calls it |+| `src/components/society/arcade/*` | Opened only by `hud/SimulatorPanel.tsx` | Opened by the `simulator.open` handler (section 20); keeps its own round reports |+| `src/lib/liveTerminals.ts` presenter API (`presentTerminal`, `registerTerminalPresenter`) and `src/components/agentic/presentedRenderer.ts` | Let the Verse takeover borrow an xterm | Removed with their tests if no other presenter registers (grep `registerTerminalPresenter`); `registerLiveTerminal` stays if the IDE uses it |+| `src/components/agentic/AgenticTerminal.tsx:1211,1398,1584,1827,2019,2127,2512` and `AgenticTerminal.offscreen.test.tsx:204` | "Verse window" reader paths (borrowed xterm, parked bytes, fit observer) | Removed with the presenter; tests for these paths removed |+| `src/components/agentic/ideHotkeys.ts:448` | "type without focusing the pane (the Verse types into a hidden pane)" | Option removed if the takeover was its only caller |+| `src/views/AgenticIdeView.tsx:96` | Comment on the maximized Verse panel | Comment updated |+| `src/i18n/index.ts:215` | Registers chunk `ship` for the stage | Chunk no longer loaded by the web app; the files stay for the backend (N-03); keys used by nothing on the web are exempt from the web key-usage check |+| `src/hooks/useCanvasAwake.ts`, `useWebglSurface.ts`, `src/lib/graphDimension.ts` | Shared with other 3D views | Stay (other importers: mars, world, wiki graph) |+| `package.json` | `three`, `@react-three/fiber`, `@react-three/drei` | Stay (used elsewhere); `three-mesh-bvh` is reached through drei and needs no change |++### 21.3 Backend, tests, CI and packaging to rewire++| File | Today | After |+|---|---|---|+| `dodaios/progression/rules.py:49-51,183-184` | Comments point at `verse/decks.ts` and `verse/ranks/ranks.ts` | Point at the Unreal DataAssets' text sources (`unreal/Verse/Config/` or the exported JSON the `ST` checks read) |+| `tests/unit/progression/test_frontend_parity.py:4,74-96` | Reads `verse/ranks/ranks.ts`, `verse/decks.ts` and the `ship` chunk | Reads the moved `progression/ranks.ts` / `decks.ts` and the Unreal rank and deck data (R-01, B-01) |+| `dodaios/ui/web/frontend/src/components/society/progression/verseDecks.test.ts` | `DECK_IDS` vs `VERSE_DECKS` | Re-pointed to `progression/decks.ts` |+| `dodaios/ui/web/server.py:73-80` | MIME types `.avif`, `.glb`, `.hdr` for Verse plates and models | Removed if no other static file needs them (grep the dist for each suffix) |+| `dodaios/ui/web/frontend/public/THIRD_PARTY_NOTICES.txt:571-576` | Verse sound credits under `public/verse/audio` | Re-pointed to the Unreal content path, shipped with the Verse payload |+| `scripts/ci/repo-junk-allowlist.txt:11-12` | Allows `public/verse/decks/*/realtime/scene.glb` | Lines removed |+| `.gitignore:528-533` | Verse cook outputs and `public/verse/decks/testbed/` | Replaced by the `unreal/` ignores (architecture §8.1); `art/verse/.cache/` stays |+| `dodaios/core/events.py:2578-2596`, `dodaios/memory/write_feedback.py:12`, `dodaios/progression/__init__.py:1` | Docstrings mention the Verse animating awards | Text only; updated to "the Unreal Verse via the bridge" |+| `dodaios/ui/web/progression_routes.py:4,64,100` | Actions reported "from the Verse" | Unchanged code; the bridge relay calls the same service in-process |+| New: `dodaios/verse_host/`, `dodaios/ui/web/verse_routes.py`, `tests/unit/verse_host/` | n/a | Land before parity (architecture §1.1); listed here because the deletion PR must not touch them |+| Installer and updater (`dodaios/core/installer_update.py:106`) | 1.5 GB cap; no Verse payload | Cap raised and Verse delta packages wired (README "Delivery") before the deletion PR |++## 22. Row count++245 rows in sections 2-19 (A 13, B 8, L 7, F 19, C 24, S 18, X 11, W 8, E 15, H 14, R 14, V 26, K 11, Z 16, D 18, T 4, N 7, Q 12).diff --git a/docs/verse/unreal/work-packages.md b/docs/verse/unreal/work-packages.mdnew file mode 100644index 0000000000..1280667939--- /dev/null+++ b/docs/verse/unreal/work-packages.md@@ -0,0 +1,1189 @@+# Verse on Unreal: work packages++The 22 fan-out packages that build the Unreal Verse. Read `README.md`+(decisions) first, then your package below, then every contract it lists.+Facts about today's code carry a file reference; everything else here is a+plan decision.++## 0. Rules for every package++### 0.1 Ids, branches, pull requests++| Item | Rule |+|---|---|+| Package id | `WP01` to `WP22`. Placement JSON `owner` fields, import records and PR bodies use this id |+| Sub-task id | `WP<nn>.<k>`. One sub-task is one agent and one PR, sized to land in about a day of agent work |+| Branch | `claude/verse-wp<nn>-<k>-<slug>` (matches the `claude/verse-wp<nn>-*` rule `validate_ownership` reads, art-pipeline 9) |+| PR title | Conventional Commits, `type(verse): subject`, lower case, imperative (`feat(verse): add the slide move`); after landing a branch with several commits, `gh pr edit <n> --title` (architecture 8.4) |+| PR body | First line `Work-Package: WP<nn>`; second line `Sub-task: WP<nn>.<k>`; then the evidence block of `orchestration.md` 5.5 |+| Commits | English, no names of other games, studios, franchises or real firearm makes or models anywhere (README Legal; `unreal-static` scans) |++### 0.2 Ownership++| Rule | Detail |+|---|---|+| Exclusive paths | Each package writes only the paths listed under "Owned". Two packages never own the same file. A path not listed anywhere belongs to the integration owner; that includes `scripts/unreal/**` except the scripts a package lists |+| QA commands | The `Verse.QA.*` console commands of `parity.md` section 19 are registered in the Core `UVerseQaRegistry` (G0.3). Each package implements the commands of its own area in its own `Private/QA/` folder (Crew `SetDuty`, Combat `Duel.*`, Decks `View.*`, `Space.*`, UI `Stats`); WP17 owns the `qa.exec` bridge path |+| Art records | An import record (`unreal/Verse/Art/Import/**`) or MI recipe (`unreal/Verse/Art/Materials/**`) belongs to the package that owns the content folder of its asset (`contracts/art-pipeline.md` 9); placement JSON belongs to the zone owner (section 3) |+| Module split | Several packages share a C++ module; they own disjoint subfolders `Public/<Area>/` and `Private/<Area>/` of it. `<Module>.Build.cs` and the module startup file (`<Module>Module.cpp/.h`) belong to the integration owner |+| Tests | Each package owns `Private/Tests/<Area>/` inside its subfolders and `unreal/Verse/Content/Verse/Test/WP<nn>/` for fixture maps and test assets |+| Zones | Deck zones and their owners are in section 3; a zone owner writes only actors tagged `verse.zone:<zone>` (art-pipeline 9) |+| Data | Tuning JSON under `unreal/Verse/Data/<area>/` belongs to the listed package. Files marked "propose-only" are frozen by a contract change rule: the package edits them in its PR, the integration owner merges with the gate run the contract asks for |+| Contracts | Nobody but the integration owner edits `docs/verse/unreal/contracts/**`, `unreal/Verse/Source/VerseCore/**`, `unreal/Verse/Source/Verse/**`, `*.Build.cs`, `*.Target.cs`, `Verse.uproject`, `Config/Default*.ini`, `LV_<Deck>.umap`, data layers, every `.gitattributes`, `.gitignore` and `.lfsconfig`, `.githooks/**`, `scripts/unreal/fake_bridge.py` and the golden fixtures. A package that needs a change opens a request naming the item, the reason and the consumers (`orchestration.md` 3.4) |++### 0.3 Parallel work against stubs++Every package can start the day G0 lands (section 1). Where a package needs+another package's runtime behaviour, it codes against the frozen contract+and a fake it writes itself:++| Rule | Detail |+|---|---|+| Stubs and fakes | G0 ships a null stub of every contract interface in `VerseCore` (`orchestration.md` 0.3), so everything builds from day one. A package that needs richer behaviour writes its own fake in `Private/Tests/<Area>/Fakes/`, named `FFake<Interface>` or `AFake<Class>`, compiled only `WITH_DEV_AUTOMATION_TESTS`. Fakes implement the contract interface exactly; no extra methods |+| Conformance | The producing package ships `Verse.Contract.<Interface>.*` tests. When the real producer lands, the consumer re-runs its acceptance tests against it; that run is the package's final acceptance |+| Synthetic events | `UVerseEventHub` is in Core from G0, so any package can drive itself by publishing contract event structs from a test (Gore, UI, Audio, Bot do this) |+| Bridge | G0.11 ships `scripts/unreal/fake_bridge.py` with the golden fixtures of every `verse.bridge/1` message and scripted scenarios; Unreal packages that read feeds test against it, never against a live app |+| Placeholder art | Box and capsule meshes from `Content/Verse/Test/WP<nn>/`, the G0 test skeleton `SK_Test_Human` (frozen bone names, crude mesh). Never engine sample content (art-pipeline 12.3) |+| Builds | Only through `scripts/unreal/build.py`, which takes the machine-wide GPU-heavy lock (architecture 8.2). Never UBT, UAT, Blender or UnrealEditor directly |++### 0.4 Evidence++Every PR attaches what its package lists under "Evidence". Files go to+`unreal/Verse/Saved/Harness/proof/WP<nn>/<sub-task>/` (ignored; never a+folder named `evidence` or `screenshots`, architecture 8.4) and are uploaded+as CI artifacts: screenshots as PNG from `scripts/unreal/screenshot.py`+(G0.6; WP10.8's `capture.py` adds scripted cameras and the palette+measurement on top), metrics as JSON, test results as the automation report+JSON. A visible change without a screenshot of the running build is not done+(architecture 8.3). An acceptance row that names only a test asserts exactly+what the row's sub-task output says, with the numbers this file states.++### 0.5 Repo gates++Every package follows the repo gate rules of architecture 8.4: no `.fbx`,+`.wav`, `.exr`, `.gif` or video committed; no folder named `Build` (outside+`unreal/Verse/Build/`), `Models`, `Env`, `Logs`, `Dist`, `Secrets`,+`Video`, `Renders`, `Evidence`, `Recordings` or `Screenshots`; English only in+every text file including `Config/*.ini`; no user-profile paths or email+addresses in docs; no `CLAUDE.md` under `unreal/`, `art/` or `docs/`; LFS+objects pushed with the branch.++## 1. G0: foundation before fan-out (integration owner, not a package)++| # | Item | Why everyone needs it |+|---|---|---|+| G0.1 | VS 2022 Build Tools with the MSVC and Windows SDK versions 5.7 needs (not installed on the dev box on 2026-11-02), the Linux cross toolchain, git-lfs, `unreal/Toolchain/toolchains.json`, `scripts/unreal/doctor.py` | Nothing compiles without it |+| G0.2 | Contracts frozen; the conflicts of section 4 are decided in the contracts | Packages code against them |+| G0.3 | `VerseCore`: coordinate module and golden file, gameplay tags (including every `Noise.*` tag of bot 3.2), log categories, `VerseRng`, all contract structs and enums (including `FVerseInputFrame`, `FVerseGadgetEvent`, `FVerseArenaSwitchEvent`, `FVerseStationUsedEvent`, `FVerseSetSummary`), DataAsset schemas (weapon, gadget, melee, tier, adaptive, penetration, audibility, destruction tuning), `UVerseEventHub` with every delegate of combat-state 11.1, `UVerseQaRegistry`, a null stub per contract interface | Shared types |+| G0.4 | Primary module `Source/Verse/` (game instance, default pawn with `UVerseCombatStateComponent`, default classes, `UVerseSettings`); `VerseHarness` only in `VerseEditor.Target.cs`; `VerseServer.Target.cs` deleted (decision C7) | Today's targets list Harness in the Game and Server targets and no primary module exists (`unreal/Verse/Source/*.Target.cs`) |+| G0.5 | Every `*.Build.cs` with exactly the DAG edges of architecture 2; `scripts/unreal/check_build_dag.py` | Rule 1 of the DAG |+| G0.6 | `scripts/unreal/build.py`, `with_lock.py`, `test.py`, `screenshot.py`, `smoke.py`, `worktree.py` (`orchestration.md` 0.5) | Only build, test and capture entry |+| G0.7 | Art pipeline entry points (art-pipeline 2): `export_unreal.py`, `import_art.py`, `check_art_text.py`, `verse_pipeline/*`, `fbx-ue/1` calibration green, `unreal/Verse/.gitattributes` (art-pipeline 10.2) | Every art package |+| G0.8 | Empty World Partition levels `LV_Bridge`, `LV_Ops`, `LV_Engineering`, `LV_Hangar` with data layers `DL_<Deck>_Base`, `DL_Hangar_Day`, `DL_Hangar_Arena`; project collision profiles and trace channels | Zone owners place into them |+| G0.9 | `SK_Test_Human` placeholder skeleton with the frozen bone names of art-pipeline 12.1 | Movement, combat, gore tests before WP13 |+| G0.10 | First `unreal-static` and `unreal-build` lane runs, wired into `CI gate` (architecture 8.2, handed to WP10 afterwards) | A green lane is the done signal |+| G0.11 | Golden JSON fixtures for every `verse.bridge/1` message (including section 14), binary `cells.bin/1` codec vectors, `scripts/unreal/fake_bridge.py` with scripted scenarios (roster churn, busy panes, meetings, awards, lifecycle, panel), in `tests/unit/verse_host/fixtures/` and `unreal/Verse/Tests/Data/bridge/` | WP15, WP16, WP18, WP20, WP21 start on day one instead of waiting for WP17 |+| G0.12 | Repo hygiene of architecture 8.4: `unreal/Verse/.gitignore` (with `!Build/`), `.lfsconfig`, `unreal/** export-ignore`, the guarded `git lfs pre-push` line in `.githooks/pre-push`, `git lfs push` in `scripts/agent_land.py`, `scripts/unreal/forbidden_names.sha256`, today's `unreal/Verse/.gitattributes` reduced to art-pipeline 10.2 (no `.fbx`, `.wav`, `.exr`, `.glb` lines) | Without it the first Unreal PR fails the junk gate or pushes pointers without objects |+| G0.13 | Baselines and pilot (`orchestration.md` 0.8, 0.9) | Proves the pipeline before 22 packages use it |++## 2. Packages++### WP01 Movement++**Goal.** A networked, predicted first-person character with walk, sprint,+crouch, prone, lean left/right, slide, jump and mantle, whose hit bodies move+with every stance.++**Owned.** `unreal/Verse/Source/VerseMovement/**` except `Public/Anim/`,+`Private/Anim/` (WP13); `unreal/Verse/Data/movement/*.json`;+`unreal/Verse/Content/Verse/Movement/**`; `unreal/Verse/Content/Verse/Test/WP01/**`.++**Contracts consumed.** `coordinates.md` (all); `combat-state.md` 2.1 (stance,+lean `int8`, sprint/airborne/mantling flags, `IVerseMovementQuery`), 11.1+(`FVerseInputFrame`, `FVerseNoiseEvent`);+`bot.md` 3.1 (eye moves with stance and lean), 3.2 (footstep, slide, land,+mantle noise ranges), 8.3 (bot drives movement through the same input);+`destruction.md` 6.1 (low breach mantle links); architecture 3.3.++**Depends on.** G0 only. Hit bodies use `SK_Test_Human` until WP13 lands.++**Start values** (tuning in `DA_MovementTuning`, not frozen): walk 4.5 m/s,+sprint 6.5 m/s, crouch 2.2 m/s, prone 0.9 m/s; slide entry from sprint at+5.5 m/s or more, boost to 7.5 m/s, decays to crouch in at most 1.1 s,+cooldown 1.0 s; jump apex 0.55 m; mantle low ledges 0.5-1.2 m in 0.45 s, high+1.2-2.0 m in 0.85 s; lean camera offset 35 cm with 12 deg roll, enter 0.15 s;+prone enter 0.7 s, exit 0.6 s, turn cap 90 deg/s.++| # | Sub-task (one agent) | Output |+|---|---|---|+| 1.1 | `AVerseCharacter` and `UVerseCharacterMovement` scaffold; `IVerseMovementQuery`; `DA_MovementTuning` loaded from JSON | Class, interface, importer, unit tests |+| 1.2 | Input path: Enhanced Input mapping for the person, plus a server-side consumer of `FVerseInputFrame` so bot and model controllers use the identical path (`bot.md` B1) | Input component, test that both paths produce identical moves |+| 1.3 | Walk, sprint, crouch, jump with sprint as a compressed saved-move flag; sprint and mantle raise the "blocks firing" flag | Moves and flags |+| 1.4 | Prone: second half-height, horizontal prone body box, floor clearance checks, turn cap, transitions | Prone mode with tests |+| 1.5 | Slide: `MOVE_Custom` / `CMOVE_Slide`, entry rule, friction curve, decay to crouch | Slide mode |+| 1.6 | Mantle: shared ledge trace at move time on client and server, predicted `FRootMotionSource_MoveToForce`, low and high variants, mantle through a low breach link | Mantle with tests |+| 1.7 | Lean: quantised value in custom move data, camera offset and roll, spine drive value for WP13, wall check that stops leaning into geometry | Lean with tests |+| 1.8 | Noise: `Noise.Footstep.Walk/Run/Sprint`, `Noise.Move.Slide/Land/Mantle` as `FVerseNoiseEvent` on the hub (surface material for audio); crouch walk and prone crawl raise none | Noise events matching `bot.md` 3.2 |+| 1.9 | Fixture map `LV_Test_Movement`: ledges 0.5/1.0/1.5/2.0/2.1 m, 0.75 m crawl tunnel, 1.2 m crouch tunnel, slopes 30 and 46 deg, stairs, a 4 m drop, lean corners | Map under `Test/WP01/` |+| 1.10 | Netcode: correction counters per move kind; run in the netcode test (dedicated + 2 lagged clients) | Counters, test, report JSON |+| 1.11 | Hit-zone table: bone to `EVerseHitZone` map read from the physics asset; tests that lean and prone move the bodies | Table and tests |++| Id | Acceptance test | Pass |+|---|---|---|+| A1.1 | `Verse.Movement.Speeds` | Each stance's steady speed within 2 % of the DataAsset value on flat floor |+| A1.2 | `Verse.Movement.Mantle` | 1,000 seeded approaches on the fixture ledges: 0.5-2.0 m succeed at least 99.5 %; 2.1 m never mantles; time within 1 tick of the DataAsset |+| A1.3 | `Verse.Movement.Prone.Clearance` | Prone passes the 0.75 m tunnel; standing and crouch are blocked; prone never starts with less than 0.4 m clearance |+| A1.4 | `Verse.Movement.Slide` | Slide starts only from sprint at 5.5 m/s or more; ends in crouch within 1.1 s; second slide blocked for 1.0 s |+| A1.5 | `Verse.Movement.Lean.Wall` | Lean against a wall never puts the camera inside geometry (0 of 500 seeded corner poses) |+| A1.6 | Netcode smoke, 2 min, `PktLag=60 PktLagVariance=10 PktLoss=1` | At most 2 corrections per minute per client in total, at most 0.5 per minute from mantle and prone combined; lean value on the server equals the client's for every move |+| A1.7 | `Verse.Movement.InputParity` | Same `FVerseInputFrame` stream from a person and a bot controller gives the same capsule path within 0.1 cm over 60 s |+| A1.8 | `Verse.Movement.Noise` | Footstep audible ranges per stance match `DA_Audibility`; crouch walk and prone emit 0 events over 60 s |+| A1.9 | Cost | Movement for 2 pawns at most 0.3 ms server game thread per tick |++**Evidence.** Netcode report JSON with correction counts; screenshots of a+mantle, a slide and a lean in the fixture map; automation report.++### WP02 Weapons, recoil, projectiles, magazines++**Goal.** Server-authoritative, client-predicted firearms with magazines,+tactical and empty reloads, a learnable recoil pattern that really climbs,+visible 300 m/s bolts, lag-compensated per-bone hits, damage, and the two+start gadgets.++**Owned.** `Source/VerseCombat/{Public,Private}/{Weapons,Inventory,Projectiles,Damage,LagComp,Gadgets}/**`;+`unreal/Verse/Data/weapons/*.json` (including `gadgets.json`);+`unreal/Verse/Content/Verse/Combat/Abilities/**`;+`unreal/Verse/Content/Verse/Test/WP02/**`. `UVerseCombatStateComponent`+lives in `Damage/`.++**Contracts consumed.** `combat-state.md` 1-6, 11, 12, and 2.3 (gadgets);+`destruction.md` 2 (`IVersePenetrationQuery`, `IVersePieceDamage`); `bot.md`+3.2 (shot, reload and gadget noise tags); `coordinates.md`.++**Depends on.** G0 only. Fakes: WP01 (`IVerseMovementQuery`), WP03+(`TraceBolt` that returns no piece), WP13 (hit bodies: `SK_Test_Human`), WP14+(meshes: boxes), WP11 (ruleset `CanDamage` that allows all).++| # | Sub-task | Output |+|---|---|---|+| 2.1 | Weapon definition importer JSON to `DA_Weapon_*`, Graveline and Tallow start values, name check | Importer, two assets, diff test |+| 2.2 | `UVerseInventoryComponent`: slot fast array, equip and holster, owner-only replication | Component and tests |+| 2.3 | Magazine and reload state machine: tactical vs empty, commit fraction, cancel, chambered round, `FVerseReloadEvent` and reload noise | State machine and tests |+| 2.4 | Recoil: `FVerseRecoilState`, kick, accumulator, pull-down compensation, recovery; tests R1-R6 | Recoil code and tests |+| 2.5 | Spread, bloom, first-shot accuracy, seed derivation, server validation (30 cm origin, `sigma + 1.5 deg`) | Spread code and tests |+| 2.6 | Fire path: `ServerFire`, shot counter, `ClientConfirmShot`, predicted bolt reconcile and removal on `Rejected` | Prediction and netcode test |+| 2.7 | `UVerseProjectileManager`: 5 m per tick steps, latency advance capped at 250 ms, `MaxRange`, trace order pieces then bodies, penetration loop via `IVersePenetrationQuery` | Manager and tests |+| 2.8 | Lag compensation: 1 s per-bone ring buffer, 250 ms cap, query API reused by WP04 | Ring buffer and tests |+| 2.9 | Damage: `UVerseHealthSet`, GAS damage effect, zone multipliers, falloff, armor first, ruleset hooks, `FVerseDeathEvent` | Damage code and tests |+| 2.10 | Hub events Fire, Hit, Penetration, Death, Reload with the transports of combat-state 5.1 | Events and transport tests |+| 2.11 | Bolt presentation: own predicted bolt amber, opponent bolt red from `FVerseFireEvent`, impact VFX only from the cosmetic hit event; placeholder VFX until WP14.9 | Presentation component |+| 2.12 | Bulwark ability and actor (GAS, prediction key) per `combat-state.md` 2.3 | Ability, actor and tests |+| 2.13 | Breach charge ability and actor: plant, fuse, detonation through `IVersePieceDamage` with breach radius, pawn damage with self-damage per `combat-state.md` 2.3 | Ability, actor and tests |+| 2.14 | Skitter (SMG) and Longsight (DMR) data on the same schema, invariants green | Two assets |++| Id | Acceptance test | Pass |+|---|---|---|+| A2.1 | `Verse.Combat.Recoil.*` R1-R6 for every weapon asset | All green; full-magazine Graveline spray with no look input: `A_p` rises after every shot and ends at 50 % or more of the summed kick |+| A2.2 | `Verse.Combat.Damage.ZonesAndFalloff` | Table-driven, every weapon and zone at 0 m, start, mid, end and beyond, exact to 1e-4 hp. Graveline: 4 upper-torso hits kill at 25 m or less, 2 head hits kill |+| A2.3 | `Verse.Combat.FireRate` | Measured over a full magazine: Graveline 690 RPM within 1 %; Tallow never above 380 |+| A2.4 | `Verse.Combat.Reload.Times` | Tactical and empty reload times within 1 tick of the asset; tactical leaves magazine + 1; cancel before commit keeps the old magazine |+| A2.5 | `Verse.Combat.Projectile.Flight` | Speed 300 m/s within 0.5 %, zero drop over `MaxRange`, despawn at `MaxRange` plus at most 5 m |+| A2.6 | `Verse.Combat.Prediction.FireReconcile` (netcode test) | At 60 ms lag, predicted bolt origin within 1 cm of the server's; a rejected shot's bolt disappears within one round trip plus 1 tick; ammo count never diverges after reconcile |+| A2.7 | `Verse.Combat.LagComp.Rewind` | A target strafing at 6.5 m/s is hit at 60, 120 and 250 ms lag when the client aim was on it; at 300 ms the rewind clamps to 250 ms |+| A2.8 | Cost | 64 bolts in flight: projectile manager at most 0.2 ms server game thread per tick |+| A2.9 | Forbidden-name scan over `Data/weapons/*.json` and `DA_Weapon_*` | 0 hits |+| A2.10 | `Verse.Combat.Gadget.Bulwark` (GD1) | 1,000 seeded bolts at an intact Bulwark: 0 pass; 1,000 sight traces: all pass; it disappears on the tick its health reaches 0 or 25 s after deploy |+| A2.11 | `Verse.Combat.Gadget.Breach` (GD2 to GD4) | Detonation 2.5 s after the plant within 1 tick; pawn damage at 0, 1.5, 3.0 m equals 120, 60, 0 to 1e-4 hp, owner included; the target piece reaches its breach result in 100 of 100 plants |++**Evidence.** Recoil spray plot (pitch and yaw per shot, 10 seeds) as PNG+and JSON; netcode report; first-person screenshot of amber and red bolts in+flight; automation report.++### WP03 Penetration and material table++**Goal.** Bolts that pass, lose damage on, and leave glowing holes in+materials according to one table, with sightlines through holes that the+person and the bot share exactly.++**Owned.** `Source/VerseDestruction/{Public,Private}/{Penetration,Holes}/**`;+`unreal/Verse/Data/destruction/penetration.json` (propose-only);+`unreal/Verse/Content/Verse/Destruction/_Holes/**`;+`unreal/Verse/Content/Verse/Test/WP03/**`.++**Contracts consumed.** `destruction.md` 2, 5, 6.2, 10; `combat-state.md` 6;+`bot.md` 3.1 (`TestSight`); `art-pipeline.md` 5 (channels), 8.3 (colour bans).++**Depends on.** G0 only. Fakes: WP06 pieces and proxies (`AFakePiece` solid+boxes tagged with a material id); WP02 as caller (WP03 tests call `TraceBolt`+directly).++| # | Sub-task | Output |+|---|---|---|+| 3.1 | Golden fixture of `destruction.md` 2: every material at 0.5x, 1x and 3x reference thickness and powers 50, 100, 150, hand-computed cost, pass and remaining damage | Fixture JSON in `Test/WP03/` |+| 3.2 | Table importer JSON to `DA_PenetrationTable`; frozen wire order check | Importer and test |+| 3.3 | `TraceBolt`: entry and exit on current proxies, traced thickness, cost, damage multiplier, 3-piece limit, impassable materials | Query implementation |+| 3.4 | `TestSight`: `VerseSight` channel, intact glass and grating see-through, damaged glass blocks, two-point hole test | Query implementation |+| 3.5 | Bolt hole records: fast array, caps 24 per piece and 512 per arena, hole 25 turns a wall `Holed`, eviction, epoch | Records and tests |+| 3.6 | Hole rendering: 256 x 256 mask per piece on first hole, rim decal, glow (tau 1.2 s, dull red at 2.5 s, off at 4 s), 128 glowing cap | Materials and component |+| 3.7 | Physical materials on non-destructible world geometry (concrete, armor steel, hall floor) mapped to table rows | Mapping and test |+| 3.8 | Fixture map: every material at 0.5x, 1x and 3x reference thickness, hole angle rig | Map |++| Id | Acceptance test | Pass |+|---|---|---|+| A3.1 | `Verse.Destruction.Penetration.Table` | 8 materials x 3 thicknesses x 3 power levels match the hand-computed table to 1e-4; rifle through two container walls keeps 0.5625 of damage (destruction 2) |+| A3.2 | `Verse.Combat.Penetration.Budget` | Concrete, armor steel and hall floor never pass; the 4th piece always stops a bolt |+| A3.3 | `Verse.Destruction.Sight.Holes` | A ray through a 15 mm hole in 0.3 cm sheet at 30 deg off the axis passes; the same ray through a 4 cm panel fails; 10,000 seeded rays agree with the analytic test |+| A3.4 | `Verse.Destruction.Holes.Caps` | Hole 25 on a wall makes it `Holed` and clears holes; arena cap drops the oldest hole of the fullest piece |+| A3.5 | Cost | 64 `TraceBolt` calls per tick at most 0.3 ms server game thread |+| A3.6 | Palette | Glow frames at 0, 1, 2.5 and 4 s: 0 banned pixels by the rendered-pixel rule of `art-pipeline.md` 8.3 |++**Evidence.** Screenshot sequence of a hole cooling (0, 1, 2.5, 4 s);+screenshot through a hole from both sides; table test report JSON.++### WP04 Melee and finisher++**Goal.** A fast frontal knife strike (two hits kill) and a 2.5 s paired+finisher from the back or flank within 1.5 m that always kills once locked.++**Owned.** `Source/VerseCombat/{Public,Private}/{Melee,Finisher}/**`;+`unreal/Verse/Data/melee/*.json`; `unreal/Verse/Content/Verse/Combat/Finisher/**`;+`unreal/Verse/Content/Verse/Test/WP04/**`.++**Contracts consumed.** `combat-state.md` 1 (rewind), 7, 8 (finisher event+fields), 9.3, D5; `bot.md` 3.2 (knife and finisher noise); `art-pipeline.md` 12+(`Warp_Finisher`, `Weapon_L`).++**Depends on.** WP02.8 rewind (fake: current transforms), WP01 stance and+grounded flags (fake), WP13.7 paired clips (placeholder montages with root+motion only, notifies at 0.25/0.9/1.8/2.1/2.5 s), WP05 and WP18 only as event+listeners.++| # | Sub-task | Output |+|---|---|---|+| 4.1 | `UVerseMeleeDefinition` importer; classification (7.1, 7.2) as a pure function | Function and grid test |+| 4.2 | Front strike: hit delay, cone, cooldown, damage through WP02's path with `Source = Melee`, noise | Strike and tests |+| 4.3 | Finisher GAS ability: validate, lock both, server phase timeline, abort on attacker death, `FVerseFinisherEvent` reliable multicast | Ability and tests |+| 4.4 | Motion warping to `Warp_Finisher` on server and clients | Warp setup and netcode test |+| 4.5 | Finisher cameras: both third person from Locked, back to first person at 2.5 s with the weapon re-equipped; cut-to-black hook for Reduced gore | Camera handling |+| 4.6 | Victim snap to the paired pose on Locked with smoothing | Correction code |+| 4.7 | Knife presentation: predicted swing, whiff, equip | Presentation |++| Id | Acceptance test | Pass |+|---|---|---|+| A4.1 | `Verse.Combat.Melee.Classify` | Grid 0-180 deg in 5 deg steps x 0-2.5 m in 0.1 m x dz -1..1 m in 0.2 m: 100 % match with 7.2 |+| A4.2 | `Verse.Combat.Melee.Strike` | 55 damage, 2 strikes kill from 100, cooldown 0.7 s within 1 tick |+| A4.3 | `Verse.Combat.Finisher.Timeline` (netcode test) | Phase times 0.25/0.9/1.8/2.1/2.5 s within 1 tick on server and both clients |+| A4.4 | D5 | 500 seeded finishers: 100 % kill unless the attacker dies before 2.1 s; aborts leave victim health unchanged |+| A4.5 | Warp accuracy | Attacker position error at Takedown at most 5 cm, on server and on both lagged clients |+| A4.6 | Invulnerability rules | The victim takes 0 other damage during the finisher; the attacker takes damage normally |++**Evidence.** A screenshot sequence (one per phase) of a finisher from both+clients side by side; netcode timeline JSON; automation report.++### WP05 Gore and setting++**Goal.** Heavy, location-true blood (bursts, spatter on walls and floor,+wounds, pools, bloody finisher), no dismemberment, with a Reduced setting,+and provably no effect on gameplay.++**Owned.** `Source/VerseGore/**` except `VerseGore.Build.cs`;+`unreal/Verse/Content/Verse/Gore/**`; `art/verse/gore/**` (procedural texture+builders); `unreal/Verse/Content/Verse/Test/WP05/**`.++**Contracts consumed.** `combat-state.md` 8, D6; `bot.md` 3.1 (gore never+seen by the bot); architecture 2 (Core-only includes).++**Depends on.** G0 only; drives itself with synthetic hub events. WP13+character material slots for wound masks (fake: test mesh with a wound mask+parameter). D6 final run uses WP10's harness.++| # | Sub-task | Output |+|---|---|---|+| 5.1 | Hub listener; synthetic event player (hit, death, finisher streams); skip on dedicated server and `-nullrhi` | Subsystem and tool |+| 5.2 | Blood bursts per zone and bolt direction (Niagara) | VFX assets |+| 5.3 | Wall and floor spatter: own visibility traces along the bolt, decal pool, oldest-first recycling | Spatter system |+| 5.4 | Wound masks: impact in bone space to a mask on the character material, up to 16 per character | Mask system |+| 5.5 | Pools under bodies: growth over 4 s, recycled | Pool system |+| 5.6 | Finisher gore driven by `FVerseFinisherEvent` phases | Finisher effects |+| 5.7 | Reduced level: neutral impact flash, no decals, cut to black Takedown to Recover; live switch purges existing gore | Setting handling |+| 5.8 | Budget counters reported to the harness; D6 hash test | Counters and test |++| Id | Acceptance test | Pass |+|---|---|---|+| A5.1 | `Verse.Gore.NoGameplayEffect` (D6) | Same seeded 10-minute bot-vs-bot match with Full and Reduced: replicated state hash equal on every tick |+| A5.2 | Include scan | `Source/VerseGore/**` includes no header from `VerseCombat`, `VerseBot` or `VerseDestruction` |+| A5.3 | No collision | 1,000 traces on every channel through decals, pools and blood particles hit nothing |+| A5.4 | Budget | At most 256 spatter decals, 16 pools, 16 wounds per character alive; `gore_storm` (30 hits/s for 60 s) at most 0.3 ms GPU at 1440p and 0.05 ms game thread per hit |+| A5.5 | Reduced | 1,000 hits leave 0 blood decals, particles or wounds; cut to black starts and ends within 1 frame of Takedown and Recover |++**Evidence.** Screenshot pairs Full vs Reduced for a body hit, a wall+spatter, a pool and a finisher; D6 hash log; budget JSON.++### WP06 Destruction and repair drones++**Goal.** Walls, cover, containers, glass, catwalks and ceiling panels break+under server authority with client-side debris, nav updates, and drones that+rebuild them after about 60 s; the hall floor never breaks.++**Owned.** `Source/VerseDestruction/**` except `Penetration/`, `Holes/` (WP03)+and `VerseDestruction.Build.cs`; `unreal/Verse/Content/Verse/Destruction/**`+except `_Holes/`; `art/verse/kit/destructible/**`;+`unreal/Verse/Data/destruction/tuning.json` (propose-only);+`unreal/Verse/Content/Verse/Test/WP06/**`.++**Contracts consumed.** `destruction.md` (all); `art-pipeline.md` 4.2+(`destructible` block), 5, 13; architecture 4, 7.++**Depends on.** G0.7 art pipeline (hard for Geometry Collections), WP03 holes+(fake: no-op), damage sources (tests call `ApplyPieceDamage` directly).++| # | Sub-task | Output |+|---|---|---|+| 6.1 | Spike: Blender Voronoi fracture as code to `SM_<Piece>_Frac` to `GC_<Piece>`; fallback editor fracture with the same seed; written verdict | Spike report and one working piece |+| 6.2 | Builders for six classes (wall panel 1.2/2.4/4.8 m, cladding wall, container wall, glass pane, catwalk segment, ceiling panel), solid with the material's reference thickness (`destruction.md` 9, decision C4) | Builders, exports |+| 6.3 | Per-state proxy meshes and up to 4 Holed and Breached variants per piece | Proxies |+| 6.4 | `AVerseDestructible`, state machine, `DA_PieceManifest` (GUID order, hash), manager fast array, `IVersePieceDamage`, `IVersePieceQuery` | Core runtime |+| 6.5 | Fracture events and client debris: strain field from seed, `VerseDebris` channel, caps and lifetimes | Debris system |+| 6.6 | Breach radius (150 cm) effects, forward-only transitions | Breach handling |+| 6.7 | Nav: dirty bounds +50 cm, at most 4 tiles in flight, mantle links for low breaches, drop links for destroyed catwalks | Nav updates |+| 6.8 | Repair drones: dock, queue order, flight, durations, encroachment wait, interruption, 30 HP target | Drone actor and tests |+| 6.9 | Full reset: epoch, burst under 16 KB, drones recalled, nav rebuilt | Reset |+| 6.10 | `UVerseDestructibleValidator`: watertight, thickness by ray sampling, proxies, GC, manifest | Validator in both lanes |+| 6.11 | `destruction_storm` scenario and budget counters | Scenario and JSON |++| Id | Acceptance test | Pass |+|---|---|---|+| A6.1 | `Verse.Destruction.States` | Every class follows table 3.2 transitions; bullets never take a wall past Holed; floor, concrete and armor steel never change |+| A6.2 | `Verse.Destruction.LateJoin` | A client joining after 200 changes builds the same proxy set as the server (0 mismatches) without spawning debris |+| A6.3 | `destruction_storm` | 400 debris bodies max (150 Low), 40 per fracture, 32 GC actors, physics at most 2 ms, at most 64 fracture events/s, state items about 20 bytes |+| A6.4 | `Verse.Destruction.Nav` | A breach is navigable within 100 ms in 100 of 100 trials |+| A6.5 | `Verse.Destruction.Repair` | Repair starts 60 s after the last damage within 1 tick; damage during repair returns the piece to `RepairFrom`; downed drone cancels; at most 3 drones active; completion waits while a pawn overlaps |+| A6.6 | Validator | Fails a double-plane wall and a missing proxy; passes all shipped pieces |+| A6.7 | Determinism of gameplay | Server and 2 clients agree on every proxy state and hole set after a 10-minute storm (hash per second) |++**Evidence.** Screenshots of each class in every state; a 10-frame breach+sequence; drone repair before, during, after; storm budget JSON; spike+report.++### WP07 Bot perception and belief map++**Goal.** The fairness boundary: a perception service that turns world truth+into percept frames with honest error, and a belief grid that tracks where+the opponent probably is from those percepts only.++**Owned.** `Source/VerseCombat/{Public,Private}/Perception/**`+(`UVersePerceptionService`); `Source/VerseBot/{Public,Private}/Belief/**`+(grid, opponent estimates, `FVersePieceBelief`);+`unreal/Verse/Content/Verse/Test/WP07/**`.++**Contracts consumed.** `bot.md` 1 (B2), 2, 3, 4, 10 (F2, F3, F7);+`destruction.md` 6.2; `combat-state.md` 5.1 (noise events).++**Depends on.** G0 only. Fakes: WP01 eye and stance (fake pawn with the+`Camera` bone of `SK_Test_Human`, decision C3), WP03 `TestSight` (plain trace+on `VerseSight`), WP06 piece query; Recast nav on its fixture maps.++| # | Sub-task | Output |+|---|---|---|+| 7.1 | Service skeleton: register observers, one frame per tick, per-observer RNG stream, profile from tier | Service |+| 7.2 | Sight: 55 deg cone, 55-80 deg peripheral band, 2 m awareness, 8 sample points, `VisibleMask`, dark-zone factor, ADS cone | Sight percepts |+| 7.3 | Hearing from `DA_Audibility`: error model, line-of-sight factor 1.5, level guess 0.9 / 0.7 | Heard percepts |+| 7.4 | Bolt, hurt, HUD and kill-feed percepts | Percepts |+| 7.5 | Belief grid from nav: 1 m columns x levels, 8-neighbour plus links, rebuild on believed nav change | Grid |+| 7.6 | Update rules: predict, clear, sighting, heard, hurt wedge, kill feed spawn prior, normalise with 1 % prior | Update step |+| 7.7 | Derived values `TopCluster`, `Confidence`, `SupportAge`, `Spread`, belief states; opponent health and ammo estimates | Read API |+| 7.8 | Piece belief and cover dependency sets | Piece belief |+| 7.9 | Fairness tests F2, F3 and scenario `wall_opened_unseen` | Tests |+| 7.10 | Dev-only belief heatmap overlay for screenshots | Debug draw |++| Id | Acceptance test | Pass |+|---|---|---|+| A7.1 | F2 percept boundary | Opponent behind opaque piece and silent: 0 sightings and 0 heard over 60 s; behind a hole: seen only when `TestSight` passes; crouch walk at 3 m: never heard |+| A7.2 | Heard error | Over 10,000 samples error sd within 10 % of the model sd; 0 percepts equal to the true location |+| A7.3 | F3 counterfactual | 20 seeds: input frames bit-identical up to the first differing percept tick |+| A7.4 | Belief tracking | Sighting, then 3 s hidden movement at 4.5 m/s on the fixture: `TopCluster` contains the true position in at least 70 % of 200 trials |+| A7.5 | Mass | Sum 1 within 1e-6 after every step; no cell at exactly 0 |+| A7.6 | Cost | Belief step at most 0.05 ms with 6,000 cells; perception at most 0.15 ms per observer per tick |+| A7.7 | `wall_opened_unseen` | No bot plan uses a breach before the bot perceives it |++**Evidence.** Heatmap overlay screenshots at sighting, +1 s, +3 s; F2/F3+report JSON; cost JSON.++### WP08 Bot decisions, EQS, learning++**Goal.** A bot brain that picks tactics by utility with hysteresis, finds+cover, peeks, flanks, breaches, wall-shoots only with authority, stalks for+finishers, and learns the person within one match.++**Owned.** `Source/VerseBot/{Public,Private}/{Controller,Brain,Tactics,Eqs,Learning,Audit}/**`;+`unreal/Verse/Content/Verse/Bot/**` except `Tiers/` (WP09);+`unreal/Verse/Content/Verse/Test/WP08/**`.++**Contracts consumed.** `bot.md` 1, 2, 4.5, 5, 6, 7, 10 (F1, F4, BR1, L1);+`destruction.md` 6.1; `combat-state.md` 2.1 (`BotTier`, `BotEffectiveSkill`),+2.3 (gadgets), 9.3 (spawn protection).++**Depends on.** G0 only. Fakes: WP07 (scripted `FVersePerceptFrame` streams+and a fake belief), WP09 aim and reflexes (fixed reaction, perfect follow),+WP01 and WP02 input (fake pawn that records the input frame), WP02.12/2.13+gadgets for the Bulwark and Breach states (fake abilities).++| # | Sub-task | Output |+|---|---|---|+| 8.1 | `AVerseBotController`, virtual input device, `FVerseBotBrainCore::Think`, record and replay harness (BR1); writes `BotTier` and `BotEffectiveSkill` into its player state | Controller and replay |+| 8.2 | StateTree schema, utility selection, +0.18 hysteresis, noise, 0.4 s dwell, forced re-decide triggers | Tree core |+| 8.3 | States Attack, Hold (Go, Hide, Peek), Retreat, Reload, Search | States |+| 8.4 | States Flank and StalkForFinisher | States |+| 8.5 | States DeployBulwark, Breach, Wallbang with authority 4.5 | States |+| 8.6 | Belief EQS contexts; `EQS_Cover`, `EQS_PeekCorner` | Queries |+| 8.7 | `EQS_WallbangSpot`, `EQS_BreachSpot`, `EQS_FinisherApproach` | Queries |+| 8.8 | `UVerseBeliefNavFilter` | Filter |+| 8.9 | `UVerseBotMatchMemory`: heatmaps, peek habits, ranges, route counts, habits; biases; weight bounds; reset | Learning |+| 8.10 | `FVerseBotFireAudit` log and classifier | Audit |+| 8.11 | Make `check_bot_isolation.py` (WP10) pass over `Source/VerseBot/**` | Clean scan |++| Id | Acceptance test | Pass |+|---|---|---|+| A8.1 | BR1 replay | 10 recorded 5-minute streams replay bit-identical |+| A8.2 | F1 isolation | 0 violations |+| A8.3 | F4 fire audit | 0 unclassified shots over 1,000 bouts |+| A8.4 | BG12 health | `timeToContactS` median at most 25 s against `hider`; at most 1 stuck event per 10 min; bot total at most 0.5 ms p99 per tick (decision 0.1 ms, EQS 0.2 ms amortised) |+| A8.5 | BG8 learning | Hard vs `repeek`, `watcher`, `camper`: `learningDelta` at least +0.05 and at least 0.03 better than learning off |+| A8.6 | BG9 reset and L1 | Nothing carried into match 2; no learned data on disk or on the bridge (file and frame scan) |+| A8.7 | BG4 tricks | Every trick vs hard: bout win rate at most 0.50 and kill share upper bound at most 0.55 |++**Evidence.** Balance report `verse.balance/1` for BG4, BG8, BG9, BG12; one+annotated screenshot per state (presentation overlay); fire audit sample.++### WP09 Bot aim, tiers, adaptive++**Goal.** Human-limited aim (reaction, OU wander, turn rate, lead, recoil+control), reflexes and fire discipline, the three tiers as data, and the+adaptive mode.++**Owned.** `Source/VerseBot/{Public,Private}/{Aim,Reflexes,Tiers,Adaptive}/**`+(including the `VerseImportBotTiers` commandlet);+`unreal/Verse/Data/bot/tiers.json`, `adaptive.json` (propose-only, merged with+a green nightly gauntlet per `bot.md` change rule);+`unreal/Verse/Content/Verse/Bot/Tiers/**` (generated assets);+`unreal/Verse/Content/Verse/Test/WP09/**`.++**Contracts consumed.** `bot.md` 2, 8, 9 (schema, floors, caps), B4;+`combat-state.md` 4 (recoil pattern the bot compensates).++**Depends on.** G0 only. Fakes: WP02.1/2.4 weapon assets and recoil (G0 test+weapon asset with the start curves), WP07 sight percepts (scripted), WP01+stance input (fake pawn). Gate runs need WP08 and WP10.++| # | Sub-task | Output |+|---|---|---|+| 9.1 | Tier import commandlet JSON to assets, CI diff check, floor and cap validation | Commandlet and test |+| 9.2 | Aim controller: reaction sampling, track latency and extrapolation, acquire error, OU wander, turn cap, stiffness, lead | Aim model |+| 9.3 | Recoil control: predictive pattern pull-down, residual correction after track latency | Recoil control |+| 9.4 | Fire discipline: tolerance, bursts, ADS range, elite taps beyond 30 m, no fire on a protected target | Fire gate |+| 9.5 | Reflexes: stance, lean, slide, prone, sound discipline, knife, finisher, pistol switch | Reflex layer |+| 9.6 | No-sight fire: suppression 0.35 s, prefire rule | Fire modes |+| 9.7 | Adaptive controller: window, deadband, gain, step cap, warmup, apply at respawn, interpolation | Adaptive |+| 9.8 | Tuning loop with the harness: tier patch proposals until BG1-BG3, BG6, BG7, BG10 pass | Patches and reports |++| Id | Acceptance test | Pass |+|---|---|---|+| A9.1 | `Verse.Bot.Aim.OU` | Stationary sd within 5 % of `AimNoiseDeg` over 100,000 ticks (pitch x 0.6) |+| A9.2 | `Verse.Bot.Aim.Reaction` | Mean within 3 % of `ReactionMs`, 0 samples under the 0.6 x mean floor over 10,000 draws |+| A9.3 | `Verse.Bot.Aim.TurnCap` | 0 ticks above `TurnRateDegS` |+| A9.4 | `Verse.Bot.Aim.Recoil` | Remaining pattern climb over a 30-round spray equals (1 - `RecoilPatternComp`) within 0.05 for every tier |+| A9.5 | `Verse.Bot.Adaptive` | Steps never above 0.05, `s` in [0, 1], no change inside the deadband or before 4 kills, applied only at respawn |+| A9.6 | Gates | BG1, BG2: bout win rate at least 0.75 and kill share lower bound at least 0.56; BG3: elite vs normal at least 0.90 and kill share at most 0.85; BG6: skilled vs elite 0.40 within 0.06; BG7: average vs normal 0.45-0.65; BG10: person share 0.40-0.60 over kills 30-60 |++**Evidence.** Nightly gauntlet report with BG1-BG12; aim trace plots per tier+(error vs time for 5 engagements); adaptive `s` trace.++### WP10 Harness++**Goal.** Autonomous proof: CI lanes, netcode test, headless bot-vs-bot+balance runs with gates, perf capture, screenshots and evidence tooling.++**Owned.** `Source/VerseHarness/**` except `VerseHarness.Build.cs`;+`unreal/Verse/Harness/**`; `unreal/Verse/Data/bot/person_models.json`+(propose-only); `scripts/unreal/{balance,capture,perf,netcode,check_bot_isolation,check_forbidden_names,check_lfs,done_check}.py`+(the hash list `forbidden_names.sha256` stays with the integration owner);+`.github/workflows/unreal-static.yml`, `unreal-build.yml`,+`unreal-gauntlet.yml`, `unreal-perf.yml` (handed over after G0.10; the `ci.yml`+jobs and `gate.needs` entries that make them required stay with the+integration owner, architecture 8.2);+`tests/unit/unreal_scripts/**`.++**Contracts consumed.** `bot.md` 10, 11; `combat-state.md` 12;+`destruction.md` 10 (`destruction_storm`); architecture 7, 8;+`art-pipeline.md` 14 (static gates).++**Depends on.** G0.6 and G0.10. Runs with a null brain until WP08 lands; every+other package plugs scenarios in.++| # | Sub-task | Output |+|---|---|---|+| 10.1 | `unreal-static`: DAG check, forbidden-name scan (hashed list, architecture 8.4), forbidden folder names, LFS pointers and remote objects, size gate, clang-format, licence ledger, art text checks; workflow policy (`permissions:`, SHA-pinned actions, `gate.needs`) | Lane |+| 10.2 | `unreal-build`: self-hosted, fork guard, concurrency plus lock, Win64 Editor and Game, Linux Game cross build, automation under `-nullrhi` | Lane |+| 10.3 | Netcode runner: dedicated plus 2 lagged clients, 2-minute smoke, correction and reconcile counters, Iris on and off nightly | Runner and lane step |+| 10.4 | Gauntlet controller, `AVerseModelController`, scenario schema, report `verse.balance/1` | Controller and schema |+| 10.5 | `balance.py`: sets, `--jobs`, seeds, patches, Wilson intervals, gates BG1-BG12, F1-F7, L1, BR1 | Driver |+| 10.6 | Speed measurement and bout-count calibration (architecture risk RK1) | Speed report, bout table |+| 10.7 | `unreal-perf`: fixed replay, Insights and `stat` parsing, NVML VRAM, budgets of architecture 7, quiet hours | Lane |+| 10.8 | `capture.py`: scripted camera, screenshots, palette share measurement (art-pipeline 8.1), evidence folder layout | Tool |+| 10.9 | Person models and the 17 tricks as model controller overrides | Models |+| 10.10 | F5 hidden-bearing statistic (nightly), F6 symmetry check | Checks |+| 10.11 | `done_check.py`: the Unreal lane status the repo done gate can call (hook line added by the integration owner) | Script |++| Id | Acceptance test | Pass |+|---|---|---|+| A10.1 | Static lane | Runs on GitHub-hosted in at most 5 minutes, with LFS off; fails each of: a planted forbidden name (from a test-only hash), a non-pointer `.uasset`, a pointer whose object is missing on the remote, a 51 MB LFS object, a new Build.cs edge, a folder named `Renders` under `unreal/` |+| A10.2 | Fork safety | Static check of the workflows: no self-hosted job can run on `pull_request` from a fork |+| A10.3 | Harness speed | At least 20x real time per process at `-nullrhi`, or a measured figure with bout counts recomputed so gate intervals are at most 0.06 wide |+| A10.4 | Gate math | Gates computed on a fixture report equal a hand calculation |+| A10.5 | Perf stability | Two runs of the same replay differ by at most 3 % in average fps and p99 frame time |+| A10.6 | Lock | Two concurrent `build.py` calls serialise; neither fails |++**Evidence.** Links to green runs of each lane; speed report; sample+`report.json`; perf JSON with a screenshot from the replay.++### WP11 Hangar arena and combat mode switch++**Goal.** Deck 4 turns from a normal deck into a dense 50 x 40 m, three-level+destructible arena on demand and back, running the endless 1v1 deathmatch.++**Owned.** Hangar zones `shell`, `arena_canyon`, `arena_shuttle`,+`arena_booth`, `arena_catwalks`, `armoury` (placement JSON,+`Content/Verse/Decks/Hangar/<Zone>/`, their external actors);+`art/verse/decks/hangar/**` except `zones/lift_lobby.py` and+`zones/day_stations.py` (WP12);+`Source/VerseDecks/{Public,Private}/HangarSwitch/**`;+`Source/VerseCombat/{Public,Private}/Rules/**` (`AVerseGameMode`,+`UVerseRuleset_Deathmatch`, `AVerseSpawnPoint`, spawn selection and+protection); `unreal/Verse/Data/rules/*.json`;+`unreal/Verse/Content/Verse/Test/WP11/**`.++**Contracts consumed.** `combat-state.md` 9, 10; `destruction.md` 11;+`art-pipeline.md` 4, 9, 13; `coordinates.md` 3.1, 3.2; `bridge-protocol.md` 12+(`quick_start_duel`).++**Depends on.** G0.7 and G0.8; WP06 destructible classes (fake: static pieces+with a valid `destructible` block), WP12 deck loading (fake: load+`LV_Hangar` directly), WP02 loadout, WP15 only as an event listener.++| # | Sub-task | Output |+|---|---|---|+| 11.1 | Arena layout spec and graybox: zone inside the 100 x 62 m hall, 3 levels, lanes, cover rhythm, at least 8 spawns | Spec in `docs/verse/unreal/arena.md`, graybox placements |+| 11.2 | Hangar shell for Unreal: solid walls, floor never breaks, ceiling 21 m | Shell builder and export |+| 11.3 | `arena_canyon`: container rows with destructible walls, 3.6 m aisles | Zone |+| 11.4 | `arena_shuttle`: walkable gunship as a mid building | Zone |+| 11.5 | `arena_booth`: glazed lookout with breakable glass | Zone |+| 11.6 | `arena_catwalks`: upper level, catwalk segments, ceiling panels, launch well crossing | Zone |+| 11.7 | `armoury`: loadout room geometry, station placements for WP16 and WP18 | Zone |+| 11.8 | Day/arena switch: data layers, `FVerseArenaSwitchEvent` on the hub (crew out of the hall, full destruction reset and nav rebuild happen in the listeners; VerseDecks never includes Crew or Destruction) | Switch subsystem |+| 11.9 | Game mode forwarder, deathmatch ruleset, `AVersePlayerState`, set logic (first to 10) and `FVerseSetSummary` per set and for the unfinished set on leave, D1-D4 | Rules |+| 11.10 | Spawn points, selection 9.2, protection 9.3 | Spawns |+| 11.11 | Flow analysis tool: sightline length histogram, time-to-contact from bot runs | Tool and report |+| 11.12 | Lighting pass: Lumen, hard work lights, haze, palette shares | Lighting |++| Id | Acceptance test | Pass |+|---|---|---|+| A11.1 | Arena geometry | Walkable arena bounds at most 50 x 40 m; 3 levels each at least 15 % of nav area; nav is one connected island per agent type |+| A11.2 | Spawns | At least 8; every spawn pair at least 20 m path apart |+| A11.3 | `Verse.Combat.Deathmatch.*` D1-D4 | 200 seeded deaths: respawn at 3.0 s within 1 tick; chosen spawn out of sight whenever a candidate is and farthest by path; 0 damage taken while protected; protection ends on the tick of the first own shot |+| A11.8 | Set summary | 50 scripted sets: one `FVerseSetSummary` each with kills matching the server log; leaving mid-set raises one `Unfinished` summary |+| A11.4 | Switch | Day to arena and back each at most 2.0 s; after either, 0 pieces not Intact, 0 crew pawns inside arena bounds |+| A11.5 | Flow | Normal vs normal median time to contact 6-15 s; longest unbroken sightline at most 40 m; BG12 with `hider` at most 25 s |+| A11.6 | Budgets | Hangar deck content at most 600 MB; nightly perf 120 fps average and p99 at most 11 ms at 1440p High in the duel replay |+| A11.7 | Floor | 1,000 breach charges on the floor change nothing |++**Evidence.** Top-down and four eye-level screenshots per zone; day and+arena screenshots of the same camera; flow report; perf JSON.++### WP12 Bridge, ops and engineering decks++**Goal.** The three agent decks and the hangar's day zones in Unreal, at+parity with today's rooms, sockets and stations, with deck loading, lift+travel, cameras and the deck world actions.++**Owned.** All zones of `bridge`, `ops`, `engineering` (placements, content+folders, external actors) and hangar zones `lift_lobby`, `day_stations`;+`art/verse/decks/{bridge,ops,engineering}/**`,+`art/verse/decks/hangar/zones/{lift_lobby,day_stations}.py`;+`art/verse/kit/**` except `kit/destructible/**` (WP06);+`unreal/Verse/Content/Verse/Kit/**`; the kit and prop material instances+and their recipes (`contracts/art-pipeline.md` 9); `Source/VerseDecks/**` except+`HangarSwitch/` (WP11), `Stations/` (WP16) and `VerseDecks.Build.cs`;+`unreal/Verse/Content/Verse/Test/WP12/**`.++**Contracts consumed.** `art-pipeline.md` (all); `coordinates.md`;+`bridge-protocol.md` 9 (`daily_visit`, `deck_discovered`, `inspection`).++**Depends on.** G0.7 and G0.8 (hard for import; builders and JSON proceed in+parallel), WP14.1 masters (fake: G0 default master), WP17 (fake bridge).++| # | Sub-task | Output |+|---|---|---|+| 12.1 | Deck loading, World Partition streaming, lift travel, deck manifest import (rooms, sockets, stations) | Deck subsystem |+| 12.2 | Architecture kit: 42 pieces exported with collision and MI recipes | Kit assets |+| 12.3 | Props kit by category | Prop assets |+| 12.4 | Bridge deck zones | Zones |+| 12.5 | Ops deck zones | Zones |+| 12.6 | Engineering deck zones (the reactor shaft stays as a deck feature, no duel) | Zones |+| 12.7 | Hangar `lift_lobby` and `day_stations` (arrivals, `create_agent` counter, shuttle-to-lift path sockets) | Zones |+| 12.8 | Lighting and look per deck in Military-Industrial Noir | Lighting |+| 12.9 | Space view outside the windows from the CC0 ledger textures | Space view |+| 12.10 | Deck cameras: overview, third and first person, mouse look, focus with the return key | Camera rig |+| 12.11 | World action reporters: `daily_visit`, `deck_discovered`, `inspection` | Reporters |++| Id | Acceptance test | Pass |+|---|---|---|+| A12.1 | Parity of content | Rooms, sockets and stations per deck equal today's manifests (`public/verse/decks/<id>/manifest.json`) 100 % by id |+| A12.2 | Loading | Cold deck load at most 4 s, lift travel at most 3 s on the reference box |+| A12.3 | Palette | Four reference views per deck within the caps of art-pipeline 8.1; 0 banned pixels by the rendered-pixel rule of art-pipeline 8.3 |+| A12.4 | Perf | 120 fps average at 1440p High per deck walk replay; VRAM at most 6 GB; deck content at most 600 MB |+| A12.5 | World actions | Golden bridge messages for each action; `inspection` sent once all rooms of a deck were visited |+| A12.6 | Art validation | `validate_assets` and `validate_ownership` green for every zone |++**Evidence.** Side-by-side sheet: today's eye-level view and the Unreal view+of the same spot for each room; palette report; load-time JSON.++### WP13 Characters, FPS skeleton, animations++**Goal.** One original FPS-grade human rig for player, bot and crew, body+variants and uniforms, all locomotion, weapon, finisher, death and crew+clips, and the animation runtime.++**Owned.** `art/verse/characters/**` (including `rig_fps.py`);+`unreal/Verse/Content/Verse/Characters/**` (`Rig/` under `git lfs lock`);+`unreal/Verse/Content/Verse/Animations/**`;+`Source/VerseMovement/{Public,Private}/Anim/**`; the import records and MI+recipes of those folders (art-pipeline 9; weapon skeletal meshes are WP14's);+`unreal/Verse/Content/Verse/Test/WP13/**`.++**Contracts consumed.** `art-pipeline.md` 3, 10, 11, 12; `combat-state.md` 7.4+(phase times), 2.1; `bot.md` 3.1 (the eye is the `Camera` bone, decision C3);+WP01 move set.++**Depends on.** G0.7 skeletal import; WP01 movement query (fake anim pawn).++| # | Sub-task | Output |+|---|---|---|+| 13.1 | `rig_fps.py`: `SKEL_Verse_Human` bones of 12.1, IK and weapon bones, `Camera`, A-pose; `SK_Calib_Rig` check | Rig |+| 13.2 | Skinning of the two CC0 body variants, at most 8 influences; garments: commander, crew, black tactical opponent | Meshes |+| 13.3 | `PHYS_Verse_Human` hit-zone bodies; `IKRig_Verse_Human` chains | Physics asset, IK rig |+| 13.4 | Locomotion: stand, crouch, prone idles and 8-way moves, sprint, jump, fall, land, slide, mantle low and high with root motion, lean poses | Clip set |+| 13.5 | First-person body: head hidden for the owner, first-person rendering without wall clipping, aim offsets | FP setup |+| 13.6 | Weapon clips per class at 60 fps: idle, ADS, fire, tactical and empty reload, equip, holster, knife strike | Clip set |+| 13.7 | Paired finisher clips with `Warp_Finisher` and root motion, markers at 0.25/0.9/1.8/2.1/2.5 s | Clip pair |+| 13.8 | Deaths, hit reacts, third-person clips for kill cam | Clip set |+| 13.9 | Crew clips: sit, type, stand, walk, talk, bunk | Clip set |+| 13.10 | `UVerseAnimInstance`: state machine from `IVerseMovementQuery`, foot IK, off-hand IK to `SOCKET_Support`, lean over three spine bones | Anim runtime |++| Id | Acceptance test | Pass |+|---|---|---|+| A13.1 | Bone names | 100 % match with art-pipeline 12.1; at most 200 bones; at most 8 influences per vertex |+| A13.2 | Finisher markers | Within 1 frame (30 fps) of the phase times |+| A13.3 | Off-hand IK | Hand to `SOCKET_Support` error at most 0.5 cm in every idle and ADS pose of every weapon |+| A13.4 | Foot IK | On 30 deg slopes and stairs no foot penetration above 1 cm |+| A13.5 | First-person clipping | Weapon 20 cm from a wall: 0 weapon pixels hidden by the wall in the owner's view |+| A13.6 | Cost | Animation at most 0.4 ms game thread for 2 FPS characters plus 12 crew |+| A13.7 | Licence | Every imported mesh cites a ledger row or `own` |++**Evidence.** Turnaround screenshots of each body and uniform; first-person+screenshots per weapon idle, ADS, reload; finisher contact sheet;+anim cost JSON.++### WP14 Weapon models, materials, style++**Goal.** The look: master materials, post-process and LUT for+Military-Industrial Noir, original fully black weapons on their own+skeletons, and weapon VFX.++**Owned.** `art/verse/weapons/**`; `unreal/Verse/Content/Verse/Weapons/**`;+`unreal/Verse/Content/Verse/Materials/Master/**` (under the integration+owner's `git lfs lock`, merged by the integration owner);+`unreal/Verse/Content/Verse/Materials/Instances/Weapons/**`;+`unreal/Verse/Content/Verse/VFX/Weapons/**`;+`unreal/Verse/Content/Verse/PostProcess/**`; the import records and MI+recipes of these folders (art-pipeline 9); `art/verse/style-unreal.md`.++**Contracts consumed.** `art-pipeline.md` 6, 7, 8, 11, 12.2; README Look and+Arsenal; `combat-state.md` 3 (`BoltColorOwn`, `BoltColorFoe`).++**Depends on.** G0.7; weapon ids from WP02.1 (fake: G0 test ids).++| # | Sub-task | Output |+|---|---|---|+| 14.1 | Master materials (opaque triplanar, UV PBR, decal, emissive, glass, hole-mask aware) with documented parameters; palette ban check in `validate_assets` | Masters |+| 14.2 | Post-process: AgX-matching LUT, exposure, fog and haze, work-light profiles; reference views | Look profile |+| 14.3 | Weapon design sheet: original silhouettes, fictional names, fully black, a checklist that no part copies a real firearm | Sheet in `style-unreal.md` |+| 14.4 | Graveline rifle: model, skeleton (`Magazine`, `Bolt`, `Trigger`, sockets) | Assets |+| 14.5 | Tallow pistol | Assets |+| 14.6 | Hookbill knife (`Root`, `SOCKET_Tip`) | Assets |+| 14.7 | Bulwark and breach charge models | Assets |+| 14.8 | Skitter SMG and Longsight DMR | Assets |+| 14.9 | Bolt VFX (amber own, red foe), muzzle, impact sparks and scorch | VFX |+| 14.10 | First-person shading pass: black steel, wear, oil, viewmodel lighting | Material instances |++| Id | Acceptance test | Pass |+|---|---|---|+| A14.1 | Weapon budgets | At most 24 bones and 60 k triangles first person; all sockets of 12.2 present |+| A14.2 | Fully black | Base colour luminance at most 0.06 (linear) on every weapon material; no gold or coloured trim |+| A14.3 | Banned colours | 0 banned pixels by the rendered-pixel rule of art-pipeline 8.3 in every reference view and VFX frame |+| A14.4 | LUT | Mean CIEDE2000 at most 3 against AgX reference renders of a 24-patch chart |+| A14.5 | VFX cost | 64 bolts in flight at most 0.1 ms GPU at 1440p |+| A14.6 | Names | Forbidden-name scan over assets, records and the design sheet: 0 hits |++**Evidence.** Weapon turnarounds and first-person shots under work light;+chart comparison image and numbers; reference view set.++### WP15 Crew and daily life++**Goal.** Officers (society agents) and technicians (coding panes) live on the+decks from real app data: duty status, ranks, routines, arrivals, meetings,+the pet drone.++**Owned.** `Source/VerseCrew/**` except `VerseCrew.Build.cs`;+`unreal/Verse/Content/Verse/Crew/**`; `unreal/Verse/Data/crew/*.json`;+`unreal/Verse/Content/Verse/Test/WP15/**`.++**Contracts consumed.** `bridge-protocol.md` 4 (roster, duty values), 7+(meetings, groups), 9 (`walk_together`, `team_briefing`), 11 (`agent.open`),+14 (`companion` topic); `combat-state.md` 11.1 (`FVerseArenaSwitchEvent`);+`coordinates.md`.++**Depends on.** G0 only (fake bridge from G0.11). Fakes: WP17 bridge client+feeds, WP13 crew rig and clips (`SK_Test_Human`), WP12 sockets (fixture deck).++| # | Sub-task | Output |+|---|---|---|+| 15.1 | Crew manager: pawns from `roster.snapshot` and `roster.delta`, ranks and uniforms | Manager |+| 15.2 | Duty status presentation for `working`, `waiting`, `idle`, `paused`, `error` with fallback | Presentation |+| 15.3 | Routines: seats, desks, bunks, walks over Recast with crowd avoidance | Routines |+| 15.4 | New agent arrival: spawn at the shuttle, walk to the lift (as `life/cast.ts:81-89`) | Arrival |+| 15.5 | Meetings and groups: gather on `meetings.update`, `team_briefing` action | Meetings |+| 15.6 | Pet drone from the `companion` topic, follow and `walk_together` | Pet |+| 15.7 | Hide crew from the hall on `FVerseArenaSwitchEvent` | Listener |+| 15.8 | Interaction: select crew, nameplate, `agent.open` | Interaction |+| 15.9 | Perf pass for 40 crew | Profile |++| Id | Acceptance test | Pass |+|---|---|---|+| A15.1 | Spawn | 40 agents plus 8 panes spawn within 1 s of the snapshot; a delta applies within 200 ms |+| A15.2 | Duty mapping | Each of `working`, `waiting`, `idle`, `paused`, `error` maps to its presentation; an unknown value maps to `idle` (bridge 4.2 fallback) |+| A15.3 | `walk_together` | Simulated walk sends one action per 50 m with the drone within 2.5 m, none during the 20 s cooldown |+| A15.4 | Arena | 0 crew pawns inside arena bounds 2 s after the switch |+| A15.5 | Soak | 30 minutes with 40 crew: 0 stuck pawns, game thread at most 1 ms |++**Evidence.** Screenshot of each deck with crew at work; duty status sheet;+soak JSON.++### WP16 Terminals and stations++**Goal.** Desk monitors that show the panes' live terminal cells and chat+tails, desk takeover that brings the app to the front on that pane, and all+stations.++**Owned.** `Source/VerseScreens/**` except `VerseScreens.Build.cs`;+`Source/VerseDecks/{Public,Private}/Stations/**`;+`Source/VerseUI/{Public,Private}/Stations/**`;+`unreal/Verse/Content/Verse/Screens/**`, `unreal/Verse/Content/Verse/UI/Stations/**`;+`unreal/Verse/Content/Verse/Test/WP16/**`.++**Contracts consumed.** `bridge-protocol.md` 5, 6, 11, 12, 14 (open commands,+`launcher.cancel`, `busy`); architecture 5.3.++**Depends on.** G0 only (fake bridge and cells fixtures from G0.11). Fakes:+WP17 bridge client, WP12 screen sockets (fixture map), WP18 UI framework+(plain UMG root).++| # | Sub-task | Output |+|---|---|---|+| 16.1 | `cells.bin/1` and `cells.json/1` decoder and grid model | Decoder |+| 16.2 | Glyph atlas from the IDE font (licence checked, 13 px reference), one render target per monitor, dirty-row drawing | Renderer |+| 16.3 | Watch set: desks within view distance, at most 8, far monitors at 2 Hz | Watch manager |+| 16.4 | Chat tail screens | Screens |+| 16.5 | Takeover: interact sends `ide.focus_terminal`, Verse hides | Takeover |+| 16.6 | Station framework: `AVerseStation`, prompt, kinds | Framework |+| 16.7 | Station UIs and commands: ledger (`agents.open_list`), group (`group.open`), record (opens WP21's view), simulator (`simulator.open`), launcher (`launcher.options`, `launcher.start`, `launcher.cancel`, `ide.open`), `create_agent` | UIs |+| 16.8 | Armoury station actor: raises `FVerseStationUsedEvent` on the hub (combat-state 11.1) that WP18's armoury UI listens to (VerseDecks never includes VerseUI); the UI's "start" asks WP11's switch | Station |++| Id | Acceptance test | Pass |+|---|---|---|+| A16.1 | Decoder | Every golden fixture decodes byte-exact |+| A16.2 | Load | 8 panes at 60 x 240 at 10 Hz: at most 0.3 ms game thread per frame, at most 200 KB/s |+| A16.3 | Colour | 256-colour and RGB test screens vs reference image: mean CIEDE2000 at most 2 |+| A16.4 | Takeover | Key press to app window in the foreground on that pane at most 500 ms (with WP17 host) |+| A16.5 | Commands | Golden messages for every station command; `rate_limited` reply shown, not retried in a loop |++**Evidence.** Screenshot of a monitor next to the same pane in the IDE;+load JSON; takeover timing JSON.++### WP17 Backend verse host and bridge++**Goal.** The backend side (supervisor, probe, bridge server, relays,+commands) and the Unreal side (bridge client, typed feeds, lifecycle, window+and focus) of `verse.bridge/1`.++**Owned.** `dodaios/verse_host/**` except `signal.py` (WP20);+`dodaios/ui/web/verse_routes.py`; the `Verse*` event block in+`dodaios/core/events.py` (all Verse events, including `VerseDuelRecorded`);+the `VerseOpenRequested` handler block in+`dodaios/ui/web/frontend/src/hooks/useWebSocket.ts`; the shared launch+sequence `dodaios/agentic_ide/launch_sequence.py` (new);+`dodaios/ui/web/frontend/src/components/verseHost/**` and its mount in+`dodaios/ui/web/frontend/src/views/DodaiosAgentsView.tsx` behind the config+flag `verse.unreal_preview` until the deletion PR;+`tests/unit/verse_host/**` except `fixtures/` (G0.11) and `test_signal*.py`+(WP20); `Source/VerseBridge/**` except `Private/Duel/` (WP21) and+`VerseBridge.Build.cs`.++**Contracts consumed.** `bridge-protocol.md` (all); architecture 1, 5.++**Depends on.** G0 only. Fakes: WP21 `record_duel` service; WP20 signal+handler (the route answers close 1013 until it lands).++| # | Sub-task | Output |+|---|---|---|+| 17.1 | Conformance: the backend codec and the `VerseBridge` codec pass every G0.11 golden fixture and `fake_bridge.py` scenario (BW11) | Conformance tests in both languages |+| 17.2 | Route, loopback check, `hello` and token, one-client rule, heartbeat, close codes (BW1) | Route |+| 17.3 | Supervisor: lazy launch, job object and `PR_SET_PDEATHSIG`, env token, backoff, crash folder, status `crashed` after 3 crashes (BW2), `GET /api/verse/status` values of architecture 1.1 | Supervisor |+| 17.4 | Probe: D3D12 SM6 with 6 GB or Vulkan 1.3, install check, `unsupported` | Probe |+| 17.5 | Roster relay, duty port, rank join, parity tests against the TS code (BW3) | Relay |+| 17.6 | Styled screen mirror, screens relay, cells codec (BW4) | Relay |+| 17.7 | Chat tails relay (BW5), groups and meetings relay (BW6) | Relays |+| 17.8 | Progression relay: snapshot, awarded forward, actions, `told_seq` and `progression.told` (BW7) | Relay |+| 17.9 | `VerseOpenRequested` and web handler for every open command of bridge 11 and 14; launcher sequence moved into the backend with single flight and `launcher.cancel`; rate limits (BW9, BW12) | Commands |+| 17.10 | Locale and settings in `welcome` and `settings.changed`; `settings.set`; `POST /api/verse/settings/import`; `companion` topic; `qa.exec` gate (BW10, BW12) | Relays and route |+| 17.11 | Unreal `VerseBridge`: WS client, JSON and binary codec, reconnect with `last_seq`, typed feed subsystems, command sender with replies | Client |+| 17.12 | Unreal lifecycle: Booting, Visible, Panel, Dormant, Exiting; return key; foreground hand-off both ways; single-instance mutex; `gpu.yield`; X11 and Wayland activation | Lifecycle |+| 17.13 | Web launcher card (status, launch, quick-start duel) and desktop foreground hand-off; `npm run build` check | Frontend |++| Id | Acceptance test | Pass |+|---|---|---|+| A17.1 | Golden round trip | 100 % of fixtures encode and decode identically in Python and C++ |+| A17.2 | Auth | Wrong token closes 4401 within 100 ms; no `hello` in 5 s closes 4400; non-loopback peer 4403; second client replaces the first |+| A17.3 | Liveness | Dead link declared at 5 s within 0.5 s; restarts after 1, 4, 15 s; 3 crashes in 5 minutes leave status `crashed` |+| A17.4 | Containment | Killing the app process ends a dummy `Verse.exe` within 2 s on Windows and Linux |+| A17.5 | Token | Token absent from every process command line and from logs (scan) |+| A17.6 | Lifecycle | Dormant to Visible at most 300 ms; cold start to first frame at most 8 s; Dormant CPU under 1 % of one core and 0 GPU frames |+| A17.7 | Screens relay | 8 busy panes: at most 200 KB/s; event loop latency added p99 at most 5 ms |+| A17.8 | No secrets | Frame scan over a 30-minute session finds no key or credential pattern |+| A17.9 | Parity additions | Golden round trip for every section 14 message; a second `launcher.start` during a batch replies `busy`; `qa.exec` replies `unavailable` without `DODAIOS_VERSE_QA=1`; the settings import writes each key once and a second call imports nothing |++**Evidence.** pytest and automation reports; lifecycle timing JSON; screenshot+of the launcher card in the running app (from the rebuilt `dist`).++### WP18 HUD, armoury, menus, kill cam++**Goal.** Everything the person reads and clicks in Unreal outside stations:+HUD, kill feed, kill cam, armoury loadout and tier choice, Verse bar, menus+and settings, end-of-set screen.++**Owned.** `Source/VerseUI/**` except `Stations/` (WP16), `ServiceRecord/`+(WP21), `Audio/` (WP19) and `VerseUI.Build.cs`;+`unreal/Verse/Content/Verse/UI/**` except `Stations/`, `ServiceRecord/`;+`unreal/Verse/Data/ui/*.json`; `unreal/Verse/Content/Verse/Test/WP18/**`.++**Contracts consumed.** `combat-state.md` 2.1 (including `BotTier` and+`BotEffectiveSkill` on `AVersePlayerState`), 5.1, 9, 11.1 (`FVerseSetSummary`);+`bot.md` 3.3 (what the HUD shows is what the bot knows), 9.2 (`s` on the end+screen); `destruction.md` 4 (kill cam replay of breaks); `bridge-protocol.md`+3.2 (locale, settings), 12 (`settings.changed`), 14 (`settings.set`).++**Depends on.** G0 only (fake bridge from G0.11). Fakes: WP02 events+(synthetic hub events), WP11 player state.++| # | Sub-task | Output |+|---|---|---|+| 18.1 | HUD framework, safe areas, 1080p to 4K scaling, strings from `welcome` | Framework |+| 18.2 | Crosshair on the true bolt direction with spread display; hit markers (hit, headshot, kill, blocked); damage direction | Widgets |+| 18.3 | Magazine and reserve, reload state, gadget charges, health, stance, spawn protection | Widgets |+| 18.4 | Kill feed, set score, respawn countdown | Widgets |+| 18.5 | Kill cam: client ring buffer of the last 4 s (transforms, fire and fracture events), third-person replay of the killer during the 3 s respawn, skip | Kill cam |+| 18.6 | Armoury UI: loadout view, tier normal, hard, elite or adaptive, start duel | Armoury UI |+| 18.7 | Verse bar: quick-start duel, deck navigation, return to app | Bar |+| 18.8 | Menus and settings: Esc menu, gore Full or Reduced, key rebinding including the return key, sensitivity, deck view FOVs (parity V-09: 70 third, 85 first), duel FOV 80-110 (default 100, the value `bot.md` 3.1 sizes the bot's view cone from), reduced motion, volumes, scalability. App-backed settings go through `settings.set`; duel FOV, keys and scalability are stored in Unreal's user settings | Menus |+| 18.9 | End-of-set screen with set summary and adaptive `s` | Screen |+| 18.10 | Accessibility: marker shapes that work without colour, text size | Pass |++| Id | Acceptance test | Pass |+|---|---|---|+| A18.1 | Crosshair | Centre of the crosshair and the predicted bolt direction differ by 0 px at 1440p over 1,000 shots |+| A18.2 | Kill cam | Starts within 150 ms of `FVerseDeathEvent`, ends at least 200 ms before respawn; replayed killer path within 10 cm of the server log |+| A18.3 | Cost | HUD at most 0.3 ms game thread plus GPU |+| A18.4 | Strings | 0 hard-coded user strings (scan); 5 locales render without clipping at 1080p |+| A18.5 | Settings | Every setting keeps its value across a Verse restart; after rebinding the return key to F8, F8 sends `focus.return_to_app` and F10 does nothing; a gore change sends one `settings.set` and the next `welcome` carries it |++**Evidence.** HUD screenshots in a fight at 1080p, 1440p, 4K; kill cam+contact sheet; one screenshot per locale of the armoury.++### WP19 Audio++**Goal.** Heavy, located sound: layered weapons, bolts, impacts per material,+footsteps, reloads, melee, destruction, drones, deck ambience; one audibility+table shared with the bot.++**Owned.** `unreal/Verse/Content/Verse/Audio/**`;+`Source/VerseUI/{Public,Private}/Audio/**`; `art/verse/audio/**` (synthesis+builders and fetch scripts only: recordings in `.wav` or `.flac` are never+committed, they are fetched from ledger URLs into `art/verse/.cache/` and only+the imported `.uasset` is committed, architecture 8.4);+`unreal/Verse/Data/audio/*.json` (`DA_Audibility` values are propose-only, Core);+`unreal/Verse/Content/Verse/Test/WP19/**`.++**Contracts consumed.** `bot.md` 3.2 and F6; `combat-state.md` 5.1;+`destruction.md` 6.2 (loudness by cause), 7 (drone noise); README Assets+(own or CC0 only).++**Depends on.** WP02 events (synthetic), material ids from WP03 and WP06+(fixture), WP12 ambience zones (fixture).++| # | Sub-task | Output |+|---|---|---|+| 19.1 | Framework: MetaSound sources, submixes, concurrency, attenuation from `DA_Audibility` | Framework |+| 19.2 | Weapons: layered mechanical thump, body, tail, room reflection; first and third person; distance layers | Weapon sounds |+| 19.3 | Bolt flyby, impacts for the 8 materials, penetration exit | Sounds |+| 19.4 | Footsteps per surface and stance, slide, land, mantle, lean and prone foley | Sounds |+| 19.5 | Reloads (tactical and empty distinct), equip, knife, finisher | Sounds |+| 19.6 | Destruction by class, debris settle, drone flight and weld | Sounds |+| 19.7 | Occlusion through pieces (holes and breaches open it), spatialisation | System |+| 19.8 | Deck ambience, crew beds, UI sounds | Sounds |+| 19.9 | Licence ledger rows and audit | Ledger |++| Id | Acceptance test | Pass |+|---|---|---|+| A19.1 | F6 symmetry | Attenuation maximum distance equals the `DA_Audibility` range for every `Noise.*` tag (0 mismatches) |+| A19.2 | Latency | Shot to sound start at most 1 frame |+| A19.3 | Load | `destruction_storm`: at most 64 voices, audio thread at most 1.5 ms |+| A19.4 | Loudness | Duel reference capture integrated -16 LUFS within 1, true peak at most -1 dBTP |+| A19.5 | Dormant | Muted within 100 ms of hide |+| A19.6 | Licence | Every sound asset cites a ledger row or `own` |++**Evidence.** Loudness report; capture WAV of the reference duel replay (CI+artifact, not committed); occlusion test JSON.++### WP20 Pixel Streaming side panel++**Goal.** The IDE side panel shows a Pixel Streaming 2 view of the running+`Verse.exe` while visible, stopping within 1 s when hidden, with a fallback+card.++**Owned.** `Source/VerseStream/**` except `VerseStream.Build.cs`;+`dodaios/verse_host/signal.py`;+`dodaios/ui/web/frontend/src/components/agentic/sidePanel/verseStream/**`;+`dodaios/ui/web/frontend/src/components/agentic/sidePanel/OfficeTab.tsx`;+`tests/unit/verse_host/test_signal*.py`;+`unreal/Verse/Content/Verse/Test/WP20/**`.++**Contracts consumed.** `bridge-protocol.md` 12 (`panel.*`); architecture 1.3, 6.++**Depends on.** G0 only. Fakes: WP17 route and lifecycle (`fake_bridge.py`+from G0.11 sends `panel.visibility`); any deck map. The frontend library pin+in `package.json` is a request to the integration owner. `OfficeTab.tsx`+shows the stream only behind the config flag `verse.unreal_preview` until the+deletion PR.++| # | Sub-task | Output |+|---|---|---|+| 20.1 | Signalling in the backend: loopback ICE only, token rules, protocol test against the plugin | `signal.py` |+| 20.2 | `VerseStream`: session start and stop, offscreen render at panel size, panel camera, 30 fps, hardware H.264 (AV1 if offered), 8 Mbit/s cap | Module |+| 20.3 | Frontend component with the pinned MIT library; visibility via `IntersectionObserver` and page visibility; fallback card | Component |+| 20.4 | Input over the data channel: overview and walking only; no duel in the panel | Input map |+| 20.5 | Arbitration: full window wins; last frame with "Verse is open" | Arbitration |+| 20.6 | Perf and lifecycle tests | Tests |++| Id | Acceptance test | Pass |+|---|---|---|+| A20.1 | Start and stop | Stream visible within 1.5 s of the panel showing; stopped within 1 s of hiding |+| A20.2 | Cost | At most 1.5 ms GPU per frame at 960 x 600; VRAM in Panel at most 3 GB |+| A20.3 | Latency | Glass-to-glass under 80 ms (timestamp overlay test) |+| A20.4 | Arbitration | Full view open: 0 streamed frames rendered |+| A20.5 | Bundle | `npm run build` output contains the component; screenshot from the running app |++**Evidence.** Screenshot of the side panel streaming in the running app;+latency JSON; GPU cost JSON.++### WP21 Progression and duel stats++**Goal.** Duel wins award commander XP; duel statistics (wins, K/D,+headshots, finishers) land in the service record, both in the web app and in+Unreal.++**Owned.** `dodaios/progression/duel_stats.py`; the duel rule block in+`dodaios/progression/rules.py`; `ProgressionService.record_duel` and helpers+in `dodaios/progression/service.py`; the duels read in+`dodaios/ui/web/progression_routes.py`; `tests/unit/progression/test_duel_*.py`+and the duel rows of `tests/unit/progression/test_frontend_parity.py`;+the duel section of `dodaios/ui/web/frontend/src/components/society/verse/ranks/ServiceRecord.tsx`;+`Source/VerseBridge/Private/Duel/**`; `Source/VerseUI/{Public,Private}/ServiceRecord/**`;+`unreal/Verse/Content/Verse/UI/ServiceRecord/**`.++**Contracts consumed.** `bridge-protocol.md` 9, 10; `combat-state.md` 9.1, 10+(`BuildSetSummary`), 11.1 (`FVerseSetSummary`, `UVerseEventHub::OnSetEnded`);+`bot.md` 9.2.++**Depends on.** G0 only. Fakes: WP17 relay (tests call `record_duel`+directly; the Unreal side uses the G0.11 fake bridge), WP11 set summary+(synthetic `OnSetEnded` events).++| # | Sub-task | Output |+|---|---|---|+| 21.1 | Duel stats store: table, migration, totals, per tier and per weapon | Store |+| 21.2 | XP rules `duel_won`, `duel_lost`, `duel_finisher`, tier multipliers, server trigger, caps; refusal through `POST /actions`; frontend parity test | Rules |+| 21.3 | `record_duel`: idempotent on `match_id`, clamping, awards, `VerseDuelRecorded` publish | Service |+| 21.4 | `GET /api/progression` with `duel_stats`; `GET /api/progression/duels?limit=20` | Routes |+| 21.5 | Web service record duel section; `npm run build` check | Frontend |+| 21.6 | Unreal reporter (in VerseBridge, reads `OnSetEnded`, never includes VerseCombat): one `duel.result` per finished set and one `unfinished` result on leave; the pending result is saved and sent as `crash_recovered` on the next launch | Reporter |+| 21.7 | Unreal service record view, commander XP and rank, promotion notice; sends `progression.told` once a promotion was shown (bridge 14) | UI |++| Id | Acceptance test | Pass |+|---|---|---|+| A21.1 | Idempotency | 100 sends of one `match_id` give 1 row and 1 award |+| A21.2 | XP | A won set vs hard pays 60; daily caps 200 / 50 / 25 hold; a set with `match_time_s` 59 pays 0; an `unfinished` result pays 0 and still updates `duel_stats` |+| A21.3 | Clamp | More than 1 kill per 2 s of match time is clamped and logged |+| A21.4 | Crash recovery | Verse killed after a set: next launch sends `crash_recovered` within 10 s of `welcome` |+| A21.5 | Refusal | `POST /api/progression/actions` with `duel_won` returns 422 or `bad_request` |+| A21.6 | Bundle | Web service record shows the duel section in the running app |++**Evidence.** pytest report; screenshots of both service records with the+same numbers.++### WP22 Packaging, installer, updater, Linux++**Goal.** Windows and Linux builds packaged, chunked per deck, shipped inside+the normal installer, updated by delta packages, with machines without a GPU+unaffected.++**Owned.** `scripts/unreal/package.py`; `.github/workflows/unreal-package.yml`+(workflow policy of architecture 8.2); `unreal/Toolchain/**` (`toolchains.json`,+`ddc.json`); `unreal/Verse/Build/**` (engine-required platform resources);+`packaging/windows/verse/**`, `packaging/linux/verse/**`; the Verse download+and delta logic in `dodaios/core/installer_update.py`; the+`GIT_LFS_SKIP_SMUDGE=1` lines in `install/**`, `dodaios/core/main_follow.py`+and `dodaios/ui/web/update_routes.py`; `tests/unit/installer/test_verse_*.py`.++**Contracts consumed.** architecture 7 (size, cold start), 8.1, 8.3;+`art-pipeline.md` 10.2 (installer clone without LFS); README Platforms and+Delivery.++**Depends on.** G0.1 and G0.6; any content for size runs (an empty map is+enough to start). `Verse.Target.cs` changes are requests to the integration+owner.++| # | Sub-task | Output |+|---|---|---|+| 22.1 | Toolchain setup and pins: MSVC, SDK, Linux clang cross toolchain, `toolchains.json`, verify command | Scripts |+| 22.2 | BuildCookRun Win64 and Linux Shipping; Harness absent from Shipping | `package.py` |+| 22.3 | IoStore chunk per deck; shipped PSO cache | Chunk rules |+| 22.4 | Delta packages: chunk diff, apply, hash verify, rollback | Delta tool |+| 22.5 | Updater: raised size cap for the Verse payload (today `MAX_INSTALLER_BYTES = 1_500_000_000`, `installer_update.py:106`), Verse channel, resumable download, signature hand-off | Updater |+| 22.6 | Installer integration on Windows and Linux; `GIT_LFS_SKIP_SMUDGE=1` in clone paths | Installers |+| 22.7 | Linux smoke: container or VM, `-nullrhi` server run, Vulkan first frame where a device exists, X11 and Wayland activation check | Nightly job |+| 22.8 | Signing hand-off to the existing signing workflow; no keys on the runner | Workflow step |+| 22.9 | Disk hygiene: DDC cap 40 GB, `Intermediate` pruning, alert below 40 GB free | Script |++| Id | Acceptance test | Pass |+|---|---|---|+| A22.1 | Size | Payload at most 2 GB compressed at parity; typical delta at most 300 MB |+| A22.2 | Cold start | At most 8 s to first frame on the reference box with the shipped PSO cache |+| A22.3 | No GPU | Install on a GPU-less VM: app runs, Verse status `unsupported`, 0 errors in the app log |+| A22.4 | LFS | A fresh installer clone and an in-app update each download 0 bytes of `unreal/**` LFS objects; the release source archive contains no `unreal/` path |+| A22.5 | Update | Delta applies with 100 % hash match; a corrupted chunk rolls back to the previous version |+| A22.6 | Linux | Linux Game target builds in `unreal-build`; 60 s server smoke passes nightly |++**Evidence.** Package size report per chunk; cold-start JSON; GPU-less VM+screenshot of the launcher card; delta apply log.++## 3. Deck zones and owners++| Deck | Zone | Owner |+|---|---|---|+| hangar | `shell`, `arena_canyon`, `arena_shuttle`, `arena_booth`, `arena_catwalks`, `armoury` | WP11 |+| hangar | `lift_lobby`, `day_stations` | WP12 |+| bridge, ops, engineering | every zone (list fixed in WP12.4-12.6 placement files) | WP12 |+| any | Station actors are placed by the zone owner; their classes come from WP16 | - |+| any | Destructible pieces are placed by the zone owner; their classes and assets come from WP06 | - |++## 4. Contract conflicts, decided (G0.2)++Each conflict found in review is decided in the contracts themselves, so no+package waits on it. G0.2 is done when the code in `VerseCore` matches.++| # | Conflict | Decision (now in the contract) |+|---|---|---|+| C1 | Penetration: rifle `PenetrationPower` 40 with 2 passes and a per-cm formula vs "100 = assault rifle", 3 pieces and a reference-thickness formula; `IVersePieceDamageSink` vs `IVersePieceDamage` | `destruction.md` 2 wins: 100 = rifle, reference-thickness cost formula, at most 3 pieces, `IVersePieceDamage`. `combat-state.md` 3, 3.1 (rifle 100 / 3, pistol 50 / 2, `HoleRadiusMm`) and 6 now follow it |+| C2 | Trace channel `VerseHitBody` missing from the frozen channel list | Added to `destruction.md` frozen interface (per-bone hit bodies only) |+| C3 | Eye socket `head_cam` vs rig bone `Camera` | The `Camera` bone of `SKEL_Verse_Human` (`art-pipeline.md` 12.1); `bot.md` 3.1 updated |+| C4 | Breakable minimum thickness "at least 10 cm" vs "material reference thickness within 10 %" | `destruction.md` 9 governs destructibles; the 10 cm and 20 cm minimums of `art-pipeline.md` 5, 6.3 apply to non-destructible architecture only; `art-pipeline.md` 13 updated |+| C5 | `duel.result` per finished set vs per session | One result per set: `won` / `lost` per finished set, `unfinished` for the set left mid-way (stats only, no XP); payload `FVerseSetSummary` (`combat-state.md` 9.1, 11.1; `bridge-protocol.md` 10) |+| C6 | Gadget contract referenced but missing | `combat-state.md` 2.3 (`UVerseGadgetDefinition`, Bulwark and breach charge rules, `FVerseGadgetEvent`, tests GD1 to GD4) |+| C7 | `VerseServer.Target.cs` exists although binary installs cannot build Server targets; Harness is in the Game target | G0.4 deletes `VerseServer.Target.cs` and lists `VerseHarness` only in `VerseEditor.Target.cs` (architecture 8.1) |+| C8 | `AVerseCharacter` (VerseMovement) was also given combat fields | Combat phase and spawn protection live in `UVerseCombatStateComponent` (`combat-state.md` 2.1, 11.2) |+| C9 | `VerseBridge` (duel reporter), `VerseUI` (adaptive `s`) and `VerseDecks` (arena switch) needed types from modules they may not include | `FVerseSetSummary`, `FVerseArenaSwitchEvent` and hub delegates in Core; `BotTier` / `BotEffectiveSkill` on `AVersePlayerState` (`combat-state.md` 2.1, 11.1) |+| C10 | Gate ids collided: phase gates G0-G3 vs bot gates G1-G12, combat D1-D6 vs destruction D1-D6, recoil R1-R6 vs bot R1 and architecture risks R1-R16, bot B1-B8 vs bridge work items B1-B11 | Bot gates `BG1-BG12`, bot replay `BR1`, learning test `L1`, piece-truth test `F7`; destruction rules `DR1-DR6`; architecture risks `RK1-RK16`; bridge work items `BW1-BW12` |+| C11 | Parity gaps needed bridge messages that did not exist | Added to `bridge-protocol.md` §14 before the freeze |++## 5. Dependency table++"Starts on" is what must exist before the first sub-task. "Stubs" are faked+by the package itself. "Final acceptance needs" is what must be real for the+package's last acceptance run.++| WP | Starts on | Stubs (own fakes) | Final acceptance needs |+|---|---|---|---|+| WP01 Movement | G0 | WP13 rig (`SK_Test_Human`) | WP10 netcode runner |+| WP02 Weapons | G0 | WP01, WP03, WP11 ruleset, WP13, WP14 | WP01, WP03, WP10 |+| WP03 Penetration | G0 | WP06 pieces | WP06 |+| WP04 Melee | G0 | WP02.8 rewind, WP01 flags, WP13.7 clips | WP02, WP13, WP10 |+| WP05 Gore | G0 | Hub events, WP13 material slots | WP10 (D6) |+| WP06 Destruction | G0 (G0.7 hard) | WP03 holes | WP03, WP10 |+| WP07 Perception, belief | G0 | WP01 eye, WP03 sight, WP06 pieces | WP01, WP03, WP06 |+| WP08 Decisions | G0 | WP07, WP09, WP01, WP02 | WP07, WP09, WP02, WP06, WP10 |+| WP09 Aim, tiers | G0 | WP02 weapons, WP07 percepts | WP08, WP10 |+| WP10 Harness | G0 | Null brain | WP08 for gates |+| WP11 Hangar arena | G0 | WP06 classes, WP12 loading, WP02 loadout | WP06, WP12, WP02, WP08, WP10 |+| WP12 Decks | G0 | WP14 masters, WP17 bridge | WP14, WP17 |+| WP13 Characters | G0 (G0.7 hard) | WP01 query | WP01 |+| WP14 Style, weapons | G0 (G0.7 hard) | WP02 ids | - |+| WP15 Crew | G0 (G0.11 fake bridge) | WP17 client, WP13 rig, WP12 sockets | WP17, WP13, WP12 |+| WP16 Terminals, stations | G0 (G0.11 fake bridge) | WP17 client, WP12 sockets, WP18 UI root | WP17, WP12 |+| WP17 Verse host, bridge | G0 | WP21 service, WP20 signal | WP21 |+| WP18 HUD, menus, kill cam | G0 (G0.11 fake bridge) | WP02 events, WP11 state, WP17 locale | WP02, WP11, WP17 |+| WP19 Audio | G0 | WP02 events, WP03/WP06 materials, WP12 zones | WP02, WP06 |+| WP20 Pixel Streaming | G0 (G0.11 fake bridge) | WP17 lifecycle | WP17 |+| WP21 Progression | G0 (G0.11 fake bridge) | WP17 relay, WP11 summary | WP17, WP11 |+| WP22 Packaging | G0.1, G0.6 | Empty map | All content packages for the size gate |++Early unblockers, scheduled first inside their packages: WP10.1-10.4+(lanes and harness), WP13.1 (rig), WP06.1 (fracture spike), WP14.1+(masters), WP11.1 (graybox), WP02.8 (rewind for WP04). The fake bridge is+G0.11, so no package waits on WP17.++## 6. Sub-task counts++| WP | Package | Sub-tasks |+|---|---|---|+| WP01 | Movement | 11 |+| WP02 | Weapons, recoil, projectiles, magazines | 14 |+| WP03 | Penetration and material table | 8 |+| WP04 | Melee and finisher | 7 |+| WP05 | Gore and setting | 8 |+| WP06 | Destruction and repair drones | 11 |+| WP07 | Bot perception and belief map | 10 |+| WP08 | Bot decisions, EQS, learning | 11 |+| WP09 | Bot aim, tiers, adaptive | 8 |+| WP10 | Harness | 11 |+| WP11 | Hangar arena and combat mode switch | 12 |+| WP12 | Bridge, ops and engineering decks | 11 |+| WP13 | Characters, FPS skeleton, animations | 10 |+| WP14 | Weapon models, materials, style | 10 |+| WP15 | Crew and daily life | 9 |+| WP16 | Terminals and stations | 8 |+| WP17 | Backend verse host and bridge | 13 |+| WP18 | HUD, armoury, menus, kill cam | 10 |+| WP19 | Audio | 9 |+| WP20 | Pixel Streaming side panel | 6 |+| WP21 | Progression and duel stats | 7 |+| WP22 | Packaging, installer, updater, Linux | 9 |+| | Total | 213 |