@sema-agent/server 7.52.0 → 7.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE.md +22 -5
- package/dist/adoption/plan.d.ts +3 -3
- package/dist/adoption/quiesce.d.ts +1 -1
- package/dist/adoption/sql.d.ts +2 -2
- package/dist/adoption/wire.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +18 -18
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-hmac.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +14 -14
- package/dist/approval.d.ts +2 -2
- package/dist/audit.d.ts +4 -4
- package/dist/auth-keys.d.ts +6 -6
- package/dist/bench/l8/artifact.d.ts +6 -1
- package/dist/bench/l8/artifact.js +2 -27
- package/dist/bench/l8/escape.d.ts +3 -3
- package/dist/bench/l8/index.d.ts +1 -1
- package/dist/bench/s1/arms.d.ts +3 -3
- package/dist/bench/s1/oracle.d.ts +2 -2
- package/dist/bench/s1/reviewer.d.ts +1 -1
- package/dist/bench/s1/row.d.ts +5 -5
- package/dist/bench/s1/runner-ctx.d.ts +3 -3
- package/dist/boot/config-center.d.ts +14 -7
- package/dist/boot/config-center.js +2 -0
- package/dist/boot/coordinators.d.ts +4 -4
- package/dist/boot/crash-last.d.ts +1 -1
- package/dist/boot/device-lane.d.ts +3 -3
- package/dist/boot/device-lane.js +2 -0
- package/dist/boot/engine-lease.d.ts +4 -4
- package/dist/boot/governance-seams.d.ts +5 -5
- package/dist/boot/leader.d.ts +5 -5
- package/dist/boot/limit-sync.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +5 -5
- package/dist/boot/memory-consolidation.d.ts +8 -2
- package/dist/boot/memory-consolidation.js +1 -0
- package/dist/boot/org-memory.d.ts +5 -5
- package/dist/boot/parked-revive-gate.d.ts +6 -6
- package/dist/boot/permission-rules-audit.d.ts +2 -2
- package/dist/boot/reapers.d.ts +8 -8
- package/dist/boot/resolve-spec.d.ts +4 -4
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +33 -27
- package/dist/boot/runner-deps.js +2 -1
- package/dist/boot/runtime-caps.d.ts +4 -4
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/shutdown.d.ts +10 -10
- package/dist/boot/side-query-lane.d.ts +14 -14
- package/dist/boot/stores.js +5 -0
- package/dist/boot/task-list-lane.d.ts +3 -3
- package/dist/boot/webfetch-summarize-lane.d.ts +9 -9
- package/dist/boot/workflow-orchestration.d.ts +1 -1
- package/dist/bounded-session-map.d.ts +1 -1
- package/dist/brain.d.ts +3 -3
- package/dist/budget.d.ts +3 -3
- package/dist/canonical-json.d.ts +53 -0
- package/dist/canonical-json.js +48 -0
- package/dist/capabilities/center-prompts.d.ts +13 -13
- package/dist/capabilities/collab-workflows.d.ts +1 -1
- package/dist/capabilities/hands-lane.d.ts +4 -4
- package/dist/capabilities/memory-notice.d.ts +4 -4
- package/dist/capabilities/prompt.d.ts +2 -2
- package/dist/capabilities/sandbox-file-send.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +16 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/team.d.ts +3 -3
- package/dist/capabilities/tool-defer.d.ts +6 -6
- package/dist/config-catalog.d.ts +139 -0
- package/dist/config-catalog.js +556 -0
- package/dist/config-center/apply-effective.d.ts +20 -7
- package/dist/config-center/apply-effective.js +45 -0
- package/dist/config-center/apply-ledger.d.ts +6 -6
- package/dist/config-center/facade.d.ts +3 -2
- package/dist/config-center/hot-keys-registry.d.ts +2 -2
- package/dist/config-center/http-client.d.ts +5 -5
- package/dist/config-center/mcp-revocation.d.ts +6 -4
- package/dist/config-center/mcp-revocation.js +2 -12
- package/dist/config-center/restart-signal.d.ts +11 -1
- package/dist/config-center/restart-signal.js +1 -1
- package/dist/config-center/skills-mcp.d.ts +2 -2
- package/dist/config-center/stage-limits.d.ts +3 -3
- package/dist/config-center/types.d.ts +23 -19
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-provider.d.ts +2 -2
- package/dist/config-types.d.ts +157 -134
- package/dist/config.d.ts +32 -24
- package/dist/config.js +48 -6
- package/dist/degenerate-instrument.d.ts +1 -1
- package/dist/deployment-governance.d.ts +13 -13
- package/dist/device-store.d.ts +2 -2
- package/dist/device-ws-hub.d.ts +6 -4
- package/dist/device-ws-hub.js +9 -3
- package/dist/device-ws-protocol.d.ts +3 -3
- package/dist/digest-form.d.ts +1 -1
- package/dist/elicitation.d.ts +1 -1
- package/dist/env-facts.d.ts +7 -7
- package/dist/execution-lane-caps.d.ts +5 -5
- package/dist/fleet/fleet-bus.d.ts +56 -53
- package/dist/fleet/fleet-reconciler.d.ts +2 -2
- package/dist/fleet/fleet-terminal-window.d.ts +1 -1
- package/dist/fleet/subagent-tail-bus.d.ts +3 -3
- package/dist/fleet-client.d.ts +3 -3
- package/dist/fleet-lease.d.ts +1 -1
- package/dist/hooks/branch-transcript.d.ts +2 -2
- package/dist/hooks/cc-agent-hook-prompt.d.ts +2 -2
- package/dist/hooks/cc-stop-prompt.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +1 -1
- package/dist/hooks/hook-runner.d.ts +12 -5
- package/dist/http/active-run-conflict.d.ts +31 -33
- package/dist/http/active-run-conflict.js +4 -2
- package/dist/http/route-ctx.d.ts +23 -21
- package/dist/http/routes/a2a-serve.d.ts +2 -2
- package/dist/http/routes/admin-config-refresh.d.ts +1 -1
- package/dist/http/routes/admin-drain.d.ts +4 -4
- package/dist/http/routes/admin-memory-optout.d.ts +5 -5
- package/dist/http/routes/adoption.d.ts +1 -1
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +6 -6
- package/dist/http/routes/approvals-assistant.js +4 -1
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +1 -0
- package/dist/http/routes/config-catalog.d.ts +28 -0
- package/dist/http/routes/config-catalog.js +42 -0
- package/dist/http/routes/diagnostics.d.ts +2 -2
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/images.d.ts +1 -1
- package/dist/http/routes/leader.d.ts +1 -1
- package/dist/http/routes/memory-bundle.d.ts +4 -4
- package/dist/http/routes/memory-bundle.js +2 -3
- package/dist/http/routes/memory-compliance.d.ts +7 -7
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/memory-origin.d.ts +9 -9
- package/dist/http/routes/memory-policy.d.ts +3 -3
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/observability.d.ts +1 -1
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/rules.d.ts +3 -3
- package/dist/http/routes/run-memory-capture.d.ts +1 -1
- package/dist/http/routes/runs.d.ts +3 -3
- package/dist/http/routes/runs.js +12 -17
- package/dist/http/routes/session-sync.d.ts +2 -2
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions.d.ts +9 -1
- package/dist/http/routes/sessions.js +61 -1
- package/dist/http/routes/shared-memory.d.ts +1 -1
- package/dist/http/routes/side-query.d.ts +1 -1
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +1 -1
- package/dist/http/run-meta.d.ts +1 -1
- package/dist/http/send.d.ts +6 -6
- package/dist/http/server.d.ts +84 -67
- package/dist/http/server.js +25 -12
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +6 -6
- package/dist/http/verify-rounds.d.ts +3 -3
- package/dist/http/wire-gate.d.ts +2 -2
- package/dist/http/wire-types.d.ts +38 -38
- package/dist/key-resolver.d.ts +1 -1
- package/dist/leader/diffout.d.ts +2 -2
- package/dist/leader/diffup.d.ts +1 -1
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +6 -6
- package/dist/leader/grader-env-factory.d.ts +1 -1
- package/dist/leader/leader.d.ts +12 -12
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/planner.d.ts +5 -5
- package/dist/leader/repair-oracle.d.ts +1 -1
- package/dist/leader/wire.d.ts +9 -9
- package/dist/lsp/manager.d.ts +2 -2
- package/dist/lsp/types.d.ts +1 -1
- package/dist/lsp/ws-transport.d.ts +2 -2
- package/dist/main.js +13 -2
- package/dist/mcp-content-origin.d.ts +1 -1
- package/dist/memory-bundle-engine.d.ts +5 -3
- package/dist/memory-bundle-engine.js +2 -2
- package/dist/memory-operator-faces.d.ts +41 -11
- package/dist/memory-operator-faces.js +12 -0
- package/dist/memory-origin-fence.d.ts +20 -35
- package/dist/memory-origin-fence.js +41 -1
- package/dist/memory-posture.d.ts +6 -6
- package/dist/memory-scope.d.ts +7 -7
- package/dist/model-select.d.ts +5 -5
- package/dist/observability/cost-quota.d.ts +6 -6
- package/dist/observability/cost-taxonomy.d.ts +2 -2
- package/dist/observability/fail-open.d.ts +1 -5
- package/dist/observability/fail-open.js +0 -4
- package/dist/observability/metrics.d.ts +1 -1
- package/dist/observability/prompt-manifest.d.ts +8 -8
- package/dist/observability/rate-limit.d.ts +2 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +6 -6
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +1 -1
- package/dist/orchestration/subagent-steer.d.ts +3 -3
- package/dist/orchestration/workflow-agent-steer.d.ts +1 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +6 -6
- package/dist/orchestration/workflow-notify-journal.d.ts +6 -6
- package/dist/parent-watch.d.ts +1 -1
- package/dist/parked-decide.d.ts +11 -11
- package/dist/plan-cache-probe.d.ts +1 -1
- package/dist/plugins/adoption-log-sql.d.ts +4 -4
- package/dist/plugins/approval-ask-store-memory.d.ts +1 -1
- package/dist/plugins/approval-ask-store-memory.js +12 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +39 -17
- package/dist/plugins/approval-ask-store-sql.js +23 -6
- package/dist/plugins/approval-payload-fingerprint.d.ts +23 -0
- package/dist/plugins/approval-payload-fingerprint.js +23 -0
- package/dist/plugins/background-agent-store-sql.d.ts +8 -8
- package/dist/plugins/background-shell-support.d.ts +12 -12
- package/dist/plugins/blob-backend.d.ts +3 -3
- package/dist/plugins/breaker-state-sql.d.ts +3 -3
- package/dist/plugins/caching-session-store.d.ts +6 -6
- package/dist/plugins/checkpoint-store-sql.d.ts +162 -66
- package/dist/plugins/checkpoint-store-sql.js +76 -33
- package/dist/plugins/device-store-sql.d.ts +4 -3
- package/dist/plugins/e2b-orphan-reclaim.d.ts +3 -3
- package/dist/plugins/file-history-store-sql.d.ts +9 -8
- package/dist/plugins/file-run-store.d.ts +27 -27
- package/dist/plugins/fork-routing-session-store.d.ts +9 -9
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +2 -2
- package/dist/plugins/k8s-bg-scripts.d.ts +1 -1
- package/dist/plugins/k8s-exec-protocol.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +26 -17
- package/dist/plugins/local-checkpoint-store.js +21 -11
- package/dist/plugins/local-session-store.d.ts +5 -5
- package/dist/plugins/mailbox-store-sql.d.ts +6 -6
- package/dist/plugins/memory-embedder-fingerprint.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-engine-tidb.d.ts +1 -1
- package/dist/plugins/memory-key-guards.d.ts +3 -3
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +10 -10
- package/dist/plugins/memory-origin-law.d.ts +13 -13
- package/dist/plugins/memory-run-store.d.ts +12 -12
- package/dist/plugins/outcome-ledger-sql.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -33
- package/dist/plugins/permission-rule-store-sql.js +7 -12
- package/dist/plugins/pg-cost-quota.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -0
- package/dist/plugins/pg-query.d.ts +1 -1
- package/dist/plugins/pg-rate-limiter.d.ts +2 -2
- package/dist/plugins/pg-session-storage.d.ts +9 -9
- package/dist/plugins/remote-env-adb.d.ts +1 -1
- package/dist/plugins/remote-env-device.d.ts +2 -2
- package/dist/plugins/remote-env-e2b.d.ts +11 -11
- package/dist/plugins/remote-env-file-error.d.ts +2 -2
- package/dist/plugins/remote-env-host.d.ts +10 -10
- package/dist/plugins/remote-env-k8s.d.ts +7 -7
- package/dist/plugins/remote-env-local-docker.d.ts +1 -1
- package/dist/plugins/remote-env-ssh.d.ts +9 -9
- package/dist/plugins/remote-scratchpad.d.ts +1 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.d.ts +2 -2
- package/dist/plugins/retention-store-sql.d.ts +11 -11
- package/dist/plugins/roster-store-sql.d.ts +5 -5
- package/dist/plugins/run-store-sql.d.ts +12 -12
- package/dist/plugins/scheduler-support.d.ts +1 -1
- package/dist/plugins/send-user-file.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.d.ts +99 -0
- package/dist/plugins/session-capture-record-store-sql.js +110 -0
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +2 -2
- package/dist/plugins/session-store.d.ts +3 -3
- package/dist/plugins/shared-memory-store-sql.d.ts +5 -5
- package/dist/plugins/sql-driver.d.ts +7 -7
- package/dist/plugins/sql-errors.d.ts +2 -2
- package/dist/plugins/sql-escape.d.ts +1 -1
- package/dist/plugins/sql-row-helpers.d.ts +1 -1
- package/dist/plugins/store-backend.d.ts +32 -19
- package/dist/plugins/store-backend.js +4 -0
- package/dist/plugins/store-contracts.d.ts +9 -9
- package/dist/plugins/task-list-store-sql.d.ts +3 -3
- package/dist/plugins/tidb-cost-quota.d.ts +3 -3
- package/dist/plugins/tidb-pool.js +9 -0
- package/dist/plugins/tidb-rate-limiter.d.ts +2 -2
- package/dist/plugins/tidb-session-storage.d.ts +2 -2
- package/dist/plugins/tidb-session-store.d.ts +11 -11
- package/dist/plugins/tool-result-store-sql.d.ts +8 -8
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +7 -7
- package/dist/plugins/workflow-journal-store-sql.d.ts +6 -6
- package/dist/plugins/workflow-run-store-sql.d.ts +1 -1
- package/dist/plugins/write-behind-counter.d.ts +6 -6
- package/dist/principal-jwt.d.ts +2 -2
- package/dist/project-memory.d.ts +1 -1
- package/dist/prompts-domain-validate.d.ts +8 -8
- package/dist/question.d.ts +3 -3
- package/dist/resource-suspend.d.ts +4 -4
- package/dist/resource-window.d.ts +3 -3
- package/dist/router/route-orchestration.d.ts +1 -1
- package/dist/rules-consent.d.ts +48 -40
- package/dist/run-local.d.ts +5 -5
- package/dist/run-local.js +28 -4
- package/dist/runs.d.ts +19 -19
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +7 -7
- package/dist/security.d.ts +13 -13
- package/dist/session-leaf-bus.d.ts +1 -1
- package/dist/session-sync-content.d.ts +4 -4
- package/dist/session-sync-kernel.d.ts +2 -2
- package/dist/session-sync.d.ts +13 -13
- package/dist/session-titler.d.ts +1 -1
- package/dist/session-watch.d.ts +3 -3
- package/dist/shared-memory-scope-authorizer.d.ts +4 -4
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +20 -20
- package/dist/ssh-host-key.d.ts +5 -5
- package/dist/store-live-probe.d.ts +2 -2
- package/dist/task-cwd.d.ts +11 -11
- package/dist/task-mcp.d.ts +5 -5
- package/dist/task-settings.d.ts +35 -35
- package/dist/task-workflow.d.ts +3 -3
- package/dist/text-bidi.d.ts +1 -1
- package/dist/tool-approval.d.ts +171 -160
- package/dist/tool-approval.js +33 -28
- package/dist/trace/core-keyset-guard.d.ts +21 -7
- package/dist/trace/engine-notice-wire.d.ts +6 -6
- package/dist/trace/injection-tier.d.ts +2 -2
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +7 -7
- package/dist/trace/project.d.ts +35 -30
- package/dist/trace/project.js +9 -0
- package/dist/turn-activity.d.ts +4 -4
- package/dist/usage-analytics.d.ts +1 -1
- package/dist/wall-clock-jump-guard.d.ts +3 -3
- package/package.json +6 -6
package/dist/http/send.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] A9 seam — response senders, extracted VERBATIM out of `http/server.ts` so the per-domain route
|
|
3
3
|
* modules under `http/routes/` can call them without a value edge back into `server.ts` (that edge would close
|
|
4
4
|
* a runtime import cycle — see `test/module-cycle-gate.test.ts`).
|
|
5
5
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { ServerResponse } from "node:http";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* [ref](黑板 [ref]②)—— 一条响应「是 SSE 流」的**在场标记**。
|
|
13
13
|
*
|
|
14
14
|
* 引擎附着租约把**打开着的 SSE 流**当作壳的附着租约来数,于是 `handle()` 需要判「这条响应是不是流」。
|
|
15
15
|
* 🔴 **不能靠读回 content-type**(本机 node v24.2.0 实测):`res.writeHead(status, headersObject)` 直接
|
|
@@ -27,7 +27,7 @@ export declare function sseHeaders(res: ServerResponse, extra?: Record<string, s
|
|
|
27
27
|
* 一条 SSE 连接的墙钟上限。到点发一帧 `error`/`STREAM_MAX_DURATION`(**不是**静默关闭 —— 客户端分不出
|
|
28
28
|
* 「到帽了请重连」和「跑完了」)然后收流。
|
|
29
29
|
*
|
|
30
|
-
* 🔴 为什么共享(2026-08-08
|
|
30
|
+
* 🔴 为什么共享(2026-08-08,[ref] 二轮扫描 finding):这个数与下面的心跳间隔此前在**三处**各手抄一份
|
|
31
31
|
* —— `http/sse-log.ts`(task_run + image_bake 共用的那台泵)、`http/routes/trace-usage.ts`、
|
|
32
32
|
* `http/routes/approvals-assistant.ts`(它的顶注还自称「parity with streamTaskTrace」)。三处各自有测试
|
|
33
33
|
* 钉着**自己那一份**,没有任何跨副本的一致性钉 ⇒ 单边调帽后「parity」只剩注释里那句话。
|
|
@@ -40,14 +40,14 @@ export declare const SSE_MAX_STREAM_MS: number;
|
|
|
40
40
|
* 长时间无事件时的心跳间隔(防中继的 idle timeout 掐流)。与 {@link SSE_MAX_STREAM_MS} 同批收口。
|
|
41
41
|
*
|
|
42
42
|
* ⚠️ 收口的只有**间隔**,**不含帧形**:`sse-log` / `trace-usage` 发 `data: {}`,`approvals-assistant`
|
|
43
|
-
* 发 `data: {"type":"heartbeat"}`。这是真分歧不是笔误 —— trace-usage 自己的 meta 帧还引着 [
|
|
43
|
+
* 发 `data: {"type":"heartbeat"}`。这是真分歧不是笔误 —— trace-usage 自己的 meta 帧还引着 [ref]C-12
|
|
44
44
|
* 「每个 data payload 都带 type」的约定,而它的心跳帧没有 type(probe-sse-1 的注释把这条记成「按
|
|
45
45
|
* data.type 分派的客户端会拿到 undefined」)。统一帧形是**行为面**改动(要么给两处加 type=多发一个键,
|
|
46
46
|
* 要么给 approvals 减 type=消费端破坏),属候裁,不在本批的零行为码范围内。
|
|
47
47
|
*/
|
|
48
48
|
export declare const SSE_HEARTBEAT_IDLE_MS = 15000;
|
|
49
49
|
export declare function sendJson(res: ServerResponse, status: number, body: unknown): void;
|
|
50
|
-
/** A6(
|
|
50
|
+
/** A6([ref] lens1 §C3/lens3 §C3a): canonical error-response sender for sites that already carry a
|
|
51
51
|
* machine `errorCode` — `errorCode` is a required positional arg (not optional-bag) so a call site
|
|
52
52
|
* cannot regress to the "code but no errorCode" shape the error-code-key-gate forbids. Body shape is
|
|
53
53
|
* `{ error: message, errorCode, ...extra }`; a site that used to ALSO emit a legacy `code` key keeps it
|
|
@@ -56,7 +56,7 @@ export declare function sendJson(res: ServerResponse, status: number, body: unkn
|
|
|
56
56
|
* where `error`/`errorCode` aren't cleanly separable from the rest of the body, are left on raw
|
|
57
57
|
* `sendJson` (see the A6 migration notes for the callers still doing that on purpose). */
|
|
58
58
|
export declare function sendError(res: ServerResponse, status: number, errorCode: string, message: string, extra?: Record<string, unknown>): void;
|
|
59
|
-
/** B7(
|
|
59
|
+
/** B7([ref] lens1 §C3):`HttpError` 的兜底 catch-all 站点没有自己的语义分支——`err.code` 在 42 个
|
|
60
60
|
* throw 点里只有 3 个带。为了让「errorCode 恒在」在这些站点也成立(而不是靠豁免表放行),按**状态码**
|
|
61
61
|
* 给一个诚实的粗码:它只声明「这类拒绝」,不冒充比 throw 点更细的语义。带 `code` 的 throw 点原样优先。 */
|
|
62
62
|
export declare function httpErrorCode(status: number, code?: string): string;
|
package/dist/http/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
2
|
import type { IncomingMessage } from "node:http";
|
|
3
|
-
import { type Runner, type TaskSpec, type TaskResult, type WorkflowRunStore, type MemoryEntry, type MemoryExportBundle, type MemoryImportReport, type EntryProvenanceAccount, type MemoryErasureAttestation, type MemoryEntryOrigin, type OriginClearanceRow, type ConsolidationRunReceipt, type ConsolidationDriverRunRow, type SideQuerySpec, type SideQueryResult, type Brain } from "@sema-agent/core";
|
|
3
|
+
import { type Runner, type TaskSpec, type TaskResult, type WorkflowRunStore, type MemoryEntry, type MemoryExportBundle, type MemoryImportReport, type EntryProvenanceAccount, type MemoryErasureAttestation, type MemoryEntryOrigin, type OriginClearanceRow, type SessionMemoryStatus, type ConsolidationRunReceipt, type ConsolidationDriverRunRow, type SideQuerySpec, type SideQueryResult, type Brain } from "@sema-agent/core";
|
|
4
4
|
import type { TaskRequestBody } from "./wire-types.js";
|
|
5
5
|
import type { ServiceConfig } from "../config-types.js";
|
|
6
6
|
import { type RestartSignal, type SessionMirrorRuling } from "../config-center/facade.js";
|
|
@@ -41,13 +41,13 @@ export interface RequestAuth {
|
|
|
41
41
|
sessionId: string;
|
|
42
42
|
memoryScope?: string;
|
|
43
43
|
/** 142-S4:the SHAPE-VALIDATED **且已归一(小写)** 的 `body.projectId`(authorizer 的 core
|
|
44
|
-
* `PROJECT_ID_REGEX` 门通过后折小写回传;
|
|
44
|
+
* `PROJECT_ID_REGEX` 门通过后折小写回传;[ref]/[ref] 宽读严写)。main.ts 拿它查 config.projects 的
|
|
45
45
|
* defaultScopes(memory.scopes 种子)。resume 腿(checkpoint 重建 auth)缺席 — 回落持久化的
|
|
46
46
|
* body.projectId(原始提交已验形),那条回落腿自己再折一次小写,两腿查同一个键。 */
|
|
47
47
|
resolvedProjectId?: string;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* [ref] A8 —— ServiceDeps 的**分组窄接口**。
|
|
51
51
|
*
|
|
52
52
|
* 病:69 个平铺可选字段里 29 个只被单一路由域读、跨 ≥9 域的只有 4 个(config/logger/runStore/metrics)。
|
|
53
53
|
* 平铺形的直接后果 = main.ts 一个上千行的装配字面量,键与键之间没有任何「属于同一件事」的编译期表达,
|
|
@@ -67,7 +67,7 @@ export interface RequestAuth {
|
|
|
67
67
|
export interface ServiceCoreDeps {
|
|
68
68
|
runner: Runner;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* [ref]:`POST /v1/side-query` 的 brain 出口。**不是** `runner.sideQuery` —— core 的 `SideQuerySpec`
|
|
71
71
|
* 结构性没有 key 座位,经 Runner 那条路走的 side-query 恒用 brain 构造时的网关 key 打**模型自己的**
|
|
72
72
|
* baseUrl(上游 401 + 凭据外泄形)。装配点 `boot/side-query-lane.ts` 给它一只 per-model key 注入
|
|
73
73
|
* 的 brain wrapper,models/roles 与 Runner 同源。
|
|
@@ -86,7 +86,7 @@ export interface ServiceCoreDeps {
|
|
|
86
86
|
* task). The disposition lives INSIDE resolveSpec because only it derives the effective scenario (principal
|
|
87
87
|
* ruling + defaultScenario) and holds the center-pack snapshot the provider pick uses — an HTTP-side probe
|
|
88
88
|
* could disagree with the actual assembly (scenario mismatch / centerPrompts refresh TOCTOU). */
|
|
89
|
-
/** `opts.liveStream` (
|
|
89
|
+
/** `opts.liveStream` ([ref] 件C):这条腿是不是 `POST /v1/tasks/stream` —— **唯一**挂 HITL 活流投递面
|
|
90
90
|
* (`question.runWithContext`)的腿。resolveSpec 拿它做逐腿 `interactionPosture` 判据(判据全文见
|
|
91
91
|
* `boot/resolve-spec.ts` 的 `declaresInteractivePosture`)。缺席/false ⇒ 无人腿,不声明 posture ——
|
|
92
92
|
* bg(`POST /v1/runs`)、A2A、resume、cron/wake 一律走这一侧,行为字节不变。
|
|
@@ -96,9 +96,9 @@ export interface ServiceCoreDeps {
|
|
|
96
96
|
liveStream?: boolean;
|
|
97
97
|
}) => TaskSpec | Promise<TaskSpec>;
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* [ref] 场景 hands lane 选路:按 `resolveSpec` 刚产出的 TaskSpec 取本任务的执行 Runner。
|
|
100
100
|
* 装配点(main.ts)把「场景判别位 → Runner 对」的映射整只闭包传进来 —— 本层不解释场景,只取用。
|
|
101
|
-
* 缺席 ⇒ 恒 {@link ServiceDeps.runner}(单 Runner 部署形 =
|
|
101
|
+
* 缺席 ⇒ 恒 {@link ServiceDeps.runner}(单 Runner 部署形 = [ref] 之前的行为,逐字不变;测试桩即此形)。
|
|
102
102
|
*/
|
|
103
103
|
runnerFor?: (spec: TaskSpec) => Runner;
|
|
104
104
|
}
|
|
@@ -113,20 +113,20 @@ export interface ServiceStoreDeps {
|
|
|
113
113
|
/** Per-session approval exemption store — enables decide body `remember:"session"` + the
|
|
114
114
|
* exemptions list/revoke surfaces on /v1/approvals. The ask-gate probe is wired separately (main.ts). */
|
|
115
115
|
approvalExemptionStore?: ApprovalExemptionStore;
|
|
116
|
-
/** Durable-checkpoint store (
|
|
116
|
+
/** Durable-checkpoint store ([ref], core 1.67): durable F4 suspend/resume. When present, the resume
|
|
117
117
|
* endpoint + suspended-run surfacing are active. Set only when DURABLE_APPROVAL + a TiDB pool. */
|
|
118
118
|
checkpointStore?: CheckpointStoreFull;
|
|
119
119
|
/** E6 durable SessionPolicyStore (operator-tightened per-session tool rules). Enables PUT/GET /v1/sessions/:id/policy
|
|
120
120
|
* when present; core reads the rules at prepare-time (subtract-only) via RunnerDeps.sessionPolicyStore (wired separately). */
|
|
121
121
|
sessionPolicyStore?: ServiceSessionPolicyStore;
|
|
122
|
-
/** [
|
|
122
|
+
/** [ref] tool-results 读面([ref] 请求,core [ref] `buildToolResultRef` 到货):`GET /v1/tasks/:id/
|
|
123
123
|
* tool-results/:ref` 的数据源 —— 与 RunnerDeps 侧的 offload 店**同实例**(main.ts 的 `toolResultStore`,
|
|
124
124
|
* 即「durable 后端在场」那一只;无 backend 部署里 Runner 用的内存兜底 `runnerOffloadStore` **不接**这里)。
|
|
125
125
|
* 🔴 缺席 ⇒ 路由回 404 而不是 501:501 会向一个无权 caller 暴露「这台机器配没配 durable 店」的部署形,
|
|
126
|
-
* 与 unknown-ref / 归属不符两臂**同形** 404 才是防 oracle 的收口([
|
|
126
|
+
* 与 unknown-ref / 归属不符两臂**同形** 404 才是防 oracle 的收口([ref] 的「另定」项按防 oracle 收紧)。
|
|
127
127
|
* 这是本组「absent ⇒ 501 诚实缺席」通例的**唯一具名例外**,例外理由即上一句。 */
|
|
128
128
|
toolResultStore?: ToolResultStoreFull;
|
|
129
|
-
/**
|
|
129
|
+
/** [ref] per-edited-file rewind history store. Present ⇒ the rewind capabilities are advertised; core uses it
|
|
130
130
|
* via RunnerDeps.fileHistoryStore (first-touch tracking + per-turn boundaries + tracked-set restore, ANY
|
|
131
131
|
* env). Also the 2c history-transfer store (exportHistory/importHistory + blob negotiation faces). */
|
|
132
132
|
fileHistoryStore?: ServiceFileHistoryStore;
|
|
@@ -134,7 +134,7 @@ export interface ServiceStoreDeps {
|
|
|
134
134
|
* POST/GET/DELETE /v1/attachments*。缺席 ⇒ 501(与其他可选 store 面同姿)。绑定/物化半场在
|
|
135
135
|
* main.ts(resolveSpec + env factory 包装);本面只管上传/取回/删除三动词 + server 权威上限。 */
|
|
136
136
|
taskAttachmentStore?: TaskAttachmentStore;
|
|
137
|
-
/**
|
|
137
|
+
/** [ref] 件3d(/decide parked 赎回腿)——与 RunnerDeps/scenarioDeps **同实例**:durable bg
|
|
138
138
|
* 行店 + boot 期从生产装配(buildScenarios)取的裸 Agent ToolSpec。**这两件**与 checkpointStore
|
|
139
139
|
* 齐备时,POST /v1/approvals/:sessionId/decide 对 parked 后台子代的 pending checkpoint 走
|
|
140
140
|
* claim→execute 赎回腿(src/parked-decide.ts);任一缺席=分支不存在(legacy 腿现状:getCtx
|
|
@@ -145,12 +145,12 @@ export interface ServiceStoreDeps {
|
|
|
145
145
|
* `task_run` runs ledger. When it carries `listSessions`, GET /v1/sessions sources sessions from the session
|
|
146
146
|
* store (task_run only joins for run preview); `fork`/`deleteSession` enable the fork/delete routes. */
|
|
147
147
|
sessionStorage?: OwnerAwareSessionStore;
|
|
148
|
-
/** S8 workflow-run store (
|
|
148
|
+
/** S8 workflow-run store ([ref]/98): enables GET /v1/workflows (list) + /v1/workflows/:id (detail).
|
|
149
149
|
* Set when SELF_ORCHESTRATION_ENABLED. Live progress (/v1/workflows/:id/stream) is in-process
|
|
150
150
|
* (subscribeWorkflow) and works whenever self-orchestration is on, store or not. Runs are owner-gated by
|
|
151
151
|
* `scope` (= the creating principal). Also drives `capabilities.workflowsList` (= "can durably LIST runs"). */
|
|
152
152
|
workflowRunStore?: WorkflowRunStore;
|
|
153
|
-
/** [
|
|
153
|
+
/** [ref] journal 读面(PAIR-REVIEW 修车批):GET /v1/workflows/:runId/journal 的数据源——与 runner 侧
|
|
154
154
|
* workflowJournalStore 同一实例(main.ts backend.workflowJournal());缺席=501(与 workflowRunStore 同门)。 */
|
|
155
155
|
workflowJournalStore?: import("@sema-agent/core").WorkflowJournalStore;
|
|
156
156
|
/** Sandbox-image-pool index (IMAGE-API-DESIGN.md §2, pool design §8): enables /v1/images* (query + select).
|
|
@@ -162,7 +162,7 @@ export interface ServiceStoreDeps {
|
|
|
162
162
|
* together). 🔴 main.ts boot-asserts `operatorPrincipals` is non-empty when this is on (never a
|
|
163
163
|
* unrestricted-write build-host exec door, §P2.4a). */
|
|
164
164
|
imageBakes?: ImageBake;
|
|
165
|
-
/** P2 (
|
|
165
|
+
/** P2 ([ref] §7.2): the outcome-fact sink, for the `GET /v1/outcomes` read aggregate. `summary` is
|
|
166
166
|
* present on the SQL ledgers; a File sink (no query surface) → the endpoint 501s honestly. */
|
|
167
167
|
outcomeSink?: import("../plugins/file-outcome-sink.js").OutcomeSink;
|
|
168
168
|
/** SendUserFile 账本(多租户治理面):scope↔object 映射的读面 GET /v1/sendfile-links。present ⇔ 签发面
|
|
@@ -182,7 +182,7 @@ export interface ServiceStoreDeps {
|
|
|
182
182
|
* `backend.session()`/`fileHistory()`/`sessionPolicy()`/`resumeAnchor()` must come from ONE backend). Present
|
|
183
183
|
* whenever a durable backend (tidb/pg/local) is; absent on the env-only/no-backend worker (the routes 501). */
|
|
184
184
|
backend?: StoreBackend;
|
|
185
|
-
/**
|
|
185
|
+
/** [ref] 车二:**持久化权限规则的同意车道**(core [ref] 三步协议的宿主半场)。
|
|
186
186
|
* 在场 ⇔ 规则店真装配(`backend.permissionRule()` 有值)⇒ `POST /v1/rules/cc-import/{prepare,redeem}`
|
|
187
187
|
* 可用、ask 帧才投 `ruleOffers`;缺席 ⇒ 两口 501、帧上零候选(发一格无处可兑的「不再询问」
|
|
188
188
|
* = wire 谎言,比缺席更坏)。 */
|
|
@@ -199,12 +199,12 @@ export interface ServiceCoordinatorDeps {
|
|
|
199
199
|
* seam AND consumed here by `POST /v1/questions/:id/respond` + the per-run ALS wraps on the streaming legs. Absent ⇒
|
|
200
200
|
* the capability is false + the AskUserQuestion tool headless-defaults (never a live human). */
|
|
201
201
|
question?: QuestionCoordinator;
|
|
202
|
-
/** [
|
|
202
|
+
/** [ref]/[ref]②: live tool-approval coordinator (core onAsk → CC three-choice card). Set when
|
|
203
203
|
* TOOL_APPROVAL_ENABLED. Wired onto the runner's onAsk seam AND consumed here by
|
|
204
204
|
* `POST /v1/tool-approvals/:id/respond` + the per-run ALS wrap on the SYNC streaming leg (live-only by design —
|
|
205
|
-
* every other leg keeps core's fail-closed headless auto-deny, [
|
|
205
|
+
* every other leg keeps core's fail-closed headless auto-deny, [ref]⑤/[ref]④). */
|
|
206
206
|
toolApproval?: ToolApprovalCoordinator;
|
|
207
|
-
/** SVC-5 (
|
|
207
|
+
/** SVC-5 ([ref] CORE-5 #6): the process-local registry of STEERABLE workflow-agent handles
|
|
208
208
|
* (`ctx.agentStream`) live on THIS replica. Enables POST /v1/workflows/:id/agents/:label/steer. See
|
|
209
209
|
* workflow-agent-steer.ts for the handle-visibility seam status (the registry is real + ready; core does not
|
|
210
210
|
* yet hand the deployment a handle to register, so the route returns steering.not_running until it does). */
|
|
@@ -224,11 +224,11 @@ export interface ServiceCoordinatorDeps {
|
|
|
224
224
|
* (the live multi-row task/workflow fleet view: status/elapsed/tokens/doneCount transitions pushed over time).
|
|
225
225
|
* Present when wired in main.ts; the run + workflow lifecycle publish their per-row deltas to it. */
|
|
226
226
|
fleetBus?: FleetEventBus;
|
|
227
|
-
/** [
|
|
227
|
+
/** [ref] 病理1:boot recover(判死前世 running 行并回灌 fleet)完成屏障——`/v1/fleet/stream` 快照组装
|
|
228
228
|
* 对它做**有界**等待(3s cap,routes/fleet.ts),SIGKILL 后壳重连不再与 recover 赛跑。缺席或已
|
|
229
229
|
* resolve=立即组装(memory 后端、无 notify gate 的部署);main.ts 铸(recover 收官即落,失败也落)。 */
|
|
230
230
|
fleetRecoveryDone?: Promise<void>;
|
|
231
|
-
/** [
|
|
231
|
+
/** [ref] session-watch registry(SSE 订阅共享探针面)。present ⇔ sessionStorage 有 getLeafId/ownerOf
|
|
232
232
|
* (main.ts 建);absent ⇒ /v1/sessions/:id/events 501(capabilities.sessionEvents 同谓词,永不漂)。 */
|
|
233
233
|
sessionWatch?: import("../session-watch.js").SessionWatchRegistry;
|
|
234
234
|
/** asyncRewake wake 管道 holder(main.ts 建壳,server 启动装 deliver=session→本副本活流 steer)。 */
|
|
@@ -237,7 +237,7 @@ export interface ServiceCoordinatorDeps {
|
|
|
237
237
|
};
|
|
238
238
|
/** SendUserFile(切片2):per-run file_link 帧发射 ALS;undefined ⇒ 工具未建(非 host lane / 未配签发面)。 */
|
|
239
239
|
sendUserFile?: import("../capabilities/send-user-file-tool.js").SendUserFileEmitter;
|
|
240
|
-
/** v2 leader endpoint (
|
|
240
|
+
/** v2 leader endpoint ([ref]): enables POST /v1/leader (async) + GET /v1/leader/:id. Set when
|
|
241
241
|
* LEADER_ENABLED + the leader wiring (e2b workers + git push) is configured. */
|
|
242
242
|
leaderEndpoint?: LeaderEndpoint;
|
|
243
243
|
/** Fire-and-forget session auto-titler (first-submit hook; absent = feature dark). */
|
|
@@ -276,7 +276,7 @@ export interface ServiceSeamDeps {
|
|
|
276
276
|
} | {
|
|
277
277
|
active: string;
|
|
278
278
|
}>;
|
|
279
|
-
/** [
|
|
279
|
+
/** [ref]③(b): read a BACKGROUND agent-handle child's final report / current status out of the core
|
|
280
280
|
* TaskRegistry (the same face the TaskOutput tool reads — agent handles are NEVER in the run store).
|
|
281
281
|
* Wired in main.ts to `defaultTaskRegistry.pollTask` (non-blocking). Access is the REGISTRATION tuple:
|
|
282
282
|
* owner = the parent run's taskId (resume legs register children under the sessionId — the registry's
|
|
@@ -289,7 +289,7 @@ export interface ServiceSeamDeps {
|
|
|
289
289
|
content: string;
|
|
290
290
|
details: unknown;
|
|
291
291
|
}>;
|
|
292
|
-
/** [
|
|
292
|
+
/** [ref] CC TaskOutput 人侧对位 — the GENERIC task-handle read (background_bash cursor-consuming stdout /
|
|
293
293
|
* monitor batches / background_agent final report; `workflow` refused at the seam — journal face owns it).
|
|
294
294
|
* Same registration-tuple access derivation as subagentTaskOutput. Wired in main.ts to the seam over
|
|
295
295
|
* defaultTaskRegistry.pollTask. */
|
|
@@ -301,7 +301,7 @@ export interface ServiceSeamDeps {
|
|
|
301
301
|
content: string;
|
|
302
302
|
details: unknown;
|
|
303
303
|
}>;
|
|
304
|
-
/** [
|
|
304
|
+
/** [ref] CC TaskStop 人侧对位 — stop a background task handle (bash kill / monitor stop / agent abort),
|
|
305
305
|
* attributed "user". Same kind gate + access derivation as taskHandleOutput. */
|
|
306
306
|
taskHandleStop?: (handle: string, access: {
|
|
307
307
|
owner: string;
|
|
@@ -316,9 +316,9 @@ export interface ServiceSeamDeps {
|
|
|
316
316
|
* pg|tidb); absent / file posture ⇒ 501 (single-user file memory exports by copying the memory dir). */
|
|
317
317
|
memoryExport?: (scope: string) => Promise<MemoryEntry[]>;
|
|
318
318
|
/**
|
|
319
|
-
*
|
|
319
|
+
* [ref](core 5.57.0 `routePairingStatus`)—— **key↔URL 配对读面**:`GET /v1/models` 每行的
|
|
320
320
|
* `routePairing` 标注就是拿这一只判的。main.ts 接的是**装配好的那只 brain 本身**(不是摘出来的
|
|
321
|
-
* 函数引用:
|
|
321
|
+
* 函数引用:[ref] 那条「裸摘引用丢接收者」的教训同款,且 core 的装饰器族是按 `stream` 的同一条
|
|
322
322
|
* 路再分派 `adjudicateRoute` 的,整只传才不会跳过路由/快切层)。
|
|
323
323
|
*
|
|
324
324
|
* 🔴 缺席 ⇒ 该面每行标 `"unknown"`,**绝不猜**:一只没有 `adjudicateRoute` 面的自定义 brain 是
|
|
@@ -332,7 +332,7 @@ export interface ServiceSeamDeps {
|
|
|
332
332
|
* (MEMORY_ENGINE_BACKEND=pg|tidb); absent / file posture ⇒ 501 honestly (a single-user file plane
|
|
333
333
|
* IS the TOC side of a sync — it has no central-authority half to serve). */
|
|
334
334
|
memorySync?: (scope: string, syncReq: MemorySyncRequest) => Promise<MemorySyncResponse>;
|
|
335
|
-
/**
|
|
335
|
+
/** [ref] v2-c(core 5.40.0 `MemoryEngine.exportMemoryScopes`):治理完备包的**携出**面。main.ts 把它接到
|
|
336
336
|
* 装配好的 memory engine 上。启用 `POST /v1/memory/export`(operator-only)。
|
|
337
337
|
* 🔴 缺席 = 这个部署**没有记忆引擎**(`MEMORY_ENGINE=off` / 多租 file 底座等暗态)⇒ 501
|
|
338
338
|
* `capability.memory_engine_required`。注意与 {@link memoryExport} 的**方向相反**:那条要 DB 记忆
|
|
@@ -340,13 +340,13 @@ export interface ServiceSeamDeps {
|
|
|
340
340
|
* 实装,SQL 孪生上引擎会自己响亮拒(`memory.export_incomplete` 原样上 wire)。理由全文见
|
|
341
341
|
* routes/memory-bundle.ts 的「能力面的诚实形」。 */
|
|
342
342
|
memoryBundleExport?: (scopes: readonly string[]) => Promise<MemoryExportBundle>;
|
|
343
|
-
/**
|
|
343
|
+
/** [ref] v2-c(core 5.40.0 `MemoryEngine.importMemoryBundle`):治理完备包的**导入**面(治理写面)。
|
|
344
344
|
* 启用 `POST /v1/memory/import`(operator-only)。缺席语义与 {@link memoryBundleExport} 逐字相同 ——
|
|
345
345
|
* 两口共用一个能力判据,因为它们是同一个引擎面的两半(一个部署不可能只有其中一半)。 */
|
|
346
346
|
memoryBundleImport?: (bundle: unknown, opts?: {
|
|
347
347
|
expectedScopes?: readonly string[];
|
|
348
348
|
}) => Promise<MemoryImportReport>;
|
|
349
|
-
/**
|
|
349
|
+
/** [ref] 件③(core 5.57.0 `MemoryEngine.provenanceOf` / `eraseMemoryEntries`):出处 / 抹除合规面。
|
|
350
350
|
* 启用 `GET /v1/memory/entries/:entryId/provenance` 与 `POST /v1/memory/erase`(两口 operator-only)。
|
|
351
351
|
* main.ts 把它接到 `createMemoryComplianceFaces` 的产物上。
|
|
352
352
|
* 🔴 缺席有两个成因,与 {@link memoryBundleExport} **同码不同判据**(同码是因为消费端分支相同:换部署
|
|
@@ -363,7 +363,20 @@ export interface ServiceSeamDeps {
|
|
|
363
363
|
allowedScopes?: readonly string[];
|
|
364
364
|
}) => Promise<MemoryErasureAttestation>;
|
|
365
365
|
};
|
|
366
|
-
/**
|
|
366
|
+
/** [ref] seam①([ref] §S-7,core 7.0.2 [ref] 件1):**会话记忆状态读面**。启用
|
|
367
|
+
* `GET /v1/sessions/:id/memory-status`(owner 门,tenant 自助读 —— 不是 operator 面)。
|
|
368
|
+
* main.ts 把它接到 `createSessionMemoryStatusFace` 的产物上(单实例引擎,SQL capture 店同座喂入)。
|
|
369
|
+
* 🔴 缺席的两个成因与 {@link memoryCompliance} **同码**(`capability.memory_engine_required`,消费端分支
|
|
370
|
+
* 相同:换部署形态):①记忆引擎没接线;②引擎接了但后端**不自带控制面归属**(`controlPlaneRoot`)——
|
|
371
|
+
* committedCount/foldedCount/lastCaptureAt 读的是引擎控制面的 lineage 台账,控制面落在副本本地盘的
|
|
372
|
+
* 部署上,一个「可读的空目录」会把三键铸成**说谎的 0**(可读零必须是真零),所以②在挂载期判掉
|
|
373
|
+
* (工厂返 undefined),与 compliance/origin 两族同一条 F-9 裁。
|
|
374
|
+
* 🔴 face 的五键**全可选**(core `SessionMemoryStatus`):absent = 该事实源不可读,路由逐键透传缺席,
|
|
375
|
+
* 恒不铸 false/0 替身;`optOutSource:"fault"` = capture 态 indeterminate(383 片2/3 轴直投)。 */
|
|
376
|
+
sessionMemoryStatus?: {
|
|
377
|
+
status: (sessionId: string) => Promise<SessionMemoryStatus>;
|
|
378
|
+
};
|
|
379
|
+
/** [ref] 件②(core 5.59.0 `MemoryEngine.listExternalOriginEntries` / `listOriginClearances` /
|
|
367
380
|
* `clearEntryOrigin`):**外源标记人面**。启用 `GET /v1/memory/origin/external`、
|
|
368
381
|
* `GET /v1/memory/origin/clearances`、`POST /v1/memory/origin/entries/:entryId/clear`(三口 operator-only)。
|
|
369
382
|
* main.ts 把它接到 `createMemoryOriginFaces` 的产物上。
|
|
@@ -393,7 +406,7 @@ export interface ServiceSeamDeps {
|
|
|
393
406
|
landedSlug: string;
|
|
394
407
|
}>;
|
|
395
408
|
};
|
|
396
|
-
/**
|
|
409
|
+
/** [ref](core 5.58.0 `runMemoryConsolidationDriver`):记忆 **consolidation 阀门**的操作面。
|
|
397
410
|
* 启用 `POST /v1/admin/memory/consolidation/run` 与 `GET /v1/admin/memory/consolidation`(两口 operator-only)。
|
|
398
411
|
* main.ts 把它接到 `createMemoryConsolidationFaces` 的产物上。
|
|
399
412
|
* 🔴 缺席的**唯一**成因是「阀门没开」(`MEMORY_CONSOLIDATION_DRIVER` 不是 `on` —— 出厂缺省):
|
|
@@ -410,18 +423,18 @@ export interface ServiceSeamDeps {
|
|
|
410
423
|
run(scope: string): Promise<ConsolidationRunReceipt>;
|
|
411
424
|
lastRun(scope: string): ConsolidationDriverRunRow | undefined;
|
|
412
425
|
};
|
|
413
|
-
/**
|
|
426
|
+
/** [ref] §3.1 / [ref] §1.3([ref] S-2):per-principal memory-capture opt-out 授权表的管理面
|
|
414
427
|
* (`/v1/admin/memory-optout` 四口,operator-only)—— `backend.memoryOptOutGrant()` 的同一只(与
|
|
415
428
|
* `RuntimeCaps.allowMemoryOptOut` 的 resolver 腿读同一张表,零缓存直读 ⇒ 写后下一次 prepare 即生效)。
|
|
416
429
|
* 缺席 = 本部署没有 SQL 后端(local 车道刻意无源)⇒ 四口 501 `capability.memory_optout_grant_required`
|
|
417
430
|
* (「换部署形态」族;与 consolidation 阀门的 404 分家:这里不是旋钮没开,是店在本部署上不存在)。 */
|
|
418
431
|
memoryOptOutGrant?: import("../plugins/memory-optout-grant-store-sql.js").MemoryOptOutGrantStore;
|
|
419
|
-
/**
|
|
432
|
+
/** [ref] 件A §7 —— org 记忆授权目录,`boot/org-memory.ts` 装配的**同一个实例**(准入 seam 与
|
|
420
433
|
* 本面共享它的 TTL 缓存/退避窗/gen 高水位)。memory-policy 面的 `org:` 属主门用它回答成员性:
|
|
421
434
|
* 读面要该 scope 在授权表里、写面另要条目 `write === true`。缺席=本部署没有目录源 ⇒ `org:` 键
|
|
422
435
|
* 逐字保持 operator-only(收编前行为),绝不因目录不接线而放宽。 */
|
|
423
436
|
orgMemoryDirectory?: import("../org-memory-admission.js").OrgMemoryDirectory;
|
|
424
|
-
/**
|
|
437
|
+
/** [ref] —— org 共享记忆库的供给面(与 core `RunnerDeps.sharedMemoryStores` **同一个实例**:
|
|
425
438
|
* HTTP 只读面看到的库集合按定义等于模型面看到的那一份,两面不可能分歧)。
|
|
426
439
|
* 🔴 缺席 ⇒ `/v1/shared-memory/*` 整域不挂载(诚实缺席);挂载还另要 {@link orgMemoryDirectory}
|
|
427
440
|
* 在场 —— 没有成员性判据的读面只能全放或全拒,两个都比「这个面不存在」差。 */
|
|
@@ -437,7 +450,7 @@ export interface ServiceSeamDeps {
|
|
|
437
450
|
/** Degenerate-output a/b instrument: on errorCode=output.degenerate, inspect the session's turns to
|
|
438
451
|
* classify where the salvageable answer was (counter + log). Fire-and-forget; no-op otherwise. */
|
|
439
452
|
instrumentDegenerate?: (result: TaskResult) => void;
|
|
440
|
-
/** [
|
|
453
|
+
/** [ref] side-query 记账 seam(budget.ts createSideQueryAccountant——与 createTracer 同一装配点、
|
|
441
454
|
* 同一组 sink 实例:costQuota/model_cost 指标/fleetUsage/fleetLease,四路同语义)。缺席=零记账
|
|
442
455
|
* (手搭测试 deps;生产 main.ts 恒传)。 */
|
|
443
456
|
sideQueryAccounting?: (principal: string | undefined, r: {
|
|
@@ -454,15 +467,15 @@ export interface ServiceSeamDeps {
|
|
|
454
467
|
};
|
|
455
468
|
}) => void;
|
|
456
469
|
parkedReviveTool?: import("@sema-agent/core").ToolSpec;
|
|
457
|
-
/** 可选第三件:revive args 的 `subagent_type` roster 成员集([
|
|
470
|
+
/** 可选第三件:revive args 的 `subagent_type` roster 成员集([ref] Q1 成员性规则)。当前生产装配
|
|
458
471
|
* **恒缺席**(boot 内建 default 无自定义 agents roster,per-request 的 spec.agents 不进 boot 工具)
|
|
459
|
-
* = 恒省略 subagent_type,typed 子代按 general-purpose 形复活(保真度 caveat 已报 core,[
|
|
472
|
+
* = 恒省略 subagent_type,typed 子代按 general-purpose 形复活(保真度 caveat 已报 core,[ref]
|
|
460
473
|
* 批复审 G-F1;center roster 接线是候件,字段先留给它与测试口)。 */
|
|
461
474
|
parkedKnownAgentTypes?: ReadonlySet<string>;
|
|
462
|
-
/** [
|
|
475
|
+
/** [ref]/[ref] 跨进程父约束重供:decide 腿按部署配置重建 host 任务的同语义父策略链(exempt 锚=
|
|
463
476
|
* row.rootSessionId),经 core 1.396 的 `parkedResume.inheritedGate` 席位透传——缺席时重启后带
|
|
464
477
|
* requiresParentConstraint 的 parked checkpoint 恒被 core pre-CAS 门诚实拒(不可赎回)。
|
|
465
|
-
* ⚠️ **async**(
|
|
478
|
+
* ⚠️ **async**([ref]):重建要按本行 principal 现解 entitlement——理由在 parked-decide.ts 的
|
|
466
479
|
* `rebuildInheritedGate` 头注。 */
|
|
467
480
|
parkedReviveInheritedGate?: (row: import("@sema-agent/core").BackgroundAgentRecord, identity: {
|
|
468
481
|
principal: string | undefined;
|
|
@@ -477,10 +490,10 @@ export interface ServiceObservabilityDeps {
|
|
|
477
490
|
/** E8 (shell-host contract): per-task × per-model usage accumulator fed by the cost tracer. Shared with `createTracer`
|
|
478
491
|
* so the durable run lifecycle drains it into `model_usage` events → the `TaskStats.modelUsage` echo. */
|
|
479
492
|
modelUsage?: ModelUsageTracker;
|
|
480
|
-
/** [
|
|
493
|
+
/** [ref]②: the shared prompt-manifest accumulator (tracer records at prepare; the durable legs drain it
|
|
481
494
|
* into `prompt_assembled` events for turns/stream). Same register-fence lifecycle as modelUsage. */
|
|
482
495
|
promptManifests?: PromptManifestTracker;
|
|
483
|
-
/** Plan-cache recurrence probe (core
|
|
496
|
+
/** Plan-cache recurrence probe (core [ref]): per-scope objective recurrence rate, dumped at
|
|
484
497
|
* GET /metrics/plan-cache. Pure in-memory; recorded per finished task on both result paths. */
|
|
485
498
|
planCacheProbe?: PlanCacheProbe;
|
|
486
499
|
}
|
|
@@ -508,7 +521,7 @@ export interface ServiceGovernanceDeps {
|
|
|
508
521
|
costQuota?: QuotaTracker;
|
|
509
522
|
/** D4 AP:worker 侧 quota-lease admission(协商式;center lane 未配 = 缺席 = 零行为)。 */
|
|
510
523
|
fleetLease?: FleetLeaseManager;
|
|
511
|
-
/**
|
|
524
|
+
/** [ref]-T1:治理窗账本店(USAGE_WINDOWS 配置时在场,与 config.usageWindows 成对)——提交面
|
|
512
525
|
* pre-admission 读窗用(主力 /v1/runs 是 202 异步,core 进场拒发生在 202 之后永远变不成 429;
|
|
513
526
|
* 这里是异步车道唯一的 429 出路)。enforcement 真源在 core(RunnerDeps 同店),此门是快速座。 */
|
|
514
527
|
usageWindowStore?: import("@sema-agent/core").UsageWindowStore;
|
|
@@ -540,7 +553,7 @@ export interface ServiceDeploymentDeps {
|
|
|
540
553
|
* • `inflight` is ASSIGNED BY createServer (a live union of this replica's in-flight legs: durable bg/resume
|
|
541
554
|
* `inflightRuns` + live sync/resume streams `steerableRuns`) — main.ts polls it to know when drain is done.
|
|
542
555
|
* • /health carries `draining:true` (k8s readiness 摘流信号) + `version` (build self-description).
|
|
543
|
-
* •
|
|
556
|
+
* • [ref]:`attachedStreams` 同样 ASSIGNED BY createServer —— 本副本当前打开着的 SSE 流条数
|
|
544
557
|
* (= 引擎附着租约集的大小)。消费方是 `boot/engine-lease.ts` 的自退判据;与 `inflight` 同族,
|
|
545
558
|
* 同一个共享盒子,不另开第二条 main↔server 的通道。
|
|
546
559
|
*/
|
|
@@ -563,20 +576,24 @@ export interface ServiceDeploymentDeps {
|
|
|
563
576
|
* auto rolling-restart the worker. Change-detected (not presence) — absent when nothing baked-at-boot
|
|
564
577
|
* changed, so polling it never causes a restart loop. */
|
|
565
578
|
restartState?: () => RestartSignal | undefined;
|
|
566
|
-
/**
|
|
579
|
+
/** [ref] 世代账([ref] §2):本副本的配置收敛状态 —— `/health` 取三键
|
|
567
580
|
* (configTargetVersion / configAppliedVersion / configApplyStaleMs),`GET /v1/diagnostics/wiring` 取整份
|
|
568
581
|
* (按组的 appliedVersion / deferredKeys+铸因 / lastRejected 消毒形)。缺席 = 这个进程没有配置管道
|
|
569
582
|
* (纯 env 部署 / 测试夹具)⇒ 两个面的形状逐字不变(additive)。 */
|
|
570
583
|
configApplyState?: () => import("../config-center/apply-ledger.js").ConfigApplyLedgerView | undefined;
|
|
571
|
-
/**
|
|
584
|
+
/** [ref] 追加件:`POST /v1/admin/config/refresh` 的实现面 —— 触发**一次既有**的 refresh 拍(在飞则 join)。
|
|
572
585
|
* 缺席 / 回 `"not-wired"` = 本部署没有配置管道 ⇒ 该口诚实 4xx(绝不吞成 200)。 */
|
|
573
586
|
configRefreshNow?: () => Promise<"triggered" | "not-wired" | "failed">;
|
|
574
|
-
/**
|
|
587
|
+
/** DESIGN-278 §5 S2([ref]):center **当前在管**的 ServiceConfig 键集 —— `GET /v1/config/catalog`
|
|
588
|
+
* 判 `effectiveLane`(env 占位/center 在管/默认)的 center 半场。缺席或返回 undefined = 本部署
|
|
589
|
+
* 没有配置管道(纯 env worker / 测试夹具)⇒ 目录把每条 center 腿如实标「不在管」(additive)。 */
|
|
590
|
+
configCenterManagedKeys?: () => ReadonlySet<string> | undefined;
|
|
591
|
+
/** [ref](core 5.50 [ref]):mid-turn MCP 撤销台账读口 —— GET /v1/sessions/:id/mcp 的展示面与
|
|
575
592
|
* 引擎执行面同一权威(被撤服务器的工具不再进面板)。缺席 = 无中心撤销面(pre-338 展示语义)。 */
|
|
576
593
|
mcpRevocations?: {
|
|
577
594
|
isRevoked(serverName: string): boolean;
|
|
578
595
|
};
|
|
579
|
-
/**
|
|
596
|
+
/** [ref] 诊断投影:当前被撤销的 MCP 服务器名单(`GET /v1/diagnostics/wiring` 的 mcpRevocations 段)。
|
|
580
597
|
* 缺席/返回 undefined = 无配置管道 ⇒ 读面报 null(additive,不铸空壳)。 */
|
|
581
598
|
mcpRevocationState?: () => {
|
|
582
599
|
revoked: string[];
|
|
@@ -596,19 +613,19 @@ export interface ServiceDeploymentDeps {
|
|
|
596
613
|
* (「探过且活」与「没接线」机读可分),顶层告警键 `storeLive:false` 只在死时出现。status 恒 "ok"
|
|
597
614
|
* ——liveness≠readiness,DB 死不是进程死;摘流语义留给读键的编排器(与 durable/ready 同姿势,
|
|
598
615
|
* 披露不代裁)。钉:test/health-store-live.test.ts。
|
|
599
|
-
* 🔴
|
|
616
|
+
* 🔴 [ref]:座席给的 `error` 是**驱动原始 message**(DSN/主机/账号常在其中),而 /health 在鉴权门
|
|
600
617
|
* 之前 ⇒ 路由把它过 `publicStoreProbeError` 换成闭集词才上线;原文只走日志轴。 */
|
|
601
618
|
storeLiveState?: () => {
|
|
602
619
|
live: boolean;
|
|
603
620
|
ageMs: number;
|
|
604
621
|
error?: string;
|
|
605
622
|
} | undefined;
|
|
606
|
-
/**
|
|
623
|
+
/** [ref] 件三:core `describeStaticWiring(deps, specTemplate)` 的 boot 产物 —— `GET /v1/diagnostics/wiring`
|
|
607
624
|
* 的 `static` 半场,**与启动期拒启自检读的是同一份**(诊断页与拒启判据结构性同源)。
|
|
608
625
|
* operator-only 面,故整份原样下发(含 `governance` 段:本面就是那个段的受众)。
|
|
609
626
|
* 缺席 = 这个进程不是由 composition root 装起来的(测试夹具形)⇒ 该路由诚实地不存在(404)。 */
|
|
610
627
|
staticWiring?: import("@sema-agent/core").WiringManifest;
|
|
611
|
-
/**
|
|
628
|
+
/** [ref] 件2/件3:记忆面姿态(boot/stores.ts 的 `buildMemoryPosture` 产物 —— 与启动日志同一份)。
|
|
612
629
|
* 两个读面共用:`GET /v1/diagnostics/wiring` 的 `memoryPosture` 段(operator-only,全量)与
|
|
613
630
|
* `GET /v1/capabilities` 的 `memoryEngine` 位(窄投影)。缺席 = 这个进程不是由 composition root 装
|
|
614
631
|
* 起来的(测试夹具形)⇒ 诊断面报 null、能力位取诚实下限 false。 */
|
|
@@ -618,7 +635,7 @@ export interface ServiceDeploymentDeps {
|
|
|
618
635
|
* proxy. Orthogonal to `workflowsList` (the durable-list axis = `workflowRunStore`). Falls back to the store
|
|
619
636
|
* proxy when absent (older callers / tests that don't pass it). */
|
|
620
637
|
workflowsCapable?: boolean;
|
|
621
|
-
/** [
|
|
638
|
+
/** [ref]③ + codex R1-[medium]:`capabilities.workflowModels` 的**引擎快照席**。main.ts 在 boot 期用
|
|
622
639
|
* `workflowModelAllowlistFor(config)` 算一次(与 createRunnerDeps 喂给 core `workflowGovernanceBaseline.
|
|
623
640
|
* workflowModelAllowlist` 的同一只函数、同一 config 代际),多租户 fail-closed 的 undefined 在装配点
|
|
624
641
|
* 折 `[]` ⇒ 生产装配下本席**恒在场**。为什么不让能力面每请求活派生:core 5.49 起 models plane 经
|
|
@@ -635,11 +652,11 @@ export interface ServiceKnobDeps {
|
|
|
635
652
|
* 形无帽)。为什么在 HTTP 面重复店里的检查:店的 never-throw 结果形把一切写失败折成 502,而 502
|
|
636
653
|
* 语义=可重试,对端会对一个永远过不去的 blob 无限重试——413 才是「别再送了」的诚实形。 */
|
|
637
654
|
snapshotBlobSqlCapBytes?: number;
|
|
638
|
-
/** [
|
|
655
|
+
/** [ref] SSE 连接帽(缺省 256/副本;超限 503+Retry-After=消费方回落 /head 轮询)。 */
|
|
639
656
|
sessionEventsMaxConnections?: number;
|
|
640
|
-
/** [
|
|
657
|
+
/** [ref] SSE 心跳/owner 复核拍距 ms(缺省 25s;测试注入用)。 */
|
|
641
658
|
sessionEventsHeartbeatMs?: number;
|
|
642
|
-
/** [
|
|
659
|
+
/** [ref] 背压阻塞断流阈 ms(缺省 60s;write 持续 false 超过即断——僵消费者不无界积压)。 */
|
|
643
660
|
sessionEventsStallMs?: number;
|
|
644
661
|
}
|
|
645
662
|
/** 组槽本身。每组可选:一个只跑 env-only 的 worker 可以一组都不给。 */
|
|
@@ -663,8 +680,8 @@ export declare function flattenServiceDeps(deps: ServiceDeps): FlatServiceDeps;
|
|
|
663
680
|
export declare const MAX_USER_SKILLS = 10;
|
|
664
681
|
/** = core `SKILL_CONTENT_MAX_CHARS`(1MB 加载门,core 1.293 起 invoke 全文零截断、超 1MB 整拒;常量在
|
|
665
682
|
* dist/core/runner/synthetic-tools.js:84,未从 core 包根导出,故钉本地孪生+本出处注记)。修7 曾对齐旧
|
|
666
|
-
* 20k 截断门([
|
|
667
|
-
* ([
|
|
683
|
+
* 20k 截断门([ref] 飞轮考据:20k 是压缩保留区口径,invoke 时刻用错),core 1.293 撤门后本门跟随回收
|
|
684
|
+
* ([ref]① 收口)——HTTP 面与引擎加载门同值,超限 400 fail-loud 而非引擎侧整拒后难诊断。 */
|
|
668
685
|
export declare const MAX_SKILL_CONTENT_CHARS = 1048576;
|
|
669
686
|
export declare const MAX_SYSTEM_PROMPT_CHARS = 16384;
|
|
670
687
|
/** Cap on a request's `outputSchema` (JSON-serialized) — an uncapped schema bloats the prompt + the per-turn
|
|
@@ -680,20 +697,20 @@ export declare function validateUserSkills(skills: unknown): string | null;
|
|
|
680
697
|
* POST /v1/runs → async: 202 {taskId, sessionId, status}, runs in background (S1)
|
|
681
698
|
* GET /v1/runs/:id → run status + result (poll)
|
|
682
699
|
* GET /v1/runs/:id/events → SSE replay from Last-Event-ID, then tail to terminal (S2)
|
|
683
|
-
* POST /v1/sessions/:id/notify → inject an out-of-session event (
|
|
700
|
+
* POST /v1/sessions/:id/notify → inject an out-of-session event ([ref] §2): live stream ⇒ core
|
|
684
701
|
* `TaskStream.notify()`; idle ⇒ parked in the session inbox, drained
|
|
685
702
|
* as a `task_notification` on the next stream open
|
|
686
703
|
* POST /v1/sessions/:id/wake → wake a `task_done` pure park with a message and resume it
|
|
687
|
-
* (
|
|
704
|
+
* ([ref] §3). NOT a gate decision — a pending gate is refused
|
|
688
705
|
* (`wake.gate_pending`). Goes through `resumeWake`, which reuses the
|
|
689
706
|
* resume family's lease/CAS/run-log leg, so it BURNS MODEL TOKENS and
|
|
690
707
|
* is subject to the billable-submit gates (`SESSION_WAKE_RE`).
|
|
691
|
-
* (both live in `http/routes/notify-wake.ts` —
|
|
708
|
+
* (both live in `http/routes/notify-wake.ts` — [ref] A9 domain split)
|
|
692
709
|
*/
|
|
693
710
|
export declare function createHttpServer(rawDeps: ServiceDeps): http.Server & {
|
|
694
711
|
denyExpiredApprovals: (now: number) => Promise<void>;
|
|
695
712
|
isRunLiveOnThisReplica: (taskId: string) => boolean;
|
|
696
|
-
/**
|
|
713
|
+
/** [ref]:live 回决腿的 PARKED 赎回席(装配层把它接进协调器的晚绑座,见 {@link redeemParkedAsk})。 */
|
|
697
714
|
redeemParkedAsk: ParkedAskRedeem;
|
|
698
715
|
};
|
|
699
716
|
/** POST endpoints that trigger BILLABLE work — the fail-closed auth guard must cover ALL of them (council: the
|
|
@@ -717,12 +734,12 @@ export declare function createHttpServer(rawDeps: ServiceDeps): http.Server & {
|
|
|
717
734
|
*/
|
|
718
735
|
export declare function isMethodDispatchedSubmitPath(url: string): boolean;
|
|
719
736
|
/** 「这台部署配了任何一把 service 凭证吗」—— fail-closed 写门族的真值源。**单一属主**:`handle()` 的
|
|
720
|
-
*
|
|
737
|
+
* 凭证门、[ref] 的 parked 赎回席、以及 [ref] 的 consolidation 阀门启动期告警读同一句(手抄迟早
|
|
721
738
|
* 只改一处,而这条判据决定的是「无凭证部署上写口开不开」)。导出仅为最后一个消费点(main.ts)。 */
|
|
722
739
|
export declare function hasServiceAuth(config: ServiceConfig): boolean;
|
|
723
740
|
export declare function isBillableSubmitPath(url: string): boolean;
|
|
724
741
|
/**
|
|
725
|
-
*
|
|
742
|
+
* [ref]([ref] 件5)—— **改写门**:不烧模型、但在**没有任何 service credential** 的部署形下必须与
|
|
726
743
|
* billable / bake 两族一样 fail-closed 的写门。谓词与 `isBillableSubmitPath` **刻意分开**:这几扇门
|
|
727
744
|
* `billable=false`(零模型工作),塞进那张名单会让它们连带吃 drain 与 model-roster-pending 两道 503 ——
|
|
728
745
|
* 而收编与规则读写在排空期/roster 未落时做完全无害。
|
|
@@ -731,7 +748,7 @@ export declare function isBillableSubmitPath(url: string): boolean;
|
|
|
731
748
|
* · `POST /v1/adoption` —— operator-only 的一次性部署级动作,把一个 principal 名下**每一行**重写到另一个
|
|
732
749
|
* 身份;授权判据 `explicitOperatorOk(gatedPrincipal(...))`。
|
|
733
750
|
* · `POST /v1/rules/cc-import/*` —— principal lane 的**持久 allow 规则**铸造口;一条持久 allow 规则对后续
|
|
734
|
-
* 同命令的 classify 档 ask 常驻消音(core
|
|
751
|
+
* 同命令的 classify 档 ask 常驻消音(core [ref] 之后仍然如此,只是不再消 mandated 的那些)。
|
|
735
752
|
* · `DELETE /v1/rules` —— 同一个规则店的**撤销**口。方向相反(收紧)但同样是持久改写,而且它多一条
|
|
736
753
|
* operator 超范围域(`?principal=` / body 的 `principal` 让 operator 收回**任一**租户的规则)⇒ 自造一个
|
|
737
754
|
* 列在 `OPERATOR_PRINCIPALS` 里的头,就能把每一位租户的规则一次清空。
|
|
@@ -745,8 +762,8 @@ export declare function isBillableSubmitPath(url: string): boolean;
|
|
|
745
762
|
* 当年被抓到的同一形。签名因此收方法,与那只谓词逐字同形。
|
|
746
763
|
* 🔴 读面**原则上**不进本表:`GET /v1/adoption/:id` 与 `GET /v1/rules` 各有自己的**属主门**兜底,本门只拦写。
|
|
747
764
|
*
|
|
748
|
-
* 🔴 **第二个合取项的加宽**(codex 交叉复审 [high]
|
|
749
|
-
* 「持久改写 **或** 授权唯一输入是 principal 头的**跨租户治理读**」。加宽是为了收进
|
|
765
|
+
* 🔴 **第二个合取项的加宽**(codex 交叉复审 [high],[ref] 提货批,验真后修)——判据现在是
|
|
766
|
+
* 「持久改写 **或** 授权唯一输入是 principal 头的**跨租户治理读**」。加宽是为了收进 [ref] v2-c 的两口:
|
|
750
767
|
* · `POST /v1/memory/import` —— 直接落在**原**判据上,而且是本仓最深的那一种持久改写:它把别处铸的
|
|
751
768
|
* 条目 / 挑战 / 污染标记 / 托管链落进本部署的记忆平面。自造一个在册 operator 头 ⇒ 一份**不当调用方自制的
|
|
752
769
|
* 治理史**成为本店的账;而记忆是模型**每次挂载都读**的面,比种一条常驻 allow 规则更深(那条只影响
|
|
@@ -760,7 +777,7 @@ export declare function isBillableSubmitPath(url: string): boolean;
|
|
|
760
777
|
*/
|
|
761
778
|
export declare function isCredentialGatedRewrite(method: string, url: string): boolean;
|
|
762
779
|
/** Stable, low-cardinality route label for metrics/logs (ids collapsed to `:id`).
|
|
763
|
-
* [
|
|
780
|
+
* [[ref]] 字面量**先于**模式:此前模式先查,五条精确路由被形状桶吞掉(`/v1/approvals/stream`
|
|
764
781
|
* 落 ":id"、`/v1/images/{bakes,select,register}` 落 ":profile"、`/v1/images/bakes/claim` 落
|
|
765
782
|
* "bakes/:id")——长连接 stream 的 duration 混进 :id 桶正是 fleet/stream 案的同族错桶病。
|
|
766
783
|
* 精确匹配恒比形状匹配更对,序修零反例(billable-route-declaration 门逐样本钉)。 */
|