@sema-agent/server 7.134.0 → 7.136.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/MIGRATION.md +197 -1
- package/USAGE.md +147 -42
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +122 -154
- package/dist/approval-card.js +50 -51
- package/dist/approval-content-kind.d.ts +23 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +35 -6
- package/dist/auth-bridge.js +20 -3
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +36 -29
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +7 -4
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +1 -1
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stage-07-capability-layer.d.ts +1 -1
- package/dist/boot/stage-08-reapers.d.ts +1 -1
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/stores.js +4 -4
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +15 -27
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/brain.js +12 -3
- package/dist/budget.d.ts +7 -7
- package/dist/budget.js +4 -0
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +11 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +29 -32
- package/dist/capability-facts.js +17 -21
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +22 -8
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-catalog.js +12 -10
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +5 -5
- package/dist/config-invariants.js +11 -2
- package/dist/config-lkg.d.ts +1 -39
- package/dist/config-lkg.js +1 -83
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +95 -87
- package/dist/config.d.ts +26 -24
- package/dist/config.js +38 -18
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +25 -11
- package/dist/file-history-disclosure.js +25 -14
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +45 -14
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +23 -19
- package/dist/fleet-lease.js +31 -23
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +58 -31
- package/dist/hooks/hook-runner.js +37 -19
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +62 -17
- package/dist/http/checkpoint-ctx.js +78 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +9 -9
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +9 -23
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -7
- package/dist/http/routes/approvals-assistant.js +101 -26
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +23 -11
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +97 -46
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +43 -53
- 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 +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +33 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +17 -13
- package/dist/observability/fail-open.js +17 -13
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -18
- package/dist/parked-decide.js +31 -11
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +5 -4
- package/dist/peer-directory.js +6 -6
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -15
- package/dist/plugins/approval-ask-store-sql.js +21 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +130 -0
- package/dist/plugins/checkpoint-index-columns.js +90 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +71 -69
- package/dist/plugins/checkpoint-store-sql.js +109 -127
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +15 -7
- package/dist/plugins/file-history-store-sql.js +55 -36
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +7 -7
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +73 -54
- package/dist/plugins/one-time-migrations.js +131 -134
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +26 -13
- package/dist/plugins/remote-env-k8s.js +24 -7
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +40 -1
- package/dist/plugins/sql-errors.js +49 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +8 -0
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +10 -3
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +20 -5
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +6 -1
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +17 -12
- package/dist/sandbox-pkg-source.js +14 -9
- package/dist/sealed-key.d.ts +22 -3
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +65 -37
- package/dist/session-incarnation.js +30 -12
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +61 -6
- package/dist/session-sync.js +55 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +52 -79
- package/dist/task-a2a.js +224 -62
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +13 -17
- package/dist/task-mcp.js +29 -49
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +166 -207
- package/dist/tool-approval.js +61 -61
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +13 -8
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +69 -67
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +61 -31
- package/dist/trace/redact.js +394 -153
- package/dist/trace/self-minted-wire.d.ts +302 -14
- package/dist/trace/self-minted-wire.js +87 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +16 -3
- package/dist/url-refusal.js +15 -2
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +32 -3
- package/dist/workspace-space.js +26 -0
- package/dist/write-protection.d.ts +2 -2
- package/package.json +5 -3
- package/scripts/drain-check-local.mjs +4 -2
- package/scripts/drain-check.mysql.sql +6 -2
- package/scripts/drain-check.pg.sql +6 -2
- package/skills/loop.md +1 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/principal-jwt.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type ApprovalEnvelope } from "./approval-hmac.js";
|
|
|
5
5
|
*
|
|
6
6
|
* 它回答的是**一跳**:签发方(issuer)与判定这份 token 的那口钟可以差多少(exp/nbf 门的宽限)。
|
|
7
7
|
*
|
|
8
|
-
* 🔴 它**不**回答「两台副本之间差多少」:
|
|
8
|
+
* 🔴 它**不**回答「两台副本之间差多少」:[ref] 的消费记录不再靠任何钟差上界活着 —— 受理窗的判定、
|
|
9
9
|
* 落地后的复核、到期清扫三处读的是**同一口钟**(消费记录店自己的钟,见
|
|
10
10
|
* `plugins/approval-nonce-store.ts` 的 `nowMs()`)。曾经由本常量推导出的那个「副本间钟差」常量已
|
|
11
11
|
* 整条删除:它是一条**猜出来的**上界,没有任何一条腿强制它,而正确的修法是根本不需要这个数。
|
|
@@ -36,7 +36,7 @@ export declare function verifyPrincipalJwt(token: string, keys: PrincipalJwtKey[
|
|
|
36
36
|
*
|
|
37
37
|
* 第三槽在两种门上是**同一条规则**「这份决定作用在哪份内容上」:动作门填被批工具调用的 `boundInputHash`
|
|
38
38
|
* (core 铸);非动作门 `plan_review` 的 `edit` 填**修订后的计划**的哈希(计划随本次请求一起提交,签名器手上
|
|
39
|
-
* 就有原文),`approve` / `reject` 不作用于任何新内容 ⇒ null。
|
|
39
|
+
* 就有原文),`approve` / `reject` 不作用于任何新内容 ⇒ null。[ref](test 黑盒发现,验真后修):此前 edit 也填
|
|
40
40
|
* null,于是为「只改 README」签出的证明可以拿去提交任意 `editedPlan`——签名只护住了 decision/reason,没护住
|
|
41
41
|
* 决定真正落地的那份内容。`cnf.bnd` 与 HMAC 都吃第三槽,所以 JWT 与信封同时绑住它;不匹配 ⇒
|
|
42
42
|
* `401 principal_unbound`(既有码,cnf.bnd 不符)。旧注记「计划哈希被拒」说的是 approve(worker 没有可哈希的
|
|
@@ -51,7 +51,7 @@ export declare function editedPlanBinding(editedPlan: string): string;
|
|
|
51
51
|
/**
|
|
52
52
|
* JWT `cnf.bnd` = **「这份身份凭据被签发去决哪一张卡」**(动作身份),故只哈希前三位。
|
|
53
53
|
*
|
|
54
|
-
* 🔴 **与 HMAC 信封的分工**(
|
|
54
|
+
* 🔴 **与 HMAC 信封的分工**([ref] F1 立此,属主注在 `approval-hmac.ts` 顶):HMAC 绑的是**「决了什么」**
|
|
55
55
|
* —— `decision` / `reason` / `permissionModeAfter` 这些**会改变后果**的字段全在那一把里。所以「同一张卡上
|
|
56
56
|
* 把 approve 的档偷偷调宽」只由 HMAC 拦;本函数**刻意不跟着加位**:决定内容改了 `cnf.bnd` 不该变(否则
|
|
57
57
|
* 一份合法 JWT 会被绑死在一个它签发时还不知道的值上,而 `permissionModeAfter` 恰恰是决裁那一刻才定的)。
|
|
@@ -97,7 +97,7 @@ export type DirectDoorProofResult = {
|
|
|
97
97
|
* verify principal → bind → mac-present → mac-valid (so a non-operator never gets a MAC oracle, an unverified
|
|
98
98
|
* caller never reaches the operator list).
|
|
99
99
|
*
|
|
100
|
-
* 🔴 `opts.nowSec`(
|
|
100
|
+
* 🔴 `opts.nowSec`([ref] / 合并复审 R2):受理窗要按**哪口钟**判。非动作门(plan_review)的反重放是
|
|
101
101
|
* 一条**消费记录**,而那条记录的生死由**消费记录店的钟**决定 —— 所以那条腿必须把店钟喂进来
|
|
102
102
|
* (`floor(店钟/1000)`),否则「还受理 ⇒ 记录还在」就退化成「两台副本的钟差不多」这条没人声明过的假设。
|
|
103
103
|
* 缺席 = 本机墙钟,这对动作门(`/decide`)是对的:它的反重放是 checkpointToken 的一次性,不牵扯第二台
|
|
@@ -110,7 +110,7 @@ export type DirectDoorProofResult = {
|
|
|
110
110
|
* {sessionId, nonce, <content hash>, decision, reason}. Pass `actionBinding:false` for a non-action gate; the default
|
|
111
111
|
* (true) keeps the /decide tool-approval contract byte-identical. The THIRD slot carries one rule on both gates —
|
|
112
112
|
* "the content this decision acts on": the bound tool input for /decide, `editedPlanBinding(editedPlan)` for a
|
|
113
|
-
* plan_review `edit` (
|
|
113
|
+
* plan_review `edit` ([ref]), null for approve/reject. Binding approve/reject to a hash of the EXISTING plan was
|
|
114
114
|
* rejected (the plan artifact lives in a profile ref store; the worker has no TOCTOU original) — that ruling never
|
|
115
115
|
* covered `edit`, whose content arrives with the request.
|
|
116
116
|
*/
|
|
@@ -119,7 +119,7 @@ export declare function verifyDirectDoorProof(proof: {
|
|
|
119
119
|
mac?: string;
|
|
120
120
|
kid?: string;
|
|
121
121
|
},
|
|
122
|
-
/** 🔴 **命名类型,不是结构等价的内联字面**(
|
|
122
|
+
/** 🔴 **命名类型,不是结构等价的内联字面**([ref] F1 [high] 的**根因**,验真后修):本位此前是一份手抄的
|
|
123
123
|
* 五字段内联形 —— 结构类型让**多带一个字段的调用方**照样编译通过,而下面那次手抄再把它**丢掉**,于是
|
|
124
124
|
* `approval-hmac.ts` 上新增的签名位在这条唯一的真实验签链上**静默失效**,tsc 一个字都不响。
|
|
125
125
|
* 用 {@link ApprovalEnvelope} 之后,信封的形只有**一个**声明点,新增一位自动到达验签器。 */
|
|
@@ -19,7 +19,7 @@ export type ProjectIdentity = {
|
|
|
19
19
|
export declare function resolveProjectIdentity(taskRoot: string): ProjectIdentity;
|
|
20
20
|
/**
|
|
21
21
|
* 退役 `repo:` 键的**唯一**铸点([ref] ①:`repo:` + sha256 hex 前 24;`root` 为 realpath 字符串,不加尾斜杠、不折大小写)。
|
|
22
|
-
*
|
|
22
|
+
* [ref] 起它只是一次性迁移的来源(`memory-project-layer.ts` 把这一层的条目折进新键;窗见 `plugins/one-time-migrations.ts` 登记表)。
|
|
23
23
|
*/
|
|
24
24
|
export declare function mintRepoScopeKey(projectRoot: string): string;
|
|
25
25
|
/** 这把键是不是本仓铸的项目键族(现行 `userrepo:` 或退役的 `repo:`)—— 运维不许把它们点名成全局层 / 同步层。 */
|
|
@@ -38,7 +38,7 @@ export declare function assertProjectLayerOwnable(scope: string, envName: string
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function normalizeGitRemoteUrl(url: string): string | undefined;
|
|
40
40
|
/**
|
|
41
|
-
* 任务根 → 项目层身份(
|
|
41
|
+
* 任务根 → 项目层身份([ref]):当前档(`r` 优先,没有 origin 退 `p`)+ 本 checkout 的低档(`r` 档时 = 它的 `p` 档)。
|
|
42
42
|
* 缺席形与 {@link resolveProjectIdentity} 同;git 配置在而读不了 ⇒ `unreadable`。
|
|
43
43
|
*/
|
|
44
44
|
export declare function projectLayerIdentityOf(taskRoot: string): {
|
|
@@ -54,7 +54,7 @@ export interface ProjectLayerOfTask {
|
|
|
54
54
|
readonly foldFrom: readonly string[];
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* 任务根 → 项目层(
|
|
57
|
+
* 任务根 → 项目层([ref]:`userrepo:<属主段>/<档>.<摘要>`,属主 = `owner`,调用方由 `projectLayerOwnerOf(全局层)` 求得)。
|
|
58
58
|
* `foldFrom` = 同一 checkout 能推出的旧层:退役 `repo:<同一路径哈希>`(一次性迁移,窗见 `plugins/one-time-migrations.ts` 登记表 M25)
|
|
59
59
|
* + 当前档是 `r` 时它的 `p` 档(常设律)。
|
|
60
60
|
* `taskRoot === undefined` = 调用方**此刻不知道**任务根在本机哪里(根在沙箱/设备盘上;或 host 车道会话没登记 cwd、手落在 factory 现铸的
|
package/dist/project-memory.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface ProjectMemoryCtx {
|
|
|
25
25
|
* every CLAUDE file it finds, per directory level up the ancestor chain, whereas this loader reads one root and
|
|
26
26
|
* takes the single first hit. */
|
|
27
27
|
declare const INSTRUCTION_FILE_CHAIN: readonly ["CLAUDE.md", ".claude/CLAUDE.md", "AGENTS.md", ".claude/AGENTS.md"];
|
|
28
|
-
/** 一个链成员(相对项目根的拼写)。导出给
|
|
28
|
+
/** 一个链成员(相对项目根的拼写)。导出给 [ref] 的 wire 段与它的值闭集登记(`trace/self-minted-wire.ts`)—— 链长一员,两处 tsc 跟着红。 */
|
|
29
29
|
export type InstructionChainMember = (typeof INSTRUCTION_FILE_CHAIN)[number];
|
|
30
30
|
/** Recover (root, rel) for a path the LOADER declared — every declared path is `root + one chain member`.
|
|
31
31
|
* The probe needs this to re-run the loader's parent-directory symlink gate each round (self-review: the probe
|
|
@@ -49,14 +49,14 @@ export declare function instructionChainCoordinates(absPath: string, p?: Platfor
|
|
|
49
49
|
* `phase: "post-compact"` forces a re-read (core re-renders the prefix there anyway). No entry for
|
|
50
50
|
* sessionless one-shot runs. (post-clear never arrives from core — [ref] — so it is not a cache key here.)
|
|
51
51
|
*
|
|
52
|
-
*
|
|
52
|
+
* [ref] — source-change notice: with `instructionSource` wired, every prepare of a non-subagent session that WALKED the
|
|
53
53
|
* instruction chain hands the chain member it selected (`null` = none) to {@link announceInstructionSource}, which
|
|
54
54
|
* compares it with the session's persisted baseline. A prepare stopped by a pre-walk gate (hands-less, a cwd that is not
|
|
55
55
|
* an absolute local directory) is "not applicable", not "none" — it never reaches the mint (O6, see `LoadOutcome`). The member is the one the snapshot carries — a cache hit answers the cached pick, so
|
|
56
56
|
* the notice follows what the model actually reads, not the disk (a same-process edit changes nothing until the
|
|
57
57
|
* snapshot is re-read: restart, post-compact, or a new session).
|
|
58
58
|
*
|
|
59
|
-
*
|
|
59
|
+
* [ref] — the same statement (same predicate, same member) also settles the calling LEG's `wiring_manifest.instructions`
|
|
60
60
|
* segment through {@link settleLegInstructionStatement} (`instruction-selection.ts`): the leg scope is the run identity
|
|
61
61
|
* the ctx does not carry, and the first call inside a leg's scope whose `ctx.sessionId` equals the leg's session is that
|
|
62
62
|
* leg's own prepare (a session-less adhoc leg falls back to plain first-call; [ref] X1). The segment projects
|
|
@@ -70,7 +70,7 @@ export declare function makeLoadProjectMemory(opts: {
|
|
|
70
70
|
maxBytes?: number;
|
|
71
71
|
/** TEST-ONLY: shrink the snapshot-cache bound so the settle-time trim is observable without 256 sessions. */
|
|
72
72
|
cacheMax?: number;
|
|
73
|
-
/**
|
|
73
|
+
/** [ref]: the baseline store + notice exit. Absent ⇒ no source-change notice (the session store has no baseline face). */
|
|
74
74
|
instructionSource?: InstructionSourceSeat;
|
|
75
75
|
}): (ctx: ProjectMemoryCtx) => Promise<string | null | ProjectMemoryLoad>;
|
|
76
76
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref](clay 裁定 2,[ref] 转达 / [ref] ②)—— **READ 容纳面档位的来源**(单一属主)。
|
|
3
3
|
*
|
|
4
4
|
* ## 它解决的问题
|
|
5
5
|
*
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* ## 优先序(与 `config.ts` 的 `postureOn` 同形)
|
|
21
21
|
* `env 显式` > `center 发布` > `lane 声明` > `posture 派生` > `引擎默认`。env 恒赢的论证逐字见 `web-admin-client/read-face.ts`
|
|
22
22
|
* 头注①(READ 容纳面描述的是**这台机器的磁盘上有什么**,组织的下发面不知道)。
|
|
23
|
-
* 🔴 **`lane` 一臂(
|
|
23
|
+
* 🔴 **`lane` 一臂([ref],clay 裁 [ref])**:隔离型执行车道(`e2b` / `k8s` / `local-docker`)的契约行**显式声明**读面缺省 `open`
|
|
24
24
|
* (`execution-lane-caps.ts` 的 `laneReadFaceDefault`;沙箱内部就是模型的整个世界)。运维没写 `READ_FACE` 时,车道声明比整机 posture 更具体 ⇒ 排在它前面;
|
|
25
25
|
* 声明 `roots` 的车道(`host` / `ssh` / `adb` / `device` / 未设车道)不替运维声明缺省,回到既有的 posture 派生,**一个字节不变**。
|
|
26
26
|
* 缺席这一态的派生**只有一只函数**({@link readFaceDefaultFor}),且读的是**最终生效的车道**(`loadConfig` 装配完 `remoteExec` 之后一次;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
import { type LaneReadFaceDefault, type RemoteExecProvider } from "./execution-lane-caps.js";
|
|
40
40
|
import { type PostureSource } from "./posture-source.js";
|
|
41
41
|
/**
|
|
42
|
-
* 档位来源的闭集词表 —— **
|
|
42
|
+
* 档位来源的闭集词表 —— **[ref] 起转 `posture-source.ts` 的共享件**(本模块只是给这一档取个本地名字,
|
|
43
43
|
* 不再持第二份词表:同一张四词表抄两遍的那天,两份会在加词时分家)。
|
|
44
44
|
*/
|
|
45
45
|
export declare const READ_FACE_SOURCE_WORDS: readonly ["env", "center", "lane", "posture", "engine-default"];
|
|
@@ -77,7 +77,7 @@ export declare function settleDerivedReadFace(seat: ReadFaceDeploymentSeat, sing
|
|
|
77
77
|
/** 本档的运维指路句 —— 骨架由共享件 {@link postureSourceNote} 给(四词穷举在那里,加词即编译红);
|
|
78
78
|
* 本函数提供两条**键专属**臂(`center` / `posture`)的事实句。
|
|
79
79
|
*
|
|
80
|
-
* 🔴 `center` 那句话的事实来源是
|
|
80
|
+
* 🔴 `center` 那句话的事实来源是 [ref](core 7.10.0 [ref]):`RunnerDeps.readFace` 进了 core 的可换席
|
|
81
81
|
* 闭集 `SWAPPABLE_DEP_SEATS` ⇒ 组织发布/撤回一个档位,**下一拍 refresh 当场换进全部 Runner**,
|
|
82
82
|
* `web-admin-client/restart-signal.ts` 的 `read-face` 片也不再为它签重启理由(判据同源 =
|
|
83
83
|
* `CENTER_READ_FACE_LIVE_KEYS`,由 core 的 `isSwappableDepSeat` 派生)。本句此前逐字写着
|
|
@@ -92,10 +92,10 @@ export declare function buildReadFaceWiring(facts: ReadFacePostureFacts): {
|
|
|
92
92
|
note: string;
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* [ref] —— 派生的档位(`posture` 单机 ⇒ open,或 [ref] 的 `lane` 隔离车道 ⇒ open)在 **boot 期推送面**的那一行(`config.ts` 经既有 `CONFIG_NOTICES` 以 info 级排空)。
|
|
96
96
|
*
|
|
97
|
-
* 为什么要有:
|
|
98
|
-
* (`GET /v1/diagnostics/wiring`)—— 只对会去拉的人成立。单机 boot 日志里零字。
|
|
97
|
+
* 为什么要有:[ref] 的补偿项是「升级即放开,得让运维看得见并知道怎么钉回」,可此前唯一看得见的是**拉取**面
|
|
98
|
+
* (`GET /v1/diagnostics/wiring`)—— 只对会去拉的人成立。单机 boot 日志里零字。[ref] 的 `lane` 臂同一个补偿:多租户沙箱部署升级后读面从 `roots` 变 `open`,
|
|
99
99
|
* 指路句带挂载告诫与钉回出路。
|
|
100
100
|
* 为什么只在 `posture` / `lane` 两词上说:另外三词都不是「没人表态、服务替它选了一个更宽的档」——`env` 是运维自己写的,
|
|
101
101
|
* `engine-default` 是本服务没铸(引擎默认接管),`center` 在 boot 这一拍还没到货(它有自己的换席通告)。
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **请求体里「声明列表」(`mcpServers` · `a2aPeers`)这一类受理座的拒绝骨架** —— 列表级 / 条目级 / 键值级的拒形、拒句尾、撞帽机读位,在这里铸一处。
|
|
3
|
+
*
|
|
4
|
+
* ## 为什么在这里
|
|
5
|
+
* 两张列表是同一个问题的两个实例:调用方随请求带一份「我要挂这些外部服务」的声明,受理口要回答「这份声明能不能原样用」。答案的**形**一样 ——
|
|
6
|
+
* ① **列表**:在场却不是数组 / 超过挂载上限 / 某一条不是对象 ⇒ `400 request.field_invalid`(整份拒而不是挂前 N 条 / 摘掉读不出的那条:一份被悄悄截短的声明,在发送方那里读起来是「生效了」);
|
|
7
|
+
* 超上限用撞帽的唯一铸点({@link limitRefusal}),拒体带机读位一组键(`field` · `reason:"over_cap"` · `count` · `cap`);
|
|
8
|
+
* ② **键名**:条目层的词表外键 ⇒ `400 request.body_shape` + `unknownKeys`(句子由各座自己写 —— 受理键表与嵌套层是座位自己的事);
|
|
9
|
+
* ③ **键值**:每个受理键一只判官 ⇒ `400 request.field_invalid`,句子 `<坐标>.<键路径> (<subject> "<名>") is not a usable declaration — <判官原因句>. …`,不回显值;
|
|
10
|
+
* 判官答「URL 带凭据」时拒体另带机读位 `field` / `reason`({@link urlCredentialFacts})。
|
|
11
|
+
* 第一处坏形即答:先列表、后条目;条目里先键名、后键值。各座只写**自己的**两件事:受理键表 + 键值判官表(以及它自己的词表外键句)。拒形、句尾、撞帽句不在座位文件里手拼 ——
|
|
12
|
+
* 两份手拼的拒形迟早分岔(`a2aPeers` 上线时就是缺了这一整套,坏形换回 200 + 运维 warn,调用方以为声明生效了)。
|
|
13
|
+
*
|
|
14
|
+
* ## 射程
|
|
15
|
+
* 纯值域、与租户车道无关;只在 fresh 提交腿上问(`boot/resolve-spec.ts` 的 `opts.leg`):重放存量 body 的腿走宽容读器,一个 4xx 打在 resume 上会永久砖死一条 parked 任务。
|
|
16
|
+
*/
|
|
17
|
+
import { type UrlCredential } from "@sema-agent/settings-schema";
|
|
18
|
+
import { type LimitFacts } from "./limit-refusal.js";
|
|
19
|
+
import { type UrlCredentialFacts } from "./url-credential-refusal.js";
|
|
20
|
+
/** 一座声明列表的名字与上限、以及拒句里要用的称呼(座位的常量,铸点只读)。 */
|
|
21
|
+
export interface DeclarationSeat {
|
|
22
|
+
/** 请求体里这张列表的键,也是机读坐标的根(`mcpServers` | `a2aPeers`)。 */
|
|
23
|
+
readonly list: string;
|
|
24
|
+
/** 挂载上限(条数;超过 ⇒ 撞帽拒)。 */
|
|
25
|
+
readonly cap: number;
|
|
26
|
+
/** 一条声明所声明的东西(拒句里的单数名词:`server` | `peer`)。 */
|
|
27
|
+
readonly subject: string;
|
|
28
|
+
/** 「一条声明」的整称(`an MCP server declaration`)。 */
|
|
29
|
+
readonly declaration: string;
|
|
30
|
+
/** 「多条声明」的整称(`MCP server declarations`)。 */
|
|
31
|
+
readonly declarations: string;
|
|
32
|
+
}
|
|
33
|
+
/** 一次拒绝:码 + 句 + 词表外的键名表(只在闭集那一形上在场)+ 机读位(撞帽 / URL 带凭据两形上在场)。受理口(同步 400)与探测口(`POST …/probe`)原样转述同一份。 */
|
|
34
|
+
export interface DeclarationRefusal {
|
|
35
|
+
readonly errorCode: "request.body_shape" | "request.field_invalid";
|
|
36
|
+
readonly message: string;
|
|
37
|
+
/** 词表外的键,全路径形(已清洗 + 截长 + 排序 + 封顶)。 */
|
|
38
|
+
readonly unknownKeys?: readonly string[];
|
|
39
|
+
/** 撞帽:`field` · `reason:"over_cap"` · `count` · `cap`;URL 带凭据:`field` · `reason`(判官的拒因词)。 */
|
|
40
|
+
readonly facts?: UrlCredentialFacts | LimitFacts;
|
|
41
|
+
}
|
|
42
|
+
/** 一处键值坏形:键路径(相对条目)+ 判官的原因句;答「URL 带凭据」时另带判官的答案(⇒ 拒体带机读位)。 */
|
|
43
|
+
export interface DeclarationKeyIssue {
|
|
44
|
+
readonly path: string;
|
|
45
|
+
readonly reason: string;
|
|
46
|
+
readonly credential?: UrlCredential;
|
|
47
|
+
}
|
|
48
|
+
/** 受理键 → 判官。`at` 是这一条的体内坐标(`a2aPeers[2]`),座位需要写绝对坐标的出路句时用。缺席(`undefined`)恒合法 = 真「没声明」;在场的 `null` 不是缺席。 */
|
|
49
|
+
export type DeclarationKeyJudge<E extends Record<string, unknown> = Record<string, unknown>> = (entry: E, at: string) => DeclarationKeyIssue | undefined;
|
|
50
|
+
/** 读不出名字的条目用的占位(非空:一条连名字都读不出的条目仍然要被说出来)。 */
|
|
51
|
+
export declare const MALFORMED_NAME = "<malformed>";
|
|
52
|
+
/** 条目的**申报名**(拿不到名字时的占位)—— 拒句、丢弃点、通告同读一只。 */
|
|
53
|
+
export declare function declaredName(e: unknown): string;
|
|
54
|
+
/** `name` 键的判官(两座同读:申报名线长界与首尾空白的唯一判官在契约包 {@link isUsableWireName})。 */
|
|
55
|
+
export declare function declarationNameIssue(entry: Record<string, unknown>): DeclarationKeyIssue | undefined;
|
|
56
|
+
/** 列表级拒句的收尾句:说清「为什么整份被拒、而不是只按读得出的那部分办」与出路(空列表 = 什么都不声明)。 */
|
|
57
|
+
export declare const LIST_REFUSAL_TAIL: string;
|
|
58
|
+
/** 列表级的一处坏形 → 拒(码恒 `request.field_invalid`)。`head` 只说位置与形的**种类**,不回显值。 */
|
|
59
|
+
export declare function declarationListRefusal(head: string): DeclarationRefusal;
|
|
60
|
+
/**
|
|
61
|
+
* 一处键值坏形**怎么被说出来**:体内坐标(`<条目坐标>.<键路径>`)+ 判官的原因句(只剥控制与双向字符,不回显值)。受理口的拒句与读器的丢弃因(请求腿运维 warn 的 `field` / `reason`)读**这一只** ——
|
|
62
|
+
* 原因只来自判官表,组句只在这里(两边各写一份,迟早分岔)。
|
|
63
|
+
*/
|
|
64
|
+
export declare function declarationIssueFacts(at: string, issue: DeclarationKeyIssue): {
|
|
65
|
+
readonly field: string;
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 列表条数撞帽**怎么被说出来**:坐标 = 列表键(`a2aPeers`)+ 撞帽铸点({@link limitRefusal})的头一句(`<列表> has N entries — at most M are accepted`)。受理口的撞帽拒句以同一句开头(接拒句尾),
|
|
70
|
+
* 读器的丢弃因读这一只 —— 与 {@link declarationIssueFacts} 同族:`reason` 只有一种内容 = 句子;机读词(`over_cap`)留在拒体的 `facts`,不进日志的 `reason`。
|
|
71
|
+
*/
|
|
72
|
+
export declare function declarationOverCapFacts(seat: DeclarationSeat, count: number): {
|
|
73
|
+
readonly field: string;
|
|
74
|
+
readonly reason: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* 一条条目不是对象(`null` / 原始值 / 数组)的头一句:`<条目坐标> is <值的种类>, not <整称> (an object)`;是对象 ⇒ `undefined`。列表级拒({@link requestDeclarationRefusal})与读器的丢弃因读同一只,
|
|
78
|
+
* 「什么算对象」只在这里判。
|
|
79
|
+
*/
|
|
80
|
+
export declare function declarationEntryNotObject(seat: DeclarationSeat, entry: unknown, at: string): string | undefined;
|
|
81
|
+
/** 一处键值坏形 → 拒。**所有键同一个形**;条目名过唯一的回显清洗,读不出名字的条目用占位,坐标与原因句由 {@link declarationIssueFacts} 铸。 */
|
|
82
|
+
export declare function declarationFieldRefusal(seat: DeclarationSeat, entry: Record<string, unknown>, at: string, issue: DeclarationKeyIssue): DeclarationRefusal;
|
|
83
|
+
/** 一条条目的键值判官表按受理键序问一遍,第一处坏形即返回。 */
|
|
84
|
+
export declare function judgeDeclarationKeys<K extends string, E extends Record<string, unknown>>(seat: DeclarationSeat, entry: E, at: string, keys: readonly K[], judges: {
|
|
85
|
+
readonly [P in K]: DeclarationKeyJudge<E>;
|
|
86
|
+
}): DeclarationRefusal | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* 一张声明列表「能不能原样用」的回答者骨架:列表级(缺席 / `null` ⇒ 没声明;不是数组 / 超上限 / 条目不是对象)在这里,条目级交座位的 `judgeEntry`(词表外的键 → 键值)。
|
|
89
|
+
* `undefined` = 能原样用(或没声明;各门自己定缺席的意思)。
|
|
90
|
+
*/
|
|
91
|
+
export declare function requestDeclarationRefusal(seat: DeclarationSeat, list: unknown, judgeEntry: (entry: Record<string, unknown>, at: string) => DeclarationRefusal | undefined): DeclarationRefusal | undefined;
|
|
92
|
+
/** 受理口的转述:有答案 ⇒ 同步 400(码 / 句 / `unknownKeys` / 机读位原样);没有 ⇒ 什么也不做。 */
|
|
93
|
+
export declare function throwDeclarationRefusal(refusal: DeclarationRefusal | undefined): void;
|
|
94
|
+
//# sourceMappingURL=request-declaration-refusal.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { describeBadWireName, describeValueShape, isUsableWireName, stripControlAndBidi } from "@sema-agent/settings-schema";
|
|
2
|
+
import { createCodedHttpError } from "./security.js";
|
|
3
|
+
import { limitRefusal } from "./limit-refusal.js";
|
|
4
|
+
import { echoKeyName } from "./request-key-closure.js";
|
|
5
|
+
import { urlCredentialFacts } from "./url-credential-refusal.js";
|
|
6
|
+
export const MALFORMED_NAME = "<malformed>";
|
|
7
|
+
export function declaredName(e) {
|
|
8
|
+
return e && typeof e === "object" && typeof e.name === "string" && e.name !== ""
|
|
9
|
+
? String(e.name)
|
|
10
|
+
: MALFORMED_NAME;
|
|
11
|
+
}
|
|
12
|
+
export function declarationNameIssue(entry) {
|
|
13
|
+
return isUsableWireName(entry.name) ? undefined : { path: "name", reason: `must be a non-empty string within the wire-name length bound — got ${describeBadWireName(entry.name)}` };
|
|
14
|
+
}
|
|
15
|
+
export const LIST_REFUSAL_TAIL = "The request is refused rather than acting on part of the list: declarations that silently did not apply would read as in effect to whoever sent them. " +
|
|
16
|
+
"Fix the list (an empty list declares none).";
|
|
17
|
+
export function declarationListRefusal(head) {
|
|
18
|
+
return { errorCode: "request.field_invalid", message: `${head}. ${LIST_REFUSAL_TAIL}` };
|
|
19
|
+
}
|
|
20
|
+
function entryRefusalTail(subject) {
|
|
21
|
+
return (`The request is refused rather than mounting the ${subject} without it: a declaration that silently did not apply would leave the ${subject} running differently from what you declared. ` +
|
|
22
|
+
"Fix the entry (an optional key may also be omitted).");
|
|
23
|
+
}
|
|
24
|
+
export function declarationIssueFacts(at, issue) {
|
|
25
|
+
return { field: `${at}.${issue.path}`, reason: stripControlAndBidi(issue.reason) };
|
|
26
|
+
}
|
|
27
|
+
export function declarationOverCapFacts(seat, count) {
|
|
28
|
+
const capped = limitRefusal(seat.list, "entries", count, seat.cap);
|
|
29
|
+
return { field: capped.facts.field, reason: capped.message };
|
|
30
|
+
}
|
|
31
|
+
export function declarationEntryNotObject(seat, entry, at) {
|
|
32
|
+
return entry === null || typeof entry !== "object" || Array.isArray(entry) ? `${at} is ${describeValueShape(entry)}, not ${seat.declaration} (an object)` : undefined;
|
|
33
|
+
}
|
|
34
|
+
export function declarationFieldRefusal(seat, entry, at, issue) {
|
|
35
|
+
const name = echoKeyName("", declaredName(entry));
|
|
36
|
+
const { field, reason } = declarationIssueFacts(at, issue);
|
|
37
|
+
return {
|
|
38
|
+
errorCode: "request.field_invalid",
|
|
39
|
+
message: `${field} (${seat.subject} "${name}") is not a usable declaration — ${reason}. ${entryRefusalTail(seat.subject)}`,
|
|
40
|
+
...(issue.credential === undefined ? {} : { facts: urlCredentialFacts(`${at}.${issue.path}`, issue.credential) }),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function judgeDeclarationKeys(seat, entry, at, keys, judges) {
|
|
44
|
+
for (const key of keys) {
|
|
45
|
+
const issue = judges[key](entry, at);
|
|
46
|
+
if (issue !== undefined)
|
|
47
|
+
return declarationFieldRefusal(seat, entry, at, issue);
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
export function requestDeclarationRefusal(seat, list, judgeEntry) {
|
|
52
|
+
if (list === undefined || list === null)
|
|
53
|
+
return undefined;
|
|
54
|
+
if (!Array.isArray(list))
|
|
55
|
+
return declarationListRefusal(`${seat.list} is ${describeValueShape(list)}, not an array of ${seat.declarations}`);
|
|
56
|
+
if (list.length > seat.cap) {
|
|
57
|
+
const capped = limitRefusal(seat.list, "entries", list.length, seat.cap, { tail: LIST_REFUSAL_TAIL });
|
|
58
|
+
return { errorCode: "request.field_invalid", message: capped.message, facts: capped.facts };
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < list.length; i++) {
|
|
61
|
+
const entry = list[i];
|
|
62
|
+
const at = `${seat.list}[${i}]`;
|
|
63
|
+
const notObject = declarationEntryNotObject(seat, entry, at);
|
|
64
|
+
if (notObject !== undefined)
|
|
65
|
+
return declarationListRefusal(notObject);
|
|
66
|
+
const refusal = judgeEntry(entry, at);
|
|
67
|
+
if (refusal !== undefined)
|
|
68
|
+
return refusal;
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
export function throwDeclarationRefusal(refusal) {
|
|
73
|
+
if (refusal === undefined)
|
|
74
|
+
return;
|
|
75
|
+
const extra = { ...(refusal.unknownKeys === undefined ? {} : { unknownKeys: [...refusal.unknownKeys] }), ...(refusal.facts ?? {}) };
|
|
76
|
+
throw createCodedHttpError(400, refusal.errorCode, refusal.message, Object.keys(extra).length === 0 ? undefined : extra);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=request-declaration-refusal.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type UrlCredentialRefusal } from "./url-credential-refusal.js";
|
|
2
|
+
/** 请求体 `images` 的 URL 座:任一条目的串值 `url` 带凭据 ⇒ 拒(整句 + 机读位),列表序第一处即答;没有 ⇒ `undefined`。`images` 不是数组 / 缺席 ⇒ `undefined`(形归受理口别的门)。 */
|
|
3
|
+
export declare function requestImageUrlRefusal(images: unknown): UrlCredentialRefusal | undefined;
|
|
4
|
+
/** fresh 提交腿的 `images` URL 门:{@link requestImageUrlRefusal} 有答案 ⇒ 同步 400(码 / 句 / 机读位原样)。 */
|
|
5
|
+
export declare function assertRequestImageUrls(bodyImages: unknown): void;
|
|
6
|
+
//# sourceMappingURL=request-image-urls.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createCodedHttpError } from "./security.js";
|
|
2
|
+
import { findUrlCredential } from "@sema-agent/settings-schema";
|
|
3
|
+
import { buildRequestUrlCredentialRefusal } from "./url-credential-refusal.js";
|
|
4
|
+
function inlineImageExit(at) {
|
|
5
|
+
return `${at} can carry the image bytes inline: send { "data": <base64>, "mimeType": "image/png" | "image/jpeg" | "image/gif" | "image/webp" } instead of a URL that holds the credential`;
|
|
6
|
+
}
|
|
7
|
+
export function requestImageUrlRefusal(images) {
|
|
8
|
+
if (!Array.isArray(images))
|
|
9
|
+
return undefined;
|
|
10
|
+
for (const [i, image] of images.entries()) {
|
|
11
|
+
if (image === null || typeof image !== "object")
|
|
12
|
+
continue;
|
|
13
|
+
const url = image.url;
|
|
14
|
+
const found = typeof url === "string" ? findUrlCredential(url) : undefined;
|
|
15
|
+
if (found === undefined)
|
|
16
|
+
continue;
|
|
17
|
+
const at = `images[${i}]`;
|
|
18
|
+
return buildRequestUrlCredentialRefusal(`${at}.url`, found, inlineImageExit(at));
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
export function assertRequestImageUrls(bodyImages) {
|
|
23
|
+
const refusal = requestImageUrlRefusal(bodyImages);
|
|
24
|
+
if (refusal !== undefined)
|
|
25
|
+
throw createCodedHttpError(400, "request.field_invalid", refusal.message, refusal.facts);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=request-image-urls.js.map
|
|
@@ -17,6 +17,11 @@ export declare function scanKeyClosure(bag: object, prefix: string, accepted: Re
|
|
|
17
17
|
unknown: string[];
|
|
18
18
|
unsupported: string[];
|
|
19
19
|
}): void;
|
|
20
|
+
/** {@link scanKeyClosure} 的名字形:键名已经由调用方读成一张表(请求入口的快照只带词表外的键**名**,值不读),分拣规则同一条。 */
|
|
21
|
+
export declare function scanKeyNames(names: readonly string[], prefix: string, accepted: ReadonlySet<string>, tolerated: ReadonlySet<string>, into: {
|
|
22
|
+
unknown: string[];
|
|
23
|
+
unsupported: string[];
|
|
24
|
+
}): void;
|
|
20
25
|
/** 一张分类表的文案片段(封顶后只报数)。 */
|
|
21
26
|
export declare function keyClosureClause(names: string[], label: string): string;
|
|
22
27
|
/**
|
|
@@ -32,7 +37,7 @@ declare const TASK_BODY_SCENARIO_KEYS: readonly ["repo"];
|
|
|
32
37
|
export type ScenarioBodyKey = (typeof TASK_BODY_SCENARIO_KEYS)[number];
|
|
33
38
|
/** 剥掉索引签名,只留**具名**键 —— `TaskRequestBody` 上那条 `[k: string]: unknown` 会让
|
|
34
39
|
* `keyof` 退化成 `string`,双向门就永远恒真(零判别力)。
|
|
35
|
-
* 🔴 **导出**(
|
|
40
|
+
* 🔴 **导出**([ref]):姊妹门 `request-value-closure.ts` 的双向钉要同一个剥法 —— 抄第二份 = 两处哪天
|
|
36
41
|
* 分岔(一边看得见索引签名、一边看不见)谁都发现不了,而两边的判别力都建立在「剥干净了」这句话上。 */
|
|
37
42
|
export type NamedKeysOf<T> = {
|
|
38
43
|
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
@@ -5,7 +5,10 @@ export function echoKeyName(prefix, key) {
|
|
|
5
5
|
return `${prefix}${echoCallerText(key)}`;
|
|
6
6
|
}
|
|
7
7
|
export function scanKeyClosure(bag, prefix, accepted, tolerated, into) {
|
|
8
|
-
|
|
8
|
+
scanKeyNames(Object.keys(bag), prefix, accepted, tolerated, into);
|
|
9
|
+
}
|
|
10
|
+
export function scanKeyNames(names, prefix, accepted, tolerated, into) {
|
|
11
|
+
for (const k of names) {
|
|
9
12
|
if (accepted.has(k))
|
|
10
13
|
continue;
|
|
11
14
|
(tolerated.has(k) ? into.unsupported : into.unknown).push(echoKeyName(prefix, k));
|
|
@@ -23,7 +26,7 @@ const TASK_BODY_DECLARED_KEYS = [
|
|
|
23
26
|
"excludeAllTools", "excludeTools", "fileHistory",
|
|
24
27
|
"finalVerification", "forwardSubagentEvents", "images", "inheritEnv", "interactiveTools", "jobId", "limits", "maxCostUsd",
|
|
25
28
|
"maxTokens", "mcpServers", "memory", "memoryCapture", "memoryWrite", "model", "objective", "oneShot", "outputRetries", "outputStyle",
|
|
26
|
-
"outputSchema", "permissionMode", "projectId", "promptProfile", "reasoningEffort", "requireExistingSession",
|
|
29
|
+
"outputSchema", "permissionMode", "projectId", "projectMemory", "promptProfile", "reasoningEffort", "requireExistingSession",
|
|
27
30
|
"resilience", "restoreFiles", "resumeAt", "resumeAtMode", "retainBackgroundProcesses", "retainSubagentSessions",
|
|
28
31
|
"rewindFiles", "rewindFilesTo", "sandboxImageProfile", "scenario", "scratchpadDir", "selfOrchestration",
|
|
29
32
|
"sessionId", "settings", "skills", "suggestNextPrompts", "systemPrompt", "taskId", "toolMaterializeStrategy",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* 于是坏值有且只有一种正确处置:**响亮拒**。按 truthiness 读成任一态都是灾难的一半 ——
|
|
10
10
|
* 一个敲错的隐私/收紧请求被静默丢掉(用户以为关了,其实没关),或者一个敲错的键把功能静默关掉。
|
|
11
11
|
*
|
|
12
|
-
* 🔴 **判别是「值域恰好是一个关断词」,不是「值域恰好是一个字面量」**(
|
|
12
|
+
* 🔴 **判别是「值域恰好是一个关断词」,不是「值域恰好是一个字面量」**([ref] 加 `fileHistory` 时定形):
|
|
13
13
|
* 当年的反例是 `approverPosture`(值域也只有一个词 `"bypass"`,但它是一句**姿态声明**、闭集属主在 core,本仓刻意零判据);
|
|
14
|
-
* 那个请求键已随 core 7.34.0 退役(
|
|
14
|
+
* 那个请求键已随 core 7.34.0 退役([ref],[ref] 裁 ③),判别式的理由不变 —— 一个非关断的单字面量键不属于本表。
|
|
15
15
|
* 关断词全集 {@link OffSwitchWord} 是 core 的两种关断拼法,新增第三种拼法 = 加一个词(并逐键重判)。
|
|
16
16
|
*
|
|
17
17
|
* ## 为什么是一只判据函数,不是每处一抄
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
* **不可逆方向**的静默降级 —— 一条旧 worker 持久化的 `memoryCapture:'OFF'` 会在 resume 时静默恢复采集。
|
|
26
26
|
*
|
|
27
27
|
* 两腿各抄一份判据 + 一份文案,就是同一条 wire 语义上的**两个写者**;`memoryCapture` 从 [ref] 起正是这么长的
|
|
28
|
-
* (`http/admission.ts` 与 `boot/resolve-spec.ts` 各一份逐字手抄的 150 字文案)。
|
|
28
|
+
* (`http/admission.ts` 与 `boot/resolve-spec.ts` 各一份逐字手抄的 150 字文案)。[ref] 给这一族添第二个键
|
|
29
29
|
* (`memory`)时把它收成**一张表、一只判据、一处文案属主**:新增一个同形键 = 加一行,而不是四处改。
|
|
30
|
-
*
|
|
30
|
+
* [ref] 加第三个键 `fileHistory` 正是这么加的 —— 一行(带它自己的关断词),零处改判据。
|
|
31
31
|
* 文案的冻结职责随之从「桶扫描」搬到 `test/api-error-text-freeze.test.ts` 的常量锚格(与 `RUN_NOT_FOUND_MESSAGE` /
|
|
32
32
|
* `PERSIST_RULE_*` 两格同形、同理由)。
|
|
33
33
|
*
|
|
@@ -43,21 +43,24 @@ import type { TaskRequestBody } from "./http/wire-types.js";
|
|
|
43
43
|
/** [ref] §2.1([ref]):`memoryCapture` 的拼写门文案。**wire 可见文本** —— 改一个字就是对端契约漂移
|
|
44
44
|
* (SDK/壳/文档锚它),字节冻结在 `test/api-error-text-freeze.test.ts` 的常量锚格。 */
|
|
45
45
|
export declare const MEMORY_CAPTURE_SPELLING_MESSAGE = "memoryCapture must be the string 'off' when present (the session-level memory-capture opt-out declaration; absent = capture as usual \u2014 there is no 'on' spelling)";
|
|
46
|
-
/** core [ref] r5 §5 W3(
|
|
46
|
+
/** core [ref] r5 §5 W3([ref]):请求级「记忆整面关」`memory` 的拼写门文案。同上,wire 可见、字节冻结。
|
|
47
47
|
* 文案刻意点明 capture 的分工 —— 两个键都在记忆轴上、形又一模一样,拿错的人要在同一条回执里读到该用哪个。 */
|
|
48
48
|
export declare const MEMORY_OFF_SPELLING_MESSAGE = "memory must be the string 'off' when present (the request-level declaration that this run mounts no memory face at all; absent = memory as usual \u2014 there is no 'on' spelling; to keep memory mounted but stop this session's content from entering long-term memory, send memoryCapture: 'off' instead)";
|
|
49
|
-
/**
|
|
49
|
+
/** [ref](core 7.31.0 [ref]):请求级「文件历史关断」`fileHistory` 的拼写门文案。同上,wire 可见、字节冻结。
|
|
50
50
|
* 唯一词是 core 的拼法 `'disabled'`(与 `checkpointStore` 同),**不是**记忆族的 `'off'` —— 句子点名它,
|
|
51
51
|
* 顺带说清同一提交里不能再要还原(那一对的拒句是下面的 {@link FILE_HISTORY_DISABLED_NO_RESTORE})。 */
|
|
52
52
|
export declare const FILE_HISTORY_OFF_SPELLING_MESSAGE = "fileHistory must be the string 'disabled' when present (the request-level declaration that this run records no file history \u2014 no backup of an edited file, and no file restore in the same request; absent = the deployment's setting \u2014 there is no 'enabled' spelling)";
|
|
53
|
+
/** 7.135.0(core 7.55.0):请求级「这一条 run 不读部署的项目上下文」`projectMemory` 的拼写门文案。同上,wire 可见、字节冻结。
|
|
54
|
+
* 唯一词是 core 的拼法 `'disabled'`(与 `fileHistory` 同族同拼法)—— 第四个同形键,按本表的规则加一行,不另判。 */
|
|
55
|
+
export declare const PROJECT_MEMORY_OFF_SPELLING_MESSAGE = "projectMemory must be the string 'disabled' when present (the request-level declaration that this run reads none of the deployment's project context \u2014 no project instruction files and no project layer; absent = the deployment's project context as usual \u2014 there is no 'on' spelling)";
|
|
53
56
|
/**
|
|
54
|
-
*
|
|
57
|
+
* [ref] b′(主会话裁,车PW codex r1 [high] 复现后)—— `fileHistory: "disabled"` 与还原**同体**的拒句(`request.field_conflict`)。
|
|
55
58
|
* 与 `tool-approval.ts` 的 `READ_ROOT_GRANT_ALLOW_ONLY` **同一族**:「只看体就能判的矛盾,在裁决之前响亮说」。
|
|
56
59
|
* 这一对是调用方自己写出的矛盾(关掉这条 run 的文件历史,又要从文件历史还原);core 也拒(`rewind.capture_disabled`)。立门时(7.104.0)
|
|
57
60
|
* core 的拒落在 prepare 的**会话分叉之后**(`prepare-acquire-reconcile` 先按 `resumeAt` 把活动分支移过去,`prepare-file-history` 才判),
|
|
58
61
|
* 且拒后不回滚 —— 所以本层在任何副作用之前拒。**这不是替 core 再判一次「捕获关了能不能还原」**:判的是体里两个键
|
|
59
62
|
* 能不能共存,不看部署、不看店。
|
|
60
|
-
* ⚠️
|
|
63
|
+
* ⚠️ [ref] / [ref](core 7.35.0 [ref]):core 起把只看请求体就判得出的拒因(本码在内)挪到**会话 acquire 之前**的请求门
|
|
61
64
|
* (`runner/file-history-request.js`),被拒的请求会话日志逐字节不动 —— 本门当年防的那个副作用在引擎侧已不存在。本门的 400
|
|
62
65
|
* 照旧有效(core wire 单:「the at-accept 400 stays valid」),退不退(退则 fresh 腿改落 core 的 422 `rewind.capture_disabled`)
|
|
63
66
|
* 列 7.106.0 收车档候裁。
|
|
@@ -94,6 +97,10 @@ declare const SINGLE_MEMBER_OFF_FIELDS: readonly [{
|
|
|
94
97
|
readonly field: "fileHistory";
|
|
95
98
|
readonly word: "disabled";
|
|
96
99
|
readonly message: "fileHistory must be the string 'disabled' when present (the request-level declaration that this run records no file history — no backup of an edited file, and no file restore in the same request; absent = the deployment's setting — there is no 'enabled' spelling)";
|
|
100
|
+
}, {
|
|
101
|
+
readonly field: "projectMemory";
|
|
102
|
+
readonly word: "disabled";
|
|
103
|
+
readonly message: "projectMemory must be the string 'disabled' when present (the request-level declaration that this run reads none of the deployment's project context — no project instruction files and no project layer; absent = the deployment's project context as usual — there is no 'on' spelling)";
|
|
97
104
|
}];
|
|
98
105
|
/** 一次值闭集裁决的产物:出问题的键名(机读)+ 一句 wire 文案。 */
|
|
99
106
|
export interface SingleMemberOffFieldIssue {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const MEMORY_CAPTURE_SPELLING_MESSAGE = "memoryCapture must be the string 'off' when present (the session-level memory-capture opt-out declaration; absent = capture as usual — there is no 'on' spelling)";
|
|
2
2
|
export const MEMORY_OFF_SPELLING_MESSAGE = "memory must be the string 'off' when present (the request-level declaration that this run mounts no memory face at all; absent = memory as usual — there is no 'on' spelling; to keep memory mounted but stop this session's content from entering long-term memory, send memoryCapture: 'off' instead)";
|
|
3
3
|
export const FILE_HISTORY_OFF_SPELLING_MESSAGE = "fileHistory must be the string 'disabled' when present (the request-level declaration that this run records no file history — no backup of an edited file, and no file restore in the same request; absent = the deployment's setting — there is no 'enabled' spelling)";
|
|
4
|
+
export const PROJECT_MEMORY_OFF_SPELLING_MESSAGE = "projectMemory must be the string 'disabled' when present (the request-level declaration that this run reads none of the deployment's project context — no project instruction files and no project layer; absent = the deployment's project context as usual — there is no 'on' spelling)";
|
|
4
5
|
export const FILE_HISTORY_DISABLED_NO_RESTORE = "fileHistory: 'disabled' cannot ride with a file restore (restoreFiles, rewindFilesTo, or the retired rewindFiles) — the request turns this run's file history off and asks to restore files from it in the same breath; the engine would refuse it (rewind.capture_disabled) only after the session had already been branched at resumeAt, which it does not undo, so it is refused here, before any side effect. Drop fileHistory to restore, or drop the restore to run without file history";
|
|
5
6
|
export function fileHistoryRestoreConflict(body) {
|
|
6
7
|
return body.fileHistory === "disabled" && fileHistoryRestoreKeysInBody(body).length > 0;
|
|
@@ -19,6 +20,7 @@ const SINGLE_MEMBER_OFF_FIELDS = [
|
|
|
19
20
|
{ field: "memoryCapture", word: "off", message: MEMORY_CAPTURE_SPELLING_MESSAGE },
|
|
20
21
|
{ field: "memory", word: "off", message: MEMORY_OFF_SPELLING_MESSAGE },
|
|
21
22
|
{ field: "fileHistory", word: "disabled", message: FILE_HISTORY_OFF_SPELLING_MESSAGE },
|
|
23
|
+
{ field: "projectMemory", word: "disabled", message: PROJECT_MEMORY_OFF_SPELLING_MESSAGE },
|
|
22
24
|
];
|
|
23
25
|
export function singleMemberOffFieldIssue(raw) {
|
|
24
26
|
if (raw === null || raw === undefined || typeof raw !== "object" || Array.isArray(raw))
|
|
@@ -28,9 +28,11 @@ export interface RoutingContext {
|
|
|
28
28
|
/** The mounted tools can EGRESS / take IRREVERSIBLE EXTERNAL actions that ESCAPE any sandbox (git push, curl,
|
|
29
29
|
* a real-target deploy). Egress harm is real even inside an isolated sandbox. */
|
|
30
30
|
canEgress: boolean;
|
|
31
|
-
/** The execution env
|
|
32
|
-
*
|
|
33
|
-
|
|
31
|
+
/** The execution env isolates side effects at the VM level (a separate kernel: e2b microVM, k8s on Kata/gVisor; torn
|
|
32
|
+
* down after the task) — vs a shared-kernel container or a real `host`/`ssh` machine where write/exec harm is real.
|
|
33
|
+
* [ref]: NOT the OS-level `executionLane.isolated` (a runc container counts there) — the deployment-shape row
|
|
34
|
+
* `vmIsolatedHands` (`deployment-shape.ts`) answers this one. */
|
|
35
|
+
vmIsolatedExecEnv: boolean;
|
|
34
36
|
/** The task delegates / fans out / is long-horizon (the leader/team path, or a long wall-clock) ⇒ the (b)
|
|
35
37
|
* goal-keeping + ask-aggregation value applies. */
|
|
36
38
|
delegatedOrLongHorizon: boolean;
|
|
@@ -47,7 +49,7 @@ export declare function deriveRoutingSignals(ctx: RoutingContext): RoutingSignal
|
|
|
47
49
|
* Service-facing convenience: map a /v1/tasks task's DETERMINISTIC facts → a routing decision (the service signal
|
|
48
50
|
* derivation + {@link deriveRoutingSignals} + {@link routeOrchestration} in one tested call; main.ts's resolveSpec
|
|
49
51
|
* calls this). Signal mapping:
|
|
50
|
-
* - `
|
|
52
|
+
* - `vmIsolatedExecEnv` ⟺ a VM-isolated remote-exec backend (`e2b`/`k8s` Kata) — `ssh`/`host`/`adb` are NOT isolated.
|
|
51
53
|
* - hand tools (write_file/bash) are mounted only when an executionEnv exists AND the autonomy does not clamp the hands
|
|
52
54
|
* read-only (read off {@link autonomyOverrides} — the one place an autonomy word becomes a hands clamp; `plan` is the
|
|
53
55
|
* engine's plan mode, whose hands stay mounted and are gated at call time, so it is not read-only here).
|
|
@@ -55,21 +57,14 @@ export declare function deriveRoutingSignals(ctx: RoutingContext): RoutingSignal
|
|
|
55
57
|
* - `delegatedOrLongHorizon` is false on the single-task path (the (b) value lives on the /v1/leader path).
|
|
56
58
|
*/
|
|
57
59
|
export declare function routeServiceTask(input: {
|
|
58
|
-
/** RESOLVED isolation —
|
|
59
|
-
* plain runc, which is NOT VM-isolated — review HIGH). */
|
|
60
|
-
|
|
60
|
+
/** RESOLVED VM-level isolation — the deployment-shape row `vmIsolatedHands` (NOT a bare provider name: a `k8s` worker
|
|
61
|
+
* can run plain runc, which is NOT VM-isolated — review HIGH). */
|
|
62
|
+
vmIsolatedExecEnv: boolean;
|
|
61
63
|
/** An executionEnv is configured (hand tools are mountable). */
|
|
62
64
|
hasExecutionEnv: boolean;
|
|
63
65
|
/** The resolved autonomy for the task. */
|
|
64
66
|
autonomy?: Autonomy;
|
|
65
67
|
}): RoutingDecision;
|
|
66
|
-
/**
|
|
67
|
-
* Resolve whether a task's execution env STRONGLY isolates side effects (a VM/kernel boundary the sandbox tears
|
|
68
|
-
* down). FAIL-CLOSED (review HIGH): a `k8s` backend is isolated ONLY with a VM-isolation `runtimeClass`
|
|
69
|
-
* (kata-x or gvisor) — a runc downgrade (`runtimeClass: ""` / `runc` / unknown) is NOT isolated (shared kernel,
|
|
70
|
-
* container escape). `e2b` is a Firecracker microVM (isolated). `host`/`ssh`/`adb` and anything unknown ⇒ NOT isolated.
|
|
71
|
-
*/
|
|
72
|
-
export declare function isIsolatedExecEnv(provider?: string, runtimeClass?: string): boolean;
|
|
73
68
|
/**
|
|
74
69
|
* The TaskSpec overrides for the SUP prevention posture (mode=supervisor). Applied via `tightenTaskSpec`
|
|
75
70
|
* (tighten-only — composes with the deployment baseline, never loosens):
|
|
@@ -78,11 +73,11 @@ export declare function isIsolatedExecEnv(provider?: string, runtimeClass?: stri
|
|
|
78
73
|
* leaves a non-isolated SUP task able to mutate the real fs via write tools ungated). The worker's existing
|
|
79
74
|
* approval machinery (durable suspend / poll) enforces the `ask` — same precondition as `shellGate:"always"`.
|
|
80
75
|
*
|
|
81
|
-
* 🔴
|
|
76
|
+
* 🔴 [ref](7.106.0,[ref]):这些 ask 是**部署**(运维开的 `ROUTER_ENABLED` 路由)写下的门 ⇒ 盖 core 的部署出身位
|
|
82
77
|
* `authoredBy:"deployment"`,经**唯一**盖位函数(`operator-ask.ts` 的 `withDeploymentAuthorship`,经 `operatorAlwaysHumanAsk`
|
|
83
78
|
* 取用 —— 治理层 ask、`APPROVAL_NEVER_AUTO` / 预算耗尽 ask 同一只)。修前:写工具的 ask 只自报 `matchedAskRule`(非强制卡),
|
|
84
79
|
* shellGate always 的 shell ask 是 core 自铸的、没有出身位 ⇒ 卡上只剩单个强制词(`operator_always`;读边界探针命中时是
|
|
85
|
-
* `probe_mandate`,它把 always 藏在后面)⇒ bypass 下壳按那一个词放行(cli
|
|
80
|
+
* `probe_mandate`,它把 always 藏在后面)⇒ bypass 下壳按那一个词放行(cli [ref] 的规则面)。盖了之后 core 判 `mandated`、
|
|
86
81
|
* 不铸 `mandate` 词(表外的门)⇒ 活卡与 park 行两腿都读成「另有门在」,壳出卡。
|
|
87
82
|
* shell 那一问的出身只能由**策略的** ask 带进去(core 的 shell 座铸的 ask 没有出身位的写口)⇒ 策略对 shell 工具也问一次,
|
|
88
83
|
* core 把它与 shellGate always 折成同一只 ask(不是两问)。
|
|
@@ -11,7 +11,7 @@ export function routeOrchestration(s) {
|
|
|
11
11
|
}
|
|
12
12
|
export function deriveRoutingSignals(ctx) {
|
|
13
13
|
const readOnly = ctx.autonomy === "read-only";
|
|
14
|
-
const dangerousCapability = !readOnly && (ctx.canEgress || (ctx.canWriteOrExec && !ctx.
|
|
14
|
+
const dangerousCapability = !readOnly && (ctx.canEgress || (ctx.canWriteOrExec && !ctx.vmIsolatedExecEnv));
|
|
15
15
|
return {
|
|
16
16
|
dangerousCapability,
|
|
17
17
|
needsGoalKeeping: ctx.delegatedOrLongHorizon,
|
|
@@ -23,20 +23,10 @@ export function routeServiceTask(input) {
|
|
|
23
23
|
...(input.autonomy ? { autonomy: input.autonomy } : {}),
|
|
24
24
|
canWriteOrExec: input.hasExecutionEnv && !readOnlyHands,
|
|
25
25
|
canEgress: false,
|
|
26
|
-
|
|
26
|
+
vmIsolatedExecEnv: input.vmIsolatedExecEnv,
|
|
27
27
|
delegatedOrLongHorizon: false,
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
const VM_ISOLATION_CLASSES = new Set(["kata", "kata-qemu", "kata-clh", "kata-fc", "gvisor", "runsc"]);
|
|
31
|
-
export function isIsolatedExecEnv(provider, runtimeClass) {
|
|
32
|
-
if (provider === "e2b")
|
|
33
|
-
return true;
|
|
34
|
-
if (provider === "k8s") {
|
|
35
|
-
const rc = (runtimeClass ?? "").trim().toLowerCase();
|
|
36
|
-
return rc.startsWith("kata") || VM_ISOLATION_CLASSES.has(rc);
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
30
|
const WRITE_HAND_TOOLS = new Set(["Edit", "Write", "NotebookEdit"]);
|
|
41
31
|
const SHELL_TOOLS = new Set(COARSE_SHELL_TOOLS);
|
|
42
32
|
export function supPostureOverrides() {
|