Skip to content

refactor: make experiment telemetry swarm-native - #67

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

christopherjnelson merged 1 commit into
mainfrom
refactor/swarm-native-telemetry

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

PR 3 of the zero-swarm migration. Follows #66.

Makes the export/archive telemetry pipeline swarm-native and removes the last legacy compatibility shims.

Export schema v12

schemaVersion is now z.literal(12); versions 9, 10 and 11 are dropped. Those versions existed to describe exports written before independent attempt accounting and, earlier, tick summaries — shapes the exporter can no longer produce.

  • Attempt accounting becomes an unconditional invariant instead of a schema-v11-only rule. The paired conditionals ("schema-v11 exports require independent attempt accounting" / "Legacy exports cannot claim schema-v11 attempt accounting") collapse into one.
  • ExperimentSource makes swarmTicks, providerAttempts, attemptRetention and attemptAccounting required; the version-conditional spreads and their ?? [] / ?. guards are gone.
  • The archive importer accepts v12 only and rejects anything else outright. New test covers that rejection.

Last compatibility shim removed

archivedAppliedScenarioSchema no longer preprocesses cognitionMode/decisionContractVersion into historicalCognitionMode/historicalDecisionContractVersion. That removes the final legacy-multi-agent literal — grep -rn "legacy-multi-agent" apps packages now returns zero hits.

The schema keeps its name rather than collapsing into appliedScenarioSchema: it still tolerates archived scenarios written under relaxed pre-v2 execution-limit and objective defaults, which is unrelated to cognition architecture. A parallel manifest-level shim was removed alongside it.

Documentation

ADR 0033 records the retirement. It is deliberately explicit that the argument is structural — one planning call per tick versus one per agent per tick, which follows from the call pattern regardless of model or price — and states plainly that no run in this repository has compared legacy against zero-swarm cognition on real providers. The offline fixture was scripted with latency zero by construction and omitted cost; the live comparison is a Jev ablation that deliberately excluded legacy mode. The ADR claims no evidence it does not have.

Eleven ADRs specific to the retired architecture are marked Superseded by ADR 0033 in their own existing status style. Where supersession is partial (0009 model catalog, 0028 reflex seam, 0030 World Lab) the note says precisely which part is superseded and which still applies. Nothing is deleted or rewritten.

ZERO_SWARM_COMPARISON.md is marked a historical migration experiment with its findings, tables and numbers left intact. LIVE_SWARM_COMPARISON.md and EXPERIMENT_ARCHIVE.md get factual corrections only.

Comparison tooling

Verified, no changes needed — both harnesses, their CLIs, help text and tests already compare only Zero+Jev against Zero+deterministic workers. PR 1 had retired the legacy variant.

Validation

pnpm validate → pass. pnpm test:e2e → 2/2 pass. 221 tests across 26 files.

Known follow-ups

  • EXPERIMENT_ARCHIVE.md is staler than its schema-version claims — its command list and storage-schema prose still describe tables dropped in PR 1/2. Flagged in-file; belongs to PR 5's documentation rewrite.
  • world-lab.tsx still carries const swarmMode = true with dead !swarmMode branches — PR 4.

🤖 Generated with Claude Code

Bump the experiment export schema to version 12 and drop support for
versions 9, 10, and 11. Those versions existed to carry exports written
before independent attempt accounting and, earlier, tick summaries; with
the legacy architecture gone, their conditional branches only described
shapes the exporter can no longer produce.

Attempt accounting is now unconditional rather than a schema-v11-only
requirement, and the exporter always emits swarm ticks, provider
attempts, retention, and accounting instead of spreading them
conditionally. The archive importer accepts version 12 alone and rejects
anything else outright rather than migrating it.

Remove the last scenario compatibility shim: archivedAppliedScenarioSchema
no longer translates cognitionMode/decisionContractVersion into historical
fields, which removes the final 'legacy-multi-agent' literal from the
codebase. The schema keeps its name because it still tolerates archived
scenarios written under relaxed pre-v2 execution and objective defaults,
which is unrelated to cognition architecture.

Documentation records the decision rather than rewriting the past. ADR
0033 states the retirement and is explicit that the argument is
structural — one planning call per tick versus one per agent per tick —
and that no run in this repository has compared legacy against zero-swarm
cognition on real providers. Eleven ADRs specific to the retired
architecture are marked superseded in their existing status fields;
none are deleted. The offline comparison report is marked a historical
migration experiment with its findings preserved intact.

Co-Authored-By: Claude Opus 5 <[email protected]>
@christopherjnelson
christopherjnelson marked this pull request as ready for review September 22, 2026 10:50
@christopherjnelson
christopherjnelson merged commit 0279158 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