@sema-agent/server 1.322.0 → 2.0.0
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/dist/approval-hmac.d.ts +40 -0
- package/dist/approval-hmac.js +67 -0
- package/dist/approval.d.ts +31 -0
- package/dist/approval.js +72 -4
- package/dist/audit.d.ts +26 -0
- package/dist/audit.js +40 -1
- package/dist/auth-bridge.d.ts +10 -0
- package/dist/auth-bridge.js +47 -4
- package/dist/auth-keys.d.ts +19 -0
- package/dist/auth-keys.js +13 -0
- package/dist/bake-runner/main.d.ts +5 -0
- package/dist/bake-runner/main.js +43 -4
- package/dist/bake-runner/protocol.d.ts +57 -0
- package/dist/bake-runner/protocol.js +58 -3
- package/dist/bake-runner/runner.d.ts +54 -0
- package/dist/bake-runner/runner.js +87 -5
- package/dist/bench/l8/artifact.d.ts +63 -0
- package/dist/bench/l8/artifact.js +61 -2
- package/dist/bench/l8/escape.d.ts +36 -0
- package/dist/bench/l8/escape.js +25 -0
- package/dist/bench/l8/index.d.ts +14 -0
- package/dist/bench/l8/index.js +14 -0
- package/dist/bench/l8/probes.d.ts +74 -0
- package/dist/bench/l8/probes.js +60 -0
- package/dist/bench/l8/run-probes.d.ts +43 -0
- package/dist/bench/l8/run-probes.js +45 -2
- package/dist/bench/s1/arms.d.ts +126 -0
- package/dist/bench/s1/arms.js +188 -13
- package/dist/bench/s1/live-deps.d.ts +66 -0
- package/dist/bench/s1/live-deps.js +249 -11
- package/dist/bench/s1/oracle.d.ts +49 -0
- package/dist/bench/s1/oracle.js +36 -1
- package/dist/bench/s1/repair-oracle-adapter.d.ts +33 -0
- package/dist/bench/s1/repair-oracle-adapter.js +30 -0
- package/dist/bench/s1/reviewer.d.ts +38 -0
- package/dist/bench/s1/reviewer.js +34 -0
- package/dist/bench/s1/row.d.ts +77 -0
- package/dist/bench/s1/row.js +62 -0
- package/dist/bench/s1/run-firm.d.ts +47 -0
- package/dist/bench/s1/run-firm.js +70 -4
- package/dist/bench/s1/runner-ctx.d.ts +71 -0
- package/dist/bench/s1/runner-ctx.js +36 -0
- package/dist/bench/s1/tasks.d.ts +108 -0
- package/dist/bench/s1/tasks.js +115 -0
- package/dist/boot-reclaim.d.ts +19 -0
- package/dist/boot-reclaim.js +20 -0
- package/dist/brain.d.ts +25 -0
- package/dist/brain.js +61 -1
- package/dist/budget.d.ts +66 -0
- package/dist/budget.js +128 -4
- package/dist/capabilities/builtin-tools.d.ts +3 -0
- package/dist/capabilities/builtin-tools.js +3 -0
- package/dist/capabilities/center-plugins.d.ts +17 -1
- package/dist/capabilities/center-plugins.js +45 -4
- package/dist/capabilities/center-prompts.d.ts +46 -0
- package/dist/capabilities/center-prompts.js +57 -3
- package/dist/capabilities/code-review-council.d.ts +28 -0
- package/dist/capabilities/code-review-council.js +40 -7
- package/dist/capabilities/collab-wire.d.ts +2 -0
- package/dist/capabilities/collab-workflows.d.ts +7 -0
- package/dist/capabilities/collab-workflows.js +44 -1
- package/dist/capabilities/oa-tools.d.ts +6 -0
- package/dist/capabilities/oa-tools.js +10 -0
- package/dist/capabilities/prompt.d.ts +14 -0
- package/dist/capabilities/prompt.js +14 -0
- package/dist/capabilities/prompts/code-review.d.ts +14 -0
- package/dist/capabilities/prompts/code-review.js +14 -0
- package/dist/capabilities/prompts/identity.d.ts +6 -0
- package/dist/capabilities/prompts/identity.js +6 -0
- package/dist/capabilities/prompts/team.d.ts +4 -0
- package/dist/capabilities/prompts/team.js +4 -0
- package/dist/capabilities/repo-tools.d.ts +11 -0
- package/dist/capabilities/repo-tools.js +8 -0
- package/dist/capabilities/sandbox-file-send.d.ts +95 -0
- package/dist/capabilities/sandbox-file-send.js +91 -3
- package/dist/capabilities/scenarios.d.ts +130 -0
- package/dist/capabilities/scenarios.js +180 -7
- package/dist/capabilities/select-environment-tool.d.ts +7 -0
- package/dist/capabilities/select-environment-tool.js +30 -0
- package/dist/capabilities/send-user-file-tool.d.ts +33 -0
- package/dist/capabilities/send-user-file-tool.js +65 -1
- package/dist/capabilities/skills.d.ts +29 -0
- package/dist/capabilities/skills.js +13 -2
- package/dist/capabilities/team.d.ts +22 -0
- package/dist/capabilities/team.js +22 -2
- package/dist/capabilities/tool-defer.d.ts +26 -0
- package/dist/capabilities/tool-defer.js +3 -0
- package/dist/config-center/apply-effective.d.ts +65 -0
- package/dist/config-center/apply-effective.js +204 -12
- package/dist/config-center/http-client.d.ts +34 -0
- package/dist/config-center/http-client.js +68 -0
- package/dist/config-center/restart-signal.d.ts +22 -0
- package/dist/config-center/restart-signal.js +39 -0
- package/dist/config-center/skills-mcp.d.ts +20 -1
- package/dist/config-center/skills-mcp.js +42 -7
- package/dist/config-center/types.d.ts +92 -1
- package/dist/config-lkg.d.ts +12 -0
- package/dist/config-lkg.js +41 -0
- package/dist/config-provider.d.ts +78 -0
- package/dist/config-provider.js +165 -2
- package/dist/config-types.d.ts +546 -0
- package/dist/config.d.ts +64 -0
- package/dist/config.js +455 -60
- package/dist/degenerate-instrument.d.ts +38 -0
- package/dist/degenerate-instrument.js +55 -3
- package/dist/elicitation.d.ts +39 -0
- package/dist/elicitation.js +87 -3
- package/dist/env-facts.d.ts +61 -0
- package/dist/env-facts.js +73 -7
- package/dist/fleet/fleet-bus.d.ts +185 -0
- package/dist/fleet/fleet-bus.js +333 -27
- package/dist/fleet/subagent-tail-bus.d.ts +11 -0
- package/dist/fleet/subagent-tail-bus.js +33 -2
- package/dist/fleet-client.d.ts +38 -0
- package/dist/fleet-client.js +44 -9
- package/dist/fleet-lease.d.ts +46 -0
- package/dist/fleet-lease.js +73 -5
- package/dist/hooks/branch-transcript.d.ts +8 -0
- package/dist/hooks/branch-transcript.js +33 -0
- package/dist/hooks/cc-stop-prompt.d.ts +42 -0
- package/dist/hooks/cc-stop-prompt.js +43 -1
- package/dist/hooks/hook-llm.d.ts +15 -0
- package/dist/hooks/hook-llm.js +47 -0
- package/dist/hooks/hook-runner.d.ts +89 -0
- package/dist/hooks/hook-runner.js +327 -18
- package/dist/http/idempotency.d.ts +31 -0
- package/dist/http/idempotency.js +34 -0
- package/dist/http/principal-gate.d.ts +17 -0
- package/dist/http/principal-gate.js +35 -3
- package/dist/http/route-ctx.d.ts +36 -0
- package/dist/http/routes/approvals-assistant.d.ts +25 -0
- package/dist/http/routes/approvals-assistant.js +253 -23
- package/dist/http/routes/attachments.js +22 -4
- package/dist/http/routes/capabilities.d.ts +7 -0
- package/dist/http/routes/capabilities.js +202 -1
- package/dist/http/routes/fleet.d.ts +6 -0
- package/dist/http/routes/fleet.js +94 -5
- package/dist/http/routes/images.d.ts +17 -0
- package/dist/http/routes/images.js +222 -14
- package/dist/http/routes/leader.d.ts +7 -0
- package/dist/http/routes/leader.js +10 -0
- package/dist/http/routes/memory-policy.d.ts +6 -0
- package/dist/http/routes/memory-policy.js +38 -6
- package/dist/http/routes/notify-wake.d.ts +10 -0
- package/dist/http/routes/notify-wake.js +19 -3
- package/dist/http/routes/observability.d.ts +6 -0
- package/dist/http/routes/observability.js +19 -2
- package/dist/http/routes/runs.d.ts +15 -0
- package/dist/http/routes/runs.js +464 -41
- package/dist/http/routes/session-sync.d.ts +15 -0
- package/dist/http/routes/session-sync.js +229 -19
- package/dist/http/routes/sessions-list.d.ts +6 -0
- package/dist/http/routes/sessions-list.js +35 -4
- package/dist/http/routes/sessions.d.ts +14 -0
- package/dist/http/routes/sessions.js +176 -31
- package/dist/http/routes/side-query.d.ts +8 -0
- package/dist/http/routes/side-query.js +26 -1
- package/dist/http/routes/tasks.d.ts +18 -0
- package/dist/http/routes/tasks.js +501 -38
- package/dist/http/routes/trace-usage.d.ts +10 -0
- package/dist/http/routes/trace-usage.js +66 -14
- package/dist/http/routes/workflows.d.ts +12 -0
- package/dist/http/routes/workflows.js +180 -19
- package/dist/http/run-meta.d.ts +11 -0
- package/dist/http/run-meta.js +6 -0
- package/dist/http/send.d.ts +19 -0
- package/dist/http/send.js +11 -0
- package/dist/http/server.d.ts +255 -0
- package/dist/http/server.js +921 -75
- package/dist/http/sse-log.d.ts +15 -0
- package/dist/http/sse-log.js +16 -0
- package/dist/http/tar.d.ts +9 -0
- package/dist/http/tar.js +21 -5
- package/dist/http/wire-gate.d.ts +9 -0
- package/dist/http/wire-gate.js +9 -0
- package/dist/http/wire-types.d.ts +187 -0
- package/dist/http/workspace-content.d.ts +8 -0
- package/dist/http/workspace-content.js +10 -0
- package/dist/images/bake-validate.d.ts +63 -0
- package/dist/images/bake-validate.js +71 -1
- package/dist/images/manifest.d.ts +19 -0
- package/dist/images/manifest.js +6 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +10 -5
- package/dist/key-resolver.d.ts +23 -0
- package/dist/key-resolver.js +27 -2
- package/dist/leader/diffout.d.ts +23 -0
- package/dist/leader/diffout.js +8 -1
- package/dist/leader/diffup.d.ts +32 -0
- package/dist/leader/diffup.js +43 -0
- package/dist/leader/endpoint.d.ts +20 -0
- package/dist/leader/endpoint.js +25 -2
- package/dist/leader/fanout.d.ts +60 -0
- package/dist/leader/fanout.js +29 -3
- package/dist/leader/grader-env-factory.d.ts +74 -0
- package/dist/leader/grader-env-factory.js +62 -3
- package/dist/leader/leader.d.ts +97 -0
- package/dist/leader/leader.js +151 -4
- package/dist/leader/merge.d.ts +94 -0
- package/dist/leader/merge.js +112 -9
- package/dist/leader/planner.d.ts +52 -0
- package/dist/leader/planner.js +47 -3
- package/dist/leader/repair-oracle.d.ts +61 -0
- package/dist/leader/repair-oracle.js +59 -1
- package/dist/leader/repair-wire.d.ts +78 -0
- package/dist/leader/repair-wire.js +79 -2
- package/dist/leader/wire.d.ts +79 -0
- package/dist/leader/wire.js +255 -8
- package/dist/lsp/e2b-bridge.d.ts +16 -0
- package/dist/lsp/e2b-bridge.js +32 -4
- package/dist/lsp/e2b-manager.d.ts +10 -0
- package/dist/lsp/e2b-manager.js +18 -2
- package/dist/lsp/lsp-frames.d.ts +12 -0
- package/dist/lsp/lsp-frames.js +12 -0
- package/dist/lsp/manager.d.ts +12 -0
- package/dist/lsp/manager.js +35 -2
- package/dist/lsp/types.d.ts +10 -0
- package/dist/lsp/ws-transport.d.ts +12 -0
- package/dist/lsp/ws-transport.js +53 -5
- package/dist/lsp-evict.d.ts +14 -0
- package/dist/lsp-evict.js +15 -1
- package/dist/main.js +2132 -96
- package/dist/memory-export.d.ts +1 -0
- package/dist/memory-export.js +4 -0
- package/dist/memory-scope.d.ts +49 -0
- package/dist/memory-scope.js +87 -4
- package/dist/memory-sync-client.d.ts +24 -0
- package/dist/memory-sync-client.js +41 -2
- package/dist/memory-sync.d.ts +23 -0
- package/dist/memory-sync.js +70 -1
- package/dist/model-select.d.ts +39 -0
- package/dist/model-select.js +42 -1
- package/dist/observability/cost-quota.d.ts +20 -0
- package/dist/observability/cost-quota.js +4 -0
- package/dist/observability/cost-taxonomy.d.ts +45 -0
- package/dist/observability/cost-taxonomy.js +34 -0
- package/dist/observability/logger.d.ts +1 -0
- package/dist/observability/logger.js +6 -0
- package/dist/observability/metrics.d.ts +13 -0
- package/dist/observability/metrics.js +63 -0
- package/dist/observability/otel-exporter.d.ts +9 -0
- package/dist/observability/otel-exporter.js +11 -3
- package/dist/observability/principal-context.d.ts +9 -0
- package/dist/observability/principal-context.js +9 -0
- package/dist/observability/prompt-manifest.d.ts +37 -0
- package/dist/observability/prompt-manifest.js +35 -1
- package/dist/observability/rate-limit.d.ts +10 -0
- package/dist/observability/rate-limit.js +1 -0
- package/dist/observability/tool-trace.d.ts +24 -0
- package/dist/observability/tool-trace.js +41 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +107 -0
- package/dist/orchestration/hardened-vm-runner.js +119 -4
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +14 -0
- package/dist/orchestration/hardened-vm-worker-runner.js +26 -1
- package/dist/orchestration/hardened-vm-worker.js +27 -0
- package/dist/orchestration/subagent-steer.d.ts +44 -0
- package/dist/orchestration/subagent-steer.js +45 -1
- package/dist/orchestration/workflow-agent-steer.d.ts +54 -0
- package/dist/orchestration/workflow-agent-steer.js +80 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +189 -2
- package/dist/orchestration/workflow-completion-inbox.js +283 -32
- package/dist/orchestration/workflow-notify-journal.d.ts +132 -1
- package/dist/orchestration/workflow-notify-journal.js +187 -13
- package/dist/parked-decide.d.ts +61 -0
- package/dist/parked-decide.js +58 -1
- package/dist/per-task-image.d.ts +54 -0
- package/dist/per-task-image.js +41 -0
- package/dist/plan-cache-probe.d.ts +35 -0
- package/dist/plan-cache-probe.js +18 -3
- package/dist/plugins/approval-exemption-store.d.ts +7 -0
- package/dist/plugins/approval-exemption-store.js +28 -2
- package/dist/plugins/approval-store-sql.d.ts +64 -0
- package/dist/plugins/approval-store-sql.js +32 -0
- package/dist/plugins/background-agent-store-sql.d.ts +55 -0
- package/dist/plugins/background-agent-store-sql.js +91 -4
- package/dist/plugins/background-shell-support.d.ts +98 -0
- package/dist/plugins/background-shell-support.js +117 -13
- package/dist/plugins/blob-backend.d.ts +104 -0
- package/dist/plugins/blob-backend.js +163 -6
- package/dist/plugins/breaker-state-sql.d.ts +65 -1
- package/dist/plugins/breaker-state-sql.js +46 -8
- package/dist/plugins/caching-session-store.d.ts +42 -0
- package/dist/plugins/caching-session-store.js +63 -3
- package/dist/plugins/checkpoint-store-sql.d.ts +179 -0
- package/dist/plugins/checkpoint-store-sql.js +239 -11
- package/dist/plugins/file-outcome-sink.d.ts +4 -0
- package/dist/plugins/file-outcome-sink.js +9 -0
- package/dist/plugins/file-resume-anchor-store.d.ts +20 -0
- package/dist/plugins/file-resume-anchor-store.js +43 -4
- package/dist/plugins/file-run-store.d.ts +90 -0
- package/dist/plugins/file-run-store.js +145 -13
- package/dist/plugins/file-snapshot-store-sql.d.ts +133 -1
- package/dist/plugins/file-snapshot-store-sql.js +178 -10
- package/dist/plugins/file-workflow-journal-store.d.ts +10 -0
- package/dist/plugins/file-workflow-journal-store.js +10 -0
- package/dist/plugins/fork-routing-session-store.d.ts +47 -0
- package/dist/plugins/fork-routing-session-store.js +51 -3
- package/dist/plugins/host-platform.d.ts +69 -0
- package/dist/plugins/host-platform.js +81 -2
- package/dist/plugins/image-bake-store-sql.d.ts +136 -1
- package/dist/plugins/image-bake-store-sql.js +241 -7
- package/dist/plugins/image-index-sql.d.ts +46 -0
- package/dist/plugins/image-index-sql.js +113 -4
- package/dist/plugins/k8s-bg-scripts.d.ts +34 -0
- package/dist/plugins/k8s-bg-scripts.js +88 -4
- package/dist/plugins/k8s-exec-protocol.d.ts +33 -0
- package/dist/plugins/k8s-exec-protocol.js +41 -0
- package/dist/plugins/local-checkpoint-store.d.ts +40 -0
- package/dist/plugins/local-checkpoint-store.js +86 -7
- package/dist/plugins/local-session-store.d.ts +157 -0
- package/dist/plugins/local-session-store.js +289 -34
- package/dist/plugins/local-task-attachment-store.js +14 -2
- package/dist/plugins/mailbox-store-sql.d.ts +38 -0
- package/dist/plugins/mailbox-store-sql.js +39 -6
- package/dist/plugins/memory-engine-pg.d.ts +30 -0
- package/dist/plugins/memory-engine-pg.js +122 -4
- package/dist/plugins/memory-engine-tidb.d.ts +26 -0
- package/dist/plugins/memory-engine-tidb.js +115 -5
- package/dist/plugins/memory-engine-vector-util.d.ts +5 -0
- package/dist/plugins/memory-engine-vector-util.js +5 -0
- package/dist/plugins/memory-resume-anchor-store.d.ts +8 -0
- package/dist/plugins/memory-resume-anchor-store.js +17 -0
- package/dist/plugins/memory-run-store.d.ts +63 -0
- package/dist/plugins/memory-run-store.js +73 -8
- package/dist/plugins/memory-session-policy-store.d.ts +17 -0
- package/dist/plugins/memory-session-policy-store.js +17 -0
- package/dist/plugins/memory-sync-store-pg.d.ts +42 -0
- package/dist/plugins/memory-sync-store-pg.js +45 -2
- package/dist/plugins/memory-sync-store-tidb.d.ts +9 -0
- package/dist/plugins/memory-sync-store-tidb.js +31 -1
- package/dist/plugins/outcome-ledger-sql.d.ts +63 -0
- package/dist/plugins/outcome-ledger-sql.js +97 -3
- package/dist/plugins/pg-approval-store.d.ts +7 -0
- package/dist/plugins/pg-approval-store.js +7 -0
- package/dist/plugins/pg-breaker-state.d.ts +6 -0
- package/dist/plugins/pg-breaker-state.js +6 -0
- package/dist/plugins/pg-checkpoint-store.d.ts +8 -0
- package/dist/plugins/pg-checkpoint-store.js +8 -0
- package/dist/plugins/pg-cost-quota.d.ts +17 -0
- package/dist/plugins/pg-cost-quota.js +6 -0
- package/dist/plugins/pg-file-snapshot-store.d.ts +6 -0
- package/dist/plugins/pg-file-snapshot-store.js +6 -0
- package/dist/plugins/pg-image-bake.d.ts +9 -0
- package/dist/plugins/pg-image-bake.js +9 -0
- package/dist/plugins/pg-image-index.d.ts +9 -0
- package/dist/plugins/pg-image-index.js +9 -0
- package/dist/plugins/pg-outcome-ledger.d.ts +9 -0
- package/dist/plugins/pg-outcome-ledger.js +9 -0
- package/dist/plugins/pg-pool.d.ts +50 -0
- package/dist/plugins/pg-pool.js +78 -0
- package/dist/plugins/pg-query.d.ts +11 -0
- package/dist/plugins/pg-rate-limiter.d.ts +23 -0
- package/dist/plugins/pg-rate-limiter.js +12 -2
- package/dist/plugins/pg-resume-anchor-store.d.ts +5 -0
- package/dist/plugins/pg-resume-anchor-store.js +5 -0
- package/dist/plugins/pg-run-store.d.ts +7 -0
- package/dist/plugins/pg-run-store.js +7 -0
- package/dist/plugins/pg-safe-json.d.ts +13 -0
- package/dist/plugins/pg-safe-json.js +40 -4
- package/dist/plugins/pg-session-policy-store.d.ts +5 -0
- package/dist/plugins/pg-session-policy-store.js +5 -0
- package/dist/plugins/pg-session-storage.d.ts +72 -0
- package/dist/plugins/pg-session-storage.js +152 -20
- package/dist/plugins/pg-session-store.d.ts +10 -0
- package/dist/plugins/pg-session-store.js +10 -0
- package/dist/plugins/pg-tool-result-store.d.ts +7 -0
- package/dist/plugins/pg-tool-result-store.js +7 -0
- package/dist/plugins/pg-workflow-journal-store.d.ts +7 -0
- package/dist/plugins/pg-workflow-journal-store.js +7 -0
- package/dist/plugins/pg-workflow-run-store.d.ts +7 -0
- package/dist/plugins/pg-workflow-run-store.js +7 -0
- package/dist/plugins/posix-shell-fs.d.ts +3 -0
- package/dist/plugins/posix-shell-fs.js +31 -1
- package/dist/plugins/remote-env-adb.d.ts +25 -0
- package/dist/plugins/remote-env-adb.js +95 -12
- package/dist/plugins/remote-env-e2b.d.ts +146 -0
- package/dist/plugins/remote-env-e2b.js +371 -40
- package/dist/plugins/remote-env-file-error.d.ts +34 -0
- package/dist/plugins/remote-env-file-error.js +37 -0
- package/dist/plugins/remote-env-host.d.ts +151 -0
- package/dist/plugins/remote-env-host.js +468 -70
- package/dist/plugins/remote-env-k8s.d.ts +135 -0
- package/dist/plugins/remote-env-k8s.js +318 -32
- package/dist/plugins/remote-env-local-docker.d.ts +65 -0
- package/dist/plugins/remote-env-local-docker.js +149 -24
- package/dist/plugins/remote-env-ssh.d.ts +35 -0
- package/dist/plugins/remote-env-ssh.js +117 -20
- package/dist/plugins/remote-scratchpad.d.ts +38 -0
- package/dist/plugins/remote-scratchpad.js +32 -2
- package/dist/plugins/remote-shell.d.ts +22 -0
- package/dist/plugins/remote-shell.js +27 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +28 -0
- package/dist/plugins/resume-anchor-store-sql.js +11 -0
- package/dist/plugins/roster-store-sql.d.ts +27 -0
- package/dist/plugins/roster-store-sql.js +54 -0
- package/dist/plugins/run-store-sql.d.ts +194 -0
- package/dist/plugins/run-store-sql.js +210 -9
- package/dist/plugins/s3-presign.d.ts +20 -0
- package/dist/plugins/s3-presign.js +49 -2
- package/dist/plugins/scheduler-support.d.ts +12 -0
- package/dist/plugins/scheduler-support.js +75 -3
- package/dist/plugins/send-file-ledger.d.ts +15 -0
- package/dist/plugins/send-file-ledger.js +53 -4
- package/dist/plugins/send-user-file.d.ts +77 -0
- package/dist/plugins/send-user-file.js +92 -4
- package/dist/plugins/session-policy-store-sql.d.ts +15 -0
- package/dist/plugins/session-policy-store-sql.js +75 -3
- package/dist/plugins/session-store.d.ts +45 -0
- package/dist/plugins/session-store.js +51 -0
- package/dist/plugins/sql-driver.d.ts +77 -0
- package/dist/plugins/sql-driver.js +4 -0
- package/dist/plugins/sql-escape.d.ts +8 -0
- package/dist/plugins/sql-escape.js +8 -0
- package/dist/plugins/sql-row-helpers.d.ts +25 -0
- package/dist/plugins/sql-row-helpers.js +25 -0
- package/dist/plugins/store-backend.d.ts +103 -0
- package/dist/plugins/store-backend.js +120 -27
- package/dist/plugins/store-contracts.d.ts +62 -0
- package/dist/plugins/store-contracts.js +3 -0
- package/dist/plugins/task-attachment-store.d.ts +60 -0
- package/dist/plugins/task-attachment-store.js +49 -3
- package/dist/plugins/task-list-store-sql.d.ts +25 -0
- package/dist/plugins/task-list-store-sql.js +21 -0
- package/dist/plugins/tidb-approval-store.d.ts +6 -0
- package/dist/plugins/tidb-approval-store.js +6 -0
- package/dist/plugins/tidb-breaker-state.d.ts +5 -0
- package/dist/plugins/tidb-breaker-state.js +5 -0
- package/dist/plugins/tidb-checkpoint-store.d.ts +7 -0
- package/dist/plugins/tidb-checkpoint-store.js +7 -0
- package/dist/plugins/tidb-cost-quota.d.ts +6 -0
- package/dist/plugins/tidb-cost-quota.js +1 -0
- package/dist/plugins/tidb-file-snapshot-store.d.ts +6 -0
- package/dist/plugins/tidb-file-snapshot-store.js +6 -0
- package/dist/plugins/tidb-image-bake.d.ts +8 -0
- package/dist/plugins/tidb-image-bake.js +8 -0
- package/dist/plugins/tidb-image-index.d.ts +8 -0
- package/dist/plugins/tidb-image-index.js +8 -0
- package/dist/plugins/tidb-outcome-ledger.d.ts +10 -0
- package/dist/plugins/tidb-outcome-ledger.js +10 -0
- package/dist/plugins/tidb-pool.d.ts +56 -0
- package/dist/plugins/tidb-pool.js +181 -1
- package/dist/plugins/tidb-rate-limiter.d.ts +11 -0
- package/dist/plugins/tidb-rate-limiter.js +5 -2
- package/dist/plugins/tidb-resume-anchor-store.d.ts +5 -0
- package/dist/plugins/tidb-resume-anchor-store.js +5 -0
- package/dist/plugins/tidb-run-store.d.ts +7 -0
- package/dist/plugins/tidb-run-store.js +7 -0
- package/dist/plugins/tidb-session-policy-store.d.ts +5 -0
- package/dist/plugins/tidb-session-policy-store.js +5 -0
- package/dist/plugins/tidb-session-storage.d.ts +43 -0
- package/dist/plugins/tidb-session-storage.js +62 -3
- package/dist/plugins/tidb-session-store.d.ts +142 -0
- package/dist/plugins/tidb-session-store.js +264 -16
- package/dist/plugins/tidb-tool-result-store.d.ts +5 -0
- package/dist/plugins/tidb-tool-result-store.js +7 -0
- package/dist/plugins/tidb-workflow-journal-store.d.ts +7 -0
- package/dist/plugins/tidb-workflow-journal-store.js +7 -0
- package/dist/plugins/tidb-workflow-run-store.d.ts +8 -0
- package/dist/plugins/tidb-workflow-run-store.js +8 -0
- package/dist/plugins/tool-result-store-sql.d.ts +58 -0
- package/dist/plugins/tool-result-store-sql.js +38 -2
- package/dist/plugins/web-search.d.ts +35 -0
- package/dist/plugins/web-search.js +45 -9
- package/dist/plugins/workflow-journal-limits.d.ts +10 -0
- package/dist/plugins/workflow-journal-limits.js +10 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +78 -0
- package/dist/plugins/workflow-journal-store-sql.js +59 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +84 -0
- package/dist/plugins/workflow-run-store-sql.js +84 -6
- package/dist/plugins/worktree-isolation.d.ts +45 -0
- package/dist/plugins/worktree-isolation.js +105 -6
- package/dist/plugins/write-behind-counter.d.ts +56 -1
- package/dist/plugins/write-behind-counter.js +53 -14
- package/dist/principal-jwt.d.ts +24 -0
- package/dist/principal-jwt.js +60 -5
- package/dist/project-memory.d.ts +22 -0
- package/dist/project-memory.js +144 -15
- package/dist/prompts-domain-validate.d.ts +28 -0
- package/dist/prompts-domain-validate.js +42 -1
- package/dist/question.d.ts +33 -0
- package/dist/question.js +69 -2
- package/dist/resource-suspend.d.ts +21 -0
- package/dist/resource-suspend.js +16 -0
- package/dist/router/route-orchestration.d.ts +78 -0
- package/dist/router/route-orchestration.js +77 -0
- package/dist/run-local.d.ts +32 -0
- package/dist/run-local.js +172 -8
- package/dist/runs.d.ts +189 -4
- package/dist/runs.js +465 -24
- package/dist/runtime-caps-resolver.d.ts +106 -0
- package/dist/runtime-caps-resolver.js +89 -4
- package/dist/runtime-governance.d.ts +84 -0
- package/dist/runtime-governance.js +127 -1
- package/dist/sandbox-pkg-source.d.ts +23 -0
- package/dist/sandbox-pkg-source.js +37 -0
- package/dist/sealed-key.d.ts +54 -0
- package/dist/sealed-key.js +68 -3
- package/dist/security.d.ts +108 -0
- package/dist/security.js +145 -6
- package/dist/sema-registry.d.ts +21 -0
- package/dist/sema-registry.js +21 -0
- package/dist/session-leaf-bus.d.ts +31 -0
- package/dist/session-leaf-bus.js +32 -0
- package/dist/session-sync-content.d.ts +46 -0
- package/dist/session-sync-content.js +47 -1
- package/dist/session-sync-kernel.d.ts +89 -0
- package/dist/session-sync-kernel.js +48 -3
- package/dist/session-sync.d.ts +125 -0
- package/dist/session-sync.js +181 -8
- package/dist/session-titler.d.ts +26 -0
- package/dist/session-titler.js +41 -7
- package/dist/session-watch.d.ts +53 -1
- package/dist/session-watch.js +73 -9
- package/dist/sighup-idle.d.ts +30 -0
- package/dist/sighup-idle.js +12 -1
- package/dist/spec-fields.d.ts +91 -3
- package/dist/spec-fields.js +116 -4
- package/dist/task-cwd.d.ts +50 -0
- package/dist/task-cwd.js +68 -1
- package/dist/task-mcp.d.ts +47 -0
- package/dist/task-mcp.js +29 -0
- package/dist/task-settings.d.ts +175 -0
- package/dist/task-settings.js +226 -11
- package/dist/task-workflow.d.ts +67 -0
- package/dist/task-workflow.js +75 -8
- package/dist/tool-approval.d.ts +91 -0
- package/dist/tool-approval.js +215 -0
- package/dist/trace/artifacts.d.ts +9 -0
- package/dist/trace/artifacts.js +30 -5
- package/dist/trace/core-keyset-guard.d.ts +18 -0
- package/dist/trace/ledger-sink.d.ts +43 -0
- package/dist/trace/ledger-sink.js +64 -5
- package/dist/trace/project.d.ts +133 -0
- package/dist/trace/project.js +189 -2
- package/dist/trace/redact.d.ts +19 -0
- package/dist/trace/redact.js +66 -9
- package/dist/usage-analytics.d.ts +26 -0
- package/dist/usage-analytics.js +26 -3
- package/package.json +1 -1
package/dist/leader/endpoint.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 MVP M4 — leader HTTP endpoint (V2-MVP-PLAN.md). Exposes `runLeaderTask` over HTTP:
|
|
3
|
+
* POST /v1/leader → 202 { leaderRunId, status:"running" }, runs in the background
|
|
4
|
+
* GET /v1/leader/:id → { id, status, result?, error? }
|
|
5
|
+
* A leader run is long (minutes: provision N E2B workers → real model coding → merge → push), so it is async
|
|
6
|
+
* (background + poll), mirroring /v1/runs. `runLeader` is injected (the real wiring lives in wire.ts /
|
|
7
|
+
* main.ts) so this handler is pure + mock-tested. MVP tracking is in-memory (single-replica); a TiDB-backed
|
|
8
|
+
* leader-run store is the cross-replica follow-up (same shape as run-store).
|
|
9
|
+
*/
|
|
1
10
|
import { uuidv7 } from "@sema-agent/core";
|
|
11
|
+
/**
|
|
12
|
+
* LEADER-REPAIRLOOP-INTEGRATION §5/§10.6 — map a finished `LeaderResult` to the run status. The repair terminal
|
|
13
|
+
* (set only when LEADER_REPAIR_LOOP/LEADER_MEASURE_GATES drove a single-agent path or the merge push chokepoint
|
|
14
|
+
* held) refines the legacy `ok ? completed : failed` into a THIRD `needs_human` for an ABSTAIN (a held candidate
|
|
15
|
+
* awaiting a human), keeping `oracle.unprotected`/`gave_up` as `failed` (carry the terminal as the WHY —
|
|
16
|
+
* no-silent-failures). Undefined `repairTerminal` ⇒ the exact legacy mapping (byte-identical default path). */
|
|
2
17
|
function statusForLeaderResult(result) {
|
|
3
18
|
switch (result.repairTerminal) {
|
|
4
19
|
case "candidate_only":
|
|
@@ -9,13 +24,17 @@ function statusForLeaderResult(result) {
|
|
|
9
24
|
case "gave_up":
|
|
10
25
|
return "failed";
|
|
11
26
|
default:
|
|
27
|
+
// `fixed` (not reachable SAFE-tier) or undefined → the legacy ok-based mapping.
|
|
12
28
|
return result.ok ? "completed" : "failed";
|
|
13
29
|
}
|
|
14
30
|
}
|
|
15
31
|
const LEADER_ID_RE = /^\/v1\/leader\/([^/]+)$/;
|
|
32
|
+
/** How long a FINISHED leader run stays pollable before it's evicted from the in-memory registry. */
|
|
16
33
|
const RUN_RETENTION_MS = 60 * 60_000;
|
|
17
34
|
export function createLeaderEndpoint(runLeader, opts = {}) {
|
|
18
35
|
const runs = new Map();
|
|
36
|
+
// Bound the in-memory registry: a finished leader run stays pollable for RUN_RETENTION_MS, then is evicted.
|
|
37
|
+
// Swept on each POST (amortized, no timer) so the map can't grow without limit over a long-lived process.
|
|
19
38
|
function reap() {
|
|
20
39
|
const cutoff = Date.now() - RUN_RETENTION_MS;
|
|
21
40
|
for (const [id, run] of runs) {
|
|
@@ -37,12 +56,13 @@ export function createLeaderEndpoint(runLeader, opts = {}) {
|
|
|
37
56
|
}
|
|
38
57
|
reap();
|
|
39
58
|
const id = uuidv7();
|
|
40
|
-
runs.set(id, { id, status: "running", startedAt: Date.now(), owner: requester ?? null });
|
|
59
|
+
runs.set(id, { id, status: "running", startedAt: Date.now(), owner: requester ?? null }); // BL-4: record owner
|
|
60
|
+
// fire-and-forget; status polled via GET. Never throws out of the handler.
|
|
41
61
|
void (async () => {
|
|
42
62
|
try {
|
|
43
63
|
const result = await runLeader(b);
|
|
44
64
|
const run = runs.get(id);
|
|
45
|
-
run.status = statusForLeaderResult(result);
|
|
65
|
+
run.status = statusForLeaderResult(result); // §10.6: ok→completed/failed PLUS needs_human for a held candidate
|
|
46
66
|
run.result = result;
|
|
47
67
|
run.finishedAt = Date.now();
|
|
48
68
|
opts.logger?.info?.("leader_run_done", { id, ok: result.ok, status: run.status, ...(result.repairTerminal ? { repairTerminal: result.repairTerminal } : {}), merged: result.merge && result.merge.ok ? result.merge.merged : undefined });
|
|
@@ -62,6 +82,9 @@ export function createLeaderEndpoint(runLeader, opts = {}) {
|
|
|
62
82
|
const run = runs.get(m[1]);
|
|
63
83
|
if (!run)
|
|
64
84
|
return { status: 404, body: { error: "leader run not found", errorCode: "not_found.leader_run" } };
|
|
85
|
+
// BL-4 owner check: an owned run is visible ONLY to its owner — 404 (not 403) to anyone else, so a
|
|
86
|
+
// non-owner can't even confirm the id exists. owner null/undefined = anonymous/single-tenant run,
|
|
87
|
+
// visible to any authenticated caller (back-compat; mirrors GET /v1/runs/:id's runOwnerOk).
|
|
65
88
|
if (run.owner != null && run.owner !== (requester ?? null)) {
|
|
66
89
|
return { status: 404, body: { error: "leader run not found", errorCode: "not_found.leader_run" } };
|
|
67
90
|
}
|
package/dist/leader/fanout.d.ts
CHANGED
|
@@ -1,16 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 MVP — leader fan-out composition layer (design/50 §3, V2-MVP-PLAN.md M1, core seam).
|
|
3
|
+
*
|
|
4
|
+
* Runs N sub-task workers in parallel over `runner.runTaskStream` sharing ONE AbortController, bounded by a
|
|
5
|
+
* Semaphore, with an overall deadline (no infinite wait — council#5), a concurrency claim (run-store
|
|
6
|
+
* createRun unique-key CAS — the rule-5 dual-session tax solved at worker scale), and a
|
|
7
|
+
* `cancelAll` that ABORTS first (stopping not-yet-started workers + aborting running ones) then interrupts the
|
|
8
|
+
* snapshot — closing the late-registration race (council round-2). Returns a typed WorkerReport per worker (council#6 — the
|
|
9
|
+
* Coordinator needs a defined shape to route diffs in merge(b)).
|
|
10
|
+
*
|
|
11
|
+
* cancelAll uses `TaskStream.destroy()` (core 1.71): abort + await run-settle + CAS-expire the checkpoint
|
|
12
|
+
* (fencing any concurrent resume) + reap a SUSPENDED worker's paused container — closing the interim-`interrupt()`
|
|
13
|
+
* gap (a cancel hitting a suspended worker no longer leaks a paused container or an orphan checkpoint). Per core's
|
|
14
|
+
* contract, `destroy()` reaps the CHECKPOINT; the leader (leader.ts) still owns + destroys each worker's static env
|
|
15
|
+
* in its own finally (the two are disjoint). Verified on real E2B+TiDB by the suspended-cancel dogfood.
|
|
16
|
+
*
|
|
17
|
+
* MVP scope: the COMPOSITION mechanics, unit-tested with a mock runner. Real E2B workers + branch/baseSha from
|
|
18
|
+
* a worker's actual git state are wired at M4/M5 (joint dogfood).
|
|
19
|
+
*/
|
|
1
20
|
import type { TaskSpec, TaskResult, TaskStream, RepairTerminal } from "@sema-agent/core";
|
|
21
|
+
/** What the Coordinator gets back per worker (council#6 — merge(b) routes on this). */
|
|
2
22
|
export interface WorkerReport {
|
|
3
23
|
workerId: string;
|
|
4
24
|
sessionId: string;
|
|
25
|
+
/** completed = mergeable; failed/suspended/timeout/rejected = not merged (quarantined). */
|
|
5
26
|
status: "completed" | "failed" | "suspended" | "timeout" | "rejected";
|
|
27
|
+
/** Worker's branch + the base it forked from — drives the merge(b) `git format-patch <baseSha>` diff-out. */
|
|
6
28
|
branch?: string;
|
|
7
29
|
baseSha?: string;
|
|
8
30
|
error?: string;
|
|
31
|
+
/** The worker's TaskResult.stats (tokens/cost/turns) — for the value-campaign cost accounting. */
|
|
9
32
|
stats?: TaskResult["stats"];
|
|
33
|
+
/** design/52 L3a module sub-gate: did this worker's module pass the per-module judge (after any repair)? */
|
|
10
34
|
moduleJudge?: "pass" | "fail";
|
|
35
|
+
/** Number of bounded repairs the module sub-gate spent on this worker (0 = passed first try). */
|
|
11
36
|
repairs?: number;
|
|
37
|
+
/** design/74 Slice 6: the terminal checkpoint gate when a worker is still SUSPENDED (the leader auto-resumed
|
|
38
|
+
* it up to its bound but it didn't fully complete — e.g. the overall deadline hit or the slice cap). Present
|
|
39
|
+
* ⇒ resumable: the operator/leader can escalate (more budget) or accept the belt-diff partial progress. */
|
|
12
40
|
checkpointGate?: TaskResult["checkpointGate"];
|
|
41
|
+
/** design/74 Slice 6: the worker's terminal `TaskResult.errorCode` (e.g. `budget.exceeded` on an exhausted
|
|
42
|
+
* resume, `limit.max_turns`) — surfaced for /v1/leader observability. */
|
|
13
43
|
errorCode?: TaskResult["errorCode"];
|
|
44
|
+
/** LEADER-REPAIRLOOP-INTEGRATION §10.6 (THE push chokepoint): the `runRepairLoop` terminal a single-agent
|
|
45
|
+
* worker resolved to, when the repair loop ran on this worker (LEADER_REPAIR_LOOP on). It MUST ride on the
|
|
46
|
+
* report because a SAFE-tier `candidate_only` maps to core verdict "PASS" → this report's `status` collapses
|
|
47
|
+
* to "completed" (there is no `candidate_only` status member) → the candidate state would otherwise be LOST,
|
|
48
|
+
* and `merge.ts:226` would push `testCmd`-green-but-unconfirmed work. The merge push chokepoint gates on this
|
|
49
|
+
* field (fires only when no mergeable report carries `repairTerminal ∉ {undefined, "fixed"}`), covering the
|
|
50
|
+
* collapse-to-single and N=1 paths by construction. `status` stays "completed" for back-compat; this is the
|
|
51
|
+
* WHY. Undefined ⇒ the repair loop did not run (the default, byte-identical path). */
|
|
14
52
|
repairTerminal?: RepairTerminal;
|
|
15
53
|
}
|
|
16
54
|
export interface FanOutSubtask {
|
|
@@ -18,29 +56,51 @@ export interface FanOutSubtask {
|
|
|
18
56
|
sessionId: string;
|
|
19
57
|
baseSha?: string;
|
|
20
58
|
branch?: string;
|
|
59
|
+
/** The sub-task spec MINUS the fields fan-out owns (sessionId + signal are injected per worker). */
|
|
21
60
|
spec: Omit<TaskSpec, "sessionId" | "signal">;
|
|
22
61
|
}
|
|
62
|
+
/** Only the two TaskStream methods fan-out consumes (the real core TaskStream satisfies this). */
|
|
23
63
|
export type FanOutStream = Pick<TaskStream, "result" | "destroy">;
|
|
24
64
|
export interface RunnerLike {
|
|
25
65
|
runTaskStream(spec: TaskSpec): FanOutStream;
|
|
26
66
|
}
|
|
67
|
+
/** Concurrency claim (run-store `createRun` unique-key CAS). Returns false = a duplicate spawn lost the claim. */
|
|
27
68
|
export type ClaimFn = (workerId: string, sessionId: string) => Promise<boolean>;
|
|
28
69
|
export interface FanOutOptions {
|
|
29
70
|
runner: RunnerLike;
|
|
71
|
+
/** Overall fan-out deadline (ms). On expiry → cancelAll, the still-running workers are cancelled. */
|
|
30
72
|
timeoutMs: number;
|
|
73
|
+
/** Grace (ms) after cancelAll before fanOut returns regardless — HARD-bounds a worker that ignores the abort.
|
|
74
|
+
* Default {@link CANCEL_GRACE_MS}. The un-settled workers are reported `timeout`. */
|
|
31
75
|
cancelGraceMs?: number;
|
|
76
|
+
/** Semaphore cap on concurrent workers (MVP = 2; structure scales to N). */
|
|
32
77
|
maxConcurrency: number;
|
|
78
|
+
/** Optional concurrency claim; omitted = always-claim (single-session MVP). */
|
|
33
79
|
claim?: ClaimFn;
|
|
34
80
|
logger?: {
|
|
35
81
|
warn?: (msg: string, meta?: Record<string, unknown>) => void;
|
|
36
82
|
info?: (msg: string, meta?: Record<string, unknown>) => void;
|
|
37
83
|
};
|
|
84
|
+
/** Optional per-worker run override (e.g. runWithVerification). When set, runOne routes through THIS instead of
|
|
85
|
+
* the default runTaskStream-and-map — still bounded by the semaphore, the overall timeout→cancelAll, and the
|
|
86
|
+
* claim. Lets the verify path reuse fan-out's concurrency/timeout/cancellation rather than an unbounded
|
|
87
|
+
* Promise.all (council). The override receives the shared abort signal; pass it into the run so a hung or
|
|
88
|
+
* cancelled worker actually aborts (else the overall-timeout's `await work` can never unblock). Like the default
|
|
89
|
+
* path it need not catch — runOne maps a throw to failed/timeout. */
|
|
38
90
|
runWorker?: (st: FanOutSubtask, signal: AbortSignal) => Promise<WorkerReport>;
|
|
91
|
+
/** Replan-lite C4 (design/68 §6): when a worker settles SUSPENDED, immediately cancelAll the rest — the
|
|
92
|
+
* suspended worker itself has already settled (its stream is deregistered), so the cancel sweep cannot
|
|
93
|
+
* touch its checkpoint/paused env (the destroy-exemption falls out of the registration lifecycle). */
|
|
39
94
|
cancelOnSuspend?: boolean;
|
|
40
95
|
}
|
|
41
96
|
export interface FanOutResult {
|
|
42
97
|
reports: WorkerReport[];
|
|
98
|
+
/** True if the overall deadline fired and cancelAll ran. */
|
|
43
99
|
cancelled: boolean;
|
|
44
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Fan out `subtasks` in parallel. Never throws — every worker resolves to a WorkerReport (failures captured).
|
|
103
|
+
* The caller (Coordinator) merges only `status==="completed"` reports.
|
|
104
|
+
*/
|
|
45
105
|
export declare function fanOut(subtasks: FanOutSubtask[], opts: FanOutOptions): Promise<FanOutResult>;
|
|
46
106
|
//# sourceMappingURL=fanout.d.ts.map
|
package/dist/leader/fanout.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** A tiny counting semaphore (FIFO-ish) bounding concurrent worker execution. */
|
|
1
2
|
class Semaphore {
|
|
2
3
|
max;
|
|
3
4
|
active = 0;
|
|
@@ -21,17 +22,30 @@ class Semaphore {
|
|
|
21
22
|
function mapStatus(s) {
|
|
22
23
|
return s === "completed" ? "completed" : s === "suspended" ? "suspended" : "failed";
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Fan out `subtasks` in parallel. Never throws — every worker resolves to a WorkerReport (failures captured).
|
|
27
|
+
* The caller (Coordinator) merges only `status==="completed"` reports.
|
|
28
|
+
*/
|
|
24
29
|
export async function fanOut(subtasks, opts) {
|
|
25
30
|
const sharedAC = new AbortController();
|
|
26
31
|
const streams = new Map();
|
|
27
32
|
let cancelled = false;
|
|
28
33
|
const cancelAll = async () => {
|
|
29
34
|
cancelled = true;
|
|
35
|
+
// Abort FIRST (council round-2): one signal both aborts RUNNING workers (their shared spec.signal) AND
|
|
36
|
+
// stops NOT-YET-STARTED ones — runOne's `sharedAC.signal.aborted` guard returns before provisioning a VM.
|
|
37
|
+
// Closes the race where a worker registering AFTER the snapshot would miss it. Then destroy() each registered
|
|
38
|
+
// stream (core 1.71): abort + await settle + CAS-expire the checkpoint (fences any concurrent resume) + reap
|
|
39
|
+
// a SUSPENDED worker's paused container — so a cancel that hits a suspended worker leaks neither a paused
|
|
40
|
+
// container nor an orphan checkpoint. The leader (leader.ts) still destroys each worker's static env in its
|
|
41
|
+
// own finally; destroy() here reaps the (durable) checkpoint — the two are disjoint (core [R47]).
|
|
30
42
|
sharedAC.abort();
|
|
31
43
|
await Promise.allSettled([...streams.values()].map((s) => s.destroy()));
|
|
32
44
|
};
|
|
33
45
|
const sem = new Semaphore(opts.maxConcurrency);
|
|
34
46
|
let pendingCancel;
|
|
47
|
+
// C4: a SUSPENDED settle preempts the remaining fan-out (the settled worker is already out of `streams`,
|
|
48
|
+
// so cancelAll's destroy sweep is exempt of it by construction — its checkpoint/paused env survive).
|
|
35
49
|
const maybeCancelOnSuspend = (r) => {
|
|
36
50
|
if (opts.cancelOnSuspend && r.status === "suspended" && !cancelled) {
|
|
37
51
|
opts.logger?.info?.("fanout_suspend_cancel", { suspendedWorker: r.workerId });
|
|
@@ -41,12 +55,15 @@ export async function fanOut(subtasks, opts) {
|
|
|
41
55
|
};
|
|
42
56
|
const runOne = async (st) => {
|
|
43
57
|
const base = { workerId: st.workerId, sessionId: st.sessionId, branch: st.branch, baseSha: st.baseSha };
|
|
58
|
+
// Concurrency claim (CAS) BEFORE provisioning — a lost claim means a duplicate spawn; skip, don't run.
|
|
44
59
|
if (opts.claim && !(await opts.claim(st.workerId, st.sessionId))) {
|
|
45
60
|
return { ...base, status: "rejected", error: "claim lost (duplicate spawn)" };
|
|
46
61
|
}
|
|
47
62
|
return sem.run(async () => {
|
|
48
63
|
if (sharedAC.signal.aborted)
|
|
49
64
|
return { ...base, status: "timeout", error: "cancelled before start" };
|
|
65
|
+
// Per-worker run override (verify path): reuse the semaphore + shared abort signal; map throws like the
|
|
66
|
+
// default path so runOne still never rejects (Promise.all stays safe).
|
|
50
67
|
if (opts.runWorker) {
|
|
51
68
|
try {
|
|
52
69
|
return maybeCancelOnSuspend(await opts.runWorker(st, sharedAC.signal));
|
|
@@ -69,24 +86,32 @@ export async function fanOut(subtasks, opts) {
|
|
|
69
86
|
report = { ...base, status: mapStatus(result.status), stats: result.stats, ...(result.errorMessage ? { error: result.errorMessage } : {}) };
|
|
70
87
|
}
|
|
71
88
|
catch (e) {
|
|
89
|
+
// interrupted/aborted workers may reject here — report, don't propagate.
|
|
72
90
|
report = { ...base, status: cancelled ? "timeout" : "failed", error: e instanceof Error ? e.message : String(e) };
|
|
73
91
|
}
|
|
74
92
|
finally {
|
|
75
93
|
streams.delete(st.workerId);
|
|
76
94
|
}
|
|
95
|
+
// AFTER deregistration — so a suspend-triggered cancelAll can never destroy THIS worker's own stream
|
|
96
|
+
// (destroying a suspended stream = CAS-expiring its checkpoint, the exact thing C4 forbids).
|
|
77
97
|
return maybeCancelOnSuspend(report);
|
|
78
98
|
});
|
|
79
99
|
};
|
|
100
|
+
// Record each worker's report as it settles so the overall deadline can HARD-bound the wait: if a worker's
|
|
101
|
+
// stream.result() ignores the abort, `Promise.all(work)` would never resolve and `await work` below would hang
|
|
102
|
+
// PAST the deadline (the overall timeout would be only "soft"). On the grace expiry we return whatever settled
|
|
103
|
+
// + a synthesized `timeout` for the rest, so fanOut always returns within timeoutMs + the cancel grace.
|
|
80
104
|
const results = new Map();
|
|
81
105
|
const work = Promise.all(subtasks.map((st) => runOne(st).then((r) => { results.set(st.workerId, r); return r; })));
|
|
82
106
|
const timer = new Promise((resolve) => {
|
|
83
107
|
const id = setTimeout(() => resolve("timeout"), opts.timeoutMs);
|
|
84
|
-
void work.then(() => clearTimeout(id));
|
|
108
|
+
void work.then(() => clearTimeout(id)); // don't leak the timer when work finishes first
|
|
85
109
|
});
|
|
86
110
|
const raced = await Promise.race([work.then(() => "done"), timer]);
|
|
87
111
|
if (raced === "timeout") {
|
|
88
112
|
opts.logger?.warn?.("fanout_timeout", { timeoutMs: opts.timeoutMs, workers: subtasks.length });
|
|
89
113
|
await cancelAll();
|
|
114
|
+
// Hard bound: give cancelAll a grace window to settle the running workers, then stop waiting regardless.
|
|
90
115
|
const graceMs = opts.cancelGraceMs ?? CANCEL_GRACE_MS;
|
|
91
116
|
const grace = new Promise((resolve) => {
|
|
92
117
|
const id = setTimeout(() => resolve("grace"), graceMs);
|
|
@@ -100,10 +125,11 @@ export async function fanOut(subtasks, opts) {
|
|
|
100
125
|
};
|
|
101
126
|
}
|
|
102
127
|
}
|
|
103
|
-
const reports = await work;
|
|
128
|
+
const reports = await work; // all settled (normal path, or cancelled workers settled within grace)
|
|
104
129
|
if (pendingCancel)
|
|
105
|
-
await pendingCancel.catch(() => { });
|
|
130
|
+
await pendingCancel.catch(() => { }); // suspend-triggered sweep fully settled before return
|
|
106
131
|
return { reports, cancelled };
|
|
107
132
|
}
|
|
133
|
+
/** Grace window after `cancelAll` before fanOut returns regardless — bounds a worker that ignores the abort. */
|
|
108
134
|
const CANCEL_GRACE_MS = 30_000;
|
|
109
135
|
//# sourceMappingURL=fanout.js.map
|
|
@@ -1,36 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OUT-OF-PROCESS grader plumbing for the leader × `runRepairLoop` integration
|
|
3
|
+
* (`docs/LEADER-REPAIRLOOP-INTEGRATION.md` §3.2 + the authoritative §10 layer). Two distinct consumers:
|
|
4
|
+
*
|
|
5
|
+
* - **R1 (single-agent oracle, §10.1)** — the `RepairOracle` closure (`repair-oracle.ts`) reuses the EXISTING
|
|
6
|
+
* integration sandbox as its grader at ZERO extra sandbox cost. It needs only a `GraderHandle` (a writeFile +
|
|
7
|
+
* exec bound to that sandbox via the wire's `asIntegrationEnv`/`sh` pattern) and the worker-diff source — it
|
|
8
|
+
* grades through `runExecGate(graderEnv, steps)` itself, so it does NOT use `applyAndGrade` (the closure owns
|
|
9
|
+
* its hermetic reset+apply inline; `repair-oracle.ts:89`). This file gives the merge path the SAME apply-and-
|
|
10
|
+
* grade primitive so the two stay byte-consistent.
|
|
11
|
+
*
|
|
12
|
+
* - **R2 (measure-drives-repair, §10.4)** — the merge path (`merge.ts`, Stage-2) RE-SEEDS a single minted
|
|
13
|
+
* grader per measure round (NOT a new microVM): `git reset --hard <integBase> && git clean -fdx`, re-apply the
|
|
14
|
+
* INTEGRATED patch, then run the trusted `measureCmd` there. The repair agent edits the merged sandbox, so the
|
|
15
|
+
* measure must NOT run in that (possibly poisoned) sandbox — `applyAndGrade` runs it in a fresh-seeded grader.
|
|
16
|
+
* Before re-measure, the caller mechanically checks the patch's changed-file list against an allowlist
|
|
17
|
+
* (`changedFilesWithinAllowlist`, §10.4(ii)) — an out-of-allowlist / build-config touch denies the candidate.
|
|
18
|
+
*
|
|
19
|
+
* The standalone, mint-a-distinct-sandbox grader factory (`createGraderEnvFactory`) is the AUTO-ACCEPT slice path
|
|
20
|
+
* (flag `LEADER_GRADER_FACTORY`, default OFF until the §7 OFF-Gate-1 end-to-end verification). It is documented +
|
|
21
|
+
* stubbed here, NOT wired — v1 reuses the integration sandbox (R1) + re-seeds it (R2) instead.
|
|
22
|
+
*
|
|
23
|
+
* Everything here is additive + OFF by default: nothing in this file runs unless the Stage-2 seams call it behind
|
|
24
|
+
* `LEADER_REPAIR_LOOP` / `LEADER_MEASURE_GATES` / `LEADER_GRADER_FACTORY`.
|
|
25
|
+
*/
|
|
1
26
|
import { type ExecutionEnv, type ExecStep } from "@sema-agent/core";
|
|
27
|
+
/**
|
|
28
|
+
* A grader env bound to a concrete sandbox. The wire constructs this from the integration sandbox's
|
|
29
|
+
* `RemoteExecutionEnv` (the `asIntegrationEnv`/`sh` pattern in `wire.ts`), so `grader-env-factory.ts` never
|
|
30
|
+
* depends on the adapter/wire module (no cycle). `env` is the core `ExecutionEnv` `runExecGate` grades in;
|
|
31
|
+
* `writeFile` plants the candidate patch into the grader tree; `repoDir`/`integBase` are the hermetic reset
|
|
32
|
+
* target (§10.1) — `git rev-parse HEAD` taken right after seed + oracle-inject (`merge.ts:137` pattern).
|
|
33
|
+
*/
|
|
2
34
|
export interface GraderHandle {
|
|
35
|
+
/** The isolated grader env (the reused integration sandbox for R1, a fresh-minted one for the auto-accept slice). */
|
|
3
36
|
env: ExecutionEnv;
|
|
37
|
+
/** Write a file into the grader tree (the wire binds this to the sandbox's `writeFile`). */
|
|
4
38
|
writeFile: (path: string, content: string) => Promise<void>;
|
|
39
|
+
/** Repo dir inside the grader (e.g. `/repo`). */
|
|
5
40
|
repoDir: string;
|
|
41
|
+
/** The grader's CLEAN base rev — the hermetic reset target (§10.1). Re-applies run base→latest, never cumulative. */
|
|
6
42
|
integBase: string;
|
|
7
43
|
}
|
|
44
|
+
/** The outcome of one `applyAndGrade` round: whether the trusted steps passed + a failure trace tail (untrusted). */
|
|
8
45
|
export interface GradeOutcome {
|
|
46
|
+
/** True iff the prep applied cleanly AND every trusted step ran and exited 0. */
|
|
9
47
|
passed: boolean;
|
|
48
|
+
/** False when the patch failed to apply onto the clean base (an apply conflict) — distinct from a step failure. */
|
|
10
49
|
applied: boolean;
|
|
50
|
+
/** Failure-output tail (untrusted worker-adjacent data; the caller delimits/sanitizes before surfacing). */
|
|
11
51
|
trace?: string;
|
|
12
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* §10.1/§10.4 — HERMETIC apply-and-grade. Reset the grader to its clean `integBase` (`git reset --hard` +
|
|
55
|
+
* `git clean -fdx`), apply the FULL `base→latest` `patch` (never cumulative onto an already-applied tree), then
|
|
56
|
+
* run the TRUSTED, spec-derived `steps` (`testCmd` / `measureCmd`) there. `steps` MUST NOT be worker-authored
|
|
57
|
+
* (the `runExecGate` security contract — exec-gate.ts header). Used by the R2 measure grader; the R1 oracle
|
|
58
|
+
* closure performs the equivalent inline (`repair-oracle.ts`) so the single-agent and merge paths grade
|
|
59
|
+
* identically. Never throws — an apply conflict or a step failure is a non-passing `GradeOutcome`.
|
|
60
|
+
*/
|
|
13
61
|
export declare function applyAndGrade(handle: GraderHandle, patch: string, steps: ExecStep[]): Promise<GradeOutcome>;
|
|
62
|
+
/** The §10.4(ii) decision: the subset of `changedFiles` that is OUT of the allowlist or hits a build-config deny. */
|
|
14
63
|
export declare function changedFilesOutOfAllowlist(changedFiles: string[], allowlist: string[]): string[];
|
|
64
|
+
/** §10.4(ii): true iff EVERY changed file is within the allowlist and none is a denied build-config path. */
|
|
15
65
|
export declare function changedFilesWithinAllowlist(changedFiles: string[], allowlist: string[]): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* §3.2 — the FUTURE standalone grader factory (the auto-accept-slice sibling of `main.ts`'s `executionEnvFactory`,
|
|
68
|
+
* `main.ts:204-249`). Mints a DISTINCT sandbox via the same `e2b/k8sExecutionEnvFactory`, seeds `seedCmd` + the
|
|
69
|
+
* oracle files ONLY there, and returns a `GraderHandle` with `provenance:"control_plane"`. v1 does NOT mint a
|
|
70
|
+
* standalone grader (R1 reuses the integration sandbox; R2 re-seeds it) — this is the path the auto-accept slice
|
|
71
|
+
* (flag `LEADER_GRADER_FACTORY`, default OFF) opens once the §7 OFF-Gate-1 deployment-contract proof lands. It is
|
|
72
|
+
* a documented STUB (NOT wired): minting + seeding a per-run sandbox is real provisioning work that belongs to the
|
|
73
|
+
* auto-accept stage, and shipping a half-mint here would be a stopgap (clay rule). The signature is fixed so the
|
|
74
|
+
* Stage-N auto-accept wiring drops in without a contract change.
|
|
75
|
+
*/
|
|
16
76
|
export interface GraderEnvFactoryCfg {
|
|
77
|
+
/** Mint a distinct, isolated sandbox env (the same factory the workers/integration sandbox use). */
|
|
17
78
|
mint: (sessionId: string) => {
|
|
18
79
|
env: ExecutionEnv;
|
|
19
80
|
writeFile: (p: string, c: string) => Promise<void>;
|
|
20
81
|
sh: (cmd: string) => Promise<string>;
|
|
21
82
|
destroy: () => Promise<void>;
|
|
22
83
|
};
|
|
84
|
+
/** Shell to seed the base repo (idempotent) — runs ONLY in the minted grader. */
|
|
23
85
|
seedCmd: string;
|
|
86
|
+
/** Repo dir inside the grader. */
|
|
24
87
|
repoDir: string;
|
|
88
|
+
/** Hidden-oracle files seeded ONLY in the grader (never the worker env). */
|
|
25
89
|
oracleFiles?: Array<{
|
|
26
90
|
path: string;
|
|
27
91
|
content: string;
|
|
28
92
|
}>;
|
|
29
93
|
}
|
|
94
|
+
/** §3.2 — a minted standalone grader plus its lifecycle + isolation brand (for the auto-accept slice). */
|
|
30
95
|
export interface MintedGrader extends GraderHandle {
|
|
96
|
+
/** The control-plane provenance brand (distinguishes a minted grader from the reused integration sandbox). */
|
|
31
97
|
provenance: "control_plane";
|
|
98
|
+
/** The grader's hidden-oracle paths (passed to `runRepairLoop.immutableOraclePaths` ONLY when the auto-accept
|
|
99
|
+
* slice runs the full `assertOracleIsolation` — v1 OMITS these; §10.2). */
|
|
32
100
|
immutableOraclePaths: string[];
|
|
101
|
+
/** Reap the minted sandbox. */
|
|
33
102
|
destroy: () => Promise<void>;
|
|
34
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* §3.2 STUB — build the standalone grader factory. NOT wired in v1 (the auto-accept slice owns it, flag
|
|
106
|
+
* `LEADER_GRADER_FACTORY`). Throws a clearly-marked not-implemented error if invoked before that slice lands so a
|
|
107
|
+
* stray call fails loudly rather than silently mis-grading — this is an explicit placeholder, not a quiet stopgap.
|
|
108
|
+
*/
|
|
35
109
|
export declare function createGraderEnvFactory(_cfg: GraderEnvFactoryCfg): () => Promise<MintedGrader>;
|
|
36
110
|
//# sourceMappingURL=grader-env-factory.d.ts.map
|
|
@@ -1,9 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OUT-OF-PROCESS grader plumbing for the leader × `runRepairLoop` integration
|
|
3
|
+
* (`docs/LEADER-REPAIRLOOP-INTEGRATION.md` §3.2 + the authoritative §10 layer). Two distinct consumers:
|
|
4
|
+
*
|
|
5
|
+
* - **R1 (single-agent oracle, §10.1)** — the `RepairOracle` closure (`repair-oracle.ts`) reuses the EXISTING
|
|
6
|
+
* integration sandbox as its grader at ZERO extra sandbox cost. It needs only a `GraderHandle` (a writeFile +
|
|
7
|
+
* exec bound to that sandbox via the wire's `asIntegrationEnv`/`sh` pattern) and the worker-diff source — it
|
|
8
|
+
* grades through `runExecGate(graderEnv, steps)` itself, so it does NOT use `applyAndGrade` (the closure owns
|
|
9
|
+
* its hermetic reset+apply inline; `repair-oracle.ts:89`). This file gives the merge path the SAME apply-and-
|
|
10
|
+
* grade primitive so the two stay byte-consistent.
|
|
11
|
+
*
|
|
12
|
+
* - **R2 (measure-drives-repair, §10.4)** — the merge path (`merge.ts`, Stage-2) RE-SEEDS a single minted
|
|
13
|
+
* grader per measure round (NOT a new microVM): `git reset --hard <integBase> && git clean -fdx`, re-apply the
|
|
14
|
+
* INTEGRATED patch, then run the trusted `measureCmd` there. The repair agent edits the merged sandbox, so the
|
|
15
|
+
* measure must NOT run in that (possibly poisoned) sandbox — `applyAndGrade` runs it in a fresh-seeded grader.
|
|
16
|
+
* Before re-measure, the caller mechanically checks the patch's changed-file list against an allowlist
|
|
17
|
+
* (`changedFilesWithinAllowlist`, §10.4(ii)) — an out-of-allowlist / build-config touch denies the candidate.
|
|
18
|
+
*
|
|
19
|
+
* The standalone, mint-a-distinct-sandbox grader factory (`createGraderEnvFactory`) is the AUTO-ACCEPT slice path
|
|
20
|
+
* (flag `LEADER_GRADER_FACTORY`, default OFF until the §7 OFF-Gate-1 end-to-end verification). It is documented +
|
|
21
|
+
* stubbed here, NOT wired — v1 reuses the integration sandbox (R1) + re-seeds it (R2) instead.
|
|
22
|
+
*
|
|
23
|
+
* Everything here is additive + OFF by default: nothing in this file runs unless the Stage-2 seams call it behind
|
|
24
|
+
* `LEADER_REPAIR_LOOP` / `LEADER_MEASURE_GATES` / `LEADER_GRADER_FACTORY`.
|
|
25
|
+
*/
|
|
1
26
|
import { runExecGate } from "@sema-agent/core";
|
|
27
|
+
/** Single-quote a string for safe interpolation into a shell command (mirrors `repair-oracle.ts` / `merge.ts`). */
|
|
2
28
|
const sq = (s) => `'${s.replace(/'/g, "'\\''")}'`;
|
|
29
|
+
/**
|
|
30
|
+
* §10.1/§10.4 — HERMETIC apply-and-grade. Reset the grader to its clean `integBase` (`git reset --hard` +
|
|
31
|
+
* `git clean -fdx`), apply the FULL `base→latest` `patch` (never cumulative onto an already-applied tree), then
|
|
32
|
+
* run the TRUSTED, spec-derived `steps` (`testCmd` / `measureCmd`) there. `steps` MUST NOT be worker-authored
|
|
33
|
+
* (the `runExecGate` security contract — exec-gate.ts header). Used by the R2 measure grader; the R1 oracle
|
|
34
|
+
* closure performs the equivalent inline (`repair-oracle.ts`) so the single-agent and merge paths grade
|
|
35
|
+
* identically. Never throws — an apply conflict or a step failure is a non-passing `GradeOutcome`.
|
|
36
|
+
*/
|
|
3
37
|
export async function applyAndGrade(handle, patch, steps) {
|
|
4
38
|
const repo = handle.repoDir;
|
|
5
39
|
const patchPath = `/tmp/grade-${Date.now()}.patch`;
|
|
6
40
|
await handle.writeFile(patchPath, patch);
|
|
41
|
+
// Hermetic prep: clean base, then apply the full base→latest diff. `--whitespace=nowarn` matches `merge.ts:144`
|
|
42
|
+
// and `repair-oracle.ts:93`. An apply failure is a non-flaky, non-applied failure (a candidate that no longer
|
|
43
|
+
// applies onto the clean base — e.g. it raced the integration head).
|
|
7
44
|
const prep = await runExecGate(handle.env, [
|
|
8
45
|
{ command: `git -C ${sq(repo)} reset --hard ${sq(handle.integBase)} && git -C ${sq(repo)} clean -fdx`, label: "grader-reset" },
|
|
9
46
|
{ command: `git -C ${sq(repo)} apply --whitespace=nowarn ${sq(patchPath)}`, label: "grader-apply" },
|
|
@@ -18,6 +55,21 @@ export async function applyAndGrade(handle, patch, steps) {
|
|
|
18
55
|
const trace = gate.steps.map((s) => `${s.label}\n${s.stdout}\n${s.stderr}`).join("\n").slice(-4000);
|
|
19
56
|
return { passed: false, applied: true, trace };
|
|
20
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* §10.4(ii) — the mechanical CHANGED-FILES ALLOWLIST guard. A "fresh sandbox" is necessary-NOT-sufficient: poison
|
|
60
|
+
* can ride INSIDE the integrated patch (a malicious `build.gradle` / git hook / test shim). Before re-measuring,
|
|
61
|
+
* diff the patch's changed-file list against the allowlist = the workers' planned `files` ∪ trusted spec dirs.
|
|
62
|
+
* Any out-of-allowlist path, or a build-config touch (gradle / settings / dependency manifests / git hooks), is a
|
|
63
|
+
* DENY — the caller downgrades the candidate to `needs_human_oracle` (the prompt-only "do NOT modify build config"
|
|
64
|
+
* `wire.ts:269` is unreliable; this makes it mechanical). Returns the offending paths (empty ⇒ within allowlist).
|
|
65
|
+
*
|
|
66
|
+
* `changedFiles` is parsed by the caller from the patch (`git apply --numstat` / `git diff --name-only`); this is
|
|
67
|
+
* the PURE policy over that list so it is unit-testable without a sandbox. Matching is path-prefix on normalized
|
|
68
|
+
* POSIX paths: an allowlist entry `"."` or `""` allows everything UNDER it (a worker that legitimately owns the
|
|
69
|
+
* whole tree); a file allow-entry matches exactly; a dir allow-entry (trailing `/` or a real dir) matches its
|
|
70
|
+
* subtree. Build-config patterns are denied even when nominally within the allowlist (a worker must not be able
|
|
71
|
+
* to launder a `build.gradle` edit through an over-broad `files:["."]`).
|
|
72
|
+
*/
|
|
21
73
|
const BUILD_CONFIG_DENY = [
|
|
22
74
|
/(^|\/)build\.gradle(\.kts)?$/,
|
|
23
75
|
/(^|\/)settings\.gradle(\.kts)?$/,
|
|
@@ -42,11 +94,12 @@ const norm = (p) => p.replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
|
42
94
|
function withinAllowEntry(file, entry) {
|
|
43
95
|
const e = norm(entry);
|
|
44
96
|
if (e === "" || e === ".")
|
|
45
|
-
return true;
|
|
97
|
+
return true; // owns the whole tree
|
|
46
98
|
if (file === e)
|
|
47
|
-
return true;
|
|
48
|
-
return file.startsWith(`${e}/`);
|
|
99
|
+
return true; // exact file match
|
|
100
|
+
return file.startsWith(`${e}/`); // subtree match
|
|
49
101
|
}
|
|
102
|
+
/** The §10.4(ii) decision: the subset of `changedFiles` that is OUT of the allowlist or hits a build-config deny. */
|
|
50
103
|
export function changedFilesOutOfAllowlist(changedFiles, allowlist) {
|
|
51
104
|
const files = changedFiles.map(norm).filter((f) => f !== "");
|
|
52
105
|
const offending = [];
|
|
@@ -60,9 +113,15 @@ export function changedFilesOutOfAllowlist(changedFiles, allowlist) {
|
|
|
60
113
|
}
|
|
61
114
|
return offending;
|
|
62
115
|
}
|
|
116
|
+
/** §10.4(ii): true iff EVERY changed file is within the allowlist and none is a denied build-config path. */
|
|
63
117
|
export function changedFilesWithinAllowlist(changedFiles, allowlist) {
|
|
64
118
|
return changedFilesOutOfAllowlist(changedFiles, allowlist).length === 0;
|
|
65
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* §3.2 STUB — build the standalone grader factory. NOT wired in v1 (the auto-accept slice owns it, flag
|
|
122
|
+
* `LEADER_GRADER_FACTORY`). Throws a clearly-marked not-implemented error if invoked before that slice lands so a
|
|
123
|
+
* stray call fails loudly rather than silently mis-grading — this is an explicit placeholder, not a quiet stopgap.
|
|
124
|
+
*/
|
|
66
125
|
export function createGraderEnvFactory(_cfg) {
|
|
67
126
|
return async () => {
|
|
68
127
|
throw new Error("createGraderEnvFactory: the standalone control-plane grader is the auto-accept slice (LEADER_GRADER_FACTORY) — " +
|