@sema-agent/server 7.134.0 → 7.135.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 +134 -0
- package/USAGE.md +98 -30
- 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 +62 -150
- package/dist/approval-card.js +33 -51
- package/dist/approval-content-kind.d.ts +22 -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 +1 -1
- 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/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/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 +28 -24
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +3 -2
- 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-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stores.js +2 -1
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +5 -10
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- 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 +10 -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 +26 -25
- package/dist/capability-facts.js +14 -16
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- 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-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- 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/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 +23 -11
- package/dist/file-history-disclosure.js +7 -12
- 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 +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +36 -18
- 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 +39 -13
- package/dist/http/checkpoint-ctx.js +74 -35
- package/dist/http/dispatch.d.ts +3 -3
- 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 +7 -7
- package/dist/http/resume-ctx-read.js +1 -1
- 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 -5
- package/dist/http/routes/approvals-assistant.js +55 -15
- 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 +22 -10
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +73 -44
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +30 -44
- 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 +28 -21
- 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-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/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 +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- 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 +16 -15
- package/dist/parked-decide.js +5 -4
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- 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 +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -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/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +44 -66
- package/dist/plugins/checkpoint-store-sql.js +55 -102
- 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 +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- 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 +3 -4
- 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 +66 -40
- package/dist/plugins/one-time-migrations.js +115 -34
- 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 +8 -8
- 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/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/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -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/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 +9 -2
- 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 +19 -4
- 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-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- 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-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +3 -3
- 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 +52 -35
- package/dist/session-incarnation.js +23 -8
- 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-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -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 +3 -1
- package/dist/task-a2a.js +34 -2
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +12 -8
- package/dist/task-mcp.js +19 -4
- 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 +143 -197
- package/dist/tool-approval.js +13 -28
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +12 -7
- 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 +41 -63
- 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 +44 -30
- package/dist/trace/redact.js +191 -89
- package/dist/trace/self-minted-wire.d.ts +35 -14
- package/dist/trace/self-minted-wire.js +8 -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.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- 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 +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +2 -1
- package/scripts/drain-check.mysql.sql +4 -2
- package/scripts/drain-check.pg.sql +4 -2
- package/skills/loop.md +1 -1
- 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 这一拍还没到货(它有自己的换席通告)。
|
|
@@ -32,7 +32,7 @@ declare const TASK_BODY_SCENARIO_KEYS: readonly ["repo"];
|
|
|
32
32
|
export type ScenarioBodyKey = (typeof TASK_BODY_SCENARIO_KEYS)[number];
|
|
33
33
|
/** 剥掉索引签名,只留**具名**键 —— `TaskRequestBody` 上那条 `[k: string]: unknown` 会让
|
|
34
34
|
* `keyof` 退化成 `string`,双向门就永远恒真(零判别力)。
|
|
35
|
-
* 🔴 **导出**(
|
|
35
|
+
* 🔴 **导出**([ref]):姊妹门 `request-value-closure.ts` 的双向钉要同一个剥法 —— 抄第二份 = 两处哪天
|
|
36
36
|
* 分岔(一边看得见索引签名、一边看不见)谁都发现不了,而两边的判别力都建立在「剥干净了」这句话上。 */
|
|
37
37
|
export type NamedKeysOf<T> = {
|
|
38
38
|
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
@@ -23,7 +23,7 @@ const TASK_BODY_DECLARED_KEYS = [
|
|
|
23
23
|
"excludeAllTools", "excludeTools", "fileHistory",
|
|
24
24
|
"finalVerification", "forwardSubagentEvents", "images", "inheritEnv", "interactiveTools", "jobId", "limits", "maxCostUsd",
|
|
25
25
|
"maxTokens", "mcpServers", "memory", "memoryCapture", "memoryWrite", "model", "objective", "oneShot", "outputRetries", "outputStyle",
|
|
26
|
-
"outputSchema", "permissionMode", "projectId", "promptProfile", "reasoningEffort", "requireExistingSession",
|
|
26
|
+
"outputSchema", "permissionMode", "projectId", "projectMemory", "promptProfile", "reasoningEffort", "requireExistingSession",
|
|
27
27
|
"resilience", "restoreFiles", "resumeAt", "resumeAtMode", "retainBackgroundProcesses", "retainSubagentSessions",
|
|
28
28
|
"rewindFiles", "rewindFilesTo", "sandboxImageProfile", "scenario", "scratchpadDir", "selfOrchestration",
|
|
29
29
|
"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() {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* ① **形**({@link ruleEntryListShapeOk}):字符串数组。引擎逐条迭代;一个裸字符串会被逐字符读成几条(deny 侧 = 意图静默落空)。
|
|
10
10
|
* 本谓词不带条数帽(引擎的 `screenAllowedToolsValue` 只判形);条数帽是另一只函数 {@link allowLayerEntryCountIssue}(`MAX_ALLOW_LAYER_ENTRIES`,
|
|
11
11
|
* 请求 allow 桶、技能两只清单、运维表四张表同一只、同一句)。
|
|
12
|
-
* ② (7.116.0–7.122.x 的「引擎读不到的一形」—— 工具段为空的协议名 `mcp__srv__` 四张表都拒 —— 随 core 7.48.0
|
|
12
|
+
* ② (7.116.0–7.122.x 的「引擎读不到的一形」—— 工具段为空的协议名 `mcp__srv__` 四张表都拒 —— 随 core 7.48.0 [ref] 退役:引擎判官给它判词
|
|
13
13
|
* `unmintable_segment`,条目由下面 ③ 读成 `tool_name`,与对端段铸不出的名字同一条路。)
|
|
14
14
|
* ③ **引擎读成空的条目**({@link inertRuleEntriesOf},判据 = 引擎包根 `compileAllowList(entries, behavior, 名册)`;原因词是引擎的 `ALLOW_ENTRY_INERT_REASONS`)。
|
|
15
15
|
* 条目的工具名也过引擎判官:退役名 / 无前缀短名 / 对端段或工具段铸不出、为空读成 `tool_name`,带判词与 1:1 现名;名册里有那只工具、条目只差大小写 ⇒ `near_miss`(`BASH` ⇒ 现名 `Bash`)。
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
* 近似名 · 退役名 · 文法读不出 · 不带内容形的工具带内容;**放行侧**(读成空 = 想放的什么也没放:`settings.permissions.allow`、根 / 子代 `allowTools`、技能 `allowedTools`)**只拒近似名**
|
|
20
20
|
* ({@link allowSideReadsAsNothing}):近似名现名唯一、确定是笔误;退役名 / 内容形 / 文法读不出 / 协议名对端段通配照 7.130.0 受理、交引擎既有通告(其中选择器清单 `allowTools` 里**有后继**的退役名〔`Task` ⇒ `Agent`、`bash` ⇒ `Bash`〕core 7.52.0 起由引擎开跑前拒,不在本仓拒面;规则表上的退役名引擎照旧告运维 ——
|
|
21
21
|
* 壳转投的 CC 用户 settings 里这些极常见,尤其内容形里的 `$VAR`(`Bash(echo $HOME)`)读成 `grammar`,拒了 = 每次提交 400)。运维的 `APPROVAL_GRANT` 是运维自己的配置:任何读成空都拒启(写错了当场改)。
|
|
22
|
-
* 技能拒侧那一拒与引擎
|
|
22
|
+
* 技能拒侧那一拒与引擎 [ref](core 7.43.0:那只技能不激活)是同一件事的两处 —— 7.118.0 重估过、本版**不退**:本仓的续跑腿把引擎的
|
|
23
23
|
* `checkpoint.config_refused`(`config.skill_deny_unreadable`)答得不一(资源停车续跑腿 500、`/decide` 先结了卡、`/wake` 先铸了 run 行),先统一那一层再退
|
|
24
24
|
* (重估读数与退役条件在下面 {@link skillDenyInertEntryOf} 头注)。
|
|
25
25
|
* ④ **工具名选择器清单**(请求顶层 `allowTools` / `excludeTools`、子代定义的 `allowTools` / `denyTools`;引擎的可用性选择器,**不是**规则条目表):读成空的条目在受理口**开跑前拒并点名现名**
|
|
26
26
|
* (拒面按 ③ 的方向分),拒句点名有界({@link MAX_NAMED_INERT_ENTRIES} 条 + 计数),清单先过条数帽({@link inertToolListEntryOf})。
|
|
27
27
|
* **真未知名**(拼写合法、没有近似也没有退役对应 —— 懒挂载的合法形,例如一台之后才连上的 MCP 服务器的工具)不是读成空:原样保留、运维行告知一次,不拒。
|
|
28
28
|
* 选择器读一条条目 = 引擎 `judgeToolNameList` 的读法({@link selectorEntryName}):先取工具名那一段再只判名字(限制侧 `Tool(content)` ⇒ 整只工具,内容里写什么都不读;放行侧内容形引擎告「什么也不授」,受理口不拒);
|
|
29
|
-
* `*`
|
|
29
|
+
* `*` 在放行侧是「本层不设名单」、在限制侧读成空;限制侧整个协议的名字 `mcp__*` / `mcp__*__*` / `a2a__*` 合法 —— 那是引擎条目读法的读数(core 7.55.0 [ref]:
|
|
30
|
+
* `compileAllowList(…, "deny", 名册)` 把它们读成这一协议的每一只工具),本仓不另写豁免。
|
|
30
31
|
* ⑤ **机读位**:拒体的码与句子是第一处命中的清单的(句子冻结),体另带这一遍判下来的**全部**读成空的条目(`entry-problems.ts` 的 `detail.problems`,{@link inertToolListEntryOf} 铸);
|
|
31
32
|
* 放行侧选择器清单里受理口没拒、却什么也不放的条目随受理应答的 `warnings` 交回({@link allowSelectorWarningsOf})—— 两处读同一次条目读法({@link selectorReadings}),不另判。
|
|
32
33
|
*/
|
|
@@ -42,7 +43,7 @@ export declare const ruleEntryListShapeOk: (v: unknown) => v is readonly string[
|
|
|
42
43
|
* 与技能授予表的 `hold` 都对已有条目线性查重 ⇒ 整表平方级、同步执行;core 7.42.0 上 1 万条约 2 s、2 万条约 6 s,本仓亲测)。不设帽 = 一份
|
|
43
44
|
* 8 MiB 以内的请求体能把整个进程的事件循环卡住几十秒。与 deny / ask 两桶的帽(`permission-rule-list.ts` `MAX_PERMISSION_RULES_PER_LIST`,
|
|
44
45
|
* 编译口的整表帽)是两件事、两个名字,数字恰好相同。
|
|
45
|
-
* 7.118.0 重估(core 7.43.0
|
|
46
|
+
* 7.118.0 重估(core 7.43.0 [ref] 把播种改成集合查重,本仓同一只探针亲测 `AllowEntryTable.seed`:7.42.1 上 1 千条 127 ms、1 万条 4.9 s;7.44.0 上 1 千条 8 ms、
|
|
46
47
|
* 1 万条 160 ms、2 万条 226 ms、10 万条 1.08 s —— 线性了,但仍是同步工作,8 MiB 的体装得下几十万条)⇒ 帽留着、数不动:理由由「平方级」换成「线性但同步、
|
|
47
48
|
* 没有真实用法需要上千条」。抬不抬这个数是产品判断,不随提货改。
|
|
48
49
|
*/
|
|
@@ -131,7 +132,7 @@ export type ToolListLayer = keyof typeof TOOL_LIST_FACES;
|
|
|
131
132
|
/**
|
|
132
133
|
* 请求体 `settings.permissions.deny` / `ask`(规则编译器读的收紧表)所在的层 —— **不在** {@link toolListsOf} 的扫描里:它们的判与句子的唯一铸点在 `config.ts` 的
|
|
133
134
|
* `unmatchableToolNamesRefusal`(经 `task-settings.ts` 的 `rulePolicyBucketsRefusal`,单表桶序;拒点是 `applyTaskSettings`,422),存体预判(`http/stored-body-replay.ts`)调同一只函数(home 同源于部署配置),把命中装成本型。
|
|
134
|
-
* 层名进这个联合只为让命中能带坐标进 409 体与运维日志。
|
|
135
|
+
* 层名进这个联合只为让命中能带坐标进 409 体与运维日志。[ref] 起「只收紧」座位族的四座(`tighten-only-seats.ts`,坐标由座位表派生)同走这条路:座位门命中(形 / 超帽 / 条目)与 `permissions.neverAuto` 的名字层。
|
|
135
136
|
*/
|
|
136
137
|
export type RulePolicyLayer = "settings.permissions.deny" | "settings.permissions.ask" | TightenOnlySeatField;
|
|
137
138
|
/** 一份提交体里第一处「工具名清单里有引擎读成空的条目」:在哪一层、哪个方向、拒码、拒句(超帽时另带机读字段,同 `settings.permissions.*` 桶超帽的形)。 */
|
|
@@ -162,7 +163,7 @@ export declare function skillToolListsOverCap(skill: unknown, at: string, scope:
|
|
|
162
163
|
* 本函数单独导出是给随包排空脚本:那条判据(`skill-deny-inert`)只数技能这两层,SQL 车道的孪生也只看技能的清单。
|
|
163
164
|
*
|
|
164
165
|
* 判据就是引擎的读法({@link inertRuleEntriesOf};7.118.0 起条目名也过引擎判官,退役名 / 对端段铸不出读成 `tool_name` —— 技能清单的名字层在受理口不再另判)。
|
|
165
|
-
* 7.118.0 重估(core 7.43.0
|
|
166
|
+
* 7.118.0 重估(core 7.43.0 [ref] 到货:读成空的拒侧条目让那只技能不激活)—— **本版不退**。实测(本判退掉之后跑同一批夹具):引擎的拒到本仓各续跑腿的
|
|
166
167
|
* 答法不一 —— 资源停车续跑腿把 `checkpoint.config_refused` 答成 500 `internal.error`;工具审批 `/decide` 在引擎拒之前已把卡结掉;`/wake` 在引擎拒之前已铸
|
|
167
168
|
* run 行;子代 `agents[].skills[]` 不在引擎的认领前屏里(续跑放行、技能在调用时被拒)。退役条件:本仓续跑腿对引擎 `checkpoint.config_refused` 的答法
|
|
168
169
|
* 收成一只(拒在认领前、行 / 卡不动、同一个 409)之后,本判与本仓的预判一起退,排空判据随之重估。
|
|
@@ -200,7 +201,7 @@ export interface CallerToolNames {
|
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
202
203
|
* **放行侧选择器清单的受理告知**(根 `allowTools`、子代定义的 `allowTools`)—— 这两张清单没有面向用户的通告通道(规则表与技能的放行清单读成空,引擎有受众 = 用户的通告
|
|
203
|
-
* `permission.allowed_tool_not_granted`;选择器清单上引擎只告运维一行),壳转投的 `.claude/agents` 文件里的 `tools:` 恰落在这两张表上。受理口**不拒**(
|
|
204
|
+
* `permission.allowed_tool_not_granted`;选择器清单上引擎只告运维一行),壳转投的 `.claude/agents` 文件里的 `tools:` 恰落在这两张表上。受理口**不拒**(引擎是这一面的判官,[ref] 起
|
|
204
205
|
* 没有任何工具答应的名字保留、只告),把「这几条什么也不放」作为 `warnings` 随受理应答交回:每条 `{ code, field, entry, reason }`(形的属主 `entry-problems.ts`),`code` = 这张清单被拒时的码。
|
|
205
206
|
* 限制侧不告(`denyTools` / `excludeTools` 的近似名 / 退役名 / 文法读不出已是 400)。
|
|
206
207
|
*
|
package/dist/rule-entry-list.js
CHANGED
|
@@ -18,13 +18,9 @@ export function allowLayerEntryCountIssue(field, list) {
|
|
|
18
18
|
export function inertRuleEntriesOf(list, behavior) {
|
|
19
19
|
return compileAllowList(list, behavior, TOOL_NAME_ROSTER).inert;
|
|
20
20
|
}
|
|
21
|
-
function peerSegmentIsWild(entry) {
|
|
22
|
-
const at = entry.indexOf("__");
|
|
23
|
-
return at >= 0 && (entry.slice(at + 2).split("__")[0] ?? "").includes("*");
|
|
24
|
-
}
|
|
25
21
|
export function inertRuleEntryGuidance(i) {
|
|
26
22
|
const reason = i.reason;
|
|
27
|
-
const write = i.currentName !== undefined
|
|
23
|
+
const write = i.currentName !== undefined ? ` — write ${displayListEntry(i.currentName)}` : "";
|
|
28
24
|
switch (reason) {
|
|
29
25
|
case "tool_name":
|
|
30
26
|
return `the tool name can never match a mounted tool (${i.verdict ?? "stale"})${write}`;
|
|
@@ -33,7 +29,7 @@ export function inertRuleEntryGuidance(i) {
|
|
|
33
29
|
case "wildcard_all":
|
|
34
30
|
return "`*` names no tool (on an allow list it voids the whole list) — name the tools instead";
|
|
35
31
|
case "namespace_wildcard":
|
|
36
|
-
return "a server segment
|
|
32
|
+
return "a server segment takes no partial wildcard (`mcp__git*`) — name the server: mcp__<server> or mcp__<server>__*; a deny or ask list may write mcp__* for every MCP tool";
|
|
37
33
|
case "content_unsupported":
|
|
38
34
|
return "this tool takes no content form here — name the tool itself, or use Bash(<command>) / Bash(<prefix>:*) for a shell command";
|
|
39
35
|
case "grammar":
|
|
@@ -75,7 +71,6 @@ const REFUSAL_TAIL = {
|
|
|
75
71
|
function selectorEntryName(entry) {
|
|
76
72
|
return entry !== entry.trim() ? entry : parsePermissionRule(entry).toolName;
|
|
77
73
|
}
|
|
78
|
-
const isProtocolWideName = (name) => PROTOCOL_TABLE.some((e) => name === `${e.prefix}*`);
|
|
79
74
|
function selectorInertEntriesOf(list, side) {
|
|
80
75
|
const readings = selectorReadings(list, side);
|
|
81
76
|
return side === "allow" ? readings.filter((i) => allowSideReadsAsNothing(i.reason)) : readings;
|
|
@@ -85,8 +80,6 @@ function selectorReadings(list, side) {
|
|
|
85
80
|
if (entry === "*" && side === "allow")
|
|
86
81
|
return [];
|
|
87
82
|
const name = selectorEntryName(entry);
|
|
88
|
-
if (side === "deny" && isProtocolWideName(name))
|
|
89
|
-
return [];
|
|
90
83
|
return compileAllowList([name], "deny", TOOL_NAME_ROSTER).inert.map((i) => ({ ...i, entry }));
|
|
91
84
|
});
|
|
92
85
|
}
|
package/dist/rules-consent.d.ts
CHANGED
|
@@ -157,7 +157,7 @@ export interface LocalImportRuleKey {
|
|
|
157
157
|
* 🔴 闭集而不是自由文本:客户端要按拒因分流(「这条是你本机的数据坏了」vs「这条规则本身不合法」是
|
|
158
158
|
* 两句不同的话),而自由文本只能被展示、不能被分支。`detail` 才是给人看的那一半。
|
|
159
159
|
*
|
|
160
|
-
* 🔴
|
|
160
|
+
* 🔴 [ref] 起**两条腿共用这一张表**(导入面的逐行预览 + 单步写口的拒):它们判的是同一件事,而判据
|
|
161
161
|
* 本身就是同一个函数({@link screenLocalImportRow})。给写口另起一张同形的表,就是给同一个问题立第二个
|
|
162
162
|
* 说话人 —— 漂的表现会是「同一条规则在一条腿上收、在另一条腿上拒」。写口的**方向**判据不在这张表里:
|
|
163
163
|
* 它在端点上先判、有自己的整句文案,而且判完就把类型收窄掉(`permission-rule-vocab.ts` 的
|
|
@@ -593,7 +593,7 @@ export interface PersistedRuleListing {
|
|
|
593
593
|
*/
|
|
594
594
|
export type RuleBucketRef = string | RuleOwner;
|
|
595
595
|
/**
|
|
596
|
-
*
|
|
596
|
+
* [ref] —— 单步写的结果(闭集三臂)。
|
|
597
597
|
*
|
|
598
598
|
* 🔴 三臂**刻意不塌成布尔**:「落了」「早就有了」「不知道落没落」对调用方是三种不同的处置,而把第三种
|
|
599
599
|
* 折进前两种里的任一边都是编一个结论(猜"成了"会谎报一次没发生的写,猜"没成"会让人以为可以重来)。
|
|
@@ -604,9 +604,9 @@ export type RuleWritten =
|
|
|
604
604
|
* (幂等重写)。两支都带 `row` —— 它是**从店里读出来的**那一行,不是我方按入参拼出来的回声。
|
|
605
605
|
*
|
|
606
606
|
* 🔴 两个词的判别位是「**这次调用有没有写**」(codex 对抗复审 F1,验真后修)。
|
|
607
|
-
*
|
|
607
|
+
* [ref] 时这条口借的是导入面的兑付腿,而那侧的 `deduped` 只说「等价规则此前已站」、**仍然落了一枚新的 dot**
|
|
608
608
|
* ⇒ 那一格必须如实报 `persisted`,否则一个照常重试的客户端会让 `adds` 台账无界增长、桶的 rev 逐次推进
|
|
609
|
-
* (在翻页的治理面全体重列)。**
|
|
609
|
+
* (在翻页的治理面全体重列)。**[ref] 换成 core 的直写接缝之后这条歧义没了**:`addPersistedRule` 的 `no-op`
|
|
610
610
|
* 契约逐字是「等价规则已经在这只桶里活着,**没有铸第二枚 dot**」——与本口 `no-op` 承诺的那句话逐字同一件事,
|
|
611
611
|
* 所以现在两个词与 core 的两个词一一对应,不再需要翻译。 */
|
|
612
612
|
{
|
|
@@ -718,7 +718,7 @@ export interface RuleConsentLane {
|
|
|
718
718
|
scope: RuleScope;
|
|
719
719
|
}): Promise<RemoveResult>;
|
|
720
720
|
/**
|
|
721
|
-
*
|
|
721
|
+
* [ref] 撤销面写半场的**对偶** —— 一条**收紧**规则(deny/ask)的单步写入,无同意仪式往返。
|
|
722
722
|
*
|
|
723
723
|
* 它为什么可以没有仪式,与 `removeRule` 为什么可以没有仪式是**同一条理由**(core
|
|
724
724
|
* `removePersistedRule` 头注逐字:「a host may narrow on a user's behalf, it may not widen」)。放宽
|
|
@@ -726,7 +726,7 @@ export interface RuleConsentLane {
|
|
|
726
726
|
*
|
|
727
727
|
* 🔴 **一行都不自造**:行的 tool/match/command 三格是规则文本的**派生事实**,由 core 的
|
|
728
728
|
* `parseRuleText` 铸;**内容判据**与导入面走**同一个函数**({@link screenLocalImportRow}),于是本口与
|
|
729
|
-
* 导入口对「一条规则能不能进店」永远给同一个答案。**落店**(
|
|
729
|
+
* 导入口对「一条规则能不能进店」永远给同一个答案。**落店**([ref] / core 7.25.0)走 core 的**记录级
|
|
730
730
|
* 直写接缝** `addPersistedRule` —— 一步、无票、core 自己铸 `origin:"user"`、`allow` 在类型上不可拼;
|
|
731
731
|
* 此前借的是导入面的两跳票仪式,代价是出处词恒 `imported-cc` + 每次成功的写白落两行台账。
|
|
732
732
|
*
|
package/dist/rules-consent.js
CHANGED
|
@@ -22,7 +22,7 @@ export declare function buildCancelContext(taskId: string, startedAtMs: number,
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const CANCELLED_CODE = "cancelled";
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* [ref] —— **取消终局的唯一铸点**。三条用户取消腿(sync stream 的断连支与 cancel-verb 支、durable bg 腿)
|
|
26
26
|
* 都从这里出结果,于是「一次取消在账本/wire 上长什么样」只有一份口径。
|
|
27
27
|
*
|
|
28
28
|
* ## 两种到达形,一条规则
|
|
@@ -47,7 +47,7 @@ export declare const CANCELLED_CODE = "cancelled";
|
|
|
47
47
|
* (`cause()` 在场),那是 server 自己的事实。让本函数去嗅 `terminal.message` 的字面就是再造事实
|
|
48
48
|
* —— [ref] 二那次事故的同一个形。
|
|
49
49
|
*
|
|
50
|
-
* ##
|
|
50
|
+
* ## [ref]:成因(`abortCause`)与码、快照**同进同退**
|
|
51
51
|
* `cause` 是**必填**:本函数是 server 铸取消终局的唯一出口,而每一次取消都有一个发起者 ⇒ 「本仓铸的取消终局上恒有
|
|
52
52
|
* `abortCause`」由签名保证,不靠调用方记得。它走与补码、补快照**同一条**空座闸 —— 引擎给的终局不是无码的 failed
|
|
53
53
|
* (与中止赛跑跑完了 / 引擎自带码)⇒ 整只原样返回,成因也不挂(那条终局不是这次中止的结果,挂上就是「完成了却带着取消便签」)。
|
|
@@ -68,11 +68,11 @@ interface CancelMintArgs {
|
|
|
68
68
|
startedAtMs: number;
|
|
69
69
|
/** 合成形的失败文案(引擎给了终局时不用)。 */
|
|
70
70
|
message: string;
|
|
71
|
-
/**
|
|
71
|
+
/** [ref]:这次取消的发起者(本腿 {@link RunAbort} 句柄上登记的那一个;park 中直接终局化的取消动词给 `"cancel_verb"`)。 */
|
|
72
72
|
cause: AbortCause;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* [ref] —— 没有 `done` 可落的取消形在账本上的那一行(`failed`):**从铸好的取消终局投影**,不手抄。
|
|
76
76
|
*
|
|
77
77
|
* 账本 `failed` 行是平面形(`errorMessage` / `errorCode` 顶层),所以成因也在顶层、与 `errorCode` 并列;有 `done` 可落的
|
|
78
78
|
* 那几形,成因随 `done.result` 走(结果本身带它)。两形同一个来源 = 同一只取消终局,不是两处各写一份。
|
|
@@ -84,7 +84,7 @@ export declare function buildCancelledLedgerRow(c: PersistedTaskResult): {
|
|
|
84
84
|
abortCause?: AbortCause;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* [ref] —— 一条 run 腿的**中止句柄**:server 中止这条腿的唯一入口,也是「为什么中止」的唯一登记处。
|
|
88
88
|
*
|
|
89
89
|
* ## 为什么是句柄、不是一张按 taskId 键控的表
|
|
90
90
|
* 修前这件事由 `cancelledViaVerb: Set<taskId>`(「这次是取消动词」一个词)+ 各腿手写的生命周期(登记 / finally 里按身份守卫删 /
|