@shapeshift-labs/frontier-swarm 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/benchmarks/package-bench.mjs +39 -0
- package/dist/index.d.ts +918 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +974 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The published Frontier package family is generated from one shared package catal
|
|
|
36
36
|
- [`@shapeshift-labs/frontier-workflow`](https://www.npmjs.com/package/@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.
|
|
37
37
|
- [`@shapeshift-labs/frontier-worker`](https://www.npmjs.com/package/@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.
|
|
38
38
|
- [`@shapeshift-labs/frontier-queue`](https://www.npmjs.com/package/@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.
|
|
39
|
-
- [`@shapeshift-labs/frontier-swarm-codex`](https://www.npmjs.com/package/@shapeshift-labs/frontier-swarm-codex): Node Codex CLI adapter for Frontier swarm plans, including prompt rendering, worktree and snapshot workspaces, Codex argument compatibility, JSONL capture, verification commands, pid-backed stop, collect/apply workflows, merge indexes, queue overlays, merge bundles, and result artifacts.
|
|
39
|
+
- [`@shapeshift-labs/frontier-swarm-codex`](https://www.npmjs.com/package/@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, and result artifacts.
|
|
40
40
|
- [`@shapeshift-labs/frontier-kv`](https://www.npmjs.com/package/@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.
|
|
41
41
|
- [`@shapeshift-labs/frontier-kv-locks`](https://www.npmjs.com/package/@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.
|
|
42
42
|
- [`@shapeshift-labs/frontier-kv-rate-limit`](https://www.npmjs.com/package/@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.
|
|
@@ -260,6 +260,11 @@ The scale APIs are runtime-neutral and serializable:
|
|
|
260
260
|
- `createSwarmPatchStackPlan` clusters compatible bundles into candidate patch stacks by lane, path, region, disposition, and risk so reviewers can evaluate batches instead of individual worker directories,
|
|
261
261
|
- `createSwarmContextPack` gives 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,
|
|
262
262
|
- `createSwarmOracleCorpus` indexes deterministic reference artifacts such as traces, snapshots, classifications, expected outputs, or fixtures without assuming a project domain,
|
|
263
|
+
- `createSwarmReplayBundle`, `createSwarmParityOracle`, `createSwarmDivergenceReport`, `createSwarmObservabilityPoint`, `createSwarmWatchpointPlan`, and `createSwarmDebugHandoff` model the trace-to-debug workflow: replay finds the narrow window, watchpoints/debug handoff explain the state at that point,
|
|
264
|
+
- `createSwarmReferenceOraclePlan` and `createSwarmReferenceOracleResponse` describe reusable reference services for ports, migrations, parity checks, and cross-implementation comparisons,
|
|
265
|
+
- `createSwarmInstrumentationBudget`, `checkSwarmInstrumentationBudget`, and `createSwarmBottleneckReport` keep traces/logs useful without making instrumentation the bottleneck,
|
|
266
|
+
- `createSwarmEvidenceIndex` / `querySwarmEvidenceIndex` and `createSwarmBlackboard` / `querySwarmBlackboard` provide storage-neutral status surfaces for coordinator dashboards, accepted facts, known divergences, rejected theories, and active ownership,
|
|
267
|
+
- `createSwarmArtifactRoutingPlan`, `createSwarmSchedulerRecommendations`, `createSwarmFixtureCatalog`, `createSwarmProgressModel`, `createSwarmAutoReviewReport`, `createSwarmRebaseReport`, and `createSwarmUsageGovernor` cover the merge/review/scheduling tools needed to scale from feature swarms to larger migration and porting swarms,
|
|
263
268
|
- `createSwarmLanePlaybook` turns successful prior bundles into persistent lane-specific guidance with commands, hot paths, evidence patterns, and avoid-investigating notes,
|
|
264
269
|
- `decomposeSwarmFeature` creates an initial task queue for feature work across lanes.
|
|
265
270
|
|
|
@@ -294,6 +299,14 @@ That lets a parent swarm route implementation jobs to a deep model while evidenc
|
|
|
294
299
|
- `createSwarmHotspotReport`, `createSwarmRunStoreShards`
|
|
295
300
|
- `createSwarmPatchStackPlan`
|
|
296
301
|
- `createSwarmContextPack`, `createSwarmOracleCorpus`, `createSwarmLanePlaybook`
|
|
302
|
+
- `createSwarmReplayBundle`, `createSwarmParityOracle`, `createSwarmDivergenceReport`, `createSwarmObservabilityPoint`
|
|
303
|
+
- `createSwarmWatchpointPlan`, `createSwarmDebugHandoff`
|
|
304
|
+
- `createSwarmReferenceOraclePlan`, `createSwarmReferenceOracleResponse`
|
|
305
|
+
- `createSwarmInstrumentationBudget`, `checkSwarmInstrumentationBudget`, `createSwarmBottleneckReport`
|
|
306
|
+
- `createSwarmEvidenceIndex`, `querySwarmEvidenceIndex`, `createSwarmBlackboard`, `querySwarmBlackboard`
|
|
307
|
+
- `createSwarmArtifactRoutingPlan`, `createSwarmSchedulerRecommendations`
|
|
308
|
+
- `createSwarmFixtureCatalog`, `createSwarmProgressModel`, `createSwarmAutoReviewReport`, `createSwarmRebaseReport`
|
|
309
|
+
- `createSwarmUsageGovernor`, `checkSwarmUsageGovernor`
|
|
297
310
|
- `classifySwarmMergeReadiness`, `classifySwarmMergeDisposition`
|
|
298
311
|
- `resolveSwarmChangedRegions`, `checkSwarmRegionOwnership`
|
|
299
312
|
- `decomposeSwarmFeature`
|
|
@@ -311,7 +324,7 @@ Run the package-local benchmark:
|
|
|
311
324
|
npm run bench
|
|
312
325
|
```
|
|
313
326
|
|
|
314
|
-
The 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, queue snapshots, queue overlays, merge bundles, merge indexes, merge admission, hotspot reports, context packs, oracle corpora, lane playbooks, patch stack plans, event routing, run checkpoints, JSONL, and proof hashing.
|
|
327
|
+
The 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, queue snapshots, queue overlays, merge bundles, merge indexes, merge admission, hotspot reports, context packs, oracle corpora, replay/debug/evidence helper creation, lane playbooks, patch stack plans, event routing, run checkpoints, JSONL, and proof hashing.
|
|
315
328
|
|
|
316
329
|
## Source Repository
|
|
317
330
|
|
|
@@ -15,6 +15,16 @@ import {
|
|
|
15
15
|
createSwarmMergeIndex,
|
|
16
16
|
createSwarmOracleCorpus,
|
|
17
17
|
createSwarmPatchStackPlan,
|
|
18
|
+
createSwarmReplayBundle,
|
|
19
|
+
createSwarmParityOracle,
|
|
20
|
+
createSwarmDivergenceReport,
|
|
21
|
+
createSwarmWatchpointPlan,
|
|
22
|
+
createSwarmDebugHandoff,
|
|
23
|
+
createSwarmEvidenceIndex,
|
|
24
|
+
createSwarmBlackboard,
|
|
25
|
+
createSwarmBottleneckReport,
|
|
26
|
+
createSwarmFixtureCatalog,
|
|
27
|
+
createSwarmProgressModel,
|
|
18
28
|
createSwarmPlan,
|
|
19
29
|
createSwarmProof,
|
|
20
30
|
createSwarmQueueOverlay,
|
|
@@ -117,6 +127,35 @@ const rows = [
|
|
|
117
127
|
{ id: 'snapshot-routing', path: 'oracles/routing-snapshot.json', kind: 'snapshot', tags: ['routing', 'reference'] }
|
|
118
128
|
]
|
|
119
129
|
}).summary.artifactCount),
|
|
130
|
+
measure('replay-debug-evidence-' + taskCount, 16, () => {
|
|
131
|
+
const replay = createSwarmReplayBundle({
|
|
132
|
+
commands: ['node replay.mjs'],
|
|
133
|
+
artifacts: [{ path: 'agent-runs/bench/trace.jsonl', kind: 'trace' }],
|
|
134
|
+
expectedEvidence: ['trace.jsonl']
|
|
135
|
+
});
|
|
136
|
+
const parity = createSwarmParityOracle({
|
|
137
|
+
comparators: [{ status: 'failed', expected: 1, actual: 2, operationIndex: cursor++ }]
|
|
138
|
+
});
|
|
139
|
+
const divergence = createSwarmDivergenceReport({
|
|
140
|
+
replayBundleIds: [replay.id],
|
|
141
|
+
observabilityPoints: [{ operationIndex: cursor, path: '/value' }],
|
|
142
|
+
expected: 1,
|
|
143
|
+
actual: 2
|
|
144
|
+
});
|
|
145
|
+
const watch = createSwarmWatchpointPlan({ watchpoints: [{ path: '/value', operator: 'changes' }] });
|
|
146
|
+
const handoff = createSwarmDebugHandoff({
|
|
147
|
+
replayBundleIds: [replay.id],
|
|
148
|
+
divergenceReportIds: [divergence.id],
|
|
149
|
+
watchpointPlanIds: [watch.id],
|
|
150
|
+
comparisons: parity.comparators
|
|
151
|
+
});
|
|
152
|
+
const evidence = createSwarmEvidenceIndex({ entries: [{ topic: 'bench', path: 'agent-runs/bench/evidence.json' }] });
|
|
153
|
+
const blackboard = createSwarmBlackboard({ entries: [{ topic: 'bench', text: 'divergence found', sourceIds: [divergence.id] }] });
|
|
154
|
+
const bottleneck = createSwarmBottleneckReport({ sources: [{ text: 'merge review bottleneck', changedPaths: ['src/runtime.ts'] }] });
|
|
155
|
+
const fixtures = createSwarmFixtureCatalog({ fixtures: [{ id: 'logged-in', tags: ['auth'] }] });
|
|
156
|
+
const progress = createSwarmProgressModel({ items: [{ id: 'bench', status: 'accepted' }] });
|
|
157
|
+
return handoff.commands.length + evidence.summary.entryCount + blackboard.summary.entryCount + bottleneck.summary.kindCount + fixtures.summary.fixtureCount + progress.summary.acceptedCount;
|
|
158
|
+
}),
|
|
120
159
|
measure('lane-playbook-' + taskCount, 16, () => createSwarmLanePlaybook({
|
|
121
160
|
lane: 'runtime',
|
|
122
161
|
successfulBundles: bundles,
|