@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical JSON(键递归排序、零空白、数组保序)—— 本仓所有「先序列化再 sha256 / 指纹自比」站点的**单一序列化器**
|
|
3
|
+
* ([ref] / [ref],2026-08-31 合并批)。
|
|
4
|
+
*
|
|
5
|
+
* ## 为什么只能有一个
|
|
6
|
+
* 合并前本仓有 **5 处**手写复刻(memory-origin-fence / permission-rule-store-sql / bench-l8 artifact /
|
|
7
|
+
* config-center restart-signal / mcp-revocation),每处一份「排 key、递归、拼串」——同一个算法五份实现,
|
|
8
|
+
* 语义在边缘(undefined 值键、函数成员、非有限数)各自漂了一点。指纹型代码的病灶恰恰在边缘:同一份内容算出
|
|
9
|
+
* 两个指纹 = 落库 checksum 失配 / 误签 restart / 包完整性自校验对不上。
|
|
10
|
+
*
|
|
11
|
+
* ## 语义 = core `canonicalJsonStringify` 的**逐字港**(fidelity 高于「更漂亮」)
|
|
12
|
+
* 治理携出包(`POST /v1/memory/export`)的 `integrity.sectionHashes.entries` 必须与 core 铸包/校验时算的
|
|
13
|
+
* 哈希**逐字节相同**(core `memoryBundleInvalid` 三向对账),而 core 公共面只出口 `computeMemoryBundleHash`
|
|
14
|
+
* (Record 特化),不出口这只序列化器(`dist/core/memory-engine/file-backend.js#canonicalJsonStringify`,
|
|
15
|
+
* exports 封死)——所以本仓必须持有一份逐字港,且**不得**在下游「修」它的边缘行为(源头修复纪律:
|
|
16
|
+
* core 若改形,港随之改;本仓不做第二个写者)。防漂移钉 = `test/memory-origin-fence.test.ts` §④(期望哈希全
|
|
17
|
+
* 经 core 出口独立算出)。
|
|
18
|
+
*
|
|
19
|
+
* 语义表(与 core 逐字同;`test/canonical-json.test.ts` 逐行钉):
|
|
20
|
+
* · 对象:own 可枚举键,**值为 `undefined` 的键省略**(与 `JSON.stringify` 同),其余按 UTF-16 码元序排序
|
|
21
|
+
* (`Object.keys().sort()`,数字形键同样按字符串序:`"10" < "2"`);键经 `JSON.stringify` 转义。
|
|
22
|
+
* · 数组:保序;元素 `undefined` / 函数 / symbol ⇒ `null`(与 `JSON.stringify` 同)。
|
|
23
|
+
* · 标量:`JSON.stringify`(`NaN`/`±Infinity` ⇒ `null`、`-0` ⇒ `0`、字符串转义与 `JSON.stringify` 同)。
|
|
24
|
+
* · **非 JSON 输入的港继承形(不是本仓的设计,是 core 的形,如实记)**:对象成员为函数/symbol 时,键**保留**
|
|
25
|
+
* 而值经 `JSON.stringify` 得 `undefined` ⇒ 拼出字面 `undefined`(非法 JSON 文本);顶层 `undefined`/函数/symbol
|
|
26
|
+
* ⇒ 返回 `undefined`(非字符串)。五个站点的真实输入全是 JSON 形(JSON.parse 产物 / DB 行 / zod 解析产物),
|
|
27
|
+
* 这两条**不可达**;需要「非法输入响亮拒」的站点用 {@link canonicalJsonStrict}。
|
|
28
|
+
* · `Date`/`Map`/`Set`/类实例:按普通对象处理(own 可枚举键 ⇒ `Date` 成 `{}`),**不调 `toJSON`**——与 core 同。
|
|
29
|
+
* · `bigint`:`JSON.stringify` 抛 TypeError,原样上抛。
|
|
30
|
+
*
|
|
31
|
+
* ## 不在本文件里的第二形(如实登记)
|
|
32
|
+
* `src/config-center/restart-signal.ts#stableStringify`(mcp-revocation 同源改调)是**另一个语义**:undefined 值键
|
|
33
|
+
* **保留为 `"k":null`**。两族在 JSON 形输入上逐字节相同(golden 交叉读数已证),分歧只在进程内构造的
|
|
34
|
+
* `{k: undefined}` 形——restart 指纹的输入正是进程内切片对象,该形原则上可达,而 `{k:undefined}` 与 `{}` 是否
|
|
35
|
+
* 同指纹是 restart-signal 轴上的**行为**(多签/少签一次 fleet 滚动重启),不是序列化器的私事 ⇒ 本批不并
|
|
36
|
+
* (语义恒等才可合并),golden 各自钉,K→O 统一另立件走三问。
|
|
37
|
+
*/
|
|
38
|
+
/** core `canonicalJsonStringify` 的逐字港(语义表见文件头)。 */
|
|
39
|
+
export declare function canonicalJson(value: unknown): string;
|
|
40
|
+
/**
|
|
41
|
+
* 严格形:先按**同一遍历序**校验,再交 {@link canonicalJson} 序列化 —— 被签名/被内容哈希的载荷(bench/l8 部署
|
|
42
|
+
* 真实性 artifact)不许把 `NaN`/`Infinity` 静默写成 `null`(签名盖在坏字节上),也不许把函数/bigint/顶层
|
|
43
|
+
* `undefined` 当作可序列化。校验通过的输入域上,输出与 {@link canonicalJson} **逐字节相同**(golden 钉);
|
|
44
|
+
* 拒绝集与错误文案 = 合并前 `src/bench/l8/artifact.ts#serialize` 逐字(`test/l8-deploy-contract.test.ts` 钉
|
|
45
|
+
* `/non-finite/`):
|
|
46
|
+
* · 非有限数(任意深度)⇒ `canonicalJson: non-finite number is not serializable`
|
|
47
|
+
* · `undefined`(顶层)/ 函数(任意深度,数组元素亦然)⇒ `canonicalJson: <typeof> is not serializable`
|
|
48
|
+
* · `bigint` ⇒ `canonicalJson: bigint is not serializable`;symbol ⇒ `canonicalJson: unsupported type symbol`
|
|
49
|
+
* · 数组元素 `undefined` ⇒ `null`(放行);对象成员 `undefined` ⇒ 省略(放行)。
|
|
50
|
+
* 遍历序 = 数组下标序、对象**排序后**键序(多处坏值时抛出的是遍历序上第一处——与合并前行为同)。
|
|
51
|
+
*/
|
|
52
|
+
export declare function canonicalJsonStrict(value: unknown): string;
|
|
53
|
+
//# sourceMappingURL=canonical-json.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function canonicalJson(value) {
|
|
2
|
+
if (Array.isArray(value))
|
|
3
|
+
return `[${value.map((v) => (v === undefined || typeof v === "function" || typeof v === "symbol" ? "null" : canonicalJson(v))).join(",")}]`;
|
|
4
|
+
if (value !== null && typeof value === "object") {
|
|
5
|
+
const rec = value;
|
|
6
|
+
const keys = Object.keys(rec)
|
|
7
|
+
.filter((k) => rec[k] !== undefined)
|
|
8
|
+
.sort();
|
|
9
|
+
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalJson(rec[k])}`).join(",")}}`;
|
|
10
|
+
}
|
|
11
|
+
return JSON.stringify(value);
|
|
12
|
+
}
|
|
13
|
+
export function canonicalJsonStrict(value) {
|
|
14
|
+
assertCanonicalJsonSerializable(value);
|
|
15
|
+
return canonicalJson(value);
|
|
16
|
+
}
|
|
17
|
+
function assertCanonicalJsonSerializable(v) {
|
|
18
|
+
if (v === null)
|
|
19
|
+
return;
|
|
20
|
+
const t = typeof v;
|
|
21
|
+
if (t === "number") {
|
|
22
|
+
if (!Number.isFinite(v))
|
|
23
|
+
throw new Error("canonicalJson: non-finite number is not serializable");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (t === "boolean" || t === "string")
|
|
27
|
+
return;
|
|
28
|
+
if (t === "undefined" || t === "function")
|
|
29
|
+
throw new Error(`canonicalJson: ${t} is not serializable`);
|
|
30
|
+
if (Array.isArray(v)) {
|
|
31
|
+
for (const x of v)
|
|
32
|
+
assertCanonicalJsonSerializable(x === undefined ? null : x);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (t === "object") {
|
|
36
|
+
const obj = v;
|
|
37
|
+
const keys = Object.keys(obj)
|
|
38
|
+
.filter((k) => obj[k] !== undefined)
|
|
39
|
+
.sort();
|
|
40
|
+
for (const k of keys)
|
|
41
|
+
assertCanonicalJsonSerializable(obj[k]);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (t === "bigint")
|
|
45
|
+
throw new Error("canonicalJson: bigint is not serializable");
|
|
46
|
+
throw new Error(`canonicalJson: unsupported type ${t}`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=canonical-json.js.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* center prompts 消费投影腿([
|
|
3
|
-
* [
|
|
2
|
+
* center prompts 消费投影腿([ref]④/[ref]③ 分工:web 承存储+covering 解析+下发,server 承本模块;
|
|
3
|
+
* [ref] 下发形定稿 / [ref] registry-core 0.10.16 schema / [ref]⑤「server 零新义务=逐字透传」)。
|
|
4
4
|
*
|
|
5
|
-
* 链路:center(sema-web)把 covering 走完的**基线终形**经 `GET /api/config/effective` 的 additive
|
|
5
|
+
* 链路:center(sema-web-admin,2026-08-26 由 sema-web 改名)把 covering 走完的**基线终形**经 `GET /api/config/effective` 的 additive
|
|
6
6
|
* `prompts` key 下发 → 本模块按任务 scenario 选包(`scenarioOverrides[s] ?? sections`,整包替换非增量,
|
|
7
|
-
* [
|
|
7
|
+
* [ref]①c)→ 声明数组**逐字**(含 opt-in `contentHash`,core 1.315 校验+manifest 透传)喂 core 既有
|
|
8
8
|
* typed `stableBlocks` 钩子。守卫全在 core(id 规范/slot 闭集/core/ 命名空间拒绝/identity 三锚
|
|
9
|
-
* pass-through/锁定槽不可写)——server 不做语义复检([
|
|
9
|
+
* pass-through/锁定槽不可写)——server 不做语义复检([ref]①f:identity 完整角色层由 center 编辑面把关)。
|
|
10
10
|
*
|
|
11
11
|
* 仅有的一层「形校验」不是语义复检,是**防炸底线**(详见其现居所 `src/prompts-domain-validate.ts`——
|
|
12
|
-
* 判形半场已下沉到该中立叶子,本文件 re-export 保兼容;
|
|
12
|
+
* 判形半场已下沉到该中立叶子,本文件 re-export 保兼容;[ref] S6,lens2 §G):core 对坏形声明的
|
|
13
13
|
* 守卫是 THROW(assemble 期),server 在采用前做结构判形,坏形=拒绝采用该候选的 prompts 面。
|
|
14
14
|
*
|
|
15
15
|
* 生效语义(两段史):1.222 时 core 1.315 的 epoch 是 bundled-only(声明不进 descriptor),热换=resume
|
|
16
|
-
* 三失真,故临时 restart-to-apply;core 1.316([
|
|
16
|
+
* 三失真,故临时 restart-to-apply;core 1.316([ref] 裁 a/[ref]d)把声明以 (id,slot,chars,contentHash?)
|
|
17
17
|
* 纳入 artifactDigest——声明变=digest 变=**下任务边界自动重 pin**(既有 legacy_migration 机制接手),
|
|
18
18
|
* 进行中会话 epoch pin 保稳。自此恢复**热采用**(main.ts boot+refresh 双点 adopt),与 center
|
|
19
|
-
* 「发布=新任务生效」产品语义对齐([
|
|
20
|
-
* 防会话可导出面字典预映)——center 链路恒逐 section 铸([
|
|
19
|
+
* 「发布=新任务生效」产品语义对齐([ref]②b)。字节级检测只认 opt-in contentHash(文本不进 digest,
|
|
20
|
+
* 防会话可导出面字典预映)——center 链路恒逐 section 铸([ref]),本投影逐字透传即全强度。
|
|
21
21
|
*/
|
|
22
22
|
import { type PromptProvider, type PublishedPromptArtifactEnvelope } from "@sema-agent/core";
|
|
23
23
|
import { type EffectiveCenterPrompts, type PromptsDomainFaces } from "../prompts-domain-validate.js";
|
|
24
24
|
/** 判形半场(validateCenterPrompts/validatePromptsDomain/CORE_ENGINE_VERSION 及两 interface)已下沉到
|
|
25
|
-
* 中立叶子 `src/prompts-domain-validate.ts`(
|
|
25
|
+
* 中立叶子 `src/prompts-domain-validate.ts`([ref] S6);消费者直引真源([ref] 兼容面全清,
|
|
26
26
|
* 此处兼容 re-export 已删)。 */
|
|
27
|
-
/** [
|
|
27
|
+
/** [ref]b / [ref] — §9.4 by-digest 补拉组合店:local miss ⇒ fetchRaw(digest) 从 center 拉 envelope ⇒
|
|
28
28
|
* core verifyPromptArtifact 全管线 + **回验「拿到的=要的」digest 逐位**(center 答非所问=丢弃)⇒
|
|
29
29
|
* best-effort 回写 inner(下次直命中)。任何失败=undefined(诚实缺席,fail-loud 归 core 的
|
|
30
30
|
* prompt_snapshot_unavailable——绝不拼杂交)。 */
|
|
@@ -37,7 +37,7 @@ export declare function withPromptArtifactBackfill(inner: {
|
|
|
37
37
|
info: (msg: string, meta?: Record<string, unknown>) => void;
|
|
38
38
|
warn: (msg: string, meta?: Record<string, unknown>) => void;
|
|
39
39
|
}): typeof inner;
|
|
40
|
-
/** e/b 接线([
|
|
40
|
+
/** e/b 接线([ref]① seam/[ref]e):catalog 轴的两态过渡推进 core 的 CenterPromptSource——
|
|
41
41
|
* present(且身份变)⇒ applySnapshot(core 重验+落盘+原子换 candidate;validate 已过 core verify,
|
|
42
42
|
* 此处失败=磁盘/状态写问题,warn 不挡 declaration 轴);absent-after-present / prompts 键整体消失
|
|
43
43
|
* ⇒ applyDisabled(闸关=显式撤下语义的 catalog 轴半场,离线重启不复活)。幂等安全:同 envelope
|
|
@@ -69,7 +69,7 @@ export declare function centerPromptProvider(prompts: EffectiveCenterPrompts, sc
|
|
|
69
69
|
* M9 迁移卫在 provider.stableBlocks 的 identity 声明上探同三锚,命中即走 pass-through 臂(其保留集无
|
|
70
70
|
* `core/role.append`,任何 append rider/outputStyle 会被静默丢)。选包与 {@link centerPromptProvider}
|
|
71
71
|
* 同式(`overrides[s] ?? sections`);锚谓词由调用方注入(task-settings `hasConstitutionAnchors` 单真源)。
|
|
72
|
-
* [
|
|
72
|
+
* [ref]①f 的「server 不做语义复检」不动:这不是复检语义,是为 capabilities.appendSystemPrompt 的诚实面
|
|
73
73
|
* 探 core 会走哪条臂。 */
|
|
74
74
|
export declare function centerIdentityAssembled(prompts: EffectiveCenterPrompts, scenarioName: string, isAssembled: (text: unknown) => boolean): boolean;
|
|
75
75
|
//# sourceMappingURL=center-prompts.d.ts.map
|
|
@@ -35,7 +35,7 @@ export interface CollabWorkflowProjection {
|
|
|
35
35
|
export declare function projectCollabToWorkflows(templates: readonly CollabTemplateWire[] | undefined): CollabWorkflowProjection;
|
|
36
36
|
export declare function registerCollabWorkflows(workflows: Record<string, CollabWorkflowEntry>): void;
|
|
37
37
|
/** composite WorkflowScriptStore 的 resolveName 前段:collab 命中 ⇒ 内置 team-discussion 脚本+本模板
|
|
38
|
-
* defaultArgs(同名 SHADOW core 内置,
|
|
38
|
+
* defaultArgs(同名 SHADOW core 内置,[ref] §6 1c)。🔴 Object.hasOwn — `name` 是模型供给的
|
|
39
39
|
* (run-workflow-tool 原样传 rawName):裸索引会让 Object.prototype 成员名("constructor"/"toString"/
|
|
40
40
|
* "__proto__"…)假命中 ⇒ 零模板注册也能烧真讨论、且同名文件 store 条目被遮蔽(交叉评审 2026-07-11 MED)。 */
|
|
41
41
|
export declare function resolveCollabWorkflow(name: string): {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] 场景 hands lane —— 「要手的场景」与「无手的场景」在装配层分家。
|
|
3
3
|
*
|
|
4
|
-
* 根本问题(设计小票 §1,案源 [
|
|
4
|
+
* 根本问题(设计小票 §1,案源 [ref]/[ref]/[ref]):core 的手带工具面是 **per-Runner 表态**
|
|
5
5
|
* (`prepare-task`:`handsEnabled = ownedEnv || deps.executionEnv`,ownedEnv 只要挂了
|
|
6
6
|
* `executionEnvFactory` 就每任务必铸)。server 此前全场景共享一只 runner + 一只 subRunner,
|
|
7
7
|
* 于是任何 REMOTE_EXEC 部署里,声明 clone-free 的 `scan`、只有 `run_council` 的评审团、
|
|
@@ -44,11 +44,11 @@ export declare function pickHandsRunner(hands: ScenarioHands, pair: HandsRunnerP
|
|
|
44
44
|
* ⚠️ 本全集是**观测口径**(用于防漂移对账),**不是** deny 名单 —— deny 用下面的
|
|
45
45
|
* {@link HANDS_EXCLUSIVE_TOOL_NAMES},理由见那里。
|
|
46
46
|
*
|
|
47
|
-
* 🚨 [
|
|
47
|
+
* 🚨 [ref] P0(2026-08-09):派生时必须过滤 core 的 `RETIRED_TOOL_NAMES` —— core 5.21.0 的
|
|
48
48
|
* `HAND_TOOL_EFFECTS` 里残留已退役的 `MultiEdit`,而 core `prepare-task` 的策略名审计见退役名
|
|
49
49
|
* **无条件 throw**(`config.legacy_tool_name`);不过滤,deny 名单一进 `spec.toolPolicy`,
|
|
50
50
|
* `hands: none` 三场景(scan/code-review/team)在**所有部署**上零 turn 全灭。core 5.21.1 已删
|
|
51
|
-
* 那条死条目([
|
|
51
|
+
* 那条死条目([ref]),这道 filter 是结构性防御:将来 core 再退役任何 band 名都不会重演
|
|
52
52
|
* (test/scenario-hands-lane.test.ts 格7/格8 双钉:真 Runner 过审计 + 零交集门)。
|
|
53
53
|
* filter 打在**整表**(effect 表 + 锚定补集)之后 —— caret floor 下装置会解析到更新的 core,
|
|
54
54
|
* 补集名哪天被退役,只滤前半就是同一次故障换个名字(codex 复审 finding,2026-08-09)。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref](板 [ref]②/[ref]④ 两次点名的 server 接线半场)—— 零记忆面部署形的**持久记忆披露**。
|
|
3
3
|
*
|
|
4
|
-
* 病(core [
|
|
4
|
+
* 病(core [ref] 实测,[ref] 立案):一台没有任何持久记忆面的部署,用户说「请记住 X」,模型回一句
|
|
5
5
|
* 「已经记住了」——落盘处并不存在。用户带着「这条事实已入库」的信念离开,下一次会话才发现是空的。
|
|
6
6
|
*
|
|
7
7
|
* core 5.26.0 的分工:引擎**能自证**只读的两态(engine 侧 `writeScope:null` / runner 侧 `handsReadOnly`)
|
|
@@ -41,7 +41,7 @@ export interface MemoryFaceFacts {
|
|
|
41
41
|
/** 部署声明 `MEMORY_PERSISTENCE_CAPABLE`(三态)。`true` = operator 自证有推断看不见的持久通道
|
|
42
42
|
* (自定义 writer / MCP 记忆服务)⇒ 披露会变成假话,撤回;`false` = 强制披露;缺席 ⇒ 走推断。 */
|
|
43
43
|
declaredCapable: boolean | undefined;
|
|
44
|
-
/** 本请求命中场景的手带表态(
|
|
44
|
+
/** 本请求命中场景的手带表态([ref] 判别位)。`none` = 该场景跑在不挂 `executionEnvFactory` 的 Runner 上,
|
|
45
45
|
* core 的手带 band(Bash/Edit/Write/…)整批不 mount。 */
|
|
46
46
|
hands: ScenarioHands;
|
|
47
47
|
/** 折完 governance+settings 后的最终 `handsReadOnly`(plan 模式 / autonomy 收窄)。手带只剩读腿。 */
|
|
@@ -56,7 +56,7 @@ export interface MemoryFaceFacts {
|
|
|
56
56
|
* `handsEnabled && isRemoteExecutionEnv` 时把 Write/Edit/NotebookEdit/Bash **全部不算**落盘路(沙箱盘
|
|
57
57
|
* 每任务即焚,够不着 host 记忆根)。而 server 在任何 remote 车道上默认让记忆引擎 dark —— 两件事合起来
|
|
58
58
|
* 正是**最常见的云部署形**:引擎不在、手带在,却一份持久面都没有。漏了这一位,那台机器就继续给
|
|
59
|
-
* 「已经记住了」的幻觉式回执 —— 恰恰是
|
|
59
|
+
* 「已经记住了」的幻觉式回执 —— 恰恰是 [ref] 立案要消灭的形态。 */
|
|
60
60
|
remoteExecutionEnv: boolean;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -4,12 +4,12 @@ import type { PromptProvider } from "@sema-agent/core";
|
|
|
4
4
|
* `stableSystem` returns ONLY the role layer (base + the task's own systemPrompt) and **core appends
|
|
5
5
|
* the constitution structurally** — harness/safety blocks (Truth/CYBER_RISK/URL_SAFETY), mode blocks,
|
|
6
6
|
* AND the memory safety/hygiene guidance (`constitutionBlocks`), plus the volatile `<user_memory>`
|
|
7
|
-
* tail LAST (
|
|
7
|
+
* tail LAST ([ref] prefix-cache discipline; guarded in CI by `assertPromptCacheFriendly`).
|
|
8
8
|
*
|
|
9
9
|
* History: the pre-1.243 seam made this helper's whole-prompt replacement silently DROP
|
|
10
10
|
* core's constitution — oa/code-review/team ran with zero safety blocks. Same batch also moved
|
|
11
11
|
* MEMORY_SAFETY/MEMORY_HYGIENE into the constitution layer, so the hand-composition this helper used
|
|
12
|
-
* to do (core 1.62,
|
|
12
|
+
* to do (core 1.62, [ref]) would now DOUBLE-inject them — both removed; core owns the discipline
|
|
13
13
|
* (consolidation mutual-exclusion included). This stays a thin role-layer join so scenarios don't
|
|
14
14
|
* re-implement the same two-line body five times.
|
|
15
15
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* when core destroys the env. No core change, no parallel abstraction — pure deployment glue on a seam
|
|
9
9
|
* the deployment already owns.
|
|
10
10
|
*
|
|
11
|
-
* The send itself is the anti-relay shape ([
|
|
11
|
+
* The send itself is the anti-relay shape ([ref]; k8s workspace-snapshot posture): the server presigns a
|
|
12
12
|
* single-object PUT (120s, method-bound, STAGING key — 修3), the SANDBOX `curl -T`s the file straight to S3 — bytes never
|
|
13
13
|
* relay through the server, S3 credentials never enter the sandbox. Tenant isolation = the sandbox can
|
|
14
14
|
* only read its own filesystem, which is exactly the tenant's task workspace; that is why this lane is
|
|
@@ -85,7 +85,7 @@ export declare class TaskEnvRegistry {
|
|
|
85
85
|
* residue of tenant B's task → the isolation premise FAILS. Multi-tenant here would be an
|
|
86
86
|
* arbitrary-host-path-read → public-URL exfil face, so the lane opens ONLY single-user
|
|
87
87
|
* (`requirePrincipal !== true`), the exact gate the host lane uses. NOT a lane to "fix later with a
|
|
88
|
-
* per-task workspace": tasks legitimately operate outside any workspace on a real host (
|
|
88
|
+
* per-task workspace": tasks legitimately operate outside any workspace on a real host ([ref] —
|
|
89
89
|
* batch deployment), so per-task dirs would not restore the boundary anyway.
|
|
90
90
|
* - adb / local-docker / host / unset: no registry (host+unset use the local-fs source in main.ts;
|
|
91
91
|
* adb/local-docker remain a follow-on).
|
|
@@ -19,21 +19,21 @@ export interface ScenarioBundle {
|
|
|
19
19
|
tools: ToolSpec[];
|
|
20
20
|
skills: SkillSpec[];
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* [ref]:本场景对 core 手带工具面(Bash/Edit/Write/Read/Grep/…)的表态 —— **必填闭集**。
|
|
23
23
|
* `full` = 任务跑在挂了 `executionEnvFactory` 的 Runner 上(core 把 band 并集进 roster);
|
|
24
24
|
* `none` = 跑在不挂 factory 的 Runner 上(band 根本不 mount,工具 schema 对模型不可见)。
|
|
25
|
-
* 必填是设计的一半:新场景不表态 = 编译红,而不是静默继承 full(那正是 [
|
|
25
|
+
* 必填是设计的一半:新场景不表态 = 编译红,而不是静默继承 full(那正是 [ref] 的病灶——
|
|
26
26
|
* `scan` 声明 clone-free 四件、实际拿到全量可写手)。
|
|
27
27
|
*/
|
|
28
28
|
hands: ScenarioHands;
|
|
29
29
|
promptProvider?: PromptProvider;
|
|
30
|
-
/** [
|
|
31
|
-
* bench 态差距三件之一。[
|
|
30
|
+
/** [ref] 场景解释层定死的终验开关(core TaskSpec.finalVerification):bench 实测产品默认请求与
|
|
31
|
+
* bench 态差距三件之一。[ref] 起无场景定死(autonomous 退役)——纯 caller 显式旋钮;spec 组装处 OR 折入(场景只会
|
|
32
32
|
* 多加一轮收官验证,绝不收窄 caller 意图),壳/caller 不感知。 */
|
|
33
33
|
finalVerification?: true;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* [ref]:场景工厂的**服务端事实**上下文 —— 与 `req`(= 调用方请求体,不可信)分开的第三个入参。
|
|
37
37
|
* 这里的每一位都由鉴权信道解析,调用方无法自报;新增位一律走本接口,绝不往 `req` 上加。
|
|
38
38
|
*/
|
|
39
39
|
export interface ScenarioContext {
|
|
@@ -55,9 +55,9 @@ export interface ScenarioDeps {
|
|
|
55
55
|
/** In-memory runner for ephemeral sub-tasks (council lenses/arbiter) — keeps them out of TiDB. */
|
|
56
56
|
subRunner: Runner;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* [ref]:`subRunner` 的无手孪生 —— 同 deps,唯独不挂 `executionEnvFactory`。hands=none 的场景把它交给
|
|
59
59
|
* 自己造的子任务工具(council 的 lens/arbiter、discuss 的成员/synthesizer):那些子任务只该读仓库/讨论,
|
|
60
|
-
* 拿全量可写手是 [
|
|
60
|
+
* 拿全量可写手是 [ref] 病灶里最意外的一支(零工具人格照拿 Bash)。取用一律走 {@link pickHandsRunner},
|
|
61
61
|
* 不在场景体内手挑 —— 判别位是唯一开关。
|
|
62
62
|
*/
|
|
63
63
|
handslessSubRunner: Runner;
|
|
@@ -71,9 +71,9 @@ export interface ScenarioDeps {
|
|
|
71
71
|
/** Deployment-injected WebSearch backend (Brave/Tavily/SearXNG via `WEB_SEARCH_PROVIDER`). When set,
|
|
72
72
|
* `assembleCodeTools` mounts the WebSearch tool; absent ⇒ not assembled (core ships no search backend). */
|
|
73
73
|
webSearch?: WebSearchConfig;
|
|
74
|
-
/** [
|
|
74
|
+
/** [ref]/[ref] WebFetch 摘要器(core `makeWebFetchSummarizer(brain, summarize 角色模型)` 的产物,
|
|
75
75
|
* main.ts 构造一次注入)。在场 ⇒ 装配实参携 `webFetch.summarize`——带 prompt 的 WebFetch 走 cheap
|
|
76
|
-
* 模型摘要而非整页灌上下文([
|
|
76
|
+
* 模型摘要而非整页灌上下文([ref] L1 的 ~660× 放大就是这缝);缺席 ⇒ `webFetch` 键不铸(修前
|
|
77
77
|
* 字节形,core 落「summarization unavailable」诚实兜底)。 */
|
|
78
78
|
webFetchSummarize?: NonNullable<NonNullable<WebFetchConfig["summarize"]>>;
|
|
79
79
|
metrics?: Metrics;
|
|
@@ -97,14 +97,14 @@ export interface ScenarioDeps {
|
|
|
97
97
|
*/
|
|
98
98
|
subagentExtraTools?: (ctx: SubagentSpawnContext) => ToolSpec[];
|
|
99
99
|
/**
|
|
100
|
-
* core 1.364 durable background agents(
|
|
100
|
+
* core 1.364 durable background agents([ref] S1,[ref] 提货单②写半场):后台子代 `a*` 行的
|
|
101
101
|
* durable 执行记录 store。**必须与 `RunnerDeps.backgroundAgentStore` 同实例**(读写双点配对,engine
|
|
102
|
-
* 无法核对——半接=静默死特性,
|
|
102
|
+
* 无法核对——半接=静默死特性,[ref]①)。绝不在这里另起实例。absent ⇒ pre-151 行为(settle 后
|
|
103
103
|
* eager release,读面纯 live)。
|
|
104
104
|
*/
|
|
105
105
|
backgroundAgentStore?: BackgroundAgentStore;
|
|
106
106
|
/**
|
|
107
|
-
* core 1.382(
|
|
107
|
+
* core 1.382([ref] 二拍B 件1+件2,parked 状态机)[ref] 提货单①②:「同车必接」的一对——core
|
|
108
108
|
* `parkEligible` 门要求 checkpointStore 与 ensureChildSessionDurable **全在场**才成立,任一缺席 = 净是
|
|
109
109
|
* pre-153 行为(子代 SAFETY ask 照旧 deny+continue,零回归)。
|
|
110
110
|
* - `checkpointStore` 必须与 `RunnerDeps.checkpointStore`(主 runner 的 per-task spec 面)**同实例**
|
|
@@ -121,7 +121,7 @@ export interface ScenarioDeps {
|
|
|
121
121
|
checkpointStore?: CheckpointStore;
|
|
122
122
|
ensureChildSessionDurable?: (sessionId: string) => Promise<void>;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
124
|
+
* [ref]([ref] F2 症状 → [ref] 定谳):**会话级**任务清单店解析器,属主 =
|
|
125
125
|
* `boot/task-list-lane.ts` 的 {@link import("../boot/task-list-lane.js").createTaskListLane}
|
|
126
126
|
* (boot 期构造一次,SQL 后端在场接对应 twin、否则进程级 per-session 内存店)。
|
|
127
127
|
*
|
|
@@ -161,10 +161,10 @@ export { SEMA_IDENTITY } from "./prompts/identity.js";
|
|
|
161
161
|
*/
|
|
162
162
|
export declare function semaIdentityProvider(): PromptProvider;
|
|
163
163
|
/**
|
|
164
|
-
* `code` 场景的提示词提供者([
|
|
165
|
-
* {@link CODE_SYSTEM_PROMPT}(core 1.298 [
|
|
164
|
+
* `code` 场景的提示词提供者([ref] 造,[ref] clay 裁定改名 autonomous→code):role 基底 = core
|
|
165
|
+
* {@link CODE_SYSTEM_PROMPT}(core 1.298 [ref] 改名批正名,旧名 FULL_BODY_SYSTEM_PROMPT=恒等
|
|
166
166
|
* 别名过渡窗;CODE_AGENT persona + AUTONOMY_SELF_AUDIT + ANTI_VERBOSITY +
|
|
167
|
-
* TOOL_PARAM_JSON;[
|
|
167
|
+
* TOOL_PARAM_JSON;[ref] 谱系定论 = CC 生产编码提示词的蒸馏去牌版,底本随 CC 版本对表 cc-anchors,
|
|
168
168
|
* 非自研)——与 bench 的请求组装完全同源,引用 core 常量随版本走,绝不复制字符串(tb bench 实测:
|
|
169
169
|
* 产品默认请求与同引擎 bench 态的差距根因就在这三件 persona/自检/终验)。品牌层与
|
|
170
170
|
* {@link semaIdentityProvider} 同构:brandIdentity 开时 SEMA_IDENTITY 叠在 role 基底之上;任务自带
|
|
@@ -48,7 +48,7 @@ export interface LoadSkillsOptions {
|
|
|
48
48
|
export declare function assertConfined(p: string, rootReal: string, label?: string): void;
|
|
49
49
|
export declare function loadSkills(dir: string, opts?: LoadSkillsOptions): LoadedSkill[];
|
|
50
50
|
/** Skills applicable to a scenario: those tagged with it, plus untagged (global) ones.
|
|
51
|
-
*
|
|
51
|
+
* [ref]:alias 窗撤销,单键查询——退役旧名标签不再命中(迁移面在 7.44 发车帖/MIGRATION 记载)。 */
|
|
52
52
|
export declare function skillsForScenario(loaded: LoadedSkill[], scenario: string): SkillSpec[];
|
|
53
53
|
export declare function parseFrontmatter(raw: string): {
|
|
54
54
|
meta: Record<string, string>;
|
|
@@ -5,7 +5,7 @@ import type { Logger } from "../observability/logger.js";
|
|
|
5
5
|
* Packaged as ONE tool the lead calls once (same shape as the code-review council), so the run model is
|
|
6
6
|
* unchanged.
|
|
7
7
|
*
|
|
8
|
-
* ── 词汇(
|
|
8
|
+
* ── 词汇([ref] / [ref],clay 直裁 [ref])──────────────────────────────────────────────────────
|
|
9
9
|
* 「team」= agent-teams(持久具名团队)专用词;一次性多 agent 讨论叫「discuss」。所以**面向调用方/
|
|
10
10
|
* 模型的名字**全部是 discussion:场景 `discuss`、工具 `run_discussion`、协调者提示词。
|
|
11
11
|
* 而**模板注册面**(`BUILTIN_TEAMS` / `registerTeams` / `getTeam` / center 的 `teams` 键)保留 team
|
|
@@ -54,8 +54,8 @@ export declare function teamNames(): string[];
|
|
|
54
54
|
export declare const DISCUSSION_TOOL_NAME = "run_discussion";
|
|
55
55
|
/**
|
|
56
56
|
* Build the discussion tool bound to a template + the consumer's per-call business injection.
|
|
57
|
-
*
|
|
58
|
-
* 部署=「工具不存在」,[
|
|
57
|
+
* [ref]:[ref] 过渡窗的 `run_team` 同款别名已随 `SCENARIO_ALIASES` 同批删(prompts 写死旧名的
|
|
58
|
+
* 部署=「工具不存在」,[ref]/7.44 发车帖点名的预告语义)。
|
|
59
59
|
*/
|
|
60
60
|
export declare function createDiscussionTools(subRunner: Runner, template: TeamTemplate, opts: {
|
|
61
61
|
objective: string;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* [
|
|
2
|
+
* [ref]④ defer face — EXPERIMENTAL long-tail per-tool defer (default OFF, `TOOL_DEFER_LONGTAIL=true`).
|
|
3
3
|
*
|
|
4
4
|
* Mechanics recap (core 1.287+ `tool-disclosure.js`, read for this assessment):
|
|
5
5
|
* - candidates for deferral are ONLY `spec.tools` (scenario/user tools) + MCP tools — core's first-party
|
|
6
6
|
* roster (Bash/Read/Edit/Grep/Glob/Write/…) is structurally NEVER deferred, so the CC "12 core tools
|
|
7
7
|
* inline" posture holds without any server action;
|
|
8
|
-
* ⚠️ **这句在中间那些世代上一度不成立**(
|
|
9
|
-
* 也卷进候选,小窗模型上首用即激活错;core 5.40.0(
|
|
8
|
+
* ⚠️ **这句在中间那些世代上一度不成立**([ref] 件⑤ 对表):`deferMode:"auto"` 的压力阀曾把内建 fs 族
|
|
9
|
+
* 也卷进候选,小窗模型上首用即激活错;core 5.40.0([ref] a 案,判据帖 [ref] 翻面清单 #3)把阀候选
|
|
10
10
|
* 收回 caller specs,**内建恒 inline**,于是这句话重新为真。**对本仓零行为影响**——理由是下一条:
|
|
11
11
|
* 我们从不开 auto。这一段留着是因为它是那次漂移的出处(数字对了而理由没对,是最难查的一类)。
|
|
12
12
|
* - MCP tool names are ALWAYS deferred (unconditional in `classifyDeferred`) — no server knob needed;
|
|
13
13
|
* - `RunnerDeps.deferMode:"auto"` is ALL-OR-NOTHING over the candidates (defers every spec tool once their
|
|
14
14
|
* combined inline chars exceed 10% of the window) — on our default scenario that would defer Agent and the
|
|
15
15
|
* Task quartet too, the OPPOSITE of the CC posture, so we deliberately do NOT enable it;
|
|
16
|
-
* 🔴 该判断在 core 5.40.0 上**逐字仍成立**(
|
|
16
|
+
* 🔴 该判断在 core 5.40.0 上**逐字仍成立**([ref] 件⑤ 亲验):5.40 收窄的是「内建卷不卷进来」,而
|
|
17
17
|
* Agent / Task 四件是 **caller spec 工具**,收窄后照样在候选池里 —— 所以「开了 auto 就会 defer 掉
|
|
18
18
|
* CC 姿势工具」这条不开 auto 的理由没有被这次收窄消解。
|
|
19
19
|
* 我方**从不接线**这个座:全树零 `RunnerDeps.deferMode` 赋值(`deferModelPlane` 是 config-center 的
|
|
20
|
-
* 同形近名,与本轴无关)。机器钉见 test/tool-defer.test.ts 的
|
|
20
|
+
* 同形近名,与本轴无关)。机器钉见 test/tool-defer.test.ts 的 [ref] 件⑤ 格 —— 这条「零接线」正是本仓
|
|
21
21
|
* 在两个 core 世代之间行为逐字不变的**全部**依据,所以它值一根钉而不只是一句注。
|
|
22
22
|
* - per-tool `ToolSpec.defer:true` is the precise instrument — that is what this helper applies.
|
|
23
23
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* spontaneous "send the user the artifact" behavior it exists for → NOT in the defer set. That leaves
|
|
30
30
|
* SelectEnvironment (~210 tokens; a discover-then-bind verb whose trigger scenario plausibly drives a
|
|
31
31
|
* ToolSearch query) as the only honest candidate — a marginal win, hence experimental + default off, with the
|
|
32
|
-
* final call left on the board ([
|
|
32
|
+
* final call left on the board ([ref]③ honesty-over-preemption).
|
|
33
33
|
*/
|
|
34
34
|
import type { ToolSpec } from "@sema-agent/core";
|
|
35
35
|
/** The long-tail set (names). Deliberately tiny — see the module header for why each other tool is excluded. */
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DESIGN-278 §5 S2([ref])—— 配置目录本体:`GET /v1/config/catalog` 的数据层。
|
|
3
|
+
*
|
|
4
|
+
* ## 形
|
|
5
|
+
* 目录 = **逐 env 键**一行(分母 = 全 `src/` 生产运行时的 env 读取点;完备性由
|
|
6
|
+
* `test/config-catalog.test.ts` 的 D1 双向 AST 对账门执法 —— 多一行是幽灵键、少一行是漏登记,两个方向
|
|
7
|
+
* 都当场红)。每行静态登记 `{域、类型、一句话语义、staticDefault?/derivedDefaultNote?、危险轴、center
|
|
8
|
+
* 联接(domain/path/优先序/时机)}`,运行期由 {@link buildConfigCatalog} 补上**本进程实算**的
|
|
9
|
+
* `{envHeld、effectiveLane、effectiveValue、center.managedNow/effectiveNow/domainExists}`。
|
|
10
|
+
*
|
|
11
|
+
* ## 词表纪律([ref]:闭集,未知词=编译红)
|
|
12
|
+
* · 类型 {@link CATALOG_VALUE_TYPES} / 时机 {@link CATALOG_TIMINGS} / 危险轴 {@link CATALOG_DANGER_AXES}
|
|
13
|
+
* 全是 `as const` 闭集;restart 片集 {@link CATALOG_RESTART_SLICES} 用 `Record<RestartSlice, true>`
|
|
14
|
+
* 锁步 —— core/config-center 的片集变了,这里不改就 tsc 红。
|
|
15
|
+
* · 域 = `ServiceConfigGroups` 的九组键(类型锁步,不自铸第二份分组)。
|
|
16
|
+
*
|
|
17
|
+
* ## secret 纪律(设计稿 §0.5 补偿条款)
|
|
18
|
+
* `secret` 类值**永不出本模块**(只回 `{present}`);`opaque` 类(策略 JSON/公钥表/证书)回
|
|
19
|
+
* `{present, length}`;`url` 类剥 userinfo(config 实算腿与 env 原文腿同裁)。机器钉 =
|
|
20
|
+
* test/config-catalog.test.ts 的响应体 canary 扫描格 + 名字启发式兜底格。
|
|
21
|
+
*
|
|
22
|
+
* ## 生效时机模型(设计稿 §3:标注是「键 × 写入通道」的属性)
|
|
23
|
+
* env 腿恒 `deploy`(env 在运行期不可变;retired/无消费键标 `inert`);center 腿按域:limits 热
|
|
24
|
+
* (costQuotaWindowSec 除外 —— 显式 deferred,铸因 `cost-quota-window`)、governance 热二件、
|
|
25
|
+
* approvalRequire 走 `runtime-gates` 重启片、readFace 族 `read-face` 片且 **env-wins**(⚪ 成因 a)、
|
|
26
|
+
* models 面 **本进程实算**(tier 表在场 ⇒ restart/models-tiers,tier-less ⇒ hot)。
|
|
27
|
+
* readFace 在 settings-schema 现行 DOMAINS 里**没有域**(R-15:暂不开)⇒ `domainExists:false`,
|
|
28
|
+
* writeLanes 不含 center(⚪ 成因 b 的诚实呈现)。
|
|
29
|
+
*/
|
|
30
|
+
import type { ServiceConfig, ServiceConfigGroups } from "./config-types.js";
|
|
31
|
+
import type { ConfigKnobRecord } from "./config.js";
|
|
32
|
+
import type { RestartSlice } from "./config-center/restart-signal.js";
|
|
33
|
+
export declare const CATALOG_VALUE_TYPES: readonly ["boolean", "number", "string", "enum", "csv", "json", "path", "url", "secret", "opaque"];
|
|
34
|
+
export type CatalogValueType = (typeof CATALOG_VALUE_TYPES)[number];
|
|
35
|
+
export declare const CATALOG_TIMINGS: readonly ["hot", "restart", "deploy", "inert"];
|
|
36
|
+
export type CatalogTiming = (typeof CATALOG_TIMINGS)[number];
|
|
37
|
+
export declare const CATALOG_DANGER_AXES: readonly ["security", "billing", "data"];
|
|
38
|
+
export type CatalogDangerAxis = (typeof CATALOG_DANGER_AXES)[number];
|
|
39
|
+
/** 域 = 配置九组(类型锁步:组集变了这里跟着红)。 */
|
|
40
|
+
export type CatalogDomain = keyof ServiceConfigGroups;
|
|
41
|
+
export declare const CATALOG_RESTART_SLICES: readonly RestartSlice[];
|
|
42
|
+
/** center 联接座(spec 层)。`models-plane` 是内部时机词:build 时按 tier 表在场性实算成 hot/restart。 */
|
|
43
|
+
export interface CatalogCenterSeatSpec {
|
|
44
|
+
readonly domain: string;
|
|
45
|
+
readonly path: string;
|
|
46
|
+
/** `centerManagedKeys`(config-center 在管键集)里查「在管」用的键;models 面统一 "models"。 */
|
|
47
|
+
readonly centerKey: string;
|
|
48
|
+
readonly precedence: "center-wins" | "env-wins";
|
|
49
|
+
readonly timing: "hot" | "restart" | "inert" | "models-plane";
|
|
50
|
+
readonly restartSlice?: RestartSlice;
|
|
51
|
+
readonly restartReason?: string;
|
|
52
|
+
}
|
|
53
|
+
export type CatalogValue = string | number | boolean | readonly string[] | null | {
|
|
54
|
+
readonly present: boolean;
|
|
55
|
+
readonly length?: number;
|
|
56
|
+
};
|
|
57
|
+
export interface ConfigCatalogSpec {
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly domain: CatalogDomain;
|
|
60
|
+
readonly type: CatalogValueType;
|
|
61
|
+
readonly semantics: string;
|
|
62
|
+
readonly staticDefault?: string;
|
|
63
|
+
readonly derivedDefaultNote?: string;
|
|
64
|
+
readonly danger?: readonly CatalogDangerAxis[];
|
|
65
|
+
readonly enumValues?: readonly string[];
|
|
66
|
+
/** `ServiceConfig` 的平铺键(实算兜底 + center managedNow 判据对表用;嵌套块不填,走 resolve)。 */
|
|
67
|
+
readonly configKey?: string;
|
|
68
|
+
/** 本进程实算(非 secret/opaque 行才可用;返回 undefined = 本行没有实算腿,落 env 原文/staticDefault)。 */
|
|
69
|
+
readonly resolve?: (config: ServiceConfig) => CatalogValue | undefined;
|
|
70
|
+
readonly center?: CatalogCenterSeatSpec;
|
|
71
|
+
/** 缺省 "deploy";retired/零消费键标 "inert"(设计稿 ⚪ 的 env 腿投影)。 */
|
|
72
|
+
readonly envTiming?: "inert";
|
|
73
|
+
readonly scope?: "bootstrap-only";
|
|
74
|
+
}
|
|
75
|
+
export interface ConfigCatalogRowCenter {
|
|
76
|
+
readonly domain: string;
|
|
77
|
+
readonly path: string;
|
|
78
|
+
readonly precedence: "center-wins" | "env-wins";
|
|
79
|
+
readonly timing: Exclude<CatalogTiming, "deploy">;
|
|
80
|
+
readonly restartSlice?: RestartSlice;
|
|
81
|
+
readonly restartReason?: string;
|
|
82
|
+
/** settings-schema 现行 DOMAINS 里真有这个域(false = 设计稿 ⚪ 成因 b「该片暂无配置中心写腿」)。 */
|
|
83
|
+
readonly domainExists: boolean;
|
|
84
|
+
/** center 的最近一份 effective **当前在管**本键(没有配置管道 ⇒ 恒 false)。 */
|
|
85
|
+
readonly managedNow: boolean;
|
|
86
|
+
/** center 写**现在真的在生效**(在管 ∧ 未被 env 占位压住;env-wins 族 env 占位 ⇒ false = ⚪ 成因 a)。 */
|
|
87
|
+
readonly effectiveNow: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface ConfigCatalogRow {
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly domain: CatalogDomain;
|
|
92
|
+
readonly type: CatalogValueType;
|
|
93
|
+
readonly semantics: string;
|
|
94
|
+
readonly writeLanes: readonly ("env" | "center")[];
|
|
95
|
+
readonly effectiveLane: "env" | "center" | "default";
|
|
96
|
+
readonly envHeld: boolean;
|
|
97
|
+
readonly envTiming: "deploy" | "inert";
|
|
98
|
+
readonly staticDefault?: string;
|
|
99
|
+
readonly derivedDefaultNote?: string;
|
|
100
|
+
readonly effectiveValue: CatalogValue;
|
|
101
|
+
readonly valueClass: "plain" | "secret" | "opaque";
|
|
102
|
+
readonly danger: readonly CatalogDangerAxis[];
|
|
103
|
+
readonly center?: ConfigCatalogRowCenter;
|
|
104
|
+
readonly centerDomain?: string;
|
|
105
|
+
readonly centerPath?: string;
|
|
106
|
+
readonly scope?: "bootstrap-only";
|
|
107
|
+
readonly enumValues?: readonly string[];
|
|
108
|
+
}
|
|
109
|
+
export interface ConfigCatalogInputs {
|
|
110
|
+
readonly config: ServiceConfig;
|
|
111
|
+
readonly env: NodeJS.ProcessEnv;
|
|
112
|
+
readonly knobs: readonly ConfigKnobRecord[];
|
|
113
|
+
/** settings-schema 现行 DOMAINS(调用方传入 —— 本模块保持纯数据层,零包依赖)。 */
|
|
114
|
+
readonly centerDomains: readonly string[];
|
|
115
|
+
/** config-center 当前在管的 ServiceConfig 键集(缺席 = 没有配置管道)。 */
|
|
116
|
+
readonly centerManagedKeys?: ReadonlySet<string> | undefined;
|
|
117
|
+
}
|
|
118
|
+
export interface ConfigCatalogWire {
|
|
119
|
+
readonly catalogVersion: 1;
|
|
120
|
+
/** env 腿的统一时机(env 运行期不可变 ⇒ 改 env=改部署面;行级 `envTiming:"inert"` 覆写)。 */
|
|
121
|
+
readonly envLaneTiming: "deploy";
|
|
122
|
+
readonly restartSlices: readonly RestartSlice[];
|
|
123
|
+
readonly centerDomains: readonly string[];
|
|
124
|
+
readonly summary: {
|
|
125
|
+
readonly total: number;
|
|
126
|
+
readonly envHeld: number;
|
|
127
|
+
readonly secret: number;
|
|
128
|
+
readonly centerManaged: number;
|
|
129
|
+
};
|
|
130
|
+
readonly rows: readonly ConfigCatalogRow[];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 目录表(按名排序 —— 卫生格执法)。语义句以读取点实现为准(不信注释纪律:本表成文时逐键对过
|
|
134
|
+
* config.ts / boot / plugins 的真实读取臂;后续漂移由 D1 对账门逼着回到这里补行)。
|
|
135
|
+
*/
|
|
136
|
+
export declare const CONFIG_CATALOG: readonly ConfigCatalogSpec[];
|
|
137
|
+
/** `build*` 命名(工厂纪律):产物是纯数据(wire 投影),零方法零捕获行为。 */
|
|
138
|
+
export declare function buildConfigCatalog(inputs: ConfigCatalogInputs): ConfigCatalogWire;
|
|
139
|
+
//# sourceMappingURL=config-catalog.d.ts.map
|