Skip to content

refactor(world-lab): remove legacy agent controls - #68

Merged
christopherjnelson merged 1 commit into
mainfrom
refactor/world-lab-swarm-native-controls
Sep 22, 2026
Merged

christopherjnelson merged 1 commit into
mainfrom
refactor/world-lab-swarm-native-controls

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

PR 4 of the zero-swarm migration. Follows #67.

What

apps/world-lab/src/components/world-lab.tsx still declared const swarmMode = true in four places — the WorldLab body, a ModelConsole default prop no caller ever passed, AgentRoster, and ExperimentExportPanel — with roughly 44 references and permanently-dead !swarmMode branches behind them. The zero swarm is the only cognition architecture, so this was a fake two-mode abstraction. It is gone: grep -rn "swarmMode" apps packages returns zero hits, and no mode prop, ternary, or commented-out branch replaces it. Containers left empty by a removal were removed too.

Removed

  • Experiment details: the "Retained turns", "Patient Zero" and "Tokens" entries.
  • Alerts: the !providerConfigured block and the reasoningUnavailable path.
  • Architecture summary: the providerMode active-model-assignment-count branch.
  • Model console: the "Apply global model to all agents" button, the entire agent-model-overrides block (per-agent model overrides for independent generative workers), and the orphaned behavior tab value.
  • Agent roster: the dead controlledCellCount line. Territory remains in the inspector.
  • Export panel: agent checkboxes, export level, turn range / latest / from-to inputs, the outcome and action FilterChecks, and the custom-switches fieldset — plus module-level defaultCustomOptions, FilterChecks, and customOptionLabel.

Relabelled

Model configuration reads as "Agent Zero model", not a global agent model, across the trigger, dialog, headings, and aria-labels. The trigger reports planner readiness rather than an "N of M agents ready" count that could only ever be one of one. AgentsWorkspace no longer describes "global assignments and explicit overrides".

The ExperimentModelConfiguration schema fields (globalModelId, globalReasoningProfile, overrides) are deliberately unchanged — they live in packages/shared and feed the v12 export, so renaming them belongs in its own PR. Only the presentation moves; the UI now always submits an empty override list, since nothing can create one.

Kept and improved

The JSON serialization control was stranded inside the dead branch even though serialization feeds the live swarm request, so pretty output was unreachable — it now renders in the swarm path. The export intro and the preview's cost label no longer explain themselves in terms of migration history, per the acceptance bar that a first-time reader should understand the architecture without it.

Also removed an unused snapshot prop on the export panel and a dead useLayoutEffect import; apps/world-lab lint is now at zero warnings, down from one on main.

Tests

swarm-view.test.tsx:150 is untouched — the queryByText(/alliance|chat|personality|memory/i) negative assertion still proves those surfaces are absent. Two component tests added: the model console exposes exactly one planner row with no worker-named controls, and the export dialog offers no agent/turn/level/outcome/action filters while keeping Preview, Generate export, and serialization.

Validation was run locally by the repository owner and reported green:

pnpm validate     # 223 tests passed, 0 lint errors
pnpm test:e2e     # 2 passed

Scope

Carried forward to PR 5, untouched here: the stale command list and storage-schema prose in docs/EXPERIMENT_ARCHIVE.md; simulation-service.ts passing [] to calculateExperimentMetrics, so live metrics read zero; and movementDirectionDistribution, longestRepeatedDirectionStreak and recentCellRevisits always reading zero for want of a fromCell→toCell helper.

🤖 Generated with Claude Code

World Lab still carried a `swarmMode = true` constant in four places with
permanently-dead `!swarmMode` branches behind it. The zero swarm is the only
cognition architecture, so the two-mode abstraction was fiction. Delete the
constants, the ModelConsole `swarmMode` prop, and every dead branch, removing
the containers that were left empty.

Removed dead surfaces: the "Retained turns", "Patient Zero" and "Tokens"
experiment-detail entries; the providerMode model-assignment summary; the
`!providerConfigured` and `reasoningUnavailable` alerts; the "Apply global
model to all agents" button; the per-agent model override block; the roster
controlled-cell line; and the whole export filter UI (agent checkboxes, export
level, turn range, outcome and action filters, custom switches) along with
`defaultCustomOptions`, `FilterChecks` and `customOptionLabel`.

Model configuration now reads as "Agent Zero model" rather than a global agent
model, and the trigger reports planner readiness instead of an "N of M agents
ready" count that could only ever be one of one. The `ExperimentModelConfiguration`
schema fields are unchanged; only the presentation moves, and the UI now always
submits an empty override list.

Keep and improve the swarm-native surfaces: the JSON serialization control was
stranded inside the dead branch despite feeding the live request, so it is now
reachable; the export intro and preview no longer explain themselves in terms
of migration history.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@christopherjnelson
christopherjnelson marked this pull request as ready for review September 22, 2026 11:57
@christopherjnelson
christopherjnelson merged commit dbabf48 into main Sep 22, 2026
2 checks passed
@christopherjnelson
christopherjnelson deleted the refactor/world-lab-swarm-native-controls branch September 22, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant