@sema-agent/server 7.135.0 → 7.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +237 -2
- package/USAGE.md +146 -41
- package/deploy/sema-up/README.md +15 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +7 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +7 -1
- package/dist/approval-card.d.ts +60 -4
- package/dist/approval-card.js +18 -1
- package/dist/approval-content-kind.d.ts +7 -0
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-gate-currency.d.ts +48 -6
- package/dist/approval-gate-currency.js +16 -9
- package/dist/approval-hmac.d.ts +13 -1
- package/dist/approval-hmac.js +1 -1
- package/dist/approval.js +3 -3
- package/dist/auth-bridge.d.ts +34 -5
- package/dist/auth-bridge.js +22 -5
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/execution-env.d.ts +24 -1
- package/dist/boot/execution-env.js +69 -6
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/reapers.d.ts +3 -0
- package/dist/boot/reapers.js +15 -1
- package/dist/boot/resolve-spec.d.ts +4 -0
- package/dist/boot/resolve-spec.js +24 -22
- package/dist/boot/runner-deps.js +4 -2
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-04-stores.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +4 -2
- package/dist/boot/stage-05-execution-env.js +11 -2
- package/dist/boot/stage-06-runners.d.ts +4 -2
- package/dist/boot/stage-06-runners.js +5 -1
- package/dist/boot/stage-07-capability-layer.d.ts +5 -2
- package/dist/boot/stage-07-capability-layer.js +1 -1
- package/dist/boot/stage-08-reapers.d.ts +5 -2
- package/dist/boot/stage-08-reapers.js +2 -1
- package/dist/boot/stage-09-leader.d.ts +5 -2
- package/dist/boot/stage-10-http-server.d.ts +5 -2
- package/dist/boot/stage-10-http-server.js +3 -2
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/stores.js +2 -3
- package/dist/boot/web-admin.js +10 -17
- package/dist/brain.js +12 -3
- package/dist/broker/broker.d.ts +89 -0
- package/dist/broker/broker.js +287 -0
- package/dist/broker/constants.d.ts +39 -0
- package/dist/broker/constants.js +15 -0
- package/dist/broker/http1.d.ts +111 -0
- package/dist/broker/http1.js +256 -0
- package/dist/broker/lease-book.d.ts +87 -0
- package/dist/broker/lease-book.js +142 -0
- package/dist/broker/lease-file.d.ts +60 -0
- package/dist/broker/lease-file.js +127 -0
- package/dist/broker/main.d.ts +2 -0
- package/dist/broker/main.js +20 -0
- package/dist/budget.d.ts +3 -3
- package/dist/budget.js +4 -0
- package/dist/capabilities/composite-members.d.ts +2 -1
- package/dist/capabilities/composite-members.js +2 -1
- package/dist/capabilities/engine-capabilities.js +1 -0
- package/dist/capabilities/mcp-probe.d.ts +5 -4
- package/dist/capabilities/scenarios.d.ts +23 -8
- package/dist/capabilities/scenarios.js +13 -8
- package/dist/capabilities/skills.d.ts +28 -5
- package/dist/capabilities/skills.js +8 -0
- package/dist/capability-facts.d.ts +3 -7
- package/dist/capability-facts.js +3 -5
- package/dist/center-credential-renewer.js +5 -1
- package/dist/center-credential.d.ts +18 -4
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-ctx-seal-m28.d.ts +3 -10
- package/dist/checkpoint-ctx-seal-m28.js +1 -1
- package/dist/checkpoint-identity.d.ts +3 -3
- package/dist/config-catalog.js +21 -16
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +1 -1
- package/dist/config-invariants.js +8 -0
- package/dist/config-lkg.d.ts +0 -38
- package/dist/config-lkg.js +1 -83
- package/dist/config-types.d.ts +21 -4
- package/dist/config.d.ts +1 -1
- package/dist/config.js +60 -16
- package/dist/deployment-governance.d.ts +2 -2
- package/dist/deployment-governance.js +7 -9
- package/dist/deployment-shape.d.ts +1 -1
- package/dist/device-ws-protocol.d.ts +1 -0
- package/dist/device-ws-protocol.js +2 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/file-history-disclosure.d.ts +8 -4
- package/dist/file-history-disclosure.js +24 -6
- package/dist/fleet-client.d.ts +32 -1
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +7 -3
- package/dist/fleet-lease.js +31 -23
- package/dist/hooks/classic-stations.d.ts +11 -54
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +4 -4
- package/dist/hooks/hook-runner.js +2 -2
- package/dist/http/admission.js +10 -7
- package/dist/http/approval-sweeps.js +4 -3
- package/dist/http/caller-trust.d.ts +2 -1
- package/dist/http/caller-trust.js +1 -3
- package/dist/http/checkpoint-ctx.d.ts +76 -16
- package/dist/http/checkpoint-ctx.js +45 -1
- package/dist/http/dispatch.js +24 -19
- package/dist/http/durable-run-leg.d.ts +5 -1
- package/dist/http/durable-run-leg.js +1 -1
- package/dist/http/health-self-report.d.ts +2 -2
- package/dist/http/mcp-remote-text.d.ts +5 -0
- package/dist/http/mcp-remote-text.js +7 -0
- package/dist/http/principal-gate.d.ts +15 -10
- package/dist/http/principal-gate.js +48 -9
- package/dist/http/resume-ctx-read.d.ts +2 -16
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +2 -20
- package/dist/http/resume-legs.js +52 -38
- package/dist/http/route-ctx.d.ts +8 -2
- package/dist/http/routes/approvals-assistant.d.ts +0 -2
- package/dist/http/routes/approvals-assistant.js +65 -16
- package/dist/http/routes/capabilities.js +11 -1
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +5 -7
- package/dist/http/routes/runs.js +4 -3
- package/dist/http/routes/session-sync.js +70 -12
- package/dist/http/routes/sessions.js +20 -15
- package/dist/http/routes/tasks.js +8 -6
- package/dist/http/server.d.ts +4 -0
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +6 -1
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/wire-types.d.ts +57 -30
- package/dist/identity-source.d.ts +65 -0
- package/dist/identity-source.js +45 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/memory-store-refusal.d.ts +3 -3
- package/dist/model-entry-refusal.d.ts +2 -0
- package/dist/model-entry-refusal.js +11 -0
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-select.d.ts +6 -17
- package/dist/model-select.js +0 -3
- package/dist/namespaced-rule-name.d.ts +1 -1
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/fail-open.d.ts +19 -7
- package/dist/observability/fail-open.js +19 -7
- package/dist/observability/metrics.js +2 -2
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.js +1 -0
- package/dist/operator-ask.d.ts +2 -2
- package/dist/org-delivery-gate.js +1 -1
- package/dist/org-memory-admission.d.ts +2 -2
- package/dist/org-memory-admission.js +39 -2
- package/dist/parked-decide.d.ts +4 -3
- package/dist/parked-decide.js +29 -9
- package/dist/peer-directory.d.ts +2 -1
- package/dist/peer-directory.js +7 -5
- package/dist/permission-rule-list.d.ts +2 -2
- package/dist/plugins/approval-ask-store-sql.d.ts +8 -0
- package/dist/plugins/approval-ask-store-sql.js +3 -0
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/checkpoint-index-columns.d.ts +50 -1
- package/dist/plugins/checkpoint-index-columns.js +28 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +46 -12
- package/dist/plugins/checkpoint-store-sql.js +64 -35
- package/dist/plugins/file-history-store-sql.d.ts +6 -0
- package/dist/plugins/file-history-store-sql.js +37 -37
- package/dist/plugins/file-run-store.js +8 -2
- package/dist/plugins/k8s-exec-protocol.d.ts +69 -13
- package/dist/plugins/k8s-exec-protocol.js +116 -28
- package/dist/plugins/k8s-pod-delete-failure.d.ts +25 -0
- package/dist/plugins/k8s-pod-delete-failure.js +17 -0
- package/dist/plugins/k8s-pod-reaper.d.ts +112 -0
- package/dist/plugins/k8s-pod-reaper.js +122 -0
- package/dist/plugins/local-checkpoint-store.d.ts +3 -6
- package/dist/plugins/local-checkpoint-store.js +7 -6
- package/dist/plugins/memory-run-store.js +2 -0
- package/dist/plugins/one-time-migrations.d.ts +49 -37
- package/dist/plugins/one-time-migrations.js +87 -128
- package/dist/plugins/permission-rule-store-file.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +17 -17
- package/dist/plugins/permission-rule-store-sql.js +16 -17
- package/dist/plugins/pg-pool.js +4 -0
- package/dist/plugins/pg-session-storage.js +2 -2
- package/dist/plugins/remote-env-adb.d.ts +3 -0
- package/dist/plugins/remote-env-adb.js +1 -0
- package/dist/plugins/remote-env-device.d.ts +3 -0
- package/dist/plugins/remote-env-device.js +4 -0
- package/dist/plugins/remote-env-e2b.d.ts +3 -0
- package/dist/plugins/remote-env-e2b.js +1 -0
- package/dist/plugins/remote-env-file-error.d.ts +8 -1
- package/dist/plugins/remote-env-file-error.js +7 -1
- package/dist/plugins/remote-env-host.d.ts +7 -1
- package/dist/plugins/remote-env-host.js +7 -1
- package/dist/plugins/remote-env-k8s.d.ts +154 -14
- package/dist/plugins/remote-env-k8s.js +300 -21
- package/dist/plugins/remote-env-local-docker.d.ts +3 -0
- package/dist/plugins/remote-env-local-docker.js +1 -0
- package/dist/plugins/remote-env-ssh.d.ts +3 -0
- package/dist/plugins/remote-env-ssh.js +1 -0
- package/dist/plugins/run-store-sql.js +10 -4
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/session-ownership.d.ts +17 -3
- package/dist/plugins/session-ownership.js +19 -5
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-errors.d.ts +60 -0
- package/dist/plugins/sql-errors.js +64 -1
- package/dist/plugins/store-contracts.d.ts +10 -1
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +10 -0
- package/dist/plugins/tidb-pool.js +8 -1
- package/dist/plugins/tidb-session-store.js +2 -2
- package/dist/plugins/web-search.d.ts +1 -1
- package/dist/plugins/web-search.js +2 -2
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +5 -0
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +31 -2
- package/dist/request-value-closure.js +7 -1
- package/dist/rule-entry-list.d.ts +3 -2
- package/dist/rule-entry-list.js +2 -2
- package/dist/rules-consent.js +7 -4
- package/dist/run-local.d.ts +2 -2
- package/dist/runs.js +2 -1
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +5 -5
- package/dist/sandbox-git-lease.d.ts +49 -0
- package/dist/sandbox-git-lease.js +60 -0
- package/dist/sandbox-git-plane.d.ts +84 -0
- package/dist/sandbox-git-plane.js +105 -0
- package/dist/sandbox-pkg-source.d.ts +28 -1
- package/dist/sandbox-pkg-source.js +1 -2
- package/dist/sealed-key.d.ts +19 -0
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +16 -4
- package/dist/security.js +8 -3
- package/dist/server-secret-env.d.ts +6 -0
- package/dist/server-secret-env.js +14 -0
- package/dist/session-error-wire.d.ts +14 -6
- package/dist/session-error-wire.js +2 -1
- package/dist/session-incarnation.d.ts +16 -5
- package/dist/session-incarnation.js +7 -4
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-policy-wire.js +2 -2
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync.d.ts +15 -3
- package/dist/session-sync.js +5 -2
- package/dist/spec-fields.d.ts +43 -13
- package/dist/spec-fields.js +33 -12
- package/dist/stored-request-prompt-profile-m30.d.ts +49 -0
- package/dist/stored-request-prompt-profile-m30.js +25 -0
- package/dist/task-a2a.d.ts +52 -81
- package/dist/task-a2a.js +219 -89
- package/dist/task-mcp.d.ts +7 -15
- package/dist/task-mcp.js +16 -51
- package/dist/task-settings.d.ts +2 -2
- package/dist/tool-approval.d.ts +35 -12
- package/dist/tool-approval.js +59 -39
- package/dist/tool-rule-names.d.ts +5 -0
- package/dist/trace/core-keyset-guard.d.ts +5 -5
- package/dist/trace/engine-notice-wire.d.ts +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.js +37 -13
- package/dist/trace/ledger-sink.d.ts +4 -5
- package/dist/trace/ledger-sink.js +3 -7
- package/dist/trace/project.d.ts +37 -3
- package/dist/trace/project.js +20 -6
- package/dist/trace/redact.d.ts +40 -12
- package/dist/trace/redact.js +332 -128
- package/dist/trace/self-minted-wire.d.ts +641 -0
- package/dist/trace/self-minted-wire.js +201 -0
- package/dist/trace/wire-projection-faces.d.ts +5 -3
- package/dist/trace/wire-projection-faces.js +7 -3
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +13 -4
- package/dist/url-refusal.js +8 -2
- package/dist/web-admin-client/apply-effective.js +0 -1
- package/dist/web-admin-client/center-request.d.ts +20 -2
- package/dist/web-admin-client/center-request.js +40 -5
- package/dist/web-admin-client/http-client.js +6 -6
- package/dist/web-admin-client/types.d.ts +5 -5
- package/dist/workspace-space.d.ts +27 -0
- package/dist/workspace-space.js +26 -0
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +11 -5
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +2 -1
- package/scripts/drain-check.mysql.sql +3 -1
- package/scripts/drain-check.pg.sql +3 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/wire-changes/server@7.137.0.json +825 -0
- package/dist/url-credential.d.ts +0 -52
- package/dist/url-credential.js +0 -49
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **身份来源闭集 + run 行身份元组** —— 叶子模块(零依赖):凭据门(`http/principal-gate.ts`)、run 店契约(`plugins/store-contracts.ts`)、
|
|
3
|
+
* 三只 run 店、中央建表语句(`plugins/tidb-pool.ts` / `plugins/pg-pool.ts`)与 `/health` 自报位读同一份。
|
|
4
|
+
*
|
|
5
|
+
* ## 律(三句;全仓只在这里写一次)
|
|
6
|
+
* 1. **一张表、一个次序**:{@link IDENTITY_SOURCES} 的序 = 凭据门的判定次序(`verifiedIdentitySource` 答表里第一个验得过的词)= `/health.auth.kinds` 的出现序。
|
|
7
|
+
* 出示了部署的 service 凭据就是 `service_token` —— 哪怕同一枚 Bearer 也被鉴权桥验成登录令牌、哪怕运维给这枚凭据起的系统名叫 `sso`;
|
|
8
|
+
* 验不过 service 凭据而鉴权桥挂了身份 ⇒ `sso`;都没有而直连门 principal 令牌验过 ⇒ `direct_door_jwt`。
|
|
9
|
+
* 2. **一只元组、受理时铸一次**:run 行的身份元组 {@link RunIdentity}(三列 `identity_source` / `identity_scope` / `identity_principal_inc`)在凭据门上随来源
|
|
10
|
+
* 一起定下(`principal-gate.ts` 的 `admitRunIdentity`,唯一调用点是凭据门),建行处原样写入,之后只读 —— 续跑认领、挂起、终局、重启都不改它,
|
|
11
|
+
* 没有任何读者按当前状态重推它。`RunRecord.source`(系统名 / `"sso"` / null)只作归因,不是认证来源。
|
|
12
|
+
* 3. **缺席一种读法**:`null` = 这一行**没有「属主在受理时验过的凭据」的记录** —— 三列存在之前写下的行、没有任何验过凭据的受理(无鉴权写面
|
|
13
|
+
* `ALLOW_UNAUTHED_WRITES`)、以及别人替属主按下的那一跑(受理请求验过的主体不是这一行的属主:唤醒 / 决定投递铸的新一跑)。读者一律按「不合格」处置
|
|
14
|
+
* (fail-closed),不分辨三种成因;存量行不回填(没有事实可回填)。
|
|
15
|
+
*
|
|
16
|
+
* 化身号 `principalInc`:令牌 `sub_inc` 声明原样,经契约包 `VerifiedIdentity.principalInc` 读(settings-schema 14.7.0 加的可选字段);本版契约包还没有这一位 ⇒ 恒 `null`,
|
|
17
|
+
* 接线点在 `admitRunIdentity` 的 `sso` 臂(不在本仓另定一份读法)。
|
|
18
|
+
*/
|
|
19
|
+
/** 验过的身份来源的**闭集**(序 = 判定次序 = `/health.auth.kinds` 的出现序;加一个来源 = 加一个词,读它的各只穷举 `switch` 不接就编译红)。 */
|
|
20
|
+
export declare const IDENTITY_SOURCES: readonly ["service_token", "sso", "direct_door_jwt"];
|
|
21
|
+
export type IdentitySource = (typeof IDENTITY_SOURCES)[number];
|
|
22
|
+
/**
|
|
23
|
+
* run 行身份元组(受理时铸、持久、之后只读;律见文件头)。三键恒在、与三列一一对应:`scope` / `principalInc` 只随 `sso` 有值 ——
|
|
24
|
+
* service 凭据与直连门令牌不带登录令牌的 scope / 化身号,判别联合让「`service_token` 带 scope」这种形写不出来。
|
|
25
|
+
*/
|
|
26
|
+
export type RunIdentity = {
|
|
27
|
+
readonly source: "sso";
|
|
28
|
+
readonly scope: string;
|
|
29
|
+
readonly principalInc: string | null;
|
|
30
|
+
} | {
|
|
31
|
+
readonly source: "service_token" | "direct_door_jwt";
|
|
32
|
+
readonly scope: null;
|
|
33
|
+
readonly principalInc: null;
|
|
34
|
+
};
|
|
35
|
+
/** `identity_scope` 的列宽(字符;两方言 VARCHAR 同口径数码点)。与主体列同宽:scope 来自验过签名的令牌,契约的 scope id 形最长 64,读口不判形 ⇒ 留余量。 */
|
|
36
|
+
export declare const RUN_IDENTITY_SCOPE_MAX_CHARS = 190;
|
|
37
|
+
/** `identity_principal_inc` 的列宽(字符):化身号是签发方插入时铸的不透明随机串(与会话化身同宽)。 */
|
|
38
|
+
export declare const RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS = 64;
|
|
39
|
+
/**
|
|
40
|
+
* `task_run` 三列的列定义 —— 两方言各一段,**唯一属主**:中央建表语句(`tidb-pool.ts` / `pg-pool.ts` 的 `CREATE TABLE task_run`)内插这同一段;
|
|
41
|
+
* 存量库缺列时起服列册对账(`schema-consistency.ts`)拒启,拒句里的 `ALTER TABLE task_run ADD COLUMN …` 由同一份建表语句解析生成 ⇒
|
|
42
|
+
* 「新库建出来的列」与「运维按拒句 / MIGRATION 补上的列」逐字同形。三列都可空(存量行与律 3 的三种成因都是 NULL);PG 钉 `COLLATE "C"`
|
|
43
|
+
* (身份键按字节判等,与 MySQL 协议表级 `utf8mb4_bin` 同形)。
|
|
44
|
+
*/
|
|
45
|
+
export declare const RUN_IDENTITY_COLUMNS: {
|
|
46
|
+
readonly tidb: string;
|
|
47
|
+
readonly pg: string;
|
|
48
|
+
};
|
|
49
|
+
/** 元组落盘的三格(SQL 三列 / File 车道 run.json 的三键,同名同义)。 */
|
|
50
|
+
export interface RunIdentityCells {
|
|
51
|
+
readonly identitySource: IdentitySource | null;
|
|
52
|
+
readonly identityScope: string | null;
|
|
53
|
+
readonly identityPrincipalInc: string | null;
|
|
54
|
+
}
|
|
55
|
+
/** 元组 → 三格(写口;三只 run 店同一只)。 */
|
|
56
|
+
export declare function runIdentityCells(identity: RunIdentity | null): RunIdentityCells;
|
|
57
|
+
/**
|
|
58
|
+
* 三格 → 元组(读口;SQL 两方言的行映射与 File 车道的 run.json 读回同一只)。读不出一只**合形**元组的三格一律读成 `null`(律 3:不合格,fail-closed),
|
|
59
|
+
* 这是运行期无法避免的缺省臂,明写在这里:
|
|
60
|
+
* · 来源格缺席 ⇒ 没有记录(三列之前的行 / 律 3 的另两种成因);
|
|
61
|
+
* · 来源格不是闭集里的词(更新的版本写下、回滚到本版读到的词,或手改的行)⇒ 本版认不得的来源不合格;
|
|
62
|
+
* · `sso` 却没有 scope、化身号不是非空串,或别的来源带着 scope / 化身号 ⇒ 不是本仓写口写得出的形(手改 / 半截写),不合格。
|
|
63
|
+
*/
|
|
64
|
+
export declare function readRunIdentityCells(source: unknown, scope: unknown, principalInc: unknown): RunIdentity | null;
|
|
65
|
+
//# sourceMappingURL=identity-source.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const IDENTITY_SOURCES = ["service_token", "sso", "direct_door_jwt"];
|
|
2
|
+
export const RUN_IDENTITY_SCOPE_MAX_CHARS = 190;
|
|
3
|
+
export const RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS = 64;
|
|
4
|
+
export const RUN_IDENTITY_COLUMNS = {
|
|
5
|
+
tidb: [
|
|
6
|
+
"identity_source VARCHAR(32) NULL",
|
|
7
|
+
`identity_scope VARCHAR(${RUN_IDENTITY_SCOPE_MAX_CHARS}) NULL`,
|
|
8
|
+
`identity_principal_inc VARCHAR(${RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS}) NULL`,
|
|
9
|
+
].join(",\n "),
|
|
10
|
+
pg: [
|
|
11
|
+
`identity_source VARCHAR(32) COLLATE "C"`,
|
|
12
|
+
`identity_scope VARCHAR(${RUN_IDENTITY_SCOPE_MAX_CHARS}) COLLATE "C"`,
|
|
13
|
+
`identity_principal_inc VARCHAR(${RUN_IDENTITY_PRINCIPAL_INC_MAX_CHARS}) COLLATE "C"`,
|
|
14
|
+
].join(",\n "),
|
|
15
|
+
};
|
|
16
|
+
export function runIdentityCells(identity) {
|
|
17
|
+
return identity === null
|
|
18
|
+
? { identitySource: null, identityScope: null, identityPrincipalInc: null }
|
|
19
|
+
: { identitySource: identity.source, identityScope: identity.scope, identityPrincipalInc: identity.principalInc };
|
|
20
|
+
}
|
|
21
|
+
const isNonEmptyString = (v) => typeof v === "string" && v !== "";
|
|
22
|
+
const isAbsent = (v) => v === null || v === undefined;
|
|
23
|
+
export function readRunIdentityCells(source, scope, principalInc) {
|
|
24
|
+
if (isAbsent(source) || typeof source !== "string")
|
|
25
|
+
return null;
|
|
26
|
+
const word = IDENTITY_SOURCES.find((w) => w === source);
|
|
27
|
+
if (word === undefined)
|
|
28
|
+
return null;
|
|
29
|
+
switch (word) {
|
|
30
|
+
case "sso":
|
|
31
|
+
if (!isNonEmptyString(scope))
|
|
32
|
+
return null;
|
|
33
|
+
if (isAbsent(principalInc))
|
|
34
|
+
return { source: word, scope, principalInc: null };
|
|
35
|
+
return isNonEmptyString(principalInc) ? { source: word, scope, principalInc } : null;
|
|
36
|
+
case "service_token":
|
|
37
|
+
case "direct_door_jwt":
|
|
38
|
+
return isAbsent(scope) && isAbsent(principalInc) ? { source: word, scope: null, principalInc: null } : null;
|
|
39
|
+
default: {
|
|
40
|
+
const unknownWord = word;
|
|
41
|
+
throw new Error(`readRunIdentityCells: identity source ${String(unknownWord)} has no reading`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=identity-source.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -34,4 +34,5 @@ export type { ModelRouteGap } from "./model-route-endpoint.js";
|
|
|
34
34
|
export { judgeServedModelRoute, type ServedModelRouteView, type ServedModelRouteOptions, type ModelRouteEndpointVerdict } from "./model-route-endpoint.js";
|
|
35
35
|
export type { UserInputLedgerStore, UserInputAcceptance, NewUserInputAcceptance, OpenScanCursor, OpenScanPage, SettleHow, WriterGoneEvidence } from "./user-input-ledger.js";
|
|
36
36
|
export type { OrgDeliveryQuotaStore, OrgDeliveryQuotaPolicy } from "./plugins/org-delivery-quota-store.js";
|
|
37
|
+
export { APPROVAL_GATE_KINDS, type ApprovalGateKind } from "./approval-content-kind.js";
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -27,4 +27,5 @@ export { createKeyResolver, resolveModelApiKey } from "./key-resolver.js";
|
|
|
27
27
|
export { isModelKeyPoison, ModelKeyPoisonedError } from "./key-resolver.js";
|
|
28
28
|
export { CATALOG_ENTRY_HEADER_LANES, CATALOG_ENTRY_HEADER_NAMES } from "./model-entry-headers.js";
|
|
29
29
|
export { judgeServedModelRoute } from "./model-route-endpoint.js";
|
|
30
|
+
export { APPROVAL_GATE_KINDS } from "./approval-content-kind.js";
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
* 那几行的前缀是**条目路径**(模型可写)—— 本仓今天不读 warnings 车道(既有面,不是本批回归),也不在模型可写的文本上
|
|
24
24
|
* 找码;这一半候 core 的结构化码位(登记在案,codex 一审 C3)。
|
|
25
25
|
*
|
|
26
|
-
* ##
|
|
26
|
+
* ## 不是这一族的形(core 同表「different surface」,本仓**不**自拼码,如实走各自既有臂;今两形 + 一只已退的形)
|
|
27
27
|
* · journal 重放目标目录成链 ⇒ `ControlPlaneCorruptError`(无 `.code`,KL-1094-b)⇒ 路由 typed 500 `internal.memory_control_plane_corrupt`
|
|
28
28
|
* (core 7.44.0 起 scope home 非目录**不再**走这一类 —— 它有了自己的码,见上;`ControlPlaneCorruptError` 只剩真控制面损坏);
|
|
29
|
-
* · 引擎原地写撞硬链(nlink>1)
|
|
30
|
-
*
|
|
29
|
+
* · (已不存在的一形)引擎原地写撞硬链(nlink>1):≤ 引擎 7.55.x 是无码文本 `has N names (a hard link) … not written`、走该写点既有的失败车道;
|
|
30
|
+
* 引擎 7.56.0 起那只写给**这个名字**另建一个新文件(原子改名落位,其余名字保留原文件),拒绝与那句文本一并消失 —— 本仓从未读过那句文本,零码;
|
|
31
31
|
* · 解析故障(`EACCES` / `ELOOP` / `ENOTDIR`)⇒ 以 errno 本身抛 ⇒ 路由未分类 500 + 运维 warn(`String(err)` 带 core 补救句)。
|
|
32
32
|
*
|
|
33
33
|
* ## 运维行也在这里铸(两受众同一只,{@link logStoreFormRefusal})
|
|
@@ -49,6 +49,8 @@ export interface CatalogEntryLike {
|
|
|
49
49
|
readonly api?: unknown;
|
|
50
50
|
/** [ref]:供应商附加头的承载形(`unknown`:判据在 `model-entry-headers.ts`,不信这张型)。 */
|
|
51
51
|
readonly headers?: unknown;
|
|
52
|
+
/** 引擎已退役的每模型引导句(core 7.56.0 [ref];settings-schema 的 `ModelEntry` 仍收它)—— 只读在场与否,见 {@link judgeCatalogEntry}。 */
|
|
53
|
+
readonly promptGuidance?: unknown;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* **逐条判据**:`undefined` = 本部署能完整服务它。判序即语义:先形(不合形的条目谈不上走哪条腿),再腿。
|
|
@@ -31,6 +31,17 @@ export function judgeCatalogEntry(m, ctx) {
|
|
|
31
31
|
const headers = readCatalogEntryHeaders(m.headers, m.api);
|
|
32
32
|
if (!headers.ok)
|
|
33
33
|
return entryInvalidRefusal(m.id, m.provider, headers.fields, headers.issue);
|
|
34
|
+
if (Array.isArray(m.promptGuidance) && m.promptGuidance.length > 0) {
|
|
35
|
+
return {
|
|
36
|
+
...refusalCause("config.model_entry_invalid"),
|
|
37
|
+
id: m.id,
|
|
38
|
+
provider: m.provider,
|
|
39
|
+
fields: ["promptGuidance"],
|
|
40
|
+
detail: "the catalog entry carries per-model guidance sentences (promptGuidance), which the engine no longer delivers — the entry is not served here " +
|
|
41
|
+
"rather than served with its sentences silently dropped; move each sentence into a center or deployment prompt overlay on the behavior band " +
|
|
42
|
+
"and remove promptGuidance from the entry to bring it back",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
34
45
|
const lane = catalogBrainLane(m.provider);
|
|
35
46
|
const mount = laneMount(lane, ctx);
|
|
36
47
|
if (!mount.mounted) {
|
|
@@ -64,11 +64,14 @@ export interface ModelRouteEnvReading {
|
|
|
64
64
|
* 它只与网关端点配对(没有 {@link gatewayBaseUrl} 就不装载),配对由消费方判。
|
|
65
65
|
*/
|
|
66
66
|
readonly gatewayApiKey: string | undefined;
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN` / `ANTHROPIC_BASE_URL`:空串 = 未设,各自独立(一个空的不遮蔽另一个)。
|
|
69
|
+
* 两把凭据**各是各的头**(`x-api-key` / `Authorization: Bearer`),同设是起服拒启的形 —— 读数原样交出两把,取哪种头只问 {@link judgeAnthropicCredential}。
|
|
70
|
+
*/
|
|
68
71
|
readonly anthropicApiKey: string | undefined;
|
|
69
72
|
readonly anthropicAuthToken: string | undefined;
|
|
70
73
|
readonly anthropicBaseUrl: string | undefined;
|
|
71
|
-
/** anthropic 路由装不装 = 两把凭据任一在场(`createBrain` 同判)
|
|
74
|
+
/** anthropic 路由装不装 = 两把凭据任一在场(`createBrain` 同判);只读在场性(同设由起服拒启,不在读数里判)。 */
|
|
72
75
|
readonly anthropicRouteMounted: boolean;
|
|
73
76
|
/**
|
|
74
77
|
* env 腿模型的 provider 词:显式 `MODEL_PROVIDER` 胜(原样,**不在此过闭集** —— 域外拒启是 `model-provider-word` 那条不变量的事);
|
|
@@ -90,6 +93,47 @@ export declare const csvOf: (raw: string | undefined) => string[];
|
|
|
90
93
|
* `parseModelDomain`(起服铸 `ServiceConfig`)吃它的读数。
|
|
91
94
|
*/
|
|
92
95
|
export declare function readModelRouteEnv(env: ModelRouteEnv): ModelRouteEnvReading;
|
|
96
|
+
/**
|
|
97
|
+
* **anthropic 车道凭据的唯一判官**(一名一义):两个名字各走各的头、互斥 ——
|
|
98
|
+
* · `ANTHROPIC_API_KEY` ⇒ `x-api-key`(只发它);
|
|
99
|
+
* · `ANTHROPIC_AUTH_TOKEN` ⇒ `Authorization: Bearer`(只发它);
|
|
100
|
+
* · 两个都设 ⇒ `conflict`:两个名字说的是两种头,哪个赢都是替运维猜(7.135.0 及以前是「AUTH_TOKEN 优先」,x-api-key 被静默丢弃)⇒ 起服拒启,拒句 {@link anthropicCredentialRefusal}。
|
|
101
|
+
* 空串 = 未设(与 {@link readModelRouteEnv} 同尺)。入参是两个名字各自的值 —— env 读数的两位或 `config.anthropic` 的 `apiKey` / `authToken` —— 不读 `process.env`。
|
|
102
|
+
* 读者:起服(`config.ts` 的拒启锚与跨键不变量表 `anthropic-credential-exclusive` 同一句)· brain 装配(交引擎哪种头)· hook 直连腿(哪种头、交引擎配对判官的那份值)·
|
|
103
|
+
* 车道端口 {@link laneAndEndpointFor}(哪把键)· 起服的 Bearer 部署诊断(`boot/web-admin.ts`)。
|
|
104
|
+
*/
|
|
105
|
+
export type AnthropicCredentialVerdict = {
|
|
106
|
+
readonly kind: "absent";
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: "x-api-key";
|
|
109
|
+
readonly envName: typeof MODEL_ROUTE_ENV_KEYS.anthropicApiKey;
|
|
110
|
+
readonly value: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "bearer";
|
|
113
|
+
readonly envName: typeof MODEL_ROUTE_ENV_KEYS.anthropicAuthToken;
|
|
114
|
+
readonly value: string;
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: "conflict";
|
|
117
|
+
};
|
|
118
|
+
/** 判官的入参:两个名字各自的值(`config.anthropic` 的两位与 env 读数的两位都映射成这一形)。 */
|
|
119
|
+
export interface AnthropicCredentialNames {
|
|
120
|
+
readonly apiKey?: string | undefined;
|
|
121
|
+
readonly authToken?: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
export declare function judgeAnthropicCredential(names: AnthropicCredentialNames): AnthropicCredentialVerdict;
|
|
124
|
+
/** 同设拒启的机读码(拒句方括号里)。 */
|
|
125
|
+
export declare const ANTHROPIC_CREDENTIAL_CONFLICT_CODE = "config.anthropic_credential_conflict";
|
|
126
|
+
/** {@link judgeAnthropicCredential} 的拒句投影:`conflict` ⇒ 一句点名两键与出路(不回显任何值);其余 ⇒ `undefined`。 */
|
|
127
|
+
export declare function anthropicCredentialRefusal(names: AnthropicCredentialNames): string | undefined;
|
|
128
|
+
/** 一份会上线的 anthropic 车道凭据(判官的两种头形)。 */
|
|
129
|
+
export type AnthropicLaneCredential = Extract<AnthropicCredentialVerdict, {
|
|
130
|
+
kind: "x-api-key" | "bearer";
|
|
131
|
+
}>;
|
|
132
|
+
/**
|
|
133
|
+
* 判官的**取值面**:这条车道会带上的那一份(头形 + 值);缺席 ⇒ `undefined`;同设 ⇒ **抛**拒句 ——
|
|
134
|
+
* 起服已在 `loadConfig` 拒启这一形,到得了这里的只有绕过起服装配、自拼配置的嵌入方(响亮,不替它挑一个)。
|
|
135
|
+
*/
|
|
136
|
+
export declare function anthropicLaneCredentialOf(names: AnthropicCredentialNames): AnthropicLaneCredential | undefined;
|
|
93
137
|
/**
|
|
94
138
|
* **env 腿的条目表** —— 主槽别名 `default` + 主槽 id(+ 铸出的 cheap 槽);没有 `MODEL_ID` ⇒ 空表(不铸占位条目:一个不存在的模型名
|
|
95
139
|
* 进可选目录 / 当缺省,正是 3.0.0 删掉的那种病)。`parseModelDomain` 铸真 `Model` 表与判官铸路由切面都经这一只,条目名与键序不会各写一份。
|
|
@@ -116,7 +160,7 @@ export interface LaneAndEndpoint {
|
|
|
116
160
|
readonly endpointDeclared: boolean;
|
|
117
161
|
/**
|
|
118
162
|
* 这条腿此刻真会带上的凭据那把 env 键;没有会装载的凭据 ⇒ `undefined`。
|
|
119
|
-
* · anthropic
|
|
163
|
+
* · anthropic 腿:设了哪一把就是哪一把(一名一义,{@link judgeAnthropicCredential} —— 引擎装配同一只判官),空串不遮蔽另一把;两把同设 ⇒ 抛起服那一句拒句;
|
|
120
164
|
* · 网关腿:`MODEL_API_KEY`,**只在端点声明时**(凭据只与网关自己的根配对;没有网关就不装载),空串 = 没有凭据(keyless 部署)。
|
|
121
165
|
*/
|
|
122
166
|
readonly apiKeyEnvName: ModelRouteEnvName | undefined;
|
|
@@ -128,7 +172,8 @@ export interface LaneAndEndpoint {
|
|
|
128
172
|
* 键名 = {@link MODEL_ROUTE_ENV_KEYS}。`routes` 是 core 路由表的原型(`Object.hasOwn(routes, 词)` 的表;`anthropic` 键在场 ⇔ anthropic 路由装上)。
|
|
129
173
|
* **只交键名不交值**:凭据与端点的值调用方自己从 env 取,本函数的答案里没有任何 env 值。
|
|
130
174
|
*
|
|
131
|
-
* 纯:不读 `process.env`,只按键表点名取值、不枚举入参。路由表里有本部署从不装的键(表在 `mountRoutes` 之外铸)⇒ 抛(`brainLaneFor` 的响亮臂)
|
|
175
|
+
* 纯:不读 `process.env`,只按键表点名取值、不枚举入参。路由表里有本部署从不装的键(表在 `mountRoutes` 之外铸)⇒ 抛(`brainLaneFor` 的响亮臂),不折网关;
|
|
176
|
+
* anthropic 腿两把凭据同设 ⇒ 抛起服的同一句拒句({@link anthropicLaneCredentialOf}:引擎在这一形上拒启,端口不替它答一把)。
|
|
132
177
|
*/
|
|
133
178
|
export declare function laneAndEndpointFor(env: ModelRouteEnv, model: ModelRouteSubject, routes: Readonly<Record<string, unknown>>): LaneAndEndpoint;
|
|
134
179
|
//# sourceMappingURL=model-route-gap.d.ts.map
|
package/dist/model-route-gap.js
CHANGED
|
@@ -56,6 +56,39 @@ export function readModelRouteEnv(env) {
|
|
|
56
56
|
: { kind: "minted", id: rawCheapId },
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
export function judgeAnthropicCredential(names) {
|
|
60
|
+
const K = MODEL_ROUTE_ENV_KEYS;
|
|
61
|
+
const apiKey = declaredValue(names.apiKey);
|
|
62
|
+
const authToken = declaredValue(names.authToken);
|
|
63
|
+
if (apiKey !== undefined && authToken !== undefined)
|
|
64
|
+
return { kind: "conflict" };
|
|
65
|
+
if (apiKey !== undefined)
|
|
66
|
+
return { kind: "x-api-key", envName: K.anthropicApiKey, value: apiKey };
|
|
67
|
+
if (authToken !== undefined)
|
|
68
|
+
return { kind: "bearer", envName: K.anthropicAuthToken, value: authToken };
|
|
69
|
+
return { kind: "absent" };
|
|
70
|
+
}
|
|
71
|
+
export const ANTHROPIC_CREDENTIAL_CONFLICT_CODE = "config.anthropic_credential_conflict";
|
|
72
|
+
export function anthropicCredentialRefusal(names) {
|
|
73
|
+
if (judgeAnthropicCredential(names).kind !== "conflict")
|
|
74
|
+
return undefined;
|
|
75
|
+
const K = MODEL_ROUTE_ENV_KEYS;
|
|
76
|
+
return (`[${ANTHROPIC_CREDENTIAL_CONFLICT_CODE}] both ${K.anthropicApiKey} and ${K.anthropicAuthToken} are set — they are two different credentials ` +
|
|
77
|
+
`(${K.anthropicApiKey} is sent as the x-api-key header, ${K.anthropicAuthToken} as Authorization: Bearer) and the Anthropic route carries exactly one; ` +
|
|
78
|
+
`keep the one your endpoint expects and unset the other`);
|
|
79
|
+
}
|
|
80
|
+
export function anthropicLaneCredentialOf(names) {
|
|
81
|
+
const verdict = judgeAnthropicCredential(names);
|
|
82
|
+
switch (verdict.kind) {
|
|
83
|
+
case "absent":
|
|
84
|
+
return undefined;
|
|
85
|
+
case "x-api-key":
|
|
86
|
+
case "bearer":
|
|
87
|
+
return verdict;
|
|
88
|
+
case "conflict":
|
|
89
|
+
throw new Error(anthropicCredentialRefusal(names));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
59
92
|
export function envLaneTable(mainId, main, cheap) {
|
|
60
93
|
if (mainId === "")
|
|
61
94
|
return {};
|
|
@@ -74,7 +107,7 @@ export function laneAndEndpointFor(env, model, routes) {
|
|
|
74
107
|
lane,
|
|
75
108
|
endpointEnvName: K.anthropicBaseUrl,
|
|
76
109
|
endpointDeclared: declaredRootUrl(reading.anthropicBaseUrl) !== undefined,
|
|
77
|
-
apiKeyEnvName:
|
|
110
|
+
apiKeyEnvName: anthropicLaneCredentialOf({ apiKey: reading.anthropicApiKey, authToken: reading.anthropicAuthToken })?.envName,
|
|
78
111
|
};
|
|
79
112
|
case "gateway": {
|
|
80
113
|
const endpointDeclared = declaredRootUrl(reading.gatewayBaseUrl) !== undefined;
|
package/dist/model-select.d.ts
CHANGED
|
@@ -187,11 +187,10 @@ export declare function matchCatalogModel(ref: string, catalog: Record<string, u
|
|
|
187
187
|
export declare const MODEL_IMAGE_INPUTS: readonly ["yes", "no", "undeclared"];
|
|
188
188
|
export type ModelImageInput = (typeof MODEL_IMAGE_INPUTS)[number];
|
|
189
189
|
/**
|
|
190
|
-
*
|
|
190
|
+
* 「这个目录条目收不收图」的**唯一读法**。读者都投影它,不各写各的:
|
|
191
191
|
* · 目录行 `GET /v1/models` 的 `vision`:`yes` ⇒ `true`,`no` ⇒ `false`,`undeclared` ⇒ **键缺席**(不替没声明的模型答「收」也不答「不收」);
|
|
192
|
-
* ·
|
|
193
|
-
*
|
|
194
|
-
* 条目上把用户的图拦在了本地,而引擎其实会把图交给模型。env 车道与 web-admin 车道恒写 `input`,分叉只落在手写目录条目上。
|
|
192
|
+
* · 配置目录 `GET /v1/config/catalog` 的 `MODEL_VISION` 行。
|
|
193
|
+
* 「图被换成占位句」这件事实不在本仓判:引擎 7.56.0([ref])在真替换的那一刻铸给人(`model.capability_downgraded`,会话流),本仓提交面的带图预检随之退役。
|
|
195
194
|
* `input` 不是数组(手写错形)与条目不在,同归 `undeclared`:没有可信的声明。
|
|
196
195
|
*/
|
|
197
196
|
export declare function modelImageInput(model: {
|
|
@@ -212,19 +211,9 @@ export interface ModelCapabilityDecl {
|
|
|
212
211
|
/**
|
|
213
212
|
* 能力位声明 ⇒ `Model` 上的两个键,**缺席不铸键**:`reasoning` 原样;`vision` 翻成 `input`(`true` ⇒ `["text","image"]`,`false` ⇒ `["text"]`)。
|
|
214
213
|
* env 腿(`MODEL_REASONING` / `MODEL_VISION`)、cheap 槽(`MODEL_CHEAP_*`)与中心腿(`models[].reasoning` / `vision`)都经它铸 —— 三条腿一个铸法、一个「缺席」的意思。
|
|
215
|
-
* 读回的唯一读法是 {@link modelReasoningDecl} 与 {@link modelImageInput}(
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* `input` 缺席 ⇒ 支持图(`modelSupportsVision`:`model?.input === undefined ? true : …`),`reasoning` 缺席 ⇒ 真值判假(`!!model.reasoning`)。所以交给引擎的目录里缺席的键是安全的,
|
|
219
|
-
* 只是型面还没跟上;返回型因此对 `Pick<Model, …>` 说了一句「可能为空」的谎,把断言收在这一处 —— 调用点的 `Model` 字面量照旧带 `Model` 注解(其余每个键仍被 tsc 逐个核,
|
|
220
|
-
* 读表门按注解收字面量的 core 键)。型面归引擎:引擎把这两位放成可选之日,本接缝(返回型 + 这一处断言)整件删除。
|
|
214
|
+
* 读回的唯一读法是 {@link modelReasoningDecl} 与 {@link modelImageInput}(`GET /v1/models` 与配置目录同读)。
|
|
215
|
+
* 引擎 7.56.0([ref])起 `Model.reasoning` / `Model.input` 在型面上就是可选(缺席 = 未声明,引擎一只读法 `capabilityOf`:图的未声明照常交给模型、
|
|
216
|
+
* 推理的未声明不发思考档),所以本函数的返回型就是引擎的型,无断言。
|
|
221
217
|
*/
|
|
222
218
|
export declare function mintCapabilityKeys(decl: ModelCapabilityDecl): Pick<Model, "reasoning" | "input">;
|
|
223
|
-
/**
|
|
224
|
-
* 带图预检:只有目录条目**明说**不收图({@link modelImageInput} 为 `"no"`)才为假 —— 提交时据此计数并告警(引擎会把这些图换成给模型的
|
|
225
|
-
* 占位句);没声明的条目为真(不出信号,图原样交给模型)。
|
|
226
|
-
*/
|
|
227
|
-
export declare function modelSupportsImages(model: {
|
|
228
|
-
input?: unknown;
|
|
229
|
-
} | undefined): boolean;
|
|
230
219
|
//# sourceMappingURL=model-select.d.ts.map
|
package/dist/model-select.js
CHANGED
|
@@ -137,7 +137,4 @@ export function mintCapabilityKeys(decl) {
|
|
|
137
137
|
keys[CAPABILITY_MODEL_KEYS.input] = decl.vision ? ["text", "image"] : ["text"];
|
|
138
138
|
return keys;
|
|
139
139
|
}
|
|
140
|
-
export function modelSupportsImages(model) {
|
|
141
|
-
return modelImageInput(model) !== "no";
|
|
142
|
-
}
|
|
143
140
|
//# sourceMappingURL=model-select.js.map
|
|
@@ -42,7 +42,7 @@ export type UnmatchableRuleName = Exclude<RuleToolNameVerdict, {
|
|
|
42
42
|
/**
|
|
43
43
|
* **运维名表的态度** —— 一个常量,判官与匹配器同读(core 7.55.0 [ref])。本仓的名表消费者(env `APPROVAL_REQUIRE` / `APPROVAL_DENY` / `APPROVAL_NEVER_AUTO`、
|
|
44
44
|
* 中心下发的 `approvalRequire`、请求 `settings.permissions` 的 neverAuto 座)全是**限制表**(要求审批 / 硬拦 / 禁自动答):引擎对一个名字在限制表里的读法
|
|
45
|
-
* (`judgeRuleToolName(name, 名册, behavior)` 收不收、`
|
|
45
|
+
* (`judgeRuleToolName(name, 名册, behavior)` 收不收、`isCoveringRuleName(name, behavior)` 够着哪些工具)只分「限制 / 放行」两侧 —— 整个协议的名字
|
|
46
46
|
* `mcp__*` / `mcp__*__*` 在 deny 与 ask 里同读成这一协议的每一只工具。受理口的判(`config.ts`)与运行期的匹配(`approval.ts`)读同一个态度,一张表不会一边收、一边什么也不拦。
|
|
47
47
|
*/
|
|
48
48
|
export declare const NAME_TABLE_BEHAVIOR: "deny";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two object-store buckets this server reads from and never creates (`docs/DEPLOY-PREREQS.md` "对象存储桶"), and the name each takes when its
|
|
3
|
+
* knob is unset — ONE spelling of each default. The config loader (`config.ts`), the config catalog's default notes, the boot presence check's role
|
|
4
|
+
* table (`plugins/snapshot-bucket-presence.ts`) and the k8s adapter's refusal sentence all read these constants; a literal copied into any of them is
|
|
5
|
+
* a second source that drifts the day a default changes (the refusal would then name a bucket the loader no longer defaults to).
|
|
6
|
+
*
|
|
7
|
+
* Pure leaf: no imports.
|
|
8
|
+
*/
|
|
9
|
+
/** `SESSION_SNAPSHOT_BUCKET` unset ⇒ this bucket: snapshot-BLOB offload, and the SendUserFile private presigned track / sandbox staging. */
|
|
10
|
+
export declare const SESSION_SNAPSHOT_BUCKET_DEFAULT = "session-snapshots";
|
|
11
|
+
/** `WORKSPACE_SNAPSHOT_BUCKET` unset ⇒ this bucket: the k8s lane's workspace snapshots (cross-run space snapshots and parked-run archives). */
|
|
12
|
+
export declare const WORKSPACE_SNAPSHOT_BUCKET_DEFAULT = "workspaces";
|
|
13
|
+
//# sourceMappingURL=object-store-buckets.d.ts.map
|
|
@@ -109,7 +109,7 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
109
109
|
};
|
|
110
110
|
readonly "server.elicitation.open-frame-undelivered": {
|
|
111
111
|
readonly cls: "F";
|
|
112
|
-
readonly note: "MCP elicitation 的 open 帧投递失败 ⇒
|
|
112
|
+
readonly note: "MCP elicitation 的 open 帧投递失败 ⇒ 按没人应答放掉(cancel)。方向本身是 fail-closed(问不到人就是没授予),缺的只是留痕。";
|
|
113
113
|
};
|
|
114
114
|
readonly "server.question.complete-breadcrumb-dropped": {
|
|
115
115
|
readonly cls: "F";
|
|
@@ -189,11 +189,11 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
189
189
|
};
|
|
190
190
|
readonly "server.approvals.park-row-blob-unreadable": {
|
|
191
191
|
readonly cls: "F";
|
|
192
|
-
readonly note: "S-700(`plugins/checkpoint-store-sql.ts` 的 `
|
|
192
|
+
readonly note: "S-700(`plugins/checkpoint-store-sql.ts` 的 `readParkRowActionCell`):运维待批队列(`GET /v1/approvals` / `/stream`)的某一行,`checkpoint` 列里寄存行的 **`pendingAction` 子树**(NP-3 / 7.100.0 起引擎内只取这一棵、整只快照不出库;只为 park 行事实 `requiresRealApproval` / `ruleOffersAbsence` / `mandated`(S-663 二段,core #1079)/ `mandate`(S-721)/ `origin`(S-755)而读 —— 事实位的真源是 `approval-card.ts` 的 `ParkRowFacts`)**在场却不是一只对象**(JSON `null` 字面 / 串 / 数 —— 手改 / 迁移脚本改过)。子树**缺席**(SQL NULL:成员不在,或整只文档不是对象 —— 后者 `get()` 照旧拒;MariaDB 文本承载上的非 JSON 字节同样答 SQL NULL)⇒ 事实缺席、不计数。放行的最坏后果 = **这一行**的 park 行事实(`ParkRowFacts` 各位)缺席(展示/分诊材料;core 定性 display metadata,resume 的带子读 gate 自己的位),队列其余部分照常 —— 而这一行本来就 resume 不了(`get()` 对同一格拒)。不放行的代价是整只 `rows.map` 抛出 ⇒ 一行坏 blob 打掉整个租户的队列(列表 500、SSE 心跳照常而队列永远空),与同一 `rows.map` 里 `rule_suggestions` / `risk_descriptor` 两格同族同判。故 F 类;tag 与那两格**分开计**(哪一格在坏要读得出来)。计数非零 = 这一行的 decide 同样读不动(`get()` 对同一格拒),去按 session 查那一行。 (`member=gate` 那第二座随 core 7.55.0 #1468 P1 阶段二退役:队列行的卡与到期分法改读 `approval_card` / `gate_kind` 两列 —— 写口与 M29 回填同一只派生落下的格 —— 本读面不再读 blob 的 `gate` 子树。)S-2076 起同 tag 另有两座同判据的臂(`SqlCheckpointStore.readParkedSkillCardFacts`:对行上真带技能卡三位之一的行,整只快照读回的体坏、或体是对象但 core 的摘要读不动它 ⇒ 只丢**这一行**的三位〔`boundGrantDigest` / `boundGrants` / `classifierNoRuling`〕,队列照常;`not-text` 同样原样抛)—— 计数非零的处置同上:去按 session 查那一行。";
|
|
193
193
|
};
|
|
194
194
|
readonly "server.approvals.durable-row-checkpoint-id-missing": {
|
|
195
195
|
readonly cls: "F";
|
|
196
|
-
readonly note: "7.133.0(`checkpoint-identity.ts` 的 `durableRowIdentity`;两只店的 `listPending` + `/v1/assistant/inbox` handler):三处 durable 读面(运维队列行 `GET /v1/approvals` 与 `/v1/approvals/stream` 的 `pending` 帧;停驻收件 `GET /v1/assistant/inbox` 的行)读到一行停驻门**没有可用的 `checkpointId`** ⇒ 这一行**照列、`checkpointId` 键缺席**(消费方按「这一行没有可 join 的身份」处理)。detail = `face=<approvals-queue|assistant-inbox> why=<absent|untrusted>`:`absent` = 行上没有这一格(core 5.42.0 之前停驻的老行 —— core 明写不回填);`untrusted` = 在场却没过信任边界(非串 / 空串 / 超长 / 含 resume token —— 数据污染;没过边界的值不上 wire)。放行(列、键缺席)的最坏后果 = 消费方对这一行做不了跨面 join(三面对账少一行)—— 行本身、决断口(`/v1/approvals/:sessionId/decide`,按会话)、到期收割都照常。不放行有两种形:整只拒的代价是一行老 / 坏行打掉整个租户的队列(列表 500、SSE 心跳照常而队列永远停在旧帧);把这一行藏起来的代价更糟 —— 人看不到要批的东西(审批面上的 fail-open,方向反了)。故 F 类;必须留痕(两种成因从此可分)。计数非零 = 有老 / 坏行在飞(列着、没身份);`/stream` 每 3s 一拍重读,同一行每拍计一次(量值 = 行 × 拍数,在场才是信号)。";
|
|
196
|
+
readonly note: "7.133.0(`checkpoint-identity.ts` 的 `durableRowIdentity`;两只店的 `listPending` + `/v1/assistant/inbox` handler):三处 durable 读面(运维队列行 `GET /v1/approvals` 与 `/v1/approvals/stream` 的 `pending` 帧;停驻收件 `GET /v1/assistant/inbox` 的行)读到一行停驻门**没有可用的 `checkpointId`** ⇒ 这一行**照列、`checkpointId` 键缺席**(消费方按「这一行没有可 join 的身份」处理)。detail = `face=<approvals-queue|assistant-inbox> why=<absent|untrusted>`:`absent` = 行上没有这一格(core 5.42.0 之前停驻的老行 —— core 明写不回填);`untrusted` = 在场却没过信任边界(非串 / 空串 / 超长 / 含 resume token —— 数据污染;没过边界的值不上 wire)。放行(列、键缺席)的最坏后果 = 消费方对这一行做不了跨面 join(三面对账少一行)—— 行本身、决断口(`/v1/approvals/:sessionId/decide`,按会话)、到期收割都照常。不放行有两种形:整只拒的代价是一行老 / 坏行打掉整个租户的队列(列表 500、SSE 心跳照常而队列永远停在旧帧);把这一行藏起来的代价更糟 —— 人看不到要批的东西(审批面上的 fail-open,方向反了)。故 F 类;必须留痕(两种成因从此可分)。计数非零 = 有老 / 坏行在飞(列着、没身份);`/stream` 每 3s 一拍重读,同一行每拍计一次(量值 = 行 × 拍数,在场才是信号)。 7.137.0 起第四面:park 账本行(`GET /v1/runs/:id/events` 的 `suspended` / `needs_review`;唯一构造器 `trace/project.ts` 的 `parkEventData`,写时判一次,detail `face=run-events-park`)—— 暂停因由上的门身份没过信任边界 ⇒ 行照写、`checkpointId` 键缺席(决断方回显不了这道门,退回不带键的决断或从 run 结果取原值;行本身、门、待批调用身份照常)。";
|
|
197
197
|
};
|
|
198
198
|
readonly "server.approvals.queue-row-gate-kind-missing": {
|
|
199
199
|
readonly cls: "F";
|
|
@@ -373,7 +373,7 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
373
373
|
};
|
|
374
374
|
readonly "server.redact.ppk-eat-to-end": {
|
|
375
375
|
readonly cls: "F";
|
|
376
|
-
readonly note: "S-107 第三十二轮重扫:PuTTY .ppk 容器扫描器(redact.ts redactPpkContainers)在「无合格终止 / 收口后同容器范围再见私钥字段 / 收口后到下一版本头之间夹非空白」三形下从头**吃到输入末尾**(fail-closed 取证丢弃)——终态 errorMessage 座上=整条错误文案变成 «redacted:private-key»,与 redactions_applied_total{private-key}
|
|
376
|
+
readonly note: "S-107 第三十二轮重扫:PuTTY .ppk 容器扫描器(redact.ts redactPpkContainers)在「无合格终止 / 收口后同容器范围再见私钥字段 / 收口后到下一版本头之间夹非空白」三形下从头**吃到输入末尾**(fail-closed 取证丢弃)——终态 errorMessage 座上=整条错误文案变成 «redacted:private-key»,与 redactions_applied_total{private-key} 的诚实替换同形不可分,故要有自己的计数/探针;影子扫不计;出口座有界行的 head 读法(只扫一段头)上「窗内无合格终止」是终止可能在窗外的未决 —— 照样遮到窗尾,但不是兜底,不计;计数=多少次整段吃尾。";
|
|
377
377
|
};
|
|
378
378
|
readonly "server.approval-card.closed-word-out-of-set": {
|
|
379
379
|
readonly cls: "F";
|
|
@@ -391,9 +391,9 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
391
391
|
readonly cls: "F";
|
|
392
392
|
readonly note: "S-287(`plugins/ensure-index.ts` 的 PG 臂):这口 PG **协议**面不认 `CREATE INDEX CONCURRENTLY`。今天唯一的真消费者是**仓内离线镜像的手搓 `PgQueryFn` 假件**(`pg-mem` 不是本仓依赖,`test/memory-embedder-fingerprint.test.ts` 头注已为此记过一次档,这里不重复那个错)。判据是**能力面**不是名字,且**只认阳性信号**:SQLSTATE ∈ {`0A000` feature_not_supported、`42601` syntax_error},或错误**完全不带 `code`**(= 不是驱动也不是服务端给的错误)⇒ 判「不认」,回退成普通 `CREATE INDEX IF NOT EXISTS`;**带任何其它 `code` 的一律原样抛** —— SQLSTATE 的 `55P03`/`57014`/`23505`/`42501`/`25001` 与 libuv 的 `ECONNRESET`/`EPIPE`/`ETIMEDOUT` 都在这一侧(⚠️ 不要按「5 位大写」的形状去分这两族:`EPIPE` 恰好也是 5 位大写)。放行的最坏后果 = 这一次建索引持表级 `SHARE` 锁阻塞该表的写(纯**性能/可用性**面,索引本身照样建成、语义零差别),而能走到这条臂的面**按定义**不是生产 PG。计数非零 = 有一口本以为是真 PG 的部署其实不认 CONCURRENTLY,运维要去看它到底是什么。detail = `<表>.<索引名>`。";
|
|
393
393
|
};
|
|
394
|
-
readonly "server.assistant-inbox.objective-
|
|
394
|
+
readonly "server.assistant-inbox.objective-preview-unreadable": {
|
|
395
395
|
readonly cls: "F";
|
|
396
|
-
readonly note: "S-
|
|
396
|
+
readonly note: "S-1874 / S-2137(`routes/approvals-assistant.ts` 的 `GET /v1/assistant/inbox`):每行的 `objective` = 这道门所属 run 的目标预览 —— 按 run id 直读那一行的 `objectivePreview` 列(写入时已脱敏 + 截断;`GET /v1/assistant/tasks` 读同一列)。门 → run 是按键直读:门所在会话的认领持有者 / 最近一条腿,委派子代的门读派它的那条 run(停驻子代行上的 `parentTaskId`,行经判别器 `findParkedAgentForCheckpoint` 取)。某一行这几次直读失败(店抖动 / 那一行 run 的 `result` 格读不出 —— SQL `getRun` 对坏格刻意抛)⇒ **这一行**的 `objective` 落 `null`,列表其余照常。放行的最坏后果 = inbox 上这一张卡这一次不显示它属于哪个任务(纯展示位;不参与任何决裁、续跑或门判)。不放行的代价是一行 run 读不出就打掉整个用户的待批列表(人看不到要批的卡)。故 F 类;必须留痕,否则「这一次没读成」与「这道门本来就没有 run」同形。detail = 那一行的会话 id 与错误句。前身(7.97.0–7.135.x):同一格读停驻上下文、坏体落 null 的那一只 tag(objective-ctx-corrupt),随 S-1874 退役(inbox 不再读续跑上下文)。";
|
|
397
397
|
};
|
|
398
398
|
readonly "server.run-store.corrupt-record-skipped": {
|
|
399
399
|
readonly cls: "F";
|
|
@@ -473,7 +473,7 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
473
473
|
};
|
|
474
474
|
readonly "server.snapshot-bucket.presence-unproven": {
|
|
475
475
|
readonly cls: "F";
|
|
476
|
-
readonly note: "S-1195(7.119.0;`plugins/snapshot-bucket-presence.ts` 的 `ensureSnapshotBucket`,boot 期核一次快照桶 `SESSION_SNAPSHOT_BUCKET`;detail = `bucket=… endpoint=<buildDisplaySafeUrl 的显示形> <HTTP 状态 | request failed: 错类>`):presigned 列举对 `MINIO_ENDPOINT` **连不上 / 403 / 5xx / 没有 NoSuchBucket 的 404**,或探针到窗尾一次都没答过(detail 写 `probe still pending when the window ended`)⇒ **证明不了桶缺**,不拒启、照常起服(只有 404 + `NoSuchBucket` 才是「缺」,那一形窗内重试、到窗拒启,不走本 tag)。三问:①错误落到哪 —— 本 tag 的计数 / 探针行 / 记录器的一次性 warn,detail 带端点显示形与状态或错类;②谁受害 —— 桶其实不存在、或凭据不能列举的部署:之后每一次快照 offload 写与 SendUserFile 私有 presigned 请求会答 404 / 403,孤儿 sweep 每分钟一条失败,运维读到的是一串失败请求而不是「桶没建」(与 7.118.x 的既有形状同形,不是新损失);③缺席倒向哪边 —— 倒向**放行起服**:没有证据既不拒启、也不伪造「桶在场」或「桶缺」,不是门 / 权限 / 凭证。最坏后果 = 缺桶的部署晚一步才暴露;不放行的代价是对象存储一次抖动 / 一次 403 就让整只服务起不来。计数非零 = 这台部署启动时没能确认快照桶,按 detail 的端点与状态去核对网络 / 凭据 / 桶。";
|
|
476
|
+
readonly note: "S-1195(7.119.0;`plugins/snapshot-bucket-presence.ts` 的 `ensureSnapshotBucket`,boot 期核一次快照桶 `SESSION_SNAPSHOT_BUCKET`;S-2021〔7.136.0〕起同一只探针、同一条规则、同一个 tag 也核 k8s 车道的工作区快照桶 `WORKSPACE_SNAPSHOT_BUCKET`——detail 里的 `bucket=` 就是被核的那只桶名;detail = `bucket=… endpoint=<buildDisplaySafeUrl 的显示形> <HTTP 状态 | request failed: 错类>`):presigned 列举对 `MINIO_ENDPOINT` **连不上 / 403 / 5xx / 没有 NoSuchBucket 的 404**,或探针到窗尾一次都没答过(detail 写 `probe still pending when the window ended`)⇒ **证明不了桶缺**,不拒启、照常起服(只有 404 + `NoSuchBucket` 才是「缺」,那一形窗内重试、到窗拒启,不走本 tag)。三问:①错误落到哪 —— 本 tag 的计数 / 探针行 / 记录器的一次性 warn,detail 带端点显示形与状态或错类;②谁受害 —— 桶其实不存在、或凭据不能列举的部署:之后每一次快照 offload 写与 SendUserFile 私有 presigned 请求会答 404 / 403,孤儿 sweep 每分钟一条失败,运维读到的是一串失败请求而不是「桶没建」(与 7.118.x 的既有形状同形,不是新损失);工作区快照桶则是每条 run 读 `latest` 得 404/403——404 + NoSuchBucket 在运行期由 `workspace_snapshot_bucket_missing` 响亮拒绝,403/5xx 走既有的非 404 读失败臂(同样响亮);③缺席倒向哪边 —— 倒向**放行起服**:没有证据既不拒启、也不伪造「桶在场」或「桶缺」,不是门 / 权限 / 凭证。最坏后果 = 缺桶的部署晚一步才暴露;不放行的代价是对象存储一次抖动 / 一次 403 就让整只服务起不来。计数非零 = 这台部署启动时没能确认快照桶,按 detail 的端点与状态去核对网络 / 凭据 / 桶。";
|
|
477
477
|
};
|
|
478
478
|
readonly "server.fleet.serving-lease-unconfirmed": {
|
|
479
479
|
readonly cls: "R";
|
|
@@ -499,6 +499,18 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
499
499
|
readonly cls: "F";
|
|
500
500
|
readonly note: "k8s 车道工作区空间结束时对**快照对象**的回收(`plugins/remote-env-k8s.ts` `createSpaceReclaimer` 的对象部分;与上一条同一只回收座、两条腿:会话删除协调器与托管留存 sweep):按空间的 `<前缀>/<化身>/space/` 分区(快照 + `latest`)和该会话停驻车道里名字带被结束住客归属记号的 `<前缀>/<会话 id>/*.tar.gz` 分别 LIST、逐个预签 DELETE;LIST 失败、DELETE 失败(HTTP 非 2xx / 非 404、网络)LIST 超过 1000 个对象被截断,或回收座一次调用的绝对截止(= 快照时限;卷回收也在内)到点〔切断在途请求、停掉余下的;这次调用里还没轮到的空间零请求、各记一次;没删的归生命周期规则〕,各记一次(detail `lane=space|park stage=list|delete|budget`;会话删除口把回收座脱离应答路径,座若抛了——契约禁止——记 `stage=seat_threw`)⇒ 这些对象留在桶里,会话照删(不挡删除)。放行的最坏后果 = 一份已无人能读的工作区快照留在桶里(会话已删,经 API 不可达;内容是用户工作区,所以不是「只占盘」—— 留到桶的生命周期规则把它过期掉为止);不碰任何别的空间、不是门不是凭据;反方向(清不掉对象就拒删会话)会让一个对象存储抖动挡住用户的删除权。故 F 类,但必须留痕:静默吞掉之后「这个会话删了、它的工作区内容还在不在桶里」在遥测里没有任何痕迹。同拍一行 `workspace_space_reclaim_failed`(`space` 前缀 / `sessionId` / `lane` / `stage` / `count` / `error`;一次调用里同类〔分区 × 阶段〕的失败合成一行,`count` = 撞上它的空间数,其余键点名调用里排第一的那个,计数仍逐空间;回收座同一时刻最多 4 个空间在收,sweep 与会话删除共用这一只门)。计数非零 = 有对象没回收掉,运维按行里的空间前缀 / 会话 id 去桶里手清,并核对象存储的可达性与 DELETE 权限。回收与同一空间的尚在途的 run 末提交不是互斥的:会话删除时没有活 run(409 挡),但上一条 run 的提交若恰在删除之后才落对象,这批对象不在本次回收射程内(同样归桶的生命周期规则)。停驻分区按会话 id 分区,所以只删名字带被结束住客归属记号的对象(不读任何钟)—— 会话 id 删后被别人重新登记,新住客停驻出的快照带它自己的记号、不碰;不带记号的旧形与 `none` 留给桶的生命周期规则。";
|
|
501
501
|
};
|
|
502
|
+
readonly "server.sandbox-secret.seat-unverified": {
|
|
503
|
+
readonly cls: "F";
|
|
504
|
+
readonly note: "k8s 车道沙箱秘密座的起服核(`boot/execution-env.ts` `ensureSandboxSecretSeat`,第 5 段 await;只在 `K8S_SANDBOX_ENV` 点到了本进程环境里有的键时问):对沙箱命名空间 secrets 的 env 座那一行动词(create —— 适配器为 env Secret 真发的调用)各发一次 SelfSubjectAccessReview,**问不到**(请求失败 / 审查本身被拒 / 答复没有布尔 `status.allowed`)而没有一个动词答「不许」⇒ 照常起服(答了「不许」⇒ 拒启,不走本 tag)。放行的最坏后果 = RBAC 真缺时第一个要建 Secret 的 run 在连接时被拒(`auth_failed`)、它的 pod 被删 —— 名单值仍然只经该 pod 自己的 Secret,不回落成 pod spec 里的明文;不是门不是凭据的放宽,只是把「缺 RBAC」从起服挪到了第一次连接。detail = `namespace=<ns>` + 每个没问到的动词与原因(不带值)。同拍一行 `sandbox_secret_seat_unverified`。计数非零 = 这台部署起服时没能确认 Secret 动词,按 detail 核 API 可达性与该服务账号能不能建 SelfSubjectAccessReview。";
|
|
505
|
+
};
|
|
506
|
+
readonly "server.sandbox-pod-reaper.list-failed": {
|
|
507
|
+
readonly cls: "F";
|
|
508
|
+
readonly note: "k8s 车道沙箱 Pod 回收器(`plugins/k8s-pod-reaper.ts` `reapOnce`,维护 tick 每副本每 5 分钟一轮)按身份标签列沙箱命名空间的 Pod **失败**(API 不可达 / 403 / 非 2xx)⇒ 这一轮一只都不删、不抛,下一轮一个周期后照常再列。最坏后果 = 已结束的沙箱 Pod 与已终 run 的 Pod(连同它们以 `ownerReferences` 挂着的 Secret —— 部署名单值 / 成员凭据租约)在 etcd 里多留至少一个周期:是**静态数据**多留,不是凭据被用 —— 成员凭据的使用界是代理的租约(到点 destroy,不随回收器);run 收尾的正常删除路不经本腿。不是门 / 凭据的放宽 ⇒ F。计数逐轮一次 + 探针行(`namespace=` + 原因)+ 同拍一行 warn `sandbox_pod_reap_list_failed`;修前只一行 info 轮次行(`listed:false`),不计数、不响。计数持续非零 = 回收器连续列不到 Pod,按原因核 API 可达性与 Role 的 pods `list`。";
|
|
509
|
+
};
|
|
510
|
+
readonly "server.sandbox-pod.delete-failed": {
|
|
511
|
+
readonly cls: "F";
|
|
512
|
+
readonly note: "k8s 车道**删一只沙箱 pod 却没删成**,两个座一只上报口(`plugins/k8s-pod-delete-failure.ts` `reportPodDeleteFailed`;detail = `namespace=<ns> pod=<名> why=<原因词> cause=<http_<状态>|request_failed>`):①连接清理座(`plugins/remote-env-k8s.ts` `discardRefusedPod`,`why` = `env_secret_unsealed|lease_secret_unsealed|broker_image_pull_failed`):env Secret / 租约 Secret 建不成、或代理镜像拉不下 ⇒ 连接被拒、该 pod 要删,而这一删本身失败(请求抛 / API 回 403、5xx 等非 2xx 非 404)⇒ 拒答不变(仍是原来那一条),pod 与挂在它名下的 Secret(部署名单值 / 租约占位)留在命名空间里,由回收器兜(`plugins/k8s-pod-reaper.ts`:带 run 标签的按 run 终态删,不带的等容器全部结束后删);②回收器座(`plugins/k8s-pod-reaper.ts` `reapOnce` 的删一步,`why` = `reaper_containers_ended|reaper_run_ended_past_hold`):兜底本身删失败 ⇒ 这一只留到下一轮(一个周期后)再判再删,一只失败不挡同轮其余。最坏后果 = **静态数据**多留至少一个回收周期(与 `server.sandbox-pod-reaper.list-failed` 同一件事的另一半):没有值进 pod spec、没有连接被放过、成员凭据的使用界是代理的租约 ⇒ 不是门 / 凭据的放宽 ⇒ F。计数逐次 + 探针行 + 同拍一行 error `sandbox_pod_delete_failed`(pod / 命名空间 / 原因词 / 原因码,不带值、不带 API 文本;运维行座缺席或只有 warn 的座上行不发、计数照记);修前连接清理三处 `.catch(() => {})` 吞,零日志零计数,回收器的删失败只落一行 warn(不计数)。计数持续非零 = 删 pod 的 Role 动词(pods `delete`)或 API 可达性有问题,按 `cause` 核;`why` 以 `reaper_` 起头的计数持续非零 = 兜底本身删不动,残留会随轮次累积。";
|
|
513
|
+
};
|
|
502
514
|
readonly "server.sandbox-egress.policy-gap": {
|
|
503
515
|
readonly cls: "P-DEBT";
|
|
504
516
|
readonly note: "k8s 车道沙箱出网的起服自检(`plugins/remote-env-k8s.ts` `checkSandboxEgressPolicy` 读节点表与沙箱 ns 的 NetworkPolicy,判法 `sandbox-egress-policy.ts` `sandboxEgressGaps`;起服一次、不挡起服)读出一个缺口 —— 某节点的 InternalIP / ExternalIP 落在一条放行 ipBlock 内(`kind=node_address_open`)、没有策略以 Egress 选中沙箱 pod(`kind=policy_absent`)、pod 保留 IPv6 而策略层担保不了 v6(`kind=ipv6_enabled`)、节点表或策略表读不到(`kind=unreadable what=nodes|networkpolicies`)⇒ 车道**照常起**,每个缺口一行 `sandbox_egress_policy_gap`(带后果句与去哪改)。归 P 类:出网策略是保护面,缺口意味着沙箱里的代码可能够到节点上的服务;归 DEBT 的理由:修法都在集群配置里(节点地址点名、kubelet 放行 v6 sysctl、CNI 的 v6 执行、RBAC),本服务改不了,而拒起车道会让缺省单节点装法(恒有 `ipv6_enabled`)升级即停摆沙箱执行 —— 车道自己的隔离(VM 边界、零 SA token)仍在。放行的最坏后果 = 读出缺口的那一面照旧可达,直到运维按行里的后果句改配置。计数非零 = 这台部署的沙箱出网面有读得出的缺口。读不出的面(宿主 DNAT 发布端口、「pod 所在节点恒放行」的实现差异、CNI 根本不执行策略)不在本 tag 的射程里。";
|