Skip to content

Multiple reviewers overlap with simplifier subagent #287

Description

@williamthorsen

Three-zone factory-floor visualization

Problem

When additional reviewers spawn during the review phase, they overlap with the simplifier subagent. The root cause is that the current single-row catwalk layout recomputes station positions when agent counts change, but existing actors are not repositioned. The canvas is also too wide relative to its height, wasting vertical space.

Context

The current "catwalk" visualization arranges all phases in a single horizontal row. Station positions are computed from actual agent counts, so when parallel reviewers appear mid-run, stations to the right shift — but existing actor positions are stale.

The visualization layer is currently tightly coupled: App.tsx hardcodes CatwalkCanvas, which hardcodes CatwalkScene. However, the data model (CanonicalRunStatus) is already visualization-agnostic, and the catwalk's mapper (mapRunToCatwalk) is a clean transformation boundary. Introducing a visualization abstraction layer is lightweight.

Solution

Two parts:

Part 1: Visualization abstraction layer

Decouple visualization selection from App.tsx so multiple visualizations can coexist:

  • Extend useSelectionParams to include a vis param (persisted via history.replaceState, survives back/forward navigation)
  • Add a <select> dropdown next to the demo control icon in the menu bar — always visible, even without a run selected
  • Define a shared visualization component contract: { status: CanonicalRunStatus }
  • Render the selected visualization dynamically in App.tsx via a registry
  • Keep the existing catwalk visualization completely untouched

Part 2: New "factory floor" visualization

Add a new visualization as a sibling of catwalk/ under visualizations/factory-floor/ with its own mapper, layout engine, scene, and types:

         ┌─────────┐ ┌─────────┐
         │Architect │ │ Planner │                                   upper platform
         └────┬─────┘ └────┬────┘
  ═══════════╪═════════════╪══════════════════╤══════════╤═══════
     🤖 Orchestrator  ← → → →               │  Coder   │Summary│  rail
  ═══════════╪═════════════╪══════════════════╧══════════╧═══════
         ┌───┴───┐┌────┐┌────┐      ┌──────┐ ┌──────┐
         │  R1   ││ R2 ││ R3 │      │ Simp │ │ Holi │              lower platform
         └───────┘└────┘└────┘      └──────┘ └──────┘
          reviewers (flex)           anchored right

Three zones:

  • Upper platform (above rail): Architect, Planner — analysis phases
  • Rail level: Orchestrator walks horizontally. Coder room at the far right (same horizontal plane). Summary is a destination position past the coder — not an agent (no sprite, no chute)
  • Lower platform (below rail): Reviewers (flexible count, fill from left), Simplifier and Holistic (anchored right)

Key design properties:

  • 4:3 aspect ratio canvas (800×600 logical resolution as starting point). Excalibur DisplayMode.FitContainer scales to fill available viewport space. Distances and dimensions should be proportionate; do not try to fill all vertical space.
  • Message area at the top of the canvas, above the rail. Reserved space for future status messages (e.g., "Phase 1: Analysis", "Run complete!"). No messages in this implementation — just allocate the space.
  • Layout is computed once at scene creation and never changes during a run
  • Reviewer zone accommodates any number of reviewers via adaptive spacing
  • Simplifier and Holistic are fixed-position, unaffected by reviewer count
  • Coder room is a rail-level extension — orchestrator walks in to deliver/receive artifacts
  • No chutes for rail-level stations (coder, summary). Only upper-zone and lower-zone stations get chutes connecting them to the rail
  • No gates in the factory floor (gates are a catwalk-specific concept)
  • Upper/lower agents connect to the rail via chutes (up for upper zone, down for lower zone)

Orchestrator choreography:

  1. Walks right to coder room → delivers plan, receives code
  2. Walks left, dispatches artifacts via chutes to lower platform (reviewers)
  3. Collects review findings, walks right to coder for fixes
  4. Fix cycle repeats (right ↔ left)
  5. Final: walks through coder room to summary position → celebrates

Implementation approach: Get the geometry right first — zone boundaries, anchor points, agent placement — using simple visual markers (thin grey lines for zone demarcation). Reuse existing sprite and actor infrastructure from catwalk where possible. Layer on visual polish afterward.

Acceptance criteria

Visualization abstraction

  • vis param in useSelectionParams — persisted in URL, survives back/forward
  • <select> dropdown next to demo control icon — always visible
  • Existing catwalk visualization is unchanged and still works
  • Both visualizations receive the same CanonicalRunStatus data

Factory-floor canvas

  • 4:3 aspect ratio (800×600 logical resolution, scales via FitContainer)
  • Reserved message area at the top of the canvas above the rail (empty for now)

Factory-floor layout

  • Layout has three vertical zones: upper platform, rail, lower platform
  • Architect and Planner are on the upper platform above the rail
  • Coder room is at rail level on the right, reachable by the orchestrator walking right
  • Summary is a destination position past the coder — no agent, no sprite, no chute
  • Reviewers fill the lower-left zone with adaptive spacing for any count
  • Simplifier and Holistic are anchored to the lower-right, unaffected by reviewer count
  • Chutes connect the rail to upper and lower platforms only (no chutes for rail-level stations)
  • No gates in the factory floor
  • Layout does not change when agents spawn mid-run
  • Orchestrator walks horizontally on the rail (no 2D pathfinding required)
  • No agent overlap regardless of reviewer count

Quality gates

  • All existing catwalk tests pass without modification
  • New factory-floor layout has its own test suite
  • TypeScript compiles cleanly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions