@sema-agent/server 7.52.1 → 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 +2 -1
- 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/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 +140 -132
- package/dist/config.d.ts +22 -22
- package/dist/config.js +2 -1
- 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 +3 -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 +53 -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 +5 -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 +22 -22
- 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-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 +60 -0
- 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 +20 -10
- 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 +12 -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 +1 -1
- package/dist/memory-origin-fence.js +2 -13
- 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/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 +19 -5
- 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 +30 -30
- 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 +5 -5
package/USAGE.md
CHANGED
|
@@ -230,7 +230,7 @@ MODEL_CODE_ROLES=default,subagent # 不设=全中立;仅这些角色在「
|
|
|
230
230
|
| `MEMORY_ORG_UNAVAILABLE_BACKOFF_MS` | `10000`(`[500, 600000]`) | 目录取不到之后的退避窗(只用于取数失败臂,不用于负结果) |
|
|
231
231
|
| `MEMORY_DELEGATION_EVIDENCE` | 缺省(=引擎自缺省 `static-face`) | **委派臂的证据标准**(core 5.45.0 design/324)。`static-face`=今日行为:委派的 attestation 缺失/未知**且**静态工具面够得着外部内容 ⇒ 标记本会话记忆为已污染(可能性即暴露)。`attested-only`=**只**豁免那一条静态面标记,且**真的豁免了一次**才响亮通告(`engine_notice` 的 `memory.delegation_static_mark_waived`,每个 prepared leg **至多**一次);送达 `external` attestation 照标、非委派的污染类工具照标、委派工具自身被分类为污染的照标。⚠️ 通告**不是 leg 计数器**:不含委派的 leg、污染面没挂载的 leg、送达了 attestation 的委派都不发 —— 看不到通告的常态含义是「没有可豁免的事」,不是「配置坏了」。坏值**启动期拒**。**部署席 only**(TaskSpec 无同名键,任务/受治脚本无法据此放松部署)。⚠️ **已接受的代价**:`attested-only` 下**后台**子代的真实外部接触不标记本会话(其内容经 TaskOutput / 任务通知注入 / AgentTranscript 摘要回流,三条都不带 attestation);异常收尾的前台子代同理。已标记的会话永不回滚清洗。运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.delegationEvidence`(`null`=本部署未设,引擎自缺省) |
|
|
232
232
|
| `MEMORY_PROVENANCE` | 缺省(=引擎自缺省 `carry`) | **记忆 provenance 总开关**(core 5.46.0 design/336 §13-3)。一个会话被判为**已暴露**之后,它的记忆写怎么处置。`carry`=引擎缺省:**普通**记忆写照常提交,但带上引擎铸的 `origin` 标记(随条目走后端/同步/导出包);指令形文件(feedback / pinned / triggers / applies-when)仍被扣下隔离;派生索引的会话散文照回滚;内容扫描门原样跑(**标记不是豁免**)。`off`=design/336 之前的行为:不铸 origin 标记,已暴露会话的 harvest **一条都不收**(整体隔离候人审)。⚠️ 已提交的标记在编辑时照样带下去 —— `off` 停的是**铸**,从不抹掉已记的事实。与 `MEMORY_DELEGATION_EVIDENCE` **正交**(四种组合全合法):那一键决定**什么时候**判会话为已暴露,本键决定判了之后**对写做什么**。坏值**启动期拒**(`OFF`/`false`/`none` 这类「看起来像关掉」的写法一律不折成缺省 —— 静默回默认 = 一台自认为「暴露会话零收录」的部署其实在照常收录)。**部署席 only**(TaskSpec 无同名键,任务/受治脚本无法据此改姿态);**不冻进 checkpoint**(resume 腿跟当前部署配置走)。运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.provenance`(`null`=本部署未设,引擎自缺省) |
|
|
233
|
-
| `MEMORY_CAPTURE_POLICY` | 缺省(=引擎自缺省 `open`) | **记忆采集 opt-out 的部署姿态**(core 7.0.0 design/383 §3.1;server S-49/S-50)。任务可带 `memory.capture:"off"` 声明「本会话不进长期记忆」(一次性,resume 恒不采集,无反向拼写),本键决定怎么裁那条声明:`open`=按面值生效,**只有**该 principal 的显式 `false` verdict 拒(403 `memory.capture_optout_denied`),resolver 故障**放行**+披露(隐私轴 fail-safe:错拒=记了用户明说不要记的会话,不可逆);`governed`=verdict **必答**(混合车队:部分用户强制留存),故障/缺席**拒跑**(fail-closed);`capture-required`=全体声明拒(一行配置)。verdict 源 = SQL 店后端上的授权表 `memory_optout_grant`(三层折叠:per-principal 行 → 部署缺省行 → 代码缺省 allow;管理面 `GET|PUT /v1/admin/memory-optout`(PUT=部署缺省行)· `PUT|DELETE …/:principal`,operator-only,能力位 `memoryOptOutGrant`,零缓存写后即生效)。🔴 **`governed` 而无 SQL 后端 ⇒ 启动期拒启**(无源 = 每个声明都被拒且没人知道为什么;要么 `DB_BACKEND=mysql|pg` 要么改姿态)。坏值**启动期拒**(`Governed`/`required`/`off` 一律不折成缺省:两种姿态的故障极性**相反**)。**部署席 only**;**不冻进 checkpoint**。运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.capturePolicy`(`null`=本部署未设)
|
|
233
|
+
| `MEMORY_CAPTURE_POLICY` | 缺省(=引擎自缺省 `open`) | **记忆采集 opt-out 的部署姿态**(core 7.0.0 design/383 §3.1;server S-49/S-50)。任务可带 `memory.capture:"off"` 声明「本会话不进长期记忆」(一次性,resume 恒不采集,无反向拼写),本键决定怎么裁那条声明:`open`=按面值生效,**只有**该 principal 的显式 `false` verdict 拒(403 `memory.capture_optout_denied`),resolver 故障**放行**+披露(隐私轴 fail-safe:错拒=记了用户明说不要记的会话,不可逆);`governed`=verdict **必答**(混合车队:部分用户强制留存),故障/缺席**拒跑**(fail-closed);`capture-required`=全体声明拒(一行配置)。verdict 源 = SQL 店后端上的授权表 `memory_optout_grant`(三层折叠:per-principal 行 → 部署缺省行 → 代码缺省 allow;管理面 `GET|PUT /v1/admin/memory-optout`(PUT=部署缺省行)· `PUT|DELETE …/:principal`,operator-only,能力位 `memoryOptOutGrant`,零缓存写后即生效)。🔴 **`governed` 而无 SQL 后端 ⇒ 启动期拒启**(无源 = 每个声明都被拒且没人知道为什么;要么 `DB_BACKEND=mysql|pg` 要么改姿态)。坏值**启动期拒**(`Governed`/`required`/`off` 一律不折成缺省:两种姿态的故障极性**相反**)。**部署席 only**;**不冻进 checkpoint**。运维读面 = `GET /v1/diagnostics/wiring` 的 `memoryPosture.capturePolicy`(`null`=本部署未设)。记录载体(S-53②,core 7.0.2 起):SQL 后端(`DB_BACKEND=mysql\|pg`)上记录落 `session_capture_optout` 表(跨副本存活,随中央 schema 自建零旋钮)——**远端车道(e2b/k8s)的 `capture:"off"` 声明自此真持久**;无 SQL 店的远端形仍 409 `config.memory_capture_unsupported`(诚实拒:落不进 resume 副本可见的载体就不许诺);单机本地车道走 core 文件三件套照常。用户面四口:提交键 `memoryCapture:"off"`(声明形)· `POST /v1/runs/:id/memory/capture-optout`(live 中途翻转,owner 门)· `POST /v1/sessions/:id/memory/erase`(所有者自助抹除,select 硬限本会话)· `GET /v1/sessions/:id/memory-status`(S-7 状态读面,owner 门,五可选键诚实缺席)。契约全文 `docs/ASSISTANT-WIRE-CONTRACT.md` §12 |
|
|
234
234
|
|
|
235
235
|
⚠️ **拒启动**:多租户 + 记忆面点亮 + `projects[].defaultScopes` 里有 org 键 + 目录源缺席 ⇒ 启动报错
|
|
236
236
|
并点名 projectId(该部署的每个此类请求都会在 prepare 期整拒,响亮拒启动比静默全拒服务诚实)。
|
|
@@ -832,6 +832,7 @@ curl -N http://<host>:8090/v1/tasks/stream -H 'content-type: application/json' \
|
|
|
832
832
|
| `GET /v1/agents/roster` | 后台 agent **名册**(7.29 起,需 durable background-agent store,否则 501 `capability.background_agent_store_required`):调用方自己 scope 的 `a…` 行,新→旧。行只带 `handle`/`name`/`agentType`/`status`/`spawnedAt`/`updatedAt`/`settledAt`(content-free;子代产物正文走 `GET /v1/runs/<id>/subagents/<handle>/output`)。查询:`?limit=`(1..100,默认 20)、`?before=`(上一页的 `nextBefore` 游标)、`?status=`(running\|parked\|completed\|failed\|killed)、`?session=`(按会话树窄化)、`?scope=`(**仅** service-token/单用户形;带 principal 的调用方锁定自己)。回体 `{agents,total,nextBefore?,truncated?}`;`truncated:true` = 租户行数超过名册窗(500),`total` 此时是窗内数。非属主的行**不出现也不计数**(无存在性 oracle) |
|
|
833
833
|
| `GET /v1/capabilities/scenarios/<name>` | 单个场景的只读详情:工具面、提示词概览、**本部署现在跑不跑得动**(见下) |
|
|
834
834
|
| `POST /v1/admin/drain` `{"reason":"…"}` | **停机因由显式声明**(7.35.0+;operator-only —— principal 须在 `OPERATOR_PRINCIPALS` 内,空名单 = 谁都不是 operator ⇒ 恒 403)。编排壳在发 SIGTERM **之前**调它;server 记进程内 `drainState.reason`,draining 期由 `/health` 的 `drainReason` 与 503 `draining` 体的 `reason` 透出(未声明 = 两面键缺席)。声明是**覆盖式**、无 TTL、随进程重启清零 ⇒ 每次停机流程内都要重新声明。`reason` 非空、trim 后 ≤256 字符,坏值 400。🔴 **写口是特权的,读口不是**:`/health` 免鉴权(见下一行)且缺省全网卡监听 —— 任何能连到这个端口的人都读得到你写的那句话。**别在 reason 里写工单号、内部主机名或任何内部标识**。 |
|
|
835
|
+
| `GET /v1/config/catalog` | **配置目录自描述**(DESIGN-278 §5 S2,S-32;operator-only —— `explicitOperatorOk`,空名单=谁都不是)。逐 env 键一行:`{name, domain, type, semantics, writeLanes, effectiveLane, envHeld, envTiming, staticDefault?/derivedDefaultNote?, effectiveValue, valueClass, danger, center?{domain,path,precedence,timing,restartSlice?,domainExists,managedNow,effectiveNow}}`;顶层带 `restartSlices`(重启片闭集)与 `centerDomains`(settings-schema 现行域表)。**两轴不混**:`writeLanes`=谁能写,`effectiveLane`=现在谁在生效(env-wins 族 env 占位 ⇒ center 腿 `effectiveNow:false`)。secret 类值**永不回传**(只回在场位;opaque 回在场位+长度;URL 剥 userinfo)。完备性由仓内 AST 双向对账门执法(分母=全 `src/` 生产 env 读取点)。旋钮 `CONFIG_CATALOG_ENABLED=false`(合规部署)⇒ 路径 404 + 能力位 `configCatalog:false`。响应 `Cache-Control: no-store`。 |
|
|
835
836
|
| `POST /v1/admin/config/refresh` | **配置手动刷新**(#322 批1;operator-only,与上一行同门:空 `OPERATOR_PRINCIPALS` ⇒ 恒 403)。改完中心配置 / `config.d` 之后不想等 60s 轮询就调它:触发**一次既有**的 refresh 拍(在飞则汇入那一拍,绝不并发双拍),返回时该拍已落地。200 体 `{triggered:true,targetVersion,appliedVersion}` —— 两个世代号与 `/health` 的 `configTargetVersion`/`configAppliedVersion` 同源。本部署没有配置管道(纯 env worker:既没配 `CONFIG_CENTER`、也不是 `CONFIG_PROVIDER=local`)⇒ 409 `config.refresh_unavailable` 指路,不会回一个「触发了但什么都没发生」的 200。 |
|
|
836
837
|
| `GET /health` | 健康(无需鉴权)。7.37.0+ 配置管道在场时带世代账键:`configTargetVersion`(本副本**最后见到**的配置版本,身份标)、`configAppliedVersion`(最后一次真落地的版本)、`configTargetOrdinal`/`configAppliedOrdinal`(7.38.0-rc.2 起,**收货序数**——`CONFIG_PROVIDER=local` 下 version 是内容哈希不承诺序,「改了没生效」看序数对不对齐)、`configApplyStaleMs`(target≠applied **持续**时长;收敛时键缺席)—— 编排器据此摘掉「配置持续落后」的副本 |
|
|
837
838
|
| `GET /metrics` | Prometheus 指标(有 token 时需带) |
|
package/dist/adoption/plan.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { AdoptionLegAction, AdoptionNotMigrated } from "./wire.js";
|
|
|
3
3
|
* 身份值的编码。
|
|
4
4
|
* · `verbatim` —— 列里存的就是 principal 本身;
|
|
5
5
|
* · `memory-scope` —— core 的 v2 typed scope 键(`user:<enc>` / `proj:<enc>/…`);
|
|
6
|
-
* · `rule-owner-key` —— 规则桶键 `sha256("principal:" + principal)` 的十六进制(
|
|
6
|
+
* · `rule-owner-key` —— 规则桶键 `sha256("principal:" + principal)` 的十六进制([ref] 车二的
|
|
7
7
|
* `buildRuleOwnerKey`)。身份在**hash 原像**里,所以「旧值 → 新值」这一对必须**算**出来,
|
|
8
|
-
* 不能拿 principal 本身去比 —— 这正是
|
|
8
|
+
* 不能拿 principal 本身去比 —— 这正是 [ref] 里残留计数恒报 0 的根因:旧式按明文 principal
|
|
9
9
|
* 查 `owner_key`,那个谓词在这张表上**永远匹配不到任何一行**。
|
|
10
10
|
*/
|
|
11
11
|
export type IdentityEncoding = "verbatim" | "memory-scope" | "rule-owner-key";
|
|
@@ -133,7 +133,7 @@ export declare const IDENTITY_WIDTH_LIMITS: readonly {
|
|
|
133
133
|
/** memory scope 列宽(两方言 VARCHAR(190) 同宽;段编码后才是真长度)。 */
|
|
134
134
|
export declare const MEMORY_SCOPE_MAX_CHARS = 190;
|
|
135
135
|
/**
|
|
136
|
-
* 收编身份的**键空间卫生门**(
|
|
136
|
+
* 收编身份的**键空间卫生门**([ref],验真后修)。纯函数、零 I/O ⇒ 在铸任何行之前判。
|
|
137
137
|
*
|
|
138
138
|
* ── 病 ──────────────────────────────────────────────────────────────────────────────────────────
|
|
139
139
|
* `adoption_log.from_principal` 上的 UNIQUE 是 183 D7「同一个源不许被收编两次」的**数据库强形**,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] —— 收编弧跑动期间的**进程内静默闸**([ref] I1「引擎先停」在本进程里的执法面)。
|
|
3
3
|
*
|
|
4
4
|
* ── 病 ──────────────────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
* 183 I1 写的是「发起收编之前必须先把引擎停掉」。那是一条**运维前提**,而本进程此前对它**零执法**:
|
package/dist/adoption/sql.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 收编迁移语句的**双方言文本铸造**(
|
|
2
|
+
* 收编迁移语句的**双方言文本铸造**([ref] §4.3 form b)。
|
|
3
3
|
*
|
|
4
4
|
* 🔴 为什么这里是**生成**而不是像别的店那样把两句话手写并排(sql-driver.ts 的 A12 判据):那条纪律的
|
|
5
5
|
* 目的是「读代码的人能一眼对比两方言」。本车的语句是从 {@link REBIND_LEGS} 计划表派生的 —— 手抄 26 条
|
|
@@ -66,7 +66,7 @@ export declare function buildBlobScanSql(dialect: SqlDialect, leg: RebindLegSpec
|
|
|
66
66
|
*/
|
|
67
67
|
export declare function buildBlobWriteSql(dialect: SqlDialect, leg: RebindLegSpec): string;
|
|
68
68
|
/**
|
|
69
|
-
* 规则桶的**整桶改键**(
|
|
69
|
+
* 规则桶的**整桶改键**([ref])。参数序:`[newOwnerKey, toPrincipal, oldOwnerKey]`。
|
|
70
70
|
*
|
|
71
71
|
* `owner_key = sha256("principal:" + principal)` —— 身份在**键的 hash 原像**里,与 session_policy
|
|
72
72
|
* 同族。差别在于这把键**不含逐行变量**(session_policy 的原像里还有 session_id),所以不必逐行扫出来
|
package/dist/adoption/wire.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] §6 —— 收编回执的**唯一包络**(form b:纯身份重绑,数据已在 SQL、承运腿为零)。
|
|
3
3
|
*
|
|
4
4
|
* 🔴 为什么 schema 在这里而不是散在路由里(clay 最高宪法「边界必 schema 禁裸 as-cast」):这份包络是
|
|
5
5
|
* **跨仓 wire 契约** —— 下游(cli / web-admin / 围栏 E2E)要按字段名逐字钉围栏。请求体在入口 zod 解析,
|
|
@@ -5,7 +5,7 @@ export declare const ASK_TERMINAL: ReadonlySet<AskState>;
|
|
|
5
5
|
/** 批侧终态集合(无出边的 2 态)。 */
|
|
6
6
|
export declare const BATCH_TERMINAL: ReadonlySet<BatchState>;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* [ref]:回决理由(`AskRow.decisionNote` → `decision_note` 列)的字符上限,**两条回决腿共用一个常量**。
|
|
9
9
|
*
|
|
10
10
|
* 🔴 为什么住在这个模块:两个消费者分别是 durable 腿的 zod 体(`http/routes/runs.ts` 的
|
|
11
11
|
* `AskDecisionBodySchema`)与 live 腿的手写 parser(`tool-approval.ts` 的 `parseToolApprovalResponse`),
|
|
@@ -25,7 +25,7 @@ export declare function canBatchTransition(from: BatchState, to: BatchState): bo
|
|
|
25
25
|
* ── `runId`(新增轴,封死跨 run 复用)────────────────────────────────────────────────────────────────
|
|
26
26
|
* core 给 `AskRequest.sourceTaskId` 填的是 **sessionId**(`prepare-task.js:2595` 的 `askSourceIdentity`),
|
|
27
27
|
* 不是 wire run id。而原轴给每条新 run 的首腿都重置 `leg=0` ⇒ 同一会话的**下一次全新提交**若撞上同一
|
|
28
|
-
* `toolCallId`(
|
|
28
|
+
* `toolCallId`([ref] 定稿 §3.1 记录了部分网关按**请求编号**而非全局编号铸它)会整组重现,
|
|
29
29
|
* `ensureAsk` 的幂等 upsert 于是命中上一 run 已 `DECIDED(approve)` 的旧行并把它回放成 `true` ——
|
|
30
30
|
* 静默复用一次早已过去的人类同意。这不是低概率碰撞,是可确定复现的路径(§10 钉 C-1)。
|
|
31
31
|
* `runId` = 本 run 的 wire id(durable 腿 = 真 run uuid;adhoc 腿 = 该腿一次性 uuid):每次全新提交必是
|
package/dist/approval-card.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] 车3([ref] 流内审批协议)—— **审批卡的 schema 属主 + 重放腿的纯函数**。
|
|
3
3
|
*
|
|
4
4
|
* 本模块只出两样东西,**都不带 IO、不带定时器、不发帧**:
|
|
5
5
|
* 1. `ApprovalCardSchema` / `ApprovalCardEnvelopeSchema` —— 落库 `approval_ask.card_json` 与一切读面
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* 2. `buildReplayFrame` / `buildApprovalPreamble` —— 行 → 帧的**纯投影**(设计稿 §5.2)。
|
|
9
9
|
*
|
|
10
10
|
* 🔴 为什么读面必须 `safeParse` 而不是裸 as-cast:`card_json` 是 JSON 列,驱动回读的是 `unknown`。
|
|
11
|
-
* 宪法 [
|
|
11
|
+
* 宪法 [ref](边界必 schema / 禁裸 as-cast / schema 单一属主)在这里是硬约束——一条形状漂了的历史行
|
|
12
12
|
* 若被 as-cast 成 `ApprovalCard`,它会带着 `undefined` 字段一路走到 wire 上,消费端拿到的是「结构上
|
|
13
13
|
* 合法、语义上空」的卡。`safeParse` 让这种行**当场落地为「跳过 + 一次 warn」**(§5.3)。
|
|
14
14
|
*
|
|
@@ -137,7 +137,7 @@ export type RuleOfferProjection = z.infer<typeof RuleOfferSchema>;
|
|
|
137
137
|
*/
|
|
138
138
|
export declare function copyRuleOffer(o: RuleOffer): RuleOfferProjection;
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
140
|
+
* [ref] 件 G1 —— `probeCause` 的形(落库/读面共用这一份;窄读入口是 {@link readProbeCause})。
|
|
141
141
|
*
|
|
142
142
|
* `.strict()` 与卡的其余部分同调:落进 `card_json` 的东西是**本仓投出来的**三键,不可能有未知键
|
|
143
143
|
* (未知键在窄读那一层就被 zod 默认 strip 掉了)。
|
|
@@ -158,7 +158,7 @@ export type ProbeCauseProjection = z.infer<typeof ProbeCauseSchema>;
|
|
|
158
158
|
* `AskRequest.probeCause`(以及耐久路同值的 `RiskDescriptor.probeCause`)的**边界窄读** —— 活卡帧与
|
|
159
159
|
* `card_json` 的**唯一**铸造点,两面因此结构性同值(不是两处各挑一次键的巧合)。
|
|
160
160
|
*
|
|
161
|
-
* 🔴 姿势与 `RiskAxesEnvelopeSchema` 一致:`safeParse` 而不是裸 `as`(宪法 [
|
|
161
|
+
* 🔴 姿势与 `RiskAxesEnvelopeSchema` 一致:`safeParse` 而不是裸 `as`(宪法 [ref] 边界必 schema)。
|
|
162
162
|
* 形不合 ⇒ **按缺席处置**(绝不半解出一个残缺结构上卡面);未知键被 zod 默认 strip(core additive
|
|
163
163
|
* 加键不该让整只 ask 的卡面塌掉)。
|
|
164
164
|
*
|
|
@@ -167,7 +167,7 @@ export type ProbeCauseProjection = z.infer<typeof ProbeCauseSchema>;
|
|
|
167
167
|
*/
|
|
168
168
|
export declare function readProbeCause(req: unknown): ProbeCauseProjection | undefined;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* [ref] 件 G2 —— `AskRequest.ruleEvidence` 的形(帧 / `card_json` / 读面共用;窄读入口是
|
|
171
171
|
* {@link readRuleEvidence})。三对成员各 = 值**或**五词命名缺席(`AskEvidenceAbsence`),core 引擎
|
|
172
172
|
* 盖章的证据恰一在场;server 只判形转录,**永不**自铸缺席词(server 铸词 = 谎报「某一层没报」)。
|
|
173
173
|
*/
|
|
@@ -184,10 +184,10 @@ export declare const RuleEvidenceSchema: z.ZodObject<{
|
|
|
184
184
|
}, z.core.$strict>;
|
|
185
185
|
export type RuleEvidenceProjection = z.infer<typeof RuleEvidenceSchema>;
|
|
186
186
|
/**
|
|
187
|
-
* `AskRequest.ruleEvidence`(core 5.35.0
|
|
187
|
+
* `AskRequest.ruleEvidence`(core 5.35.0 [ref] G-2)的**边界窄读**——活卡帧(`ToolApprovalFrame.
|
|
188
188
|
* ruleEvidence`)与 `card_json`(`buildApprovalCard`)的**唯一**铸造点,两面结构性同值(与
|
|
189
189
|
* {@link readProbeCause} 同款分工)。姿势逐条:
|
|
190
|
-
* · `safeParse`,形不合 ⇒ 按缺席处置(宪法 [
|
|
190
|
+
* · `safeParse`,形不合 ⇒ 按缺席处置(宪法 [ref]);未知键 strip(core additive 加键不塌卡)。
|
|
191
191
|
* · **恰一不变量**:一对成员(值 / 缺席词)**双在场** ⇒ 整只丢——那是矛盾证据(引擎盖章的恰一,
|
|
192
192
|
* 双在场只可能是第三方 producer 的坏行),半解上卡比缺席更坏。双缺席**容忍**(老 producer 行)。
|
|
193
193
|
* · `orgRule` 内容族(管理员写的规则文本)⇒ `redactSecrets` 后截 `MAX_RULE_TEXT_CHARS`,**先脱敏
|
|
@@ -196,7 +196,7 @@ export type RuleEvidenceProjection = z.infer<typeof RuleEvidenceSchema>;
|
|
|
196
196
|
* · `orgRevision` / 缺席词 verbatim(数值 / 闭集词,非内容)。
|
|
197
197
|
*/
|
|
198
198
|
export declare function readRuleEvidence(req: unknown): RuleEvidenceProjection | undefined;
|
|
199
|
-
/**
|
|
199
|
+
/** [ref] 第五单(core [ref] 修②)—— `ruleOffers` 缺席因由的**闭三词集**(core d.ts 逐字;词表是闭集,
|
|
200
200
|
* 未知词=形不合=按缺席处置,绝不透传一个消费端词表外的值)。 */
|
|
201
201
|
export declare const RuleOffersAbsenceSchema: z.ZodEnum<{
|
|
202
202
|
mandated: "mandated";
|
|
@@ -205,15 +205,15 @@ export declare const RuleOffersAbsenceSchema: z.ZodEnum<{
|
|
|
205
205
|
}>;
|
|
206
206
|
export type RuleOffersAbsence = z.infer<typeof RuleOffersAbsenceSchema>;
|
|
207
207
|
/**
|
|
208
|
-
* `AskRequest.ruleOffersAbsence`(core
|
|
208
|
+
* `AskRequest.ruleOffersAbsence`(core [ref] 修②)的**边界窄读** —— 活卡帧与 `card_json` 的唯一铸造点
|
|
209
209
|
* (与 {@link readProbeCause} 同款分工),两面结构性同值。闭集词 verbatim(非内容族,零 redact);
|
|
210
210
|
* 形不合/缺席 ⇒ 不铸键(缺席不是断言 —— 它同时覆盖「有 offers」与结构性无车道的门,core 契约逐字)。
|
|
211
211
|
*/
|
|
212
212
|
export declare function readRuleOffersAbsence(req: unknown): RuleOffersAbsence | undefined;
|
|
213
213
|
/**
|
|
214
|
-
*
|
|
214
|
+
* [ref] §3.1 的**中性投影**——呈卡面看到的全部内容,与 wire 面的既有 `ToolApprovalFrame` 解耦。
|
|
215
215
|
*
|
|
216
|
-
* `risk` 的三态形(设计稿 §14.1,core [
|
|
216
|
+
* `risk` 的三态形(设计稿 §14.1,core [ref] 回帖后定):`AskRequest.riskAxes?.{irreversible,egress}`
|
|
217
217
|
* 是 **additive optional**,**缺席 = 引擎未判,不是「安全」**。所以两轴在这里是 `optional()`:
|
|
218
218
|
* `true` / `false` / **缺席(未标注)** 三态各自可分,投影层**禁把缺席折算成 false** —— 那等于替引擎
|
|
219
219
|
* 打包票。`requiresRealApproval` 是**粗粒度**安全类标记,两侧的在场契约**不同、别混**:core 侧是
|
|
@@ -397,16 +397,16 @@ export interface ApprovalCardSource {
|
|
|
397
397
|
args?: unknown;
|
|
398
398
|
argsOmitted?: boolean;
|
|
399
399
|
toolCallId?: string;
|
|
400
|
-
/** [
|
|
400
|
+
/** [ref]/[ref]:治理来源标 —— 与 wire 帧**同一份素材**(`ToolApprovalFrame` 结构上满足本接口),
|
|
401
401
|
* 于是 live 帧 / `card_json` / 重放帧三面同源,不是三处各判一遍。 */
|
|
402
402
|
governanceForced?: true;
|
|
403
403
|
/** E-14:bidi 在场位 —— 与 wire 帧**同一份素材**(`ToolApprovalFrame` 结构上满足本接口)⇒ live 帧 /
|
|
404
404
|
* `approval_request` / `card_json` / 重放帧四面同源,不是四处各扫一遍。 */
|
|
405
405
|
inputHasBidi?: true;
|
|
406
|
-
/**
|
|
406
|
+
/** [ref](core 5.25.0):被越级的持久规则原文 —— **已 redactSecrets**(发帧点做,本模块只 clip)。
|
|
407
407
|
* 与 wire 帧**同一份素材**(`ToolApprovalFrame` 结构上满足本接口)⇒ live 帧 / `card_json` / 重放帧三面同源。 */
|
|
408
408
|
persistedRuleShadowed?: string;
|
|
409
|
-
/**
|
|
409
|
+
/** [ref](core 5.58.0):引擎铸的「不再询问」OFFER(**只在规则店装配时**由发帧点填;语义与在场性契约见
|
|
410
410
|
* `ApprovalCardSchema.ruleOffers`)。与 wire 帧**同一份素材** ⇒ live 帧 / `card_json` / 重放帧
|
|
411
411
|
* 三面同源。 */
|
|
412
412
|
ruleOffers?: readonly RuleOffer[];
|
|
@@ -421,7 +421,7 @@ export interface ApprovalCardSource {
|
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
423
|
/**
|
|
424
|
-
*
|
|
424
|
+
* [ref] §3.1 的**中性投影**(设计稿 §6.2)—— 写侧的唯一铸造点。
|
|
425
425
|
*
|
|
426
426
|
* `risk` 三态(§14.1):两轴 `optional`,`true`/`false`/**缺席(未标注)** 各自可分。`req` 是 core 交来的
|
|
427
427
|
* `AskRequest`(可能带、也可能不带 `riskAxes`),按 `unknown` 窄读;`requiresRealApproval` 走**独立入参**
|
|
@@ -434,7 +434,7 @@ export declare function buildApprovalCard(source: ApprovalCardSource, req: unkno
|
|
|
434
434
|
/** 落库信封的纯构造(写侧;读侧 = `ApprovalCardEnvelopeSchema.safeParse`,**同一个 schema**)。 */
|
|
435
435
|
export declare function buildApprovalCardEnvelope(approvalId: string, card: ApprovalCard): ApprovalCardEnvelope;
|
|
436
436
|
/**
|
|
437
|
-
*
|
|
437
|
+
* [ref] §3.1 的呈卡帧(设计稿 §4.1)—— **live 铸造**形(重放形见 {@link buildReplayFrame},
|
|
438
438
|
* 两者投的是同一种帧,区别只在 `card` 的来源:这里是刚投影出来的,那里是从行上回读的)。
|
|
439
439
|
*
|
|
440
440
|
* `expiresAtMs` **入参**而不是在这里现算:同一只 ask 的窗**只铸一次**(§3.1「永不赋新 deadline」),
|
|
@@ -450,7 +450,7 @@ export declare function buildApprovalRequestFrame(input: {
|
|
|
450
450
|
nowMs: number;
|
|
451
451
|
}): ApprovalRequestFrame;
|
|
452
452
|
/**
|
|
453
|
-
*
|
|
453
|
+
* [ref] §3.1 的呈卡帧(设计稿 §4.1 逐字)。
|
|
454
454
|
*
|
|
455
455
|
* 与既有 `tool_approval` 帧是**并行加帧、不替换**(§4.2):存量壳只认旧帧,新帧是闭集加员;两帧同带
|
|
456
456
|
* `approvalId`,消费端据它去重。
|
|
@@ -481,7 +481,7 @@ export interface ApprovalRequestFrame {
|
|
|
481
481
|
approvalId: string;
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
|
-
*
|
|
484
|
+
* [ref] §3.3 的**批级撤卡帧**(车6;设计稿 §3 逐字)。
|
|
485
485
|
*
|
|
486
486
|
* 语义:本批里 `askIds` 列出的那些卡**已经作废**,壳按白名单清掉它们(未知 `reason` 按通用撤卡处理)。
|
|
487
487
|
* 已 `DECIDED` 的兄弟**永远不在** `askIds` 里(§3.0「已 DECIDED 不受撤卡影响」)——名单恒等于持久层
|
package/dist/approval-hmac.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { ApprovalHmacKey } from "./auth-keys.js";
|
|
|
7
7
|
* the unexposed resume credential the client can never see (it resumes by sessionId), so a checkpointToken-bound
|
|
8
8
|
* message would be uncomputable by the signer.
|
|
9
9
|
*
|
|
10
|
-
* ── `reason` 入签(三方裁 (a):cli [
|
|
10
|
+
* ── `reason` 入签(三方裁 (a):cli [ref] / core [ref]§四 / server;clay「干净切」令 [ref])─────────────
|
|
11
11
|
* `reason` 是随决定落账的自由文本(审计面的一部分)。它此前**在信封之外** ⇒ 能改线上字节的一方(反代 /
|
|
12
12
|
* 被接管的客户端 —— 正是 HMAC 要防的风险模型)可以在操作员批准同一个动作的那次决定里,把落账理由换成
|
|
13
13
|
* 别的:动作没变,**审计记录变了**。三方裁定纳入签名载荷,不留 `reasonUnsigned` 宽限代际(未上生产)。
|
|
@@ -48,7 +48,7 @@ export declare function approvalHmacMessage(env: ApprovalEnvelope): string;
|
|
|
48
48
|
* 取 4096 与本仓既有的人写文本上限同档(`MAX_ELICIT_MESSAGE_CHARS` / `MAX_AGENT_TEXT_CHARS`)。 */
|
|
49
49
|
export declare const MAX_APPROVAL_REASON_CHARS = 4096;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* [ref] D-G: verify the INTEGRITY of an approval-decision envelope. Returns true iff `mac` (hex) equals
|
|
52
52
|
* HMAC-SHA256(canonical-envelope) under ANY key in the set — the `kid`-hinted key first, then the rest (so a MAC
|
|
53
53
|
* signed with a key being rotated out still verifies during the overlap). `timingSafeEqual` avoids a timing
|
|
54
54
|
* oracle. An empty key-set ⇒ false (caller decides whether absence = skip-because-inactive or fail-closed).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 流内审批协议(
|
|
2
|
+
* 流内审批协议([ref] §3.0)的**对账收敛器** —— [ref] 车5。
|
|
3
3
|
*
|
|
4
4
|
* 职责一句话:把 `PARKING`(窗到期中选、正在转投递面)这个**唯一的非终态中间态**收敛成
|
|
5
5
|
* `PARKED | DENIED | VOID`,并在崩溃后补位那些没人打 expire 的孤儿 `STREAM_PENDING` 行。
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 那一维读成等式会让合法 park 几乎命不中。逐字实现在 {@link classifyGateMatch};判据的**唯一
|
|
12
12
|
* 属主**是那个函数的头注,这里只列纲要,细则(祖先层 fold 否决、多候选取舍)不在此复述。
|
|
13
13
|
* 🔴 两处易错,写在这里免得下一个人照旧口径改码:
|
|
14
|
-
* · 承重的第一维是 **`sourceTaskId`**(
|
|
14
|
+
* · 承重的第一维是 **`sourceTaskId`**([ref] 件1,黑板 [ref]③①)——`sessionId` **不进身份等式**
|
|
15
15
|
* (委派子代的 ask 落行记的是投递上下文的根会话,park 却发生在子代自己的 sessionId 上,只按
|
|
16
16
|
* session 等值会张冠李戴),它在这一层只是读口 `findCheckpointCandidatesForAsk` 的入参。
|
|
17
17
|
* ⚠️ 但别据此把它当无用键:{@link isAncestorFoldMint} 的祖先层否决判的正是
|
|
@@ -96,9 +96,9 @@ export interface ReconcileInput {
|
|
|
96
96
|
allowBind?: boolean;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* 判据 1 的一次**分类**结果(
|
|
99
|
+
* 判据 1 的一次**分类**结果([ref] 件1;纯数据)。
|
|
100
100
|
*
|
|
101
|
-
* 为什么不只回「命中 / 不命中」:黑板 [
|
|
101
|
+
* 为什么不只回「命中 / 不命中」:黑板 [ref]/[ref] 两帖把「两侧摘要不等」拆成了**四种成因**,处置各不
|
|
102
102
|
* 相同 —— 只有一种是真的「两个值不一样」,其余三种根本只有一侧(或零侧)铸过摘要。压成同一个
|
|
103
103
|
* `undefined` 会让运维看着一条「不匹配」去查一件从没发生过的事。
|
|
104
104
|
*/
|
|
@@ -108,12 +108,12 @@ export type GateMatchOutcome =
|
|
|
108
108
|
kind: "match";
|
|
109
109
|
candidate: CheckpointAskCandidate;
|
|
110
110
|
}
|
|
111
|
-
/** 祖先冻结 approver 层 fold 中途的那一次铸造:其后还可能有 rewrite,两侧**本不该等**([
|
|
111
|
+
/** 祖先冻结 approver 层 fold 中途的那一次铸造:其后还可能有 rewrite,两侧**本不该等**([ref]③)。 */
|
|
112
112
|
| {
|
|
113
113
|
kind: "ancestor_fold_mint";
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* 单铸路径 —— **不是** mismatch([
|
|
116
|
+
* 单铸路径 —— **不是** mismatch([ref]③②):
|
|
117
117
|
* - `ask_only`:纯 sync 腿(同轮结算,永无 checkpoint 行)/ 再审批链(2 次 ask 铸造、0 次 checkpoint);
|
|
118
118
|
* - `checkpoint_only`:durable-first 干净 args(ask 侧 0 次铸造,checkpoint 铸出);
|
|
119
119
|
* - `neither`:字符串模式 `onAsk` + durableApproval(两侧都没铸)。
|
|
@@ -124,7 +124,7 @@ export type GateMatchOutcome =
|
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* 三元组身份对得上、两侧摘要都在场却**不等** —— 唯一的真 mismatch。成因是**部署自伤**而非不当调用
|
|
127
|
-
* ([
|
|
127
|
+
* ([ref]②:hook/policy 把自己仍持引用的活对象在两铸点之间改了,或每读返回新值的有状态 getter)。
|
|
128
128
|
* 处置 = 留痕不拒:计数 + 一条 warn,行照 ②③④⑤ 走(判据 1 不命中的既有 fail-safe 路径不变)。
|
|
129
129
|
*/
|
|
130
130
|
| {
|
|
@@ -136,7 +136,7 @@ export type GateMatchOutcome =
|
|
|
136
136
|
kind: "identity_miss";
|
|
137
137
|
};
|
|
138
138
|
/**
|
|
139
|
-
* 这只 ask 是不是**祖先冻结 approver 层**在委派 fold 中途铸的那一份(
|
|
139
|
+
* 这只 ask 是不是**祖先冻结 approver 层**在委派 fold 中途铸的那一份([ref] 件1④,黑板 [ref]③)。
|
|
140
140
|
*
|
|
141
141
|
* 判别位是**产品自己发的**,不是外部约定:core 的 `withDelegationProvenance` 只包**子代自己那条缝**,
|
|
142
142
|
* 祖先层那次走未包装的原函数 ⇒ `AskRequest.delegation` 在不在,就是「这一份是哪一层发的」。落到行上,
|
|
@@ -152,14 +152,14 @@ export type GateMatchOutcome =
|
|
|
152
152
|
*/
|
|
153
153
|
export declare function isAncestorFoldMint(ask: AskRow): boolean;
|
|
154
154
|
/**
|
|
155
|
-
* 判据 1 的**硬谓词**(纯函数,§9 C2 + §8 D-2
|
|
155
|
+
* 判据 1 的**硬谓词**(纯函数,§9 C2 + §8 D-2;[ref] 件1 起返回分类而不是布尔)。
|
|
156
156
|
*
|
|
157
157
|
* 逐条:
|
|
158
158
|
* - 祖先层 fold 中途铸点 ⇒ 直接退出(见 {@link isAncestorFoldMint});
|
|
159
159
|
* - `unparseable` 候选直接出局(读不出 ⇒ 不确定 ⇒ 不命中);
|
|
160
160
|
* - **身份三元组**:`sourceTaskId` **相等** ∧ `toolCallId` **相等** ∧ 时间维的**因果下界**
|
|
161
161
|
* `candidate.createdAtMs >= ask.createdAtMs`(⚠️ 第三维**不是等式** —— 把它读成等式会让合法的 park
|
|
162
|
-
* 几乎命不中,行随后落 ②③⑤ 被误判)—— 摘要**不是**身份([
|
|
162
|
+
* 几乎命不中,行随后落 ②③⑤ 被误判)—— 摘要**不是**身份([ref]③①:
|
|
163
163
|
* 同 args 的两次调用摘要天然相同,只靠摘要硬相等会把第二次投递并进第一次的票);任一维在候选侧
|
|
164
164
|
* 缺席(读不出的 blob 没有 `sourceTaskId`)即身份不成立;
|
|
165
165
|
* - **hash 双等**:两侧都必须在场且相等,任一侧缺席一律不 bind;禁「能取到时才比」的可选谓词。
|
|
@@ -187,7 +187,7 @@ export interface ReconcileStats {
|
|
|
187
187
|
* 于是判据 1 恒不命中、PARKING 行只会落 ②③④⑤。这个计数把那片盲区变成**可观测量**而不是静默行为
|
|
188
188
|
* (下面每 tick 一条 warn),并被写成协议开关翻真的前置判据之一。
|
|
189
189
|
*
|
|
190
|
-
* ✅ **该前置判据已销账**(
|
|
190
|
+
* ✅ **该前置判据已销账**([ref] 翻真验证车,2026-08-07 亲验 core 5.15.0):字段在
|
|
191
191
|
* `core/tool-policy.d.ts:83`,真码 `core/tool-policy.js:610` 每一只 ask 都填 ——
|
|
192
192
|
* 判据 1 现在会真命中(钉:test/stream-approval-on-e2e.test.ts 件4 末条,同构两行只差 hash 一位,
|
|
193
193
|
* 有 hash 的 bind 成 PARKED、无 hash 的进本计数)。
|
|
@@ -198,7 +198,7 @@ export interface ReconcileStats {
|
|
|
198
198
|
*/
|
|
199
199
|
unmatchableNoHash: number;
|
|
200
200
|
/**
|
|
201
|
-
* 🔴 判据 1 的**真** mismatch 行数(
|
|
201
|
+
* 🔴 判据 1 的**真** mismatch 行数([ref] 件1③,黑板 [ref]②):三元组身份对得上、两侧摘要都在场却不等。
|
|
202
202
|
*
|
|
203
203
|
* 成因裁定 = **部署自伤,不是不当调用**:core 已证在真正产生两次铸造的弧上摘要恒等,两条分歧路径都要求
|
|
204
204
|
* 部署自己交出活对象(hook/policy 返回己持引用后在两铸点之间突变;或每读返回新值的有状态 getter)。
|
|
@@ -207,7 +207,7 @@ export interface ReconcileStats {
|
|
|
207
207
|
*/
|
|
208
208
|
hashMismatch: number;
|
|
209
209
|
/**
|
|
210
|
-
* 单铸路径行数(
|
|
210
|
+
* 单铸路径行数([ref] 件1②)——**不计入** {@link hashMismatch}。三形分列:
|
|
211
211
|
* `askOnly` 纯 sync / 再审批链;`checkpointOnly` durable-first 干净 args;`neither` 两侧都没铸。
|
|
212
212
|
* 它们都是**结构上只有一侧(或零侧)有摘要**,把它们读成「比过了、不匹配」是把没发生的事记成异常。
|
|
213
213
|
*/
|
|
@@ -215,7 +215,7 @@ export interface ReconcileStats {
|
|
|
215
215
|
singleMintCheckpointOnly: number;
|
|
216
216
|
singleMintNeither: number;
|
|
217
217
|
/**
|
|
218
|
-
* 祖先冻结 approver 层 fold 中途铸点(
|
|
218
|
+
* 祖先冻结 approver 层 fold 中途铸点([ref] 件1④):退出硬相等,不是 mismatch 也不是单铸。
|
|
219
219
|
*
|
|
220
220
|
* 🔴 **今天恒零,而且是结构性的**(扫描P2,2026-08-12 亲读验真;登记而不假称已解):读口
|
|
221
221
|
* `findCheckpointCandidatesForAsk` 按 `session_id = ask.sessionId` 查,`session_id` 列写的是
|
package/dist/approval.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Human-in-the-loop approval gate (F4) — durable-only since 5.0.0 ([
|
|
2
|
+
* Human-in-the-loop approval gate (F4) — durable-only since 5.0.0 ([ref]/[ref] A-5:OA 轮询车道
|
|
3
3
|
* (createOaApprovalPolicy + ApprovalStore pending 行轮询)整体退役;唯一门形 = durable checkpoint
|
|
4
4
|
* suspend/resume,见 createDurableAskPolicy 与 /v1/approvals 的 checkpointStore 腿)。
|
|
5
5
|
*/
|
|
@@ -37,7 +37,7 @@ export declare function assertGateIntentServiceable(config: {
|
|
|
37
37
|
durableApproval: boolean;
|
|
38
38
|
}, checkpointStorePresent: boolean): void;
|
|
39
39
|
/**
|
|
40
|
-
* Durable approval policy (core 1.67 /
|
|
40
|
+
* Durable approval policy (core 1.67 / [ref]): returns three-state **`ask`** for gated tools instead of
|
|
41
41
|
* polling. With `TaskSpec.durableApproval` set + a `checkpointStore` on the Runner, core turns that `ask` into
|
|
42
42
|
* a **suspend** (persists a checkpoint, ends `status:"suspended"`) — no held connection, resumable on any
|
|
43
43
|
* replica. (The former poll-lane
|
package/dist/audit.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Pool as PgPool } from "pg";
|
|
|
3
3
|
/**
|
|
4
4
|
* Audit view of a session = its **current context** (the live messages + the last compaction's
|
|
5
5
|
* summary), i.e. the floor-bounded window — never the full raw transcript. This matches the
|
|
6
|
-
* deployment decision that audit/回溯 needs "current + summary" (
|
|
6
|
+
* deployment decision that audit/回溯 needs "current + summary" ([ref]); the full `session_event`
|
|
7
7
|
* log remains available as a separate cold-forensic query if ever needed.
|
|
8
8
|
*/
|
|
9
9
|
export interface SessionAudit {
|
|
@@ -18,8 +18,8 @@ export interface SessionAudit {
|
|
|
18
18
|
} | null;
|
|
19
19
|
/** Current model context: prior messages with older history collapsed into a summary message. */
|
|
20
20
|
messages: unknown[];
|
|
21
|
-
/** [
|
|
22
|
-
* `session.getPromptEpoch()` — first-class `prompt_epoch` entry, compaction restatement,
|
|
21
|
+
/** [ref]① web 观测切片 B: the session's prompt-epoch pin, core contract verbatim (core 1.304
|
|
22
|
+
* `session.getPromptEpoch()` — first-class `prompt_epoch` entry, compaction restatement, [ref] anchor
|
|
23
23
|
* all inside core). Additive; a pre-epoch session omits the key entirely (undefined). */
|
|
24
24
|
promptEpoch?: {
|
|
25
25
|
epoch: number;
|
|
@@ -57,6 +57,6 @@ export declare function windowMessages(messages: unknown[], opts: {
|
|
|
57
57
|
* string fields of content parts — the shapes core emits; anything else passes through untouched). A capped
|
|
58
58
|
* message gains `truncated: true` (message level — the web renders an expand affordance and refetches that
|
|
59
59
|
* one message at full size). Pure/copy-on-write: uncapped messages keep their original reference.
|
|
60
|
-
* [
|
|
60
|
+
* [ref]①:超预算时引擎注入块(INJECTED_BLOCK_RE 闭集)优先整段让位,用户正文最后截。 */
|
|
61
61
|
export declare function truncateMessageBlobs(messages: unknown[], capBytes: number): unknown[];
|
|
62
62
|
//# sourceMappingURL=audit.d.ts.map
|
package/dist/auth-keys.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AUTH KEY-SET parsing (
|
|
2
|
+
* AUTH KEY-SET parsing ([ref] A4) — the env→key-set decoders for the two D-G credential planes, moved VERBATIM
|
|
3
3
|
* out of security.ts: {@link parseApprovalHmacKeys} (APPROVAL_HMAC_KEYS — the rotating HMAC secret set, decision
|
|
4
4
|
* INTEGRITY) and {@link parsePrincipalJwks} (PRINCIPAL_JWT_PUBKEYS — the rotating issuer public-key set, principal
|
|
5
5
|
* IDENTITY). config.ts consumes ONLY these two functions + their row types at env-load time, and importing them from
|
|
6
6
|
* security.ts made the base config layer value-depend on the whole 55KiB auth module (lens2 §F). This file is a pure
|
|
7
7
|
* leaf (JSON.parse + shape filters, zero repo imports); the VERIFIERS that consume the parsed key-sets
|
|
8
|
-
* (verifyApprovalHmac / verifyPrincipalJwt) stay in ./approval-hmac.ts and ./principal-jwt.ts; consumers import these four names from HERE ([
|
|
8
|
+
* (verifyApprovalHmac / verifyPrincipalJwt) stay in ./approval-hmac.ts and ./principal-jwt.ts; consumers import these four names from HERE ([ref] 兼容面全清).
|
|
9
9
|
*/
|
|
10
10
|
/** One key in the rotating HMAC key-set. `kid` lets the verifier pick the signing key (or fall back to trying the
|
|
11
11
|
* whole set); `status` lets sema-registry rotate without breaking in-flight approvals: `active` = sign + verify,
|
|
@@ -16,7 +16,7 @@ export interface ApprovalHmacKey {
|
|
|
16
16
|
status?: "active" | "retiring";
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* [ref](黑板 [ref]③「坏值禁静默回默认」)—— 一条**被丢弃**的 key-set 条目的诊断。
|
|
20
20
|
*
|
|
21
21
|
* 为什么两个解析器要新长一个必填出口:它们的 fail-closed 方向是对的(坏形 ⇒ `[]` ⇒ 门关着),但**丢弃
|
|
22
22
|
* 本身此前零留痕**。真场景:轮换新钥时手滑把 `key` 写成 `secret`,这一条被 `filter` 悄悄滤掉,进程照常
|
|
@@ -32,13 +32,13 @@ export interface KeySetRejection {
|
|
|
32
32
|
reason: string;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* 诊断出口**必填**(不是 `onReject?:`)。可选回调 = 「没人接就等于错误蒸发」,正是本仓
|
|
35
|
+
* 诊断出口**必填**(不是 `onReject?:`)。可选回调 = 「没人接就等于错误蒸发」,正是本仓 [ref] 静默降级
|
|
36
36
|
* 门数的 SHAPE B;这两条钥又都在凭据轴上,所以由**类型**逼每个调用点当场表态,而不是靠人记得去接。
|
|
37
37
|
*/
|
|
38
38
|
export type OnKeySetRejection = (rejection: KeySetRejection) => void;
|
|
39
39
|
/** Parse APPROVAL_HMAC_KEYS — a sema-registry-managed, rotating key-SET, as a JSON array of {kid,key,status}.
|
|
40
40
|
* Empty / unset / unparseable ⇒ `[]` ⇒ HMAC verification is OFF (D-G inactive; back-compat, BFF-only door).
|
|
41
|
-
* fail-closed 语义与改前**逐字相同**;新增的只有 `onReject`(
|
|
41
|
+
* fail-closed 语义与改前**逐字相同**;新增的只有 `onReject`([ref]:每一条被丢弃的条目都要说出来)。 */
|
|
42
42
|
export declare function parseApprovalHmacKeys(raw: string | undefined, onReject: OnKeySetRejection): ApprovalHmacKey[];
|
|
43
43
|
/** One issuer public key in the rotating principal JWKS (mirror of the HMAC key-set rotation discipline). The
|
|
44
44
|
* `alg` is PINNED per key — the JWT header's alg MUST match it, killing alg-confusion (`none`, HS-with-the-pubkey).
|
|
@@ -51,7 +51,7 @@ export interface PrincipalJwtKey {
|
|
|
51
51
|
}
|
|
52
52
|
/** Parse PRINCIPAL_JWT_PUBKEYS — a JSON array of {kid,alg,key,status}. Empty/unset/malformed ⇒ [] ⇒ no trust
|
|
53
53
|
* anchor ⇒ the direct door cannot open (D-G inactive). Each entry must have kid + a pinned alg + a PEM key.
|
|
54
|
-
*
|
|
54
|
+
* [ref]: fail-closed 语义逐字不变,但每条被丢弃的条目经 `onReject` 报出(序号 + 缺陷字段名,不带值)——
|
|
55
55
|
* 这里的 key 是**公**钥,但 reason 仍只说字段名,与 HMAC 那条同形(两个出口的口径不该分岔)。 */
|
|
56
56
|
export declare function parsePrincipalJwks(raw: string | undefined, onReject: OnKeySetRejection): PrincipalJwtKey[];
|
|
57
57
|
//# sourceMappingURL=auth-keys.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* L8 G-c artifact — the signed deploy-authenticity evidence the
|
|
2
|
+
* L8 G-c artifact — the signed deploy-authenticity evidence the [ref] §5.2 G-c aggregator requires
|
|
3
3
|
* (SPEC-RSI-L7-L8 §A.3). The artifact is canonical-JSON serialized and ed25519-signed so the GO aggregator can
|
|
4
4
|
* verify it was produced by a real L8 run and link it to a commit + adapter build + boundary.
|
|
5
5
|
*
|
|
@@ -88,6 +88,11 @@ export interface BuildArtifactMeta {
|
|
|
88
88
|
* Canonical JSON: object keys sorted recursively, no insignificant whitespace, arrays preserve order. Stable
|
|
89
89
|
* across re-serialization so the signature/contentHash are deterministic. Rejects non-finite numbers (NaN/Inf
|
|
90
90
|
* would serialize as `null` and silently corrupt the canonical form).
|
|
91
|
+
*
|
|
92
|
+
* [ref](2026-08-31)起 = 本仓共享件 `src/canonical-json.ts#canonicalJsonStrict` 的再导出:校验集/错误文案与
|
|
93
|
+
* 合并前本文件的 `serialize` 逐字同(`/non-finite/` 等钉在 test/l8-deploy-contract.test.ts),通过校验的输入域上
|
|
94
|
+
* 输出字节与合并前逐字节相同(test/canonical-json-golden.test.ts,基线 cb543ad 的 contentHash 落盘)。
|
|
95
|
+
* 签名/contentHash 的载荷语义一个字节不动。
|
|
91
96
|
*/
|
|
92
97
|
export declare function canonicalJson(value: unknown): string;
|
|
93
98
|
/** sha256 of the canonical body — links the signature to the exact body bytes. */
|
|
@@ -1,33 +1,8 @@
|
|
|
1
1
|
import { createPrivateKey, createPublicKey, sign as cryptoSign, verify as cryptoVerify } from "node:crypto";
|
|
2
2
|
import { L8_SCHEMA_VERSION } from "./escape.js";
|
|
3
|
+
import { canonicalJsonStrict } from "../../canonical-json.js";
|
|
3
4
|
export function canonicalJson(value) {
|
|
4
|
-
return
|
|
5
|
-
}
|
|
6
|
-
function serialize(v) {
|
|
7
|
-
if (v === null)
|
|
8
|
-
return "null";
|
|
9
|
-
const t = typeof v;
|
|
10
|
-
if (t === "number") {
|
|
11
|
-
if (!Number.isFinite(v))
|
|
12
|
-
throw new Error("canonicalJson: non-finite number is not serializable");
|
|
13
|
-
return JSON.stringify(v);
|
|
14
|
-
}
|
|
15
|
-
if (t === "boolean" || t === "string")
|
|
16
|
-
return JSON.stringify(v);
|
|
17
|
-
if (t === "undefined" || t === "function")
|
|
18
|
-
throw new Error(`canonicalJson: ${t} is not serializable`);
|
|
19
|
-
if (Array.isArray(v))
|
|
20
|
-
return `[${v.map((x) => serialize(x === undefined ? null : x)).join(",")}]`;
|
|
21
|
-
if (t === "object") {
|
|
22
|
-
const obj = v;
|
|
23
|
-
const keys = Object.keys(obj)
|
|
24
|
-
.filter((k) => obj[k] !== undefined)
|
|
25
|
-
.sort();
|
|
26
|
-
return `{${keys.map((k) => `${JSON.stringify(k)}:${serialize(obj[k])}`).join(",")}}`;
|
|
27
|
-
}
|
|
28
|
-
if (t === "bigint")
|
|
29
|
-
throw new Error("canonicalJson: bigint is not serializable");
|
|
30
|
-
throw new Error(`canonicalJson: unsupported type ${t}`);
|
|
5
|
+
return canonicalJsonStrict(value);
|
|
31
6
|
}
|
|
32
7
|
import { createHash } from "node:crypto";
|
|
33
8
|
function signableBody(a) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* L8 escape vocabulary — the `l8.v1` schema (
|
|
2
|
+
* L8 escape vocabulary — the `l8.v1` schema ([ref] §2, SPEC-RSI-L7-L8 §A.3).
|
|
3
3
|
*
|
|
4
4
|
* 🔴 WHY A SEPARATE SCHEMA (do NOT silently reuse core's L6 union):
|
|
5
5
|
* core's L6 bench (`sema-core/test/rsi-l6-bench.test.ts:92-94`, VERIFIED) defines
|
|
@@ -21,7 +21,7 @@ export declare const L8_SCHEMA_VERSION: "l8.v1";
|
|
|
21
21
|
export type L8SchemaVersion = typeof L8_SCHEMA_VERSION;
|
|
22
22
|
/**
|
|
23
23
|
* Escape kinds. E1 / E2-readable / E2-callable mirror core's L6 union EXACTLY (so an aggregator can fold them);
|
|
24
|
-
* E3 is the L8-only deploy/side-effect kind core's L6 vocab lacks (
|
|
24
|
+
* E3 is the L8-only deploy/side-effect kind core's L6 vocab lacks ([ref] §2 row E3).
|
|
25
25
|
*/
|
|
26
26
|
export type L8EscapeKind = "E1" | "E2-readable" | "E2-callable" | "E3";
|
|
27
27
|
/**
|
|
@@ -39,7 +39,7 @@ export interface L8Escape {
|
|
|
39
39
|
detail: string;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* 🔴 OPEN QUESTION (cross-team, do NOT resolve unilaterally — SPEC §A.3 /
|
|
42
|
+
* 🔴 OPEN QUESTION (cross-team, do NOT resolve unilaterally — SPEC §A.3 / [ref] open-questions):
|
|
43
43
|
* whether the GO aggregator accepts `l8.v1` + ed25519 verification + an E3/deploy lane, OR core extends its
|
|
44
44
|
* L6 `EscapeKind`/`Classification` instead. Until confirmed, this constant records the unaligned state so a
|
|
45
45
|
* reader (and a test) cannot mistake "L8 ships its own schema" for "the vocabularies are already merged".
|
package/dist/bench/l8/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* L8 deploy-contract authenticity bench (RSI L8,
|
|
2
|
+
* L8 deploy-contract authenticity bench (RSI L8, [ref] §5.2 G-c, SPEC-RSI-L7-L8 §A).
|
|
3
3
|
*
|
|
4
4
|
* NO-DEPENDENCY scaffold: the probe matrix + the l8.v1 escape schema + the signed G-c artifact (build/sign/verify)
|
|
5
5
|
* + the probe HARNESS that runs the BUILDABLE probes (P0 runtime-verification, P2 isolation) and emits HONEST
|
package/dist/bench/s1/arms.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* repair + steering + plan_review; TEAM = runLeaderTask). Each arm emits ONE conformant s1.v1 RawRow per
|
|
5
5
|
* (task × arm × seed) — RawRow === core RunRecord (row.ts).
|
|
6
6
|
*
|
|
7
|
-
* 🔴 THE s1.v1 PRODUCER OBLIGATIONS (
|
|
7
|
+
* 🔴 THE s1.v1 PRODUCER OBLIGATIONS ([ref]):
|
|
8
8
|
* - `arm` is the LOWERCASE wire tag (armTag). `runStatus` is HONEST — an infra death (OOM/passthrough/
|
|
9
9
|
* nested-root crash) is "infra-failed" and EXCLUDED from scoring (the metric tool drops it); default "scored".
|
|
10
10
|
* - `oracle` = the 4 OBJECTIVE booleans (the measure). `delivery.withheld` is ONLY ever true for SUP/TEAM —
|
|
@@ -139,13 +139,13 @@ export declare function classifyRunStatus(input: {
|
|
|
139
139
|
/**
|
|
140
140
|
* Capture the s1.v1 `stats` subset directly off a core `TaskResult.stats` (costBreakdown C1 + humanReview C2).
|
|
141
141
|
* Assign-direct: the field names/shapes match core's bench subpath contract(1.110.0 首发;现行 core 已扩 humanReview.gates[toolName?/toolArg?],service 只读子集向后兼容——L17)— no transformation, no pre-composed scalar.
|
|
142
|
-
* C2 (human seconds) is NEVER folded into C1 (token µUSD) — three separate axes (
|
|
142
|
+
* C2 (human seconds) is NEVER folded into C1 (token µUSD) — three separate axes ([ref] §2.1).
|
|
143
143
|
*/
|
|
144
144
|
export declare function captureStats(stats: TaskResult["stats"] | undefined): EmittedStats;
|
|
145
145
|
/**
|
|
146
146
|
* 🔴 Corr #5 — the COMPLETE TEAM `stats`. Σ(worker stats.costBreakdown + humanReview) PLUS the merge legs:
|
|
147
147
|
* `repair?.costUsd` and `conflictResolverCostUsd` (the resolver cost was just un-dropped in merge.ts). All three
|
|
148
|
-
* legs, or TEAM C1 is undercounted (
|
|
148
|
+
* legs, or TEAM C1 is undercounted ([ref]'s #1 confound). costUsd (float USD) → µUSD into llmRoot.
|
|
149
149
|
*/
|
|
150
150
|
export declare function captureTeamStats(reports: WorkerReport[], merge: MergeResult | undefined): EmittedStats;
|
|
151
151
|
/**
|