@anyswarm/core 0.5.0 → 0.5.2
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/AGENTS.md +1 -1
- package/README.md +21 -13
- package/deploy/worker/Dockerfile +12 -4
- package/dist/deploy/worker/Dockerfile +12 -4
- package/dist/examples/README.md +35 -12
- package/dist/examples/authoring/README.md +24 -0
- package/dist/examples/authoring/business.d.ts +2 -0
- package/dist/examples/authoring/business.js +4 -0
- package/dist/examples/authoring/config.d.ts +5 -0
- package/dist/examples/authoring/config.js +2 -0
- package/dist/examples/authoring/eject.json +5 -0
- package/dist/examples/authoring/harness.d.ts +4 -0
- package/dist/examples/authoring/harness.js +19 -0
- package/dist/examples/autoresearch/README.md +40 -0
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +11 -0
- package/dist/examples/autoresearch/config.d.ts +51 -0
- package/dist/examples/autoresearch/config.js +57 -0
- package/dist/examples/autoresearch/demo.d.ts +11 -0
- package/dist/examples/autoresearch/demo.js +52 -0
- package/dist/examples/autoresearch/eject.json +17 -0
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.js +3 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +87 -0
- package/dist/examples/autoresearch/frontiercs2.js +211 -0
- package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
- package/dist/examples/autoresearch/prepare-demo.js +15 -0
- package/dist/examples/autoresearch/prepare.d.ts +95 -0
- package/dist/examples/autoresearch/prepare.js +257 -0
- package/dist/examples/autoresearch/process.d.ts +13 -0
- package/dist/examples/autoresearch/process.js +48 -0
- package/dist/examples/autoresearch/project.d.ts +21 -0
- package/dist/examples/autoresearch/project.js +392 -0
- package/dist/examples/autoresearch/research-service.d.ts +106 -0
- package/dist/examples/autoresearch/research-service.js +255 -0
- package/dist/examples/code/README.md +33 -0
- package/dist/examples/code/REQUIREMENTS.zh.md +11 -0
- package/dist/examples/code/candidate.d.ts +19 -0
- package/dist/examples/code/candidate.js +80 -0
- package/dist/examples/code/config.d.ts +32 -0
- package/dist/examples/code/config.js +18 -0
- package/dist/examples/code/eject.json +5 -0
- package/dist/examples/code/project.d.ts +3 -0
- package/dist/examples/code/project.js +605 -0
- package/dist/examples/code/prompts.d.ts +5 -0
- package/dist/examples/code/prompts.js +12 -0
- package/dist/examples/code/verification.d.ts +19 -0
- package/dist/examples/code/verification.js +268 -0
- package/dist/examples/code/worktree.d.ts +17 -0
- package/dist/examples/code/worktree.js +233 -0
- package/dist/examples/harness-session/README.md +3 -6
- package/dist/examples/lead-worker/harness/dynamic-scheduler.d.ts +2 -1
- package/dist/examples/lead-worker/harness/dynamic-scheduler.js +5 -2
- package/dist/examples/lead-worker/harness/index.d.ts +60 -0
- package/dist/examples/lead-worker/harness/index.js +77 -6
- package/dist/examples/lead-worker/project.js +2 -2
- package/dist/examples/lead-worker/services/board.d.ts +5 -0
- package/dist/examples/lead-worker/services/board.js +19 -1
- package/dist/examples/messages/README.md +5 -5
- package/dist/examples/messages/handoff.d.ts +2 -0
- package/dist/examples/messages/handoff.js +5 -1
- package/dist/examples/messages/project.js +52 -2
- package/dist/examples/notes/README.md +13 -18
- package/dist/examples/notes/project.js +67 -6
- package/dist/examples/peermesh/harness/router.js +3 -1
- package/dist/examples/peermesh/harness/team.d.ts +8 -0
- package/dist/examples/peermesh/harness/team.js +13 -0
- package/dist/examples/peermesh/project.js +22 -4
- package/dist/examples/services/agent-control/README.md +3 -3
- package/dist/examples/services/mathlib-search/Dockerfile +4 -2
- package/dist/examples/services/mathlib-search/README.md +1 -1
- package/dist/examples/services/mcp-managed/README.md +2 -2
- package/dist/examples/services/persistent-board/README.md +16 -3
- package/dist/examples/services/persistent-board/business.d.ts +7 -0
- package/dist/examples/services/persistent-board/business.js +7 -0
- package/dist/examples/services/persistent-board/index.js +10 -0
- package/dist/examples/services/persistent-board/live.d.ts +3 -0
- package/dist/examples/services/persistent-board/live.js +58 -0
- package/dist/examples/subagents/README.md +5 -5
- package/dist/examples/subagents/business.js +3 -1
- package/dist/examples/subagents/config.js +3 -3
- package/dist/examples/subagents/harness/controller.d.ts +15 -0
- package/dist/examples/subagents/harness/controller.js +181 -32
- package/dist/examples/subagents/project.d.ts +2 -0
- package/dist/examples/subagents/project.js +43 -34
- package/dist/examples/subagents/prompts/prompts.d.ts +1 -0
- package/dist/examples/subagents/prompts/prompts.js +3 -0
- package/dist/examples/subagents/services/collaboration-service.d.ts +3 -2
- package/dist/examples/subagents/services/collaboration-service.js +14 -2
- package/dist/examples/substrate/README.md +2 -2
- package/dist/examples/substrate/harness/index.d.ts +1 -1
- package/dist/examples/substrate/harness/index.js +77 -12
- package/dist/examples/substrate/project.js +4 -1
- package/dist/examples/super/README.md +52 -0
- package/dist/examples/super/actions.d.ts +95 -0
- package/dist/examples/super/actions.js +230 -0
- package/dist/examples/super/artifact.d.ts +4 -0
- package/dist/examples/super/artifact.js +51 -0
- package/dist/examples/super/config.d.ts +80 -0
- package/dist/examples/super/config.js +83 -0
- package/dist/examples/super/coordinator.d.ts +33 -0
- package/dist/examples/super/coordinator.js +151 -0
- package/dist/examples/super/daemon.d.ts +11 -0
- package/dist/examples/super/daemon.js +109 -0
- package/dist/examples/super/decisions.d.ts +8 -0
- package/dist/examples/super/decisions.js +52 -0
- package/dist/examples/super/eject.json +5 -0
- package/dist/examples/super/execution.d.ts +11 -0
- package/dist/examples/super/execution.js +136 -0
- package/dist/examples/super/github.d.ts +62 -0
- package/dist/examples/super/github.js +269 -0
- package/dist/examples/super/inbox.d.ts +162 -0
- package/dist/examples/super/inbox.js +284 -0
- package/dist/examples/super/location.d.ts +5 -0
- package/dist/examples/super/location.js +64 -0
- package/dist/examples/super/operator.d.ts +1 -0
- package/dist/examples/super/operator.js +31 -0
- package/dist/examples/super/outbox.d.ts +5 -0
- package/dist/examples/super/outbox.js +103 -0
- package/dist/examples/super/project.d.ts +4 -0
- package/dist/examples/super/project.js +251 -0
- package/dist/examples/super/prompts.d.ts +3 -0
- package/dist/examples/super/prompts.js +25 -0
- package/dist/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/dist/examples/taskpool/harness/controller.d.ts +35 -6
- package/dist/examples/taskpool/harness/controller.js +73 -7
- package/dist/examples/taskpool/project.js +18 -2
- package/dist/scripts/anyswarm-arguments.d.ts +18 -6
- package/dist/scripts/anyswarm-arguments.js +88 -52
- package/dist/scripts/anyswarm-author.d.ts +5 -0
- package/dist/scripts/anyswarm-author.js +24 -0
- package/dist/scripts/anyswarm-eject.d.ts +11 -0
- package/dist/scripts/anyswarm-eject.js +164 -0
- package/dist/scripts/anyswarm-harnesses.d.ts +1 -0
- package/dist/scripts/anyswarm-harnesses.js +10 -0
- package/dist/scripts/anyswarm-installation.d.ts +7 -40
- package/dist/scripts/anyswarm-installation.js +17 -285
- package/dist/scripts/anyswarm-launch.d.ts +7 -0
- package/dist/scripts/anyswarm-launch.js +37 -0
- package/dist/scripts/anyswarm-progress.d.ts +6 -0
- package/dist/scripts/anyswarm-progress.js +102 -0
- package/dist/scripts/anyswarm-project.d.ts +3 -1
- package/dist/scripts/anyswarm-project.js +49 -35
- package/dist/scripts/anyswarm-source-runner.d.ts +1 -0
- package/dist/scripts/anyswarm-source-runner.js +200 -0
- package/dist/scripts/anyswarm.js +28 -3
- package/dist/scripts/build-provenance.json +1 -0
- package/dist/scripts/build.js +7 -1
- package/dist/scripts/generate-architecture-api.js +2 -0
- package/dist/scripts/generate-architecture-prompts.js +24 -2
- package/dist/scripts/local-environment.d.ts +13 -2
- package/dist/scripts/local-environment.js +111 -28
- package/dist/scripts/local-setup-smoke.js +3 -2
- package/dist/scripts/local-setup-worker.d.ts +1 -1
- package/dist/scripts/local-setup-worker.js +15 -6
- package/dist/scripts/local-setup.d.ts +5 -2
- package/dist/scripts/local-setup.js +167 -79
- package/dist/scripts/opensandbox-agent-worker.js +2 -2
- package/dist/scripts/pack-release.d.ts +1 -0
- package/dist/scripts/pack-release.js +66 -0
- package/dist/scripts/pi-session-bridge.js +11 -3
- package/dist/scripts/run-harness.js +3 -1
- package/dist/scripts/setup-bootstrap.js +43 -6
- package/dist/src/core/allocation-ledger.js +4 -3
- package/dist/src/core/host-identity.d.ts +2 -0
- package/dist/src/core/host-identity.js +11 -0
- package/dist/src/core/index.d.ts +4 -2
- package/dist/src/core/index.js +12 -4
- package/dist/src/core/mcp-service.js +2 -2
- package/dist/src/core/runtime-management.d.ts +6 -0
- package/dist/src/core/runtime-management.js +24 -0
- package/dist/src/core/sandbox/executor-driver.d.ts +4 -2
- package/dist/src/core/sandbox/executor-driver.js +12 -14
- package/dist/src/core/sandbox/local-executor.d.ts +13 -1
- package/dist/src/core/sandbox/local-executor.js +69 -19
- package/dist/src/core/sandbox/local-worker.js +32 -21
- package/dist/src/core/sandbox/opensandbox-backend.d.ts +2 -0
- package/dist/src/core/sandbox/opensandbox-backend.js +36 -11
- package/dist/src/core/sandbox/sandbox-connection.d.ts +2 -0
- package/dist/src/core/sandbox/sandbox-connection.js +14 -6
- package/dist/src/core/service-live-state.d.ts +14 -0
- package/dist/src/core/service-live-state.js +161 -0
- package/dist/src/core/service-observation-types.d.ts +21 -1
- package/dist/src/core/service-process.d.ts +1 -1
- package/dist/src/core/service-process.js +45 -4
- package/dist/src/core/service-types.d.ts +5 -1
- package/dist/src/core/services.d.ts +1 -1
- package/dist/src/core/services.js +8 -3
- package/dist/src/core/types.d.ts +3 -0
- package/dist/src/core/worker-image.js +3 -3
- package/dist/src/harness/harness-session-types.d.ts +10 -0
- package/dist/src/harness/harness-session.js +42 -5
- package/dist/src/harness/project-harness.d.ts +14 -1
- package/dist/src/harness/project-harness.js +38 -12
- package/dist/src/harness/project-input.js +81 -15
- package/dist/src/harness/project-rpc-client.d.ts +1 -0
- package/dist/src/harness/project-rpc-client.js +5 -0
- package/dist/src/harness/project-rpc.d.ts +8 -2
- package/dist/src/harness/project-rpc.js +31 -7
- package/dist/src/harness/project-runtime.js +6 -2
- package/dist/src/harness/typescript-loader.d.ts +2 -0
- package/dist/src/harness/typescript-loader.js +41 -0
- package/dist/src/trace-viewer/public/app.js +6 -5
- package/dist/src/trace-viewer/reader.mjs +42 -2
- package/docs/INDEX.md +5 -2
- package/docs/architecture/00-overview.md +1 -1
- package/docs/architecture/01-agent-core.md +1 -1
- package/docs/architecture/04-services.md +1 -1
- package/docs/architecture/06-observability-experiments.md +1 -1
- package/docs/architecture/07-run-configuration.md +38 -18
- package/docs/architecture/08-prompts.md +22 -0
- package/docs/architecture/10-service-api-reference.md +53 -18
- package/docs/architecture/11-storage-reference.md +18 -1
- package/docs/architecture/12-code-coverage.md +152 -89
- package/docs/architecture/15-core-runtime.md +8 -0
- package/docs/architecture/16-pi-opensandbox-backend.md +5 -5
- package/docs/architecture/17-harness-reporting.md +1 -1
- package/docs/architecture/19-substrate-harness.md +28 -1
- package/docs/architecture/20-lead-worker-harness.md +34 -1
- package/docs/architecture/22-website.md +5 -6
- package/docs/architecture/23-project-harness.md +152 -8
- package/docs/architecture/24-runtime-recovery.md +10 -3
- package/docs/architecture/26-code.md +54 -0
- package/docs/architecture/27-personal.md +58 -0
- package/docs/architecture/28-autoresearch.md +43 -0
- package/docs/architecture/INDEX.md +3 -0
- package/docs/architecture/prompts/08-lead-worker-harness.md +4 -2
- package/docs/architecture/prompts/08-subagents-harness.md +21 -0
- package/docs/architecture/prompts/21-personal.md +44 -0
- package/docs/architecture/prompts/22-autoresearch.md +63 -0
- package/docs/architecture/prompts/26-code.md +55 -0
- package/docs/architecture/prompts/source-manifest.json +152 -33
- package/docs/architecture/source-map.json +473 -25
- package/docs/designs/core-harness/01-core.md +2 -2
- package/docs/designs/core-harness/06-project-harness.md +13 -2
- package/docs/designs/core-harness/README.md +7 -2
- package/docs/en/agents.md +1 -1
- package/docs/en/build-your-harness.md +3 -5
- package/docs/en/changelog.md +20 -4
- package/docs/en/first-harness.md +9 -12
- package/docs/en/harnesses/lead-worker.md +1 -1
- package/docs/en/harnesses/peermesh.md +2 -2
- package/docs/en/harnesses/subagents.md +2 -2
- package/docs/en/harnesses/substrate.md +4 -4
- package/docs/en/harnesses/taskpool.md +2 -2
- package/docs/en/latest.md +14 -121
- package/docs/en/overview.md +1 -1
- package/docs/en/quickstart.md +42 -39
- package/docs/en/reference/api.md +14 -4
- package/docs/en/reference/cli.md +53 -47
- package/docs/en/runtime.md +2 -2
- package/docs/en/sandbox.md +3 -3
- package/docs/en/services.md +4 -0
- package/docs/operations/trace-viewer.md +1 -1
- package/docs/workflows/development.md +28 -21
- package/docs/workflows/release-and-docs-versioning.md +77 -0
- package/docs/workflows/release-cli-acceptance.md +85 -0
- package/docs/zh/agents.md +1 -1
- package/docs/zh/build-your-harness.md +3 -5
- package/docs/zh/changelog.md +20 -4
- package/docs/zh/first-harness.md +9 -12
- package/docs/zh/harnesses/lead-worker.md +1 -1
- package/docs/zh/harnesses/peermesh.md +2 -2
- package/docs/zh/harnesses/subagents.md +2 -2
- package/docs/zh/harnesses/substrate.md +4 -4
- package/docs/zh/harnesses/taskpool.md +2 -2
- package/docs/zh/latest.md +15 -122
- package/docs/zh/overview.md +1 -1
- package/docs/zh/quickstart.md +42 -39
- package/docs/zh/reference/api.md +14 -4
- package/docs/zh/reference/cli.md +24 -40
- package/docs/zh/runtime.md +2 -2
- package/docs/zh/sandbox.md +3 -3
- package/docs/zh/services.md +4 -0
- package/examples/README.md +35 -12
- package/examples/authoring/README.md +24 -0
- package/examples/authoring/business.ts +4 -0
- package/examples/authoring/config.ts +2 -0
- package/examples/authoring/eject.json +5 -0
- package/examples/authoring/harness.ts +21 -0
- package/examples/autoresearch/README.md +40 -0
- package/examples/autoresearch/REQUIREMENTS.zh.md +11 -0
- package/examples/autoresearch/config.ts +90 -0
- package/examples/autoresearch/demo.ts +55 -0
- package/examples/autoresearch/eject.json +17 -0
- package/examples/autoresearch/frontiercs2-config.ts +4 -0
- package/examples/autoresearch/frontiercs2.ts +237 -0
- package/examples/autoresearch/prepare-demo.ts +15 -0
- package/examples/autoresearch/prepare.ts +267 -0
- package/examples/autoresearch/process.ts +50 -0
- package/examples/autoresearch/project.ts +380 -0
- package/examples/autoresearch/research-service.ts +302 -0
- package/examples/code/README.md +33 -0
- package/examples/code/REQUIREMENTS.zh.md +11 -0
- package/examples/code/candidate.ts +89 -0
- package/examples/code/config.ts +19 -0
- package/examples/code/eject.json +5 -0
- package/examples/code/project.ts +581 -0
- package/examples/code/prompts.ts +16 -0
- package/examples/code/verification.ts +239 -0
- package/examples/code/worktree.ts +188 -0
- package/examples/harness-session/README.md +3 -6
- package/examples/lead-worker/harness/dynamic-scheduler.ts +6 -3
- package/examples/lead-worker/harness/index.ts +61 -6
- package/examples/lead-worker/project.ts +2 -2
- package/examples/lead-worker/services/board.ts +14 -1
- package/examples/messages/README.md +5 -5
- package/examples/messages/handoff.ts +6 -2
- package/examples/messages/project.ts +47 -2
- package/examples/notes/README.md +13 -18
- package/examples/notes/project.ts +57 -9
- package/examples/peermesh/harness/router.ts +2 -2
- package/examples/peermesh/harness/team.ts +11 -0
- package/examples/peermesh/project.ts +19 -4
- package/examples/services/agent-control/README.md +3 -3
- package/examples/services/mathlib-search/Dockerfile +4 -2
- package/examples/services/mathlib-search/README.md +1 -1
- package/examples/services/mcp-managed/README.md +2 -2
- package/examples/services/persistent-board/README.md +16 -3
- package/examples/services/persistent-board/business.ts +10 -0
- package/examples/services/persistent-board/index.ts +10 -0
- package/examples/services/persistent-board/live.ts +54 -0
- package/examples/subagents/README.md +5 -5
- package/examples/subagents/business.ts +3 -1
- package/examples/subagents/config.ts +4 -3
- package/examples/subagents/harness/controller.ts +161 -29
- package/examples/subagents/project.ts +47 -33
- package/examples/subagents/prompts/prompts.ts +4 -0
- package/examples/subagents/services/collaboration-service.ts +14 -2
- package/examples/substrate/README.md +2 -2
- package/examples/substrate/harness/index.ts +67 -11
- package/examples/substrate/project.ts +5 -1
- package/examples/super/README.md +52 -0
- package/examples/super/actions.ts +196 -0
- package/examples/super/artifact.ts +56 -0
- package/examples/super/config.ts +95 -0
- package/examples/super/coordinator.ts +158 -0
- package/examples/super/daemon.ts +84 -0
- package/examples/super/decisions.ts +46 -0
- package/examples/super/eject.json +5 -0
- package/examples/super/execution.ts +131 -0
- package/examples/super/github.ts +242 -0
- package/examples/super/inbox.ts +306 -0
- package/examples/super/location.ts +54 -0
- package/examples/super/operator.ts +28 -0
- package/examples/super/outbox.ts +97 -0
- package/examples/super/project.ts +225 -0
- package/examples/super/prompts.ts +27 -0
- package/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/examples/taskpool/harness/controller.ts +59 -7
- package/examples/taskpool/project.ts +18 -2
- package/npm-shrinkwrap.development.json +700 -0
- package/npm-shrinkwrap.json +95 -1969
- package/package.development.json +88 -0
- package/package.json +11 -8
- package/scripts/anyswarm-arguments.ts +91 -54
- package/scripts/anyswarm-author.ts +25 -0
- package/scripts/anyswarm-eject.ts +145 -0
- package/scripts/anyswarm-harnesses.ts +10 -0
- package/scripts/anyswarm-installation.ts +18 -288
- package/scripts/anyswarm-launch.ts +36 -0
- package/scripts/anyswarm-progress.ts +95 -0
- package/scripts/anyswarm-project.ts +35 -34
- package/scripts/anyswarm-source-runner.ts +176 -0
- package/scripts/anyswarm.ts +24 -3
- package/scripts/build.ts +8 -1
- package/scripts/generate-architecture-api.ts +2 -0
- package/scripts/generate-architecture-prompts.ts +35 -2
- package/scripts/local-environment.ts +117 -28
- package/scripts/local-setup-smoke.ts +3 -2
- package/scripts/local-setup-worker.ts +17 -7
- package/scripts/local-setup.ts +166 -73
- package/scripts/opensandbox-agent-worker.ts +2 -2
- package/scripts/pack-release.ts +70 -0
- package/scripts/pi-session-bridge.ts +10 -2
- package/scripts/run-harness.ts +3 -1
- package/scripts/setup-bootstrap.ts +41 -6
- package/src/core/allocation-ledger.ts +5 -3
- package/src/core/host-identity.ts +11 -0
- package/src/core/index.ts +12 -6
- package/src/core/mcp-service.ts +2 -2
- package/src/core/runtime-management.ts +22 -0
- package/src/core/sandbox/executor-driver.ts +15 -18
- package/src/core/sandbox/local-executor.ts +65 -19
- package/src/core/sandbox/local-worker.ts +29 -21
- package/src/core/sandbox/opensandbox-backend.ts +36 -11
- package/src/core/sandbox/sandbox-connection.ts +14 -5
- package/src/core/service-live-state.ts +156 -0
- package/src/core/service-observation-types.ts +23 -1
- package/src/core/service-process.ts +36 -3
- package/src/core/service-types.ts +3 -1
- package/src/core/services.ts +8 -3
- package/src/core/types.ts +3 -0
- package/src/core/worker-image.ts +3 -3
- package/src/harness/harness-session-types.ts +13 -1
- package/src/harness/harness-session.ts +40 -7
- package/src/harness/project-harness.ts +38 -12
- package/src/harness/project-input.ts +73 -15
- package/src/harness/project-rpc-client.ts +5 -0
- package/src/harness/project-rpc.ts +29 -8
- package/src/harness/project-runtime.ts +4 -2
- package/src/harness/typescript-loader.ts +37 -0
- package/src/trace-viewer/public/app.js +6 -5
- package/src/trace-viewer/reader.mjs +42 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const frontierRevision = "7e48965c7cef2a567c2669c8e2f10b06386289c9";
|
|
2
|
+
export declare const pumpkinPin = "2026-11-30 ca3ce7ae0da5616464b00ee7962aecac0fc0b38d a1bb9c633f1f700ea42bceb9cd9512f684e9063d3a8ae6c9485526a1dd68016f";
|
|
3
|
+
export declare const frontierTask = "tasks/binary_fuse_filter/task.star";
|
|
4
|
+
export declare const submissionLimit: number;
|
|
5
|
+
export declare const judgeTimeMs = 190000;
|
|
6
|
+
export declare const frontierFinalTimeMs = 250000;
|
|
7
|
+
export declare function digest(bytes: Uint8Array | string): string;
|
|
8
|
+
export declare function frontierSubmission(patch: Uint8Array): Buffer;
|
|
9
|
+
export declare const bridgeDockerfile = "FROM ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852\n";
|
|
10
|
+
export declare function bridgeWorkflow(source: string): string;
|
|
11
|
+
interface Submission {
|
|
12
|
+
payload: {
|
|
13
|
+
digest: string;
|
|
14
|
+
size: number;
|
|
15
|
+
};
|
|
16
|
+
finalized: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Outcome {
|
|
19
|
+
state?: string;
|
|
20
|
+
agents?: {
|
|
21
|
+
role: string;
|
|
22
|
+
submission: Submission | null;
|
|
23
|
+
}[];
|
|
24
|
+
verdict?: {
|
|
25
|
+
kind: string;
|
|
26
|
+
result?: {
|
|
27
|
+
values: {
|
|
28
|
+
name: string;
|
|
29
|
+
value: unknown;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
usage?: unknown;
|
|
34
|
+
driver?: unknown;
|
|
35
|
+
}
|
|
36
|
+
export type JudgeImages = {
|
|
37
|
+
train_judge: string;
|
|
38
|
+
final_judge: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function judgeImages(record: string): Promise<JudgeImages>;
|
|
41
|
+
export interface FrontierPaths {
|
|
42
|
+
source: string;
|
|
43
|
+
config: string;
|
|
44
|
+
dockerContext: string;
|
|
45
|
+
cache: string;
|
|
46
|
+
}
|
|
47
|
+
export declare class FrontierRun {
|
|
48
|
+
readonly paths: FrontierPaths;
|
|
49
|
+
readonly runs: string;
|
|
50
|
+
id?: string;
|
|
51
|
+
container?: string;
|
|
52
|
+
imageId?: string;
|
|
53
|
+
judges?: JudgeImages;
|
|
54
|
+
private closed;
|
|
55
|
+
constructor(paths: FrontierPaths, runs: string);
|
|
56
|
+
private pumpkin;
|
|
57
|
+
private docker;
|
|
58
|
+
get record(): string | undefined;
|
|
59
|
+
start(seconds: number, signal: AbortSignal, timeoutMs?: number): Promise<void>;
|
|
60
|
+
private call;
|
|
61
|
+
train(bytes: Uint8Array, signal: AbortSignal, onAdmission: (job: number) => void): Promise<{
|
|
62
|
+
job: number;
|
|
63
|
+
returned: Record<string, unknown>;
|
|
64
|
+
}>;
|
|
65
|
+
finish(bytes: Uint8Array, signal: AbortSignal): Promise<{
|
|
66
|
+
record: string;
|
|
67
|
+
submission: Submission;
|
|
68
|
+
verdict: {
|
|
69
|
+
kind: string;
|
|
70
|
+
result?: {
|
|
71
|
+
values: {
|
|
72
|
+
name: string;
|
|
73
|
+
value: unknown;
|
|
74
|
+
}[];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
usage: {} | null;
|
|
78
|
+
driver: {} | null;
|
|
79
|
+
}>;
|
|
80
|
+
outcome(signal: AbortSignal): Promise<{
|
|
81
|
+
outcome: Outcome;
|
|
82
|
+
record: string;
|
|
83
|
+
}>;
|
|
84
|
+
close(): Promise<'complete' | 'pending'>;
|
|
85
|
+
}
|
|
86
|
+
export declare function installBridge(source: string): Promise<void>;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
5
|
+
import { command, requireSuccess } from './process.js';
|
|
6
|
+
export const frontierRevision = '7e48965c7cef2a567c2669c8e2f10b06386289c9';
|
|
7
|
+
export const pumpkinPin = '2026-11-30 ca3ce7ae0da5616464b00ee7962aecac0fc0b38d a1bb9c633f1f700ea42bceb9cd9512f684e9063d3a8ae6c9485526a1dd68016f';
|
|
8
|
+
export const frontierTask = 'tasks/binary_fuse_filter/task.star';
|
|
9
|
+
export const submissionLimit = 1024 * 1024;
|
|
10
|
+
export const judgeTimeMs = 190_000;
|
|
11
|
+
export const frontierFinalTimeMs = 250_000;
|
|
12
|
+
export function digest(bytes) {
|
|
13
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
14
|
+
}
|
|
15
|
+
export function frontierSubmission(patch) {
|
|
16
|
+
const bytes = Math.ceil(patch.byteLength / 512) * 512 + 512 * 3;
|
|
17
|
+
if (!patch.byteLength || bytes > submissionLimit)
|
|
18
|
+
throw new Error('Patch exceeds the FrontierCS-2 submission limit or is empty');
|
|
19
|
+
const archive = Buffer.alloc(bytes);
|
|
20
|
+
archive.write('payload/solution.patch');
|
|
21
|
+
archive.write('0000644\0', 100);
|
|
22
|
+
archive.write('0000000\0', 108);
|
|
23
|
+
archive.write('0000000\0', 116);
|
|
24
|
+
archive.write(patch.byteLength.toString(8).padStart(11, '0') + '\0', 124);
|
|
25
|
+
archive.write('00000000000\0', 136);
|
|
26
|
+
archive.fill(32, 148, 156);
|
|
27
|
+
archive.write('0', 156);
|
|
28
|
+
archive.write('ustar\0' + '00', 257);
|
|
29
|
+
let checksum = 0;
|
|
30
|
+
for (const byte of archive.subarray(0, 512))
|
|
31
|
+
checksum += byte;
|
|
32
|
+
archive.write(checksum.toString(8).padStart(6, '0') + '\0 ', 148);
|
|
33
|
+
archive.set(patch, 512);
|
|
34
|
+
return archive;
|
|
35
|
+
}
|
|
36
|
+
function replaceOnce(source, needle, replacement) {
|
|
37
|
+
const first = source.indexOf(needle);
|
|
38
|
+
if (first < 0 || source.indexOf(needle, first + needle.length) >= 0)
|
|
39
|
+
throw new Error('Unexpected pinned FrontierCS-2 workflow');
|
|
40
|
+
return source.replace(needle, replacement);
|
|
41
|
+
}
|
|
42
|
+
export const bridgeDockerfile = 'FROM ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852\n';
|
|
43
|
+
export function bridgeWorkflow(source) {
|
|
44
|
+
return replaceOnce(source, ' elif AGENT == "reference":', ` elif AGENT == "anyswarm":
|
|
45
|
+
agent_role = {
|
|
46
|
+
"name": "agent",
|
|
47
|
+
"image": image("Dockerfile", context = "//lib/anyswarm-bridge"),
|
|
48
|
+
"user": AGENT_USER,
|
|
49
|
+
"needs": agent,
|
|
50
|
+
"runtime": {"agent": {
|
|
51
|
+
"command": {"argv": ["/bin/sh", "-c", "while :; do sleep 1; done"], "cwd": "/pumpkin"},
|
|
52
|
+
"finalize_grace_seconds": 1,
|
|
53
|
+
}},
|
|
54
|
+
}
|
|
55
|
+
elif AGENT == "reference":`);
|
|
56
|
+
}
|
|
57
|
+
export async function judgeImages(record) {
|
|
58
|
+
const ir = JSON.parse(await readFile(join(record, 'ir.json'), 'utf8'));
|
|
59
|
+
function image(name) {
|
|
60
|
+
const roles = ir.roles?.filter((role) => role.name === name);
|
|
61
|
+
const id = roles?.[0]?.image;
|
|
62
|
+
if (roles?.length !== 1 || typeof id !== 'string' || !/^sha256:[a-f0-9]{64}$/.test(id)) {
|
|
63
|
+
throw new Error(`Cannot establish pinned Pumpkin image for ${name}`);
|
|
64
|
+
}
|
|
65
|
+
return id;
|
|
66
|
+
}
|
|
67
|
+
return { train_judge: image('train_judge'), final_judge: image('final_judge') };
|
|
68
|
+
}
|
|
69
|
+
const runId = /^\d{8}-\d{6}-[a-f0-9]{8}$/;
|
|
70
|
+
export class FrontierRun {
|
|
71
|
+
paths;
|
|
72
|
+
runs;
|
|
73
|
+
id;
|
|
74
|
+
container;
|
|
75
|
+
imageId;
|
|
76
|
+
judges;
|
|
77
|
+
closed = false;
|
|
78
|
+
constructor(paths, runs) {
|
|
79
|
+
this.paths = paths;
|
|
80
|
+
this.runs = runs;
|
|
81
|
+
}
|
|
82
|
+
pumpkin(args, timeoutMs, signal) {
|
|
83
|
+
return command('./pumpkin', args, { cwd: this.paths.source, env: { ...process.env, XDG_CACHE_HOME: this.paths.cache }, timeoutMs, signal });
|
|
84
|
+
}
|
|
85
|
+
docker(args, timeoutMs, signal, input) {
|
|
86
|
+
return command('docker', ['--context', this.paths.dockerContext, ...args], { timeoutMs, signal, input });
|
|
87
|
+
}
|
|
88
|
+
get record() { return this.id ? join(this.runs, this.id) : undefined; }
|
|
89
|
+
async start(seconds, signal, timeoutMs = 360_000) {
|
|
90
|
+
await mkdir(this.runs, { recursive: true, mode: 0o700 });
|
|
91
|
+
const start = await this.pumpkin(['run', frontierTask, '--arg', 'agent=anyswarm', '--arg', `deadline_seconds=${seconds}`,
|
|
92
|
+
'--config', this.paths.config, '--runs', this.runs], timeoutMs, signal);
|
|
93
|
+
const id = requireSuccess(start, 'Start official Pumpkin workflow').split(/\s+/)[0];
|
|
94
|
+
if (!runId.test(id))
|
|
95
|
+
throw new Error('Pumpkin returned an invalid run ID');
|
|
96
|
+
this.id = id;
|
|
97
|
+
const started = AbortSignal.any([signal, AbortSignal.timeout(20_000)]);
|
|
98
|
+
while (!this.container) {
|
|
99
|
+
const result = await this.docker(['container', 'ls', '--no-trunc', '--filter', `label=pumpkin.run=${id}`,
|
|
100
|
+
'--filter', 'label=pumpkin.role=agent', '--format', '{{.ID}}'], 5_000, started);
|
|
101
|
+
const ids = requireSuccess(result, 'Find the official agent role').split(/\s+/).filter(Boolean);
|
|
102
|
+
if (ids.length > 1 || (ids.length && !/^[a-f0-9]{64}$/.test(ids[0])))
|
|
103
|
+
throw new Error('Ambiguous Pumpkin agent container');
|
|
104
|
+
this.container = ids[0];
|
|
105
|
+
if (!this.container)
|
|
106
|
+
await delay(250, undefined, { signal: started });
|
|
107
|
+
}
|
|
108
|
+
this.imageId = requireSuccess(await this.docker(['inspect', '--format', '{{.Image}}', this.container], 5_000, started), 'Inspect bridge image');
|
|
109
|
+
const record = this.record;
|
|
110
|
+
this.judges = await judgeImages(record);
|
|
111
|
+
const ir = JSON.parse(await readFile(join(record, 'ir.json'), 'utf8'));
|
|
112
|
+
const role = ir.roles?.find((role) => role.name === 'agent');
|
|
113
|
+
const grantTrain = role?.runtime?.agent?.grants?.find((grant) => grant.name === 'train');
|
|
114
|
+
const grantFinal = role?.runtime?.agent?.grants?.find((grant) => grant.name === 'final');
|
|
115
|
+
if (grantTrain?.job?.target !== 'train_judge' || !(grantTrain.job.calls >= 8) ||
|
|
116
|
+
grantTrain.job.payload_max_bytes !== submissionLimit || grantFinal?.now?.payload_max_bytes !== submissionLimit ||
|
|
117
|
+
grantFinal.now.body?.arguments?.finalize?.type !== 'bool' || ir.final?.target !== undefined && ir.final.target !== 'final_judge') {
|
|
118
|
+
throw new Error('The Pumpkin role does not have the pinned train and final grants');
|
|
119
|
+
}
|
|
120
|
+
const grants = await this.docker(['exec', this.container, '/bin/sh', '-eu', '-c',
|
|
121
|
+
'test -w /pumpkin; exec /.pumpkin/bin/sandboxctl ops'], 5_000, started);
|
|
122
|
+
const ops = JSON.parse(requireSuccess(grants, 'Check official Pumpkin grants and submission scratch space'));
|
|
123
|
+
if (ops.kind !== 'ops')
|
|
124
|
+
throw new Error('The Pumpkin role has no official grants');
|
|
125
|
+
}
|
|
126
|
+
async call(name, bytes, signal) {
|
|
127
|
+
if (!this.container || this.closed)
|
|
128
|
+
throw new Error('Pumpkin submission role is unavailable');
|
|
129
|
+
const result = await this.docker(['exec', '-i', this.container, '/bin/sh', '-eu', '-c',
|
|
130
|
+
'umask 077; file="/pumpkin/$1.tar"; shift; trap \'rm -f -- "$file"\' EXIT; cat > "$file"; name="$1"; shift; /.pumpkin/bin/sandboxctl call "$name" "$file" "$@"',
|
|
131
|
+
'anyswarm-submit', randomUUID(), name, ...(name === 'final' ? ['--arg', 'finalize=true'] : [])], 15_000, signal, bytes);
|
|
132
|
+
if (!result.stdout.trim()) {
|
|
133
|
+
throw new Error(`Official ${name} admission is unknown: ${result.stderr.trim().slice(-320) || `exit ${result.code}`}`);
|
|
134
|
+
}
|
|
135
|
+
return JSON.parse(result.stdout);
|
|
136
|
+
}
|
|
137
|
+
async train(bytes, signal, onAdmission) {
|
|
138
|
+
const reply = await this.call('train', bytes, signal);
|
|
139
|
+
if (reply.kind === 'refused')
|
|
140
|
+
throw new Error(reply.message ?? 'Official train refused the candidate');
|
|
141
|
+
if (reply.kind !== 'call' || !Number.isSafeInteger(reply.job))
|
|
142
|
+
throw new Error('Official train admission is unknown');
|
|
143
|
+
const job = reply.job;
|
|
144
|
+
onAdmission(job);
|
|
145
|
+
const deadline = AbortSignal.any([signal, AbortSignal.timeout(judgeTimeMs)]);
|
|
146
|
+
while (true) {
|
|
147
|
+
const reply = await this.docker(['exec', this.container, '/.pumpkin/bin/sandboxctl', 'status', String(job)], 5_000, deadline);
|
|
148
|
+
const state = JSON.parse(reply.stdout);
|
|
149
|
+
if (state.kind !== 'status' || state.job !== job)
|
|
150
|
+
throw new Error('Official train status is unknown');
|
|
151
|
+
if (state.state === 'completed' && state.returned)
|
|
152
|
+
return { job, returned: state.returned };
|
|
153
|
+
if (state.state === 'errored')
|
|
154
|
+
throw new Error(`Official train job ${job} failed`);
|
|
155
|
+
if (state.state !== 'queued' && state.state !== 'running')
|
|
156
|
+
throw new Error(`Official train job ${job} has an unknown status`);
|
|
157
|
+
await delay(750, undefined, { signal: deadline });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async finish(bytes, signal) {
|
|
161
|
+
const sha256 = digest(bytes);
|
|
162
|
+
const reply = await this.call('final', bytes, signal).catch(() => undefined);
|
|
163
|
+
if (reply?.kind === 'refused')
|
|
164
|
+
throw new Error(reply.message ?? 'Official final refused the candidate');
|
|
165
|
+
// A missing acknowledgement may still have stored and locked the payload. Verify
|
|
166
|
+
// the authoritative outcome against the immutable payload before crediting it.
|
|
167
|
+
const { outcome, record } = await this.outcome(signal);
|
|
168
|
+
const submission = outcome.agents?.find(agent => agent.role === 'agent')?.submission;
|
|
169
|
+
if (outcome.state !== 'finished' || outcome.verdict?.kind !== 'returned' ||
|
|
170
|
+
submission?.payload?.digest !== `sha256:${sha256}` || submission.payload.size !== bytes.byteLength || !submission.finalized) {
|
|
171
|
+
throw new Error('Official final result could not be associated with the selected candidate');
|
|
172
|
+
}
|
|
173
|
+
return { record, submission, verdict: outcome.verdict, usage: outcome.usage ?? null, driver: outcome.driver ?? null };
|
|
174
|
+
}
|
|
175
|
+
async outcome(signal) {
|
|
176
|
+
const record = this.record;
|
|
177
|
+
if (!record)
|
|
178
|
+
throw new Error('There is no official Pumpkin run');
|
|
179
|
+
await this.pumpkin(['wait', '--runs', this.runs, '--outcome', this.id], frontierFinalTimeMs, signal);
|
|
180
|
+
const outcome = JSON.parse(await readFile(join(record, 'outcome.json'), 'utf8'));
|
|
181
|
+
this.closed = outcome.state === 'finished';
|
|
182
|
+
return { outcome, record };
|
|
183
|
+
}
|
|
184
|
+
async close() {
|
|
185
|
+
try {
|
|
186
|
+
const ids = this.id ? [this.id] : (await readdir(this.runs, { withFileTypes: true }).catch(() => []))
|
|
187
|
+
.filter(entry => entry.isDirectory() && runId.test(entry.name)).map(entry => entry.name);
|
|
188
|
+
for (const id of ids) {
|
|
189
|
+
const finished = this.closed || await readFile(join(this.runs, id, 'outcome.json'), 'utf8')
|
|
190
|
+
.then(raw => JSON.parse(raw).state === 'finished').catch(() => false);
|
|
191
|
+
if (!finished)
|
|
192
|
+
await this.pumpkin(['cancel', '--runs', this.runs, id], 20_000).catch(() => { });
|
|
193
|
+
const remaining = await this.docker(['container', 'ls', '-a', '--filter', `label=pumpkin.run=${id}`, '--format', '{{.ID}}'], 5_000);
|
|
194
|
+
if (remaining.code !== 0 || remaining.stdout.trim())
|
|
195
|
+
return 'pending';
|
|
196
|
+
}
|
|
197
|
+
return 'complete';
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return 'pending';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
export async function installBridge(source) {
|
|
205
|
+
const file = join(source, 'lib', 'fcs.star');
|
|
206
|
+
const original = await readFile(file, 'utf8');
|
|
207
|
+
const role = join(source, 'lib', 'anyswarm-bridge');
|
|
208
|
+
await mkdir(role, { recursive: true, mode: 0o700 });
|
|
209
|
+
await writeFile(join(role, 'Dockerfile'), bridgeDockerfile);
|
|
210
|
+
await writeFile(file, bridgeWorkflow(original));
|
|
211
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { prepareFrontier } from './prepare.js';
|
|
2
|
+
const controller = new AbortController();
|
|
3
|
+
const interrupt = (signal) => {
|
|
4
|
+
process.exitCode = signal === 'SIGINT' ? 130 : 143;
|
|
5
|
+
controller.abort();
|
|
6
|
+
};
|
|
7
|
+
process.on('SIGINT', interrupt).on('SIGTERM', interrupt);
|
|
8
|
+
try {
|
|
9
|
+
const report = await prepareFrontier({ signal: controller.signal, progress: console.error });
|
|
10
|
+
console.log(JSON.stringify(report, null, 2));
|
|
11
|
+
process.exitCode ??= report.ok ? 0 : 2;
|
|
12
|
+
}
|
|
13
|
+
finally {
|
|
14
|
+
process.off('SIGINT', interrupt).off('SIGTERM', interrupt);
|
|
15
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type ResearchBudget } from './config.js';
|
|
2
|
+
import { type FrontierPaths, type JudgeImages } from './frontiercs2.js';
|
|
3
|
+
export declare function resourcePlan(budget: ResearchBudget): {
|
|
4
|
+
roles: {
|
|
5
|
+
role: string;
|
|
6
|
+
count: number;
|
|
7
|
+
cpu: number;
|
|
8
|
+
memoryGiB: number;
|
|
9
|
+
}[];
|
|
10
|
+
cpu: number;
|
|
11
|
+
memoryGiB: number;
|
|
12
|
+
diskGiB: number;
|
|
13
|
+
gpu: number;
|
|
14
|
+
};
|
|
15
|
+
export interface Check {
|
|
16
|
+
name: string;
|
|
17
|
+
ok: boolean;
|
|
18
|
+
detail: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function checkKimiRoute(signal: AbortSignal): Promise<Check[]>;
|
|
21
|
+
export declare function loadPrepared(home?: string): Promise<{
|
|
22
|
+
saved: {
|
|
23
|
+
version: 2;
|
|
24
|
+
revision: string;
|
|
25
|
+
pumpkin: string;
|
|
26
|
+
sourceDigest: string;
|
|
27
|
+
bridgeDigest: string;
|
|
28
|
+
bridgeImage: string;
|
|
29
|
+
judges: JudgeImages;
|
|
30
|
+
dockerContext: string;
|
|
31
|
+
referenceRecord: string;
|
|
32
|
+
budget: ResearchBudget;
|
|
33
|
+
};
|
|
34
|
+
paths: FrontierPaths;
|
|
35
|
+
budget: ResearchBudget;
|
|
36
|
+
starter: string;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function prepareFrontier({ signal, progress, home }: {
|
|
39
|
+
signal: AbortSignal;
|
|
40
|
+
progress: (message: string) => void;
|
|
41
|
+
home?: string;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
ok: boolean;
|
|
44
|
+
benchmark: string;
|
|
45
|
+
pumpkin: string;
|
|
46
|
+
budget: ResearchBudget;
|
|
47
|
+
resources: {
|
|
48
|
+
roles: {
|
|
49
|
+
role: string;
|
|
50
|
+
count: number;
|
|
51
|
+
cpu: number;
|
|
52
|
+
memoryGiB: number;
|
|
53
|
+
}[];
|
|
54
|
+
cpu: number;
|
|
55
|
+
memoryGiB: number;
|
|
56
|
+
diskGiB: number;
|
|
57
|
+
gpu: number;
|
|
58
|
+
};
|
|
59
|
+
checks: Check[];
|
|
60
|
+
home: string;
|
|
61
|
+
modelInference: 'not-attempted';
|
|
62
|
+
} | {
|
|
63
|
+
benchmark: string;
|
|
64
|
+
pumpkin: string;
|
|
65
|
+
budget: ResearchBudget;
|
|
66
|
+
resources: {
|
|
67
|
+
roles: {
|
|
68
|
+
role: string;
|
|
69
|
+
count: number;
|
|
70
|
+
cpu: number;
|
|
71
|
+
memoryGiB: number;
|
|
72
|
+
}[];
|
|
73
|
+
cpu: number;
|
|
74
|
+
memoryGiB: number;
|
|
75
|
+
diskGiB: number;
|
|
76
|
+
gpu: number;
|
|
77
|
+
};
|
|
78
|
+
checks: Check[];
|
|
79
|
+
home: string;
|
|
80
|
+
modelInference: 'not-attempted';
|
|
81
|
+
ok: boolean;
|
|
82
|
+
reused: boolean;
|
|
83
|
+
prepared: {
|
|
84
|
+
version: 2;
|
|
85
|
+
revision: string;
|
|
86
|
+
pumpkin: string;
|
|
87
|
+
sourceDigest: string;
|
|
88
|
+
bridgeDigest: string;
|
|
89
|
+
bridgeImage: string;
|
|
90
|
+
judges: JudgeImages;
|
|
91
|
+
dockerContext: string;
|
|
92
|
+
referenceRecord: string;
|
|
93
|
+
budget: ResearchBudget;
|
|
94
|
+
};
|
|
95
|
+
}>;
|