Skip to content

refactor: remove legacy social agent systems - #66

Merged
christopherjnelson merged 1 commit into
mainfrom
refactor/remove-legacy-social-agent-systems
Sep 22, 2026
Merged

christopherjnelson merged 1 commit into
mainfrom
refactor/remove-legacy-social-agent-systems

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

PR 2 of the zero-swarm migration. Follows #65 (refactor: make zero swarm the sole cognition architecture).

Removes the social/cognition machinery that existed for the retired independent multi-agent architecture. Agent Zero plus Jev reflex workers over the deterministic H3 engine is the only architecture now, so the concepts these systems modelled no longer exist in the game.

32 files changed, +943 / −13,185.

Removed

  • personalities, behavior/strategy profiles, behavior assignment (packages/shared/src/behavior.ts)
  • agent-to-agent communication: public, direct, alliance and zero channels, ranges, delivery, observations, metrics, UI
  • diplomacy, alliances, alliance proposals, and their events/validation/UI
  • model-authored worker goals and prose worker memories
  • the legacy per-agent generative decision contract: agentDecisionSchema, providerDecisionEnvelopeSchema, AgentTurnRecord, export turn records
  • ObservationHistory and the Behavior Trace panel
  • the legacy experiment import surface (/api/simulation/experiment/import, importModelConfiguration, experimentImport*Schema incl. its legacy: boolean field)
  • 155 lines of orphaned CSS for the removed markup

Consequential details

  • Alliance branches are gone from world rules. allied-controller is unreachable without alliances, so it leaves both action-reason enums, and move-option controllerRelationship shrinks to ['open','self','other'].
  • Turn-shaped export counters (matchingTurnCount, firstMatchingTurn, lastMatchingTurn, turnsWithUnknownCost) go with the turn records they counted. Export metrics now derive from swarmTicks + providerAttempts.
  • Archive migration 6 drops the legacy tables/columns, following the package's append-only convention. failures() was re-pointed from the deleted model_attempts to provider_attempts.
  • No legacy compatibility is retained. Pre-swarm exports require an older Git revision to read.
  • NonCommunicationWorldEvent → PhysicalWorldEvent, which describes what it is rather than what it is not.

Preserved

Physical worker identity (id, name, color, position), infection, capture, the deterministic engine, Agent Zero, Jev, provider accounting, swarm telemetry, safe exports, and the swarm-useful archive surface. Test coverage retained for deterministic legality, simultaneous resolution, Zero planning, Jev candidate selection, pressure, captures, directive completion, attempt accounting, provider cost attribution, and export safety.

Validation

pnpm validate → pass (format, lint, typecheck, test, build). pnpm test:e2e → 2/2 pass. 222 tests across 26 files.

Known follow-ups (not in this PR)

  • world-lab.tsx still has const swarmMode = true with dead !swarmMode branches (44 refs) — PR 4's headline item.
  • archivedAppliedScenarioSchema retains historicalCognitionMode/historicalDecisionContractVersion incl. the string legacy-multi-agent — PR 3.
  • simulation-service.ts passes [] to calculateExperimentMetrics, so live World Lab metrics read zero. Pre-existing, but swarmTicks now makes real data available.
  • movementDirectionDistribution / longestRepeatedDirectionStreak / recentCellRevisits are always zero; direction is no longer recoverable without a fromCell→toCell helper.

🤖 Generated with Claude Code

Remove the social/cognition machinery that existed for the retired
independent multi-agent architecture. Agent Zero plus Jev reflex workers
over the deterministic H3 engine is now the only architecture, so the
concepts these systems modelled no longer exist in the game.

Removed domain machinery:
- personalities, behavior/strategy profiles, and behavior assignment
- agent-to-agent communication (public, direct, alliance, zero channels)
- diplomacy, alliances, and alliance proposals
- model-authored worker goals and prose worker memories
- the legacy per-agent generative decision contract (agentDecisionSchema,
  providerDecisionEnvelopeSchema, AgentTurnRecord, export turn records)
- observation history and the Behavior Trace panel
- the legacy experiment import surface, including its `legacy` response
  field; pre-swarm exports now require an older revision to read

World snapshots, scenarios, observations, metrics, exports, and the
experiment archive drop the fields that carried those concepts. Capture
and movement lose their alliance-specific branches: `allied-controller`
is unreachable without alliances, so both action-reason enums and the
move-option `controllerRelationship` enum shrink accordingly. Turn-shaped
export counters go with the turn records they counted, and archive
migration 6 drops the corresponding tables and columns.

Renames NonCommunicationWorldEvent to PhysicalWorldEvent, which now
describes what it is rather than what it is not.

Physical worker identity is preserved: agents keep id, name, color, and
position. Deterministic legality, simultaneous resolution, Zero planning,
Jev candidate selection, pressure, captures, directive completion,
attempt accounting, provider cost attribution, and export safety keep
their test coverage.

Co-Authored-By: Claude Opus 5 <[email protected]>
@christopherjnelson
christopherjnelson marked this pull request as ready for review September 22, 2026 10:28
@christopherjnelson
christopherjnelson merged commit 6df4d1e into main Sep 22, 2026
2 checks passed
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