Skip to content

Create 3-zone adapter for office visualization #303

Description

@williamthorsen

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

  • 3-zone definitions with correct slot assignments
  • mapLogicalToOffice() correctly assigns agents and artifacts to zones/slots
  • Corridor paths work for all zone pairs
  • Position resolver produces correct pixel coordinates for the new layout
  • Differ detects changes across all entity types
  • Transition planner produces valid animation instructions
  • OfficeScene integrates the full pipeline with geometric placeholders
  • Comprehensive tests for all layers
  • No logical state derivation in the office layer — it consumes LogicalSceneState

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions