@sema-agent/server 7.52.1 → 7.54.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/USAGE.md +7 -1
- package/dist/adoption/plan.d.ts +3 -3
- package/dist/adoption/quiesce.d.ts +1 -1
- package/dist/adoption/sql.d.ts +2 -2
- package/dist/adoption/wire.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +18 -18
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-hmac.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +14 -14
- package/dist/approval.d.ts +2 -2
- package/dist/audit.d.ts +4 -4
- package/dist/auth-keys.d.ts +6 -6
- package/dist/bench/l8/artifact.d.ts +6 -1
- package/dist/bench/l8/artifact.js +2 -27
- package/dist/bench/l8/escape.d.ts +3 -3
- package/dist/bench/l8/index.d.ts +1 -1
- package/dist/bench/s1/arms.d.ts +3 -3
- package/dist/bench/s1/oracle.d.ts +2 -2
- package/dist/bench/s1/reviewer.d.ts +1 -1
- package/dist/bench/s1/row.d.ts +5 -5
- package/dist/bench/s1/runner-ctx.d.ts +3 -3
- package/dist/boot/config-center.d.ts +14 -7
- package/dist/boot/config-center.js +4 -2
- package/dist/boot/coordinators.d.ts +4 -4
- package/dist/boot/crash-last.d.ts +1 -1
- package/dist/boot/device-lane.d.ts +3 -3
- package/dist/boot/engine-lease.d.ts +4 -4
- package/dist/boot/governance-seams.d.ts +5 -5
- package/dist/boot/leader.d.ts +5 -5
- package/dist/boot/leader.js +2 -0
- package/dist/boot/limit-sync.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +5 -5
- package/dist/boot/memory-consolidation.d.ts +8 -2
- package/dist/boot/memory-consolidation.js +1 -0
- package/dist/boot/org-memory.d.ts +5 -5
- package/dist/boot/parked-revive-gate.d.ts +6 -6
- package/dist/boot/permission-rules-audit.d.ts +2 -2
- package/dist/boot/reapers.d.ts +8 -8
- package/dist/boot/resolve-spec.d.ts +4 -4
- package/dist/boot/resolve-spec.js +1 -3
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +53 -27
- package/dist/boot/runner-deps.js +16 -9
- package/dist/boot/runtime-caps.d.ts +4 -4
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/shutdown.d.ts +10 -10
- package/dist/boot/shutdown.js +1 -1
- package/dist/boot/side-query-lane.d.ts +14 -14
- package/dist/boot/stores.js +5 -0
- package/dist/boot/task-list-lane.d.ts +3 -3
- package/dist/boot/webfetch-summarize-lane.d.ts +9 -9
- package/dist/boot/workflow-orchestration.d.ts +1 -1
- package/dist/bounded-session-map.d.ts +1 -1
- package/dist/brain.d.ts +3 -3
- package/dist/budget.d.ts +3 -3
- package/dist/canonical-json.d.ts +53 -0
- package/dist/canonical-json.js +48 -0
- package/dist/capabilities/center-prompts.d.ts +13 -13
- package/dist/capabilities/collab-workflows.d.ts +1 -1
- package/dist/capabilities/hands-lane.d.ts +4 -4
- package/dist/capabilities/memory-notice.d.ts +4 -4
- package/dist/capabilities/prompt.d.ts +2 -2
- package/dist/capabilities/sandbox-file-send.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +16 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/team.d.ts +13 -12
- package/dist/capabilities/tool-defer.d.ts +6 -6
- package/dist/config-catalog.d.ts +139 -0
- package/dist/config-catalog.js +556 -0
- package/dist/config-center/apply-effective.d.ts +42 -30
- package/dist/config-center/apply-effective.js +69 -62
- package/dist/config-center/apply-ledger.d.ts +6 -6
- package/dist/config-center/effective-keys.d.ts +30 -0
- package/dist/config-center/effective-keys.js +49 -0
- package/dist/config-center/facade.d.ts +6 -5
- package/dist/config-center/facade.js +1 -1
- package/dist/config-center/hot-keys-registry.d.ts +2 -2
- package/dist/config-center/http-client.d.ts +5 -5
- package/dist/config-center/mcp-revocation.d.ts +6 -4
- package/dist/config-center/mcp-revocation.js +2 -12
- package/dist/config-center/restart-signal.d.ts +11 -1
- package/dist/config-center/restart-signal.js +4 -10
- package/dist/config-center/skills-mcp.d.ts +2 -2
- package/dist/config-center/stage-limits.d.ts +3 -3
- package/dist/config-center/types.d.ts +42 -59
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-lkg.js +7 -1
- package/dist/config-provider.d.ts +2 -2
- package/dist/config-provider.js +1 -1
- package/dist/config-types.d.ts +140 -132
- package/dist/config.d.ts +22 -22
- package/dist/config.js +2 -1
- package/dist/degenerate-instrument.d.ts +1 -1
- package/dist/deployment-governance.d.ts +13 -13
- package/dist/device-enrollment.d.ts +5 -3
- package/dist/device-store.d.ts +17 -3
- package/dist/device-store.js +2 -0
- package/dist/device-ws-hub.d.ts +10 -5
- package/dist/device-ws-hub.js +25 -5
- package/dist/device-ws-protocol.d.ts +3 -3
- package/dist/digest-form.d.ts +1 -1
- package/dist/elicitation.d.ts +1 -1
- package/dist/env-facts.d.ts +7 -7
- package/dist/execution-lane-caps.d.ts +5 -5
- package/dist/fleet/fleet-bus.d.ts +53 -53
- package/dist/fleet/fleet-reconciler.d.ts +2 -2
- package/dist/fleet/fleet-terminal-window.d.ts +1 -1
- package/dist/fleet/subagent-tail-bus.d.ts +3 -3
- package/dist/fleet-client.d.ts +3 -3
- package/dist/fleet-lease.d.ts +1 -1
- package/dist/hooks/branch-transcript.d.ts +2 -2
- package/dist/hooks/cc-agent-hook-prompt.d.ts +2 -2
- package/dist/hooks/cc-stop-prompt.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +1 -1
- package/dist/hooks/hook-runner.d.ts +5 -5
- package/dist/http/active-run-conflict.d.ts +31 -33
- package/dist/http/active-run-conflict.js +4 -2
- package/dist/http/route-ctx.d.ts +22 -22
- package/dist/http/routes/a2a-serve.d.ts +2 -2
- package/dist/http/routes/admin-config-refresh.d.ts +1 -1
- package/dist/http/routes/admin-drain.d.ts +4 -4
- package/dist/http/routes/admin-memory-optout.d.ts +5 -5
- package/dist/http/routes/adoption.d.ts +1 -1
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +6 -6
- package/dist/http/routes/approvals-assistant.js +4 -1
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +1 -0
- package/dist/http/routes/config-catalog.d.ts +28 -0
- package/dist/http/routes/config-catalog.js +42 -0
- package/dist/http/routes/diagnostics.d.ts +2 -2
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/images.d.ts +1 -1
- package/dist/http/routes/leader.d.ts +1 -1
- package/dist/http/routes/memory-bundle.d.ts +4 -4
- package/dist/http/routes/memory-compliance.d.ts +7 -7
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/memory-origin.d.ts +9 -9
- package/dist/http/routes/memory-policy.d.ts +3 -3
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/observability.d.ts +1 -1
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/rules.d.ts +3 -3
- package/dist/http/routes/run-memory-capture.d.ts +1 -1
- package/dist/http/routes/runs.d.ts +3 -3
- package/dist/http/routes/runs.js +12 -17
- package/dist/http/routes/session-sync.d.ts +2 -2
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions.d.ts +9 -1
- package/dist/http/routes/sessions.js +60 -0
- package/dist/http/routes/shared-memory.d.ts +1 -1
- package/dist/http/routes/side-query.d.ts +1 -1
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +1 -1
- package/dist/http/run-meta.d.ts +1 -1
- package/dist/http/send.d.ts +6 -6
- package/dist/http/server.d.ts +84 -67
- package/dist/http/server.js +39 -10
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +6 -6
- package/dist/http/verify-rounds.d.ts +3 -3
- package/dist/http/wire-gate.d.ts +2 -2
- package/dist/http/wire-types.d.ts +57 -38
- package/dist/key-resolver.d.ts +1 -1
- package/dist/leader/diffout.d.ts +2 -2
- package/dist/leader/diffup.d.ts +1 -1
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +6 -6
- package/dist/leader/grader-env-factory.d.ts +1 -1
- package/dist/leader/leader.d.ts +12 -12
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/planner.d.ts +5 -5
- package/dist/leader/repair-oracle.d.ts +1 -1
- package/dist/leader/wire.d.ts +21 -9
- package/dist/leader/wire.js +6 -5
- package/dist/lsp/manager.d.ts +2 -2
- package/dist/lsp/types.d.ts +1 -1
- package/dist/lsp/ws-transport.d.ts +2 -2
- package/dist/main.js +12 -2
- package/dist/mcp-content-origin.d.ts +1 -1
- package/dist/memory-bundle-engine.d.ts +5 -3
- package/dist/memory-bundle-engine.js +2 -2
- package/dist/memory-operator-faces.d.ts +41 -11
- package/dist/memory-operator-faces.js +12 -0
- package/dist/memory-origin-fence.d.ts +1 -1
- package/dist/memory-origin-fence.js +2 -13
- package/dist/memory-posture.d.ts +6 -6
- package/dist/memory-scope.d.ts +7 -7
- package/dist/model-select.d.ts +5 -5
- package/dist/observability/cost-quota.d.ts +6 -6
- package/dist/observability/cost-taxonomy.d.ts +2 -2
- package/dist/observability/fail-open.d.ts +17 -5
- package/dist/observability/fail-open.js +16 -4
- package/dist/observability/metrics.d.ts +1 -1
- package/dist/observability/prompt-manifest.d.ts +8 -8
- package/dist/observability/rate-limit.d.ts +2 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +6 -6
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +1 -1
- package/dist/orchestration/subagent-steer.d.ts +3 -3
- package/dist/orchestration/workflow-agent-steer.d.ts +1 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +6 -6
- package/dist/orchestration/workflow-notify-journal.d.ts +6 -6
- package/dist/parent-watch.d.ts +1 -1
- package/dist/parked-decide.d.ts +11 -11
- package/dist/plan-cache-probe.d.ts +1 -1
- package/dist/plugins/adoption-log-sql.d.ts +4 -4
- package/dist/plugins/approval-ask-store-memory.d.ts +1 -1
- package/dist/plugins/approval-ask-store-memory.js +12 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +39 -17
- package/dist/plugins/approval-ask-store-sql.js +23 -6
- package/dist/plugins/approval-payload-fingerprint.d.ts +23 -0
- package/dist/plugins/approval-payload-fingerprint.js +23 -0
- package/dist/plugins/background-agent-store-sql.d.ts +8 -8
- package/dist/plugins/background-shell-support.d.ts +12 -12
- package/dist/plugins/blob-backend.d.ts +3 -3
- package/dist/plugins/breaker-state-sql.d.ts +3 -3
- package/dist/plugins/caching-session-store.d.ts +6 -6
- package/dist/plugins/checkpoint-store-sql.d.ts +162 -66
- package/dist/plugins/checkpoint-store-sql.js +76 -33
- package/dist/plugins/device-store-sql.d.ts +4 -3
- package/dist/plugins/e2b-orphan-reclaim.d.ts +3 -3
- package/dist/plugins/file-history-store-sql.d.ts +9 -8
- package/dist/plugins/file-run-store.d.ts +27 -27
- package/dist/plugins/fork-routing-session-store.d.ts +9 -9
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +2 -2
- package/dist/plugins/k8s-bg-scripts.d.ts +1 -1
- package/dist/plugins/k8s-exec-protocol.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +26 -17
- package/dist/plugins/local-checkpoint-store.js +21 -11
- package/dist/plugins/local-session-store.d.ts +5 -5
- package/dist/plugins/mailbox-store-sql.d.ts +6 -6
- package/dist/plugins/memory-embedder-fingerprint.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-engine-tidb.d.ts +1 -1
- package/dist/plugins/memory-key-guards.d.ts +3 -3
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +10 -10
- package/dist/plugins/memory-origin-law.d.ts +13 -13
- package/dist/plugins/memory-run-store.d.ts +12 -12
- package/dist/plugins/outcome-ledger-sql.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -33
- package/dist/plugins/permission-rule-store-sql.js +7 -12
- package/dist/plugins/pg-cost-quota.d.ts +2 -2
- package/dist/plugins/pg-pool.d.ts +29 -2
- package/dist/plugins/pg-pool.js +50 -2
- package/dist/plugins/pg-query.d.ts +1 -1
- package/dist/plugins/pg-rate-limiter.d.ts +2 -2
- package/dist/plugins/pg-session-storage.d.ts +9 -9
- package/dist/plugins/remote-env-adb.d.ts +1 -1
- package/dist/plugins/remote-env-device.d.ts +6 -4
- package/dist/plugins/remote-env-device.js +4 -1
- package/dist/plugins/remote-env-e2b.d.ts +11 -11
- package/dist/plugins/remote-env-file-error.d.ts +2 -2
- package/dist/plugins/remote-env-host.d.ts +10 -10
- package/dist/plugins/remote-env-k8s.d.ts +7 -7
- package/dist/plugins/remote-env-local-docker.d.ts +1 -1
- package/dist/plugins/remote-env-ssh.d.ts +9 -9
- package/dist/plugins/remote-scratchpad.d.ts +1 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.d.ts +2 -2
- package/dist/plugins/retention-store-sql.d.ts +11 -11
- package/dist/plugins/roster-store-sql.d.ts +6 -8
- package/dist/plugins/run-store-sql.d.ts +12 -12
- package/dist/plugins/scheduler-support.d.ts +1 -1
- package/dist/plugins/send-user-file.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.d.ts +99 -0
- package/dist/plugins/session-capture-record-store-sql.js +110 -0
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +2 -2
- package/dist/plugins/session-store.d.ts +3 -3
- package/dist/plugins/shared-memory-store-sql.d.ts +5 -5
- package/dist/plugins/sql-driver.d.ts +7 -7
- package/dist/plugins/sql-errors.d.ts +2 -2
- package/dist/plugins/sql-escape.d.ts +1 -1
- package/dist/plugins/sql-row-helpers.d.ts +1 -1
- package/dist/plugins/store-backend.d.ts +32 -19
- package/dist/plugins/store-backend.js +5 -1
- package/dist/plugins/store-contracts.d.ts +9 -9
- package/dist/plugins/task-list-store-sql.d.ts +3 -3
- package/dist/plugins/tidb-cost-quota.d.ts +3 -3
- package/dist/plugins/tidb-pool.d.ts +13 -0
- package/dist/plugins/tidb-pool.js +9 -0
- package/dist/plugins/tidb-rate-limiter.d.ts +2 -2
- package/dist/plugins/tidb-session-storage.d.ts +2 -2
- package/dist/plugins/tidb-session-store.d.ts +11 -11
- package/dist/plugins/tool-result-store-sql.d.ts +8 -8
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +7 -7
- package/dist/plugins/workflow-journal-store-sql.d.ts +6 -6
- package/dist/plugins/workflow-run-store-sql.d.ts +1 -1
- package/dist/plugins/write-behind-counter.d.ts +6 -6
- package/dist/principal-jwt.d.ts +2 -2
- package/dist/project-memory.d.ts +1 -1
- package/dist/prompts-domain-validate.d.ts +8 -8
- package/dist/question.d.ts +3 -3
- package/dist/resource-suspend.d.ts +4 -4
- package/dist/resource-window.d.ts +3 -3
- package/dist/router/route-orchestration.d.ts +1 -1
- package/dist/rules-consent.d.ts +48 -40
- package/dist/run-local.d.ts +5 -5
- package/dist/runs.d.ts +19 -19
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +11 -7
- package/dist/runtime-governance.js +23 -1
- package/dist/security.d.ts +13 -13
- package/dist/session-leaf-bus.d.ts +1 -1
- package/dist/session-sync-content.d.ts +4 -4
- package/dist/session-sync-kernel.d.ts +2 -2
- package/dist/session-sync.d.ts +13 -13
- package/dist/session-titler.d.ts +1 -1
- package/dist/session-watch.d.ts +3 -3
- package/dist/shared-memory-scope-authorizer.d.ts +4 -4
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +20 -20
- package/dist/ssh-host-key.d.ts +5 -5
- package/dist/store-live-probe.d.ts +2 -2
- package/dist/task-cwd.d.ts +11 -11
- package/dist/task-mcp.d.ts +5 -5
- package/dist/task-settings.d.ts +35 -35
- package/dist/task-workflow.d.ts +3 -3
- package/dist/text-bidi.d.ts +1 -1
- package/dist/tool-approval.d.ts +186 -182
- package/dist/tool-approval.js +247 -120
- package/dist/trace/core-keyset-guard.d.ts +19 -5
- package/dist/trace/engine-notice-wire.d.ts +7 -7
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/injection-tier.d.ts +11 -21
- package/dist/trace/injection-tier.js +3 -4
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +7 -7
- package/dist/trace/project.d.ts +31 -30
- package/dist/trace/project.js +1 -0
- package/dist/turn-activity.d.ts +4 -4
- package/dist/usage-analytics.d.ts +1 -1
- package/dist/wall-clock-jump-guard.d.ts +3 -3
- package/package.json +6 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `RemoteContainerExecutionEnv` — the E2B implementation of core's `RemoteExecutionEnv` seam
|
|
3
|
-
* (core src/core/remote-env.ts,
|
|
3
|
+
* (core src/core/remote-env.ts, [ref] §5). The service control plane owns this backend; core
|
|
4
4
|
* owns the seam shape (exactly like `CheckpointStore` / `SqlExecutor`).
|
|
5
5
|
*
|
|
6
|
-
* **Scope =
|
|
6
|
+
* **Scope = [ref] §0.5 v1 minimal slice**: single worker, E2B managed, **Tier 2 only** (every
|
|
7
7
|
* op runs in a per-task E2B Firecracker VM — no tiering/classification), and the ~4 live seam methods
|
|
8
8
|
* `connect` / `execStream` / `workspaceHandle` / `destroy` + the base `ExecutionEnv` (FileSystem + Shell).
|
|
9
9
|
*
|
|
10
|
-
* **v1.5 (
|
|
10
|
+
* **v1.5 ([ref], core 1.69):** `suspendVM` (E2B `pause()`) / `resumeVM` (`Sandbox.connect(id)` auto-resume)
|
|
11
11
|
* / `postResumeInit` (reachability + at-rest-encryption red line) are IMPLEMENTED — core orchestrates them when
|
|
12
12
|
* a task with this remote env hits a durable-approval `ask` (workspaceHandle → Checkpoint.state). `reconnect`
|
|
13
13
|
* (cross-replica re-attach to a still-running VM) stays deferred to **v2** (v1.5 always snapshots → resumeVM).
|
|
@@ -48,7 +48,7 @@ export interface RemoteContainerEnvConfig extends RemoteEnvObservers {
|
|
|
48
48
|
/** Sandbox metadata (e.g. sessionId/taskId for fleet observability). */
|
|
49
49
|
metadata?: Record<string, string>;
|
|
50
50
|
/**
|
|
51
|
-
* 🔴 Out-of-band secret/config env injected sandbox-WIDE at create (
|
|
51
|
+
* 🔴 Out-of-band secret/config env injected sandbox-WIDE at create ([ref] §5 gap 7, OA Phase-B): every
|
|
52
52
|
* command + background process in the VM sees these, but the VALUES never enter the model prompt, the tool
|
|
53
53
|
* `command` string, or the durable event log (which only records the command `args`, redacted). This is the
|
|
54
54
|
* channel for a credential (e.g. a git token the agent uses via GIT_ASKPASS / a credential helper) WITHOUT
|
|
@@ -84,7 +84,7 @@ export interface RemoteContainerEnvDeps {
|
|
|
84
84
|
* FIRST FileSystem/Shell/execStream call (auto `connect()`), so a task that never touches the hand pays zero
|
|
85
85
|
* cost. `connect()` may still be called explicitly (idempotent + concurrency-memoized) if the control plane
|
|
86
86
|
* wants to provision eagerly. `destroy()` on task end (the Runner calls it via `hasDestroy`); a never-used env's
|
|
87
|
-
* destroy is a no-op (nothing to kill, no bill). One container per task (
|
|
87
|
+
* destroy is a no-op (nothing to kill, no bill). One container per task ([ref] §5 §7 Q7).
|
|
88
88
|
*/
|
|
89
89
|
export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv, BackgroundShellCapability {
|
|
90
90
|
/** Current working directory for relative paths (FileSystem contract; mutable, core may reassign). */
|
|
@@ -113,7 +113,7 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
113
113
|
* SAME env instance skips the reconnect and every later fs/exec runs against the dead VM. */
|
|
114
114
|
private paused;
|
|
115
115
|
constructor(config: RemoteContainerEnvConfig, deps?: RemoteContainerEnvDeps);
|
|
116
|
-
/**
|
|
116
|
+
/** [ref] §9: E2B is a FULL RemoteExecutionEnv — an isolated, snapshot-suspendable microVM. (SSH/ADB
|
|
117
117
|
* adapters declare {isolation:false, suspendable:false} — real machines/devices, not snapshotable.) */
|
|
118
118
|
readonly capabilities: {
|
|
119
119
|
isolation: boolean;
|
|
@@ -122,13 +122,13 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
122
122
|
workspaceHandle(): WorkspaceHandle;
|
|
123
123
|
/**
|
|
124
124
|
* Public host for a port inside the sandbox (E2B reverse proxy → `<port>-<id>.e2b.app`). The LSP sidecar
|
|
125
|
-
* (
|
|
125
|
+
* ([ref] §13.1) uses this to reach the in-sandbox language-server WS bridge over `wss://`. Lazily
|
|
126
126
|
* provisions the VM (like exec/fs); `undefined` if it can't connect → the LSP manager degrades.
|
|
127
127
|
*/
|
|
128
128
|
getHost(port: number): Promise<string | undefined>;
|
|
129
129
|
/**
|
|
130
130
|
* Launch a long-running process as a TRUE E2B background command (resolves once launched, E2B keeps it alive)
|
|
131
|
-
* — for the LSP bridge (
|
|
131
|
+
* — for the LSP bridge ([ref] §13.1). NOT the same as `exec` with a shell `&`: E2B reaps a foreground
|
|
132
132
|
* command's process group on completion, which would kill an in-shell `&`/nohup child. Fire-and-forget.
|
|
133
133
|
*/
|
|
134
134
|
startBackground(command: string): Promise<void>;
|
|
@@ -141,7 +141,7 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
141
141
|
}>;
|
|
142
142
|
private doConnect;
|
|
143
143
|
/**
|
|
144
|
-
* v1.5 (
|
|
144
|
+
* v1.5 ([ref]): snapshot the workspace via E2B `pause()` (stores fs+memory+process; the snapshot id IS
|
|
145
145
|
* the sandbox id — a paused E2B sandbox is resumed by its id). Atomic contract (council): on failure the VM
|
|
146
146
|
* is left UNTOUCHED (still running) so core can fall back to onAsk. Refuses if a command is in flight
|
|
147
147
|
* (council #4) — never silently snapshot a running command. `abortSignal` bounds a hung pause (council BUG#2).
|
|
@@ -167,7 +167,7 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
167
167
|
error: RemoteExecutionError;
|
|
168
168
|
}>;
|
|
169
169
|
private doResumeVM;
|
|
170
|
-
/** Cross-replica re-attach to a still-running VM = v2 (
|
|
170
|
+
/** Cross-replica re-attach to a still-running VM = v2 ([ref] council #15: v1.5 always snapshots→resumeVM). */
|
|
171
171
|
reconnect(_sessionToken: SessionToken): Promise<{
|
|
172
172
|
ok: true;
|
|
173
173
|
value: WorkspaceHandle;
|
|
@@ -295,7 +295,7 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
295
295
|
private remoteError;
|
|
296
296
|
}
|
|
297
297
|
/**
|
|
298
|
-
* Build the deployment-level `RunnerDeps.executionEnvFactory` (
|
|
298
|
+
* Build the deployment-level `RunnerDeps.executionEnvFactory` ([ref] v1b). Wiring this onto a
|
|
299
299
|
* deployment makes it a "code-agent worker": every task's hand runs in a per-task E2B VM. Deployments that do
|
|
300
300
|
* NOT set this (e.g. OA / review) keep the in-process stub env — routing is **deployment-level** (the factory
|
|
301
301
|
* ctx carries only sessionId/taskId, never a service scenario; that stays out of the generic core seam).
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 会把**已被取消的操作再打一遍**。host 腿没有这个问题,因为它直接用 `fs` + 自己的分类器
|
|
12
12
|
* (AbortError → `aborted`)—— 也就是说这 4 条腿丢的正是 host 腿有的那个信息。
|
|
13
13
|
*
|
|
14
|
-
* 做成**一个共享函数而不是各腿各修一处**的理由:这一族有 28 个包装点,逐处修必然漏(core [
|
|
14
|
+
* 做成**一个共享函数而不是各腿各修一处**的理由:这一族有 28 个包装点,逐处修必然漏(core [ref] [ref]
|
|
15
15
|
* 那条教训:宣布"类修完成"而三个实现只落了一个)。收成一处之后,判据只有一条 ——
|
|
16
16
|
* **文件面的 exec 包装必须走这里**,而这条能被机器检查(见 `test/env-adapter-file-error-parity.test.ts`)。
|
|
17
17
|
*/
|
|
@@ -19,7 +19,7 @@ import { FileError, type ExecutionError, type RemoteExecutionError } from "@sema
|
|
|
19
19
|
/** exec 层的错误码 → 文件层的码。只映射**有对应语义**的那些,其余落 `unknown`(诚实降级)。 */
|
|
20
20
|
export declare function fileErrorFromExec(e: ExecutionError | RemoteExecutionError, path?: string): FileError;
|
|
21
21
|
/**
|
|
22
|
-
* shell 命令 exit≠0 时把 **stderr** 分类成 `FileError` 的共享分类器(
|
|
22
|
+
* shell 命令 exit≠0 时把 **stderr** 分类成 `FileError` 的共享分类器([ref] B6 R2 裁决:k8s 形=正形)。
|
|
23
23
|
*
|
|
24
24
|
* 此前四腿三向分叉:ssh/adb 硬编码 `not_found`(把 EACCES 谎报成"不存在"——keyed-on-code 的调用方会
|
|
25
25
|
* 对一个权限问题走"不存在"分支);local-docker 分类但无 fallback(缺文件报 unknown),且其
|
|
@@ -39,16 +39,16 @@ export interface HostEnvConfig {
|
|
|
39
39
|
*/
|
|
40
40
|
workspaceDir?: string;
|
|
41
41
|
/** R7 self-wake: the injected `SchedulerCapability` backend (the TOC self-wake scheduler write side).
|
|
42
|
-
* When set, `hasScheduler(env)` is true and core mounts CronCreate/CronDelete/CronList(旧名 CronCancel;Sleep 已
|
|
42
|
+
* When set, `hasScheduler(env)` is true and core mounts CronCreate/CronDelete/CronList(旧名 CronCancel;Sleep 已 [ref] 撤除;挂载在 prepare-task 非 createHandsToolkit——L8 订正); when absent the env
|
|
43
43
|
* reports `supported:false` → INERT (no scheduler tools). Injected at boot only on the single-user host lane. */
|
|
44
44
|
scheduler?: SchedulerCapability;
|
|
45
|
-
/**
|
|
45
|
+
/** [ref] background shell: `false` → INERT (multi-tenant host lane gate). Default (undefined) = on for the
|
|
46
46
|
* single-user TOC host lane. `HOST_BG_ENABLED=false` is an additional global kill switch(🪦 旧名
|
|
47
47
|
* `HOST_BG_DISABLED` 自 server 3.0.0 起是 fail-loud 墓碑:设了即拒启并指路新名,不再被读取)。 */
|
|
48
48
|
backgroundShell?: boolean;
|
|
49
49
|
}
|
|
50
50
|
export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, SchedulerCapability, BackgroundShellCapability {
|
|
51
|
-
/**
|
|
51
|
+
/** [ref] §9 / DUAL-MODE-DESIGN §5: a `host` env is the operator's real machine — no isolation, no snapshot. */
|
|
52
52
|
readonly capabilities: {
|
|
53
53
|
isolation: boolean;
|
|
54
54
|
suspendable: boolean;
|
|
@@ -70,7 +70,7 @@ export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, Sched
|
|
|
70
70
|
private prepared;
|
|
71
71
|
/** Terminal once {@link destroy} ran — guards fs/exec from running against a removed workspace. */
|
|
72
72
|
private destroyed;
|
|
73
|
-
/** [
|
|
73
|
+
/** [ref] 五轮复审:fg/bg spool 根=tmpdir 私有目录(core bgSpoolDir 同形)。workspace 是命令可写区,
|
|
74
74
|
* `git clean -fdx` 类清理会 unlink 活跃 spool(子进程经继承 fd 对 unlinked inode 继续写,而父进程
|
|
75
75
|
* 按路径 statSync/read 静默断=输出丢失+轮转帽失效);顺带不再弄脏 user-owned workspace(TOC/CC
|
|
76
76
|
* persistent 形)。懒建;destroy 整树清。 */
|
|
@@ -78,7 +78,7 @@ export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, Sched
|
|
|
78
78
|
/** 🔴 在飞的 fg spool 目录登记表(2026-07-25)。`destroy()` 原来只看 `bgManager.hasShells()` 就 `rm -rf`
|
|
79
79
|
* spool 根 —— 而**前台** exec 的 spool 也在同一个根下,子进程通过继承的 fd 继续往已 unlink 的 inode 写,
|
|
80
80
|
* 父进程按**路径** stat/read 于是什么都看不到 ⇒ 命令照跑、副作用照落盘,但 stdout 被静默截断,还返回
|
|
81
|
-
* `exitCode 0`。对模型而言那与「成功且无输出」**不可区分**。(与 core
|
|
81
|
+
* `exitCode 0`。对模型而言那与「成功且无输出」**不可区分**。(与 core [ref] 同形:写已释放的 inode。)
|
|
82
82
|
* 判据与 `hasShells()` 并列:**只要还有人在读写这个根下的文件,就不删它**。 */
|
|
83
83
|
private readonly liveFgSpools;
|
|
84
84
|
private ensureSpoolRoot;
|
|
@@ -142,7 +142,7 @@ export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, Sched
|
|
|
142
142
|
shellId: BackgroundShellId;
|
|
143
143
|
}, BackgroundShellError>>;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* [ref] detach (core 1.207, clay 排 1.81): ADOPT a still-running FOREGROUND exec child as a background
|
|
146
146
|
* shell — the mid-flight ctrl+b path. The exec child writes to pipes (not files, unlike a `launch`-spawned
|
|
147
147
|
* bg shell), so adoption splices those live pipes into fresh bg spool files: pre-fill them with the output
|
|
148
148
|
* captured so far (the detach TEE, fed from the exec's FIRST chunk → TaskOutput's first read has the full
|
|
@@ -171,12 +171,12 @@ export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, Sched
|
|
|
171
171
|
}, ExecutionError>>;
|
|
172
172
|
/** 管道旧形(win32 / spool 打开失败的回退;行为=1.225 及以前的 exec 原样)。 */
|
|
173
173
|
private execViaPipes;
|
|
174
|
-
/** [
|
|
174
|
+
/** [ref] fg spool pair:tmpdir 私有根下专属子目录(五轮复审迁址,workspace=命令可写区不可放)+ "ax"
|
|
175
175
|
* 独占建(core openSpoolPair 同形)。失败=undefined(调用方回退管道形)。 */
|
|
176
176
|
private openFgSpool;
|
|
177
|
-
/** [
|
|
177
|
+
/** [ref] spool 形 fg exec(core node-execution-env 1.318-1.321 机制移植;坑图=core CHANGELOG 同段)。 */
|
|
178
178
|
private execViaSpool;
|
|
179
|
-
/** [
|
|
179
|
+
/** [ref] spool 形 detach adoption:spool 路径+fg 游标直接进 HostBgState 的 FILE 面(launch 同形,poll
|
|
180
180
|
* 共码);同一文件单一字节流=天然无 decoder 接缝(mem-tee 版为此专门修过的病在此结构性不存在)。 */
|
|
181
181
|
private adoptRunningExecSpool;
|
|
182
182
|
execStream(command: string, options?: ExecStreamOptions): AsyncIterable<OutputChunk>;
|
|
@@ -210,7 +210,7 @@ export declare class RemoteHostExecutionEnv implements RemoteExecutionEnv, Sched
|
|
|
210
210
|
* ⇒ 用户仓库根目录按后台任务数累积 `bash-task-<hex>.output`(内容=命令输出)+ 每次 `createTempDir` 一个
|
|
211
211
|
* `tmp-XXXXXX/`,**永久**留在他们的 git 树里。两条独立判据说明这是偏差不是设计:①core 自己的 TOC 参照实现
|
|
212
212
|
* `NodeExecutionEnv.createTempFile` 放的是 `os.tmpdir()`;②**本适配器早就为了同一个理由把 spool 根搬去了
|
|
213
|
-
* tmpdir**([
|
|
213
|
+
* tmpdir**([ref] 五轮复审明写"不再弄脏 user-owned workspace"),只是 createTempFile/Dir 没跟上。
|
|
214
214
|
* 改用本 env 自己的 tmp 根(`ensureSpoolRoot()`,已在 `os.tmpdir()` 下):
|
|
215
215
|
* · 用户目录不再被写入;
|
|
216
216
|
* · 镜像写仍然可用 —— `isLingeringMirrorTarget` 同批放行这个根(见那里的旁注);
|
|
@@ -35,7 +35,7 @@ export interface K8sEnvConfig {
|
|
|
35
35
|
backoffMs?: number;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* Workspace-snapshot store (
|
|
38
|
+
* Workspace-snapshot store ([ref] §5 WorkspaceHandle/SnapshotId). When set, the Kata pod
|
|
39
39
|
* gains a DURABLE workspace across suspend/resume: `suspendVM` tars the workspace and uploads it to S3, then
|
|
40
40
|
* deletes the pod; `resumeVM` provisions a fresh pod and restores the tar. This raises `capabilities.suspendable`
|
|
41
41
|
* to `true` — but only the *workspace* is durable (files restored byte-for-byte); in-VM process/memory state
|
|
@@ -43,7 +43,7 @@ export interface K8sEnvConfig {
|
|
|
43
43
|
* tolerate. Unset → `suspendable:false` (the original checkpoint + cold-rebuild degrade).
|
|
44
44
|
*
|
|
45
45
|
* 🔴 Credentials are ADAPTER-HELD: the sandbox only ever receives a short-lived, single-object PRESIGNED URL
|
|
46
|
-
* (never the access/secret key) — a credential reaching code that runs untrusted work is the
|
|
46
|
+
* (never the access/secret key) — a credential reaching code that runs untrusted work is the [ref] lethal
|
|
47
47
|
* trifecta. The presigned URL is used only inside an adapter-issued exec at suspend/resume time, so it never
|
|
48
48
|
* reaches an agent turn.
|
|
49
49
|
*/
|
|
@@ -60,7 +60,7 @@ export interface K8sEnvConfig {
|
|
|
60
60
|
sessionId?: string;
|
|
61
61
|
/**
|
|
62
62
|
* 🔴 ADDITIVE pod-spec patch (a SERVICE-side adapter seam, NOT a core seam: the K8s pod shape is
|
|
63
|
-
* provider-specific, so it stays in the adapter per
|
|
63
|
+
* provider-specific, so it stays in the adapter per [ref]). A deployment supplies extra volumes / volumeMounts
|
|
64
64
|
* / securityContext so the pod can carry e.g. a REAL read-only oracle mount (the RSI L8 immutable-mount probe) or
|
|
65
65
|
* a hardened grader env (the graderEnvFactory). DEFAULT absent ⇒ the pod is byte-identical. The patch is TRUSTED
|
|
66
66
|
* deployment config (like the rest of K8sEnvConfig) AND is STRUCTURALLY CONFINED: {@link applyPodSpecPatch} can
|
|
@@ -90,7 +90,7 @@ export interface ExecSocket {
|
|
|
90
90
|
terminate?(): void;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Test seam (
|
|
93
|
+
* Test seam ([ref] §9.3 fault-injection): inject the REST `request` and/or the exec-socket factory, so pod
|
|
94
94
|
* lifecycle, retry policy, channel framing and liveness are deterministically testable without a cluster.
|
|
95
95
|
*/
|
|
96
96
|
export interface K8sEnvDeps {
|
|
@@ -183,7 +183,7 @@ export declare class RemoteK8sExecutionEnv implements RemoteExecutionEnv, Backgr
|
|
|
183
183
|
* provision a pod, then download + untar the snapshot into the workspace. A missing object (empty/plan-only
|
|
184
184
|
* snapshot) resumes as a clean workspace.
|
|
185
185
|
*
|
|
186
|
-
* [
|
|
186
|
+
* [ref]①(priorHandle 根保真)——k8s 走**诚实臂**而非绑定臂:pod 的 workspace volume 挂在**当前**
|
|
187
187
|
* 配置根(cfg.mountPath),往 priorHandle.mountPath 绑=往容器 rootfs untar 大工作区,ephemeral-storage
|
|
188
188
|
* 触顶即 pod 驱逐(恢复中途死,比「根变了 fail-closed reopen」更糟)。所以 untar 落当前根、handle 回报
|
|
189
189
|
* 真生效根(core 契约明许:「做不到就诚实返回实际 mountPath,勿回显未兑现值」);跨 K8S_MOUNT_PATH
|
|
@@ -191,7 +191,7 @@ export declare class RemoteK8sExecutionEnv implements RemoteExecutionEnv, Backgr
|
|
|
191
191
|
*/
|
|
192
192
|
resumeVM(snapshotId: SnapshotId, options?: VmLifecycleOptions): Promise<ConnectResult>;
|
|
193
193
|
/**
|
|
194
|
-
* Honest post-resume consistency (
|
|
194
|
+
* Honest post-resume consistency ([ref] §5 council #8): the workspace FILES are restored byte-for-byte
|
|
195
195
|
* from the snapshot, so read-before-edit hashing already lines up — there's nothing to re-fetch. In-VM
|
|
196
196
|
* process state (a language server) is gone by design; core/the LSP manager re-establishes it lazily. So
|
|
197
197
|
* this is a successful no-op rather than the previous `unsupported` (which forced a cold rebuild).
|
|
@@ -224,7 +224,7 @@ export declare class RemoteK8sExecutionEnv implements RemoteExecutionEnv, Backgr
|
|
|
224
224
|
};
|
|
225
225
|
}, ExecutionError>>;
|
|
226
226
|
/**
|
|
227
|
-
* LSP surface (lsp/manager.ts `isLspCapable` duck-type,
|
|
227
|
+
* LSP surface (lsp/manager.ts `isLspCapable` duck-type, [ref] §13.1): cluster-internal address for a
|
|
228
228
|
* port on the sandbox pod. The E2B counterpart returns a public proxy host; a pod has none — the WORKER
|
|
229
229
|
* must be able to reach pod IPs (in-cluster deployment, or on-node), and the transport is plain `ws://`
|
|
230
230
|
* (cluster network, no TLS — the per-session bridge token still gates access like on E2B).
|
|
@@ -182,7 +182,7 @@ export declare class RemoteLocalDockerExecutionEnv implements RemoteExecutionEnv
|
|
|
182
182
|
/** Spawn the docker binary with argv; collect stdout/stderr (+ raw bytes when binary), bound by timeout/abort. */
|
|
183
183
|
private docker;
|
|
184
184
|
/** Lazy connect for an exec path → ExecutionError on failure (fail closed, never throws). */
|
|
185
|
-
/** S1([
|
|
185
|
+
/** S1([ref]):容器内**用户命令**的 shell。缺省 /bin/sh;首次连接后探测一次 `command -v bash`,
|
|
186
186
|
* 有则切 bash(TB 实测 dash 三病:$'\t' 静默错字节/[[ ]] 127/进程替换)。镜像无 bash(alpine 裸底)
|
|
187
187
|
* ⇒ 保 sh(修前字节形,诚实降级);探测自身失败同。容器**创建**引导命令(mkdir && tail)不走
|
|
188
188
|
* 本 shell——无 bash 语法且探测尚不可能。 */
|
|
@@ -5,7 +5,7 @@ export interface SshEnvConfig {
|
|
|
5
5
|
host: string;
|
|
6
6
|
port?: number;
|
|
7
7
|
username: string;
|
|
8
|
-
/** PEM private key — from the adapter-held secret env (NEVER the workspace).
|
|
8
|
+
/** PEM private key — from the adapter-held secret env (NEVER the workspace). [ref] §5 #2. */
|
|
9
9
|
privateKey: string;
|
|
10
10
|
passphrase?: string;
|
|
11
11
|
/** Workspace root; relative paths resolve against it. Default "." (the login dir). */
|
|
@@ -15,7 +15,7 @@ export interface SshEnvConfig {
|
|
|
15
15
|
/**
|
|
16
16
|
* Per-command wall-clock bound (ms) when the caller gives none — NOT the connection lifetime.
|
|
17
17
|
*
|
|
18
|
-
* ⚠️ **值与孪生腿不一致,原因未成文**(2026-08-08
|
|
18
|
+
* ⚠️ **值与孪生腿不一致,原因未成文**(2026-08-08,[ref] 二轮扫描 finding,**候裁**):本腿默认
|
|
19
19
|
* `5 * 60_000`(见构造处),而同判据的另外两条腿 —— `remote-env-host.ts` / `remote-env-local-docker.ts`
|
|
20
20
|
* 的 `DEFAULT_COMMAND_TIMEOUT_MS` —— 都是 `30 * 60_000`,JSDoc 措辞还逐字同源。三处无共享常量、无对表
|
|
21
21
|
* 钉,ssh 这一处也没有任何注释说明 5min 是刻意收紧(git 史是 history-free snapshot,「30min 是后来调
|
|
@@ -28,12 +28,12 @@ export interface SshEnvConfig {
|
|
|
28
28
|
commandTimeoutMs?: number;
|
|
29
29
|
/** File-transfer (sftp) bound (ms). */
|
|
30
30
|
dataTimeoutMs?: number;
|
|
31
|
-
/** connect retry (idempotent establishment only — withRetry,
|
|
31
|
+
/** connect retry (idempotent establishment only — withRetry, [ref] §2A). */
|
|
32
32
|
retry?: {
|
|
33
33
|
maxAttempts?: number;
|
|
34
34
|
backoffMs?: number;
|
|
35
35
|
};
|
|
36
|
-
/**
|
|
36
|
+
/** [ref] / [ref]:主机密钥校验策略(两旋钮,语义见 {@link SshHostKeyPolicy});缺席 = 两旋钮都没配。 */
|
|
37
37
|
hostKey?: SshHostKeyPolicy;
|
|
38
38
|
}
|
|
39
39
|
type ConnectResult = {
|
|
@@ -44,7 +44,7 @@ type ConnectResult = {
|
|
|
44
44
|
error: RemoteExecutionError;
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
|
-
* Test seam (
|
|
47
|
+
* Test seam ([ref] §9.3 fault-injection): inject a `connectOnce` that replays an error sequence, so the
|
|
48
48
|
* retry policy (retryable codes / maxAttempts / "first fail → second success") is deterministically testable
|
|
49
49
|
* without a live host.
|
|
50
50
|
*/
|
|
@@ -61,12 +61,12 @@ export declare class RemoteSshExecutionEnv implements RemoteExecutionEnv {
|
|
|
61
61
|
private conn?;
|
|
62
62
|
private sftpPromise?;
|
|
63
63
|
private destroyed;
|
|
64
|
-
/** [
|
|
64
|
+
/** [ref] 代际闸:destroy/reconnect 各自 +1。逻辑连接操作(startConnect)起飞时抓拍一次并贯穿全部
|
|
65
65
|
* 重试轮(四轮复审:抓拍若在 connectOnce 内,被顶替代的下一轮重试会抓到**新**代际混进新代)——
|
|
66
66
|
* 每轮起跳先查代际/destroyed(陈旧=不再开 socket),ready 到达再查一次(在飞握手 late-ready=end
|
|
67
67
|
* 不赋 conn)。关死「A 在飞→reconnect 起 B→A 竞后抢占/成孤儿活连接」的全部竞窗。 */
|
|
68
68
|
private connEpoch;
|
|
69
|
-
/** [
|
|
69
|
+
/** [ref] 四轮复审 single-flight:connect()/reconnect()/懒连接三路共用一条代际键在飞记录——任何一路
|
|
70
70
|
* 在飞时其余路 join 同一 promise(同代际),绝不并起两条连接;settle 时按记录身份清(旧败诺清不掉
|
|
71
71
|
* 新记录)。五轮复审:①记录带 kind——并发 reconnect join 已在飞的 replace 记录(不再各自 bump 代际
|
|
72
72
|
* =重连风暴);②共享尝试**不携带任何 caller 信号**(首创者的 pre-abort 不得毒化 joiner;单 caller
|
|
@@ -86,11 +86,11 @@ export declare class RemoteSshExecutionEnv implements RemoteExecutionEnv {
|
|
|
86
86
|
}>;
|
|
87
87
|
/** 五轮复审:per-caller 可中止等待(共享诺不动,只退本 caller)。 */
|
|
88
88
|
private raceConnAbort;
|
|
89
|
-
/** [
|
|
89
|
+
/** [ref] 四轮复审:三路(connect/reconnect/懒连接)唯一的连接发起点——同代际在飞记录 join,settle
|
|
90
90
|
* 身份清;代际抓拍一次贯穿全部重试轮,每轮起跳先查(陈旧/destroyed=不再开 socket,用不可重试的
|
|
91
91
|
* aborted 码即刻收敛 withRetry)。五轮复审:共享尝试零 caller 信号(取消面全在 per-caller race)。 */
|
|
92
92
|
private startConnect;
|
|
93
|
-
/** [
|
|
93
|
+
/** [ref] exec/execStream/sftp 共用的懒连接入口。已连=零开销直过;未连=走完整 connect()(含重试策略)。
|
|
94
94
|
* caller 的 signal 只中止**它自己的等待**(共享在飞尝试继续伺服其他等待者;彻底取消归 destroy 的代际
|
|
95
95
|
* 闸管,handshake 余命 ≤ readyTimeout 有界)。 */
|
|
96
96
|
private ensureConnected;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* [
|
|
2
|
+
* [ref] remote scratchpad(server 半场)— the REMOTE sandbox lanes' session scratchpad convention.
|
|
3
3
|
*
|
|
4
4
|
* host lane already has one (env-facts.ts ensureScratchpadDir, worker-local under localDataRoot). The remote
|
|
5
5
|
* lanes (e2b/k8s/local-docker/ssh) run their hands OFF this box, so a worker-local dir would be a lie — the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Durable resume-at anchor map (E18) — SINGLE-FILE DUAL-DIALECT (
|
|
2
|
+
* Durable resume-at anchor map (E18) — SINGLE-FILE DUAL-DIALECT ([ref] A12 收编). The service-owned
|
|
3
3
|
* eventId→entryId translation: the shell holds the live E2 `eventId` (core never persists it); core's
|
|
4
4
|
* `TaskSpec.resumeAt` takes a persisted `SessionTreeEntry.id`. Keyed (session_id, event_id) so `resolve`
|
|
5
5
|
* is a PK point-lookup. `owner` is the single-DB-fleet null-safe defense-in-depth guard, the data-layer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 托管留存执行面的**非破坏性 SQL 半场** —— SINGLE-FILE DUAL-DIALECT(
|
|
3
|
-
* `retention-store-sql.ts` 本身)
|
|
2
|
+
* 托管留存执行面的**非破坏性 SQL 半场** —— SINGLE-FILE DUAL-DIALECT([ref] A12;先例 =
|
|
3
|
+
* `retention-store-sql.ts` 本身)。[ref] 车2,设计稿 `docs/DESIGN-270-retention-lane.md` v1.3。
|
|
4
4
|
*
|
|
5
5
|
* ── 为什么与车1 的 `retention-store-sql.ts` 分家(而不是往那只店上再挂三组方法)────────────────────
|
|
6
6
|
* 车1 那只店是 core `ManagedRetentionCapability` 的**实现体**:它的每一个公开方法都是一次**破坏性**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 托管留存(managed retention)执行面的 **store 半场** —— SINGLE-FILE DUAL-DIALECT(
|
|
3
|
-
* 先例 = `leader-run-store-sql.ts` / `checkpoint-store-sql.ts`)
|
|
2
|
+
* 托管留存(managed retention)执行面的 **store 半场** —— SINGLE-FILE DUAL-DIALECT([ref] A12 定型半场;
|
|
3
|
+
* 先例 = `leader-run-store-sql.ts` / `checkpoint-store-sql.ts`)。[ref] 车1,设计稿
|
|
4
4
|
* `docs/DESIGN-270-retention-lane.md` v1.2。上游契约真源 = `@sema-agent/core` 的
|
|
5
5
|
* `core/retention.d.ts`(`ManagedRetentionCapability` / `RetentionReceipt` / `RetentionDeclaration`)。
|
|
6
6
|
*
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* - schema 属主:MySQL DDL 由本文件导出、展开进 `tidb-pool.ts` 的 `SCHEMA_STATEMENTS`;PG DDL 由本文件的
|
|
40
40
|
* `ensurePgRetentionSchema` 导出、由 `pg-pool.ts` 的中央 `ensurePgSchema` 组合(与 leader-run 同姿势)。
|
|
41
41
|
*
|
|
42
|
-
* ── 命名(
|
|
42
|
+
* ── 命名([ref] 纪律,与设计稿的复数写法的**有意**偏离)────────────────────────────────────────────
|
|
43
43
|
* 设计稿 §5/§2 写的是 `retention_holds` / `retention_tombstones`;本仓的表名闭集词表是**单数**制且由
|
|
44
44
|
* `test/schema-naming-invariants.test.ts` 机器执法(「一张表是一类行的集合,表名说的是『一行是什么』」)。
|
|
45
45
|
* ⇒ 落库名一律单数:`retention_audit` / `retention_hold` / `retention_lease` / `retention_tombstone`。
|
|
@@ -136,7 +136,7 @@ export interface SqlRetentionStoreOptions {
|
|
|
136
136
|
*/
|
|
137
137
|
taskAttachmentTable: boolean;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* [ref] `task_list_meta` / `task_list_item` 两表是否在场。**必填,没有默认值**(与
|
|
140
140
|
* `taskAttachmentTable` 同一条理由:盲发 DELETE 会在没建表的库上把整轮 sweep 打红)。
|
|
141
141
|
* 生产上 `boot/task-list-lane.ts` 在**任何 SQL 后端**都无条件 ensure 这两张表 ⇒ 装配层照实传 true;
|
|
142
142
|
* 纯内存/local 车道压根没有 SQL 留存腿。
|
|
@@ -282,17 +282,17 @@ export declare class SqlRetentionStore implements ManagedRetentionCapability {
|
|
|
282
282
|
* COMMIT,一个并发的 PUT hold 在此期间提交不了(它抢同一把锁)——一段恒真的"复核"比没有更坏。
|
|
283
283
|
*
|
|
284
284
|
* 视界判据**两条臂都写出来**:`deadline` 在场按 deadline,缺席按 `created_at_ms`。少了后一条臂,一条
|
|
285
|
-
* 没有审批 TTL 的 pending 行就永远过不了期(
|
|
285
|
+
* 没有审批 TTL 的 pending 行就永远过不了期([ref] §3 inv#3 的 terminal_at_ms 要挡的正是这种永久泄漏)。
|
|
286
286
|
*
|
|
287
|
-
* 🔴 **pin 释放 = 本方法的 `pending → expired` 翻转本身**(core [
|
|
288
|
-
* 「AND release the associated session pins」是真意,[
|
|
287
|
+
* 🔴 **pin 释放 = 本方法的 `pending → expired` 翻转本身**(core [ref] 定谳:retention.ts 契约那句
|
|
288
|
+
* 「AND release the associated session pins」是真意,[ref] 引错了对象——它引的是引擎 live-path reap
|
|
289
289
|
* 的 JSDoc)。本仓 SQL 后端**没有独立的 pin 存储**:钉住 session 的正是 `checkpoint.status='pending'`
|
|
290
290
|
* 这一状态(它是 deleteExpiredSessions 活引用四腿之一,见下方 lineage 注 :79x),所以状态翻转 = 引用
|
|
291
|
-
* 解除 = pin 释放——不需要第二个写操作,而幂等(重跑对已 expired 行零命中)恰好满足 [
|
|
292
|
-
* 「释放已释放 pin=no-op」要求。单写者不变式按 [
|
|
291
|
+
* 解除 = pin 释放——不需要第二个写操作,而幂等(重跑对已 expired 行零命中)恰好满足 [ref] 的
|
|
292
|
+
* 「释放已释放 pin=no-op」要求。单写者不变式按 [ref] 改述:**每行的 pin 恰好释放一次,由终局该行
|
|
293
293
|
* 的车道执行**——live 行归 reaper,retention 行归本方法,两行集不交(下一段的 live-pin skip 正是
|
|
294
294
|
* 「不交」的执行判据)。
|
|
295
|
-
* 边界形([
|
|
295
|
+
* 边界形([ref] 建议,[ref] 确认仍成立):**live-pinned 且已过视界**的行(`task_active` 还占着这条
|
|
296
296
|
* 会话)⇒ skip 计数、不动那行 —— 不在一条活会话脚下抽掉它的 resume 坐标,与 legal-hold 的 skip 同形。
|
|
297
297
|
*
|
|
298
298
|
* receipt 口径:`deleted` = **本次 CAS 赢下的行数**(过期销毁的是那道 pending 门,行本身按设计留在库里
|
|
@@ -304,7 +304,7 @@ export declare class SqlRetentionStore implements ManagedRetentionCapability {
|
|
|
304
304
|
* 抽成一处是因为它同时被「可过期候选」与「被 pin 的计数」两条查询用,手抄两份必分家。
|
|
305
305
|
*/
|
|
306
306
|
private horizonArms;
|
|
307
|
-
/** 「这条 checkpoint 的会话被一次活跑占着」= [
|
|
307
|
+
/** 「这条 checkpoint 的会话被一次活跑占着」= [ref] 的 live-pinned 判据(SQL 谓词形,两方言同文本)。 */
|
|
308
308
|
private static readonly PINNED_EXISTS;
|
|
309
309
|
/**
|
|
310
310
|
* **可过期**的候选 token(保护谓词写在 SQL 里、扣在 `LIMIT` **之前**)。
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* RosterStore SQL twins(agent-team S1 server 半场,[
|
|
2
|
+
* RosterStore SQL twins(agent-team S1 server 半场,[ref]① 提货单)——core `RunnerDeps.rosterStore`
|
|
3
3
|
* 的 TiDB/PG 双方言实现:具名子 agent 的持久名册(具名 spawn advisory 写入;SendMessage 活注册表
|
|
4
4
|
* miss 后咨询;v1=诚实指针 roster_only,非跨 run resume)。
|
|
5
5
|
*
|
|
6
|
-
* 语义三条([
|
|
6
|
+
* 语义三条([ref]① 必守,与 core roster-store.js 参考实现字节对齐):
|
|
7
7
|
* 1. resolve **查询内** filter-before-reduce:access 轴在 SQL WHERE 完成(scope 先拒 → owner 匹配 →
|
|
8
8
|
* sessionScoped 显式位才认 session 匹配),绝不先取全集再内存过滤(跨租户行连查询结果都不进);
|
|
9
9
|
* 2. 同 `(normalizedName, owner, scope)` 域 upsert(core upsertKey 同键);
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
* spawn 可共享毫秒、多副本时钟可偏斜,无第三键的 LIMIT 1 非确定)。诚实记账:同毫秒并写时选择=
|
|
16
16
|
* agent_id 字典序最大,与 core 单进程的「后遍历者赢」可能不同——多副本本就无全序,确定性优先。
|
|
17
17
|
*
|
|
18
|
-
* normalize 私拷已回收(2026-07-19):core 公共出口落地(黑板 [
|
|
18
|
+
* normalize 私拷已回收(2026-07-19):core 公共出口落地(黑板 [ref]① 所请的 additive 导出),按
|
|
19
19
|
* 头注预案换回单行 import。⚠️ 语义仍是**存储键**:DB 行按 normalize 后的键写入——core 若改语义,
|
|
20
20
|
* 存量行查不回;test/roster-store-db-integration.test.ts 的 golden corpus 钉守这条(非私拷漂移钉,
|
|
21
21
|
* 是「core 变语义必须先过迁移裁量」的告警钉)。
|
|
22
22
|
*/
|
|
23
23
|
import type { Pool } from "mysql2/promise";
|
|
24
|
-
import { type RosterStore, type RosterEntry } from "@sema-agent/core";
|
|
25
|
-
type RosterAccess = Parameters<RosterStore["resolve"]>[1];
|
|
24
|
+
import { type RosterStore, type RosterEntry, type RosterAccess } from "@sema-agent/core";
|
|
26
25
|
import type { PgQueryFn } from "./pg-query.js";
|
|
27
26
|
export declare const ROSTER_TABLE = "agent_roster";
|
|
28
27
|
export declare function ensureTiDBRosterSchema(pool: Pool): Promise<void>;
|
|
@@ -35,7 +34,7 @@ export declare class TiDBRosterStore implements RosterStore {
|
|
|
35
34
|
resolve(name: string, access: RosterAccess): Promise<RosterEntry | undefined>;
|
|
36
35
|
list(): Promise<RosterEntry[]>;
|
|
37
36
|
releaseAgent(agentId: string): Promise<void>;
|
|
38
|
-
/** [
|
|
37
|
+
/** [ref] MED2(server 扩展,非 core 接口;core [ref]②③ 派给部署的清理半场):TTL 清理——
|
|
39
38
|
* task-scoped 具名 spawn 的 owner=宿主 taskId=每 run 一新行,无清理=线性无界。按 recorded_at_ms
|
|
40
39
|
* (最后一次 upsert 触碰)删,latest 语义不受影响(活跃名恒被新 spawn 刷新)。 */
|
|
41
40
|
reapOlderThan(cutoffMs: number): Promise<number>;
|
|
@@ -48,8 +47,7 @@ export declare class PgRosterStore implements RosterStore {
|
|
|
48
47
|
resolve(name: string, access: RosterAccess): Promise<RosterEntry | undefined>;
|
|
49
48
|
list(): Promise<RosterEntry[]>;
|
|
50
49
|
releaseAgent(agentId: string): Promise<void>;
|
|
51
|
-
/** [
|
|
50
|
+
/** [ref] MED2(TiDB twin 同案注)。 */
|
|
52
51
|
reapOlderThan(cutoffMs: number): Promise<number>;
|
|
53
52
|
}
|
|
54
|
-
export {};
|
|
55
53
|
//# sourceMappingURL=roster-store-sql.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Async run registry (S1) + replayable event log (S2) — SINGLE-FILE DUAL-DIALECT (
|
|
2
|
+
* Async run registry (S1) + replayable event log (S2) — SINGLE-FILE DUAL-DIALECT ([ref] A12 定型半场).
|
|
3
3
|
* ONE implementation, TWO dialects; the historical `TiDBRunStore` / `PgRunStore` class names survive as thin
|
|
4
4
|
* ctor subclasses so every consumer (store-backend.ts, the run/reaper/session/usage suites) is untouched.
|
|
5
5
|
*
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
* - `?` placeholders vs `$n` (transaction control itself is normalized by `SqlDriver`/`SqlTxConn` —
|
|
16
16
|
* mysql2's native begin/commit/rollback vs PG's statement form; see sql-driver.ts)
|
|
17
17
|
* - dup-key classification (createRun's task_active claim race) — the PREDICATE has a single owner
|
|
18
|
-
* (`sql-errors.ts`,
|
|
18
|
+
* (`sql-errors.ts`, [ref] P1-①); only the dialect DISPATCH is visible here
|
|
19
19
|
*
|
|
20
20
|
* ⚠️ The run ACTIVE-status word list written out in the `status IN (…)` / `NOT IN (…)` fragments below
|
|
21
21
|
* is the closed set owned by `store-contracts.ts` (`isTerminalRunStatus` / `isParkedRunStatus`). The SQL
|
|
22
22
|
* text stays literal ON PURPOSE (A12: both dialects readable side by side), so the tie is a PARITY GATE:
|
|
23
|
-
* `test/source-hygiene-gate.test.ts` → "
|
|
23
|
+
* `test/source-hygiene-gate.test.ts` → "[ref] P1-② run 活状态 SQL 字面 ↔ store-contracts 闭集属主 parity".
|
|
24
24
|
* core adding a TaskStatus member turns that gate red on every fragment here — update them in the same batch.
|
|
25
25
|
* - null-safe owner compare: `<=>` (TiDB) vs `IS NOT DISTINCT FROM` (PG) — a null-owner run still matches
|
|
26
26
|
* `owner=null` on both, single-DB-fleet defense-in-depth (see {@link requestCancel})
|
|
@@ -51,7 +51,7 @@ export declare class SqlRunStore {
|
|
|
51
51
|
constructor(db: SqlDriver);
|
|
52
52
|
/** Pick the dialect's SQL text. Both statements stay written out at the call site ON PURPOSE. */
|
|
53
53
|
private q;
|
|
54
|
-
/** Dup-key classification — single owner in `sql-errors.ts` (
|
|
54
|
+
/** Dup-key classification — single owner in `sql-errors.ts` ([ref] P1-①; the old local form read
|
|
55
55
|
* only mysql2's string `code`, so an error carrying just `errno` fell through the claim-race arm). */
|
|
56
56
|
private isDupKey;
|
|
57
57
|
/** JSON column binding: TiDB stores the string verbatim; PG goes through the protocol-safe envelope
|
|
@@ -88,7 +88,7 @@ export declare class SqlRunStore {
|
|
|
88
88
|
/** Whether a cancel has been requested for this run (polled by the owning instance's heartbeat tick).
|
|
89
89
|
* `owner` is the single-DB-fleet null-safe owner guard (see {@link requestCancel}). */
|
|
90
90
|
isCancelRequested(taskId: string, owner: string | null): Promise<boolean>;
|
|
91
|
-
/**
|
|
91
|
+
/** [ref] seam #2: request PREEMPT (graceful durable yield, ≠ cancel's kill) of a RUNNING run — durable +
|
|
92
92
|
* cross-replica. Sets the flag the owning instance's heartbeat tick polls (it then aborts its preemptSignal →
|
|
93
93
|
* the task suspends at the next clean turn boundary, gate resource_limit/reason preempt); a same-replica caller
|
|
94
94
|
* additionally aborts the in-flight preempt controller for instant effect. Only flags a `running` row
|
|
@@ -112,7 +112,7 @@ export declare class SqlRunStore {
|
|
|
112
112
|
* colliding on the (task_id, seq) PK. */
|
|
113
113
|
maxSeq(taskId: string): Promise<number>;
|
|
114
114
|
/** Mark terminal AND release the single-active-run claim atomically — if the DELETE were a separate
|
|
115
|
-
* statement that failed, the session would stay permanently locked. [
|
|
115
|
+
* statement that failed, the session would stay permanently locked. [ref] FIRST terminal writer wins:
|
|
116
116
|
* the UPDATE is CAS'd POSITIVELY on the live statuses (running/suspended/needs_review) — every call site
|
|
117
117
|
* is a settle-once flow whose backstops may double-fire (cancel × leg-throw × reaper), and an
|
|
118
118
|
* unconditional write let the LAST racer overwrite errorCode (a `cancelled` row flipping to a generic
|
|
@@ -121,18 +121,18 @@ export declare class SqlRunStore {
|
|
|
121
121
|
* unconditional (idempotent; the first writer already released it). */
|
|
122
122
|
setTerminal(taskId: string, status: TaskStatus, result: TaskResult | null, error: string | null): Promise<void>;
|
|
123
123
|
/**
|
|
124
|
-
* Durable F4 (
|
|
124
|
+
* Durable F4 ([ref]): a task suspended on a policy `ask`. Sets the run NON-terminal `suspended` and
|
|
125
125
|
* KEEPS the `task_active` claim — the session stays locked (no new run) until an operator resumes it to a
|
|
126
126
|
* terminal state or the reaper expires it. The token-bearing result is NOT stored (the submitter polling
|
|
127
127
|
* this row must never receive the capability token); only the status flips.
|
|
128
128
|
*/
|
|
129
129
|
setSuspended(taskId: string): Promise<void>;
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* [ref] D-B: PARK a run that paused on a REVIEW gate — a `needs_review` result (a dry-run diff review OR a
|
|
132
132
|
* pre-action `plan_review`; core assemble-result slot 8.6). Like {@link setSuspended} this is a NON-terminal park
|
|
133
133
|
* that KEEPS the `task_active` session claim (it does NOT delete it — only {@link setTerminal} does), so the
|
|
134
134
|
* resume path (`getActiveTaskId` → `markResuming`) can find + claim the row. core treats a review pause "like a
|
|
135
|
-
* suspend, an INTENTIONAL durable pause" (
|
|
135
|
+
* suspend, an INTENTIONAL durable pause" ([ref] §2.5) — the service MUST park it the same way, else the run is
|
|
136
136
|
* terminalized + its lock released and the plan_review/dry_run_review resume can never run (it gets
|
|
137
137
|
* taskId=undefined and drives the model unprotected on an unlocked session). CAS on `running`/`needs_review`
|
|
138
138
|
* (reaper-revert guard, mirrors setSuspended). The park→resume→claim invariant is pinned on BOTH REAL engines by
|
|
@@ -153,7 +153,7 @@ export declare class SqlRunStore {
|
|
|
153
153
|
* crosses the TTL is marked `failed` mid-run and its session lock (`task_active`) is released. Returns true
|
|
154
154
|
* if it claimed the flip (false ⇒ the reaper already expired it, or it isn't suspended).
|
|
155
155
|
*
|
|
156
|
-
*
|
|
156
|
+
* [ref](codex R1 [medium],红先双库证):认领 = **接管 `instance_id`**。此前该列只在 createRun 铸、此处不动,
|
|
157
157
|
* 于是 A 创建、C 认领 resume 的行永远记 A —— 而 steer/interrupt 的「他副本」臂与 sendHandleMiss 都拿这列当
|
|
158
158
|
* 「当前持有者」证据:verify 形 resume 腿(不登记 steerable)在 C 上跑时,C 读到 A≠C 就谎报「run 在别的副本」。
|
|
159
159
|
* 语义自此成文:`instance_id` = **当前持有副本**(createRun 铸、markResuming 认领接管);CAS 输不改列
|
|
@@ -286,7 +286,7 @@ export declare class SqlRunStore {
|
|
|
286
286
|
* the run + RELEASE its task_active (unlock the session). Mirrors the checkpoint reaper's CAS-expire (≈ deny);
|
|
287
287
|
* idempotent across replicas. Returns count.
|
|
288
288
|
*
|
|
289
|
-
* 🔴
|
|
289
|
+
* 🔴 [ref] D-D (blocker fix): SKIPS any row whose checkpoint is STILL pending — that row is
|
|
290
290
|
* owned by a checkpoint-state-driven sweep (the SLA deny-sweep for human/irreversible_ask, or
|
|
291
291
|
* failSuspendedWithExpiredCheckpoint once the checkpoint is expired). Without this guard, this time-based
|
|
292
292
|
* UPDATE fired at the SAME instant as the deny-sweep (deadline == createdAt + ttl, both keyed on the TTL),
|
|
@@ -302,7 +302,7 @@ export declare class SqlRunStore {
|
|
|
302
302
|
*/
|
|
303
303
|
reapSuspended(olderThanMs: number): Promise<number>;
|
|
304
304
|
/**
|
|
305
|
-
*
|
|
305
|
+
* [ref] §3 inv#3 (crash-safe backstop — the run-row half of the checkpoint `terminal_at_ms` sweep): fail a
|
|
306
306
|
* suspended run whose durable checkpoint was ALREADY EXPIRED by `reapExpired` (past its `deadline` or its
|
|
307
307
|
* absolute `terminal_at_ms`), and release its task_active (unlock the session). Runs UNCONDITIONALLY (no
|
|
308
308
|
* approval-TTL gate), CHECKPOINT-STATE-driven not time-driven, so it aligns EXACTLY with the per-row
|
|
@@ -10,7 +10,7 @@ type Result<T, E> = {
|
|
|
10
10
|
ok: false;
|
|
11
11
|
error: E;
|
|
12
12
|
};
|
|
13
|
-
/** Default caps (fail-closed bounds;
|
|
13
|
+
/** Default caps (fail-closed bounds; [ref] §3.9). Override per deployment. */
|
|
14
14
|
export declare const DEFAULT_SCHEDULER_CAPS: {
|
|
15
15
|
readonly supported: true;
|
|
16
16
|
readonly maxScheduledPerScope: 32;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** SigV4 physical ceiling (AWS: X-Amz-Expires max 604800s = 7 days). */
|
|
2
2
|
export declare const PRESIGN_MAX_TTL_SEC = 604800;
|
|
3
3
|
/**
|
|
4
|
-
* Multi-tenant governance (clay ruling 2026-07-14, blackboard [
|
|
4
|
+
* Multi-tenant governance (clay ruling 2026-07-14, blackboard [ref]② variant a with a HASHED segment): every
|
|
5
5
|
* object key carries a per-tenant SCOPE SEGMENT so tenants can be listed/revoked by prefix on the store itself,
|
|
6
6
|
* WITHOUT leaking the principal into the (user-visible, forwardable) URL. The segment is
|
|
7
7
|
* `HMAC-SHA256(secretKey, "sendfile-scope:" + scope)` hex, truncated to 32 chars:
|