@sema-agent/server 7.125.0 → 7.126.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 +199 -2
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +263 -140
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/networkpolicy-sandbox.yaml +47 -0
- package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +5 -1
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +2 -2
- package/deploy/sema-up/chart/templates/server.yaml +1 -1
- package/deploy/sema-up/chart/values.yaml +12 -0
- package/deploy/sema-up/cluster-up.sh +10 -10
- package/deploy/sema-up/kube-up.sh +11 -10
- package/deploy/sema-up/lib/dataroot.sh +1 -1
- package/deploy/sema-up/lib/envf.sh +5 -5
- package/deploy/sema-up/lib/flagshape.sh +5 -5
- package/deploy/sema-up/lib/lanes.py +1 -1
- package/deploy/sema-up/lib/parse-machines.py +2 -2
- package/deploy/sema-up/lib/shell-access.sh +1 -1
- package/deploy/sema-up/preflight.sh +4 -4
- package/deploy/sema-up/sema-up.sh +33 -33
- package/deploy/sema-up/smoke.sh +3 -3
- package/deploy/sema-up/stack/compose.yaml +1 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +6 -2
- package/dist/approval-card.d.ts +20 -4
- package/dist/approval-content-kind.d.ts +38 -22
- package/dist/approval-content-kind.js +20 -4
- package/dist/audit.js +2 -0
- package/dist/bench/s1/arms.d.ts +9 -37
- package/dist/bench/s1/arms.js +4 -61
- package/dist/bench/s1/live-deps.d.ts +4 -10
- package/dist/bench/s1/live-deps.js +1 -222
- package/dist/bench/s1/oracle.d.ts +1 -1
- package/dist/bench/s1/reviewer.d.ts +1 -1
- package/dist/bench/s1/row.d.ts +5 -7
- package/dist/bench/s1/row.js +0 -2
- package/dist/bench/s1/run-firm.d.ts +2 -2
- package/dist/bench/s1/run-firm.js +1 -4
- package/dist/bench/s1/runner-ctx.d.ts +17 -29
- package/dist/bench/s1/runner-ctx.js +3 -7
- package/dist/bench/s1/tasks.d.ts +9 -46
- package/dist/bench/s1/tasks.js +4 -63
- package/dist/boot/execution-env.d.ts +38 -26
- package/dist/boot/execution-env.js +71 -38
- package/dist/boot/memory-boundary.d.ts +1 -1
- package/dist/boot/parked-revive-gate.d.ts +0 -3
- package/dist/boot/parked-revive-gate.js +2 -2
- package/dist/boot/resolve-spec.d.ts +0 -2
- package/dist/boot/resolve-spec.js +12 -17
- package/dist/boot/retention-lane.d.ts +12 -1
- package/dist/boot/retention-lane.js +2 -0
- package/dist/boot/runner-deps.d.ts +5 -5
- package/dist/boot/runner-deps.js +5 -16
- package/dist/boot/session-faces.d.ts +5 -1
- package/dist/boot/session-faces.js +37 -1
- package/dist/boot/stage-03-store-backend.d.ts +1 -0
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -0
- package/dist/boot/stage-05-execution-env.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.js +7 -4
- package/dist/boot/stage-06-runners.d.ts +2 -3
- package/dist/boot/stage-06-runners.js +8 -7
- package/dist/boot/stage-07-capability-layer.d.ts +2 -3
- package/dist/boot/stage-07-capability-layer.js +3 -4
- package/dist/boot/stage-08-reapers.d.ts +2 -3
- package/dist/boot/stage-08-reapers.js +2 -2
- package/dist/boot/stage-09-leader.d.ts +2 -3
- package/dist/boot/stage-09-leader.js +2 -1
- package/dist/boot/stage-10-http-server.d.ts +2 -3
- package/dist/boot/stage-10-http-server.js +2 -2
- package/dist/boot/stores.d.ts +1 -0
- package/dist/boot/stores.js +4 -3
- package/dist/boot/web-admin.d.ts +5 -0
- package/dist/boot/web-admin.js +28 -14
- package/dist/brain.d.ts +2 -2
- package/dist/brain.js +1 -1
- package/dist/capabilities/builtin-tools.d.ts +2 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/composite-members.js +1 -1
- package/dist/capabilities/hands-lane.d.ts +9 -6
- package/dist/capabilities/hands-lane.js +2 -2
- package/dist/capabilities/memory-notice.d.ts +27 -22
- package/dist/capabilities/memory-notice.js +15 -17
- package/dist/capabilities/scenarios.d.ts +9 -14
- package/dist/capabilities/scenarios.js +5 -50
- package/dist/capability-facts.d.ts +22 -11
- package/dist/capability-facts.js +13 -6
- package/dist/config-catalog.js +11 -4
- package/dist/config-provider.d.ts +5 -1
- package/dist/config-provider.js +23 -4
- package/dist/config-types.d.ts +14 -1
- package/dist/config.js +39 -6
- package/dist/deployment-governance.d.ts +19 -21
- package/dist/deployment-governance.js +7 -8
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/env-name-allowlist-knobs.js +1 -0
- package/dist/execution-lane-caps.js +2 -2
- package/dist/hooks/hook-runner.d.ts +84 -30
- package/dist/hooks/hook-runner.js +74 -41
- package/dist/http/admission.js +12 -9
- package/dist/http/durable-run-leg.d.ts +5 -4
- package/dist/http/durable-run-leg.js +1 -1
- package/dist/http/idempotency.d.ts +28 -6
- package/dist/http/idempotency.js +10 -2
- package/dist/http/principal-gate.d.ts +14 -0
- package/dist/http/principal-gate.js +7 -0
- package/dist/http/request-guards.d.ts +2 -1
- package/dist/http/request-guards.js +14 -14
- package/dist/http/resume-legs.d.ts +2 -2
- package/dist/http/resume-legs.js +5 -4
- package/dist/http/route-ctx.d.ts +8 -6
- package/dist/http/routes/a2a-serve.js +11 -7
- package/dist/http/routes/approvals-assistant.js +18 -3
- package/dist/http/routes/background.d.ts +1 -1
- package/dist/http/routes/background.js +1 -1
- package/dist/http/routes/capabilities.js +10 -2
- package/dist/http/routes/mcp-reconnect.js +1 -1
- package/dist/http/routes/runs.d.ts +4 -3
- package/dist/http/routes/runs.js +12 -13
- package/dist/http/routes/session-sync.js +14 -11
- package/dist/http/routes/sessions.js +9 -9
- package/dist/http/routes/side-query.js +6 -19
- package/dist/http/routes/tasks.js +12 -11
- package/dist/http/server.d.ts +4 -0
- package/dist/http/server.js +2 -2
- package/dist/http/submit-replay.d.ts +15 -8
- package/dist/http/submit-replay.js +6 -0
- package/dist/http/wire-types.d.ts +7 -9
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/internal-run-env.d.ts +30 -0
- package/dist/internal-run-env.js +11 -0
- package/dist/leader/wire.js +3 -2
- package/dist/memory-scope.d.ts +19 -7
- package/dist/memory-scope.js +25 -8
- package/dist/observability/fail-open.d.ts +15 -3
- package/dist/observability/fail-open.js +15 -3
- package/dist/observability/metrics.d.ts +0 -1
- package/dist/observability/metrics.js +0 -3
- package/dist/observability/run-terminal.js +69 -4
- package/dist/permission-rule-vocab.d.ts +3 -2
- package/dist/permission-rule-vocab.js +1 -1
- package/dist/plan-cache-probe.d.ts +3 -2
- package/dist/plugins/approval-ask-store-sql.d.ts +1 -1
- package/dist/plugins/caching-session-store.d.ts +3 -0
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +42 -28
- package/dist/plugins/checkpoint-store-sql.js +57 -11
- package/dist/plugins/file-run-store.d.ts +25 -21
- package/dist/plugins/file-run-store.js +70 -34
- package/dist/plugins/local-checkpoint-store.d.ts +8 -5
- package/dist/plugins/local-checkpoint-store.js +5 -15
- package/dist/plugins/local-session-store.d.ts +66 -7
- package/dist/plugins/local-session-store.js +168 -101
- package/dist/plugins/mailbox-recipient-lifecycle.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +19 -3
- package/dist/plugins/memory-run-store.js +38 -3
- package/dist/plugins/one-time-migrations.d.ts +141 -39
- package/dist/plugins/one-time-migrations.js +32 -143
- package/dist/plugins/pg-pool.js +11 -1
- package/dist/plugins/pg-session-storage.d.ts +2 -0
- package/dist/plugins/pg-session-storage.js +9 -5
- 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 +1 -0
- package/dist/plugins/remote-env-e2b.d.ts +4 -0
- package/dist/plugins/remote-env-e2b.js +2 -1
- package/dist/plugins/remote-env-host.d.ts +12 -0
- package/dist/plugins/remote-env-host.js +11 -1
- package/dist/plugins/remote-env-k8s.d.ts +227 -39
- package/dist/plugins/remote-env-k8s.js +450 -75
- package/dist/plugins/remote-env-local-docker.d.ts +4 -0
- package/dist/plugins/remote-env-local-docker.js +2 -1
- package/dist/plugins/remote-env-ssh.d.ts +3 -0
- package/dist/plugins/remote-env-ssh.js +1 -0
- package/dist/plugins/retention-store-sql.d.ts +4 -1
- package/dist/plugins/retention-store-sql.js +11 -9
- package/dist/plugins/run-store-sql.d.ts +44 -6
- package/dist/plugins/run-store-sql.js +92 -27
- package/dist/plugins/session-capture-record-store-sql.d.ts +2 -3
- package/dist/plugins/sql-driver.d.ts +2 -1
- package/dist/plugins/store-backend.js +1 -1
- package/dist/plugins/store-contracts.d.ts +17 -3
- package/dist/plugins/tidb-pool.js +15 -3
- package/dist/plugins/tidb-session-storage.js +3 -2
- package/dist/plugins/tidb-session-store.d.ts +2 -0
- package/dist/plugins/tidb-session-store.js +6 -2
- package/dist/request-key-closure.d.ts +12 -0
- package/dist/request-key-closure.js +3 -3
- package/dist/router/route-orchestration.d.ts +3 -11
- package/dist/router/route-orchestration.js +0 -4
- package/dist/rule-entry-list.js +0 -4
- package/dist/rules-consent.js +3 -0
- package/dist/run-local.d.ts +5 -4
- package/dist/run-local.js +23 -17
- package/dist/runs.js +1 -0
- package/dist/security.d.ts +7 -0
- package/dist/security.js +5 -0
- package/dist/server-secret-env.d.ts +10 -4
- package/dist/server-secret-env.js +4 -1
- package/dist/session-incarnation.d.ts +46 -2
- package/dist/session-incarnation.js +14 -3
- package/dist/session-sync-kernel.d.ts +10 -3
- package/dist/spec-fields.d.ts +24 -8
- package/dist/spec-fields.js +21 -2
- package/dist/task-workflow.d.ts +6 -4
- package/dist/task-workflow.js +3 -2
- package/dist/tool-approval.d.ts +78 -6
- package/dist/tool-approval.js +7 -3
- package/dist/trace/core-keyset-guard.d.ts +4 -4
- package/dist/trace/engine-notice-wire.d.ts +26 -1
- package/dist/trace/engine-notice-wire.js +7 -2
- package/dist/trace/project.d.ts +8 -3
- package/dist/trace/project.js +15 -1
- package/dist/trace/self-minted-wire.d.ts +104 -2
- package/dist/trace/self-minted-wire.js +35 -0
- package/dist/web-admin-client/apply-effective.d.ts +13 -7
- package/dist/web-admin-client/apply-effective.js +11 -26
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/candidate-gate.d.ts +39 -4
- package/dist/web-admin-client/candidate-gate.js +9 -2
- package/dist/web-admin-client/facade.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +3 -1
- package/dist/web-admin-client/http-client.js +4 -3
- package/dist/web-admin-client/read-warnings.d.ts +33 -5
- package/dist/web-admin-client/read-warnings.js +41 -6
- package/dist/web-admin-client/types.d.ts +11 -5
- package/dist/workspace-cache.d.ts +45 -0
- package/dist/workspace-cache.js +30 -0
- package/dist/workspace-space-commit.d.ts +116 -0
- package/dist/workspace-space-commit.js +117 -0
- package/dist/workspace-space.d.ts +75 -9
- package/dist/workspace-space.js +52 -1
- package/package.json +4 -4
- package/dist/boot/session-incarnation-seat.d.ts +0 -41
- package/dist/boot/session-incarnation-seat.js +0 -69
- package/dist/capabilities/code-review-council.d.ts +0 -49
- package/dist/capabilities/code-review-council.js +0 -111
- package/dist/capabilities/collab-wire.d.ts +0 -36
- package/dist/capabilities/collab-wire.js +0 -2
- package/dist/capabilities/collab-workflows.d.ts +0 -47
- package/dist/capabilities/collab-workflows.js +0 -90
- package/dist/capabilities/prompts/code-review.d.ts +0 -25
- package/dist/capabilities/prompts/code-review.js +0 -39
- package/dist/capabilities/prompts/team.d.ts +0 -10
- package/dist/capabilities/prompts/team.js +0 -6
- package/dist/capabilities/team.d.ts +0 -113
- package/dist/capabilities/team.js +0 -70
package/dist/tool-approval.d.ts
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ref]/[ref]② tool-approval bridge — the SERVICE side of core's `RunnerDeps.onAsk` seam (core `tool-policy.ts`
|
|
3
|
+
* `resolveAsk`, 1.290's sync-ask leg). The SIBLING of {@link import("./question.js").QuestionCoordinator}: onQuestion
|
|
4
|
+
* routes the agent's AskUserQuestion tool to a live human; THIS routes a policy `ask` DECISION (e.g. the
|
|
5
|
+
* `createFsWriteGatePolicy` fs-write gate, an ask-list rule, or a non-durable safety ask) to the live human as a
|
|
6
|
+
* CC-parity three-choice card (Yes / Yes-allow-all-session / No).
|
|
7
|
+
*
|
|
8
|
+
* Wire shape (mirrors question end to end): core adjudicates a tool call `ask` → `resolveAsk(req, onAsk)` calls this
|
|
9
|
+
* coordinator's `ask` → we mint a pending entry + emit a `tool_approval` SSE frame on the run's live stream → the
|
|
10
|
+
* shell renders the three-choice card → `POST /v1/tool-approvals/:id/respond` settles the parked promise →
|
|
11
|
+
* `resolveAsk` maps our boolean to allow/deny. RESPOND BODY selection rationale: the question precedent's body is
|
|
12
|
+
* core's own QuestionAnswer (a structured multi-answer object) because core FENCES its semantics; an approval has no
|
|
13
|
+
* core-side answer object — `OnAsk` resolves to a BARE boolean — so the wire body is a minimal closed enum
|
|
14
|
+
* `{decision: "allow" | "allow_session" | "deny"}` mapping 1:1 onto the CC card's three choices (no free text = no
|
|
15
|
+
* fence needed; "allow_session" carries the Yes-allow-all intent that a boolean cannot).
|
|
16
|
+
*
|
|
17
|
+
* Session state ([ref]② "桥内会话态"): `allow_session` remembers a per-CAPABILITY grant keyed by
|
|
18
|
+
* `[owner, sessionId, category]` — a LATER ask in that (owner, session) whose tool maps to the SAME category
|
|
19
|
+
* auto-allows WITHOUT a card (CC 207: "Yes, allow all edits during this session") only through the FOUR-WAY
|
|
20
|
+
* conjunction at the short-circuit (see `ask`): {@link standingAnswerHome} over the ask's three facts
|
|
21
|
+
* (NOT governance-forced [ref] 件7/[ref], NOT `requiresRealApproval` [ref], NOT `mandated` S-660 — the SAME
|
|
22
|
+
* predicate decides whether an `allow_session` answer may MINT a grant, see `finishRespond`) ∧ a truthy sessionId ∧
|
|
23
|
+
* the grant itself ∧ `sessionGrantUncontestedByRow` (the durable row must not contradict the local peek). The category collapses the
|
|
24
|
+
* fs-WRITE tool family (Write/Edit/NotebookEdit, canonical space) into ONE bucket `"fs-write"`; any OTHER tool is
|
|
25
|
+
* its OWN bucket `"tool:<canonical>"`. 🔴 A `allow_session` on a NON-fs-write ask (an irreversible-Bash safety ask,
|
|
26
|
+
* an ask-list rule on another tool) therefore unlocks ONLY that same tool for the session — it must NEVER unlock the
|
|
27
|
+
* fs-write family (the "approve a cheap ask once → all future Write/Edit auto-allowed" scope widening, 三路复审 A 组 修2).
|
|
28
|
+
* The key is scoped to the VERIFIED owner too, so a session id shared across principals cannot inherit another's
|
|
29
|
+
* grant. This is the cheapest mid-task implementation; a mode SWITCH (default → acceptEdits) still goes through the
|
|
30
|
+
* shell's intent on the next task ([ref] table).
|
|
31
|
+
*
|
|
32
|
+
* 🔒 FAIL-CLOSED everywhere (the inverse of the question lane — an unanswered QUESTION never blocks the run: since
|
|
33
|
+
* [ref] the coordinator reports `unavailable` and CORE decides the landing, which depends on WHEN the human became
|
|
34
|
+
* unreachable — at policy time the durable gate says `ask` and the leg parks; once the tool is already running core is
|
|
35
|
+
* past `suspendAsk`, so it continues on `declined_unavailable`; an unanswered APPROVAL must NOT let the write
|
|
36
|
+
* proceed): TTL expiry and client disconnect ([ref] `parkOpenAsksForTask` → `forceParkNow`) land on the ONE
|
|
37
|
+
* unattended-outcome former ({@link ToolApprovalCoordinator.unattendedOutcome}, [ref] R-13) — park route
|
|
38
|
+
* ("unavailable" ⇒ core durable-parks) by default, a DEPLOYMENT-POLICY refusal (`{allow:false, settledBy:"policy",
|
|
39
|
+
* reason}` ⇒ core settles `policy_refused`; S-689 — never a bare `false`, which core reads as a PERSON's refusal)
|
|
40
|
+
* ONLY where the deployment declared `UNATTENDED_APPROVAL_POLICY=deny`; a run ABORT (task cancel → `runCancel`)
|
|
41
|
+
* still resolves `false` — the row goes VOID, there is nothing left to redeem. Since [ref] G1 (core 1.295
|
|
42
|
+
* OnAsk 三值化) the "no reachable human" class returns
|
|
43
|
+
* "unavailable" instead of false — no ALS context AND no bound-closure broker hit(1.258 起 bg/嵌套子代经
|
|
44
|
+
* spec.onAsk 的 bound 闭包 + streams broker 直达宿主活流,「无 ctx」只剩 durable-submit/headless resume
|
|
45
|
+
* 残余腿)and emit failure
|
|
46
|
+
* (card never delivered, and only when this catch is the first settler — a human verdict that raced in during the
|
|
47
|
+
* await keeps its boolean) ⇒ "unavailable" → core durable-parks (or fail-closed denies without a checkpoint). core's
|
|
48
|
+
* `resolveAsk` maps false to a deny WITH the ask message, so the model can re-route (deny + continue turn, [ref]⑤).
|
|
49
|
+
* Owner gate on respond = the VERIFIED principal (gatedPrincipal at the HTTP layer), 404 without an existence oracle
|
|
50
|
+
* — same posture as question/elicit. The frame's model-authored surfaces (message + args) are secret-REDACTED
|
|
51
|
+
* before they are streamed; the SIZE bound is per-surface: args ride a byte cap (`MAX_APPROVAL_ARGS_BYTES`,
|
|
52
|
+
* over-cap ⇒ `argsOmitted`), while the legacy frame's `message` is redacted but NOT length-capped — the char
|
|
53
|
+
* cap (`MAX_MESSAGE`, approval-card.ts `clip`) lives on the card/`approval_request` projection only (same
|
|
54
|
+
* redact-at-write contract as question; the args are shown to a human,
|
|
55
|
+
* never re-fed to a model). No throttle (unlike question): an approval breach-default would be a DENY (task failure),
|
|
56
|
+
* and asks are turn-blocking by construction — the TTL bounds the human-side exposure instead.
|
|
57
|
+
*/
|
|
58
|
+
import { type ParkedGateFace } from "./approval-content-kind.js";
|
|
1
59
|
import { type ApprovalDecidedBy, type HostSettledBy, type RetiredDecisionKeyFacts } from "./host-decision.js";
|
|
2
60
|
import type { IncomingMessage } from "node:http";
|
|
3
|
-
import { type AskClass, type AskRequest, type AskOutcome, type PermissionResult, type CheckpointGate, type PendingAction, type PersistedRuleMandate, type ReadRootGrantCandidate, type RuleOffer, type AutoModeFallbackCause, type BoundSkillGrants } from "@sema-agent/core";
|
|
61
|
+
import { type AskClass, type AskRequest, type AskOutcome, type PermissionResult, type CheckpointGate, type PendingAction, type PersistedRuleMandate, type ReadRootGrantCandidate, type RuleOffer, type AutoModeFallbackCause, type BoundSkillGrants, type ToolApprovalCard } from "@sema-agent/core";
|
|
4
62
|
import { type CardRulePersisted, type RuleConsentLane } from "./rules-consent.js";
|
|
5
63
|
import { type AllowRuleShadowProjection, type DenialLimitFallback, type RuleOffersAbsence, type ApprovalRequestFrame, type ApprovalRevokeFrame, type RuleEvidenceProjection } from "./approval-card.js";
|
|
6
64
|
import { type ApprovalAskStore, type AskRow } from "./plugins/approval-ask-store-sql.js";
|
|
@@ -18,6 +76,11 @@ import { type ApprovalExemptionStore } from "./plugins/approval-exemption-store.
|
|
|
18
76
|
export declare const APPROVAL_GATE_KINDS: readonly ["human", "irreversible_ask"];
|
|
19
77
|
export type ApprovalGateKind = (typeof APPROVAL_GATE_KINDS)[number];
|
|
20
78
|
export declare function isApprovalGateKind(k: string | undefined): k is ApprovalGateKind;
|
|
79
|
+
/**
|
|
80
|
+
* 停驻行的到期归 SLA 拒扫腿(deny)而不是作废(expire)?—— **一只谓词**:审批门型 ∧ core `facetOf(gate)` 读作 `A`(问答卡 ⇒ `B`,到期作废;
|
|
81
|
+
* 无门型 / 非审批门 ⇒ 不归拒扫)。两只店的拒扫选行与作废腿的补集都读这一只(SQL 腿的 `gate_kind IN …` 只是它的粗筛前置,判官仍是 core)。
|
|
82
|
+
*/
|
|
83
|
+
export declare function denySweepOwns(gate: ParkedGateFace | undefined): boolean;
|
|
21
84
|
/** 两方言同形的 SQL IN 片段(值为闭集常量字面,无注入面)。 */
|
|
22
85
|
export declare const APPROVAL_GATE_KINDS_SQL_IN: string;
|
|
23
86
|
/**
|
|
@@ -345,7 +408,7 @@ export interface ToolApprovalFrame {
|
|
|
345
408
|
/**
|
|
346
409
|
* **S-721(core 7.32.0 #1092;ADDITIVE,`"tool_approval"` only)** —— 强制位**站在哪一个词上**:core `PERSISTED_RULE_MANDATES`
|
|
347
410
|
* 六词之一(`operator_always` / `tool_marks` / `probe_mandate` / `probe_unanswered` / `write_protection` /
|
|
348
|
-
* `
|
|
411
|
+
* `target_unresolved`,词义属主在 core)。只在 `mandated: true` 的**整因**是那一个词时在场;另一扇门(治理 / hook /
|
|
349
412
|
* 祖先)或不止一个理由 ⇒ 缺席 —— **缺席从不命名一个词**,也不等于「不强制」(读 `mandated`)。值经 `approval-card.ts` 的
|
|
350
413
|
* `readClosedWordSeat(req, "mandate")` 窄读(闭集筛 = core `isPersistedRuleMandate`,本仓不抄词表;集外词读作缺席 + 计一次)。echo-only:
|
|
351
414
|
* 本仓不按词分支。耐久面同一个词:运维队列行(`parkRowFacts`,park 行孪生座)与 inbox 行(core `CheckpointSummary.mandate`)。
|
|
@@ -407,6 +470,15 @@ export interface ToolApprovalFrame {
|
|
|
407
470
|
/** core 7.43.0 #1353:分类器没给判词的成因词(`error` / `timeout` / `parse_error`;只在类 `classifier_no_ruling` 的卡上)。闭集经 core 的
|
|
408
471
|
* `readClosedWordSeat(req, "classifierNoRuling")` 窄读(筛 = core `isAutoModeFallbackCause`),集外 ⇒ 缺席 + 计一次。display:本仓不按它裁决。 */
|
|
409
472
|
classifierNoRuling?: AutoModeFallbackCause;
|
|
473
|
+
/**
|
|
474
|
+
* **core 7.49.0 #1414(ADDITIVE,`"tool_approval"` only)—— 这一问渲在哪张卡上**:引擎在闸站铸的那一个词(闭集 core `TOOL_APPROVAL_CARDS`:
|
|
475
|
+
* `file-edit` / `file-write` / `notebook-edit` / `shell` / `fetch` / `plan` / `question` / `generic`),`AskRequest.approvalCard` 逐字过境,经
|
|
476
|
+
* `approval-content-kind.ts` 的 `readApprovalCard` 闭集窄读(集外 ⇒ 缺席 + 计一次 closed-word-out-of-set)。`question` = 问用户的问题(引擎保留的
|
|
477
|
+
* 问答工具),不是副作用工具。**本仓不从工具名回推卡**(工具名只作展示):此前按名字铸的 `livePending` 行 / 队列行 `contentKind` 随本键删。
|
|
478
|
+
* 停驻孪生 = 门的 `gate.approvalCard`(运维队列行顶层同名键,两只店读同一只 `parkedApprovalCard`)。display:本仓不按它裁决。
|
|
479
|
+
* 🔴 缺席即缺席(宿主自建的 ask / 老引擎),不编 `generic`。⚠️ `card_json` 卡面不带本键(`ApprovalCardSchema` `.strict()`,与 `mandated` 同)。
|
|
480
|
+
*/
|
|
481
|
+
approvalCard?: ToolApprovalCard;
|
|
410
482
|
/**
|
|
411
483
|
* **[ref]**(core 7.19.0;**ADDITIVE**,`"tool_approval"` only)—— 这只**根外读** ask 的**清障目录**:
|
|
412
484
|
* 把 `dir` 加进本会话的读目录(壳侧既有的 `/add-dir` 口),同一条调用就不会再问。
|
|
@@ -675,10 +747,10 @@ export interface LivePendingRow {
|
|
|
675
747
|
* 子代 ask)上恒等成立。缺席 = 顶层 ask。`fromSubagent` 保留不动(byte-compat:先于本键的消费方仍按
|
|
676
748
|
* 它判别)。 */
|
|
677
749
|
originTaskId?: string;
|
|
678
|
-
/**
|
|
679
|
-
* `
|
|
680
|
-
*
|
|
681
|
-
|
|
750
|
+
/** core 7.49.0 #1414:这一问的卡词 —— 与 {@link frame} 上的 `approvalCard` **同一个值**(行读帧上那一格,不另读一遍),与 durable
|
|
751
|
+
* 队列行顶层的同名键同层同形(那一面读门的 `gate.approvalCard`)。缺席 = 引擎没给(宿主自建 ask / 老引擎)。展示/分诊用,永不参与决议路由。
|
|
752
|
+
* (此前此处是按工具名铸的 `contentKind`,随 #1414 删:卡只有引擎铸的这一个词。) */
|
|
753
|
+
approvalCard?: ToolApprovalCard;
|
|
682
754
|
/**
|
|
683
755
|
* 🔴 S-454(P1;cli L-397 / 板 [ref]):这只 ask **本来会 emit 的那只活卡帧**。
|
|
684
756
|
*
|
package/dist/tool-approval.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parkedFacetOf, readApprovalCard } from "./approval-content-kind.js";
|
|
2
2
|
import { heldAskOf, liveSettledBy, readDecidedBy, retiredDecisionKeyFacts, DECIDED_BY_OUTSIDE_CLOSED_SET, POLICY_CANNOT_ALLOW_PERSON_ASK } from "./host-decision.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { uuidv7, classifyAsk, foldArbitrationRow, policyCannotAnswer, screenAskClassMembers, MAX_RULE_TEXT_CHARS, READ_ROOT_CANDIDATE_DIR_MAX, parseRuleText, pathConfinableWriteToolNames } from "@sema-agent/core";
|
|
@@ -23,6 +23,9 @@ export const APPROVAL_GATE_KINDS = ["human", "irreversible_ask"];
|
|
|
23
23
|
export function isApprovalGateKind(k) {
|
|
24
24
|
return k !== undefined && APPROVAL_GATE_KINDS.includes(k);
|
|
25
25
|
}
|
|
26
|
+
export function denySweepOwns(gate) {
|
|
27
|
+
return isApprovalGateKind(typeof gate?.kind === "string" ? gate.kind : undefined) && parkedFacetOf(gate) === "A";
|
|
28
|
+
}
|
|
26
29
|
export const APPROVAL_GATE_KINDS_SQL_IN = `(${APPROVAL_GATE_KINDS.map((k) => `'${k}'`).join(",")})`;
|
|
27
30
|
const MAX_APPROVAL_ARGS_BYTES = 16384;
|
|
28
31
|
const DEFAULT_APPROVAL_TTL_MS = 5 * 60_000;
|
|
@@ -1151,6 +1154,7 @@ export class ToolApprovalCoordinator {
|
|
|
1151
1154
|
let ruleLaneMaterial = this.buildRuleLaneMaterial(req, origin.owner, governanceForced, origin.sessionId);
|
|
1152
1155
|
const mandateWord = readClosedWordSeat(req, "mandate");
|
|
1153
1156
|
const noRulingCause = readClosedWordSeat(req, "classifierNoRuling");
|
|
1157
|
+
const cardWord = readApprovalCard(req.approvalCard);
|
|
1154
1158
|
const originWord = typeof req.origin === "string" && req.origin.length > 0 ? req.origin : undefined;
|
|
1155
1159
|
const askClassPair = readAskClassPair(req);
|
|
1156
1160
|
const frame = {
|
|
@@ -1181,6 +1185,7 @@ export class ToolApprovalCoordinator {
|
|
|
1181
1185
|
...(standingAnswerHome(askStandingAnswerFacts(req, governanceForced, deploymentListAsks)) === "none" ? { rememberRefused: true } : {}),
|
|
1182
1186
|
...(typeof req.boundGrantDigest === "string" ? { boundGrantDigest: req.boundGrantDigest, ...(req.boundGrants !== undefined ? { boundGrants: req.boundGrants } : {}) } : {}),
|
|
1183
1187
|
...(noRulingCause !== undefined ? { classifierNoRuling: noRulingCause } : {}),
|
|
1188
|
+
...(cardWord !== undefined ? { approvalCard: cardWord } : {}),
|
|
1184
1189
|
...(mandateWord !== undefined ? { mandate: mandateWord } : {}),
|
|
1185
1190
|
...(originWord !== undefined ? { origin: originWord } : {}),
|
|
1186
1191
|
...(askClassPair ?? {}),
|
|
@@ -2434,7 +2439,6 @@ export class ToolApprovalCoordinator {
|
|
|
2434
2439
|
for (const [id, e] of this.pending) {
|
|
2435
2440
|
if (scope !== undefined && e.owner !== scope)
|
|
2436
2441
|
continue;
|
|
2437
|
-
const contentKind = contentKindOf(e.toolName);
|
|
2438
2442
|
rows.push({
|
|
2439
2443
|
approvalId: id,
|
|
2440
2444
|
toolName: e.toolName,
|
|
@@ -2448,7 +2452,7 @@ export class ToolApprovalCoordinator {
|
|
|
2448
2452
|
...(e.mandate !== undefined ? { mandate: e.mandate } : {}),
|
|
2449
2453
|
...(e.origin !== undefined ? { origin: e.origin } : {}),
|
|
2450
2454
|
...(e.originTaskId !== undefined ? { fromSubagent: true, originTaskId: e.originTaskId } : {}),
|
|
2451
|
-
...(
|
|
2455
|
+
...(e.frame.approvalCard !== undefined ? { approvalCard: e.frame.approvalCard } : {}),
|
|
2452
2456
|
frame: e.frame.approvalId === id ? e.frame : { ...e.frame, approvalId: id },
|
|
2453
2457
|
});
|
|
2454
2458
|
}
|
|
@@ -43,7 +43,7 @@ type _GuardBgNotifReverse = AssertAllKeysHandled<Exclude<BgNotifProjected | BgNo
|
|
|
43
43
|
type RosterProjected = "name" | "agentId" | "sessionId" | "toolUseId" | "owner" | "scope" | "sessionScoped" | "rootSessionId" | "model" | "modelFallback" | "createdAt";
|
|
44
44
|
type _GuardRoster = AssertAllKeysHandled<Exclude<keyof RosterEntry, RosterProjected>>;
|
|
45
45
|
type _GuardRosterReverse = AssertAllKeysHandled<Exclude<RosterProjected, keyof RosterEntry>>;
|
|
46
|
-
type AskProjected = "toolName" | "toolCallId" | "args" | "message" | "sourceTaskId" | "fromSubagent" | "sourceAgentName" | "delegation" | "ruleOffers" | "ruleOffersAbsence" | "allowRuleShadowed" | "probeCause" | "probeReason" | "ruleEvidence" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "readRootCandidate" | "mandated" | "mandate" | "askClass" | "classes" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling";
|
|
46
|
+
type AskProjected = "toolName" | "toolCallId" | "args" | "message" | "sourceTaskId" | "fromSubagent" | "sourceAgentName" | "delegation" | "ruleOffers" | "ruleOffersAbsence" | "allowRuleShadowed" | "probeCause" | "probeReason" | "ruleEvidence" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "readRootCandidate" | "mandated" | "mandate" | "askClass" | "classes" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "approvalCard";
|
|
47
47
|
type AskExcluded = "preview" | "principal" | "riskAxes" | "boundInputHash" | "isDelegatedChild" | "hasBidiControls" | "previewWithheld" | "execCwd" | "authoredBy";
|
|
48
48
|
type _GuardAsk = AssertAllKeysHandled<Exclude<keyof AskRequest, AskProjected | AskExcluded>>;
|
|
49
49
|
type _GuardAskReverse = AssertAllKeysHandled<Exclude<AskProjected | AskExcluded, keyof AskRequest>>;
|
|
@@ -137,7 +137,7 @@ type _GuardPermissionTraceReverse = AssertAllKeysHandled<Exclude<PermissionTrace
|
|
|
137
137
|
type AssertNonEmpty<T> = [T] extends [never] ? "EMPTY" : never;
|
|
138
138
|
type _GuardPermissionTraceNonEmpty = AssertAllKeysHandled<AssertNonEmpty<PermissionTraceKind>>;
|
|
139
139
|
type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling";
|
|
140
|
-
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceTaskId" | "
|
|
140
|
+
type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceTaskId" | "approvalCard" | "restoreMode" | "checkpointId" | "previewWithheld" | "authoredBy";
|
|
141
141
|
type _GuardInboxSummary = AssertAllKeysHandled<Exclude<keyof CheckpointSummary, SummaryProjected | SummaryExcluded>>;
|
|
142
142
|
type _GuardInboxSummaryReverse = AssertAllKeysHandled<Exclude<SummaryProjected | SummaryExcluded, keyof CheckpointSummary>>;
|
|
143
143
|
type ParkArmKeys = keyof Extract<PendingAction, {
|
|
@@ -148,8 +148,8 @@ type ParkArmQueueExcluded = "kind" | "args" | "batchToolCallIds" | "completedCal
|
|
|
148
148
|
type _GuardParkArmQueue = AssertAllKeysHandled<Exclude<ParkArmKeys, ParkArmQueueProjected | ParkArmQueueExcluded>>;
|
|
149
149
|
type _GuardParkArmQueueReverse = AssertAllKeysHandled<Exclude<ParkArmQueueProjected | ParkArmQueueExcluded, ParkArmKeys>>;
|
|
150
150
|
type _NoDoubleBookParkArmQueue = AssertAllKeysHandled<Extract<ParkArmQueueProjected, ParkArmQueueExcluded>>;
|
|
151
|
-
type TaskSpecWired = "objective" | "principal" | "images" | "sessionId" | "requireExistingSession" | "oneShot" | "clientContext" | "resumeAt" | "resumeAtMode" | "model" | "compactionModel" | "thinking" | "systemPrompt" | "appendSystemPrompt" | "promptProvider" | "memory" | "suggestNextPrompts" | "restoreFiles" | "acceptPartialRestore" | "rewindFilesTo" | "tools" | "excludeTools" | "deferTools" | "toolMaterializeStrategy" | "promptProfile" | "toolPolicy" | "onAsk" | "onQuestion" | "hooks" | "durableApproval" | "resourceSuspend" | "resilience" | "finalVerification" | "checkpointStore" | "handsReadOnly" | "memoryPersistenceCapable" | "additionalDirectories" | "additionalReadDirectories" | "enablePlanMode" | "interactiveTools" | "enableFork" | "shellGate" | "approvalReach" | "writeFace" | "mcp" | "a2a" | "skills" | "backgroundScope" | "envFacts" | "limits" | "configOverrides" | "forwardSubagentEvents" | "retainSubagentSessions" | "retainBackgroundProcesses" | "outputSchema" | "outputRetries" | "compaction" | "attachments" | "selfOrchestration" | "getApiKeyAndHeaders" | "interactionPosture" | "agents" | "permissionMode" | "taskId" | "signal" | "preemptSignal" | "
|
|
152
|
-
type TaskSpecUnwired = "actor" | "roles" | "lspManager" | "tracer" | "readFace" | "readDenyPatterns" | "interactiveQuestionFallback" | "alwaysLoadTools" | "restoreGatedTools" | "deferSelfResolve" | "basePolicyForResumeEdit" | "lspDiagnostics" | "streamingToolExecution" | "toolResultThresholdChars" | "peerPresence";
|
|
151
|
+
type TaskSpecWired = "objective" | "principal" | "images" | "sessionId" | "requireExistingSession" | "oneShot" | "clientContext" | "resumeAt" | "resumeAtMode" | "model" | "compactionModel" | "thinking" | "systemPrompt" | "appendSystemPrompt" | "promptProvider" | "memory" | "suggestNextPrompts" | "restoreFiles" | "acceptPartialRestore" | "rewindFilesTo" | "tools" | "excludeTools" | "deferTools" | "toolMaterializeStrategy" | "promptProfile" | "toolPolicy" | "onAsk" | "onQuestion" | "hooks" | "durableApproval" | "resourceSuspend" | "resilience" | "finalVerification" | "checkpointStore" | "handsReadOnly" | "memoryPersistenceCapable" | "additionalDirectories" | "additionalReadDirectories" | "enablePlanMode" | "interactiveTools" | "enableFork" | "shellGate" | "approvalReach" | "writeFace" | "mcp" | "a2a" | "skills" | "backgroundScope" | "envFacts" | "limits" | "configOverrides" | "forwardSubagentEvents" | "retainSubagentSessions" | "retainBackgroundProcesses" | "outputSchema" | "outputRetries" | "compaction" | "attachments" | "selfOrchestration" | "getApiKeyAndHeaders" | "interactionPosture" | "agents" | "permissionMode" | "taskId" | "signal" | "preemptSignal" | "maxSuspends" | "skillListingBudgetFraction" | "skillListingMaxDescChars" | "excludeAllTools" | "fileHistory" | "userInvokedSkills" | "outputStyle" | "allowedTools" | "allowTools";
|
|
152
|
+
type TaskSpecUnwired = "actor" | "roles" | "lspManager" | "tracer" | "readFace" | "readDenyPatterns" | "interactiveQuestionFallback" | "alwaysLoadTools" | "restoreGatedTools" | "deferSelfResolve" | "basePolicyForResumeEdit" | "lspDiagnostics" | "streamingToolExecution" | "toolResultThresholdChars" | "peerPresence" | "writeProtectedAdditions" | "complianceAdditionalDenies" | "modelRole" | "enableBlockedReport";
|
|
153
153
|
type _GuardTaskSpec = AssertAllKeysHandled<Exclude<keyof TaskSpec, TaskSpecWired | TaskSpecUnwired>>;
|
|
154
154
|
type _GuardTaskSpecReverse = AssertAllKeysHandled<Exclude<TaskSpecWired | TaskSpecUnwired, keyof TaskSpec>>;
|
|
155
155
|
type TaskResultForwarded = "taskId" | "runId" | "sessionId" | "terminal" | "model" | "effectiveReasoning" | "result" | "salvagedOutput" | "remoteEnvFailures" | "apiFailure" | "retryAfterMs" | "degraded" | "structuredOutput" | "rewindNotes" | "haltedOnUserRejection" | "haltedByUser" | "strandedHumanAnswers" | "pendingApproval" | "approvalWaitedMs" | "effectiveReadFace" | "effectiveReadDenyPatterns" | "effectiveWriteFace" | "effectiveMemoryScopes" | "stats" | "editedFiles" | "responseModel" | "compaction";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* 同文件 G1 e2e 的全码扇出夹具、以及契约文档附录 D.3 那张表(含**小节标题里的码数** —— 那道门本批
|
|
17
17
|
* 刚立,立完就在下一次加码时自己咬住了)。
|
|
18
18
|
*/
|
|
19
|
-
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.records_skipped", "server.model_unreachable", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete"];
|
|
19
|
+
export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.records_skipped", "server.model_unreachable", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored"];
|
|
20
20
|
export type EngineNoticeWireCode = (typeof ENGINE_NOTICE_WIRE_CODES)[number];
|
|
21
21
|
/** 白名单谓词(单点):路由与门都读这一个,不许第二处手抄码串。 */
|
|
22
22
|
export declare function isEngineNoticeWireCode(code: string): code is EngineNoticeWireCode;
|
|
@@ -62,6 +62,31 @@ export interface EngineNoticeWireRow {
|
|
|
62
62
|
* · 其余(function / symbol / bigint / undefined)⇒ 丢键(JSON 不可承载或语义不明)。
|
|
63
63
|
*/
|
|
64
64
|
export declare function sanitizeNoticeDetail(detail: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
65
|
+
/**
|
|
66
|
+
* `engine_notice` 载荷构造器(三条终点腿同源:live SSE / durable 账本 / 未来的任何第四条腿)。
|
|
67
|
+
*
|
|
68
|
+
* 与 `trace/project.ts` 的 `*EventData` 族同纪律(白名单挑键、禁 `{...notice}`),但**不住在那个文件里**:
|
|
69
|
+
* 那一族的入参全是 core `TaskEvent` 的臂(有 `wire-whitelist-exhaustiveness` 的臂集编译门看着),
|
|
70
|
+
* 而 `EngineNotice` 不是 `TaskEvent` —— 混进去会让那道门的语义变成"两个不同来源的联合",判别力反而降。
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* 通告 `detail` 里**规则文本**的坐标:码 → `{ 数组键, 元素上的文本键 }`。新码的 detail 带规则文本时在这里登记(一张表,不在各处写分支)。
|
|
74
|
+
* 规则文本是人或模型写下的条目原串,最可能夹着凭据;这张表管的只有一件事 —— 它离开进程的每一条路都先过 {@link redactListEntry}。
|
|
75
|
+
* 导出是给钉用的:`test/notice-entry-presentation.test.ts` 的「日志行 = 会话流行」一组逐码迭代这张表,新登记的码自动入组。
|
|
76
|
+
*/
|
|
77
|
+
export declare const RULE_TEXT_DETAIL_FIELDS: Readonly<Record<string, {
|
|
78
|
+
readonly array: string;
|
|
79
|
+
readonly field: string;
|
|
80
|
+
}>>;
|
|
81
|
+
/**
|
|
82
|
+
* 通告 `message`(引擎铸的人读句)的脱敏 —— **唯一一只**:会话流行(经 {@link engineNoticeEventData},之后截到 {@link NOTICE_TEXT_MAX})与运维日志行
|
|
83
|
+
* (`boot/runner-deps.ts` 的转发席,不截)同调它 ⇒ 同一条通告的 `message` 在两条出路上逐字节同(会话流行另有 {@link NOTICE_TEXT_MAX} 字上限,
|
|
84
|
+
* 超长的那一截只在日志行上)。对**全部**通告码一视同仁,不按码分支:带规则文本的码(本表 {@link RULE_TEXT_DETAIL_FIELDS} 的登记码)的 `message` 里
|
|
85
|
+
* 条目以引擎的转义形出现,和别的自由文本一样只在这一只上被认凭据;认出凭据形才改字节,没有凭据形的句子逐字节原样。
|
|
86
|
+
* ⚠️ 已知边界(既有,两条出路同,见 CHANGELOG 7.120.0「条目」条):引擎把条目里的零宽字符写成 `\uXXXX` 转义,夹零宽字符的凭据在转义后的句子里认不出;
|
|
87
|
+
* 句子归引擎,本仓不改写 —— 机读位 `detail` 里的规则文本是在原串上认的({@link redactNoticeRuleText}),不受此限。
|
|
88
|
+
*/
|
|
89
|
+
export declare function redactNoticeMessage(message: unknown): string;
|
|
65
90
|
/**
|
|
66
91
|
* 通告 `detail` 里的**规则文本**换成条目的脱敏原值({@link redactListEntry}:凭据换记号,不加引号、不转义 —— 机读位不是显示面,显示形只属于人读句)。
|
|
67
92
|
* 会话流行(经 {@link engineNoticeEventData},之后照常过 {@link sanitizeNoticeDetail})与运维日志行(`boot/runner-deps.ts` 的转发席,其余字段逐字)
|
|
@@ -37,6 +37,8 @@ export const ENGINE_NOTICE_WIRE_CODES = [
|
|
|
37
37
|
"permission.rule_row_dropped",
|
|
38
38
|
"permission.allowed_tool_not_granted",
|
|
39
39
|
"task.tool_turn_incomplete",
|
|
40
|
+
"route.finish_reason_unknown",
|
|
41
|
+
"route.stream_end_ignored",
|
|
40
42
|
];
|
|
41
43
|
const WIRE_CODES = new Set(ENGINE_NOTICE_WIRE_CODES);
|
|
42
44
|
export function isEngineNoticeWireCode(code) {
|
|
@@ -93,10 +95,13 @@ function sanitizeValue(v, depth) {
|
|
|
93
95
|
}
|
|
94
96
|
return undefined;
|
|
95
97
|
}
|
|
96
|
-
const RULE_TEXT_DETAIL_FIELDS = {
|
|
98
|
+
export const RULE_TEXT_DETAIL_FIELDS = {
|
|
97
99
|
"permission.allowed_tool_not_granted": { array: "entries", field: "entry" },
|
|
98
100
|
"permission.rule_row_dropped": { array: "rows", field: "rule" },
|
|
99
101
|
};
|
|
102
|
+
export function redactNoticeMessage(message) {
|
|
103
|
+
return redactSecrets(String(message));
|
|
104
|
+
}
|
|
100
105
|
export function redactNoticeRuleText(code, detail) {
|
|
101
106
|
const at = Object.hasOwn(RULE_TEXT_DETAIL_FIELDS, code) ? RULE_TEXT_DETAIL_FIELDS[code] : undefined;
|
|
102
107
|
if (at === undefined || detail === undefined)
|
|
@@ -113,7 +118,7 @@ export function redactNoticeRuleText(code, detail) {
|
|
|
113
118
|
export function engineNoticeEventData(notice, sessionId, nowMs) {
|
|
114
119
|
return {
|
|
115
120
|
code: notice.code,
|
|
116
|
-
message:
|
|
121
|
+
message: redactNoticeMessage(notice.message).slice(0, NOTICE_TEXT_MAX),
|
|
117
122
|
detail: sanitizeNoticeDetail(redactNoticeRuleText(notice.code, notice.detail)),
|
|
118
123
|
sessionId,
|
|
119
124
|
ts: nowMs,
|
package/dist/trace/project.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ export declare function toolStartEventData(ev: {
|
|
|
150
150
|
toolName: string;
|
|
151
151
|
label?: string;
|
|
152
152
|
args: unknown;
|
|
153
|
+
recovered?: true;
|
|
153
154
|
eventId?: string;
|
|
154
155
|
parentToolCallId?: string;
|
|
155
156
|
}): Record<string, unknown>;
|
|
@@ -190,8 +191,8 @@ export declare function screenedGate(v: unknown): GateOutcome | undefined;
|
|
|
190
191
|
* ## 读腿与写腿现在是**同一只**筛(7.74.0 起,零双读)
|
|
191
192
|
* 7.72.0–7.73.0 期间读腿多一步「认本服务上一版写下的退役词旧拼法」(`unresolvable` → `ancestor_marked`),
|
|
192
193
|
* 那是一条**长期双读臂**:同一份字节在写腿与读腿上有两种理解,而且没有到期日。7.74.0 把它换成**一次性
|
|
193
|
-
* 迁移**(
|
|
194
|
-
*
|
|
194
|
+
* 迁移**(启动期把存量字节原地改名;窗关后已删码)⇒ 读腿退回写腿那只严格筛子,集外词一律整条 withhold + 计数,
|
|
195
|
+
* 不再有第二种读法 —— 残留旧拼法的字节(local 车道引擎 File 店里不可改写的已决行)同走这一只筛,响亮不静默。
|
|
195
196
|
*
|
|
196
197
|
* ## 与写腿脱敏汇点的关系(别再走回头路)
|
|
197
198
|
* 写腿的对偶是 `redactLedgerEventData`(三孪生 store 的 `appendEvent` 落库前),它管的是脱敏、不是判形;
|
|
@@ -281,6 +282,8 @@ export declare function toolEndEventData(ev: {
|
|
|
281
282
|
delivered?: McpDelivered;
|
|
282
283
|
gate?: GateOutcome;
|
|
283
284
|
gatedCallId?: string;
|
|
285
|
+
wireName?: string;
|
|
286
|
+
notExecuted?: true;
|
|
284
287
|
eventId?: string;
|
|
285
288
|
parentToolCallId?: string;
|
|
286
289
|
}): Record<string, unknown>;
|
|
@@ -837,6 +840,8 @@ export declare function brainStatusEventData(ev: {
|
|
|
837
840
|
errorStatus?: number;
|
|
838
841
|
elapsedMs?: number;
|
|
839
842
|
timeoutMs?: number;
|
|
843
|
+
providerCondition?: string;
|
|
844
|
+
providerConditionSource?: string;
|
|
840
845
|
eventId?: string;
|
|
841
846
|
parentToolCallId?: string;
|
|
842
847
|
}): Record<string, unknown>;
|
|
@@ -891,7 +896,7 @@ export interface TraceTurn {
|
|
|
891
896
|
* 🔴 **S-213⑥:五个子键**全部按同族 OMIT 契约走 —— 引擎那一侧报了才铸,没报就**缺席**,恒不折 `0`。
|
|
892
897
|
* `in`/`out` 此前是必填座、缺一键时写 `?? 0`:读端拿到的 `in:0` 与「这一轮真的零输入」逐字节同形,
|
|
893
898
|
* 于是一次 usage 半缺(某些 provider 只回 output 侧)在面板上显示成一个可核对的真数字。
|
|
894
|
-
* 0 是一个数,未知不是 —— 两者同形正是本仓 `boundCallId`/`gateKind`/`
|
|
899
|
+
* 0 是一个数,未知不是 —— 两者同形正是本仓 `boundCallId`/`gateKind`/`approvalCard` 一族一直在防的事。
|
|
895
900
|
* ⚠️ wire 面(`GET /v1/tasks/:id/turns` 与 trace SSE 的 `turn` 事件)因此可能给出**只有一侧**的
|
|
896
901
|
* `tokens`;做算术的消费端要按「键可能缺席」读(`tokens` 整只可缺席早就是契约的一部分)。
|
|
897
902
|
* 🔴 **7.74.0 / core 7.17.0([ref])**:引擎自陈 `usageMissing` 的一轮(usage 是六个 0 的占位)⇒ 整只缺席 ——
|
package/dist/trace/project.js
CHANGED
|
@@ -91,7 +91,14 @@ export function modelTextEventData(ev) {
|
|
|
91
91
|
return { text: ev.text, ...(ev.eventId ? { eventId: ev.eventId } : {}) };
|
|
92
92
|
}
|
|
93
93
|
export function toolStartEventData(ev) {
|
|
94
|
-
return {
|
|
94
|
+
return {
|
|
95
|
+
toolCallId: ev.toolCallId,
|
|
96
|
+
toolName: ev.toolName,
|
|
97
|
+
...(ev.label !== undefined ? { label: ev.label } : {}),
|
|
98
|
+
args: redactDeep(ev.args),
|
|
99
|
+
...(ev.recovered === true ? { recovered: true } : {}),
|
|
100
|
+
...identityFields(ev),
|
|
101
|
+
};
|
|
95
102
|
}
|
|
96
103
|
const SETTLEMENT_NOTE_MAX = 500;
|
|
97
104
|
export function screenedGate(v) {
|
|
@@ -274,6 +281,8 @@ export function toolEndEventData(ev) {
|
|
|
274
281
|
...(typeof ev.delivered === "string" && MCP_DELIVERY_VERDICTS.includes(ev.delivered) ? { delivered: ev.delivered } : {}),
|
|
275
282
|
...(gate !== undefined ? { gate } : {}),
|
|
276
283
|
...(typeof ev.gatedCallId === "string" && ev.gatedCallId !== "" ? { gatedCallId: ev.gatedCallId } : {}),
|
|
284
|
+
...(typeof ev.wireName === "string" && ev.wireName !== "" ? { wireName: ev.wireName } : {}),
|
|
285
|
+
...(ev.notExecuted === true ? { notExecuted: true } : {}),
|
|
277
286
|
...identityFields(ev),
|
|
278
287
|
};
|
|
279
288
|
}
|
|
@@ -724,6 +733,8 @@ export function brainStatusEventData(ev) {
|
|
|
724
733
|
...(num(ev.timeoutMs) ? { timeoutMs: ev.timeoutMs } : {}),
|
|
725
734
|
...(num(ev.errorStatus) ? { errorStatus: ev.errorStatus } : {}),
|
|
726
735
|
...(typeof ev.errClass === "string" && ev.errClass.length > 0 ? { errClass: ev.errClass } : {}),
|
|
736
|
+
...(typeof ev.providerCondition === "string" && ev.providerCondition.length > 0 ? { providerCondition: ev.providerCondition } : {}),
|
|
737
|
+
...(typeof ev.providerConditionSource === "string" && ev.providerConditionSource.length > 0 ? { providerConditionSource: ev.providerConditionSource } : {}),
|
|
727
738
|
...identityFields(ev),
|
|
728
739
|
};
|
|
729
740
|
}
|
|
@@ -839,6 +850,7 @@ export function toolCallFieldsOf(d) {
|
|
|
839
850
|
name: String(d.toolName ?? ""),
|
|
840
851
|
...(typeof d.label === "string" ? { label: d.label } : {}),
|
|
841
852
|
input: d.args,
|
|
853
|
+
...(d.recovered === true ? { recovered: true } : {}),
|
|
842
854
|
...identityFields(d),
|
|
843
855
|
};
|
|
844
856
|
}
|
|
@@ -854,6 +866,8 @@ export function toolResultFieldsOf(d) {
|
|
|
854
866
|
...(typeof d.delivered === "string" && MCP_DELIVERY_VERDICTS.includes(d.delivered) ? { delivered: d.delivered } : {}),
|
|
855
867
|
...(gate !== undefined ? { gate } : {}),
|
|
856
868
|
...(typeof d.gatedCallId === "string" && d.gatedCallId !== "" ? { gatedCallId: d.gatedCallId } : {}),
|
|
869
|
+
...(typeof d.wireName === "string" && d.wireName !== "" ? { wireName: d.wireName } : {}),
|
|
870
|
+
...(d.notExecuted === true ? { notExecuted: true } : {}),
|
|
857
871
|
...identityFields(d),
|
|
858
872
|
};
|
|
859
873
|
}
|
|
@@ -365,8 +365,9 @@ export declare const SELF_MINTED_WIRE: {
|
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
367
|
/**
|
|
368
|
-
* 提交幂等(契约 §0.7:幂等 = 资源行上的唯一键)
|
|
369
|
-
* `Idempotency-Key` 命中一条读不到 / 不是这次 taskId 所指的行时的 409
|
|
368
|
+
* 提交幂等(契约 §0.7:幂等 = 资源行上的唯一键)上 wire 的面:同步腿读行重放体的 `replay` 键、两只按键读的读口、
|
|
369
|
+
* `Idempotency-Key` 命中一条读不到 / 不是这次 taskId 所指的行时的 409(7.125.0);同键异体(绑定那一行的请求体与这次不同)的 409(7.126.0)。
|
|
370
|
+
* 行为由 `test/submit-idempotency-one-ledger.test.ts` 钉。
|
|
370
371
|
*/
|
|
371
372
|
readonly submitIdempotency: {
|
|
372
373
|
readonly at: "提交幂等(<端点>#<面> → 应答状态)";
|
|
@@ -387,6 +388,107 @@ export declare const SELF_MINTED_WIRE: {
|
|
|
387
388
|
readonly attr: 409;
|
|
388
389
|
readonly since: "7.125.0";
|
|
389
390
|
};
|
|
391
|
+
readonly "POST /v1/runs|/v1/tasks Idempotency-Key#conflict.idempotency_payload_mismatch": {
|
|
392
|
+
readonly attr: 409;
|
|
393
|
+
readonly since: "7.126.0";
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* 内建场景名(`GET /v1/capabilities.scenarios` 的内建成员,`GET /v1/capabilities/scenarios/:name` 的内建详情)。7.126.0 `discuss` 退出 wire
|
|
399
|
+
* (core 7.49.0 删团队讨论运行时;请求体再传它 = 400 `scenario_unknown`)。钉 test/team-orchestration-retired.test.ts。
|
|
400
|
+
*/
|
|
401
|
+
readonly builtinScenario: {
|
|
402
|
+
readonly at: "GET /v1/capabilities#scenarios[] 内建成员";
|
|
403
|
+
readonly members: {
|
|
404
|
+
code: {
|
|
405
|
+
attr: string;
|
|
406
|
+
since: string;
|
|
407
|
+
};
|
|
408
|
+
default: {
|
|
409
|
+
attr: string;
|
|
410
|
+
since: string;
|
|
411
|
+
};
|
|
412
|
+
"code-review": {
|
|
413
|
+
attr: string;
|
|
414
|
+
since: string;
|
|
415
|
+
};
|
|
416
|
+
scan: {
|
|
417
|
+
attr: string;
|
|
418
|
+
since: string;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
readonly retired: {
|
|
422
|
+
readonly discuss: {
|
|
423
|
+
readonly attr: "-";
|
|
424
|
+
readonly since: "7.28.0";
|
|
425
|
+
readonly until: "7.126.0";
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* 提交体的场景透传键(受理门放行;`ScenarioRequest` 索引签名读)。7.126.0 只喂 discuss 场景与 code-review council 腿的四键退出 wire
|
|
431
|
+
* (受理门对它们答未知键 400;同批退出的具名键 `council` / `debate` 住在 `TaskRequestBody` 上,不在本集 —— 具名提交面键本清单今天看不见)。
|
|
432
|
+
*/
|
|
433
|
+
readonly scenarioBodyKey: {
|
|
434
|
+
readonly at: "POST /v1/tasks|/v1/tasks/stream|/v1/runs 体的场景透传键";
|
|
435
|
+
readonly members: {
|
|
436
|
+
repo: {
|
|
437
|
+
attr: string;
|
|
438
|
+
since: string;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
readonly retired: {
|
|
442
|
+
readonly businessContext: {
|
|
443
|
+
readonly attr: "-";
|
|
444
|
+
readonly since: "1.214.2";
|
|
445
|
+
readonly until: "7.126.0";
|
|
446
|
+
};
|
|
447
|
+
readonly lenses: {
|
|
448
|
+
readonly attr: "-";
|
|
449
|
+
readonly since: "1.214.2";
|
|
450
|
+
readonly until: "7.126.0";
|
|
451
|
+
};
|
|
452
|
+
readonly rounds: {
|
|
453
|
+
readonly attr: "-";
|
|
454
|
+
readonly since: "1.214.2";
|
|
455
|
+
readonly until: "7.126.0";
|
|
456
|
+
};
|
|
457
|
+
readonly team: {
|
|
458
|
+
readonly attr: "-";
|
|
459
|
+
readonly since: "1.214.2";
|
|
460
|
+
readonly until: "7.126.0";
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* `GET /v1/models` 应答体的顶层键(闭集;`src/http/routes/capabilities.ts` 的 `sendJson(res, 200, {…})` 字面量)。属性 = 在场律:`always` 恒在场(零条也出键),`present-iff` 条件成立才出键
|
|
466
|
+
* (缺席不下「无」的结论——也可能是更早的 server)。`since` = 该键上 wire 的起始版本(`models` / `default` / `defaultModel` 在本仓首个 tag 就有)。
|
|
467
|
+
* 7.126.0:`candidateRejected`(S-1457,present-iff:当前生效的配置是因判官整拒了最近一份候选而回落的那一份;契约 §A.1d)。
|
|
468
|
+
*/
|
|
469
|
+
readonly modelsResponseKey: {
|
|
470
|
+
readonly at: "GET /v1/models 应答体顶层键(<键> → 在场律)";
|
|
471
|
+
readonly members: {
|
|
472
|
+
readonly models: {
|
|
473
|
+
readonly attr: "always";
|
|
474
|
+
readonly since: "1.214.2";
|
|
475
|
+
};
|
|
476
|
+
readonly default: {
|
|
477
|
+
readonly attr: "always";
|
|
478
|
+
readonly since: "1.214.2";
|
|
479
|
+
};
|
|
480
|
+
readonly defaultModel: {
|
|
481
|
+
readonly attr: "always";
|
|
482
|
+
readonly since: "1.214.2";
|
|
483
|
+
};
|
|
484
|
+
readonly droppedEntries: {
|
|
485
|
+
readonly attr: "always";
|
|
486
|
+
readonly since: "7.123.0";
|
|
487
|
+
};
|
|
488
|
+
readonly candidateRejected: {
|
|
489
|
+
readonly attr: "present-iff";
|
|
490
|
+
readonly since: "7.126.0";
|
|
491
|
+
};
|
|
390
492
|
};
|
|
391
493
|
};
|
|
392
494
|
/** 本仓在出口对 core 值做的变换(值变、键不变)。 */
|
|
@@ -134,6 +134,41 @@ export const SELF_MINTED_WIRE = {
|
|
|
134
134
|
"GET /v1/runs?idempotencyKey": { attr: 200, since: "7.125.0" },
|
|
135
135
|
"GET /v1/leader?idempotencyKey": { attr: 200, since: "7.125.0" },
|
|
136
136
|
"POST /v1/runs|/v1/tasks Idempotency-Key#conflict.run_exists": { attr: 409, since: "7.125.0" },
|
|
137
|
+
"POST /v1/runs|/v1/tasks Idempotency-Key#conflict.idempotency_payload_mismatch": { attr: 409, since: "7.126.0" },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
builtinScenario: {
|
|
141
|
+
at: "GET /v1/capabilities#scenarios[] 内建成员",
|
|
142
|
+
members: {
|
|
143
|
+
code: { attr: "-", since: "1.214.2" },
|
|
144
|
+
default: { attr: "-", since: "1.214.2" },
|
|
145
|
+
"code-review": { attr: "-", since: "1.214.2" },
|
|
146
|
+
scan: { attr: "-", since: "1.214.2" },
|
|
147
|
+
},
|
|
148
|
+
retired: {
|
|
149
|
+
discuss: { attr: "-", since: "7.28.0", until: "7.126.0" },
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
scenarioBodyKey: {
|
|
153
|
+
at: "POST /v1/tasks|/v1/tasks/stream|/v1/runs 体的场景透传键",
|
|
154
|
+
members: {
|
|
155
|
+
repo: { attr: "-", since: "1.214.2" },
|
|
156
|
+
},
|
|
157
|
+
retired: {
|
|
158
|
+
businessContext: { attr: "-", since: "1.214.2", until: "7.126.0" },
|
|
159
|
+
lenses: { attr: "-", since: "1.214.2", until: "7.126.0" },
|
|
160
|
+
rounds: { attr: "-", since: "1.214.2", until: "7.126.0" },
|
|
161
|
+
team: { attr: "-", since: "1.214.2", until: "7.126.0" },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
modelsResponseKey: {
|
|
165
|
+
at: "GET /v1/models 应答体顶层键(<键> → 在场律)",
|
|
166
|
+
members: {
|
|
167
|
+
models: { attr: "always", since: "1.214.2" },
|
|
168
|
+
default: { attr: "always", since: "1.214.2" },
|
|
169
|
+
defaultModel: { attr: "always", since: "1.214.2" },
|
|
170
|
+
droppedEntries: { attr: "always", since: "7.123.0" },
|
|
171
|
+
candidateRejected: { attr: "present-iff", since: "7.126.0" },
|
|
137
172
|
},
|
|
138
173
|
},
|
|
139
174
|
wireValueRule: {
|
|
@@ -62,9 +62,9 @@ export declare function applyEffective(config: ServiceConfig, eff: EffectiveConf
|
|
|
62
62
|
/**
|
|
63
63
|
* 🔴 **模型面组由哪些 effective 域组成 —— 唯一定义**(7.101.0 验修轮 V1 / codex V-1;OA 验修轮 V2 的以点改面)。
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* 组里今天只有 `models` 一个域(collab 域曾因模板带模型引用而同组;7.49.0 起本仓不执行 collab 模板,它出组 —— 见
|
|
66
|
+
* {@link collabTemplatesNotExecuted})。此前「模型面」散在三处各写一份(世代账键表 / stage 闸 / boot 按组回落 LKG 的合成),
|
|
67
|
+
* 收成本表一处定义;再有域入组只改这一行,下面的映射型逼着补落点。
|
|
68
68
|
* 读者一律从这里派生,禁手抄:
|
|
69
69
|
* · stage:{@link stageModelPlane} 产出组内**每个**域的产物({@link ModelPlaneStages} 按本表映射),组被拒 ⇒ 一个域都没有;
|
|
70
70
|
* · 世代账:整组拒的 `keys` 与落地的 `applied` 都由 {@link MODEL_PLANE_SURFACES} 按本表派生({@link modelPlaneGroupReport});
|
|
@@ -72,14 +72,14 @@ export declare function applyEffective(config: ServiceConfig, eff: EffectiveConf
|
|
|
72
72
|
* (与 `config.ts` 的配置组视图 `MODEL_PLANE_GROUP_KEYS` 不是一回事:那是 `ServiceConfig` 的分节视图;这里是「中心热应用的
|
|
73
73
|
* 模型面这一组包含哪些 effective 域」。)
|
|
74
74
|
*/
|
|
75
|
-
export declare const MODEL_PLANE_DOMAINS: readonly ["models"
|
|
75
|
+
export declare const MODEL_PLANE_DOMAINS: readonly ["models"];
|
|
76
76
|
export type ModelPlaneDomain = (typeof MODEL_PLANE_DOMAINS)[number];
|
|
77
|
-
/** 模型面组在 effective 上的那一切片(
|
|
77
|
+
/** 模型面组在 effective 上的那一切片(组内各域,与 `EffectiveConfig` 同形)。 */
|
|
78
78
|
export type ModelPlaneOf = Pick<EffectiveConfig, ModelPlaneDomain>;
|
|
79
79
|
/**
|
|
80
80
|
* `target` 换上 `source` 的**整个模型面**(组内每个域都取 `source` 的;`source` 缺席的域在结果里同样缺席,不留 `target` 的),
|
|
81
81
|
* 其余域原样是 `target` 的。boot 按组回落 LKG 的合成文档(回落 apply 的入参)走这一只 —— 禁在调用点
|
|
82
|
-
* 手写 `{ ...x, models
|
|
82
|
+
* 手写 `{ ...x, models }`(组再加域时漏一个正是 V1 的病形)。纯数据:不改两个入参。
|
|
83
83
|
*/
|
|
84
84
|
export declare function withModelPlaneOf<E extends EffectiveConfig>(target: E, source: ModelPlaneOf): E;
|
|
85
85
|
/**
|
|
@@ -104,6 +104,12 @@ export declare const PLANE_REFUSAL_INVARIANT_OF: {
|
|
|
104
104
|
readonly "config.model_route_endpoint_missing": "model-route-endpoint";
|
|
105
105
|
readonly "config.gateway_fallback_without_primary": "model-route-endpoint";
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* collab 域 = 中心的多成员讨论模板。**本仓不执行它们**:唯一的执行体是引擎的团队讨论脚本,core 7.49.0 已删(本仓不留第二份
|
|
109
|
+
* 团队编排)。这一只是本仓对该域的**唯一读法**:已发布且启用的模板 id(`enabled === false` 是运营态关闭,不算发布)——
|
|
110
|
+
* 真 apply 的 `web_admin_collab_not_executed` warn 与 dry-run 行的 `collab.notExecuted` 都读它。
|
|
111
|
+
*/
|
|
112
|
+
export declare function collabTemplatesNotExecuted(eff: Pick<EffectiveConfig, "collab">): string[];
|
|
107
113
|
/**
|
|
108
114
|
* DESIGN-278 §5 S2([ref])—— center 这份 effective **当前在管**哪些 `ServiceConfig` 键(配置目录端点
|
|
109
115
|
* `GET /v1/config/catalog` 判 `effectiveLane` 的 center 半场)。
|
|
@@ -127,7 +133,7 @@ export declare function applyRuntimeHot(config: ServiceConfig, gov: EffectiveCon
|
|
|
127
133
|
/**
|
|
128
134
|
* Read-only comparison (`WEB_ADMIN_ENV.dryRun`): log what the web-admin config WOULD change vs the current
|
|
129
135
|
* (env-derived) config, WITHOUT applying it. The safe-rollout step the web-admin recommends — verify
|
|
130
|
-
* the center's models/roles
|
|
136
|
+
* the center's models/roles match (or intentionally differ from) the env baseline before going live.
|
|
131
137
|
*/
|
|
132
138
|
export declare function logEffectiveDiff(config: ServiceConfig, eff: EffectiveConfig, logger?: Logger): void;
|
|
133
139
|
//# sourceMappingURL=apply-effective.d.ts.map
|