@shapeshift-labs/frontier-swarm
v0.5.20
Published
Hierarchical swarm plans, lanes, compute profiles, ownership policy, events, and proofs for Frontier agent work.
Downloads
4,871
Maintainers
Readme
@shapeshift-labs/frontier-swarm
Hierarchical swarm plans, lanes, compute profiles, ownership policy, events, and proofs for Frontier agent work.
frontier-swarm turns parallel agent work into data: manifests, parent/child swarm layers, compute profiles, lane ownership, task queues, dry-run plans, event streams, changed-path checks, job results, and proof hashes. It does not spawn processes, create git worktrees, call Codex, or talk to queue brokers. Runners attach through structural adapters such as @shapeshift-labs/frontier-swarm-codex.
Related Packages
The published Frontier package family is generated from one shared package catalog so READMEs stay in sync across packages:
@shapeshift-labs/frontier: Core JSON diff/apply, compact patch tuples, JSON Pointer, equality, clone, validation, Unicode helpers, and tiny dependency-free runtime budget/scheduler primitives.@shapeshift-labs/frontier-query: Shared query-key, selector path, condition, entity identity, and table-shape primitives.@shapeshift-labs/frontier-codec: Patch serialization, binary frames, canonical JSON, and patch-history codecs.@shapeshift-labs/frontier-engine: Stateful planned diff engine, adaptive profiles, schema plans, and engine-level history helpers.@shapeshift-labs/frontier-state: Patch-routed app-state subscriptions, owned commits, maintained views, and path mapping.@shapeshift-labs/frontier-dataflow: Serializable incremental dataflow and materialized-view graphs for Frontier apps, including selectors, dependency DAGs, filters, joins, aggregations, stale paths, recompute budgets, output patches, provenance records, and proof of why derived views changed.@shapeshift-labs/frontier-state-cache: Normalized query-result cache with entity/query watchers, persistence, change logs, optimistic layers, scheduled persistence, and mutation bridge.@shapeshift-labs/frontier-state-cache-idb: IndexedDB persistence adapter for Frontier state-cache snapshots and durable change logs.@shapeshift-labs/frontier-state-cache-file: Structured file persistence adapter for Frontier state-cache snapshots and change logs.@shapeshift-labs/frontier-state-cache-sql: SQL persistence adapter for Frontier state-cache snapshots and change logs.@shapeshift-labs/frontier-schema: JSON Schema validation, Frontier profile generation, CloudEvent envelopes, and query/table schema helpers.@shapeshift-labs/frontier-migrations: Boundary-first data migrations, import normalization, plugin/API version mapping, versioned envelopes, graph diagnostics, patch path rewrites, dry-run reports, and current-shape rehydration.@shapeshift-labs/frontier-event-log: Bounded event logs, replay cursors, consumer acknowledgements, keyed compaction, checkpoints, and Frontier patch event records.@shapeshift-labs/frontier-inspect: Cross-package inspection/evidence bundles, registry graph snapshots, feature/resource impact reports, timeline/event normalization, redaction, JSONL import/export, and AI-readable app feature maps.@shapeshift-labs/frontier-scheduler: Deterministic work scheduling, lanes, cancellation, backpressure, frame policies, replay snapshots, and work graphs.@shapeshift-labs/frontier-logging: Opt-in structured logging, browser telemetry, scheduled sinks, file sinks, exporters, benchmark traces, and Frontier patch/update summaries.@shapeshift-labs/frontier-mutation: Explicit mutation and selector plans compiled to Frontier patches or CRDT operations.@shapeshift-labs/frontier-effects: Serializable effect descriptors and resource graphs for Frontier apps, including fetch, storage, timers, navigation, workers, clipboard, broadcast, WebSocket, stream, policy metadata, runtime records, redaction, JSONL, proof helpers, and registry graph output.@shapeshift-labs/frontier-auth: Frontier-native auth contracts for providers, sessions, profile completeness, route and resource gates, account-linking policy, token issue/verify plans, runtime grants, audit events, registry graphs, lint resources, and auth evidence without owning app secrets, crypto, storage, or provider SDKs.@shapeshift-labs/frontier-policy: Serializable policy and capability decisions for Frontier apps, effects, views, sync, routes, traces, and AI tools.@shapeshift-labs/frontier-flags: Patchable policy-aware feature flag state for Frontier apps, including targeting, deterministic rollouts, experiment variants, kill switches, exposure records, audit logs, and replay evidence.@shapeshift-labs/frontier-tools: Serializable app action/tool manifests for AI-operable Frontier apps, including availability, validation, dry-run plans, patch previews, effect/tool constraints, execution records, rollback links, and registry graph output.@shapeshift-labs/frontier-sandbox: Runtime-agnostic sandbox contracts for Frontier patch-producing actions, including manifests, declared reads/writes/capabilities, host-validated patch/effect/event/log results, dynamic source modules, source event replay, and structural runtime adapters.@shapeshift-labs/frontier-sandbox-quickjs: QuickJS/WebAssembly runtime adapter for Frontier sandbox actions, including invocation/runtime isolation modes, deadline and memory limits, dynamic source execution, and patch/effect result normalization.@shapeshift-labs/frontier-workflow: Serializable durable workflow/process manifests for Frontier apps, including steps, waits, approvals, timers, retries, expected patches, compensation, records, timelines, and registry graph output.@shapeshift-labs/frontier-worker: Serializable worker and edge task descriptors for Frontier apps, including queues, idempotency keys, retry and timeout policy, declared reads/writes/effects, snapshots, patch outputs, produced assets, execution records, logs, trace links, proof hashes, dedupe indexes, and registry graph output.@shapeshift-labs/frontier-queue: Serializable durable queue state, leases, retries, dedupe keys, patch-carrying jobs, dead-letter records, replay evidence, and queue inspection for Frontier apps.@shapeshift-labs/frontier-swarm-codex: Node Codex CLI adapter for Frontier swarm plans, including prompt rendering, worktree and snapshot workspaces, Codex argument compatibility, browser resource allocation, JSONL capture, verification commands, pid-backed stop, collect/apply workflows, merge indexes, queue overlays, merge bundles, normalized job evidence, coordinator query artifacts, and result artifacts.@shapeshift-labs/frontier-lang-kernel: Runtime-neutral semantic source graph, type/lattice/extern declarations, patch bundles, replay, hashing, evidence records, and merge-admission kernel for Frontier Lang.@shapeshift-labs/frontier-lang-parser: Dependency-light Frontier Lang parser for modules, entities, state, actions, effects, types, externs, targets, and lattice declarations.@shapeshift-labs/frontier-lang-checker: Checker and diagnostics for Frontier Lang semantic documents, including type symbols, effects, regions, lattice laws, CRDT metadata, and patch evidence.@shapeshift-labs/frontier-lang-typescript: TypeScript projection adapter for Frontier Lang semantic documents, including type/entity/state/action/extern declarations and CRDT lattice descriptors.@shapeshift-labs/frontier-lang-javascript: JavaScript projection adapter for Frontier Lang semantic documents, including ESM action stubs and schema/lattice descriptors.@shapeshift-labs/frontier-lang-rust: Rust projection adapter for Frontier Lang semantic documents, including structs, aliases, and action stubs.@shapeshift-labs/frontier-lang-python: Python projection adapter for Frontier Lang semantic documents, including dataclasses, typed patch records, and action stubs.@shapeshift-labs/frontier-lang-c: C header projection adapter for Frontier Lang semantic documents, including structs and action prototypes.@shapeshift-labs/frontier-lang-compiler: Compiler facade for Frontier Lang source documents, including parse, check, hash, diagnostics, universal AST envelopes, proof/paradigm semantic summaries, projection to TypeScript, JavaScript, Rust, Python, and C, and native source-import adapters for semantic merge evidence.@shapeshift-labs/frontier-lang-swift: Swift source-language importer package for Frontier Lang semantic documents, including package-level metadata, SwiftSyntax adapter helpers, native import results, and semantic sidecar generation for SwiftSyntax/SwiftParser-shaped syntax trees.@shapeshift-labs/frontier-lang-kotlin: Kotlin PSI source-language importer package for Frontier Lang semantic documents, including package-level metadata, Kotlin PSI adapter helpers, native import results, and semantic sidecar generation for Kotlin PSI/KtFile-shaped syntax trees.@shapeshift-labs/frontier-lang-java: Java source-language importer package for Frontier Lang semantic documents, including package-level metadata, Java AST adapter helpers, native import results, and semantic sidecar generation for javac/JDT/JavaParser-shaped ASTs.@shapeshift-labs/frontier-lang-go: Go source-language importer package for Frontier Lang semantic documents, including package-level metadata, Go AST adapter helpers, native import results, and semantic sidecar generation for go/ast File or Package trees.@shapeshift-labs/frontier-lang-csharp: C# Roslyn source-language importer package for Frontier Lang semantic documents, including package-level metadata, Roslyn adapter helpers, native import results, and semantic sidecar generation for SyntaxTree/SyntaxNode-shaped ASTs.@shapeshift-labs/frontier-lang-clang: Clang AST source-language importer package for Frontier Lang semantic documents, including package-level metadata, Clang AST JSON adapter helpers, native import results, and semantic sidecar generation for C/C++ translation units.@shapeshift-labs/frontier-lang-cli: Command line interface for parsing, checking, hashing, and emitting Frontier Lang projects.@shapeshift-labs/frontier-lang: Umbrella package for Frontier Lang kernel, parser, checker, compiler facade, universal AST helpers, projection adapters, and source-language importer adapters.@shapeshift-labs/frontier-kv: Serializable in-memory key/value state for Frontier apps, including TTL, versioned compare-and-set, batched patch mutations, scans, watchers, snapshots, JSONL event evidence, and replay verification.@shapeshift-labs/frontier-kv-locks: Lease-style lock records on top of Frontier KV, including acquire, renew, release, fencing tokens, expiration, owner evidence, and replayable lock events.@shapeshift-labs/frontier-kv-rate-limit: Patch-native rate limit buckets for Frontier KV, including fixed windows, sliding windows, token buckets, deterministic refill, consume evidence, and reset records.@shapeshift-labs/frontier-kv-file: Node file persistence adapter for Frontier KV snapshots and append-only JSONL event logs, including atomic writes, compaction, replay loading, and adapter evidence.@shapeshift-labs/frontier-kv-idb: IndexedDB persistence adapter for Frontier KV snapshots and event logs, with structural IDB interfaces, upgrade planning, compact event storage, and replay loading.@shapeshift-labs/frontier-kv-redis: Redis-compatible command planning and structural client adapter for Frontier KV operations, including key mapping, TTL commands, optimistic CAS scripts, and replay evidence without bundling Redis drivers.@shapeshift-labs/frontier-kv-server: Small Node HTTP server adapter for Frontier KV, including request planning, JSON endpoints for get/set/delete/scan/batch, optional rate-limit hooks, and replayable response evidence.@shapeshift-labs/frontier-assets: Serializable asset and content provenance graphs for Frontier apps, including source files, generated variants, thumbnails, LOD chunks, shader/material dependencies, transforms, hashes, owners, runtime consumers, review plans, registry graph output, and impact queries.@shapeshift-labs/frontier-blueprint: Serializable Blueprint/Prefab flyweight templates for Frontier apps, including parameterized instantiation, deterministic ID/path remapping, compact overrides, variants, effective-state materialization, scene/state patch emission, dependency metadata, and registry graph output.@shapeshift-labs/frontier-triggers: Capability-gated event trigger registry, scoped event envelopes, listener/reaction rules, structured rejection, deterministic event-to-action scheduling, replay/provenance records, and registry graph output.@shapeshift-labs/frontier-virtual: DOM-neutral virtualization, layout providers, range materialization, grids, spatial/frustum indexes, patch invalidation, camera anchors, and serializable layout state.@shapeshift-labs/frontier-table: Renderer-neutral data grid and table primitives for Frontier apps, including stable row identity, sorting, filtering, selection, virtual ranges, patch-driven edits, cache/dataflow descriptors, and CRDT-compatible row and cell operation frames.@shapeshift-labs/frontier-scene: Patch-native 2D/3D scene graph, transform propagation, bounds queries, virtual/culling adapters, spatial invalidation, and camera/frustum materialization.@shapeshift-labs/frontier-pathfinding: Patch-native grid pathfinding, typed-array A*/Dijkstra search, flow fields, connected components, line-of-sight smoothing, dirty-cell invalidation, and scheduler-friendly path jobs.@shapeshift-labs/frontier-lod: Patch-native level-of-detail and significance selection for rendering and computation workloads, compact typed hot paths, multi-observer selection, budget degradation, materialization frames, and scheduler work plans.@shapeshift-labs/frontier-route: DOM-neutral app/game route resources, route and scene manifests, match/resolve/transition planning, dependency metadata, sessions, registry graph output, and impact queries.@shapeshift-labs/frontier-trace: Serializable traces, spans, events, causal links, W3C trace context helpers, timeline/resource/path queries, critical-path analysis, registry graph output, JSONL/proof helpers, Chrome trace export, and redaction for app-wide feature observability.@shapeshift-labs/frontier-manifest: Build/static feature manifests for owners, routes, actions, states, migrations, tests, source files, assets, resources, tasks, dependency metadata, registry graph output, feature maps, JSONL export, and impact queries.@shapeshift-labs/frontier-view: Renderer-neutral view manifests, type defaults, validation frames, action bindings, visual channels, virtual/LOD hints, and data-to-representation mapping for Frontier apps.@shapeshift-labs/frontier-icons: Renderer-neutral icon records, icon sets, lookup aliases, SVG frames, string rendering, and registry evidence for Frontier apps.@shapeshift-labs/frontier-design: Renderer-neutral design-system tokens, semantic roles, recipes, target style frames, CSS variable output, and registry graph evidence for Frontier apps.@shapeshift-labs/frontier-canvas: Renderer-neutral infinite canvas surfaces for Frontier apps, including camera and viewport math, pan/zoom plans, grid materialization, snapping, hit testing, selection handles, extensible tool dispatch, frame records, registry graph output, and impact/proof helpers.@shapeshift-labs/frontier-canvas-tools: Renderer-neutral editor tools, state machines, transform handles, permissions, async records, and AI action bridges for Frontier canvas surfaces.@shapeshift-labs/frontier-dnd: Renderer-neutral drag-and-drop sessions, sensor descriptors, collision ranking, drop planning, reorder patches, state partitioning, and registry evidence for Frontier apps.@shapeshift-labs/frontier-dom: Patch-native DOM and host renderer bindings, manifest hydration, JSX runtime/compiler helpers, SSR, devtools, and logging bridges.@shapeshift-labs/frontier-playwright: Playwright/headless automation probes for Frontier state, DOM, devtools, marks, and timeline queries.@shapeshift-labs/frontier-test: Serializable test/spec evidence manifests for Frontier apps, including fixtures, commands, expected patches/effects/routes/policies, coverage declarations, run plans, run records, report adapters, replay proofs, fuzzers, benchmarks, registry graph output, and impact queries.@shapeshift-labs/frontier-fixtures: Deterministic fixture and scenario generation for Frontier apps, including schema-valid sample state, related entity collections, actor personas, route states, replay-verified patch streams, event records, JSONL bundles, and evidence summaries.@shapeshift-labs/frontier-component-preview: Frontier-native component preview books, generated preview manifests, stateful variants, Vite virtual modules, standalone browser preview shells, inspector bridges, and preview harness evidence for Frontier apps.@shapeshift-labs/frontier-documentation: Frontier-native documentation manifests, generated documentation books, package/API/source discovery, Vite virtual modules, standalone browser docs shells, inspector bridges, search indexes, and documentation harness evidence for Frontier apps and packages.@shapeshift-labs/frontier-ast-walk: Dependency-light source graph, import/export/declaration/call analysis, Frontier package-use discovery, and business-logic placement findings for Frontier tools, apps, docs, fuzzers, benchmarks, and agent evidence.@shapeshift-labs/frontier-history: Serializable temporal explanation and causality records for Frontier apps, including field-change explanations, action/workflow/policy/effect/trace/test provenance, audit windows, undo planning, registry/provenance graph output, JSONL replay bundles, and proof hashes.@shapeshift-labs/frontier-application: Serializable whole-application graph and impact queries for Frontier apps, including features, owners, packages, routes, views, actions, mutations, state paths, effects, workers, assets, tests, traces, policies, workflows, migrations, benchmarks, registry graph output, feature maps, JSONL bundles, and proof hashes.@shapeshift-labs/frontier-linter: Serializable Frontier lint rules, diagnostics, fixes, reports, and fast rule execution for package catalogs, registry graphs, application maps, manifests, traces, policies, workflows, workers, assets, tests, benchmarks, and source snippets.@shapeshift-labs/frontier-framework: High-level app framework package for Frontier applications, including configuration, CLI scaffolding, Vite builds, monorepo layout, TSX route builds, split frontend/backend deploy artifacts, backend-neutral Fetch handler and sync transport contracts, runtime data-source migrations, devtools, harness gates, agent MCP/tool manifests, CI evidence gates, workflow manifests, SARIF/linter output, replay scripts, and evidence manifest output.@shapeshift-labs/frontier-crdt: Native CRDT documents, update tooling, awareness, branches, conflict introspection, version frames, and undo.@shapeshift-labs/frontier-crdt-sync: CRDT sync endpoints, repo/storage/provider contracts, scheduled sync work, document URLs, local networks, model checking, forensics, and text binding contracts.@shapeshift-labs/frontier-crdt-websocket: WebSocket client/server transports for Frontier CRDT sync providers.@shapeshift-labs/frontier-react: React external-store hooks and adapters for Frontier state, cache, and CRDT surfaces.@shapeshift-labs/frontier-richtext: Rich text Delta normalization/application, marks, embeds, ranges, and cursor/selection transforms for local editor integrations.@shapeshift-labs/frontier-realtime: Shared realtime command, tick, snapshot, prediction, reconciliation, interpolation, rollback, message, and delta primitives.@shapeshift-labs/frontier-realtime-server: Authoritative realtime room, tick, command validation, rate-limit, session, and snapshot-history runtime.@shapeshift-labs/frontier-realtime-websocket: WebSocket client, wire, and Node room-server transport for Frontier realtime.@shapeshift-labs/frontier-game: Game-facing entity, component, player, room, ownership, spatial interest, rollback, physics, and replication helpers above realtime.
Package source repositories:
siliconjungle/-shapeshift-labs-frontiersiliconjungle/-shapeshift-labs-frontier-querysiliconjungle/-shapeshift-labs-frontier-codecsiliconjungle/-shapeshift-labs-frontier-enginesiliconjungle/-shapeshift-labs-frontier-statesiliconjungle/-shapeshift-labs-frontier-dataflowsiliconjungle/-shapeshift-labs-frontier-state-cachesiliconjungle/-shapeshift-labs-frontier-state-cache-idbsiliconjungle/-shapeshift-labs-frontier-state-cache-filesiliconjungle/-shapeshift-labs-frontier-state-cache-sqlsiliconjungle/-shapeshift-labs-frontier-schemasiliconjungle/-shapeshift-labs-frontier-migrationssiliconjungle/-shapeshift-labs-frontier-event-logsiliconjungle/-shapeshift-labs-frontier-inspectsiliconjungle/-shapeshift-labs-frontier-schedulersiliconjungle/-shapeshift-labs-frontier-loggingsiliconjungle/-shapeshift-labs-frontier-mutationsiliconjungle/-shapeshift-labs-frontier-effectssiliconjungle/-shapeshift-labs-frontier-authsiliconjungle/-shapeshift-labs-frontier-policysiliconjungle/-shapeshift-labs-frontier-flagssiliconjungle/-shapeshift-labs-frontier-toolssiliconjungle/-shapeshift-labs-frontier-sandboxsiliconjungle/-shapeshift-labs-frontier-sandbox-quickjssiliconjungle/-shapeshift-labs-frontier-workflowsiliconjungle/-shapeshift-labs-frontier-workersiliconjungle/-shapeshift-labs-frontier-queuesiliconjungle/-shapeshift-labs-frontier-swarmsiliconjungle/-shapeshift-labs-frontier-swarm-codexsiliconjungle/-shapeshift-labs-frontier-lang-kernelsiliconjungle/-shapeshift-labs-frontier-lang-parsersiliconjungle/-shapeshift-labs-frontier-lang-checkersiliconjungle/-shapeshift-labs-frontier-lang-typescriptsiliconjungle/-shapeshift-labs-frontier-lang-javascriptsiliconjungle/-shapeshift-labs-frontier-lang-rustsiliconjungle/-shapeshift-labs-frontier-lang-pythonsiliconjungle/-shapeshift-labs-frontier-lang-csiliconjungle/-shapeshift-labs-frontier-lang-compilersiliconjungle/-shapeshift-labs-frontier-lang-swiftsiliconjungle/-shapeshift-labs-frontier-lang-kotlinsiliconjungle/-shapeshift-labs-frontier-lang-javasiliconjungle/-shapeshift-labs-frontier-lang-gosiliconjungle/-shapeshift-labs-frontier-lang-csharpsiliconjungle/-shapeshift-labs-frontier-lang-clangsiliconjungle/-shapeshift-labs-frontier-lang-clisiliconjungle/-shapeshift-labs-frontier-langsiliconjungle/-shapeshift-labs-frontier-kvsiliconjungle/-shapeshift-labs-frontier-kv-lockssiliconjungle/-shapeshift-labs-frontier-kv-rate-limitsiliconjungle/-shapeshift-labs-frontier-kv-filesiliconjungle/-shapeshift-labs-frontier-kv-idbsiliconjungle/-shapeshift-labs-frontier-kv-redissiliconjungle/-shapeshift-labs-frontier-kv-serversiliconjungle/-shapeshift-labs-frontier-assetssiliconjungle/-shapeshift-labs-frontier-blueprintsiliconjungle/-shapeshift-labs-frontier-triggerssiliconjungle/-shapeshift-labs-frontier-virtualsiliconjungle/-shapeshift-labs-frontier-tablesiliconjungle/-shapeshift-labs-frontier-scenesiliconjungle/-shapeshift-labs-frontier-pathfindingsiliconjungle/-shapeshift-labs-frontier-lodsiliconjungle/-shapeshift-labs-frontier-routesiliconjungle/-shapeshift-labs-frontier-tracesiliconjungle/-shapeshift-labs-frontier-manifestsiliconjungle/-shapeshift-labs-frontier-viewsiliconjungle/-shapeshift-labs-frontier-iconssiliconjungle/-shapeshift-labs-frontier-designsiliconjungle/-shapeshift-labs-frontier-canvassiliconjungle/-shapeshift-labs-frontier-canvas-toolssiliconjungle/-shapeshift-labs-frontier-dndsiliconjungle/-shapeshift-labs-frontier-domsiliconjungle/-shapeshift-labs-frontier-playwrightsiliconjungle/-shapeshift-labs-frontier-testsiliconjungle/-shapeshift-labs-frontier-fixturessiliconjungle/-shapeshift-labs-frontier-component-previewsiliconjungle/-shapeshift-labs-frontier-documentationsiliconjungle/-shapeshift-labs-frontier-ast-walksiliconjungle/-shapeshift-labs-frontier-historysiliconjungle/-shapeshift-labs-frontier-applicationsiliconjungle/-shapeshift-labs-frontier-lintersiliconjungle/-shapeshift-labs-frontier-frameworksiliconjungle/-shapeshift-labs-frontier-crdtsiliconjungle/-shapeshift-labs-frontier-crdt-syncsiliconjungle/-shapeshift-labs-frontier-crdt-websocketsiliconjungle/-shapeshift-labs-frontier-reactsiliconjungle/-shapeshift-labs-frontier-richtextsiliconjungle/-shapeshift-labs-frontier-realtimesiliconjungle/-shapeshift-labs-frontier-realtime-serversiliconjungle/-shapeshift-labs-frontier-realtime-websocketsiliconjungle/-shapeshift-labs-frontier-game
Install
npm install @shapeshift-labs/frontier-swarmExample
import {
createSwarmPlan,
defineSwarmManifest,
defineSwarmTasks
} from '@shapeshift-labs/frontier-swarm';
const manifest = defineSwarmManifest({
compute: [
{ id: 'deep', kind: 'codex', model: 'gpt-5.5', reasoningEffort: 'xhigh' },
{ id: 'fast', kind: 'codex', model: 'gpt-5.4-mini', reasoningEffort: 'medium' }
],
layers: [
{ id: 'parent', childCompute: { implementation: 'deep', evidence: 'fast' } },
{ id: 'implementation', parentId: 'parent' },
{ id: 'evidence', parentId: 'parent' }
],
lanes: [{
id: 'runtime',
layer: 'implementation',
allowedWrites: ['src/runtime/**'],
evidencePrefix: 'agent-runs/runtime/'
}],
policy: { defaultCompute: 'fast' }
});
const tasks = defineSwarmTasks([{
id: 'runtime-port',
lane: 'runtime',
targetRefs: ['src/runtime/index.ts'],
acceptance: ['runtime evidence passes'],
verification: [{ command: 'npm', args: ['test'] }]
}]);
const plan = createSwarmPlan(manifest, tasks, { limit: 4 });Strategy Tournaments
Use strategy tournaments when several workers, merge policies, proof searches, or projection routes need to be compared by more than raw completion status. The records are runtime-neutral JSON: discovery/search cost is separate from the verification certificate, undefined outcomes stay explicit, and standings are deterministic.
import {
createSwarmPayoffVector,
createSwarmStrategyTournament,
createSwarmStrategyTournamentHistory,
compareSwarmStrategyTournaments,
createSwarmTournamentAdaptiveFeedback,
createSwarmAdaptiveLoadPlan
} from '@shapeshift-labs/frontier-swarm';
const tournament = createSwarmStrategyTournament({
strategies: [
{ id: 'trace-first', family: 'oracle-search' },
{ id: 'patch-first', family: 'implementation' }
],
games: [
{ id: 'merge-admission', objective: 'prefer replayable verified patches' }
],
matches: [{
payoff: createSwarmPayoffVector({
strategyId: 'trace-first',
gameId: 'merge-admission',
outcome: 'verified',
components: {
correctness: 1,
evidence: 0.9,
reviewCost: { value: 0.2, direction: 'minimize', weight: 0.5 }
},
search: { attempts: 8, durationMs: 12000, tokens: 24000 },
certificate: { commands: ['npm test'], durationMs: 1500 }
})
}]
});
const history = createSwarmStrategyTournamentHistory({
tournaments: [tournament]
});
const comparison = compareSwarmStrategyTournaments({
baseline: tournament,
current: tournament,
scoreThreshold: 5
});
const feedback = createSwarmTournamentAdaptiveFeedback({
tournament,
history,
comparison,
scoreFloor: 40
});
const adaptive = createSwarmAdaptiveLoadPlan({
mode: 'balanced',
tournamentFeedback: feedback,
maxLimits: { maxReadyJobs: 8 }
});history tracks strategy performance across runs, comparison highlights regressions and improvements between two tournaments, and feedback can be passed into createSwarmAdaptiveLoadPlan as replayable observations. Feedback maps landed/verified outcomes to healthy throughput and noisy, stale, regressed, or discovery-only outcomes to deterministic reduction signals; when strategy or match metadata includes lane or concurrencyKey, the adaptive planner can adjust those specific scheduler limits without reading mutable tournament state. This makes prompt styles, workspace modes, evidence requirements, and merge policies comparable as strategies instead of treating every worker bundle as a one-off result.
1000-Agent Control Plane
Large swarms need a control plane, not just a flat worker loop. frontier-swarm now exports deterministic data helpers for that layer:
import {
checkSwarmBudget,
createSwarmArtifactIndex,
createSwarmEventStream,
createSwarmLeases,
createSwarmMergePlan,
createSwarmQueueSnapshot,
createSwarmReviewPlan,
createSwarmSchedule,
routeSwarmEventToMailboxes
} from '@shapeshift-labs/frontier-swarm';
const schedule = createSwarmSchedule({
plan,
maxReadyJobs: 100,
maxConcurrencyKeyConcurrency: { 'runtime-state': 1 },
maxComputeConcurrency: { deep: 40 }
});
const leases = createSwarmLeases({
schedule,
workerId: 'worker-a',
leaseMs: 15 * 60 * 1000,
count: 10
});The scale APIs are runtime-neutral and serializable:
- dependency DAGs are compiled into
plan.graph, createSwarmSchedulereturns ready, blocked, running, completed, and failed jobs under lane/compute/contention limits,createSwarmLeasesgives workers expiring leases with fencing tokens,- lane/task
capabilitiesandresourceRequirementscan reserve browser work with lower concurrency, port pools, profile directories, and explicit capability checks, createSwarmQueueSnapshotand run checkpoints give durable queue/run-store adapters a stable serialization shape,createSwarmEventStreamandrouteSwarmEventToMailboxesroute global, lane, task, and worker events into coordinator-facing JSONL streams,checkSwarmBudgetrecords token/cost/time/retry budget decisions,createSwarmArtifactIndexgroups evidence, timelines, logs, and produced files,createSwarmReviewPlansamples or requires reviewer assignments,createSwarmMergePlanblocks jobs with failed checks, required reviews, ownership violations, or conflicting changed paths,- job results include merge-readiness classification:
discovery-only,patch-candidate,verified-patch,rejected, orblocked, - job results, merge bundles, queue overlays, and merge indexes can carry
semanticImportsummaries for imported symbols, semantic dependency relations, semantic ownership regions, proof/spec obligations, paradigm semantics/lowering records, source projection/native compile readiness, and empty sidecar detection, ownershipRegionsallow hot files to be split into semantic regions such ascontent.docs.*oradminSettings.quota.*; merge conflict detection compares explicit changed regions when both sides report them and falls back to path conflicts when either side omits regions,createSwarmMergeBundlebuilds a compact workermerge.jsonshape with touched owned files, patch path, evidence, verification, queue items satisfied, risk, and disposition,createSwarmQueueOverlayandderiveSwarmQueueStatuskeep central queue files immutable while deriving status from worker result overlays,createSwarmMergeIndexrecords stale/patch status and region-aware conflicts so coordinators can review ready bundles before reading every worker directory,checkSwarmRegionOwnershipmakes semantic region ownership enforceable instead of only advisory,createSwarmHotspotReporthighlights repeatedly touched files and suggests module/region splits for merge throughput,createSwarmReviewerLanePlanturns risky/conflicting merge bundles into reviewer-lane tasks,createSwarmRunStoreShardsdescribes sharded event/result/checkpoint paths for large run stores,createSwarmMergeAdmissionlimits ready merges by count, touched paths/regions, and risk budget,createSwarmCoordinatorDashboardandquerySwarmCoordinatorDashboardcombine merge index entries, queue overlays, evidence indexes, admission decisions, duplicate groups, semantic sidecar/dependency summaries, source citations, and worker liveness into one coordinator-query surface with a compact merge score per job,createSwarmAdaptiveLoadPlantreats declared concurrency/resource values as maximums and derives lower effective caps from deterministic observations such as browser/resource contention, stale patches, merge conflicts, empty semantic sidecars, log noise, discovery-only overproduction, failed evidence, and healthy throughput,createSwarmPatchStackPlanclusters compatible bundles into candidate patch stacks by lane, path, region, disposition, and risk so reviewers can evaluate batches instead of individual worker directories,createSwarmContextPackgives workers compact task context: relevant files, API maps, known failures, focused/oracle commands, expected evidence, exclusions, evidence schema, playbooks, and explicit dead ends to avoid,createSwarmOracleCorpusindexes deterministic reference artifacts such as traces, snapshots, classifications, expected outputs, or fixtures without assuming a project domain,createSwarmReplayBundle,createSwarmParityOracle,createSwarmDivergenceReport,createSwarmObservabilityPoint,createSwarmWatchpointPlan, andcreateSwarmDebugHandoffmodel the trace-to-debug workflow: replay finds the narrow window, watchpoints/debug handoff explain the state at that point,createSwarmTraceShard,createSwarmTraceIndex, andquerySwarmTraceIndexturn worker trace findings into sortable evidence: row windows, source hypotheses, executable ownership regions, focused tests, reference evidence, and unresolved divergence signals,createSwarmReferenceOraclePlanandcreateSwarmReferenceOracleResponsedescribe reusable reference services for ports, migrations, parity checks, and cross-implementation comparisons,createSwarmInstrumentationBudget,checkSwarmInstrumentationBudget, andcreateSwarmBottleneckReportkeep traces/logs useful without making instrumentation the bottleneck,createSwarmEvidenceIndex/querySwarmEvidenceIndexandcreateSwarmBlackboard/querySwarmBlackboardprovide storage-neutral status surfaces for coordinator dashboards, accepted facts, known divergences, rejected theories, and active ownership,createSwarmArtifactRoutingPlan,createSwarmSchedulerRecommendations,createSwarmFixtureCatalog,createSwarmProgressModel,createSwarmAutoReviewReport,createSwarmRebaseReport, andcreateSwarmUsageGovernorcover the merge/review/scheduling tools needed to scale from feature swarms to larger migration and porting swarms,createSwarmLanePlaybookturns successful prior bundles into persistent lane-specific guidance with commands, hot paths, evidence patterns, and avoid-investigating notes,decomposeSwarmFeaturecreates an initial task queue for feature work across lanes.
Trace Shards
Trace shards are the generic form of “the worker found the narrow window.” They are not emulator-specific: a row window can be CPU cycles, log rows, replay steps, API events, migration records, or UI interaction frames. The important part is that the shard connects evidence to source hypotheses and executable ownership regions.
import {
createSwarmCoordinatorDashboard,
createSwarmMergeBundle,
createSwarmTraceIndex,
createSwarmTraceShard,
querySwarmTraceIndex
} from '@shapeshift-labs/frontier-swarm';
const traceShard = createSwarmTraceShard({
jobId: 'runtime-worker-12',
lane: 'runtime',
subject: 'parser-port',
rowWindows: [{ start: 6240, end: 6250, firstDivergenceAt: 6243, deltaFields: ['result.value'] }],
hypotheses: [{
sourcePath: 'src/parser.ts',
symbol: 'parseExpression',
region: 'parser.expression',
confidence: 'high',
reason: 'reference trace diverges immediately after expression precedence handling'
}],
executableOwnershipRegions: [{
id: 'parser.expression',
sourcePath: 'src/parser.ts',
symbol: 'parseExpression',
affectedTests: ['npm run test:parser -- --case precedence'],
conflictingAssumptions: ['operators are parsed left-to-right']
}],
focusedTests: ['npm run test:parser -- --case precedence'],
referenceEvidence: [{ path: 'agent-runs/runtime-worker-12/reference-trace.jsonl', kind: 'trace' }]
});
const bundle = createSwarmMergeBundle({
result: {
jobId: 'runtime-worker-12',
status: 'verified',
changedPaths: ['src/parser.ts'],
changedRegions: ['parser.expression'],
verification: [{ status: 0 }]
},
patchPath: 'agent-runs/runtime-worker-12/changes.patch',
traceShards: [traceShard]
});
const traceIndex = createSwarmTraceIndex({ bundles: [bundle] });
const expressionFindings = querySwarmTraceIndex(traceIndex, { region: 'parser.expression', minConfidence: 0.9 });
const dashboard = createSwarmCoordinatorDashboard({ bundles: [bundle] });
const traceReadyJobs = dashboard.jobs.filter((job) => job.traceSummary?.shardCount);Merge scoring uses trace shards as review evidence, not automatic correctness. Focused tests, reference evidence, and executable regions raise confidence; unresolved divergences and conflicting assumptions lower the score until a coordinator or review worker resolves them.
Hierarchical Compute
Higher swarm layers can choose compute for lower layers without binding the core package to Codex or any other runtime. Compute resolution is deterministic:
- task
compute - lane
compute - nearest parent layer
childCompute - current layer
computeordefaultCompute - manifest policy
defaultCompute
That lets a parent swarm route implementation jobs to a deep model while evidence or inspection jobs use a faster profile.
Surface
defineSwarmManifest,createSwarmManifestdefineSwarmTaskscompileSwarm,validateSwarmManifestcreateSwarmTaskSelectioncreateSwarmPlan,createSwarmRuncreateSwarmSchedule,createSwarmLeasescreateSwarmQueueSnapshot,createSwarmRunCheckpointcreateSwarmQueueOverlay,deriveSwarmQueueStatuscreateSwarmEventStream,createSwarmMailbox,routeSwarmEventToMailboxescheckSwarmBudgetcreateSwarmArtifactIndexcreateSwarmReviewPlan,createSwarmReviewerLanePlan,createSwarmMergePlancreateSwarmMergeBundlecreateSwarmMergeIndex,createSwarmMergeAdmissioncreateSwarmHotspotReport,createSwarmRunStoreShardscreateSwarmPatchStackPlancreateSwarmContextPack,createSwarmOracleCorpus,createSwarmLanePlaybookcreateSwarmReplayBundle,createSwarmParityOracle,createSwarmDivergenceReport,createSwarmObservabilityPointcreateSwarmTraceShard,createSwarmTraceIndex,querySwarmTraceIndexcreateSwarmWatchpointPlan,createSwarmDebugHandoffcreateSwarmReferenceOraclePlan,createSwarmReferenceOracleResponsecreateSwarmInstrumentationBudget,checkSwarmInstrumentationBudget,createSwarmBottleneckReportcreateSwarmEvidenceIndex,querySwarmEvidenceIndex,createSwarmBlackboard,querySwarmBlackboardcreateSwarmArtifactRoutingPlan,createSwarmSchedulerRecommendationscreateSwarmFixtureCatalog,createSwarmProgressModel,createSwarmAutoReviewReport,createSwarmRebaseReportcreateSwarmUsageGovernor,checkSwarmUsageGovernorcreateSwarmAdaptiveLoadPlan,createSwarmScheduleInputFromAdaptiveLoadPlanclassifySwarmMergeReadiness,classifySwarmMergeDispositionresolveSwarmChangedRegions,checkSwarmRegionOwnershipdecomposeSwarmFeaturerecordSwarmEvent,completeSwarmJobresolveSwarmComputecheckSwarmOwnership,matchesGlobencodeSwarmJsonl,decodeSwarmJsonlcreateSwarmProof
Benchmarks
Run the package-local benchmark:
npm run benchThe benchmark writes benchmarks/results/frontier-swarm-package-bench-latest.json when run from the monorepo. These are Frontier-only package measurements for plan creation, manifest validation, hierarchical compute resolution, ownership checks, scheduling/leases, adaptive load planning, queue snapshots, queue overlays, merge bundles, merge indexes, merge admission, hotspot reports, context packs, oracle corpora, replay/debug/evidence helper creation, trace index/query creation, lane playbooks, patch stack plans, event routing, run checkpoints, JSONL, and proof hashing.
Source Repository
This package is published from siliconjungle/-shapeshift-labs-frontier-swarm.
