Problem
The office visualization needs a spatial adapter that maps the visualization-agnostic LogicalSceneState (#299) to the 3-zone facility layout (prep area, workshop, governor's office). Branch 295's implementation used a 5-room layout that has been superseded.
Context
With #299 providing LogicalSceneState — a stable snapshot of what each agent and artifact is doing — this ticket covers the office-specific spatial layer: assigning entities to zones and slots, calculating corridor paths, resolving pixel positions, detecting changes, and planning transitions.
The 3-zone layout is defined in packages/factory/docs/visions/facility-architecture.md:
- Prep area (top-left): architect + planner workstations
- Workshop (top-right): coder + 3–5 reviewer workstations + whiteboard display
- Governor's office (bottom, full width): orchestrator desk + delivery table + control console
Salvageable code exists on branch 295-salvage for the position resolver, differ, and transition planner. The room definitions, slot assignments, corridor paths, and agent assignments need rewriting for the new zones.
The adapter consumes LogicalSceneState, not CanonicalRunStatus — no logical state derivation in this layer.
Depends on: #299 (shared logical scene state)
Solution
1. Zone definitions
Define 3 zones replacing the old 5 rooms:
| Zone |
ID |
Slots |
| Prep area |
prep |
prep-ws-0 (architect), prep-ws-1 (planner), prep-display-0 |
| Workshop |
workshop |
workshop-ws-0 (coder), workshop-ws-1 through workshop-ws-5 (reviewers), workshop-display-0 (whiteboard) |
| Governor's office |
governor |
governor-ws-0 (orchestrator), governor-storage-0/-1 (delivery table), governor-display-0 (control console) |
2. Office adapter
mapLogicalToOffice(logical: LogicalSceneState): OfficeSceneConfig
Maps agents to zone/slot assignments based on phase, derives zone states, assigns artifacts to producer slots. Consumes the output of #299.
3. Corridor paths
Three zone pairs, each bidirectional:
- prep ↔ workshop (horizontal gap between upper zones)
- prep ↔ governor (vertical, through doorway)
- workshop ↔ governor (vertical, through doorway)
4. Downstream layers (adapted from 295-salvage)
- Position resolver:
OfficeSceneConfig + FacilityLayout → ResolvedPositions
- Differ:
diffOfficeConfigs(prev, next) → OfficeDiff
- Transition planner:
planTransitions(diff, positions, layout) → TransitionPlan
- OfficeScene: Excalibur scene wiring the pipeline together (geometric placeholders)
5. Interfaces
OfficeSceneConfig as the scene snapshot type
FacilityLayout with query methods (slotPosition, corridorPath, etc.)
OfficeDiff + TransitionPlan for the animation pipeline
6. Out of scope
Acceptance criteria
Problem
The office visualization needs a spatial adapter that maps the visualization-agnostic
LogicalSceneState(#299) to the 3-zone facility layout (prep area, workshop, governor's office). Branch 295's implementation used a 5-room layout that has been superseded.Context
With #299 providing
LogicalSceneState— a stable snapshot of what each agent and artifact is doing — this ticket covers the office-specific spatial layer: assigning entities to zones and slots, calculating corridor paths, resolving pixel positions, detecting changes, and planning transitions.The 3-zone layout is defined in
packages/factory/docs/visions/facility-architecture.md:Salvageable code exists on branch
295-salvagefor the position resolver, differ, and transition planner. The room definitions, slot assignments, corridor paths, and agent assignments need rewriting for the new zones.The adapter consumes
LogicalSceneState, notCanonicalRunStatus— no logical state derivation in this layer.Depends on: #299 (shared logical scene state)
Solution
1. Zone definitions
Define 3 zones replacing the old 5 rooms:
prepprep-ws-0(architect),prep-ws-1(planner),prep-display-0workshopworkshop-ws-0(coder),workshop-ws-1throughworkshop-ws-5(reviewers),workshop-display-0(whiteboard)governorgovernor-ws-0(orchestrator),governor-storage-0/-1(delivery table),governor-display-0(control console)2. Office adapter
mapLogicalToOffice(logical: LogicalSceneState): OfficeSceneConfigMaps agents to zone/slot assignments based on phase, derives zone states, assigns artifacts to producer slots. Consumes the output of #299.
3. Corridor paths
Three zone pairs, each bidirectional:
4. Downstream layers (adapted from 295-salvage)
OfficeSceneConfig + FacilityLayout → ResolvedPositionsdiffOfficeConfigs(prev, next) → OfficeDiffplanTransitions(diff, positions, layout) → TransitionPlan5. Interfaces
OfficeSceneConfigas the scene snapshot typeFacilityLayoutwith query methods (slotPosition,corridorPath, etc.)OfficeDiff+TransitionPlanfor the animation pipeline6. Out of scope
Acceptance criteria
mapLogicalToOffice()correctly assigns agents and artifacts to zones/slotsLogicalSceneState