@sema-agent/server 7.141.0 → 7.143.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 +657 -0
- package/USAGE.md +102 -30
- package/dist/adoption/plan.js +22 -0
- package/dist/approval-ask-audit-store.d.ts +61 -43
- package/dist/approval-ask-audit-store.js +69 -44
- package/dist/approval-ask-machine.d.ts +15 -7
- package/dist/approval-ask-machine.js +10 -4
- package/dist/approval-card.d.ts +126 -27
- package/dist/approval-card.js +103 -23
- package/dist/approval-crash-convergence.d.ts +17 -7
- package/dist/approval-crash-convergence.js +94 -22
- package/dist/approval-deny-reasons.d.ts +34 -30
- package/dist/approval-deny-reasons.js +21 -6
- package/dist/approval-policy-settlement.d.ts +1 -1
- package/dist/approval-queue-kind.d.ts +27 -0
- package/dist/approval-queue-kind.js +6 -0
- package/dist/approval-reconciler.d.ts +41 -9
- package/dist/approval-reconciler.js +45 -42
- package/dist/audit.js +4 -2
- package/dist/auth-bridge.d.ts +9 -6
- package/dist/auth-bridge.js +9 -3
- package/dist/boot/adoption.js +2 -1
- package/dist/boot/budget-tracing.d.ts +17 -1
- package/dist/boot/budget-tracing.js +10 -6
- package/dist/boot/device-lane.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +24 -4
- package/dist/boot/execution-env.js +26 -23
- package/dist/boot/execution-lane.js +2 -1
- package/dist/boot/exit-boundary.js +5 -4
- package/dist/boot/governance-seams.d.ts +26 -41
- package/dist/boot/governance-seams.js +61 -28
- package/dist/boot/late-binds.d.ts +7 -4
- package/dist/boot/late-binds.js +3 -1
- package/dist/boot/leader.js +2 -4
- package/dist/boot/memory-consolidation.d.ts +0 -8
- package/dist/boot/memory-consolidation.js +5 -4
- package/dist/boot/parked-revive-gate.js +2 -1
- package/dist/boot/permission-rules-audit.d.ts +0 -28
- package/dist/boot/permission-rules-audit.js +2 -1
- package/dist/boot/read-deny-anchor-audit.js +2 -1
- package/dist/boot/reapers.js +9 -7
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +19 -10
- package/dist/boot/retention-lane.js +5 -3
- package/dist/boot/runner-deps.d.ts +10 -7
- package/dist/boot/runner-deps.js +20 -29
- package/dist/boot/runtime-caps.js +3 -2
- package/dist/boot/session-faces.js +4 -3
- package/dist/boot/shutdown.d.ts +9 -0
- package/dist/boot/shutdown.js +19 -4
- package/dist/boot/stage-02-web-admin-pull.js +3 -0
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +1 -2
- package/dist/boot/stage-04-stores.d.ts +5 -2
- package/dist/boot/stage-04-stores.js +6 -7
- package/dist/boot/stage-05-execution-env.d.ts +6 -3
- package/dist/boot/stage-05-execution-env.js +8 -6
- package/dist/boot/stage-06-runners.d.ts +6 -3
- package/dist/boot/stage-06-runners.js +3 -4
- package/dist/boot/stage-07-capability-layer.d.ts +6 -3
- package/dist/boot/stage-07-capability-layer.js +7 -2
- package/dist/boot/stage-08-reapers.d.ts +6 -3
- package/dist/boot/stage-08-reapers.js +3 -2
- package/dist/boot/stage-09-leader.d.ts +6 -3
- package/dist/boot/stage-10-http-server.d.ts +6 -3
- package/dist/boot/stage-10-http-server.js +14 -5
- package/dist/boot/stores.d.ts +5 -2
- package/dist/boot/stores.js +10 -9
- package/dist/boot/web-admin.d.ts +5 -1
- package/dist/boot/web-admin.js +48 -36
- package/dist/boot/webfetch-summarize-lane.js +2 -1
- package/dist/boot/workflow-orchestration.js +3 -2
- package/dist/capabilities/builtin-tools.d.ts +2 -1
- package/dist/capabilities/builtin-tools.js +2 -4
- package/dist/capabilities/composite-members.d.ts +2 -1
- package/dist/capabilities/composite-members.js +2 -1
- package/dist/capabilities/hands-lane.d.ts +9 -39
- package/dist/capabilities/hands-lane.js +8 -13
- package/dist/capabilities/mcp-probe.d.ts +3 -2
- package/dist/capabilities/scenarios.d.ts +11 -1
- package/dist/capabilities/scenarios.js +1 -0
- package/dist/capabilities/skills.d.ts +1 -17
- package/dist/capabilities/skills.js +0 -8
- package/dist/capability-facts.d.ts +31 -7
- package/dist/capability-facts.js +27 -4
- package/dist/card-void.d.ts +6 -9
- package/dist/config-catalog.js +2 -1
- package/dist/config-dir-trust.js +58 -29
- package/dist/config-invariants.d.ts +7 -1
- package/dist/config-invariants.js +7 -0
- package/dist/config-provider.d.ts +10 -0
- package/dist/config-provider.js +15 -4
- package/dist/config-root-migration.d.ts +13 -0
- package/dist/config-root-migration.js +99 -0
- package/dist/config-types.d.ts +19 -8
- package/dist/config.d.ts +10 -3
- package/dist/config.js +18 -4
- package/dist/delegated-session-owner.d.ts +5 -3
- package/dist/delegated-session-owner.js +1 -1
- package/dist/device-ws-protocol.d.ts +1 -0
- package/dist/device-ws-protocol.js +2 -1
- package/dist/env-model-table-gate.d.ts +53 -0
- package/dist/env-model-table-gate.js +53 -0
- package/dist/execution-lane-caps.d.ts +2 -1
- package/dist/fleet/fleet-bus.d.ts +34 -55
- package/dist/fleet/fleet-bus.js +35 -100
- package/dist/fleet/fleet-reconciler.d.ts +4 -4
- package/dist/fleet/fleet-reconciler.js +1 -1
- package/dist/fleet/subagent-tail-bus.d.ts +14 -11
- package/dist/fleet/subagent-tail-bus.js +15 -28
- package/dist/hooks/hook-runner.d.ts +6 -0
- package/dist/hooks/hook-runner.js +58 -8
- package/dist/host-decision.d.ts +54 -20
- package/dist/host-decision.js +42 -14
- package/dist/http/admission.d.ts +1 -1
- package/dist/http/admission.js +7 -3
- package/dist/http/approval-sweeps.js +11 -8
- package/dist/http/caller-trust.d.ts +1 -1
- package/dist/http/dispatch.js +4 -2
- package/dist/http/durable-run-leg.js +2 -2
- package/dist/http/engine-refusal.d.ts +16 -0
- package/dist/http/engine-refusal.js +17 -0
- package/dist/http/execution-context.d.ts +2 -2
- package/dist/http/idempotency.d.ts +1 -1
- package/dist/http/memory-compliance-failure-reply.d.ts +1 -3
- package/dist/http/memory-compliance-failure-reply.js +4 -6
- package/dist/http/owner-access.d.ts +11 -0
- package/dist/http/owner-access.js +13 -0
- package/dist/http/principal-gate.d.ts +3 -1
- package/dist/http/principal-gate.js +17 -8
- package/dist/http/resume-legs.d.ts +21 -7
- package/dist/http/resume-legs.js +76 -58
- package/dist/http/resume-restatement.d.ts +39 -0
- package/dist/http/resume-restatement.js +25 -0
- package/dist/http/route-ctx.d.ts +35 -10
- package/dist/http/route-ctx.js +1 -1
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/approvals-assistant.d.ts +9 -1
- package/dist/http/routes/approvals-assistant.js +142 -31
- package/dist/http/routes/attachments.js +18 -0
- package/dist/http/routes/capabilities.js +16 -4
- package/dist/http/routes/memory-policy.d.ts +2 -2
- package/dist/http/routes/memory-policy.js +27 -7
- package/dist/http/routes/notify-wake.js +23 -25
- package/dist/http/routes/rules.js +48 -13
- package/dist/http/routes/runs.js +12 -11
- package/dist/http/routes/session-memory-sync.d.ts +91 -0
- package/dist/http/routes/session-memory-sync.js +174 -0
- package/dist/http/routes/session-sync.js +13 -20
- package/dist/http/routes/sessions-list.d.ts +2 -1
- package/dist/http/routes/sessions.d.ts +2 -2
- package/dist/http/routes/sessions.js +22 -23
- package/dist/http/routes/tasks.js +34 -54
- package/dist/http/run-read-face.d.ts +7 -0
- package/dist/http/run-read-face.js +9 -3
- package/dist/http/send.d.ts +5 -0
- package/dist/http/send.js +9 -2
- package/dist/http/server.d.ts +27 -15
- package/dist/http/server.js +4 -6
- package/dist/http/stored-body-replay.js +15 -4
- package/dist/http/submit-replay.d.ts +4 -3
- package/dist/http/submit-replay.js +2 -2
- package/dist/http/sync-submit-body.d.ts +21 -4
- package/dist/http/sync-submit-body.js +13 -0
- package/dist/http/wire-types.d.ts +17 -7
- package/dist/identity-source.d.ts +21 -2
- package/dist/identity-source.js +6 -0
- package/dist/leader/leader.js +5 -2
- package/dist/leader/wire.d.ts +7 -1
- package/dist/leader/wire.js +6 -5
- package/dist/leg-facts.d.ts +37 -0
- package/dist/leg-facts.js +15 -0
- package/dist/memory-bundle-engine.d.ts +1 -4
- package/dist/memory-bundle-engine.js +2 -2
- package/dist/memory-incident-sink.d.ts +19 -6
- package/dist/memory-incident-sink.js +8 -4
- package/dist/memory-operator-faces.d.ts +30 -66
- package/dist/memory-operator-faces.js +17 -88
- package/dist/memory-scope-stores.d.ts +38 -40
- package/dist/memory-scope-stores.js +51 -36
- package/dist/memory-scope.d.ts +0 -9
- package/dist/memory-scope.js +0 -9
- package/dist/memory-sync-client.d.ts +21 -21
- package/dist/memory-sync-client.js +62 -43
- package/dist/memory-sync-identity.d.ts +24 -0
- package/dist/memory-sync-identity.js +57 -0
- package/dist/memory-sync.d.ts +27 -5
- package/dist/memory-sync.js +29 -7
- package/dist/model-plane-face.d.ts +13 -7
- package/dist/model-plane-face.js +2 -1
- package/dist/observability/fail-open.d.ts +47 -14
- package/dist/observability/fail-open.js +37 -11
- package/dist/observability/run-terminal.d.ts +92 -34
- package/dist/observability/run-terminal.js +171 -162
- package/dist/orchestration/workflow-completion-inbox.d.ts +5 -19
- package/dist/orchestration/workflow-completion-inbox.js +0 -12
- package/dist/orchestration/workflow-notify-journal.d.ts +3 -2
- package/dist/orchestration/workflow-park-decision.d.ts +8 -3
- package/dist/orchestration/workflow-park-decision.js +5 -3
- package/dist/org-delivery-gate.d.ts +11 -0
- package/dist/org-delivery-gate.js +19 -1
- package/dist/parked-decide.d.ts +13 -9
- package/dist/parked-decide.js +7 -7
- package/dist/parked-revive-surface.js +1 -1
- package/dist/peer-inbound-face.d.ts +127 -0
- package/dist/peer-inbound-face.js +158 -0
- package/dist/permission-rule-list.d.ts +13 -9
- package/dist/permission-rule-list.js +7 -3
- package/dist/plugins/approval-ask-store-file.d.ts +14 -4
- package/dist/plugins/approval-ask-store-file.js +64 -11
- package/dist/plugins/approval-ask-store-memory.d.ts +2 -1
- package/dist/plugins/approval-ask-store-memory.js +17 -14
- package/dist/plugins/approval-ask-store-sql.d.ts +70 -23
- package/dist/plugins/approval-ask-store-sql.js +79 -30
- package/dist/plugins/checkpoint-store-sql.d.ts +4 -4
- package/dist/plugins/checkpoint-store-sql.js +9 -7
- package/dist/plugins/file-history-store-sql.d.ts +24 -18
- package/dist/plugins/file-history-store-sql.js +24 -19
- package/dist/plugins/file-run-store.d.ts +35 -1
- package/dist/plugins/file-run-store.js +108 -9
- package/dist/plugins/imported-layer-root-retirement.d.ts +82 -0
- package/dist/plugins/imported-layer-root-retirement.js +96 -0
- package/dist/plugins/local-checkpoint-store.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.js +2 -2
- package/dist/plugins/local-session-store.d.ts +42 -9
- package/dist/plugins/local-session-store.js +83 -33
- package/dist/plugins/local-task-attachment-store.d.ts +12 -2
- package/dist/plugins/local-task-attachment-store.js +67 -43
- package/dist/plugins/mailbox-recipient-lifecycle.d.ts +9 -31
- package/dist/plugins/mailbox-recipient-lifecycle.js +4 -0
- package/dist/plugins/mailbox-store-sql.d.ts +12 -8
- package/dist/plugins/mailbox-store-sql.js +76 -7
- package/dist/plugins/memory-key-guards.d.ts +3 -3
- package/dist/plugins/memory-run-store.d.ts +6 -1
- package/dist/plugins/memory-run-store.js +11 -1
- package/dist/plugins/memory-sync-store-pg.d.ts +15 -0
- package/dist/plugins/memory-sync-store-pg.js +21 -0
- package/dist/plugins/memory-sync-store-tidb.d.ts +2 -0
- package/dist/plugins/memory-sync-store-tidb.js +13 -1
- package/dist/plugins/one-time-migrations.d.ts +58 -2
- package/dist/plugins/one-time-migrations.js +161 -4
- package/dist/plugins/org-delivery-quota-store.d.ts +1 -1
- package/dist/plugins/org-delivery-quota-store.js +2 -12
- package/dist/plugins/park-commit-watch.d.ts +1 -1
- package/dist/plugins/permission-rule-store-file.d.ts +10 -1
- package/dist/plugins/permission-rule-store-file.js +15 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +31 -1
- package/dist/plugins/permission-rule-store-sql.js +35 -2
- package/dist/plugins/remote-env-device.d.ts +8 -11
- package/dist/plugins/remote-env-device.js +6 -3
- package/dist/plugins/remote-env-e2b.d.ts +23 -4
- package/dist/plugins/remote-env-e2b.js +111 -28
- package/dist/plugins/remote-env-k8s.d.ts +61 -22
- package/dist/plugins/remote-env-k8s.js +133 -33
- package/dist/plugins/remote-env-local-docker.d.ts +15 -3
- package/dist/plugins/remote-env-local-docker.js +40 -12
- package/dist/plugins/retention-store-sql.d.ts +2 -2
- package/dist/plugins/run-store-sql.d.ts +9 -1
- package/dist/plugins/run-store-sql.js +9 -1
- package/dist/plugins/sandbox-read-floor.d.ts +5 -7
- package/dist/plugins/sandbox-read-floor.js +2 -7
- package/dist/plugins/sql-errors.d.ts +10 -1
- package/dist/plugins/sql-errors.js +13 -0
- package/dist/plugins/store-backend.d.ts +33 -35
- package/dist/plugins/store-backend.js +10 -1
- package/dist/plugins/store-contracts.d.ts +50 -1
- package/dist/plugins/store-contracts.js +6 -0
- package/dist/plugins/task-attachment-store.d.ts +112 -14
- package/dist/plugins/task-attachment-store.js +207 -29
- package/dist/plugins/tool-result-store-sql.d.ts +9 -8
- package/dist/plugins/tool-result-store-sql.js +23 -2
- package/dist/plugins/wiring-section-codec.d.ts +32 -0
- package/dist/plugins/wiring-section-codec.js +55 -0
- package/dist/plugins/workspace-fill.d.ts +60 -0
- package/dist/plugins/workspace-fill.js +106 -0
- package/dist/project-bundle.d.ts +38 -0
- package/dist/project-bundle.js +609 -0
- package/dist/rule-entry-list.d.ts +3 -2
- package/dist/rule-entry-list.js +5 -1
- package/dist/rules-consent.d.ts +28 -5
- package/dist/rules-consent.js +40 -28
- package/dist/run-local.js +11 -13
- package/dist/runs.d.ts +12 -8
- package/dist/runs.js +6 -8
- package/dist/runtime-governance.d.ts +1 -1
- package/dist/sandbox-egress-policy.d.ts +4 -1
- package/dist/sandbox-egress-policy.js +3 -1
- package/dist/sandbox-git-plane.d.ts +31 -12
- package/dist/sandbox-git-plane.js +24 -4
- package/dist/security.d.ts +9 -0
- package/dist/security.js +8 -0
- package/dist/server-secret-env.d.ts +4 -0
- package/dist/session-error-wire.d.ts +36 -0
- package/dist/session-error-wire.js +13 -0
- package/dist/session-incarnation.d.ts +1 -1
- package/dist/session-notify-door.d.ts +106 -0
- package/dist/session-notify-door.js +93 -0
- package/dist/session-sync.d.ts +9 -14
- package/dist/session-sync.js +5 -5
- package/dist/session-workspace.d.ts +3 -13
- package/dist/session-workspace.js +0 -9
- package/dist/standing-answer-grant.d.ts +5 -0
- package/dist/standing-answer-grant.js +10 -0
- package/dist/stores-sql/session-policy-store-sql.d.ts +4 -2
- package/dist/stores-sql/session-policy-store-sql.js +3 -13
- package/dist/task-mcp.d.ts +1 -1
- package/dist/task-settings.d.ts +21 -10
- package/dist/task-settings.js +46 -13
- package/dist/terminal.d.ts +39 -19
- package/dist/terminal.js +65 -22
- package/dist/tool-approval.d.ts +56 -37
- package/dist/tool-approval.js +78 -71
- package/dist/trace/core-keyset-guard.d.ts +134 -14
- package/dist/trace/engine-notice-wire.d.ts +9 -3
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/exit-seat.d.ts +9 -2
- package/dist/trace/exit-seat.js +1 -0
- package/dist/trace/ledger-sink.d.ts +10 -6
- package/dist/trace/ledger-sink.js +2 -2
- package/dist/trace/model-segment.d.ts +55 -25
- package/dist/trace/model-segment.js +101 -33
- package/dist/trace/project.d.ts +25 -5
- package/dist/trace/project.js +22 -0
- package/dist/trace/redact.d.ts +61 -9
- package/dist/trace/redact.js +1490 -468
- package/dist/trace/self-minted-wire.d.ts +745 -24
- package/dist/trace/self-minted-wire.js +239 -9
- package/dist/trace/wire-projection-faces.d.ts +2 -2
- package/dist/trace/wire-projection-faces.js +2 -2
- package/dist/verifier-pause-card.d.ts +33 -5
- package/dist/verifier-pause-card.js +15 -10
- package/dist/web-admin-client/apply-effective.d.ts +12 -16
- package/dist/web-admin-client/apply-effective.js +109 -9
- package/dist/web-admin-client/effective-keys.js +2 -0
- package/dist/web-admin-client/types.d.ts +4 -0
- package/dist/workspace-space.d.ts +19 -3
- package/dist/workspace-space.js +8 -4
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -1
- package/package.json +3 -2
- package/wire-changes/server@7.142.0.json +639 -0
- package/wire-changes/server@7.143.0.json +1167 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ⚠️ **位置即契约**:必须晚于 stores/exec-env/coordinators/workflow 段(所有键都是它们的产物),
|
|
8
8
|
* 且早于 `new Runner(runnerDeps)` —— Runner 构造时展开 tier 表成私有目录副本(之后的换代经
|
|
9
9
|
* `Runner.swapDeps` 换进,见 boot/stage-08-reapers.ts)。
|
|
10
|
-
*
|
|
10
|
+
* runStore 在本段之后才构造 ⇒ 本段不读它(本段没有晚绑取值)。
|
|
11
11
|
*/
|
|
12
12
|
import { type CacheBreakFinding, type CrossBoundaryPosture, type RunnerDeps, type WorkflowRunStore, type AskOutcome } from "@sema-agent/core";
|
|
13
13
|
import type { createBrain } from "../brain.js";
|
|
@@ -19,13 +19,13 @@ import type { Logger } from "../observability/logger.js";
|
|
|
19
19
|
import type { Metrics } from "../observability/metrics.js";
|
|
20
20
|
import { type ConsolidationDriverSeat } from "./memory-consolidation.js";
|
|
21
21
|
import { WorkflowAgentRegistry } from "../orchestration/workflow-agent-steer.js";
|
|
22
|
-
import { type WorkflowCompletionInbox } from "../orchestration/workflow-completion-inbox.js";
|
|
23
22
|
import { type EngineNoticeRouter } from "../trace/engine-notice-wire.js";
|
|
24
23
|
import { WorkflowNotifyGate, type WorkflowCompletionPayload } from "../orchestration/workflow-notify-journal.js";
|
|
25
24
|
import type { ServiceWorkflowJournalStore, SessionCaptureRecordSource, StoreBackend, ToolResultStoreFull } from "../plugins/store-backend.js";
|
|
26
25
|
import type { createSessionStore } from "../plugins/session-store.js";
|
|
27
26
|
import type { QuestionCoordinator } from "../question.js";
|
|
28
27
|
import type { ToolApprovalCoordinator } from "../tool-approval.js";
|
|
28
|
+
import { type PeerInboundFace } from "../peer-inbound-face.js";
|
|
29
29
|
import type { MemoryBackend } from "@sema-agent/core";
|
|
30
30
|
import type { MemorySyncRunner } from "../memory-sync-client.js";
|
|
31
31
|
import type { MailboxRecipientLifecycle } from "../plugins/mailbox-recipient-lifecycle.js";
|
|
@@ -68,7 +68,10 @@ export declare function createRunnerDepsOnAsk(toolApproval: ToolApprovalCoordina
|
|
|
68
68
|
* `classificationKnown:false`(指标标签折 `unknown`),不吞不编;与安装包的锁步由 test/boot-runner-deps-shared-base.test.ts
|
|
69
69
|
* 的 dist 扫描格钉住(两种发射写法都读;读不出词的经变量发射点本身红;core 加词/收进 d.ts 那天先红)。
|
|
70
70
|
* 第七词 `peer-seat-hold`(runtask 的 `holdDeclarations`,字面量):对端座的三员对象里 `hold` / `release` 抛了 ⇒ 引擎报一次、该引用
|
|
71
|
-
* 不被持有;座是本仓的 desk,所以这是部署自己的故障,与其余六词同走 warn + 计数。
|
|
71
|
+
* 不被持有;座是本仓的 desk,所以这是部署自己的故障,与其余六词同走 warn + 计数。
|
|
72
|
+
* 第八词 `input-author-unreadable`(core 7.61.0 `run-leg.js` 的 `objectiveAuthorOf` 回调,字面量):宿主经 `RunInternals.objectiveAuthor`
|
|
73
|
+
* 递了一个不在 `INPUT_AUTHORS` 里的词 ⇒ 引擎报一次、该目标按操作者的输入筛。本服务不递这个字段(src 零读写),只有嵌入方手铸时才发射,
|
|
74
|
+
* 仍是部署侧的故障,同走 warn + 计数。 */
|
|
72
75
|
export declare const CONFIG_ADVISORY_CLASSIFICATIONS: ReadonlySet<string>;
|
|
73
76
|
/** [ref]:core 的 [ref] 前缀缓存**断裂**探测器交给宿主的根因**闭集**,以及每个词的日志级别。
|
|
74
77
|
* 闭集**不抄词**:词源直接取 core 公开导出的 `CacheBreakFinding["cause"]`(`@sema-agent/core` 根导出,
|
|
@@ -240,10 +243,7 @@ export interface RunnerDepsCtx {
|
|
|
240
243
|
workflowJournalStore: ServiceWorkflowJournalStore | undefined;
|
|
241
244
|
workflowAgentRegistry: WorkflowAgentRegistry | undefined;
|
|
242
245
|
workflowNotifyGate: WorkflowNotifyGate | undefined;
|
|
243
|
-
workflowCompletionInbox: WorkflowCompletionInbox | undefined;
|
|
244
246
|
deliverWorkflowCompletion: (p: WorkflowCompletionPayload) => Promise<void>;
|
|
245
|
-
/** 晚绑(runStore 在本段之后构造)——见文件头「位置即契约」。 */
|
|
246
|
-
getRunStore: () => ReturnType<StoreBackend["run"]> | undefined;
|
|
247
247
|
}
|
|
248
248
|
/** [ref] A10 留档发现②:main runner `RunnerDeps` 与 main.ts subRunner 字面量之间此前手工重复
|
|
249
249
|
* 的 ~15 个键,类型标注见 {@link createSharedRunnerDeps} 头注。 */
|
|
@@ -281,7 +281,10 @@ export interface EngineNoticeMetricsSeat {
|
|
|
281
281
|
}
|
|
282
282
|
export declare function createEngineNoticeForwarder(logger: {
|
|
283
283
|
warn: (msg: string, fields?: Record<string, unknown>) => void;
|
|
284
|
-
}, router?: EngineNoticeRouter, metrics?: EngineNoticeMetricsSeat
|
|
284
|
+
}, router?: EngineNoticeRouter, metrics?: EngineNoticeMetricsSeat,
|
|
285
|
+
/** [ref]:收信方决断面的坐标表(进程单例,与 core 的 held 队列注册表同寿命;它只读两条 peer 通告的坐标,见 `peer-inbound-face.ts`)。
|
|
286
|
+
* 默认值与 `router` 同一条理由:装配点多,必填会让「新车道忘了传」变成被扣的信静默不列。 */
|
|
287
|
+
peerInbound?: Pick<PeerInboundFace, "observe">): NonNullable<RunnerDeps["onNotice"]>;
|
|
285
288
|
/**
|
|
286
289
|
* `onNotice` **席**的装配判据本身 —— 「`warn` 真在场才铸席」这一条从此是**一个可直接调用的函数**,
|
|
287
290
|
* 不是散在装配点、只能靠扫源码文本去猜的一行三元(codex 交叉复审 R1-[medium],验真后修)。
|
package/dist/boot/runner-deps.js
CHANGED
|
@@ -8,20 +8,22 @@ import { assertAutoConsolidationWirable } from "./memory-consolidation.js";
|
|
|
8
8
|
import { createHardenedVmRunner } from "../orchestration/hardened-vm-runner.js";
|
|
9
9
|
import { createWorkerHardenedVmRunner } from "../orchestration/hardened-vm-worker-runner.js";
|
|
10
10
|
import { WorkflowAgentRegistry } from "../orchestration/workflow-agent-steer.js";
|
|
11
|
-
import { resolveServedSession } from "../orchestration/workflow-completion-inbox.js";
|
|
12
11
|
import { defaultEngineNoticeRouter, redactNoticeMessage, redactNoticeRuleText } from "../trace/engine-notice-wire.js";
|
|
13
12
|
import { WorkflowNotifyGate } from "../orchestration/workflow-notify-journal.js";
|
|
14
13
|
import { makeLoadProjectMemory, makeProbeInstructionSources } from "../project-memory.js";
|
|
15
14
|
import { createInstructionSourceSeat } from "../instruction-source-notice.js";
|
|
16
15
|
import { workflowModelAllowlistFor } from "../task-workflow.js";
|
|
17
16
|
import { buildCrossSessionInboundLayers, crossSessionDialogExpiryOf } from "../cross-session-settings.js";
|
|
17
|
+
import { defaultPeerInboundFace } from "../peer-inbound-face.js";
|
|
18
18
|
import { createPeerDirectory } from "../peer-directory.js";
|
|
19
19
|
import { storeFormRefusalInIncident } from "../memory-store-refusal.js";
|
|
20
20
|
import { coreFileHistoryCaptureSeat } from "../file-history-capture.js";
|
|
21
21
|
import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
|
|
22
22
|
import { rewindFailureCode } from "../file-history-disclosure.js";
|
|
23
23
|
import { errorKindOf } from "../observability/err-text.js";
|
|
24
|
+
import { codeFieldOf } from "../terminal.js";
|
|
24
25
|
import { buildShownUrlsInText } from "../url-refusal.js";
|
|
26
|
+
import { seatText } from "../trace/exit-seat.js";
|
|
25
27
|
export function createRunnerDepsOnAsk(toolApproval) {
|
|
26
28
|
if (!toolApproval)
|
|
27
29
|
return undefined;
|
|
@@ -30,6 +32,7 @@ export function createRunnerDepsOnAsk(toolApproval) {
|
|
|
30
32
|
export const CONFIG_ADVISORY_CLASSIFICATIONS = new Set([
|
|
31
33
|
"file-history-no-env",
|
|
32
34
|
"file-history-no-store",
|
|
35
|
+
"input-author-unreadable",
|
|
33
36
|
"interaction-posture-refused",
|
|
34
37
|
"memory-tools-not-mounted",
|
|
35
38
|
"peer-seat-hold",
|
|
@@ -45,7 +48,7 @@ export const PROMPT_CACHE_BREAK_CAUSE_LEVEL = {
|
|
|
45
48
|
};
|
|
46
49
|
const PROMPT_CACHE_BREAK_LEVELS = new Map(Object.entries(PROMPT_CACHE_BREAK_CAUSE_LEVEL));
|
|
47
50
|
const CEILING_ORIGINS = new Set(["walltime", "turns"]);
|
|
48
|
-
export function createEngineNoticeForwarder(logger, router = defaultEngineNoticeRouter, metrics) {
|
|
51
|
+
export function createEngineNoticeForwarder(logger, router = defaultEngineNoticeRouter, metrics, peerInbound = defaultPeerInboundFace) {
|
|
49
52
|
return (notice) => {
|
|
50
53
|
const detail = redactNoticeRuleText(notice.code, notice.detail);
|
|
51
54
|
const message = redactNoticeMessage(notice.message);
|
|
@@ -55,6 +58,7 @@ export function createEngineNoticeForwarder(logger, router = defaultEngineNotice
|
|
|
55
58
|
if (typeof origin === "string" && CEILING_ORIGINS.has(origin))
|
|
56
59
|
metrics.inc("limit_ceiling_after_answer_total", { origin });
|
|
57
60
|
}
|
|
61
|
+
peerInbound.observe(notice);
|
|
58
62
|
router.route(notice);
|
|
59
63
|
};
|
|
60
64
|
}
|
|
@@ -138,7 +142,7 @@ export function createSharedRunnerDeps(ctx) {
|
|
|
138
142
|
return shared;
|
|
139
143
|
}
|
|
140
144
|
export function createRunnerDeps(ctx) {
|
|
141
|
-
const { config, logger, metrics, localRoot, outcomeSink, elicitation, question, toolApproval, sessionStore, memoryEngine, sessionCaptureRecords, memorySyncRunner, runtimeCapsResolver, fileHistoryStore, permissionRuleStore, fleetBus, workflowRunStore, workflowJournalStore, workflowAgentRegistry, workflowNotifyGate,
|
|
145
|
+
const { config, logger, metrics, localRoot, outcomeSink, elicitation, question, toolApproval, sessionStore, memoryEngine, sessionCaptureRecords, memorySyncRunner, runtimeCapsResolver, fileHistoryStore, permissionRuleStore, fleetBus, workflowRunStore, workflowJournalStore, workflowAgentRegistry, workflowNotifyGate, deliverWorkflowCompletion, } = ctx;
|
|
142
146
|
const peerSessionLister = sessionStore.listSessions?.bind(sessionStore);
|
|
143
147
|
const memoryEngineIncident = createMemoryEngineIncidentSink({ logger, metrics });
|
|
144
148
|
const sharedRunnerDeps = createSharedRunnerDeps(ctx);
|
|
@@ -167,20 +171,6 @@ export function createRunnerDeps(ctx) {
|
|
|
167
171
|
...(workflowNotifyGate
|
|
168
172
|
? workflowNotifyGate.buildNotifier()
|
|
169
173
|
: { notify: (input) => deliverWorkflowCompletion(input) }),
|
|
170
|
-
ackServed: async (input) => {
|
|
171
|
-
if (!workflowCompletionInbox)
|
|
172
|
-
return;
|
|
173
|
-
try {
|
|
174
|
-
const sid = await resolveServedSession(input, getRunStore() ? (id) => getRunStore().getRun(id) : undefined);
|
|
175
|
-
if (sid) {
|
|
176
|
-
await workflowCompletionInbox.markTerminalServed(sid, input.runId);
|
|
177
|
-
logger.info("workflow_complete_ack_served", { route: "poll-served", sessionId: sid, runId: input.runId });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
catch (err) {
|
|
181
|
-
logger.warn("workflow_ack_served_failed", { runId: input.runId, err: String(err) });
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
174
|
},
|
|
185
175
|
}
|
|
186
176
|
: {};
|
|
@@ -199,7 +189,7 @@ export function createRunnerDeps(ctx) {
|
|
|
199
189
|
onTaskOutcome: outcomeSink
|
|
200
190
|
? (o) => {
|
|
201
191
|
metrics.inc("task_outcomes_total", { status: o.status, green: String(o.oracle?.green ?? "unknown") });
|
|
202
|
-
void outcomeSink.recordCore(o).catch((err) => logger.warn("task_outcome_record_failed", { runId: o.runId, err: String(err) }));
|
|
192
|
+
void outcomeSink.recordCore(o).catch((err) => logger.warn("task_outcome_record_failed", { runId: o.runId, err: seatText("operator-log-text", String(err)) }));
|
|
203
193
|
}
|
|
204
194
|
: undefined,
|
|
205
195
|
onElicit: elicitation ? elicitation.elicit : undefined,
|
|
@@ -249,17 +239,18 @@ export function createRunnerDeps(ctx) {
|
|
|
249
239
|
: undefined,
|
|
250
240
|
...selfOrchestrationDeps,
|
|
251
241
|
onError: (err, ctx) => {
|
|
242
|
+
const codeField = codeFieldOf(err);
|
|
252
243
|
if (ctx.phase === "degraded") {
|
|
253
|
-
logger.warn("task_degraded", { sessionId: ctx.sessionId, info: String(err) });
|
|
244
|
+
logger.warn("task_degraded", { sessionId: ctx.sessionId, ...codeField, info: seatText("operator-log-text", String(err)) });
|
|
254
245
|
return;
|
|
255
246
|
}
|
|
256
247
|
if (ctx.phase === "prompt-constitution") {
|
|
257
|
-
logger.warn("prompt_composition_warning", { sessionId: ctx.sessionId, info: String(err) });
|
|
248
|
+
logger.warn("prompt_composition_warning", { sessionId: ctx.sessionId, ...codeField, info: seatText("operator-log-text", String(err)) });
|
|
258
249
|
return;
|
|
259
250
|
}
|
|
260
251
|
if (ctx.phase === "rewind") {
|
|
261
252
|
const code = rewindFailureCode(err);
|
|
262
|
-
logger.warn("rewind_snapshot_failed", { sessionId: ctx.sessionId, code, info: String(err) });
|
|
253
|
+
logger.warn("rewind_snapshot_failed", { sessionId: ctx.sessionId, code, info: seatText("operator-log-text", String(err)) });
|
|
263
254
|
metrics.inc("rewind_snapshot_failed_total", { code });
|
|
264
255
|
return;
|
|
265
256
|
}
|
|
@@ -268,12 +259,12 @@ export function createRunnerDeps(ctx) {
|
|
|
268
259
|
return;
|
|
269
260
|
}
|
|
270
261
|
if (ctx.phase === "mcp") {
|
|
271
|
-
logger.warn("mcp_server_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), info: buildShownUrlsInText(String(err)) });
|
|
262
|
+
logger.warn("mcp_server_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), ...codeField, info: seatText("operator-log-text", buildShownUrlsInText(String(err))) });
|
|
272
263
|
metrics.inc("mcp_server_unavailable_total");
|
|
273
264
|
return;
|
|
274
265
|
}
|
|
275
266
|
if (ctx.phase === "a2a") {
|
|
276
|
-
logger.warn("a2a_peer_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), info: buildShownUrlsInText(String(err)) });
|
|
267
|
+
logger.warn("a2a_peer_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), ...codeField, info: seatText("operator-log-text", buildShownUrlsInText(String(err))) });
|
|
277
268
|
metrics.inc("a2a_peer_unavailable_total");
|
|
278
269
|
return;
|
|
279
270
|
}
|
|
@@ -285,7 +276,8 @@ export function createRunnerDeps(ctx) {
|
|
|
285
276
|
sessionId: ctx.sessionId,
|
|
286
277
|
confirmed: classification !== undefined,
|
|
287
278
|
...(classification !== undefined ? { classification, classificationKnown: causeLevel !== undefined } : {}),
|
|
288
|
-
|
|
279
|
+
...codeField,
|
|
280
|
+
err: seatText("operator-log-text", String(err)),
|
|
289
281
|
};
|
|
290
282
|
metrics.inc("prompt_cache_low_hit_total", {
|
|
291
283
|
...(classification !== undefined ? { classification: causeLevel !== undefined ? classification : "unknown" } : {}),
|
|
@@ -298,25 +290,24 @@ export function createRunnerDeps(ctx) {
|
|
|
298
290
|
return;
|
|
299
291
|
}
|
|
300
292
|
if (ctx.phase === "config") {
|
|
301
|
-
const code = typeof err?.code === "string" ? err.code : undefined;
|
|
302
293
|
const classification = ctx.classification;
|
|
303
294
|
const classificationKnown = classification === undefined ? undefined : CONFIG_ADVISORY_CLASSIFICATIONS.has(classification);
|
|
304
295
|
const fields = {
|
|
305
296
|
sessionId: ctx.sessionId,
|
|
306
|
-
...
|
|
297
|
+
...codeField,
|
|
307
298
|
...(classification !== undefined ? { classification, classificationKnown } : {}),
|
|
308
|
-
info: String(err),
|
|
299
|
+
info: seatText("operator-log-text", String(err)),
|
|
309
300
|
};
|
|
310
301
|
logger.warn("runner_config_advisory", fields);
|
|
311
302
|
metrics.inc("runner_config_advisory_total", {
|
|
312
|
-
...
|
|
303
|
+
...codeField,
|
|
313
304
|
...(classification !== undefined ? { classification: classificationKnown ? classification : "unknown" } : {}),
|
|
314
305
|
level: "warn",
|
|
315
306
|
});
|
|
316
307
|
return;
|
|
317
308
|
}
|
|
318
309
|
metrics.inc("runner_error_total", { phase: ctx.phase });
|
|
319
|
-
logger.error("runner_error", { phase: ctx.phase, sessionId: ctx.sessionId, err: String(err) });
|
|
310
|
+
logger.error("runner_error", { phase: ctx.phase, sessionId: ctx.sessionId, ...codeField, err: seatText("operator-log-text", String(err)) });
|
|
320
311
|
},
|
|
321
312
|
...(ctx.consolidationSeat !== undefined
|
|
322
313
|
? {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { applyGovernedVerdictAbsenceWarning, applyLocalAutoModeDeny, applyMemoryOptOutGrant, applyObserverEnvOptIn, centerEntitlementSourceWired, createPrincipalEntitlementsClient, } from "../runtime-caps-resolver.js";
|
|
2
2
|
import { scopedTokenNeedsWorker } from "../center-credential.js";
|
|
3
3
|
import { WEB_ADMIN_ENV } from "@sema-agent/settings-schema";
|
|
4
|
+
import { seatText } from "../trace/exit-seat.js";
|
|
4
5
|
export function assertMemoryCapturePolicyWirable(input) {
|
|
5
6
|
if (input.policy !== "governed")
|
|
6
7
|
return;
|
|
@@ -47,7 +48,7 @@ export function createRuntimeCaps(ctx) {
|
|
|
47
48
|
? createPrincipalEntitlementsClient({
|
|
48
49
|
center: config.webAdmin,
|
|
49
50
|
...(config.webAdmin.worker ? { worker: config.webAdmin.worker } : {}),
|
|
50
|
-
onError: (err, principal) => logger.warn("runtime_caps_resolve_failed", { principal, err: String(err) }),
|
|
51
|
+
onError: (err, principal) => logger.warn("runtime_caps_resolve_failed", { principal, err: seatText("operator-log-text", String(err)) }),
|
|
51
52
|
})
|
|
52
53
|
: undefined;
|
|
53
54
|
const centerRuntimeCapsResolver = principalCaps?.resolveRuntimeCaps;
|
|
@@ -60,7 +61,7 @@ export function createRuntimeCaps(ctx) {
|
|
|
60
61
|
const withMemoryGrant = applyMemoryOptOutGrant(withObservers, ctx.memoryOptOutGrant, {
|
|
61
62
|
onFault: (err, principal) => logger.warn("memory_optout_grant_resolve_failed", {
|
|
62
63
|
principal,
|
|
63
|
-
err: String(err),
|
|
64
|
+
err: seatText("operator-log-text", String(err)),
|
|
64
65
|
...(observability ? {} : { face: "capabilities-read" }),
|
|
65
66
|
effect: "allowMemoryOptOut left ABSENT for this resolve (never coined as false): open posture ⇒ the opt-out takes effect; governed ⇒ core refuses the run (verdict absent)",
|
|
66
67
|
}),
|
|
@@ -11,6 +11,7 @@ import { probeSessionChildren, retireSessionChildren, sessionChildrenScope, Sess
|
|
|
11
11
|
import { SessionActiveRunError } from "../execution-placement.js";
|
|
12
12
|
import { headReadOf, redactIncarnations } from "../session-incarnation.js";
|
|
13
13
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
14
|
+
import { seatText } from "../trace/exit-seat.js";
|
|
14
15
|
export function createSessionFaces(ctx) {
|
|
15
16
|
const { config, logger, metrics, localRoot, backend, sessionStore, runStore, checkpointStore, toolResultStore, resumeAnchorStore, approvalExemptionStore, sessionPolicyStore, taskAttachmentStore, fileHistoryErasure, workflowCompletionInbox, taskListLane, dropSessionScoped, mailboxStore, mailboxRecipientLifecycle, backgroundAgentStore, userInputLedgerStore, spaceReclaimer, } = ctx;
|
|
16
17
|
const mysqlPool = backend?.mysqlPool();
|
|
@@ -106,7 +107,7 @@ export function createSessionFaces(ctx) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
if (workflowCompletionInbox)
|
|
109
|
-
await workflowCompletionInbox.purge(sessionId, owner ?? null).catch((err) => logger.warn("workflow_completion_inbox_purge_failed", { sessionId, err: String(err) }));
|
|
110
|
+
await workflowCompletionInbox.purge(sessionId, owner ?? null).catch((err) => logger.warn("workflow_completion_inbox_purge_failed", { sessionId, err: seatText("operator-log-text", String(err)) }));
|
|
110
111
|
const peerBox = mailboxStore !== undefined && mailboxRecipientLifecycle !== undefined
|
|
111
112
|
? { store: mailboxStore, lifecycle: mailboxRecipientLifecycle, scope: owner ?? "default", handle: peerSessionBoxHandle(sessionId) }
|
|
112
113
|
: undefined;
|
|
@@ -118,7 +119,7 @@ export function createSessionFaces(ctx) {
|
|
|
118
119
|
await reapSessionBackgroundHard(sessionId, owner ?? "default", { includeRetained: false, reason: "session_deleted" }, logger);
|
|
119
120
|
}
|
|
120
121
|
catch (err) {
|
|
121
|
-
logger.warn("session_background_reap_failed", { sessionId, err: String(err) });
|
|
122
|
+
logger.warn("session_background_reap_failed", { sessionId, err: seatText("operator-log-text", String(err)) });
|
|
122
123
|
}
|
|
123
124
|
if (peerBox !== undefined)
|
|
124
125
|
await peerBox.store.drop(peerBox.scope, peerBox.handle);
|
|
@@ -138,7 +139,7 @@ export function createSessionFaces(ctx) {
|
|
|
138
139
|
logger.warn("workspace_space_reclaim_failed", {
|
|
139
140
|
sessionId,
|
|
140
141
|
stage: "seat_threw",
|
|
141
|
-
error: redactIncarnations(String(err)),
|
|
142
|
+
error: seatText("operator-log-text", redactIncarnations(String(err))),
|
|
142
143
|
effect: "the ended space's cache volume and snapshot objects may stay (the reclaim seat threw, which its contract forbids; the session delete went ahead) — the bucket's lifecycle rule is the fallback for objects, the volume is deleted by label sema.space",
|
|
143
144
|
});
|
|
144
145
|
});
|
package/dist/boot/shutdown.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import type { BreakerStateStore, CostQuotaStore, RateLimiterStore, StoreBackend
|
|
|
31
31
|
import type { WorkflowNotifyJournalStore } from "../orchestration/workflow-notify-journal.js";
|
|
32
32
|
import type { ToolApprovalCoordinator } from "../tool-approval.js";
|
|
33
33
|
import type { ParkCommitWatch } from "../plugins/park-commit-watch.js";
|
|
34
|
+
import type { PeerInboundShutdownReading } from "../peer-inbound-face.js";
|
|
34
35
|
import { type DrainState } from "../fleet/drain-entry.js";
|
|
35
36
|
export interface ShutdownCtx {
|
|
36
37
|
config: ServiceConfig;
|
|
@@ -94,6 +95,14 @@ export interface ShutdownCtx {
|
|
|
94
95
|
servingLease?: {
|
|
95
96
|
stop(): void;
|
|
96
97
|
} | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* [ref]:被扣跨会话来信的收信方决断面(`peer-inbound-face.ts`,进程单例)的关停口 —— CC `HBe` 的宿主半场(core 不调 `PeerHeldQueue.shutdown()`)。
|
|
100
|
+
* hardShutdown 起点与审批面收尾**并行**调它、`backend.close()` 之前等它(结清要走信箱店的 CAS 与回执投递):本进程仍被扣的信按 core 的规则
|
|
101
|
+
* 带 `expired` 回执结清(reason `shutdown`)。缺席 = 本装配不接(测试装配)。
|
|
102
|
+
*/
|
|
103
|
+
peerInbound?: {
|
|
104
|
+
shutdown(): Promise<PeerInboundShutdownReading>;
|
|
105
|
+
} | undefined;
|
|
97
106
|
}
|
|
98
107
|
/**
|
|
99
108
|
* 受控退的**后台宽限**还要等多久(ms)—— hardShutdown 软停后台 shell 之后、`process.exit` 之前,给软停过的行**一次**
|
package/dist/boot/shutdown.js
CHANGED
|
@@ -9,6 +9,7 @@ import { createEngineLeaseTracker } from "./engine-lease.js";
|
|
|
9
9
|
import { writeExitLast, readExitLast, clearExitLast } from "./exit-last.js";
|
|
10
10
|
import { isScriptRealmRejection, describeRejectionReason } from "../orchestration/hardened-vm-runner.js";
|
|
11
11
|
import { DRAIN_CAUSE_COUNTS_AS_FIRST_STOP_SIGNAL, HARD_STOP_ACTION_ID, drainDeadlineBeyondBound } from "../fleet/drain-entry.js";
|
|
12
|
+
import { seatText } from "../trace/exit-seat.js";
|
|
12
13
|
const HARD_STOP_GRACE_MS = 10_000;
|
|
13
14
|
const FINAL_EXIT_MS = 15_000;
|
|
14
15
|
export function backgroundGraceRemainingMs(a) {
|
|
@@ -17,7 +18,7 @@ export function backgroundGraceRemainingMs(a) {
|
|
|
17
18
|
return Math.max(0, Math.min(a.softStoppedAt + a.graceMs, a.deadlineMs) - a.now);
|
|
18
19
|
}
|
|
19
20
|
export function installShutdownHandlers(ctx) {
|
|
20
|
-
const { config, logger, server, reaper, fleetReconcile, retentionLane, releaseRetentionLease, otelExporter, breakerState, costQuota, rateLimiter, runner, subRunner, lspManager, workflowNotifyJournal, fleetClient, backend, drainState, storeLiveProbe, webAdmin, version, deviceHub, toolApproval, parkCommits, servingLease, } = ctx;
|
|
21
|
+
const { config, logger, server, reaper, fleetReconcile, retentionLane, releaseRetentionLease, otelExporter, breakerState, costQuota, rateLimiter, runner, subRunner, lspManager, workflowNotifyJournal, fleetClient, backend, drainState, storeLiveProbe, webAdmin, version, deviceHub, toolApproval, parkCommits, servingLease, peerInbound, } = ctx;
|
|
21
22
|
const dataRoot = config.localDataRoot;
|
|
22
23
|
if (dataRoot) {
|
|
23
24
|
const prior = readCrashLast(dataRoot);
|
|
@@ -91,7 +92,21 @@ export function installShutdownHandlers(ctx) {
|
|
|
91
92
|
for (const p of uncommittedParks)
|
|
92
93
|
logger.warn("approval_park_uncommitted_at_shutdown", { approvalId: p.approvalId, taskId: p.taskId });
|
|
93
94
|
})
|
|
94
|
-
.catch((err) => logger.warn("approval_drain_for_shutdown_failed", { err: String(err) }));
|
|
95
|
+
.catch((err) => logger.warn("approval_drain_for_shutdown_failed", { err: seatText("operator-log-text", String(err)) }));
|
|
96
|
+
const peerInboundDrain = peerInbound === undefined
|
|
97
|
+
? Promise.resolve()
|
|
98
|
+
: (async () => {
|
|
99
|
+
const deadline = new AbortController();
|
|
100
|
+
const settled = peerInbound.shutdown().then((reading) => {
|
|
101
|
+
if (reading.queues > 0 || reading.scopeUnresolved > 0)
|
|
102
|
+
logger.info("peer_inbound_settled_at_shutdown", { queues: reading.queues, scopeUnresolved: reading.scopeUnresolved });
|
|
103
|
+
}, (err) => logger.warn("peer_inbound_shutdown_failed", { err: seatText("operator-log-text", String(err)) }));
|
|
104
|
+
const timedOut = delay(Math.max(0, graceDeadlineMs - Date.now()), undefined, { signal: deadline.signal }).then(() => "deadline", () => "done");
|
|
105
|
+
const winner = await Promise.race([settled.then(() => "done"), timedOut]);
|
|
106
|
+
deadline.abort();
|
|
107
|
+
if (winner === "deadline")
|
|
108
|
+
logger.warn("peer_inbound_shutdown_unfinished_at_deadline", {});
|
|
109
|
+
})();
|
|
95
110
|
clearInterval(reaper);
|
|
96
111
|
clearInterval(fleetReconcile.timer);
|
|
97
112
|
const retentionTeardown = retentionLane === undefined
|
|
@@ -107,7 +122,7 @@ export function installShutdownHandlers(ctx) {
|
|
|
107
122
|
engineLease?.stop();
|
|
108
123
|
storeLiveProbe?.stop();
|
|
109
124
|
servingLease?.stop();
|
|
110
|
-
void deviceHub?.close().catch((err) => logger.warn("device_hub_close_failed", { err: String(err) }));
|
|
125
|
+
void deviceHub?.close().catch((err) => logger.warn("device_hub_close_failed", { err: seatText("operator-log-text", String(err)) }));
|
|
111
126
|
webAdmin?.stopRefreshLoop();
|
|
112
127
|
otelExporter?.stop();
|
|
113
128
|
breakerState?.stop();
|
|
@@ -119,7 +134,7 @@ export function installShutdownHandlers(ctx) {
|
|
|
119
134
|
const softStoppedAt = Date.now();
|
|
120
135
|
const backgroundGraceMs = backgroundGraceRemainingMs({ softStopped: backgroundSoftStopped, softStoppedAt, now: softStoppedAt, graceMs: HOST_BG_KILL_GRACE_MS, deadlineMs: graceDeadlineMs });
|
|
121
136
|
const backgroundGrace = backgroundGraceMs > 0 ? delay(backgroundGraceMs) : Promise.resolve();
|
|
122
|
-
const drained = approvalDrain
|
|
137
|
+
const drained = Promise.all([approvalDrain, peerInboundDrain])
|
|
123
138
|
.then(() => parkCommits?.quiesce(graceDeadlineMs))
|
|
124
139
|
.then((q) => {
|
|
125
140
|
if (q !== undefined && q.inFlight > 0)
|
|
@@ -3,6 +3,7 @@ import { createWebAdminRuntime } from "./web-admin.js";
|
|
|
3
3
|
import { composeExecutionLane, FILE_SOURCED_LANES } from "./execution-lane.js";
|
|
4
4
|
import { configSourceKind } from "../config-provider.js";
|
|
5
5
|
import { logConfigDirMigration, migrateLocalConfigDirectory } from "../config-d-migration.js";
|
|
6
|
+
import { logEnvModelsMigration, runEnvModelsMigration } from "../config-root-migration.js";
|
|
6
7
|
import { assertLocalConfigDirTrusted } from "../config-dir-trust.js";
|
|
7
8
|
import { defaultModelRefusal, refusedNameMintedRefusal } from "../model-entry-refusal.js";
|
|
8
9
|
import { isRosterGateArmed } from "../config.js";
|
|
@@ -13,6 +14,8 @@ export async function runStage02(ctx) {
|
|
|
13
14
|
const configSource = configSourceKind(config);
|
|
14
15
|
if (configSource === "local") {
|
|
15
16
|
await assertLocalConfigDirTrusted({ root: localRoot, declaredOwnerUid: config.configLocalOwnerUid });
|
|
17
|
+
const envModelsMigration = { root: localRoot, env: process.env, envTableIsPlaceholder: isRosterGateArmed(config.webAdmin) };
|
|
18
|
+
logEnvModelsMigration(logger, envModelsMigration, await runEnvModelsMigration(envModelsMigration));
|
|
16
19
|
logConfigDirMigration(logger, await migrateLocalConfigDirectory(localRoot));
|
|
17
20
|
}
|
|
18
21
|
await composeExecutionLane(config, { configSource, localRoot, logger, drivesFromFile: FILE_SOURCED_LANES });
|
|
@@ -5,7 +5,10 @@ export declare function runStage03(ctx: Awaited<ReturnType<typeof runStage02>>):
|
|
|
5
5
|
breakerState: import("../plugins/breaker-state-sql.js").TiDBBreakerState | import("../plugins/breaker-state-sql.js").PgBreakerState | undefined;
|
|
6
6
|
engineDataRoot: string;
|
|
7
7
|
instanceId: string;
|
|
8
|
-
mailboxRecipientLifecycle:
|
|
8
|
+
mailboxRecipientLifecycle: Readonly<{
|
|
9
|
+
retireRecipient: NonNullable<import("@sema-agent/core").MailboxStore["retireRecipient"]>;
|
|
10
|
+
listRetiredRecipients: NonNullable<import("@sema-agent/core").MailboxStore["listRetiredRecipients"]>;
|
|
11
|
+
}> | undefined;
|
|
9
12
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
10
13
|
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
11
14
|
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
@@ -2,9 +2,8 @@ import { uuidv7 } from "@sema-agent/core";
|
|
|
2
2
|
import { openStores } from "./stores.js";
|
|
3
3
|
export async function runStage03(ctx) {
|
|
4
4
|
const { config, localRoot, logger, metrics } = ctx;
|
|
5
|
-
const { backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, taskAttachmentStore, mailboxStore, mailboxRecipientLifecycle, memoryExportStores, memorySyncRunner, sessionStore, breakerState, usageWindowStore, memoryPosture, taskListLane, sqlEngine, } = await openStores({ config, logger, metrics, localRoot });
|
|
5
|
+
const { backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, sessionCaptureRecords, taskAttachmentStore, mailboxStore, mailboxRecipientLifecycle, memoryExportStores, memorySyncRunner, sessionStore, breakerState, usageWindowStore, memoryPosture, taskListLane, sqlEngine, } = await openStores({ config, logger, metrics, localRoot });
|
|
6
6
|
const instanceId = uuidv7();
|
|
7
|
-
const sessionCaptureRecords = backend?.sessionCaptureRecords();
|
|
8
7
|
return { ...ctx, backend, backgroundAgentStore, breakerState, engineDataRoot, instanceId, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memoryExportStores, memoryPosture, memorySyncCursors, memorySyncRunner, rosterStore, sessionCaptureRecords, sessionStore, sqlEngine, storePosture, taskAttachmentStore, taskListLane, usageWindowStore };
|
|
9
8
|
}
|
|
10
9
|
//# sourceMappingURL=stage-03-store-backend.js.map
|
|
@@ -28,14 +28,17 @@ export declare function runStage04(ctx: Awaited<ReturnType<typeof runStage03>>):
|
|
|
28
28
|
sessionMemoryStatusFace: import("../memory-operator-faces.js").SessionMemoryStatusFace | undefined;
|
|
29
29
|
sessionPolicyStore: import("@sema-agent/core").SessionPolicyStore | undefined;
|
|
30
30
|
sideQueryAccounting: import("../budget.js").SideQueryAccounting;
|
|
31
|
-
toolResultStore: import("
|
|
31
|
+
toolResultStore: import("@sema-agent/core").ToolResultStore | undefined;
|
|
32
32
|
tracer: import("@sema-agent/core").TracerHook;
|
|
33
33
|
backend: import("../index.js").StoreBackend | undefined;
|
|
34
34
|
backgroundAgentStore: import("@sema-agent/core").BackgroundAgentStore | undefined;
|
|
35
35
|
breakerState: import("../plugins/breaker-state-sql.js").TiDBBreakerState | import("../plugins/breaker-state-sql.js").PgBreakerState | undefined;
|
|
36
36
|
engineDataRoot: string;
|
|
37
37
|
instanceId: string;
|
|
38
|
-
mailboxRecipientLifecycle:
|
|
38
|
+
mailboxRecipientLifecycle: Readonly<{
|
|
39
|
+
retireRecipient: NonNullable<import("@sema-agent/core").MailboxStore["retireRecipient"]>;
|
|
40
|
+
listRetiredRecipients: NonNullable<import("@sema-agent/core").MailboxStore["listRetiredRecipients"]>;
|
|
41
|
+
}> | undefined;
|
|
39
42
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
40
43
|
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
41
44
|
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
@@ -6,23 +6,22 @@ import { auditDormantPermissionRules } from "./permission-rules-audit.js";
|
|
|
6
6
|
import { createBudgetAndTracing } from "./budget-tracing.js";
|
|
7
7
|
import { createRuleConsentLane } from "../rules-consent.js";
|
|
8
8
|
import { createConsolidationValve } from "./memory-consolidation.js";
|
|
9
|
+
import { createOperatorFaceIncidentSink } from "../memory-incident-sink.js";
|
|
9
10
|
export async function runStage04(ctx) {
|
|
10
|
-
const { backend, breakerState, config, logger, memoryEngine, metrics
|
|
11
|
-
const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine
|
|
11
|
+
const { backend, breakerState, config, logger, memoryEngine, metrics } = ctx;
|
|
12
|
+
const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine) : undefined;
|
|
12
13
|
const memoryComplianceFaces = memoryEngine
|
|
13
14
|
? createMemoryComplianceFaces(memoryEngine, {
|
|
14
|
-
onIncident: (
|
|
15
|
-
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
15
|
+
onIncident: createOperatorFaceIncidentSink({ logger }, "memory_compliance_incident"),
|
|
16
16
|
})
|
|
17
17
|
: undefined;
|
|
18
18
|
const memoryOriginFaces = memoryEngine
|
|
19
19
|
? createMemoryOriginFaces(memoryEngine, {
|
|
20
|
-
onIncident: (
|
|
21
|
-
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
20
|
+
onIncident: createOperatorFaceIncidentSink({ logger }, "memory_origin_incident"),
|
|
22
21
|
})
|
|
23
22
|
: undefined;
|
|
24
23
|
const sessionMemoryStatusFace = memoryEngine
|
|
25
|
-
? createSessionMemoryStatusFace(memoryEngine
|
|
24
|
+
? createSessionMemoryStatusFace(memoryEngine)
|
|
26
25
|
: undefined;
|
|
27
26
|
const { valve: consolidationValve, watch: consolidationSeatWatch } = createConsolidationValve({ config, memoryEngine, logger });
|
|
28
27
|
const adoptionBoot = await runAdoptionBootScan({ backend, logger });
|
|
@@ -10,7 +10,7 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
10
10
|
lspManager: import("@sema-agent/core").NodeLspManager | import("../lsp/manager.js").E2bLspManager | undefined;
|
|
11
11
|
spaceReclaimer: import("../workspace-space.js").SpaceReclaimer | undefined;
|
|
12
12
|
sandboxPodReaper: import("../plugins/k8s-pod-reaper.js").SandboxPodReaper | undefined;
|
|
13
|
-
sandboxGitPlane: import("../sandbox-git-plane.js").SandboxGitPlane;
|
|
13
|
+
sandboxGitPlane: () => import("../sandbox-git-plane.js").SandboxGitPlane;
|
|
14
14
|
perSessionCwd: Map<string, string>;
|
|
15
15
|
perTaskImage: import("../per-task-image.js").PerTaskImageRegistry;
|
|
16
16
|
sendUserFileTaskEnvs: import("../capabilities/sandbox-file-send.js").TaskEnvRegistry | undefined;
|
|
@@ -47,14 +47,17 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
47
47
|
sessionMemoryStatusFace: import("../memory-operator-faces.js").SessionMemoryStatusFace | undefined;
|
|
48
48
|
sessionPolicyStore: import("@sema-agent/core").SessionPolicyStore | undefined;
|
|
49
49
|
sideQueryAccounting: import("../budget.js").SideQueryAccounting;
|
|
50
|
-
toolResultStore: import("
|
|
50
|
+
toolResultStore: import("@sema-agent/core").ToolResultStore | undefined;
|
|
51
51
|
tracer: import("@sema-agent/core").TracerHook;
|
|
52
52
|
backend: import("../index.js").StoreBackend | undefined;
|
|
53
53
|
backgroundAgentStore: import("@sema-agent/core").BackgroundAgentStore | undefined;
|
|
54
54
|
breakerState: import("../plugins/breaker-state-sql.js").TiDBBreakerState | import("../plugins/breaker-state-sql.js").PgBreakerState | undefined;
|
|
55
55
|
engineDataRoot: string;
|
|
56
56
|
instanceId: string;
|
|
57
|
-
mailboxRecipientLifecycle:
|
|
57
|
+
mailboxRecipientLifecycle: Readonly<{
|
|
58
|
+
retireRecipient: NonNullable<import("@sema-agent/core").MailboxStore["retireRecipient"]>;
|
|
59
|
+
listRetiredRecipients: NonNullable<import("@sema-agent/core").MailboxStore["listRetiredRecipients"]>;
|
|
60
|
+
}> | undefined;
|
|
58
61
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
59
62
|
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
60
63
|
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
@@ -13,18 +13,20 @@ export async function runStage05(ctx) {
|
|
|
13
13
|
const deviceLane = config.remoteExec?.provider === "device" ? createDeviceLane({ config, logger, metrics, backend, seat: sessionStore.executionPlacement, replicaId: instanceId }) : undefined;
|
|
14
14
|
const headOf = headReadOf(sessionStore);
|
|
15
15
|
const spaceCommits = backend !== undefined ? () => runStore : undefined;
|
|
16
|
-
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, sandboxSecretSeatGate, sandboxPodReaper,
|
|
16
|
+
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, sandboxSecretSeatGate, sandboxPodReaper, sandboxGitPlane: sandboxGitPlaneSeat, } = createExecutionEnv({ config, logger, metrics, taskAttachmentStore, ...(deviceLane ? { deviceLane } : {}), ...(spaceCommits !== undefined ? { spaceCommits } : {}), ...(headOf !== undefined ? { headOf } : {}), ...(backend !== undefined ? { runRows: () => runStore } : {}) });
|
|
17
17
|
assertDeviceLaneWired(config.remoteExec?.provider === "device", deviceLane, executionEnvFactory !== undefined);
|
|
18
18
|
if (deviceLane !== undefined && config.remoteExec?.provider === "device")
|
|
19
19
|
await noteDeviceRelayBindings(config.remoteExec.relay, deviceLane.store, logger);
|
|
20
20
|
assertWorkspaceSpaceReadable(facts.workspaceSpace(config), { headOf, spaceCommits }, facts.workspaceCache(config), sessionStoreLabelOf(config.sessionBackend, backend?.kind));
|
|
21
21
|
if (sandboxSecretSeatGate !== undefined)
|
|
22
22
|
await sandboxSecretSeatGate();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
logger.info("credential_plane_sandbox_git", { state: "
|
|
23
|
+
await sandboxGitPlaneSeat.settle();
|
|
24
|
+
const sandboxGitPlane = sandboxGitPlaneSeat.now;
|
|
25
|
+
const bootPlane = sandboxGitPlane();
|
|
26
|
+
if (bootPlane.state === "on")
|
|
27
|
+
logger.info("credential_plane_sandbox_git", { state: "on", origins: bootPlane.origins });
|
|
28
|
+
else if (bootPlane.reason !== "single_user" && bootPlane.reason !== "lane_without_boundary") {
|
|
29
|
+
logger.info("credential_plane_sandbox_git", { state: "off", reason: bootPlane.reason, why: SANDBOX_GIT_PLANE_OFF_TEXT[bootPlane.reason] });
|
|
28
30
|
}
|
|
29
31
|
if (config.toolTrace)
|
|
30
32
|
logger.info("tool_trace_enabled", {});
|
|
@@ -71,7 +71,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
71
71
|
lspManager: import("@sema-agent/core").NodeLspManager | import("../lsp/manager.js").E2bLspManager | undefined;
|
|
72
72
|
spaceReclaimer: import("../workspace-space.js").SpaceReclaimer | undefined;
|
|
73
73
|
sandboxPodReaper: import("../plugins/k8s-pod-reaper.js").SandboxPodReaper | undefined;
|
|
74
|
-
sandboxGitPlane: import("../sandbox-git-plane.js").SandboxGitPlane;
|
|
74
|
+
sandboxGitPlane: () => import("../sandbox-git-plane.js").SandboxGitPlane;
|
|
75
75
|
perSessionCwd: Map<string, string>;
|
|
76
76
|
perTaskImage: import("../per-task-image.js").PerTaskImageRegistry;
|
|
77
77
|
sendUserFileTaskEnvs: import("../capabilities/sandbox-file-send.js").TaskEnvRegistry | undefined;
|
|
@@ -108,14 +108,17 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
108
108
|
sessionMemoryStatusFace: import("../memory-operator-faces.js").SessionMemoryStatusFace | undefined;
|
|
109
109
|
sessionPolicyStore: import("@sema-agent/core").SessionPolicyStore | undefined;
|
|
110
110
|
sideQueryAccounting: import("../budget.js").SideQueryAccounting;
|
|
111
|
-
toolResultStore: import("
|
|
111
|
+
toolResultStore: import("@sema-agent/core").ToolResultStore | undefined;
|
|
112
112
|
tracer: import("@sema-agent/core").TracerHook;
|
|
113
113
|
backend: import("../index.js").StoreBackend | undefined;
|
|
114
114
|
backgroundAgentStore: import("@sema-agent/core").BackgroundAgentStore | undefined;
|
|
115
115
|
breakerState: import("../plugins/breaker-state-sql.js").TiDBBreakerState | import("../plugins/breaker-state-sql.js").PgBreakerState | undefined;
|
|
116
116
|
engineDataRoot: string;
|
|
117
117
|
instanceId: string;
|
|
118
|
-
mailboxRecipientLifecycle:
|
|
118
|
+
mailboxRecipientLifecycle: Readonly<{
|
|
119
|
+
retireRecipient: NonNullable<import("@sema-agent/core").MailboxStore["retireRecipient"]>;
|
|
120
|
+
listRetiredRecipients: NonNullable<import("@sema-agent/core").MailboxStore["listRetiredRecipients"]>;
|
|
121
|
+
}> | undefined;
|
|
119
122
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
120
123
|
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
121
124
|
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
@@ -29,6 +29,7 @@ import { mountOrgDeliveryGate } from "./org-delivery.js";
|
|
|
29
29
|
import { parkedAskRedeem, runStore } from "./late-binds.js";
|
|
30
30
|
import { withInternalRunEnvs } from "../internal-run-env.js";
|
|
31
31
|
import { retentionSweepRuns } from "../plugins/retention-store-sql.js";
|
|
32
|
+
import { createOperatorFaceIncidentSink } from "../memory-incident-sink.js";
|
|
32
33
|
export async function runStage06(ctx) {
|
|
33
34
|
const { backend, backgroundAgentStore, brain, engineDataRoot, peerDesk, config, webAdmin, consolidationValve, deploymentMods, executionEnvFactory, fileHistoryStore, localRoot, logger, lspManager, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memorySyncRunner, metrics, perSessionCwd, permissionRuleProvider, pricing, rosterStore, ruleConsent, sendUserFileTaskEnvs, sessionCaptureRecords, sessionPolicyStore, sessionStore, taskAttachmentStore, taskListLane, toolResultStore, tracer, usageWindowStore } = ctx;
|
|
34
35
|
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, workflowParkDecisions, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
@@ -92,9 +93,8 @@ export async function runStage06(ctx) {
|
|
|
92
93
|
seat: consolidationSeat,
|
|
93
94
|
scopes: config.memoryConsolidationDriver.scopes,
|
|
94
95
|
...(config.memoryProvenance !== undefined ? { provenance: config.memoryProvenance } : {}),
|
|
95
|
-
onIncident: (
|
|
96
|
+
onIncident: createOperatorFaceIncidentSink({ logger }, "memory_consolidation_incident"),
|
|
96
97
|
onStopDetail: (audit) => logger.warn("memory_consolidation_stop_detail", audit),
|
|
97
|
-
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
98
98
|
writeJudge: createOperatorValveWriteJudge({ ruleStoreProvider: permissionRuleProvider, config }),
|
|
99
99
|
onNotice: createEngineNoticeForwarder(logger, defaultEngineNoticeRouter, metrics),
|
|
100
100
|
})
|
|
@@ -141,10 +141,9 @@ export async function runStage06(ctx) {
|
|
|
141
141
|
memorySyncRunner, toolResultStore: runnerOffloadStore, checkpointStore, sessionPolicyStore, runtimeCapsResolver, fileHistoryStore,
|
|
142
142
|
permissionRuleStore: permissionRuleProvider,
|
|
143
143
|
executionEnvFactory, lspManager, fleetBus, deploymentMods, workflowRunStore, workflowJournalStore,
|
|
144
|
-
workflowAgentRegistry, workflowNotifyGate,
|
|
144
|
+
workflowAgentRegistry, workflowNotifyGate, deliverWorkflowCompletion, orgMemoryAdmission,
|
|
145
145
|
governanceSeams,
|
|
146
146
|
sharedMemoryStores: sharedMemoryStore ? sharedMemoryStore : undefined,
|
|
147
|
-
getRunStore: () => runStore,
|
|
148
147
|
});
|
|
149
148
|
const orgDeliveryGate = mountOrgDeliveryGate({ runnerDeps, directory: orgMemoryAdmission.directory, mailboxStore, backend, logger });
|
|
150
149
|
const runner = new Runner(runnerDeps);
|