@sema-agent/server 7.52.0 → 7.53.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 +22 -5
- 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 +2 -0
- 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/device-lane.js +2 -0
- 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/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/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +33 -27
- package/dist/boot/runner-deps.js +2 -1
- 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/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 +3 -3
- 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 +20 -7
- package/dist/config-center/apply-effective.js +45 -0
- package/dist/config-center/apply-ledger.d.ts +6 -6
- package/dist/config-center/facade.d.ts +3 -2
- 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 +1 -1
- 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 +23 -19
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-provider.d.ts +2 -2
- package/dist/config-types.d.ts +157 -134
- package/dist/config.d.ts +32 -24
- package/dist/config.js +48 -6
- package/dist/degenerate-instrument.d.ts +1 -1
- package/dist/deployment-governance.d.ts +13 -13
- package/dist/device-store.d.ts +2 -2
- package/dist/device-ws-hub.d.ts +6 -4
- package/dist/device-ws-hub.js +9 -3
- 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 +56 -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 +12 -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 +23 -21
- 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-bundle.js +2 -3
- 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 +61 -1
- 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 +25 -12
- 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 +38 -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 +9 -9
- 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 +13 -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 +20 -35
- package/dist/memory-origin-fence.js +41 -1
- 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 +1 -5
- package/dist/observability/fail-open.js +0 -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.js +5 -0
- 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 +2 -2
- 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 +5 -5
- 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 +4 -0
- 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.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/run-local.js +28 -4
- package/dist/runs.d.ts +19 -19
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +7 -7
- 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 +171 -160
- package/dist/tool-approval.js +33 -28
- package/dist/trace/core-keyset-guard.d.ts +21 -7
- package/dist/trace/engine-notice-wire.d.ts +6 -6
- package/dist/trace/injection-tier.d.ts +2 -2
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +7 -7
- package/dist/trace/project.d.ts +35 -30
- package/dist/trace/project.js +9 -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
package/dist/http/server.js
CHANGED
|
@@ -22,7 +22,8 @@ import { emitPendingWorkflowCompletions, taskNotificationInboxEntry, taskNotific
|
|
|
22
22
|
import { HANDS_BAND_TOOL_NAMES } from "../capabilities/hands-lane.js";
|
|
23
23
|
import { fleetRunPublisher, fleetRunLabels, fleetRunResiduals, isFleetAgentTerminalNotification } from "../fleet/fleet-bus.js";
|
|
24
24
|
import { defaultSubagentTailBus, projectTailFrame } from "../fleet/subagent-tail-bus.js";
|
|
25
|
-
import { createApprovalCardEmitter, isApprovalGateKind, resolveApprovalLeg, resolveStreamApprovalGate } from "../tool-approval.js";
|
|
25
|
+
import { APPROVAL_GATE_KINDS, createApprovalCardEmitter, isApprovalGateKind, resolveApprovalLeg, resolveStreamApprovalGate } from "../tool-approval.js";
|
|
26
|
+
import { TERMINAL_PARK_GATE_KINDS } from "../plugins/checkpoint-store-sql.js";
|
|
26
27
|
import { createWallClockJumpGuard } from "../wall-clock-jump-guard.js";
|
|
27
28
|
import {} from "../observability/rate-limit.js";
|
|
28
29
|
import { withPrincipal } from "../observability/principal-context.js";
|
|
@@ -43,6 +44,7 @@ import { handleAdoption } from "./routes/adoption.js";
|
|
|
43
44
|
import { handleRetention } from "./routes/retention-ops.js";
|
|
44
45
|
import { handleAdminDrain } from "./routes/admin-drain.js";
|
|
45
46
|
import { handleAdminConfigRefresh } from "./routes/admin-config-refresh.js";
|
|
47
|
+
import { handleConfigCatalog } from "./routes/config-catalog.js";
|
|
46
48
|
import { handleMemoryOptOut } from "./routes/admin-memory-optout.js";
|
|
47
49
|
import { handleMemoryPolicy } from "./routes/memory-policy.js";
|
|
48
50
|
import { handleMemoryBundle } from "./routes/memory-bundle.js";
|
|
@@ -148,6 +150,7 @@ const ROUTE_DOMAINS = [
|
|
|
148
150
|
handleRetention,
|
|
149
151
|
handleAdminDrain,
|
|
150
152
|
handleAdminConfigRefresh,
|
|
153
|
+
handleConfigCatalog,
|
|
151
154
|
handleMemoryOptOut,
|
|
152
155
|
handleMemoryPolicy,
|
|
153
156
|
handleMemoryBundle,
|
|
@@ -465,6 +468,8 @@ export function createHttpServer(rawDeps) {
|
|
|
465
468
|
return;
|
|
466
469
|
if (await handleAdminConfigRefresh(req, res, url, ctx))
|
|
467
470
|
return;
|
|
471
|
+
if (await handleConfigCatalog(req, res, url, ctx))
|
|
472
|
+
return;
|
|
468
473
|
if (await handleMemoryOptOut(req, res, url, ctx))
|
|
469
474
|
return;
|
|
470
475
|
if (await handleMemoryPolicy(req, res, url, ctx))
|
|
@@ -977,7 +982,7 @@ export function createHttpServer(rawDeps) {
|
|
|
977
982
|
const resumeFleetScope = (req, auth) => req ? (gatedPrincipal(req, deps.config) ?? "default") : (auth.principal ?? "default");
|
|
978
983
|
async function resumeCheckpoint(sessionId, decision, reason, settledBy, req, answer, binding, onResumeCommitted, acceptEarly, decider) {
|
|
979
984
|
const cs = deps.checkpointStore;
|
|
980
|
-
const token = await cs.findPendingTokenBySession(sessionId);
|
|
985
|
+
const token = (await cs.findPendingTokenBySession(sessionId, undefined, { gateKinds: APPROVAL_GATE_KINDS })) ?? (await cs.findPendingTokenBySession(sessionId));
|
|
981
986
|
if (binding?.checkpointToken && binding.checkpointToken !== token) {
|
|
982
987
|
let seenUnreadable = false;
|
|
983
988
|
const seen = await cs.get(binding.checkpointToken).catch((e) => {
|
|
@@ -1257,7 +1262,7 @@ export function createHttpServer(rawDeps) {
|
|
|
1257
1262
|
if (!store)
|
|
1258
1263
|
return true;
|
|
1259
1264
|
try {
|
|
1260
|
-
return (await store.
|
|
1265
|
+
return (await store.get(token))?.status === "pending";
|
|
1261
1266
|
}
|
|
1262
1267
|
catch {
|
|
1263
1268
|
return true;
|
|
@@ -1782,7 +1787,8 @@ export function createHttpServer(rawDeps) {
|
|
|
1782
1787
|
}
|
|
1783
1788
|
async function resumePreempted(sessionId, req, acceptEarly) {
|
|
1784
1789
|
const cs = deps.checkpointStore;
|
|
1785
|
-
const
|
|
1790
|
+
const RESUMABLE_GATE_KIND = "resource_limit";
|
|
1791
|
+
const token = (await cs.findPendingTokenBySession(sessionId, undefined, { gateKinds: [RESUMABLE_GATE_KIND] })) ?? (await cs.findPendingTokenBySession(sessionId));
|
|
1786
1792
|
if (!token)
|
|
1787
1793
|
return { status: 404, body: { error: "no resumable suspension for this task (already running, resumed, or expired)", errorCode: "not_found.suspension" } };
|
|
1788
1794
|
let cp;
|
|
@@ -1795,7 +1801,7 @@ export function createHttpServer(rawDeps) {
|
|
|
1795
1801
|
if (!cp)
|
|
1796
1802
|
return { status: 404, body: { error: "checkpoint not found", errorCode: "not_found.checkpoint" } };
|
|
1797
1803
|
const gateKind = cp.gate?.kind;
|
|
1798
|
-
if (gateKind !==
|
|
1804
|
+
if (gateKind !== RESUMABLE_GATE_KIND) {
|
|
1799
1805
|
return { status: 409, body: { error: `task is suspended on a '${gateKind ?? "unknown"}' gate, not a resumable resource/preempt suspension — an approval gate must be decided via POST /v1/approvals/:id/decide`, errorCode: "gate_not_resumable" } };
|
|
1800
1806
|
}
|
|
1801
1807
|
const ctx = await cs.getCtx(sessionId).catch(() => null);
|
|
@@ -1809,12 +1815,13 @@ export function createHttpServer(rawDeps) {
|
|
|
1809
1815
|
}
|
|
1810
1816
|
async function resumeWake(sessionId, message, caller, req, acceptEarly) {
|
|
1811
1817
|
const cs = deps.checkpointStore;
|
|
1812
|
-
const
|
|
1818
|
+
const wakeBinding = { gateKinds: TERMINAL_PARK_GATE_KINDS, pick: "oldest" };
|
|
1819
|
+
const token = (await cs.findPendingTokenBySession(sessionId, undefined, wakeBinding)) ?? (await cs.findPendingTokenBySession(sessionId));
|
|
1813
1820
|
if (!token)
|
|
1814
1821
|
return { status: 404, body: { error: "no parked checkpoint for this session (nothing to wake)", errorCode: "not_found.parked_checkpoint" } };
|
|
1815
1822
|
const operator = explicitOperatorOk(caller, deps.config.operatorPrincipals);
|
|
1816
1823
|
if (!operator) {
|
|
1817
|
-
const scope = await cs.peekPendingScope(sessionId).catch(() => undefined);
|
|
1824
|
+
const scope = await cs.peekPendingScope(sessionId, wakeBinding).then((s) => (s === undefined ? cs.peekPendingScope(sessionId) : s)).catch(() => undefined);
|
|
1818
1825
|
const decodedScope = scope != null ? decodeCheckpointScope(scope) : undefined;
|
|
1819
1826
|
if (decodedScope !== undefined && decodedScope !== caller) {
|
|
1820
1827
|
return { status: 404, body: { error: "no parked checkpoint for this session (nothing to wake)", errorCode: "not_found.parked_checkpoint" } };
|
|
@@ -1875,7 +1882,8 @@ export function createHttpServer(rawDeps) {
|
|
|
1875
1882
|
...(log?.taskId !== undefined ? { taskId: log.taskId } : { sessionId }),
|
|
1876
1883
|
...(log?.principalPresent !== undefined ? { principalPresent: log.principalPresent } : {}),
|
|
1877
1884
|
});
|
|
1878
|
-
const
|
|
1885
|
+
const PLAN_REVIEW_GATE_KIND = "plan_review";
|
|
1886
|
+
const token = (await cs.findPendingTokenBySession(sessionId, undefined, { gateKinds: [PLAN_REVIEW_GATE_KIND] })) ?? (await cs.findPendingTokenBySession(sessionId));
|
|
1879
1887
|
if (!token) {
|
|
1880
1888
|
log404("no-pending-checkpoint");
|
|
1881
1889
|
return { status: 404, body: { error: "no pending plan_review for this session (already decided or expired)", errorCode: "not_found.plan_review" } };
|
|
@@ -1892,7 +1900,7 @@ export function createHttpServer(rawDeps) {
|
|
|
1892
1900
|
return { status: 404, body: { error: "checkpoint not found", errorCode: "not_found.checkpoint" } };
|
|
1893
1901
|
}
|
|
1894
1902
|
const gateKind = cp.gate?.kind;
|
|
1895
|
-
if (gateKind !==
|
|
1903
|
+
if (gateKind !== PLAN_REVIEW_GATE_KIND) {
|
|
1896
1904
|
return {
|
|
1897
1905
|
status: 409,
|
|
1898
1906
|
body: {
|
|
@@ -2027,7 +2035,7 @@ export function createHttpServer(rawDeps) {
|
|
|
2027
2035
|
const gateOwner = fleetWide ? null : (gatedPrincipal(req, deps.config) || null);
|
|
2028
2036
|
return { fleetWide, gateOwner };
|
|
2029
2037
|
}
|
|
2030
|
-
function runOwnerOk(req, res, owner) {
|
|
2038
|
+
function runOwnerOk(req, res, owner, notFoundForm = "run") {
|
|
2031
2039
|
const principal = gatedPrincipal(req, deps.config);
|
|
2032
2040
|
if (deps.config.requirePrincipal && !principal) {
|
|
2033
2041
|
sendError(res, 401, "auth.principal_required", `missing principal header '${deps.config.principalHeader}'`);
|
|
@@ -2035,7 +2043,10 @@ export function createHttpServer(rawDeps) {
|
|
|
2035
2043
|
}
|
|
2036
2044
|
const legacyShellOwner = !deps.config.requirePrincipal && owner === "anon:shell-live" && (principal === undefined || principal === null);
|
|
2037
2045
|
if (!legacyShellOwner && owner !== null && principal !== owner) {
|
|
2038
|
-
|
|
2046
|
+
if (notFoundForm === "session")
|
|
2047
|
+
sendError(res, 404, "not_found.session", "session not found");
|
|
2048
|
+
else
|
|
2049
|
+
sendError(res, 404, "not_found.run", RUN_NOT_FOUND_MESSAGE);
|
|
2039
2050
|
return false;
|
|
2040
2051
|
}
|
|
2041
2052
|
return true;
|
|
@@ -2114,7 +2125,7 @@ export function createHttpServer(rawDeps) {
|
|
|
2114
2125
|
if (deps.backgroundAgentStore === undefined)
|
|
2115
2126
|
return false;
|
|
2116
2127
|
try {
|
|
2117
|
-
const token = await cs.findPendingTokenBySession(sessionId);
|
|
2128
|
+
const token = await cs.findPendingTokenBySession(sessionId, undefined, { gateKinds: APPROVAL_GATE_KINDS });
|
|
2118
2129
|
if (!token)
|
|
2119
2130
|
return false;
|
|
2120
2131
|
const cp = await cs.get(token);
|
|
@@ -2286,6 +2297,7 @@ const ROUTE_LABEL_PATTERNS = [
|
|
|
2286
2297
|
[/^\/v1\/sessions\/[^/]+\/(wake|fork|init|notify|events|head|mcp|a2a|policy|settings)$/, "/v1/sessions/:id/$verb"],
|
|
2287
2298
|
[/^\/v1\/admin\/memory-optout\/[^/]+$/, "/v1/admin/memory-optout/:principal"],
|
|
2288
2299
|
[/^\/v1\/sessions\/[^/]+\/memory\/erase$/, "/v1/sessions/:id/memory/erase"],
|
|
2300
|
+
[/^\/v1\/sessions\/[^/]+\/memory-status$/, "/v1/sessions/:id/memory-status"],
|
|
2289
2301
|
[/^\/v1\/sessions\/[^/]+\/sync\/(manifest|entries|plan)$/, "/v1/sessions/:id/sync/$verb"],
|
|
2290
2302
|
[/^\/v1\/sessions\/[^/]+\/sync\/import(\/[^/]+\/entries)?$/, "/v1/sessions/:id/sync/import"],
|
|
2291
2303
|
[/^\/v1\/sessions\/[^/]+\/sync\/blobs(\/[^/]+)?$/, "/v1/sessions/:id/sync/blobs"],
|
|
@@ -2331,6 +2343,7 @@ const ROUTE_LABEL_LITERALS = new Set([
|
|
|
2331
2343
|
"/v1/adoption",
|
|
2332
2344
|
"/v1/admin/drain",
|
|
2333
2345
|
"/v1/admin/config/refresh",
|
|
2346
|
+
"/v1/config/catalog",
|
|
2334
2347
|
"/v1/admin/memory-optout",
|
|
2335
2348
|
"/v1/admin/memory/consolidation/run", "/v1/admin/memory/consolidation",
|
|
2336
2349
|
"/v1/rules/cc-import/prepare", "/v1/rules/cc-import/redeem",
|
package/dist/http/sse-log.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] A9 seam —— 通用可恢复 SSE 泵(P2.8),从 `http/server.ts` 整段搬出的原文。
|
|
3
3
|
*
|
|
4
4
|
* task_run 与 image_bake 两条日志共用同一套 liveness/heartbeat/416/终态复取/15 分钟帽逻辑;域模块
|
|
5
5
|
* (routes/images.ts)与 server.ts 都要用它,所以它必须住在 http/ 叶子里(routes/* 值 import server.ts
|
|
@@ -31,7 +31,7 @@ export interface SseLogProvider<E extends {
|
|
|
31
31
|
data: unknown;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* [ref] 车3 §5:**开流 preamble** —— 在 416 判定与 `sseHeaders` **之后**、日志 tail **之前**写的
|
|
35
35
|
* 一批**非账本**帧(今天唯一的用户 = 审批未决卡的全量对账基准)。
|
|
36
36
|
*
|
|
37
37
|
* 🔴 为什么必须是这里的内部 hook,而不是调用方在 `streamSseLog` **之前**自己写:本 helper 的判序是
|
|
@@ -44,7 +44,7 @@ export interface SseLogProvider<E extends {
|
|
|
44
44
|
*
|
|
45
45
|
* 缺席 = 零影响(其余 provider 不实现)。失败/挂起的处置见 {@link collectSsePreamble}。
|
|
46
46
|
*
|
|
47
|
-
* `signal`(
|
|
47
|
+
* `signal`([ref] 车3 刀 3b,§14.2 遗留记账):有界窗到点时**被 abort** —— 实现方应把它传进自己的
|
|
48
48
|
* store 读口,让那次读当场以 abort 拒绝,而不是留一个「结果已被丢弃、调用链却还在飞」的悬挂读。
|
|
49
49
|
* 可达到的语义与残留边界见 `ApprovalAskStore.listPendingBySession` 的 `signal` 注(驱动无取消 seam)。
|
|
50
50
|
*/
|
|
@@ -58,16 +58,16 @@ export interface SseLogProvider<E extends {
|
|
|
58
58
|
*/
|
|
59
59
|
onPreambleFailure?(reason: "timeout" | "error", err?: unknown): void;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/** [ref] 车3 §5.3:preamble 的**有界**等待上限。挂起的 store 不许拖住开流——开流是壳的主路径,
|
|
62
62
|
* 而 preamble 只是一个锦上添花的对账基准。超时即按「无卡集基准」继续(与今天等同)。 */
|
|
63
63
|
export declare const SSE_PREAMBLE_TIMEOUT_MS = 2000;
|
|
64
64
|
/**
|
|
65
|
-
* 跑一次 preamble,**有界 + fail-open**(
|
|
65
|
+
* 跑一次 preamble,**有界 + fail-open**([ref] 车3 §5.3)。
|
|
66
66
|
*
|
|
67
67
|
* 🔴 只 catch throw 是不够的:store **挂起**(不抛)会把整条开流一起拖住。所以这里是 `Promise.race`
|
|
68
68
|
* 而不是 try/catch —— 两种失败形(抛 / 不返回)各自有一条出路,都落到「零帧 + 一次 warn + 继续开流」。
|
|
69
69
|
*
|
|
70
|
-
* 🔴
|
|
70
|
+
* 🔴 [ref] 车3 刀 3b(§14.2 遗留记账兑现):超时**同时 abort** 一个交给 `preamble` 的 `AbortSignal`。
|
|
71
71
|
* 此前只是「丢结果」,原 promise 仍在飞 —— DB 挂死时的重连风暴会一轮轮往连接池里堆等待者。现在读口
|
|
72
72
|
* 拿到 abort 会当场拒绝,调用链不再累积;库那侧的那条查询仍会跑完(驱动无取消 seam,残留边界见
|
|
73
73
|
* `ApprovalAskStore.listPendingBySession` 的注)。丢结果这条语义不变:preamble 只读,丢弃零副作用。
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] R9 — the verify-rounds shape (used by the developer-mode independent-verification gate, 1.44) pulled
|
|
3
3
|
* out to a NEUTRAL LEAF: it was three copies of the same anonymous `{ maxRounds: number; costCeilingMicroUsd?:
|
|
4
4
|
* number }` object type (route-ctx.ts ×2, runs.ts `runInBackground`'s public signature) plus four call sites in
|
|
5
5
|
* http/server.ts that each re-derived the same "verify:true → clamp rounds + fold cost ceiling" expression from a
|
|
6
6
|
* request body. A leaf (not server.ts itself) so route-ctx.ts — which must never value-import server.ts (that
|
|
7
7
|
* closes the runtime module-load cycle test/module-cycle-gate.test.ts guards) — can `import type` the shape from
|
|
8
8
|
* one place. server.ts imports {@link clampVerifyRounds} from here; tests import it from HERE too
|
|
9
|
-
* ([
|
|
9
|
+
* ([ref] 兼容面全清:server.ts 的保深路径 re-export 已删).
|
|
10
10
|
*/
|
|
11
11
|
import type { TaskRequestBody } from "./wire-types.js";
|
|
12
12
|
/** Verification-rounds config threaded onto a task's `verify`/resume paths (see {@link verifyRoundsFromBody}). */
|
|
@@ -19,6 +19,6 @@ export declare function clampVerifyRounds(v: unknown): number;
|
|
|
19
19
|
/** `undefined` when `body.verify` is not `true` (the caller didn't opt into the gate); otherwise the clamped
|
|
20
20
|
* rounds + (if `maxCostUsd` is a positive number) the same USD→micro-USD cost ceiling the cascade lane uses.
|
|
21
21
|
* Same expression that lived inline at all four verify/resume call sites in http/server.ts (fresh-submit,
|
|
22
|
-
* resumeCheckpoint, resumePreempted, resumePlanReview) — collected here VERBATIM (
|
|
22
|
+
* resumeCheckpoint, resumePreempted, resumePlanReview) — collected here VERBATIM ([ref] R9). */
|
|
23
23
|
export declare function verifyRoundsFromBody(body: Pick<TaskRequestBody, "verify" | "verifyRounds" | "maxCostUsd">): VerifyRoundsSpec | undefined;
|
|
24
24
|
//# sourceMappingURL=verify-rounds.d.ts.map
|
package/dist/http/wire-gate.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* D-0 (
|
|
2
|
+
* D-0 ([ref] §1): the single source of truth for the `CheckpointGate.kind` values the service emits on the
|
|
3
3
|
* wire. The suspend path surfaces the gate VERBATIM (`append("suspended", { gate })`, server.ts), and the
|
|
4
4
|
* agent-client SDK renders these as typed arms (an unknown kind falls through the SDK's open `(string & {})`
|
|
5
5
|
* arm and renders generically). This explicit mirror exists so the compile-time guards below + the contract
|
|
6
6
|
* test (`test/wire-gate-contract.test.ts`) keep the wire/SDK in lockstep with core — the guarantee the SDK's
|
|
7
7
|
* own `spec.test.ts` cannot give (it hardcodes the kinds without importing core, so it would stay GREEN the
|
|
8
|
-
* moment core adds a 6th kind;
|
|
8
|
+
* moment core adds a 6th kind; [ref] §3 #10 was therefore unenforced until this).
|
|
9
9
|
*/
|
|
10
10
|
export declare const WIRE_GATE_KINDS: readonly ["human", "irreversible_ask", "resource_limit", "needs_review", "task_done", "plan_review"];
|
|
11
11
|
export type WireGateKind = (typeof WIRE_GATE_KINDS)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HTTP wire REQUEST types (
|
|
2
|
+
* HTTP wire REQUEST types ([ref] A4) — pure type shapes of the task-submit surface, moved VERBATIM out of
|
|
3
3
|
* http/server.ts so a caller that needs only the request SHAPE (security.ts's authorizer signature; embedders via
|
|
4
4
|
* index.ts) depends on a type-only LEAF instead of the whole 10k-line route module. server.ts re-exports
|
|
5
5
|
* {@link TaskRequestBody}, so every existing import site keeps working unchanged. Conservative scope for the first
|
|
@@ -20,7 +20,7 @@ export interface TaskRequestBody {
|
|
|
20
20
|
scenario?: string;
|
|
21
21
|
/** dispatch-gateway failover 幂等第二级:caller-minted 任务 id(uuidv7)。同 owner 重放同 id ⇒ 幂等重放;
|
|
22
22
|
* 异 owner ⇒ 409 `conflict.run_exists`;非 uuidv7 ⇒ 400 `request.id_invalid`(routes/runs.ts:192-208 真验收)。
|
|
23
|
-
* [
|
|
23
|
+
* [ref] TR-16 连带:此键此前只活在 runs.ts 读点,导出类型漏declared——CAPS-OPS-13 同族第 9 键。 */
|
|
24
24
|
taskId?: string;
|
|
25
25
|
images?: Array<{
|
|
26
26
|
data: string;
|
|
@@ -33,7 +33,7 @@ export interface TaskRequestBody {
|
|
|
33
33
|
* 上限 16/task;未知或他人 id → 400(fresh 腿)。⚠️ 名为 `attachmentIds` 而非 `attachments`——
|
|
34
34
|
* 后者已被系统提醒配置键占用(本接口 :464,core spec.attachments 镜像)。 */
|
|
35
35
|
attachmentIds?: string[];
|
|
36
|
-
/**
|
|
36
|
+
/** [ref] C1 (core 1.181): the CLIENT/gateway's view of the user — used by core to localize the env block's
|
|
37
37
|
* date to the user's zone + surface who the agent acts for. The shell/gateway fills it from a verified user
|
|
38
38
|
* identity (NOT the model). core validates timeZone (invalid → UTC, never mislabeled). Pass-through to
|
|
39
39
|
* `spec.clientContext`; `locale` was removed in core 1.186 (dead field) so only timeZone+userEmail are accepted. */
|
|
@@ -47,7 +47,7 @@ export interface TaskRequestBody {
|
|
|
47
47
|
* SERVICE_AUTH_TOKEN reaches here (same boundary as `businessContext`). Keep it STABLE per
|
|
48
48
|
* integrator-version (it's part of the cacheable prefix); put per-request context in `objective`. */
|
|
49
49
|
systemPrompt?: string;
|
|
50
|
-
/** Append-only system prompt rider ([
|
|
50
|
+
/** Append-only system prompt rider ([ref] R1 / [ref] R2 ruling): passes through to core's
|
|
51
51
|
* `TaskSpec.appendSystemPrompt` (≈ CC `--append-system-prompt`) — a STABLE block composed after the scenario
|
|
52
52
|
* base + `systemPrompt`, before the volatile tail (prefix-cache friendly). First-class lane for the shell's
|
|
53
53
|
* product-knowledge block, so `settings.outputStyle` stays a real output style (a future center-issued style
|
|
@@ -64,7 +64,7 @@ export interface TaskRequestBody {
|
|
|
64
64
|
* (config.models keys), so it picks WHICH configured model but can never inject one. Wins over an inline
|
|
65
65
|
* @mention; an unknown name falls through to mention/default (lenient). Never a baseUrl/apiKey. */
|
|
66
66
|
model?: string;
|
|
67
|
-
/** [
|
|
67
|
+
/** [ref]① Cheap-model gear for within-task compaction/summarize (core [ref] `TaskSpec.compactionModel`):
|
|
68
68
|
* a catalog INTENT like `model` (name/tier word/id), gated against the SAME expanded allow-list — picks WHICH
|
|
69
69
|
* configured model compacts, never injects one. core clamps window-unsafe picks back to the main model with
|
|
70
70
|
* `modelFallback` attribution on the `compacted` event. Absent ⇒ the `summarize` role / main model (status quo).
|
|
@@ -123,7 +123,7 @@ export interface TaskRequestBody {
|
|
|
123
123
|
* finite, ≥1, floored, capped at 10; anything else ⇒ key omitted (core's own default). Meaningless without
|
|
124
124
|
* `outputSchema` (core ignores it there). */
|
|
125
125
|
outputRetries?: number;
|
|
126
|
-
/** Within-task compaction tuning (core
|
|
126
|
+
/** Within-task compaction tuning (core [ref] `TaskSpec.compaction`). ⚠️ ONLY `clampTolerance` is a caller
|
|
127
127
|
* knob — the rest of core's compaction object is an OPERATOR axis and is deliberately not on the wire, so this
|
|
128
128
|
* type is narrower than core's field on purpose. `boot/resolve-spec.ts` accepts a finite number in [0,1] and
|
|
129
129
|
* omits the whole `compaction` key otherwise. Pairs with `compactionModel` (which gear compacts). */
|
|
@@ -141,7 +141,7 @@ export interface TaskRequestBody {
|
|
|
141
141
|
* The service resolves eventId→the persisted SessionTreeEntry.id (the anchor map) in resolveSpec; an unknown
|
|
142
142
|
* eventId is a 4xx (never silently dropped). Requires a session. Absent ⇒ continue from the current leaf. */
|
|
143
143
|
resumeAt?: string;
|
|
144
|
-
/** [
|
|
144
|
+
/** [ref] rewind exclusive mode (core 1.292 `TaskSpec.resumeAtMode`): qualifies the `resumeAt` target. `"at"`
|
|
145
145
|
* (default when absent — zero regression) keeps the target message in the branched context; `"before"` branches at
|
|
146
146
|
* the target's PARENT, EXCLUDING the target itself (the exclusive-rewind shape: "remove this prompt and everything
|
|
147
147
|
* after it"). core enforces the "before" edges and the service passes its rejection codes through UNCHANGED for the
|
|
@@ -150,7 +150,7 @@ export interface TaskRequestBody {
|
|
|
150
150
|
* `rewind_snapshot.unresolvable` (rewindFiles: no snapshot at/above the "before" branch point). Only meaningful
|
|
151
151
|
* WITH `resumeAt` — sent alone it's a 400 (fail-loud, not a silent no-op). */
|
|
152
152
|
resumeAtMode?: string;
|
|
153
|
-
/**
|
|
153
|
+
/** [ref] Phase3 (reuse-path warm-resume): require the `sessionId` to ALREADY exist. When `true` and the session
|
|
154
154
|
* is genuinely missing (expired / purged / never created), the run FAILS LOUD (`resume.session_not_found`) instead
|
|
155
155
|
* of silently starting a fresh empty session ("looks warm, actually fresh"). Absent/`false` ⇒ the historical
|
|
156
156
|
* create-on-miss. Fails loud with NO sessionId too (nothing to resume). Rides the persisted body onto resume legs. */
|
|
@@ -163,7 +163,7 @@ export interface TaskRequestBody {
|
|
|
163
163
|
count?: number;
|
|
164
164
|
role?: string;
|
|
165
165
|
};
|
|
166
|
-
/**
|
|
166
|
+
/** [ref] file restore ([ref]): with `resumeAt`, ALSO converge the working tree's **agent-edited files**
|
|
167
167
|
* (the tracked set — nothing else is visible to the history, so a user's parallel work is structurally
|
|
168
168
|
* untouchable) to that entry's history boundary. Capture needs no request anymore: first-touch tracking is
|
|
169
169
|
* always on when the deployment wires a history store. Requires a FileHistoryStore. */
|
|
@@ -181,16 +181,16 @@ export interface TaskRequestBody {
|
|
|
181
181
|
* value is the same handle as `resumeAt` (the prompt's taskId); the service resolves it → the entry id. Honored ONLY
|
|
182
182
|
* when `resumeAt` is ABSENT (the two modes are mutually exclusive). Requires the anchor map + a FileHistoryStore. */
|
|
183
183
|
rewindFilesTo?: string;
|
|
184
|
-
/**
|
|
184
|
+
/** [ref] (core 1.246): per-task resilience INTENT flags. allowDegrade/allowFailover are caller-facing;
|
|
185
185
|
* bypassBreaker is operator-only (resolveSpec drops it for non-operators — a permission downgrade, not a 400). */
|
|
186
186
|
resilience?: {
|
|
187
187
|
allowDegrade?: boolean;
|
|
188
188
|
allowFailover?: boolean;
|
|
189
189
|
bypassBreaker?: boolean;
|
|
190
190
|
};
|
|
191
|
-
/**
|
|
191
|
+
/** [ref] (core 1.249): one-shot end-game verification nudge — opt-in by the AUTONOMY caller. */
|
|
192
192
|
finalVerification?: boolean;
|
|
193
|
-
/** [
|
|
193
|
+
/** [ref]④ per-request 配速——core 5.8.0 时限重构后的键集([ref]):`maxWalltimeMs`(毫秒,opt-in 墙钟)/
|
|
194
194
|
* `maxOutputTokens`/`maxTurns`,均正整数;可选运营方上限旋钮各自封顶(TASK_TIMEOUT_MAX_SEC 保**秒**义,
|
|
195
195
|
* 对毫秒键封顶 ×1000)。旧键 `timeoutSec` 与 deadline 族三 opt-out(机制退役)fresh-submit 400 响亮
|
|
196
196
|
* 点名替代;`maxWalltimeMs` 缺席时保持既有 tenancy 墙钟姿势(resolveTaskLimits,spec-fields.ts)。 */
|
|
@@ -203,9 +203,9 @@ export interface TaskRequestBody {
|
|
|
203
203
|
at?: [number, number];
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
|
-
/**
|
|
206
|
+
/** [ref] (core 1.251) + G1 (core 1.253): turn-boundary attachment reminders (todo / changed-files /
|
|
207
207
|
* plan-mode) + one-shot boundary notices (post-compaction background-task recap / deferred-tools delta).
|
|
208
|
-
* [
|
|
208
|
+
* [ref] CAPS-OPS-13:本类型经 src/index.ts 导出给 embedder——键集必须与真验收面(spec-fields.ts
|
|
209
209
|
* normalizeAttachments 10 键 / normalizeLimits 6 键)同源;此前少 8 键 ⇒ agentListing:false(唯一能关
|
|
210
210
|
* core 默认开列表注入的通道)与三个 deadline opt-out 在类型面失踪。agentListing/skillsListing 是
|
|
211
211
|
* boolean 透传(core DEFAULT-ON,explicit false 才关);budgetUsd/mcpInstructions 只认 literal true;
|
|
@@ -229,13 +229,13 @@ export interface TaskRequestBody {
|
|
|
229
229
|
* log, so a shell can render the child's transcript live ("enter 看详情"). Default OFF = progress-only (prior
|
|
230
230
|
* behavior). Purely a render channel — core never merges the child stream into the parent's model context. */
|
|
231
231
|
forwardSubagentEvents?: boolean;
|
|
232
|
-
/** G3([
|
|
232
|
+
/** G3([ref] 壳侧承诺③/[ref]③):壳供 per-session scratchpad 路径(壳 vendored getScratchpadDir 的
|
|
233
233
|
* 约定路径)。接受后优先于 server 自算,同源喂 envFacts.scratchpadDir 事实 + fs-write gate exemptDirs +
|
|
234
234
|
* additionalDirectories 根围栏——壳提示词与 server 写门指同一个目录。验收 fail-closed(单用户 +
|
|
235
235
|
* host-semantics lane + 绝对路径/深度/长度门,规则在 env-facts.acceptShellScratchpadDir),拒收形
|
|
236
236
|
* warn 后回落自算——「没到货引擎忽略 = 无害 additive」的对偶:异形键忽略,任务照跑。 */
|
|
237
237
|
scratchpadDir?: string;
|
|
238
|
-
/**
|
|
238
|
+
/** [ref] (core 1.225): opt-in — RETAIN settled sub-agent sessions so the shell can revive one
|
|
239
239
|
* (`POST /v1/runs/:id/subagents/:target/resume`, CC dfe parity). `true` = core defaults (30min ttl / 16 max);
|
|
240
240
|
* an object tunes them (service-clamped: ttlMs ≤24h, max ≤64 — retention pins sessions in memory within the
|
|
241
241
|
* run). Default OFF = throwaway children (a resume then 409s `resume.retain_off`). Run-scoped: everything is
|
|
@@ -244,7 +244,7 @@ export interface TaskRequestBody {
|
|
|
244
244
|
ttlMs?: number;
|
|
245
245
|
max?: number;
|
|
246
246
|
};
|
|
247
|
-
/** [
|
|
247
|
+
/** [ref] per-task custom subagents (core 1.295 `TaskSpec.agents` — CC `.claude/agents/` parity): the shell sends
|
|
248
248
|
* its resolved agent definitions per request. Whitelist-validated FAIL-LOUD at submit (unknown keys 400 — an
|
|
249
249
|
* agent definition silently losing a `denyTools`/`isolation` field is a silent widening, the opposite failure
|
|
250
250
|
* mode of the resilience "tolerate unknown keys" posture; `permissionMode` deliberately NOT accepted — core call,
|
|
@@ -253,24 +253,24 @@ export interface TaskRequestBody {
|
|
|
253
253
|
* fail-closed; advertised via capabilities.taskAgents). ≤32 per request. Rides the persisted body onto resume
|
|
254
254
|
* legs (defensive per-item DROP there, never a brick). */
|
|
255
255
|
agents?: AgentDefinition[];
|
|
256
|
-
/** [
|
|
256
|
+
/** [ref]② (core 1.295 `TaskSpec.retainBackgroundProcesses`): opt-out of the task-end reaping of session
|
|
257
257
|
* background processes ("keep my dev server running"). On the host lane this is a RESOURCE-RESIDENCY grant, so
|
|
258
258
|
* it takes the same single-user gate as backgroundShell/hooks (multi-tenant warns + ignores; advertised via
|
|
259
259
|
* capabilities.retainBackgroundProcesses). Boolean fail-loud at submit; only `true` rides the spec. */
|
|
260
260
|
retainBackgroundProcesses?: boolean;
|
|
261
|
-
/** [
|
|
261
|
+
/** [ref]② (core 1.314 工具面控制批): roster 真卸载清单(schema 不上 wire,manifest 收窄)。wire 工具名;
|
|
262
262
|
* tighten-only(core 继承不变量 union 进子 spawn)。数组-of-string fail-loud at submit。 */
|
|
263
263
|
excludeTools?: string[];
|
|
264
|
-
/** [
|
|
264
|
+
/** [ref]② (core 1.314): [ref] 延迟披露清单(占位上 wire,ToolSearch 激活)——cli「Workflow 默认开
|
|
265
265
|
* 不暴露」的承载位。同 excludeTools 的校验/继承姿势。 */
|
|
266
266
|
deferTools?: string[];
|
|
267
|
-
/** [
|
|
267
|
+
/** [ref]/[ref] (core 1.328 R2): 提示词双形轴——simple(CC 212 短形,引擎缺省)| classic(长形,可按
|
|
268
268
|
* 任务/模型试分)。纯呈现轴无租户门;枚举 fail-loud at submit;缺省不挂键。 */
|
|
269
269
|
promptProfile?: "simple" | "classic";
|
|
270
|
-
/** [
|
|
270
|
+
/** [ref]②(core 5.14.0 座已在,`TaskSpec.toolMaterializeStrategy`):deferred 工具在**激活之后**怎么给
|
|
271
271
|
* 模型供 schema。`static` = 占位符形不变(激活只改可调用性,广告的 schema 仍是空对象);`swap` = 激活
|
|
272
272
|
* 后下一轮把占位符换成真 schema。
|
|
273
|
-
* 为什么要上 wire:cli 的
|
|
273
|
+
* 为什么要上 wire:cli 的 [ref] 取证表明,忠实跟随广告 schema 解码的 provider(openai-completions 车道)
|
|
274
274
|
* 在 `static` 下会**无界循环** —— 每轮发 `{}` → invalidArgumentsRejection → 下一轮广告仍空,纠错回路
|
|
275
275
|
* 结构上无效。core 的缺省链是 `spec.toolMaterializeStrategy ?? env ?? <core 缺省>`,而**进程级 env 说不了
|
|
276
276
|
* 「每个模型」的话**(模型目录车道 per-model api 可混),所以必须有一个**按任务**的位子——这条理由与
|
|
@@ -284,26 +284,26 @@ export interface TaskRequestBody {
|
|
|
284
284
|
toolMaterializeStrategy?: "static" | "swap";
|
|
285
285
|
/** R4 (CC parity): the LIGHT top-level per-turn permission-mode intent (CC `permissionMode`). The shell sends
|
|
286
286
|
* the RAW mode (axis-agnostic, no client-side interpretation); the SERVICE interprets it tighten-only vs the
|
|
287
|
-
* deployment baseline. Post-[
|
|
287
|
+
* deployment baseline. Post-[ref] all FIVE modes are honored as gate-SHAPE choices (`plan` ⇒ read-only hands +
|
|
288
288
|
* `present_plan`; `acceptEdits`/`bypassPermissions`/`auto` select how much the mode-derived fs-write ask gate
|
|
289
289
|
* asks — they can never subtract from deployment/operator policy, tightenTaskSpec deny-wins; the old "LOOSEN →
|
|
290
|
-
* coerced to default" note was pre-[
|
|
290
|
+
* coerced to default" note was pre-[ref] doc-rot). Folds onto the SAME tighten-only governance as
|
|
291
291
|
* `settings.permissions.defaultMode` (the heavier bundle), so it's a lighter alias, not a second path.
|
|
292
|
-
*
|
|
292
|
+
* [ref]-②: CLOSED enum on the wire — an unknown word 400s at submit (`request.field_invalid`, sibling of
|
|
293
293
|
* promptProfile) instead of silently coercing to `default`; resume replay of a stored body stays lenient
|
|
294
294
|
* (coercePermissionMode). */
|
|
295
295
|
permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "auto";
|
|
296
296
|
/** MF-30 memory PAUSE (shell-host contract, option B per-request — clay 2026-06-27): `false` makes THIS run
|
|
297
|
-
* read-only over long-term memory (`TaskSpec.memory.writeScope:null` — the
|
|
297
|
+
* read-only over long-term memory (`TaskSpec.memory.writeScope:null` — the [ref] memory ENGINE materializes/
|
|
298
298
|
* reads but its harvest commits nothing). Absent/`true` ⇒ normal read+write. The shell's `/memory` pause carries
|
|
299
299
|
* this per request (no stored per-session flag). Re-applies on resume (rides in the persisted body).
|
|
300
|
-
* ⚠️ **NOT the same axis as the deployment's `MEMORY_PERSISTENCE_CAPABLE:false`** (core 5.27.0 / [
|
|
300
|
+
* ⚠️ **NOT the same axis as the deployment's `MEMORY_PERSISTENCE_CAPABLE:false`** (core 5.27.0 / [ref] F2):
|
|
301
301
|
* that one declares the SESSION restricted — materialize/search/harvest serve the committed account and
|
|
302
302
|
* unbacked disk divergence is refused (`restricted_divergence`). A `writeScope:null` PLANE keeps its ordinary
|
|
303
303
|
* adopt-on-read semantics: a paused run still sees the user's hand-edits and git-pull drops, it just commits
|
|
304
304
|
* nothing. Restriction is the session's DECLARATION, never the plane's structure. */
|
|
305
305
|
memoryWrite?: boolean;
|
|
306
|
-
/**
|
|
306
|
+
/** [ref] §2.1(core 7.0.0 片2/3;server [ref]):**session 记忆采集 opt-out 声明** —— `"off"` = 「本会话
|
|
307
307
|
* 不进长期记忆」:单成员闭集,**没有** `"on"`(缺席就是照常采集的唯一形)。透传为 `TaskSpec.memory.capture`,
|
|
308
308
|
* 由 core 按部署姿态(`MEMORY_CAPTURE_POLICY`)+ 该 principal 的 `allowMemoryOptOut` verdict 裁:拒 = 403
|
|
309
309
|
* `memory.capture_optout_denied`。**一次性**:声明落一条单向控制面记录,后续 resume 恒不采集(record wins),
|
|
@@ -314,11 +314,11 @@ export interface TaskRequestBody {
|
|
|
314
314
|
* 记忆面暗的部署(引擎未接线 / 多租户)上本键随 `memory` 整体缺席而无处落 —— 那里本就零采集。
|
|
315
315
|
* Rides the persisted body onto resume legs(与 memoryWrite 同姿势)。 */
|
|
316
316
|
memoryCapture?: "off";
|
|
317
|
-
/** 142-S4 projectId 线程化(
|
|
317
|
+
/** 142-S4 projectId 线程化([ref] §2):这个 run 归属的项目(center 登记簿键,generic lowercase
|
|
318
318
|
* UUID — core S1 `resolveProjectId` marker 或 S3 无仓 mint 的产物;客户端只透传,零铸造权威)。是「哪个
|
|
319
319
|
* 项目」的选择器,不是身份/capability — scope 的 tenant 段永远来自 verified principal。SHAPE 门在
|
|
320
320
|
* authorizer(core `PROJECT_ID_REGEX`,不合形状=422 typed `invalid_project_id`)。**大小写不敏感收、
|
|
321
|
-
* 归一小写用**(
|
|
321
|
+
* 归一小写用**([ref]/[ref]:词法与 core 的格式单源对齐,带 /i;收下后折小写再派生 scope/查表 ——
|
|
322
322
|
* 同一个 id 的两种大小写写法落同一只记忆盘)。多租户 DB 记忆面下它把派生
|
|
323
323
|
* scope 从 user 盘切到项目盘(`proj:<tenant>/<projectId>`)并以 config.projects[projectId].defaultScopes
|
|
324
324
|
* 作 memory.scopes 种子;单用户部署忽略派生(memoryScopeFor 不变),仅 defaultScopes 种子生效。
|
|
@@ -330,7 +330,7 @@ export interface TaskRequestBody {
|
|
|
330
330
|
* (a caller can't point a shared/cloud worker at an arbitrary host path). Validated absolute (prepareSpec 400s a
|
|
331
331
|
* relative cwd — it would silently resolve against the SERVICE process cwd). */
|
|
332
332
|
cwd?: string;
|
|
333
|
-
/**
|
|
333
|
+
/** [ref] (CC `--add-dir`, core `TaskSpec.additionalDirectories`): extra host dirs the FILE tools may reach
|
|
334
334
|
* beyond the containment root. 🔒 Gated exactly like `cwd`/`shellEnv` — honored ONLY on the single-user host
|
|
335
335
|
* lane (`task-cwd.ts` `cwdHonored`); off that lane `boot/resolve-spec.ts` drops them with a loud
|
|
336
336
|
* `task_additional_directories_ignored` (never silently). SHAPE is fail-loud at submit (absolute host paths,
|
|
@@ -340,7 +340,7 @@ export interface TaskRequestBody {
|
|
|
340
340
|
* resume legs. */
|
|
341
341
|
additionalDirectories?: string[];
|
|
342
342
|
additionalReadDirectories?: string[];
|
|
343
|
-
/** [
|
|
343
|
+
/** [ref]⑧/[ref]/[ref] (core 5.23.0 `TaskSpec.oneShot`): this SUBMISSION is one-shot — no later turn exists
|
|
344
344
|
* in which an async background notification could land (the archetypal case is a headless `sema -p` whose
|
|
345
345
|
* process exits when the turn ends). PER-REQUEST on purpose: "does this submission expect to be continued" is
|
|
346
346
|
* a property of the submission, not of the connection it arrived on. core consumes it as GUIDANCE ONLY (the
|
|
@@ -356,7 +356,7 @@ export interface TaskRequestBody {
|
|
|
356
356
|
* worker, not the exec env); IGNORED on multi-tenant deployments (can't make the shared worker run an arbitrary
|
|
357
357
|
* command). Validated + gated downstream; the center/config baseline wins on a name clash.
|
|
358
358
|
*
|
|
359
|
-
*
|
|
359
|
+
* [ref](core 5.60.0):条目上可选的 `contentOrigin`(`"local"|"execution"|"external"`)= **内容
|
|
360
360
|
* 出处声明**,只影响记忆写治理(会话污染标记),对审批门/策略/角色表零作用。缺席 = pre-378 逐字节
|
|
361
361
|
* 现行为(判 external)。🔴 **新提交(fresh)腿上,词表外的值 ⇒ 同步 400 `request.field_invalid`** ——
|
|
362
362
|
* 静默丢会把一次信任边界声明变成探针。⚠️ **耐久 resume 腿上不拒**:那条腿重放的是存量 body,4xx 会把
|
|
@@ -391,10 +391,10 @@ export interface TaskRequestBody {
|
|
|
391
391
|
enableFork?: boolean;
|
|
392
392
|
[k: string]: unknown;
|
|
393
393
|
}
|
|
394
|
-
/**
|
|
394
|
+
/** [ref] D-1: the operator-echoed decision-action binding carried on POST /v1/approvals/:sessionId/decide([ref]C-4:裸 :id 臂已删).
|
|
395
395
|
* All optional for back-compat — a legacy BFF caller omitting them resumes on the current-pending values
|
|
396
396
|
* exactly as before (the pre-D-1 path), tracked by a deprecation counter.
|
|
397
|
-
*
|
|
397
|
+
* [ref] A9: hoisted VERBATIM out of `createHttpServer`'s closure so the approvals/assistant route domain
|
|
398
398
|
* and the resume leg can name the SAME shape without a routes/* → server.ts value edge. */
|
|
399
399
|
export type DecideBinding = {
|
|
400
400
|
/** The capability token the operator actually SAW (from listPending). A mismatch with the current pending
|
|
@@ -404,10 +404,10 @@ export type DecideBinding = {
|
|
|
404
404
|
boundCallId?: string;
|
|
405
405
|
/** The server-minted opaque boundInputHash the operator saw — echoed VERBATIM (never recomputed here). */
|
|
406
406
|
boundInputHash?: string;
|
|
407
|
-
/**
|
|
407
|
+
/** [ref] edit: operator-corrected tool args, applied by core AFTER the binding check, on approve only. */
|
|
408
408
|
updatedInput?: unknown;
|
|
409
409
|
};
|
|
410
|
-
/**
|
|
410
|
+
/** [ref]([ref]④→[ref] 坐标轮换判定):409 `approval_stale` 拒体上的 additive 机读指路 ——
|
|
411
411
|
* **本会话当前 pending** 的 D-1 回显坐标,让持旧坐标的壳一跳重定位(免重拉列表)。
|
|
412
412
|
* 键名/键形与 GET /v1/approvals 的 pending 行逐字同名(壳复用同一解析)。
|
|
413
413
|
* 🔴 恒**不含** checkpointToken(runs.ts §12-C:resume 凭证从不外发);只在当前 pending **在场**、
|
package/dist/key-resolver.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { type SealedKeyPoison } from "./sealed-key.js";
|
|
|
10
10
|
* regression). When no per-model keys are configured at all this returns `undefined`, leaving the spec
|
|
11
11
|
* field unset so core's default path is byte-for-byte unchanged.
|
|
12
12
|
*
|
|
13
|
-
* Only the api KEY is per-model; the base URL stays brain-owned (
|
|
13
|
+
* Only the api KEY is per-model; the base URL stays brain-owned ([ref]) — core's seam carries
|
|
14
14
|
* `{ apiKey, headers? }`, not a baseUrl. Same-account-rotation could round-robin inside this function.
|
|
15
15
|
*
|
|
16
16
|
* `modelApiKeys` (sealed-box custody) carries per-model entries unsealed from `ModelEntry.sealedApiKey` —
|
package/dist/leader/diffout.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v2 MVP M2 — diff-OUT-of-container (
|
|
2
|
+
* v2 MVP M2 — diff-OUT-of-container ([ref] §7 solution (b), V2-MVP-PLAN.md, findings F1/F3, council#1/#13/#14).
|
|
3
3
|
*
|
|
4
4
|
* The Coordinator pulls a worker's commits as a patch series over `execStream` `git format-patch --stdout` —
|
|
5
5
|
* the diff comes OUT of the worker container, **no push credentials ever go IN** (preserves §5/F3 isolation).
|
|
@@ -41,7 +41,7 @@ export type PullDiffResult = {
|
|
|
41
41
|
/**
|
|
42
42
|
* 一次 diff 的字节帽(pull 腿与 push/上行腿**共用同一个数**)。
|
|
43
43
|
*
|
|
44
|
-
* 🔴 exported 是判据的一部分(2026-08-08
|
|
44
|
+
* 🔴 exported 是判据的一部分(2026-08-08,[ref] 二轮扫描 finding):`diffup.ts` 原先另抄了一份同值常量,
|
|
45
45
|
* 而它**本就已经** `import { safeRev } from "./diffout.js"` —— 依赖边在,共享零成本。两份手抄的后果不是
|
|
46
46
|
* 「多写一行」,是**单边改值后上行/pull 两腿对同一个 diff 的过/拒判定分家**:同一份补丁在一条腿上过、
|
|
47
47
|
* 另一条腿上被截断,而两处都「按自己的常量」正确工作,没有任何一处会报错。
|
package/dist/leader/diffup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] §8 F2(a) — worker SELF-UPLOAD diff-out (the factory-env counterpart of diffout.ts's pullDiff).
|
|
3
3
|
*
|
|
4
4
|
* With a factory env the runner owns the container lifecycle (create at task start, destroy at finish — and
|
|
5
5
|
* durable suspend only produces a complete ownedEnv on this path), so the leader can no longer pull the diff
|
|
@@ -66,7 +66,7 @@ export declare function createLeaderEndpoint(runLeader: (body: LeaderRequestBody
|
|
|
66
66
|
* runLeader 的内部实现细节,依旧保持 pure/testable。不传 = 向后兼容旧行为(只查 objective) ——
|
|
67
67
|
* 本文件其余全部既有用例都用最小 {objective} payload,不能被这个修复打红。 */
|
|
68
68
|
requiredFields?: readonly string[];
|
|
69
|
-
/**
|
|
69
|
+
/** [ref] 车4 件1:durable 登记表。缺席 ⇒ 显式的单副本内存降级臂(见文件头注)。 */
|
|
70
70
|
store?: LeaderRunStore;
|
|
71
71
|
}): LeaderEndpoint;
|
|
72
72
|
//# sourceMappingURL=endpoint.d.ts.map
|
package/dist/leader/fanout.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v2 MVP — leader fan-out composition layer (
|
|
2
|
+
* v2 MVP — leader fan-out composition layer ([ref] §3, V2-MVP-PLAN.md M1, core seam).
|
|
3
3
|
*
|
|
4
4
|
* Runs N sub-task workers in parallel over `runner.runTaskStream` sharing ONE AbortController, bounded by a
|
|
5
5
|
* Semaphore, with an overall deadline (no infinite wait — council#5), and a
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* snapshot — closing the late-registration race (council round-2). Returns a typed WorkerReport per worker (council#6 — the
|
|
8
8
|
* Coordinator needs a defined shape to route diffs in merge(b)).
|
|
9
9
|
*
|
|
10
|
-
* ── 重复 spawn 的去重由谁负责(
|
|
10
|
+
* ── 重复 spawn 的去重由谁负责([ref] 车4 件1,台账 P1-9③ 更正)────────────────────────────────────
|
|
11
11
|
* 这段头注**曾经**写着 fan-out 带一道「concurrency claim(run-store createRun unique-key CAS)」并称
|
|
12
12
|
* 「the rule-5 dual-session tax solved at worker scale」。亲读后裁定:那道 claim 全链路无人传,而且
|
|
13
13
|
* **由构造即无效** —— 它的 CAS 键是 `(workerId, sessionId)`,而 sessionId 是 `wire.ts` 每次现铸的
|
|
@@ -41,15 +41,15 @@ export interface WorkerReport {
|
|
|
41
41
|
error?: string;
|
|
42
42
|
/** The worker's TaskResult.stats (tokens/cost/turns) — for the value-campaign cost accounting. */
|
|
43
43
|
stats?: TaskResult["stats"];
|
|
44
|
-
/**
|
|
44
|
+
/** [ref] L3a module sub-gate: did this worker's module pass the per-module judge (after any repair)? */
|
|
45
45
|
moduleJudge?: "pass" | "fail";
|
|
46
46
|
/** Number of bounded repairs the module sub-gate spent on this worker (0 = passed first try). */
|
|
47
47
|
repairs?: number;
|
|
48
|
-
/**
|
|
48
|
+
/** [ref] Slice 6: the terminal checkpoint gate when a worker is still SUSPENDED (the leader auto-resumed
|
|
49
49
|
* it up to its bound but it didn't fully complete — e.g. the overall deadline hit or the slice cap). Present
|
|
50
50
|
* ⇒ resumable: the operator/leader can escalate (more budget) or accept the belt-diff partial progress. */
|
|
51
51
|
checkpointGate?: TaskResult["checkpointGate"];
|
|
52
|
-
/**
|
|
52
|
+
/** [ref] Slice 6: the worker's terminal `TaskResult.errorCode` (e.g. `limits.max_cost_exceeded` on an
|
|
53
53
|
* exhausted resume, `limits.max_turns_exceeded` — core 5.8.0 码名轴) — surfaced for /v1/leader observability. */
|
|
54
54
|
errorCode?: TaskResult["errorCode"];
|
|
55
55
|
/** LEADER-REPAIRLOOP-INTEGRATION §10.6 (THE push chokepoint): the `runRepairLoop` terminal a single-agent
|
|
@@ -95,7 +95,7 @@ export interface FanOutOptions {
|
|
|
95
95
|
* cancelled worker actually aborts (else the overall-timeout's `await work` can never unblock). Like the default
|
|
96
96
|
* path it need not catch — runOne maps a throw to failed/timeout. */
|
|
97
97
|
runWorker?: (st: FanOutSubtask, signal: AbortSignal) => Promise<WorkerReport>;
|
|
98
|
-
/** Replan-lite C4 (
|
|
98
|
+
/** Replan-lite C4 ([ref] §6): when a worker settles SUSPENDED, immediately cancelAll the rest — the
|
|
99
99
|
* suspended worker itself has already settled (its stream is deregistered), so the cancel sweep cannot
|
|
100
100
|
* touch its checkpoint/paused env (the destroy-exemption falls out of the registration lifecycle). */
|
|
101
101
|
cancelOnSuspend?: boolean;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* built. v1 reuses the integration sandbox (R1) + re-seeds it (R2) instead. **There is no config key that turns
|
|
21
21
|
* such a factory on** — an earlier revision of this header named one and shipped a `throw`-only stub beside it,
|
|
22
22
|
* but no such key ever existed in `config.ts`, so an operator following that text set an env var that did
|
|
23
|
-
* nothing. Both the stub and the promise were removed (
|
|
23
|
+
* nothing. Both the stub and the promise were removed ([ref] 车4 件3 / staleness ledger P2-9); the auto-accept
|
|
24
24
|
* slice, when it happens, is a new design件 that lands its factory, its wiring and its knob in one batch.
|
|
25
25
|
*
|
|
26
26
|
* Everything here is additive + OFF by default: nothing in this file runs unless the Stage-2 seams call it behind
|