@sema-agent/server 7.52.0 → 7.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE.md +22 -5
- package/dist/adoption/plan.d.ts +3 -3
- package/dist/adoption/quiesce.d.ts +1 -1
- package/dist/adoption/sql.d.ts +2 -2
- package/dist/adoption/wire.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +18 -18
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-hmac.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +14 -14
- package/dist/approval.d.ts +2 -2
- package/dist/audit.d.ts +4 -4
- package/dist/auth-keys.d.ts +6 -6
- package/dist/bench/l8/artifact.d.ts +6 -1
- package/dist/bench/l8/artifact.js +2 -27
- package/dist/bench/l8/escape.d.ts +3 -3
- package/dist/bench/l8/index.d.ts +1 -1
- package/dist/bench/s1/arms.d.ts +3 -3
- package/dist/bench/s1/oracle.d.ts +2 -2
- package/dist/bench/s1/reviewer.d.ts +1 -1
- package/dist/bench/s1/row.d.ts +5 -5
- package/dist/bench/s1/runner-ctx.d.ts +3 -3
- package/dist/boot/config-center.d.ts +14 -7
- package/dist/boot/config-center.js +2 -0
- package/dist/boot/coordinators.d.ts +4 -4
- package/dist/boot/crash-last.d.ts +1 -1
- package/dist/boot/device-lane.d.ts +3 -3
- package/dist/boot/device-lane.js +2 -0
- package/dist/boot/engine-lease.d.ts +4 -4
- package/dist/boot/governance-seams.d.ts +5 -5
- package/dist/boot/leader.d.ts +5 -5
- package/dist/boot/limit-sync.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +5 -5
- package/dist/boot/memory-consolidation.d.ts +8 -2
- package/dist/boot/memory-consolidation.js +1 -0
- package/dist/boot/org-memory.d.ts +5 -5
- package/dist/boot/parked-revive-gate.d.ts +6 -6
- package/dist/boot/permission-rules-audit.d.ts +2 -2
- package/dist/boot/reapers.d.ts +8 -8
- package/dist/boot/resolve-spec.d.ts +4 -4
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +33 -27
- package/dist/boot/runner-deps.js +2 -1
- package/dist/boot/runtime-caps.d.ts +4 -4
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/shutdown.d.ts +10 -10
- package/dist/boot/side-query-lane.d.ts +14 -14
- package/dist/boot/stores.js +5 -0
- package/dist/boot/task-list-lane.d.ts +3 -3
- package/dist/boot/webfetch-summarize-lane.d.ts +9 -9
- package/dist/boot/workflow-orchestration.d.ts +1 -1
- package/dist/bounded-session-map.d.ts +1 -1
- package/dist/brain.d.ts +3 -3
- package/dist/budget.d.ts +3 -3
- package/dist/canonical-json.d.ts +53 -0
- package/dist/canonical-json.js +48 -0
- package/dist/capabilities/center-prompts.d.ts +13 -13
- package/dist/capabilities/collab-workflows.d.ts +1 -1
- package/dist/capabilities/hands-lane.d.ts +4 -4
- package/dist/capabilities/memory-notice.d.ts +4 -4
- package/dist/capabilities/prompt.d.ts +2 -2
- package/dist/capabilities/sandbox-file-send.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +16 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/team.d.ts +3 -3
- package/dist/capabilities/tool-defer.d.ts +6 -6
- package/dist/config-catalog.d.ts +139 -0
- package/dist/config-catalog.js +556 -0
- package/dist/config-center/apply-effective.d.ts +20 -7
- package/dist/config-center/apply-effective.js +45 -0
- package/dist/config-center/apply-ledger.d.ts +6 -6
- package/dist/config-center/facade.d.ts +3 -2
- package/dist/config-center/hot-keys-registry.d.ts +2 -2
- package/dist/config-center/http-client.d.ts +5 -5
- package/dist/config-center/mcp-revocation.d.ts +6 -4
- package/dist/config-center/mcp-revocation.js +2 -12
- package/dist/config-center/restart-signal.d.ts +11 -1
- package/dist/config-center/restart-signal.js +1 -1
- package/dist/config-center/skills-mcp.d.ts +2 -2
- package/dist/config-center/stage-limits.d.ts +3 -3
- package/dist/config-center/types.d.ts +23 -19
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-provider.d.ts +2 -2
- package/dist/config-types.d.ts +157 -134
- package/dist/config.d.ts +32 -24
- package/dist/config.js +48 -6
- package/dist/degenerate-instrument.d.ts +1 -1
- package/dist/deployment-governance.d.ts +13 -13
- package/dist/device-store.d.ts +2 -2
- package/dist/device-ws-hub.d.ts +6 -4
- package/dist/device-ws-hub.js +9 -3
- package/dist/device-ws-protocol.d.ts +3 -3
- package/dist/digest-form.d.ts +1 -1
- package/dist/elicitation.d.ts +1 -1
- package/dist/env-facts.d.ts +7 -7
- package/dist/execution-lane-caps.d.ts +5 -5
- package/dist/fleet/fleet-bus.d.ts +56 -53
- package/dist/fleet/fleet-reconciler.d.ts +2 -2
- package/dist/fleet/fleet-terminal-window.d.ts +1 -1
- package/dist/fleet/subagent-tail-bus.d.ts +3 -3
- package/dist/fleet-client.d.ts +3 -3
- package/dist/fleet-lease.d.ts +1 -1
- package/dist/hooks/branch-transcript.d.ts +2 -2
- package/dist/hooks/cc-agent-hook-prompt.d.ts +2 -2
- package/dist/hooks/cc-stop-prompt.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +1 -1
- package/dist/hooks/hook-runner.d.ts +12 -5
- package/dist/http/active-run-conflict.d.ts +31 -33
- package/dist/http/active-run-conflict.js +4 -2
- package/dist/http/route-ctx.d.ts +23 -21
- package/dist/http/routes/a2a-serve.d.ts +2 -2
- package/dist/http/routes/admin-config-refresh.d.ts +1 -1
- package/dist/http/routes/admin-drain.d.ts +4 -4
- package/dist/http/routes/admin-memory-optout.d.ts +5 -5
- package/dist/http/routes/adoption.d.ts +1 -1
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +6 -6
- package/dist/http/routes/approvals-assistant.js +4 -1
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +1 -0
- package/dist/http/routes/config-catalog.d.ts +28 -0
- package/dist/http/routes/config-catalog.js +42 -0
- package/dist/http/routes/diagnostics.d.ts +2 -2
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/images.d.ts +1 -1
- package/dist/http/routes/leader.d.ts +1 -1
- package/dist/http/routes/memory-bundle.d.ts +4 -4
- package/dist/http/routes/memory-bundle.js +2 -3
- package/dist/http/routes/memory-compliance.d.ts +7 -7
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/memory-origin.d.ts +9 -9
- package/dist/http/routes/memory-policy.d.ts +3 -3
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/observability.d.ts +1 -1
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/rules.d.ts +3 -3
- package/dist/http/routes/run-memory-capture.d.ts +1 -1
- package/dist/http/routes/runs.d.ts +3 -3
- package/dist/http/routes/runs.js +12 -17
- package/dist/http/routes/session-sync.d.ts +2 -2
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions.d.ts +9 -1
- package/dist/http/routes/sessions.js +61 -1
- package/dist/http/routes/shared-memory.d.ts +1 -1
- package/dist/http/routes/side-query.d.ts +1 -1
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +1 -1
- package/dist/http/run-meta.d.ts +1 -1
- package/dist/http/send.d.ts +6 -6
- package/dist/http/server.d.ts +84 -67
- package/dist/http/server.js +25 -12
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +6 -6
- package/dist/http/verify-rounds.d.ts +3 -3
- package/dist/http/wire-gate.d.ts +2 -2
- package/dist/http/wire-types.d.ts +38 -38
- package/dist/key-resolver.d.ts +1 -1
- package/dist/leader/diffout.d.ts +2 -2
- package/dist/leader/diffup.d.ts +1 -1
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +6 -6
- package/dist/leader/grader-env-factory.d.ts +1 -1
- package/dist/leader/leader.d.ts +12 -12
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/planner.d.ts +5 -5
- package/dist/leader/repair-oracle.d.ts +1 -1
- package/dist/leader/wire.d.ts +9 -9
- package/dist/lsp/manager.d.ts +2 -2
- package/dist/lsp/types.d.ts +1 -1
- package/dist/lsp/ws-transport.d.ts +2 -2
- package/dist/main.js +13 -2
- package/dist/mcp-content-origin.d.ts +1 -1
- package/dist/memory-bundle-engine.d.ts +5 -3
- package/dist/memory-bundle-engine.js +2 -2
- package/dist/memory-operator-faces.d.ts +41 -11
- package/dist/memory-operator-faces.js +12 -0
- package/dist/memory-origin-fence.d.ts +20 -35
- package/dist/memory-origin-fence.js +41 -1
- package/dist/memory-posture.d.ts +6 -6
- package/dist/memory-scope.d.ts +7 -7
- package/dist/model-select.d.ts +5 -5
- package/dist/observability/cost-quota.d.ts +6 -6
- package/dist/observability/cost-taxonomy.d.ts +2 -2
- package/dist/observability/fail-open.d.ts +1 -5
- package/dist/observability/fail-open.js +0 -4
- package/dist/observability/metrics.d.ts +1 -1
- package/dist/observability/prompt-manifest.d.ts +8 -8
- package/dist/observability/rate-limit.d.ts +2 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +6 -6
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +1 -1
- package/dist/orchestration/subagent-steer.d.ts +3 -3
- package/dist/orchestration/workflow-agent-steer.d.ts +1 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +6 -6
- package/dist/orchestration/workflow-notify-journal.d.ts +6 -6
- package/dist/parent-watch.d.ts +1 -1
- package/dist/parked-decide.d.ts +11 -11
- package/dist/plan-cache-probe.d.ts +1 -1
- package/dist/plugins/adoption-log-sql.d.ts +4 -4
- package/dist/plugins/approval-ask-store-memory.d.ts +1 -1
- package/dist/plugins/approval-ask-store-memory.js +12 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +39 -17
- package/dist/plugins/approval-ask-store-sql.js +23 -6
- package/dist/plugins/approval-payload-fingerprint.d.ts +23 -0
- package/dist/plugins/approval-payload-fingerprint.js +23 -0
- package/dist/plugins/background-agent-store-sql.d.ts +8 -8
- package/dist/plugins/background-shell-support.d.ts +12 -12
- package/dist/plugins/blob-backend.d.ts +3 -3
- package/dist/plugins/breaker-state-sql.d.ts +3 -3
- package/dist/plugins/caching-session-store.d.ts +6 -6
- package/dist/plugins/checkpoint-store-sql.d.ts +162 -66
- package/dist/plugins/checkpoint-store-sql.js +76 -33
- package/dist/plugins/device-store-sql.d.ts +4 -3
- package/dist/plugins/e2b-orphan-reclaim.d.ts +3 -3
- package/dist/plugins/file-history-store-sql.d.ts +9 -8
- package/dist/plugins/file-run-store.d.ts +27 -27
- package/dist/plugins/fork-routing-session-store.d.ts +9 -9
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +2 -2
- package/dist/plugins/k8s-bg-scripts.d.ts +1 -1
- package/dist/plugins/k8s-exec-protocol.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +26 -17
- package/dist/plugins/local-checkpoint-store.js +21 -11
- package/dist/plugins/local-session-store.d.ts +5 -5
- package/dist/plugins/mailbox-store-sql.d.ts +6 -6
- package/dist/plugins/memory-embedder-fingerprint.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-engine-tidb.d.ts +1 -1
- package/dist/plugins/memory-key-guards.d.ts +3 -3
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +10 -10
- package/dist/plugins/memory-origin-law.d.ts +13 -13
- package/dist/plugins/memory-run-store.d.ts +12 -12
- package/dist/plugins/outcome-ledger-sql.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -33
- package/dist/plugins/permission-rule-store-sql.js +7 -12
- package/dist/plugins/pg-cost-quota.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -0
- package/dist/plugins/pg-query.d.ts +1 -1
- package/dist/plugins/pg-rate-limiter.d.ts +2 -2
- package/dist/plugins/pg-session-storage.d.ts +9 -9
- package/dist/plugins/remote-env-adb.d.ts +1 -1
- package/dist/plugins/remote-env-device.d.ts +2 -2
- package/dist/plugins/remote-env-e2b.d.ts +11 -11
- package/dist/plugins/remote-env-file-error.d.ts +2 -2
- package/dist/plugins/remote-env-host.d.ts +10 -10
- package/dist/plugins/remote-env-k8s.d.ts +7 -7
- package/dist/plugins/remote-env-local-docker.d.ts +1 -1
- package/dist/plugins/remote-env-ssh.d.ts +9 -9
- package/dist/plugins/remote-scratchpad.d.ts +1 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.d.ts +2 -2
- package/dist/plugins/retention-store-sql.d.ts +11 -11
- package/dist/plugins/roster-store-sql.d.ts +5 -5
- package/dist/plugins/run-store-sql.d.ts +12 -12
- package/dist/plugins/scheduler-support.d.ts +1 -1
- package/dist/plugins/send-user-file.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.d.ts +99 -0
- package/dist/plugins/session-capture-record-store-sql.js +110 -0
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +2 -2
- package/dist/plugins/session-store.d.ts +3 -3
- package/dist/plugins/shared-memory-store-sql.d.ts +5 -5
- package/dist/plugins/sql-driver.d.ts +7 -7
- package/dist/plugins/sql-errors.d.ts +2 -2
- package/dist/plugins/sql-escape.d.ts +1 -1
- package/dist/plugins/sql-row-helpers.d.ts +1 -1
- package/dist/plugins/store-backend.d.ts +32 -19
- package/dist/plugins/store-backend.js +4 -0
- package/dist/plugins/store-contracts.d.ts +9 -9
- package/dist/plugins/task-list-store-sql.d.ts +3 -3
- package/dist/plugins/tidb-cost-quota.d.ts +3 -3
- package/dist/plugins/tidb-pool.js +9 -0
- package/dist/plugins/tidb-rate-limiter.d.ts +2 -2
- package/dist/plugins/tidb-session-storage.d.ts +2 -2
- package/dist/plugins/tidb-session-store.d.ts +11 -11
- package/dist/plugins/tool-result-store-sql.d.ts +8 -8
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +7 -7
- package/dist/plugins/workflow-journal-store-sql.d.ts +6 -6
- package/dist/plugins/workflow-run-store-sql.d.ts +1 -1
- package/dist/plugins/write-behind-counter.d.ts +6 -6
- package/dist/principal-jwt.d.ts +2 -2
- package/dist/project-memory.d.ts +1 -1
- package/dist/prompts-domain-validate.d.ts +8 -8
- package/dist/question.d.ts +3 -3
- package/dist/resource-suspend.d.ts +4 -4
- package/dist/resource-window.d.ts +3 -3
- package/dist/router/route-orchestration.d.ts +1 -1
- package/dist/rules-consent.d.ts +48 -40
- package/dist/run-local.d.ts +5 -5
- package/dist/run-local.js +28 -4
- package/dist/runs.d.ts +19 -19
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +7 -7
- package/dist/security.d.ts +13 -13
- package/dist/session-leaf-bus.d.ts +1 -1
- package/dist/session-sync-content.d.ts +4 -4
- package/dist/session-sync-kernel.d.ts +2 -2
- package/dist/session-sync.d.ts +13 -13
- package/dist/session-titler.d.ts +1 -1
- package/dist/session-watch.d.ts +3 -3
- package/dist/shared-memory-scope-authorizer.d.ts +4 -4
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +20 -20
- package/dist/ssh-host-key.d.ts +5 -5
- package/dist/store-live-probe.d.ts +2 -2
- package/dist/task-cwd.d.ts +11 -11
- package/dist/task-mcp.d.ts +5 -5
- package/dist/task-settings.d.ts +35 -35
- package/dist/task-workflow.d.ts +3 -3
- package/dist/text-bidi.d.ts +1 -1
- package/dist/tool-approval.d.ts +171 -160
- package/dist/tool-approval.js +33 -28
- package/dist/trace/core-keyset-guard.d.ts +21 -7
- package/dist/trace/engine-notice-wire.d.ts +6 -6
- package/dist/trace/injection-tier.d.ts +2 -2
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +7 -7
- package/dist/trace/project.d.ts +35 -30
- package/dist/trace/project.js +9 -0
- package/dist/turn-activity.d.ts +4 -4
- package/dist/usage-analytics.d.ts +1 -1
- package/dist/wall-clock-jump-guard.d.ts +3 -3
- package/package.json +6 -6
package/dist/task-cwd.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare function deviceCwdHonored(config: {
|
|
|
43
43
|
requirePrincipal?: boolean;
|
|
44
44
|
}): boolean;
|
|
45
45
|
/**
|
|
46
|
-
* [
|
|
46
|
+
* [ref]P3a — the OTHER host-semantics lane: provider UNSET = the in-process single-user lane. It has NO shell
|
|
47
47
|
* hands (core prepare-task: no factory/executionEnv ⇒ StubExecutionEnv), so the perSession cwd/env registries
|
|
48
48
|
* have no consumer there — but PROCESS-level consumers (hooks commands, the C4 projectContext local read) still
|
|
49
49
|
* see the engine's own `process.cwd()`/`process.env`. When the shell spawned the engine in the caller's own
|
|
@@ -58,37 +58,37 @@ export declare function inProcessSingleUserLane(config: {
|
|
|
58
58
|
requirePrincipal?: boolean;
|
|
59
59
|
}): boolean;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* [ref](F-1,[ref] 修向 (b')):卡批「不再询问」落盘规则的 **project root** —— 「这次授权是在哪个
|
|
62
62
|
* 工作目录里点的」。取值与既有 cwd 语义同源,不新造坐标系:
|
|
63
63
|
* 1. session 显式注册的 cwd(cwd seam,host lane;与 {@link effectiveHostWorkspace} 第 1 优先级同源)
|
|
64
64
|
* —— **今天唯一真的会命中的那一臂**;⚠️ 它**不含 lane 判据**,lane 语义完全依赖「`perSessionCwd`
|
|
65
65
|
* 只在 `cwdHonored` 为真时被写」这条跨文件外部不变量(写侧唯一入口 boot/resolve-spec.ts)。这是
|
|
66
66
|
* 刻意的单写者惯用法,不是疏漏:在消费端补第二道闸 = 把一条不变量拆给两个属主(同族消费者
|
|
67
|
-
* {@link effectiveHostWorkspace} 形状完全相同)。机器背书 = test/task-cwd.test.ts 的
|
|
68
|
-
* 2. 🔴 **前瞻/防御臂,本仓当前装配下零命中**(
|
|
67
|
+
* {@link effectiveHostWorkspace} 形状完全相同)。机器背书 = test/task-cwd.test.ts 的 [ref] 两格。
|
|
68
|
+
* 2. 🔴 **前瞻/防御臂,本仓当前装配下零命中**([ref],2026-08-19 合并重扫 partial,存活断言):
|
|
69
69
|
* in-process 单用户 lane({@link inProcessSingleUserLane})取引擎自身 `process.cwd()`。它读起来像在
|
|
70
70
|
* 服务一个真部署形,其实到不了 —— 该 lane 的 `remoteExec` 未设 ⇒ boot/execution-env.ts 六条工厂臂全
|
|
71
71
|
* 不命中 ⇒ core 落 `StubExecutionEnv` ⇒ `handsEnabled=false` ⇒ 不挂 Bash ⇒ 未知工具在 agent-loop 走
|
|
72
72
|
* `tool.not_found`(**不进审批座**)⇒ 无 `ruleOffers` ⇒ 本函数在规则车道上根本不被调用;同 lane
|
|
73
73
|
* 第 1 臂也因写侧闸只在 `cwdHonored` 下开而恒空。危害口径按 refuter **降级**:死枝 ≡ 落第 3 臂
|
|
74
|
-
* `undefined` ≡ core global 缺省 ≡
|
|
74
|
+
* `undefined` ≡ core global 缺省 ≡ [ref] 修前行为,**今天零用户可见伤害**,不是「恒不命中」类缺陷。
|
|
75
75
|
* 🚧 **给将来接手的人的红线**:这条 lane 若哪天真接上 hands,root 必须取 `executionEnv.cwd`(core 的
|
|
76
76
|
* `taskRootFinal` 就是它),**不是** `process.cwd()` —— 两者在静态 env 装配形下可以完全不同,照现注
|
|
77
77
|
* 直接接线会铸出一个真的歪 root。真正的本地开箱形(`CONFIG_PROVIDER=local`)被 config 默认成
|
|
78
|
-
* **host** lane,受益的是第 1
|
|
78
|
+
* **host** lane,受益的是第 1 臂;本臂不是「[ref] 的本地形受益臂」。
|
|
79
79
|
* 3. 其余(远程沙箱 / REMOTE_EXEC=host 未注册 / 多租户)⇒ `undefined`:root 在 server 坐标系里
|
|
80
|
-
* 不可知,调用方**不铸 scope**,落 core 的 global 缺省(=
|
|
80
|
+
* 不可知,调用方**不铸 scope**,落 core 的 global 缺省(= [ref] 修前行为,恒不更宽;也绝不铸一个
|
|
81
81
|
* 与规则判定时 cwd 不同坐标系的 root —— 那会静默把「不再询问」变成恒不命中)。
|
|
82
82
|
*
|
|
83
|
-
* 🔴 出口 = `path.resolve(原字节)`,**禁 realpath**(
|
|
83
|
+
* 🔴 出口 = `path.resolve(原字节)`,**禁 realpath**([ref].F-A,2026-08-19 合并重扫 confirmed high):
|
|
84
84
|
* core 判定这条规则时喂进 `scopeCoversCwd` 的 cwd = `executionEnv.cwd` = host env 构造里的
|
|
85
85
|
* `path.resolve(同一条注册原字节)`(remote-env-host.ts),比较是**纯串**(`pathWithinRoot`,零
|
|
86
86
|
* realpath)。初版这里走 realpath(据 core `PersistedAllowRule.scope` JSDoc「root 由构造方
|
|
87
|
-
* canonicalize」)——但 JSDoc 说的是义务、实现行才是事实([
|
|
87
|
+
* canonicalize」)——但 JSDoc 说的是义务、实现行才是事实([ref] 宪法):core 自己喂进匹配的 cwd
|
|
88
88
|
* 恰恰**未** canonicalize,单侧规范化=两坐标系分叉,注册 cwd 含符号链接段时(macOS `/tmp`、
|
|
89
89
|
* `~/work→/mnt/...`)落盘规则**永不命中**,「不再询问」恒失效。正解=root 与判定坐标出自**同一条
|
|
90
90
|
* 串、同一种规范化**;将来 core 若把判定面改 canonicalize,这里必须同批跟(端到端钉在
|
|
91
|
-
* test/task-cwd.test.ts 的
|
|
91
|
+
* test/task-cwd.test.ts 的 [ref].F-A 格,靠真 `scopeCoversCwd` 咬住两侧任何一侧的单独漂移)。
|
|
92
92
|
* `path.resolve` 不抛 ⇒ 初版的 realpath 失败 F 类兜底臂(`rule-scope-root-unresolvable`)随之退役
|
|
93
93
|
* (census 行同批销,fail-open.ts)。
|
|
94
94
|
*/
|
|
@@ -109,7 +109,7 @@ export declare function shellEnvMismatchCount(requested: Record<string, string>,
|
|
|
109
109
|
/** Cap on the number of `--add-dir` entries a caller may attach (bounds a pathological allowlist blast). */
|
|
110
110
|
export declare const MAX_ADDITIONAL_DIRS = 64;
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
112
|
+
* [ref] (CC `--add-dir` parity): validate an untrusted `body.additionalDirectories` — extra host dirs the
|
|
113
113
|
* FILE tools may access beyond the containment root (core canonicalizes each into its allowlist + lists them in the
|
|
114
114
|
* `# Environment` block). Gated identically to {@link cwdHonored}: these are the caller's OWN-machine paths, so they
|
|
115
115
|
* only make sense — and are only safe — on the single-user host lane (on a cloud/container lane a file-tool root is
|
package/dist/task-mcp.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare function mcpInjectionHonored(config: {
|
|
|
39
39
|
}): boolean;
|
|
40
40
|
/**
|
|
41
41
|
* Shape-check the raw `body.mcpServers`. `null` → a non-array (caller error; the route may 400). Otherwise the
|
|
42
|
-
* valid subset + the names of dropped (malformed/over-cap) entries +
|
|
42
|
+
* valid subset + the names of dropped (malformed/over-cap) entries + [ref]'s `badContentOrigin`
|
|
43
43
|
* (**降级**掉的内容出处声明,与 `dropped` 是两回事:那条 server **留着**,丢的只是它的声明)。
|
|
44
44
|
*/
|
|
45
45
|
export declare function validateRequestMcp(raw: unknown): {
|
|
@@ -51,14 +51,14 @@ export declare function validateRequestMcp(raw: unknown): {
|
|
|
51
51
|
}>;
|
|
52
52
|
} | null;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* [ref] 件C §4.3 —— **同步**拒面:部署锁了 `mcp` 而请求仍带 `mcpServers` ⇒ 400 `config.locked_key`。
|
|
55
55
|
*
|
|
56
56
|
* 为什么在这里也拒一次(与 core 的 prepare 门不是「两处裁决」):设计稿把裁决点定在 server 治理层,
|
|
57
57
|
* core 的 preflight 执行的是**同一条**判据的引擎侧终局形。二者语义等价、位置不同 —— 一个请求根本不该
|
|
58
58
|
* 进 core 才发现自己被锁,而消费端拿到一条同步 4xx 比拿到一个跑起来又终态失败的任务可诊断得多。
|
|
59
59
|
*
|
|
60
60
|
* 判据是「请求**占位**」而不是「请求的值合不合法」:锁是两态的,占了就整拒,不静默丢(静默丢正是
|
|
61
|
-
*
|
|
61
|
+
* [ref] §2.3 讲的那种把判决变成探针的形)。键缺席 / 显式 `null` 都不是占位。
|
|
62
62
|
*
|
|
63
63
|
* ⚠️ **不看车道**:多租户腿本来就会忽略 body MCP(`mcpInjectionHonored` 关),但锁在场时忽略是错的
|
|
64
64
|
* 失败方向 —— operator 声明了「本部署不收任务自带 MCP」,那就该说出来,而不是安静地当没看见。
|
|
@@ -69,7 +69,7 @@ export declare function validateRequestMcp(raw: unknown): {
|
|
|
69
69
|
*/
|
|
70
70
|
export declare function assertRequestMcpUnlocked(bodyMcp: unknown, lockedKeys: ReadonlySet<LockedKey>): void;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* [ref](core 5.60.0 提货批件②)—— 请求体里 `mcpServers[].contentOrigin` 的**值域门**,腿首同步拒。
|
|
73
73
|
*
|
|
74
74
|
* ## 先把 core 的硬条款抄下来,因为本腿的全部争议都在它上面
|
|
75
75
|
* `McpServerSpec.contentOrigin` 顶注逐字:「TRUST SOURCE — a DEPLOYMENT-plane key … any assembly layer
|
|
@@ -98,7 +98,7 @@ export declare function assertRequestMcpUnlocked(bodyMcp: unknown, lockedKeys: R
|
|
|
98
98
|
* 与此同时 `checkpoint_ctx` 存的是**原始** `TaskRequestBody`,耐久 resume 逐字重放它,从本门逃出去的
|
|
99
99
|
* `HttpError` 会被 `src/http/server.ts` 折成 `409 resume_blocked_by_policy` ⇒ 一条**升级前** park、body 里
|
|
100
100
|
* 带着当时被静默忽略的坏值的任务,升级后**永久**恢复不了(codex 交叉复审 R1-[high],验真后采纳)。
|
|
101
|
-
* ⇒ 照本仓成文的三处 `opts.leg` 先例(`appendSystemPrompt` 案 / `@model` 名单
|
|
101
|
+
* ⇒ 照本仓成文的三处 `opts.leg` 先例(`appendSystemPrompt` 案 / `@model` 名单 [ref] 终裁 (a) /
|
|
102
102
|
* `compactionModel` 案,都逐字写着「砖死 resume 比降级糟」):fresh fail-loud,resume 降级 + 留声
|
|
103
103
|
* (留声点 = {@link resolveRequestMcp} 的 `mcp_content_class_dropped`)。挂点判据在 `boot/resolve-spec.ts`。
|
|
104
104
|
*
|
package/dist/task-settings.d.ts
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
* Design: `TaskRequest.settings` is a
|
|
9
9
|
* PER-REQUEST ephemeral stamp = the v2-design TASK layer (a single-run override, NOT durable). It folds into THIS
|
|
10
10
|
* spec via {@link tightenTaskSpec} and that is all — it is NEVER written to the durable `SessionPolicyStore` (the
|
|
11
|
-
* operator/principal axis,
|
|
11
|
+
* operator/principal axis, [ref] §E6, a different trust axis + lifecycle). Re-applying on a resume leg is
|
|
12
12
|
* idempotent (the same tighten), so no special resume handling is needed (mirrors runtime-governance).
|
|
13
13
|
*
|
|
14
14
|
* 🔒 SECURITY INVARIANTS (SDK settings.ts §3.3):
|
|
15
15
|
* - permissions are TIGHTEN-ONLY — folded via `tightenTaskSpec` (deny-wins `combinePolicies`); it THROWS on any
|
|
16
16
|
* override that would LOOSEN a stricter base safety field. The client can only ADD denies/asks/handsReadOnly on
|
|
17
17
|
* top of the deployment + operator baseline, never widen it.
|
|
18
|
-
* - permissionMode(轴B #2 注释保鲜,1.254——[
|
|
18
|
+
* - permissionMode(轴B #2 注释保鲜,1.254——[ref]/[ref] 后的真实现):`defaultMode` 收**五**模式
|
|
19
19
|
* (default | acceptEdits | plan | bypassPermissions | auto),bypass/auto 被 HONOR 为 gate-shape 选择
|
|
20
20
|
* ——但深层不变量未变:bypass=「不加 ask 门」,恒不越部署基线(tightenTaskSpec deny-wins,基线 deny/
|
|
21
|
-
* ask 照压);精化语义见 :2xx 行内注释。旧头注的「NEVER honored/三模式白名单」是 pre-[
|
|
21
|
+
* ask 照压);精化语义见 :2xx 行内注释。旧头注的「NEVER honored/三模式白名单」是 pre-[ref] 拍照。
|
|
22
22
|
*
|
|
23
23
|
* 🔴 SYNC WITH sema-cli(壳仓)的 `src/sema/settings/seam.ts`: the permissions→toolPolicy + §6.4 permissionMode derive MIRRORS
|
|
24
24
|
* the shell's LOCAL-Runner resolver — both compose the SAME core primitives (`createAllowDenyPolicy` /
|
|
@@ -37,36 +37,36 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { type ExecutionEnv, type TaskSpec, type ThinkingLevel, type ToolPolicy, type PromptProvider } from "@sema-agent/core";
|
|
39
39
|
import type { HooksConfig } from "@sema-agent/settings-schema/hooks";
|
|
40
|
-
/** The permission MODE a client may request (SDK `SettingsPermissions.defaultMode`), the [
|
|
41
|
-
* table. ⚠️ This is a DELIBERATE deployment set, NOT a copy of any CC set (
|
|
40
|
+
/** The permission MODE a client may request (SDK `SettingsPermissions.defaultMode`), the [ref]/[ref] five-word
|
|
41
|
+
* table. ⚠️ This is a DELIBERATE deployment set, NOT a copy of any CC set ([ref] P2-1 corpus check): CC's own
|
|
42
42
|
* full enum is SIX words (= ours + `dontAsk`), CC's managed/remote form accepts FOUR (= ours − `bypassPermissions`,
|
|
43
43
|
* which it warns-and-ignores). Ours = {CC-remote four} ∪ {`bypassPermissions`} — registered divergence, not parity.
|
|
44
|
-
* `bypassPermissions` and `auto` joined the set with the [
|
|
44
|
+
* `bypassPermissions` and `auto` joined the set with the [ref] fs-write gate: since the gate exists, every
|
|
45
45
|
* mode is a choice of HOW MUCH mode-derived gating the interpretation layer ADDS on top of the deployment baseline —
|
|
46
|
-
* `bypassPermissions` adds none (= the pre-[
|
|
46
|
+
* `bypassPermissions` adds none (= the pre-[ref] behavior of every mode: "不加门" not "开门", [ref] table row 4; the
|
|
47
47
|
* deployment approval/governance baseline is composed OUTSIDE this derive and is untouchable from a settings stamp),
|
|
48
48
|
* and `auto` adds the same ask gate as `default` with core's auto-mode classifier screening the asks upstream
|
|
49
|
-
* (entitlement-gated in core, [
|
|
49
|
+
* (entitlement-gated in core, [ref]②). */
|
|
50
50
|
export type SettingsPermissionMode = "default" | "acceptEdits" | "plan" | "bypassPermissions" | "auto";
|
|
51
51
|
/**
|
|
52
52
|
* R4: coerce a raw top-level `body.permissionMode` (the LIGHT per-turn wire — the shell sends the
|
|
53
53
|
* CC permission mode RAW, axis-agnostic; the service interprets) to a service-honored mode, or undefined.
|
|
54
54
|
* 🔴 TIGHTEN-ONLY vs the DEPLOYMENT baseline still holds for every value: the mode only selects the CLIENT-derived
|
|
55
55
|
* gate ({@link deriveSettingsPolicy}); it can never subtract from the deployment/operator policy (applyTaskSettings
|
|
56
|
-
* folds via tightenTaskSpec, deny-wins). Post-[
|
|
56
|
+
* folds via tightenTaskSpec, deny-wins). Post-[ref] the honored set is the five-word table above (NOT "CC verbatim" —
|
|
57
57
|
* see the {@link SettingsPermissionMode} header for the three-set contrast; the earlier "five CC modes" wording here
|
|
58
|
-
* was
|
|
58
|
+
* was [ref] P2-1's finding: no CC set has five members). `acceptEdits`,
|
|
59
59
|
* `bypassPermissions` and `auto` are HONORED as gate-shape choices (they no longer coerce to `default`, which
|
|
60
60
|
* would FORCE the manual ask gate onto a caller that explicitly asked for less asking — with the gate live, the old
|
|
61
61
|
* coercion would have been a behavior change for them, incl. a headless-deny regression for bypass callers). An
|
|
62
62
|
* UNKNOWN string still coerces to `default` (fail-safe: the most-asking mode).
|
|
63
|
-
*
|
|
63
|
+
* [ref]-②: fresh submits can no longer REACH the unknown-word arm — the HTTP gate 400s a non-five-mode value
|
|
64
64
|
* (server.ts, sibling of promptProfile) and the wire type is a closed enum. This lenient fold stays for the one
|
|
65
65
|
* population the gate deliberately does not cover: RESUME replay of a persisted pre-gate body (outputStyle/model
|
|
66
66
|
* two-layer posture — bricking a resume over a value that was legal at submit time is worse than the quiet fold).
|
|
67
67
|
*/
|
|
68
68
|
export declare function coercePermissionMode(raw: unknown): SettingsPermissionMode | undefined;
|
|
69
|
-
/** L2 ultracode (
|
|
69
|
+
/** L2 ultracode ([ref]): the effective `thinking` level given the explicit `reasoningEffort` and the ultracode
|
|
70
70
|
* preset. ultracode FLOORS at the "ultra" tier — core's single source `resolveReasoningProfile("ultra").thinking`
|
|
71
71
|
* (= "max"), never a hardcoded literal — so an explicit higher tier still wins (none exists above max today;
|
|
72
72
|
* future-proof). Awareness rides for free: core composes ORCHESTRATION_AWARENESS from thinking∈{xhigh,max}, no field. */
|
|
@@ -76,7 +76,7 @@ export declare function effectiveThinking(reasoningEffort: unknown, ultracode: b
|
|
|
76
76
|
* no `body.settings` bundle was sent. The result flows through {@link applyTaskSettings} (tighten-only). */
|
|
77
77
|
export declare function withPermissionMode(settings: ParsedTaskSettings | undefined, mode: SettingsPermissionMode): ParsedTaskSettings;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* [ref] §6-1 —— 本请求的**生效** permission mode,单点。优先序逐字同 {@link withPermissionMode}:
|
|
80
80
|
* 顶层 `body.permissionMode`(本轮显式表态)赢过 bundle 的 `settings.permissions.defaultMode`;两处
|
|
81
81
|
* 都没有 ⇒ `undefined` = **无表态**(调用点据此不写键,而不是替调用方选一个默认值)。
|
|
82
82
|
*
|
|
@@ -89,14 +89,14 @@ export declare function effectivePermissionMode(body: {
|
|
|
89
89
|
permissionMode?: unknown;
|
|
90
90
|
}, settings: ParsedTaskSettings | undefined): SettingsPermissionMode | undefined;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* [ref] §2 —— 显式 permission mode → `TaskSpec.shellGate` 档位的**翻译表(单一真源)**。
|
|
93
93
|
*
|
|
94
94
|
* · `bypassPermissions` ⇒ `"off"` —— CC `--dangerously-skip-permissions` 的对位裁定
|
|
95
95
|
* (与 fs-write 面的 bypass 臂两面归一,见 {@link deriveSettingsPolicy})。
|
|
96
|
-
* · `auto` ⇒ `"classify"` —— **
|
|
96
|
+
* · `auto` ⇒ `"classify"` —— **[ref] §8 开口按施工期新披露亲裁改译**(原裁定字面是 off,
|
|
97
97
|
* §8 保留「core auto 分类器覆盖面有新披露时可独立再裁,表驱动一行」——新披露见下段):
|
|
98
98
|
*
|
|
99
|
-
* ⚠️ **`auto` 这一行有一条待裁的开口(
|
|
99
|
+
* ⚠️ **`auto` 这一行有一条待裁的开口([ref] §8 明列「core auto 分类器覆盖面有新披露时可独立再裁,
|
|
100
100
|
* 表驱动一行」)。施工期交叉复审给出了那条新披露,已亲读安装包核实**:
|
|
101
101
|
* · core 只在**已经产生 `ask`** 之后才咨询分类器(`dist/core/hooks.js`:`if (input.autoMode &&
|
|
102
102
|
* decision.action === "ask" …)`);
|
|
@@ -105,7 +105,7 @@ export declare function effectivePermissionMode(body: {
|
|
|
105
105
|
* 却没有 shell 安全轴折叠」)。
|
|
106
106
|
* 两条合起来:`auto` × off ⇒ Bash 既不产 ask、分类器也就永不被咨询 —— off 档下「筛选权交给分类器」
|
|
107
107
|
* 不成立。故 auto 归 classify 组:分类器坐在 classify 产的 ask 之上,语义才真是「交给分类器」
|
|
108
|
-
* (良性只读命令由分类器自动放行,其余 ask;这正是 auto 模式的本义)。发车帖向 [
|
|
108
|
+
* (良性只读命令由分类器自动放行,其余 ask;这正是 auto 模式的本义)。发车帖向 [ref] 裁定链披露此
|
|
109
109
|
* 一行偏离;core auto 分类器若来日在 off 档下也有咨询点,可再裁回(表驱动一行)。
|
|
110
110
|
* · `default` / `acceptEdits` / `plan` ⇒ `"classify"` —— 这一档原先由壳无条件注入 `MANUAL_MODE_SHELL_GATE`
|
|
111
111
|
* 供给(车道缺省走了 operator 通道),现在归位到表态轴。`plan` 本身 handsReadOnly(core 明写此档下
|
|
@@ -116,7 +116,7 @@ export declare function effectivePermissionMode(body: {
|
|
|
116
116
|
* 缺席默认是 off,但**写**一个 off 会成为 governance 的 base,与缺席不是同一件事)。
|
|
117
117
|
*
|
|
118
118
|
* 🔴 **闭集 exhaustive switch,无 default 臂**:五个模式词是封闭词表,新增一个模式而不更新本表
|
|
119
|
-
* 是**编译错误**(
|
|
119
|
+
* 是**编译错误**([ref] 的安全轴纪律:词表的未知项不许有静默兜底臂)。
|
|
120
120
|
*/
|
|
121
121
|
export declare function shellGateForMode(effMode: SettingsPermissionMode): "off" | "classify";
|
|
122
122
|
/** The validated, service-trusted subset of `SemaSettings` we project onto the spec. `env` is parsed only to REPORT
|
|
@@ -133,11 +133,11 @@ export interface ParsedTaskSettings {
|
|
|
133
133
|
model?: string;
|
|
134
134
|
outputStyle?: string;
|
|
135
135
|
/** `settings.env` → per-task shell env. core deliberately keeps NO
|
|
136
|
-
* `TaskSpec.env` (an untrusted caller must not swap the sandbox —
|
|
137
|
-
* the TRUSTED `executionEnvFactory` seam (`shellEnv`) instead.
|
|
136
|
+
* `TaskSpec.env` (an untrusted caller must not swap the sandbox — [ref] §7 Q4); per-session shell env rides
|
|
137
|
+
* the TRUSTED `executionEnvFactory` seam (`shellEnv`) instead. [ref] "env = capability axis": HONORED only on
|
|
138
138
|
* the single-user host lane (`cwdHonored`), IGNORED on any cloud/multi-tenant lane. Parsed here; gated at apply. */
|
|
139
139
|
shellEnv?: Record<string, string>;
|
|
140
|
-
/** L2 ultracode preset (
|
|
140
|
+
/** L2 ultracode preset ([ref]): a CC-parity `settings.ultracode` boolean that EXPANDS to the two existing
|
|
141
141
|
* orthogonal axes — `thinking:"max"` (the reasoning axis) + `selfOrchestration:true` (the orchestration axis,
|
|
142
142
|
* through its existing fail-closed gate). NOT a new mechanism; just a preset that fans out to existing spec fields. */
|
|
143
143
|
ultracode?: boolean;
|
|
@@ -168,11 +168,11 @@ export declare const MAX_SETTINGS_ENV_KEY_CHARS = 256;
|
|
|
168
168
|
* Validate an untrusted `body.settings` (raw `unknown` off the wire) into the service-trusted {@link
|
|
169
169
|
* ParsedTaskSettings}. NEVER trusts the wire type — every field is shape-checked; unknown keys are ignored
|
|
170
170
|
* (forward-compatible, matching the SDK's open `[k: string]: unknown`). `defaultMode` accepts the FIVE modes
|
|
171
|
-
* (post-[
|
|
171
|
+
* (post-[ref]; unknown values coerce to `default` — see the header note). Returns the
|
|
172
172
|
* present-but-deferred field names so the caller can warn/advertise rather than silently dropping `env`/`hooks`.
|
|
173
173
|
*/
|
|
174
174
|
export declare function parseTaskSettings(raw: unknown): ParseTaskSettingsResult;
|
|
175
|
-
/** Defensive acceptance of the `appendSystemPrompt` rider ([
|
|
175
|
+
/** Defensive acceptance of the `appendSystemPrompt` rider ([ref] R2 + codex F2): the HTTP 400 gate (prepareSpec,
|
|
176
176
|
* MAX_SYSTEM_PROMPT_CHARS) only covers FRESH submits — every resume family re-enters resolveSpec on a STORED body,
|
|
177
177
|
* and a pre-1.243 store preserved unknown request keys verbatim (the field was INERT then), so an over-cap legacy
|
|
178
178
|
* value must not become active prompt content after rollout (context exhaustion / spend hole). Over-cap ⇒ dropped +
|
|
@@ -196,44 +196,44 @@ export declare function hasConstitutionAnchors(text: unknown): boolean;
|
|
|
196
196
|
* (REPLACE_ALL_EXCLUDED strips role.append) → append-less true. */
|
|
197
197
|
export declare function providerDropsAppend(provider: PromptProvider | undefined, userSystemPrompt: string | undefined): boolean;
|
|
198
198
|
export declare function acceptAppendSystemPrompt(v: unknown, warn?: (detail: string) => void, packDropsAppend?: boolean): string | undefined;
|
|
199
|
-
/** [
|
|
199
|
+
/** [ref]②/codex F2 — what the workflow ask leg needs from the deployment, on EVERY lane. It is name-keyed and
|
|
200
200
|
* fs-independent, so it never had the lane split {@link FsWriteGateWiring} carried (that split is itself gone
|
|
201
|
-
* since
|
|
201
|
+
* since [ref] — the sandbox lanes wire a gate of their own shape instead of no gate). */
|
|
202
202
|
export interface WorkflowGateWiring {
|
|
203
203
|
/** The session "don't ask again" probe (approvalExemptionStore.has, canonical toolName key) — same store and
|
|
204
204
|
* key space as the fs-write gate's probe; one remember="session" grant serves both. */
|
|
205
205
|
isExempt?: (toolName: string) => boolean | Promise<boolean>;
|
|
206
206
|
}
|
|
207
|
-
/** [
|
|
208
|
-
* `resolve-spec.ts`. Absent ⇒ no gate is derived (the pre-[
|
|
207
|
+
/** [ref]/[ref]① — everything the mode-derived fs-write ask gate needs from the deployment, provided by
|
|
208
|
+
* `resolve-spec.ts`. Absent ⇒ no gate is derived (the pre-[ref] behavior).
|
|
209
209
|
*
|
|
210
210
|
* WHY the `env` matters: core's `createFsWriteGatePolicy` canonicalizes every target/dir through the given `env`
|
|
211
211
|
* (real `exists`/`canonicalPath`/`readLink` fs access — read in dist, fs-write-gate-policy.js), so on a
|
|
212
212
|
* HOST-SEMANTICS lane (`REMOTE_EXEC` unset or "host") the env MUST be the fs the hand tools write.
|
|
213
213
|
*
|
|
214
|
-
*
|
|
214
|
+
* [ref]/[ref] — the sandbox lanes (e2b/k8s/ssh/adb/local-docker) wire a gate TOO, but a different-shaped one: the
|
|
215
215
|
* tools run OFF this box and the per-task sandbox env is minted inside core (executionEnvFactory) AFTER spec
|
|
216
216
|
* build, so a worker-local env would adjudicate against the WRONG fs (a wrong ALLOW is worse than no gate — that
|
|
217
|
-
* is why [
|
|
217
|
+
* is why [ref] left those lanes gate-less). They supply a `DeferredSandboxPathEnv`
|
|
218
218
|
* (`src/boot/deferred-sandbox-path-env.ts`) instead: a proxy that forwards the fs READ primitives to the task's
|
|
219
219
|
* REAL sandbox env at adjudication time (a per-session slot the factory decorator fills), keeping only
|
|
220
220
|
* `absolutePath` lexical so no relative path is resolved against the wrong base. Empty slot ⇒ fail-closed. */
|
|
221
221
|
export interface FsWriteGateWiring {
|
|
222
222
|
/** The env the gate canonicalizes against — the worker host env on the host lane, the
|
|
223
|
-
* `DeferredSandboxPathEnv` proxy over the task's real sandbox env on the sandbox lanes (
|
|
223
|
+
* `DeferredSandboxPathEnv` proxy over the task's real sandbox env on the sandbox lanes ([ref]). */
|
|
224
224
|
env: ExecutionEnv;
|
|
225
225
|
/** The task's working directory: the factory's `rootPath` (relative-path base) AND the acceptEdits accept domain.
|
|
226
|
-
* ABSENT on the sandbox lanes (
|
|
226
|
+
* ABSENT on the sandbox lanes ([ref]/[ref]): the sandbox cwd is the ENGINE's tracked cwd, not the env's own, so
|
|
227
227
|
* neither spec time nor the env proxy can supply the right base — inventing one would mint a bogus auto-allow
|
|
228
228
|
* domain. With it absent the gate gets no `rootPath` and no `acceptDirs`, so relative paths fail to resolve
|
|
229
229
|
* (⇒ ask) and `acceptEdits` degrades to the `default` arm — the same fail-safe direction as the host lane's
|
|
230
230
|
* never-created sentinel dir (resolve-spec 修5). */
|
|
231
231
|
cwd?: string;
|
|
232
|
-
/** The session scratchpad dir (envFacts.scratchpadDir, [
|
|
232
|
+
/** The session scratchpad dir (envFacts.scratchpadDir, [ref]③) — writes there are always auto-allowed. */
|
|
233
233
|
scratchpadDir?: string;
|
|
234
|
-
/** [
|
|
234
|
+
/** [ref]① / core 1.294 exemption seam: the session "don't ask again" probe (approvalExemptionStore.has),
|
|
235
235
|
* called by core as `(canonicalToolName, canonicalPath)`. The host arm ignores the second argument (the key
|
|
236
|
-
* comes from a real-fs canonicalize and the grant is deliberately name-keyed); the sandbox arm (
|
|
236
|
+
* comes from a real-fs canonicalize and the grant is deliberately name-keyed); the sandbox arm ([ref]) uses it
|
|
237
237
|
* to confine the exemption to POSIX-absolute canonical keys — core's `canonicalizeTarget` short-circuits
|
|
238
238
|
* backslash-UNC forms to `ok:true, key=raw` WITHOUT consulting the env, and an unconfined name-keyed grant
|
|
239
239
|
* would turn those unresolvable forms into an allow (codex review 2026-08-05).
|
|
@@ -242,7 +242,7 @@ export interface FsWriteGateWiring {
|
|
|
242
242
|
* toolName key space as the ask-policy layer's exemption probe — ONE grant serves both layers; the gate-level
|
|
243
243
|
* check is what makes "allow all session" bite SAME-TURN for the parent and inherited child tasks (the ask
|
|
244
244
|
* path is never re-entered). (codex M1 的边界注记:sensitive-path DENY 腿与本探针的「豁免越不过 deny」
|
|
245
|
-
* 保证仍成立——但那条腿已随
|
|
245
|
+
* 保证仍成立——但那条腿已随 [ref] 搬到 governance 层,deny-wins 是 tightenTaskSpec 折叠给的,不再依赖
|
|
246
246
|
* 本 wiring 的组合点。) */
|
|
247
247
|
isExempt?: (toolName: string, canonicalPath: string) => boolean | Promise<boolean>;
|
|
248
248
|
}
|
package/dist/task-workflow.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function selfOrchestrationFromBody(body: {
|
|
|
23
23
|
requirePrincipal?: boolean;
|
|
24
24
|
}, hasEntitlementResolver: boolean): true | undefined;
|
|
25
25
|
/**
|
|
26
|
-
* §4 (Fork) — map the per-task `body.enableFork` intent onto `TaskSpec.enableFork`. core 1.257 (
|
|
26
|
+
* §4 (Fork) — map the per-task `body.enableFork` intent onto `TaskSpec.enableFork`. core 1.257 ([ref] BREAKING)
|
|
27
27
|
* RETIRED the standalone `Fork` tool; a fork is now `Agent(subagent_type:"fork")`, and `enableFork` is one of the two
|
|
28
28
|
* governance axes (`forkGovernanceDenial(spec.enableFork, runtimeCaps.allowFork)`) that gate it.
|
|
29
29
|
*
|
|
@@ -61,12 +61,12 @@ export declare function workflowModelAllowlistFor(config: {
|
|
|
61
61
|
requirePrincipal?: boolean;
|
|
62
62
|
models: Record<string, unknown>;
|
|
63
63
|
}): string[] | undefined;
|
|
64
|
-
/**
|
|
64
|
+
/** [ref] caps for a caller-supplied `retainSubagentSessions` object (core defaults 30min/16; the ledger
|
|
65
65
|
* is run-scoped and fully released at parent end, so these only bound the WITHIN-RUN memory pin). */
|
|
66
66
|
export declare const RETAIN_SUBAGENT_TTL_MS_CAP: number;
|
|
67
67
|
export declare const RETAIN_SUBAGENT_MAX_CAP = 64;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* [ref] (core 1.225): normalize an untrusted `body.retainSubagentSessions` onto the TaskSpec field.
|
|
70
70
|
* `true`/`false` pass through (core's own defaults apply); an object keeps only NUMERIC ttlMs/max, each
|
|
71
71
|
* clamped to a positive integer under the cap (retention pins settled child sessions in memory for the
|
|
72
72
|
* parent run's lifetime — the knob must not become a caller-controlled resource hold). Anything malformed →
|
package/dist/text-bidi.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* 清洗面比检测面宽是对的:那两处要的是「只留可打印的一行」。
|
|
16
16
|
*
|
|
17
17
|
* ## 案锚
|
|
18
|
-
* Trojan Source([
|
|
18
|
+
* Trojan Source([ref]②;`docs/DISEASE-SHAPES.md` 的不可见字符条):字面控制符让**人审与机器门看到
|
|
19
19
|
* 两份不同的文本**。审批卡是本仓唯一一处「把模型写的命令交给人眼判断」的面,所以它需要的是**披露**
|
|
20
20
|
* (告诉壳「这串里有 bidi」),不是清洗 —— 清洗会改掉即将被执行的那串字节,让卡上显示的与真正跑的不是
|
|
21
21
|
* 同一个东西,那比不披露更坏。
|