@sema-agent/core 7.64.0 → 7.66.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.
Files changed (192) hide show
  1. package/CHANGELOG.md +571 -0
  2. package/dist/agents/delegation-registry-seat.d.ts +15 -0
  3. package/dist/agents/delegation-registry-seat.js +13 -0
  4. package/dist/agents/org-delivery-gate.d.ts +8 -1
  5. package/dist/agents/org-delivery-gate.js +9 -3
  6. package/dist/agents/peer-held-queue.js +1 -1
  7. package/dist/agents/peer-idle.js +1 -1
  8. package/dist/agents/peer-session-drain.d.ts +51 -12
  9. package/dist/agents/peer-session-drain.js +47 -34
  10. package/dist/agents/read-inbox-tool.d.ts +6 -2
  11. package/dist/agents/read-inbox-tool.js +18 -5
  12. package/dist/agents/subagent.d.ts +3 -1
  13. package/dist/agents/subagent.js +84 -77
  14. package/dist/brain/reasoning.d.ts +2 -0
  15. package/dist/brain/reasoning.js +1 -0
  16. package/dist/core/allow-entry.d.ts +9 -0
  17. package/dist/core/allow-entry.js +7 -1
  18. package/dist/core/ask-origin.d.ts +23 -3
  19. package/dist/core/ask-origin.js +11 -1
  20. package/dist/core/auto-promote.d.ts +3 -2
  21. package/dist/core/background-agent-store.d.ts +7 -0
  22. package/dist/core/checkpoint-store.d.ts +2 -3
  23. package/dist/core/context-settings.d.ts +1 -2
  24. package/dist/core/context-settings.js +1 -1
  25. package/dist/core/engine-attestation.d.ts +2 -2
  26. package/dist/core/engine-notice.d.ts +13 -1
  27. package/dist/core/engine-notice.js +3 -1
  28. package/dist/core/file-history-store.d.ts +2 -2
  29. package/dist/core/file-history-store.js +0 -4
  30. package/dist/core/gate-fold.js +3 -1
  31. package/dist/core/governance-codes.d.ts +6 -4
  32. package/dist/core/governance-codes.js +5 -3
  33. package/dist/core/human-input-projection.d.ts +9 -0
  34. package/dist/core/human-input-projection.js +13 -0
  35. package/dist/core/input-author.d.ts +66 -6
  36. package/dist/core/input-author.js +21 -3
  37. package/dist/core/leg-identity.d.ts +18 -2
  38. package/dist/core/leg-identity.js +5 -7
  39. package/dist/core/mailbox-store.d.ts +1 -1
  40. package/dist/core/memory-engine/consolidation.d.ts +30 -10
  41. package/dist/core/memory-engine/consolidation.js +41 -6
  42. package/dist/core/memory-engine/control-objects.d.ts +36 -3
  43. package/dist/core/memory-engine/control-objects.js +134 -12
  44. package/dist/core/memory-engine/control-plane-adoption.d.ts +13 -9
  45. package/dist/core/memory-engine/control-plane-adoption.js +58 -31
  46. package/dist/core/memory-engine/delegation-settlement.d.ts +75 -52
  47. package/dist/core/memory-engine/delegation-settlement.js +211 -228
  48. package/dist/core/memory-engine/dual-root.d.ts +3 -2
  49. package/dist/core/memory-engine/dual-root.js +5 -1
  50. package/dist/core/memory-engine/engine.d.ts +33 -16
  51. package/dist/core/memory-engine/engine.js +213 -177
  52. package/dist/core/memory-engine/file-backend.d.ts +21 -12
  53. package/dist/core/memory-engine/file-backend.js +58 -104
  54. package/dist/core/memory-engine/index.d.ts +2 -2
  55. package/dist/core/memory-engine/index.js +2 -2
  56. package/dist/core/memory-engine/layout.d.ts +184 -83
  57. package/dist/core/memory-engine/layout.js +267 -172
  58. package/dist/core/memory-engine/memory-age.d.ts +12 -0
  59. package/dist/core/memory-engine/memory-age.js +17 -0
  60. package/dist/core/memory-engine/memory-backend-contract.js +12 -11
  61. package/dist/core/memory-engine/memory-deployment.d.ts +4 -3
  62. package/dist/core/memory-engine/memory-deployment.js +6 -3
  63. package/dist/core/memory-engine/origin-clearance.d.ts +43 -15
  64. package/dist/core/memory-engine/origin-clearance.js +142 -58
  65. package/dist/core/memory-engine/tools.d.ts +2 -2
  66. package/dist/core/memory-engine/tools.js +7 -7
  67. package/dist/core/memory-engine/types.d.ts +16 -10
  68. package/dist/core/memory-vector.d.ts +6 -14
  69. package/dist/core/memory.d.ts +0 -462
  70. package/dist/core/memory.js +0 -333
  71. package/dist/core/model-receipt.d.ts +2 -1
  72. package/dist/core/model-receipt.js +5 -0
  73. package/dist/core/mods/dollar.d.ts +12 -0
  74. package/dist/core/mods/kernel/dispatch.d.ts +3 -1
  75. package/dist/core/mods/kernel/dispatch.js +5 -2
  76. package/dist/core/mods/kernel/events.d.ts +3 -1
  77. package/dist/core/mods/kernel/events.js +2 -2
  78. package/dist/core/mods/prompt-submit.d.ts +4 -0
  79. package/dist/core/mods/prompt-submit.js +24 -0
  80. package/dist/core/mods/stations.d.ts +23 -4
  81. package/dist/core/mods/stations.js +14 -7
  82. package/dist/core/permission-rule-consent.d.ts +49 -18
  83. package/dist/core/permission-rule-consent.js +59 -38
  84. package/dist/core/permission-rule-store.d.ts +24 -14
  85. package/dist/core/retention.d.ts +2 -7
  86. package/dist/core/retention.js +0 -1
  87. package/dist/core/retired-host-table-account.d.ts +19 -0
  88. package/dist/core/retired-host-table-account.js +28 -0
  89. package/dist/core/retired-tool-name-account.d.ts +60 -0
  90. package/dist/core/retired-tool-name-account.js +32 -0
  91. package/dist/core/roles.d.ts +3 -1
  92. package/dist/core/roles.js +5 -2
  93. package/dist/core/runner/classifier-ladder.d.ts +3 -1
  94. package/dist/core/runner/classifier-ladder.js +2 -2
  95. package/dist/core/runner/compact-session.js +2 -1
  96. package/dist/core/runner/contracts.d.ts +9 -9
  97. package/dist/core/runner/delegation-owner.d.ts +0 -8
  98. package/dist/core/runner/delegation-owner.js +1 -3
  99. package/dist/core/runner/gate-exit.js +9 -2
  100. package/dist/core/runner/memory-consolidation-driver.js +2 -2
  101. package/dist/core/runner/prepare-config-doors.js +1 -1
  102. package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
  103. package/dist/core/runner/prepare-delegation-surface.js +5 -3
  104. package/dist/core/runner/prepare-gate-stations.d.ts +8 -5
  105. package/dist/core/runner/prepare-gate-stations.js +13 -5
  106. package/dist/core/runner/prepare-inherited-gate.js +2 -0
  107. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  108. package/dist/core/runner/prepare-memory.js +35 -14
  109. package/dist/core/runner/prepare-policy-chain.js +12 -3
  110. package/dist/core/runner/prepare-project-context.js +2 -2
  111. package/dist/core/runner/prepare-task.d.ts +9 -1
  112. package/dist/core/runner/prepare-task.js +6 -5
  113. package/dist/core/runner/prepare-wiring-manifest.js +5 -4
  114. package/dist/core/runner/prompt-suggestions.js +1 -1
  115. package/dist/core/runner/run-identity-wiring.js +2 -2
  116. package/dist/core/runner/run-leg.js +3 -3
  117. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  118. package/dist/core/runner/run-notification-lane.js +2 -2
  119. package/dist/core/runner/runtask.js +6 -3
  120. package/dist/core/runner/steer-admission.d.ts +11 -2
  121. package/dist/core/runner/stream-steer-verb.d.ts +5 -2
  122. package/dist/core/runner/stream-steer-verb.js +67 -14
  123. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -8
  124. package/dist/core/runner/sub-agent-deny-lists.js +22 -8
  125. package/dist/core/runner-deps.d.ts +4 -4
  126. package/dist/core/secret-env.d.ts +2 -2
  127. package/dist/core/secret-env.js +6 -20
  128. package/dist/core/session-store.d.ts +6 -6
  129. package/dist/core/session-store.js +3 -3
  130. package/dist/core/shell-run-candidates.js +3 -3
  131. package/dist/core/side-query.js +1 -1
  132. package/dist/core/skill-grant.d.ts +7 -0
  133. package/dist/core/skill-grant.js +14 -5
  134. package/dist/core/store-contracts/background-agent-store-contract.js +13 -0
  135. package/dist/core/task-event.d.ts +14 -0
  136. package/dist/core/task-notification.d.ts +35 -8
  137. package/dist/core/task-notification.js +31 -13
  138. package/dist/core/task-registry-agent.js +1 -0
  139. package/dist/core/task-registry-shared.d.ts +4 -0
  140. package/dist/core/tool-errors.d.ts +3 -3
  141. package/dist/core/tool-policy.js +2 -3
  142. package/dist/core/tool-spec.d.ts +20 -10
  143. package/dist/core/user-attachment.d.ts +5 -1
  144. package/dist/core/user-attachment.js +11 -5
  145. package/dist/core/write-protect.d.ts +16 -0
  146. package/dist/core/write-protect.js +10 -0
  147. package/dist/engine/harness/agent-harness.d.ts +19 -11
  148. package/dist/engine/harness/agent-harness.js +7 -4
  149. package/dist/engine/llm/types.d.ts +22 -10
  150. package/dist/engine/session/repo-utils.d.ts +14 -4
  151. package/dist/engine/session/repo-utils.js +5 -4
  152. package/dist/index.d.ts +10 -8
  153. package/dist/index.js +9 -7
  154. package/dist/prompts/default.d.ts +1 -2
  155. package/dist/scenarios/full-body.d.ts +1 -1
  156. package/dist/shell/lex.d.ts +50 -15
  157. package/dist/shell/lex.js +43 -9
  158. package/dist/stores/file/adoption/adopt.d.ts +1 -1
  159. package/dist/stores/file/index.d.ts +1 -15
  160. package/dist/stores/file/index.js +1 -15
  161. package/dist/stores/file/permission-rule-store.d.ts +12 -1
  162. package/dist/stores/file/permission-rule-store.js +31 -4
  163. package/dist/stores/file/session-store.js +1 -1
  164. package/dist/tools/fs/fs-bash.js +3 -3
  165. package/dist/tools/fs/removal-targets.d.ts +8 -2
  166. package/dist/tools/fs/removal-targets.js +31 -4
  167. package/dist/tools/fs/shell-read-argv.js +7 -1
  168. package/dist/tools/fs/shell-read-bindings.d.ts +21 -5
  169. package/dist/tools/fs/shell-read-bindings.js +130 -44
  170. package/dist/tools/fs/shell-read-plan.js +95 -29
  171. package/dist/tools/fs/shell-read-sourced.d.ts +25 -0
  172. package/dist/tools/fs/shell-read-sourced.js +119 -0
  173. package/dist/tools/fs/shell-read-word.d.ts +2 -2
  174. package/dist/tools/fs/shell-read-word.js +4 -5
  175. package/dist/tools/fs/shell-read-workdir.d.ts +19 -3
  176. package/dist/tools/fs/shell-read-workdir.js +60 -15
  177. package/dist/tools/fs/shell-reentry-text.d.ts +10 -2
  178. package/dist/tools/fs/shell-reentry-text.js +11 -4
  179. package/package.json +2 -2
  180. package/test/export-surface.snapshot.json +21 -79
  181. package/wire-changes/core-stores-sql@7.65.0.json +30 -0
  182. package/wire-changes/core-stores-sql@7.66.0.json +30 -0
  183. package/wire-changes/core@7.65.0.json +1650 -0
  184. package/wire-changes/core@7.66.0.json +1218 -0
  185. package/wire-changes/mods-kernel@7.65.0.json +30 -0
  186. package/wire-changes/mods-kernel@7.66.0.json +65 -0
  187. package/wire-changes/primitives@7.65.0.json +337 -0
  188. package/wire-changes/primitives@7.66.0.json +30 -0
  189. package/dist/core/memory-recall.d.ts +0 -208
  190. package/dist/core/memory-recall.js +0 -136
  191. package/dist/stores/file/memory-store.d.ts +0 -124
  192. package/dist/stores/file/memory-store.js +0 -353
@@ -0,0 +1,60 @@
1
+ /**
2
+ * THE account of the entries of a restricting tool table that name a tool the engine retired with NO successor to write
3
+ * (`TeamCreate`, `TaskOutput`, … — the retirement table's `removed` and `folded` lines, `RETIRED_TOOL_NAMES`): the sentence and the data
4
+ * of the retired-name notice (audience `user`; code {@link POLICY_NAME_REFUSAL_CODE}). Such a name reaches no tool in any roster, now or later, and never did anything a
5
+ * rewrite could restore, so every restricting table leaves the entry out, goes on, and says so ONCE in these words — the engine's own tables (a
6
+ * tool policy's `deny` / `ask`, a task's tool-name lists, a skill's `disallowed-tools`) through `retiredToolNameNotice`
7
+ * (`runner/sub-agent-deny-lists.ts`, the engine's mint), a table the host owns and the engine never reads through
8
+ * `retiredToolNameAccount` (`retired-host-table-account.ts`: the host mints its own notice from the pure account). This module holds the words and the
9
+ * data and reads no entry; the one reader and the one question (`compileAllowList`, then `isRetiredLeftOut`) are `allow-entry.ts`'s.
10
+ * A name the engine RENAMED (it has a successor the entry used to guard), an unprefixed namespace and an unmintable segment are not here:
11
+ * leaving such an entry out would widen the surface, so every table still refuses them.
12
+ */
13
+ import type { EngineNotice } from "./engine-notice.js";
14
+ /** The code of the policy-name refusal and of the retired-name notice — the one spelling their mints and every problem they list carry. */
15
+ export declare const POLICY_NAME_REFUSAL_CODE = "config.legacy_tool_name";
16
+ /** The tables the account is told for, by the words the trace already gives the first three: the run's own policy (`caller_policy`), the stored
17
+ * rules of its session, the rules an ancestor's session handed it; the lists the engine reads beside the policy — a task's tool-name lists
18
+ * (`task_selector`: `excludeTools`, a definition's or a delegation tool's `denyTools`) and a skill's `disallowed-tools` (`skill_table`); and
19
+ * `host_table`, a restricting table the HOST owns and the engine never reads (`settings.permissions.neverAuto`). */
20
+ export type PolicyNameLayer = "caller_policy" | "session_rules" | "ancestor_session_rules" | "task_selector" | "skill_table" | "host_table";
21
+ /** One entry of a restricting list (`deny` / `ask`) that names a tool the engine retired with no successor to write: the name matches nothing in
22
+ * any roster, so its table leaves the entry out and says so instead of refusing the run. `guidance` is the retirement table's own line for the
23
+ * name; `source` names the list when a layer holds more than one (a task's list, a skill, a host table), carried into the sentence and the detail. */
24
+ export interface RetiredPolicyEntry {
25
+ readonly field: "deny" | "ask";
26
+ readonly entry: string;
27
+ readonly layer: PolicyNameLayer;
28
+ readonly guidance: string;
29
+ readonly source?: string;
30
+ }
31
+ /** The words and the data of the account of a table's retired entries — everything of the notice but its code, its audience, its minter and the
32
+ * session it is told to. */
33
+ export interface RetiredToolNameAccount {
34
+ readonly message: string;
35
+ readonly detail: {
36
+ readonly layer: PolicyNameLayer;
37
+ readonly entries: ReadonlyArray<{
38
+ field: "deny" | "ask";
39
+ entry: string;
40
+ layer: PolicyNameLayer;
41
+ guidance: string;
42
+ source?: string;
43
+ }>;
44
+ readonly total: number;
45
+ };
46
+ }
47
+ /** How many entries one account lists; the rest are counted in `detail.total`. Entries are names from the retirement table (a name outside it is
48
+ * not retired), so each is short; the bound keeps the coded detail inside the terminal's element budget. */
49
+ export declare const RETIRED_NOTICE_ENTRIES_SHOWN = 32;
50
+ /** The sentence and the detail of `entries` (unique by (field, entry, source) in scan order, at most {@link RETIRED_NOTICE_ENTRIES_SHOWN} in the
51
+ * detail, `total` counts every one). */
52
+ export declare function accountOfRetired(layer: PolicyNameLayer, entries: readonly RetiredPolicyEntry[]): RetiredToolNameAccount;
53
+ /**
54
+ * The notice for the entries of one restricting table that name a retired tool (code {@link POLICY_NAME_REFUSAL_CODE}, audience `user` — the person who wrote
55
+ * the entry believes it guards a tool): the table left them out, they reach no tool in any roster, and the run goes on. Minted here and nowhere else
56
+ * by the engine. `detail: { layer, entries: [{ field, entry, layer, guidance, source? }], total, sessionId }` — `entries` are unique by (field, entry,
57
+ * source) in scan order, at most {@link RETIRED_NOTICE_ENTRIES_SHOWN}, `total` counts every one. The entries that name a tool the engine renamed
58
+ * are not here: their names have a successor, the entry guarded it, and every table still refuses them.
59
+ */
60
+ export declare function retiredToolNameNotice(layer: PolicyNameLayer, entries: readonly RetiredPolicyEntry[], sessionId: string): EngineNotice;
@@ -0,0 +1,32 @@
1
+ export const POLICY_NAME_REFUSAL_CODE = "config.legacy_tool_name";
2
+ const LAYER_WORD = {
3
+ caller_policy: "the run's tool policy",
4
+ session_rules: "the session's stored permission rules",
5
+ ancestor_session_rules: "the stored permission rules of an ancestor session",
6
+ task_selector: "the run's tool-name lists",
7
+ skill_table: "a Skill's disallowed-tools",
8
+ host_table: "a restricting tool table of the host",
9
+ };
10
+ export const RETIRED_NOTICE_ENTRIES_SHOWN = 32;
11
+ export function accountOfRetired(layer, entries) {
12
+ const unique = [];
13
+ const seen = new Set();
14
+ for (const e of entries) {
15
+ const key = `${e.field}\u0000${e.entry}\u0000${e.source ?? ""}`;
16
+ if (seen.has(key))
17
+ continue;
18
+ seen.add(key);
19
+ unique.push(e);
20
+ }
21
+ const one = unique.length === 1;
22
+ const shown = unique.slice(0, 5).map((e) => `${e.field}-list entry "${e.entry}"${e.source !== undefined ? ` of ${e.source}` : ""}`);
23
+ const more = unique.length > shown.length ? ` and ${unique.length - shown.length} more` : "";
24
+ return {
25
+ message: `${LAYER_WORD[layer]} holds ${shown.join(", ")}${more}, ${one ? "a RETIRED tool name" : "RETIRED tool names"} that ${one ? "reaches" : "reach"} no tool in this run's roster — ${one ? "it guards" : "they guard"} nothing, and the run goes on without ${one ? "it" : "them"}. Remove ${one ? "the entry" : "the entries"} from the list.`,
26
+ detail: { layer, entries: unique.slice(0, RETIRED_NOTICE_ENTRIES_SHOWN).map((e) => ({ field: e.field, entry: e.entry, layer: e.layer, guidance: e.guidance, ...(e.source !== undefined ? { source: e.source } : {}) })), total: unique.length },
27
+ };
28
+ }
29
+ export function retiredToolNameNotice(layer, entries, sessionId) {
30
+ const account = accountOfRetired(layer, entries);
31
+ return { code: POLICY_NAME_REFUSAL_CODE, message: account.message, detail: { ...account.detail, sessionId } };
32
+ }
@@ -197,7 +197,9 @@ export interface ResolvedRole {
197
197
  * the deployment's per-model context-window overlay.
198
198
  */
199
199
  modelRef: ModelRef;
200
- /** The effective thinking level: explicit `spec.thinking` wins, else the role's default. */
200
+ /** The effective thinking level, the one reading of the chain: explicit `spec.thinking` wins, else the role's default,
201
+ * else the resolved model's own `Model.defaultThinking` ({@link thinkingOf}); absent ⇒ no tier is named anywhere, so the
202
+ * request writes no thinking key and the provider's default governs. */
201
203
  thinking?: ThinkingLevel;
202
204
  /** The requested role's role-base statement, if it made one (independent of model fallback): its word (the host role
203
205
  * and the catalog variant it selects) and its text (which replaces that base) — the second source of the role-base
@@ -376,6 +376,9 @@ export function unheldChainRefusal(chain, models, roles) {
376
376
  export function roleFallbackChain(role) {
377
377
  return FALLBACK[role];
378
378
  }
379
+ function thinkingOf(explicit, role, model) {
380
+ return explicit ?? role ?? model.defaultThinking;
381
+ }
379
382
  function chainHead(spec, deps) {
380
383
  const start = spec.modelRole === undefined ? "default" : spec.modelRole;
381
384
  assertKnownRole(start, "modelRole");
@@ -394,7 +397,7 @@ export function resolveTaskModel(spec, deps) {
394
397
  return {
395
398
  model,
396
399
  modelRef: typeof written === "string" ? written : model,
397
- thinking: spec.thinking ?? startParts.thinking,
400
+ thinking: thinkingOf(spec.thinking, startParts.thinking, model),
398
401
  promptRole: startParts.promptRole,
399
402
  systemPrompt: startParts.systemPrompt,
400
403
  };
@@ -409,7 +412,7 @@ export function resolveTaskModel(spec, deps) {
409
412
  const model = fromParts ?? roleTierModel(role, deps.models);
410
413
  if (model) {
411
414
  const modelRef = fromParts !== undefined ? (parts.model ?? model) : (ROLE_TIER_DEFAULTS[role] ?? model);
412
- return { model, modelRef, thinking: spec.thinking ?? parts.thinking, promptRole: startPromptRole, systemPrompt: startSystemPrompt };
415
+ return { model, modelRef, thinking: thinkingOf(spec.thinking, parts.thinking, model), promptRole: startPromptRole, systemPrompt: startSystemPrompt };
413
416
  }
414
417
  }
415
418
  if (firstUnheld !== undefined)
@@ -167,10 +167,12 @@ export declare function classifierUnavailableNotice(args: ClassifierUnavailableI
167
167
  runId?: string;
168
168
  }): EngineNotice;
169
169
  /** A classifier station's fork facts, wired once per leg: the route an ask the station hands on takes, and the
170
- * `classifier.unavailable` notice through the one throat. Both stations (the gate, the inherited fold) take it. */
170
+ * `classifier.unavailable` notice through the one throat, under the leg's notice admission when it has one (`admission`).
171
+ * Both stations (the gate, the inherited fold) take it. */
171
172
  export declare function classifierUnavailableSeat(args: ClassifierUnavailableStation & {
172
173
  route: ApprovalRoute;
173
174
  onNotice: RunnerDeps["onNotice"];
175
+ admission?: (notice: EngineNotice) => boolean;
174
176
  sessionId?: string;
175
177
  sourceSessionId?: string;
176
178
  agentId?: string;
@@ -136,8 +136,8 @@ export function classifierUnavailableNotice(args) {
136
136
  };
137
137
  }
138
138
  export function classifierUnavailableSeat(args) {
139
- const { route, onNotice, sessionId, sourceSessionId, agentId, runId, station, budgetMs } = args;
140
- return { route, onUnavailable: (info) => deliverEngineNotice(onNotice, classifierUnavailableNotice({ ...info, station, ...(budgetMs !== undefined ? { budgetMs } : {}), ...(sessionId !== undefined ? { sessionId } : {}), ...(sourceSessionId !== undefined ? { sourceSessionId } : {}), ...(agentId !== undefined ? { agentId } : {}), ...(runId !== undefined ? { runId } : {}) })) };
139
+ const { route, onNotice, admission, sessionId, sourceSessionId, agentId, runId, station, budgetMs } = args;
140
+ return { route, onUnavailable: (info) => deliverEngineNotice(onNotice, classifierUnavailableNotice({ ...info, station, ...(budgetMs !== undefined ? { budgetMs } : {}), ...(sessionId !== undefined ? { sessionId } : {}), ...(sourceSessionId !== undefined ? { sourceSessionId } : {}), ...(agentId !== undefined ? { agentId } : {}), ...(runId !== undefined ? { runId } : {}) }), admission) };
141
141
  }
142
142
  function classifierFallbackAnnouncer(args) {
143
143
  const announced = new Set();
@@ -81,7 +81,7 @@ async function compactOnSession(req, deps, session, resolved, named, legMods) {
81
81
  compactStation.bind({ bus: legMods.bus, identity: undefined, report: legMods.report });
82
82
  const overlay = contextOverlayFor(deps.contextSettings, resolved.modelRef, deps);
83
83
  const activeTools = compactionActivationSnapshot(branch);
84
- const thinking = resolved.thinking ?? resolved.model.defaultThinking;
84
+ const thinking = resolved.thinking;
85
85
  const comp = await compactStation.compact({
86
86
  session,
87
87
  admitRows: rowSeat.admitRows,
@@ -154,6 +154,7 @@ function bindSessionFacade(legMods, input) {
154
154
  sessionAppend: () => unavailable("session.append"),
155
155
  sessionSend: () => unavailable("session.send"),
156
156
  sessionCompact: () => unavailable("session.compact"),
157
+ promptSubmit: () => unavailable("prompt.submit"),
157
158
  });
158
159
  legMods.bindFacade({
159
160
  ...seats,
@@ -749,11 +749,11 @@ export interface Prepared {
749
749
  * (they consult it at harvest time themselves — this accessor serves observers/tests).
750
750
  */
751
751
  pollution: {
752
- polluted: () => {
752
+ polluted: () => Promise<{
753
753
  at: number;
754
754
  reason: string;
755
755
  cause?: import("../memory-engine/types.js").MemoryOriginCause;
756
- } | undefined;
756
+ } | undefined>;
757
757
  /** `cause` is the structured mechanical fact the mark records (and the
758
758
  * origin marker minted off it carries): `"observed"` for a witnessed external event,
759
759
  * `"static"` for the capability over-approximation, `"derived"` for recall-taint. Absent
@@ -774,10 +774,9 @@ export interface Prepared {
774
774
  * default): an `"off"` deployment keeps the pre-336 accepted-cost posture byte-level.
775
775
  */
776
776
  settlement?: {
777
- /** The WRITE plane's governance store (the settlement / lineage / challenge documents). */
778
- governance: import("../memory-engine/types.js").MemoryGovernanceDocs;
779
- /** The WRITE plane's control-plane dir (the pollution marker and hold custody files). */
780
- controlDir: string;
777
+ /** The WRITE plane's governance store (the settlement / lineage / challenge documents and the pollution
778
+ * marker a settled delegation's effects reach). */
779
+ governance: import("../memory-engine/types.js").MemoryGovernanceStore;
781
780
  sessionId: string;
782
781
  provenance: "carry";
783
782
  };
@@ -2077,8 +2076,9 @@ export interface RunInternals {
2077
2076
  rootSessionId?: string;
2078
2077
  /** The occupant of {@link rootSessionId}'s row (`SessionMetadata.incarnation`) as the tree's root run acquired it — the
2079
2078
  * other half of the root anchor's ADDRESS, carried beside it by the same fixed point (the spawner passes its own
2080
- * `ctx.rootSessionIncarnation`). Absent = unknown: a revival, a resume or a wake (the row records no root occupant) and a
2081
- * row written before occupants were minted; a frame the notification lane escalates to the root anchor is then addressed
2079
+ * `ctx.rootSessionIncarnation`; a background spawn persists it on its row, `BackgroundAgentRecord.rootSessionIncarnation`, and a
2080
+ * revival reads it back with the anchor). Absent = unknown: a revival of a row that recorded none and a row written before
2081
+ * occupants were minted; a frame the notification lane escalates to the root anchor is then addressed
2082
2082
  * to an unknown occupant, which a root holding a token is not. TRUSTED run-scoped channel (never a TaskSpec field). */
2083
2083
  rootSessionIncarnation?: string;
2084
2084
  /** The delegation tree's owner seat ({@link import("./delegation-owner.js").DelegationOwnerSeat}): a fixed point like
@@ -3009,7 +3009,7 @@ export interface RunnerSelfSeat {
3009
3009
  */
3010
3010
  export type PrepareTaskFn = (spec: TaskSpec, deps: RunnerDeps, sessions: SessionStore, resume?: PrepareResume, internals?: RunInternals, runnerSelf?: RunnerSelfSeat, runIdSink?: {
3011
3011
  runId?: string;
3012
- }, holdSessionLock?: (sessionId: string) => Promise<void>, legWrites?: LegWrites) => Promise<Prepared>;
3012
+ }, holdSessionLock?: (sessionId: string) => Promise<void>, legWrites?: LegWrites, noticeDestinations?: import("../task-notification.js").NoticeDestinationJudge, promptSubmitRef?: import("../input-author.js").PromptSubmitRef) => Promise<Prepared>;
3013
3013
  /** One leg's view of the Runner's session write ledger (`session-write-ledger.ts`): `issue` starts a write of the leg (`what` = the
3014
3014
  * entry type, for a report) or refuses it once `close` ran — the leg's hold ended; a write still in flight is reported when it settles. */
3015
3015
  export interface LegWrites {
@@ -22,14 +22,6 @@ export type DelegationOwnerReading = {
22
22
  export interface DelegationOwnerSeat {
23
23
  read(): Promise<DelegationOwnerReading>;
24
24
  }
25
- /**
26
- * Whether two readings of one session id's occupant cell (`SessionMetadata.incarnation`, `undefined` = no token) name the occupant a
27
- * run holds: the same token, or no token on either side (a row written before occupants were minted, taken as it reads — a row
28
- * created again under the id is minted a token, so it never reads as the one before it). A token on one side only is another
29
- * occupant. The one reading of this question for a run's own seats: the tree owner below and the session address a frame is
30
- * delivered to (`task-notification.ts`).
31
- */
32
- export declare function sameOccupant(held: string | undefined, current: string | undefined): boolean;
33
25
  /**
34
26
  * The seat of a run nobody spawned: the owner of the row it acquired, read by id through its own store's {@link SessionStore.headOf}
35
27
  * and taken only while the row's occupant is the one acquired ({@link sameOccupant} of the head's `incarnation` and the acquired
@@ -1,12 +1,10 @@
1
+ import { sameOccupant } from "../../engine/session/repo-utils.js";
1
2
  function ownerCellReading(sessionId, head) {
2
3
  const owner = head.owner;
3
4
  if (owner === null || typeof owner === "string")
4
5
  return { bound: true, owner };
5
6
  return { bound: false, reason: `the session ${sessionId}'s row answers an owner that is neither a name nor anonymous (${owner === undefined ? "none" : typeof owner})` };
6
7
  }
7
- export function sameOccupant(held, current) {
8
- return held === current;
9
- }
10
8
  export function ownRowDelegationOwner(sessions, sessionId, acquiredIncarnation) {
11
9
  let settled;
12
10
  let inFlight;
@@ -1,5 +1,5 @@
1
1
  import { DENIED_BY_MAY_ECHO, screenGateOutcome, SETTLEMENT_IS_REFUSAL } from "../gate-outcome.js";
2
- import { askFaceOf, classifyAsk, headlessApprovalRemedy } from "../ask-origin.js";
2
+ import { askFaceOf, classifyAsk, headlessApprovalRemedy, unresolvedAskDenialMessage, unresolvedAskQuestionOf } from "../ask-origin.js";
3
3
  import { wireOf } from "../tool-name-readings.js";
4
4
  import { isProtectedWrite } from "../tool-registry.js";
5
5
  import { attestationOf, decisionText, foldHookAsk, licenseCovers } from "../tool-policy.js";
@@ -220,6 +220,12 @@ function withParkFailureCause(reason, parkFailed, nobodyJudged) {
220
220
  const note = `${reason} — note: a durable approval park was attempted for this call and could not be minted (${inlineUntrusted(parkFailed, PARK_FAILURE_CAUSE_MAX)})`;
221
221
  return nobodyJudged ? `${note}; with nobody to judge the call, that is why it stopped — it can be issued again once its park can be minted.` : `${note}.`;
222
222
  }
223
+ function parkFailedBase(text, toolName, cause, parkFailed) {
224
+ if (!parkFailed || (cause !== "no_approver_wired" && cause !== "approver_unavailable"))
225
+ return text;
226
+ const question = unresolvedAskQuestionOf(cause, toolName, text);
227
+ return question === undefined ? text : unresolvedAskDenialMessage(cause, toolName, question, true);
228
+ }
223
229
  export function takeInheritedScreen(pass, read) {
224
230
  if (read?.floated !== undefined)
225
231
  pass.hookAsk = pass.hookAsk !== undefined ? foldHookAsk(pass.hookAsk, read.floated) : read.floated;
@@ -308,7 +314,8 @@ export async function exitGate(pass) {
308
314
  const bindingRefusal = attestationOf(pass.decision, { toolCallId, toolName })?.bindingRefusal;
309
315
  const headless = bindingRefusal !== undefined ? undefined : remedySeat !== undefined ? headlessApprovalRemedy({ mode: input.permissionMode?.(), classification: foldCause !== undefined ? ancestorUnresolvedClassification(pass.req) : pass.askClassification, approverSeat: remedySeat, coveredWrite: isProtectedWrite(pass.req), ...(pass.shellUnplacedOptions !== undefined ? { unplacedOptions: pass.shellUnplacedOptions } : {}) }) : undefined;
310
316
  const remedy = headless?.sentence;
311
- const denyReason = withParkFailureCause(`${decisionText(pass.decision) ?? `tool "${toolName}" denied by policy`}${remedy !== undefined ? ` — ${remedy}` : ""}`, pass.parkFailed, unresolvable !== undefined);
317
+ const base = parkFailedBase(decisionText(pass.decision) ?? `tool "${toolName}" denied by policy`, toolName, unresolvable, pass.parkFailed !== undefined);
318
+ const denyReason = withParkFailureCause(`${base}${remedy !== undefined ? ` — ${remedy}` : ""}`, pass.parkFailed, unresolvable !== undefined);
312
319
  if (unresolvable !== undefined) {
313
320
  const cause = unresolvable;
314
321
  const noticeRemedy = bindingRefusal ?? remedy;
@@ -1,5 +1,5 @@
1
1
  import { brainToRuntime } from "../runtime.js";
2
- import { catalogOfDeps, roleModelIfSet, unheldChainRefusal } from "../roles.js";
2
+ import { catalogOfDeps, resolveTaskModel, roleModelIfSet, unheldChainRefusal } from "../roles.js";
3
3
  import { isAliasModelId, openAiCompatChatSeat } from "../memory-engine/distiller.js";
4
4
  import { runMemoryConsolidationDriver } from "../memory-engine/consolidation-driver.js";
5
5
  import { recommendationUnconsumed } from "../memory-engine/consolidation.js";
@@ -42,7 +42,7 @@ export function resolveMemoryConsolidationDriver(deps) {
42
42
  const runtime = brainToRuntime(deps.brain);
43
43
  chat = async (req) => {
44
44
  const auth = await deps.getApiKeyAndHeaders?.(resolved);
45
- const message = await runtime.completeSimple(resolved, { systemPrompt: req.system, messages: [{ role: "user", content: req.user, timestamp: Date.now() }] }, { temperature: req.temperature, maxTokens: req.maxTokens, apiKey: auth?.apiKey, headers: auth?.headers });
45
+ const message = await runtime.completeSimple(resolved, { systemPrompt: req.system, messages: [{ role: "user", content: req.user, timestamp: Date.now() }] }, { temperature: req.temperature, maxTokens: req.maxTokens, reasoning: resolveTaskModel({ model: resolved }, {}).thinking, apiKey: auth?.apiKey, headers: auth?.headers });
46
46
  if (message.stopReason === "error" || message.stopReason === "aborted") {
47
47
  throw new Error(message.errorMessage ?? `model completion ${message.stopReason}`);
48
48
  }
@@ -494,7 +494,7 @@ export function prepareConfigDoors(input) {
494
494
  unknownClasses: gateDecision.unknownClasses,
495
495
  discardedEnvRaw: gateDecision.discardedEnvRaw,
496
496
  });
497
- const thinking = spec.thinking ?? resolvedRole.thinking ?? model.defaultThinking;
497
+ const thinking = resolvedRole.thinking;
498
498
  const compModel = resolveCompactionModel(spec, deps, "TaskSpec.compactionModel");
499
499
  return {
500
500
  spec,
@@ -77,7 +77,7 @@ export interface PrepareDelegationSurfaceInput {
77
77
  /** borrowed-mutable — the lane's late-bound facts; the SendMessage mount hands the SAME object to its peer seats (identity is
78
78
  * the contract: the wiring station fills `askEffective` later). Not written here. */
79
79
  peerLaneRefs: PeerLaneRefs;
80
- /** borrowed-readonly — the session-box drain's mount judgment (the `ReadInbox` door: a box drained by this leg). */ sessionBox?: import("../task-notification.js").SessionBoxBinding | undefined;
80
+ /** borrowed-readonly — the session-box drain's mount judgment (with the principal inbox's consumer, the `ReadInbox` door: a drain bound on this leg). */ sessionBox?: import("../task-notification.js").SessionBoxBinding | undefined;
81
81
  /** borrowed-mutable — the run's roster builder (`Prepared.tools` is its read face; the writer table is on that field).
82
82
  * Writers here: the seven mounts (TaskStop, SendMessage, AgentTranscript, ListAgents, Monitor, the worktree
83
83
  * pair, the offload reader), every one a `mount`. */
@@ -1,6 +1,6 @@
1
1
  import { createAgentTranscriptTool, AGENT_TRANSCRIPT_TOOL_NAME } from "../../agents/agent-transcript-tool.js";
2
2
  import { createSendMessageTool, SEND_MESSAGE_TOOL_NAME } from "../../agents/send-message-tool.js";
3
- import { listAgentsMountable, mountListAgents, peerLaneSendMessageSeats, terminalsDrainPrincipalInbox } from "../../agents/peer-session-drain.js";
3
+ import { listAgentsMountable, mountListAgents, peerDrainLanesOf, peerLaneSendMessageSeats } from "../../agents/peer-session-drain.js";
4
4
  import { resolvePeerLaneConfig } from "../../agents/peer-admission.js";
5
5
  import { createReadInboxTool, READ_INBOX_TOOL_NAME } from "../../agents/read-inbox-tool.js";
6
6
  import { valveLeaves } from "../../agents/tool-filter.js";
@@ -81,8 +81,10 @@ export function prepareDelegationSurface(input) {
81
81
  }
82
82
  }
83
83
  }
84
- if (sessionBox !== undefined && internals?.onTaskNotification !== undefined && leaves({ name: READ_INBOX_TOOL_NAME }) && !(spec.tools ?? []).some((t) => t.name === READ_INBOX_TOOL_NAME)) {
85
- roster.mount(firstPartyOffload(createReadInboxTool({ pull: () => peerLaneRefs.pull, ...(terminalsDrainPrincipalInbox(deps) ? { coversPrincipalInbox: true } : {}) })), { source: "builtin", mountedBy: "peerLane" });
84
+ const drainLanes = internals?.onTaskNotification !== undefined ? peerDrainLanesOf(deps, { sessionBox, hostTaskId, sessionId }) : undefined;
85
+ if (drainLanes !== undefined && leaves({ name: READ_INBOX_TOOL_NAME }) && !(spec.tools ?? []).some((t) => t.name === READ_INBOX_TOOL_NAME)) {
86
+ const covers = drainLanes.principalInbox === undefined ? {} : { coversPrincipalInbox: drainLanes.principalInbox === "pullOnly" ? "pullOnly" : true };
87
+ roster.mount(firstPartyOffload(createReadInboxTool({ pull: () => peerLaneRefs.pull, ...covers })), { source: "builtin", mountedBy: "peerLane" });
86
88
  }
87
89
  const listAgents = (peerLaneActive || delegationSurfaceActive) && peerSendMessageBuiltIn && listAgentsMountable({ leaves, specTools: spec.tools ?? [] }) ? mountListAgents({ ...(peerLaneActive ? { peerDirectory: deps.peerDirectory } : {}), freshWindowMs: resolvePeerLaneConfig(deps.peerLane, deps.onNotice).listingFreshWindowMs, sessionId, scope: taskScope, hostTaskId, ...(internals?.parentTaskId !== undefined ? { parentTaskId: internals.parentTaskId } : {}), ...(internals?.parentSessionId !== undefined ? { parentSessionId: internals.parentSessionId } : {}), registry: defaultTaskRegistry, ...(deps.rosterStore !== undefined ? { roster: deps.rosterStore } : {}), ...(sendMessageTier !== undefined ? { continuationTier: sendMessageTier } : {}), ...(checkpointSeat !== undefined ? { readSeats: { checkpointSeat } } : {}), specTools: spec.tools ?? [] }) : undefined;
88
90
  if (listAgents !== undefined)
@@ -35,7 +35,8 @@ import { type HookEnvCapabilities, type HookInvocationIdentity } from "../hooks.
35
35
  import type { ToolPolicy } from "../tool-policy.js";
36
36
  import { type GateOutcome } from "../gate-outcome.js";
37
37
  import type { RunnerDeps, TaskSpec } from "../types.js";
38
- import type { NoticeAddress } from "../leg-identity.js";
38
+ import type { NoticeRoute } from "../leg-identity.js";
39
+ import type { NoticeDestinationJudge } from "../task-notification.js";
39
40
  import { type WiringManifest } from "../wiring-manifest.js";
40
41
  import type { WriteProtectionCheck } from "../write-protect.js";
41
42
  import type { ShellReadCheck } from "../../tools/fs/shell-read-check.js";
@@ -153,10 +154,12 @@ export interface PrepareGateStationsInput {
153
154
  hostTaskId: string;
154
155
  /** borrowed-readonly — the acquired session id (the settlement defects' error tag). */
155
156
  sessionId: string;
156
- /** borrowed-readonly — where this station's user-face notices are addressed (`noticeAddressOf`, minted once per leg beside the
157
- * ask source): the leg's own session on a top-level leg; the delegation tree's root, naming this leg, on a delegated one —
158
- * every notice below spreads it in place of the bare session id. */
159
- noticeAddress: NoticeAddress;
157
+ /** borrowed-readonly — where this station's user-face notices go (`noticeAddressOf`, minted once per leg beside the ask
158
+ * source): the leg's own session on a top-level leg; the delegation tree's root, naming this leg, on a delegated one — every
159
+ * notice below spreads its `address` in place of the bare session id, and is delivered under {@link legNoticeAdmission}. */
160
+ noticeRoute: NoticeRoute;
161
+ /** borrowed-readonly — the Runner's judge of a notice routed to the tree's root (absent outside a Runner). */
162
+ noticeDestinations: NoticeDestinationJudge | undefined;
160
163
  /** borrowed-readonly — the hand's live tracked cwd, or undefined; `current` is read per screening / per post seat. Not
161
164
  * written here. */
162
165
  handsCwdRef: CwdRef | undefined;
@@ -49,8 +49,16 @@ export function maybeHumanRejectionHalt(input) {
49
49
  },
50
50
  };
51
51
  }
52
+ function legNoticeAdmission(route, judge) {
53
+ const { address, destination } = route;
54
+ if (destination === undefined || judge === undefined)
55
+ return undefined;
56
+ return (notice) => judge(destination, { taskId: address.agentId ?? address.sourceSessionId ?? address.sessionId, taskType: notice.code }) !== true;
57
+ }
52
58
  export function prepareGateStations(input) {
53
- const { askLane, parkAsk, tools, toolRosterDeltas, deps, toolCallGateArmedRef, effectivePolicy, egressTools, irreversibleTools, spec, complianceDenies, harness, blockedToolCalls, inheritedAskGrants, inheritedUnavailableAsks, foldAskClasses, ancestorSandboxAdmissions, preToolContexts, toolOccurrences, batchHaltRef, blockedTracked, hookIdentity, reminderMark, hostTaskId, sessionId, noticeAddress, handsCwdRef, stampCallTarget, hookEnvFace, writeProtectionCheck, shellReadCheck, crossBoundaryCheck, readFace, irreversibilityTier, reversibilityProbes, abortController, shellGatedTools, autoModeDecider, autoModeDenialTracking, askRoute, permissionMode, toolMarkSources, a2aIsolatePeers, ancestorArbitrations, runId, stopForDenialLimit, permissionRuleLane, permissionRuleOrgLane, questionToolMounted, sandboxAdmissionArmed, sandboxBoundaryCapable, emitSandboxAdmitted, delegation, frameSettlement, seatInputsFor, modBus, inheritedInstallations } = input;
59
+ const { askLane, parkAsk, tools, toolRosterDeltas, deps, toolCallGateArmedRef, effectivePolicy, egressTools, irreversibleTools, spec, complianceDenies, harness, blockedToolCalls, inheritedAskGrants, inheritedUnavailableAsks, foldAskClasses, ancestorSandboxAdmissions, preToolContexts, toolOccurrences, batchHaltRef, blockedTracked, hookIdentity, reminderMark, hostTaskId, sessionId, noticeRoute, noticeDestinations, handsCwdRef, stampCallTarget, hookEnvFace, writeProtectionCheck, shellReadCheck, crossBoundaryCheck, readFace, irreversibilityTier, reversibilityProbes, abortController, shellGatedTools, autoModeDecider, autoModeDenialTracking, askRoute, permissionMode, toolMarkSources, a2aIsolatePeers, ancestorArbitrations, runId, stopForDenialLimit, permissionRuleLane, permissionRuleOrgLane, questionToolMounted, sandboxAdmissionArmed, sandboxBoundaryCapable, emitSandboxAdmitted, delegation, frameSettlement, seatInputsFor, modBus, inheritedInstallations } = input;
60
+ const noticeAddress = noticeRoute.address;
61
+ const admitsLegNotice = legNoticeAdmission(noticeRoute, noticeDestinations);
54
62
  const releasesAnnounced = new Map();
55
63
  const onModeReleased = (info) => {
56
64
  const table = info.readUnestablished === true ? input.readDenyInForce(info.toolCallId) : undefined;
@@ -60,7 +68,7 @@ export function prepareGateStations(input) {
60
68
  code: "permission.read_deny_unapplied",
61
69
  message: `the ${info.release.mode} permission mode released "${info.toolName}" although a read-deny table is in force (${named}): the read boundary could not establish what this command reads, so no row of the table was applied to it`,
62
70
  detail: { mode: info.release.mode, toolCallId: info.toolCallId, tiers: [...table.tiers], rows: table.rows.slice(0, 8), rowCount: table.rows.length, ...noticeAddress, runId },
63
- });
71
+ }, admitsLegNotice);
64
72
  }
65
73
  const key = `${info.release.mode}\u0000${info.release.askClass}`;
66
74
  const count = (releasesAnnounced.get(key) ?? 0) + 1;
@@ -71,7 +79,7 @@ export function prepareGateStations(input) {
71
79
  code: "permission.ask_released_by_mode",
72
80
  message: `the ${info.release.mode} permission mode released a ${info.release.askClass} ask on "${info.toolName}" without putting it to anyone (further releases of this pair in this run ride each call's tool_end.gate.disposition.released)`,
73
81
  detail: { mode: info.release.mode, askClass: info.release.askClass, ...(info.release.origin !== undefined ? { origin: info.release.origin } : {}), ...(info.release.mandate !== undefined ? { mandate: info.release.mandate } : {}), count, firstToolCallId: info.toolCallId, ...noticeAddress, runId },
74
- });
82
+ }, admitsLegNotice);
75
83
  };
76
84
  if (askLane !== undefined && parkAsk !== undefined) {
77
85
  const { adjudicate, resolveAskBound, notifyPermissionDenied, notifyHookError } = askLane;
@@ -140,7 +148,7 @@ export function prepareGateStations(input) {
140
148
  abortSignal: abortController.signal,
141
149
  onHookError: notifyHookError,
142
150
  shellGated: tierSeat?.shellGated(shellGatedTools, toolMarkSources) === true,
143
- ...(autoModeDecider.current !== undefined ? { autoMode: { decider: autoModeDecider.current, ...(autoModeDenialTracking.current !== undefined ? { denialTracking: autoModeDenialTracking.current } : {}), unavailable: classifierUnavailableSeat({ station: "leg", ...(autoModeDecider.current.timeoutMs !== undefined ? { budgetMs: autoModeDecider.current.timeoutMs } : {}), route: approvalRouteOf(askRoute), onNotice: deps.onNotice, ...noticeAddress, runId }) } } : {}),
151
+ ...(autoModeDecider.current !== undefined ? { autoMode: { decider: autoModeDecider.current, ...(autoModeDenialTracking.current !== undefined ? { denialTracking: autoModeDenialTracking.current } : {}), unavailable: classifierUnavailableSeat({ station: "leg", ...(autoModeDecider.current.timeoutMs !== undefined ? { budgetMs: autoModeDecider.current.timeoutMs } : {}), route: approvalRouteOf(askRoute), onNotice: deps.onNotice, admission: admitsLegNotice, ...noticeAddress, runId }) } } : {}),
144
152
  permissionMode: () => permissionMode.current, askSeatForm: askRoute.form,
145
153
  ...(markSources.size > 0 ? { toolMarkSources: markSources } : {}),
146
154
  ...seatInputsFor(e.toolName, wireOf("gate.skillActivationSeat", call)),
@@ -149,7 +157,7 @@ export function prepareGateStations(input) {
149
157
  onModeReleased,
150
158
  ancestorArbitrationOf: (toolCallId) => ancestorArbitrations.get(toolCallId),
151
159
  onHeadlessDenialLimit: stopForDenialLimit,
152
- onAskUnresolvable: (info) => deliverEngineNotice(deps.onNotice, askUnresolvableNotice({ ...noticeAddress, ...info })),
160
+ onAskUnresolvable: (info) => deliverEngineNotice(deps.onNotice, askUnresolvableNotice({ ...noticeAddress, ...info }), admitsLegNotice),
153
161
  ...(permissionRuleLane
154
162
  ? {
155
163
  persistedRules: {
@@ -9,6 +9,7 @@ import { declaresSubagentPlacement } from "../session.js";
9
9
  import { performsIo } from "../remote-env.js";
10
10
  import { durableMandateSourceOf } from "../tool-policy.js";
11
11
  import { chainAnchorRecords } from "./child-tree.js";
12
+ import { defaultTaskRegistry } from "../task-registry.js";
12
13
  import { deliverEngineNotice } from "../types.js";
13
14
  import { PermissionModeController, autoModeFaceOf, modeRequestAfterResume } from "../mode-policy.js";
14
15
  import { SessionModeSeats } from "./session-mode-seats.js";
@@ -250,6 +251,7 @@ export function prepareInheritedGate(input) {
250
251
  ...(spec.durableApproval !== undefined ? { durableApprovalForChildren: { ...spec.durableApproval } } : {}),
251
252
  ...(input.checkpointSeat !== undefined ? { checkpointStoreForChildren: input.checkpointSeat } : {}),
252
253
  checkpointScopeForChildren: input.checkpointScope,
254
+ taskRegistry: defaultTaskRegistry,
253
255
  taskId: hostTaskId,
254
256
  ...(internals?.parentTaskId !== undefined ? { parentTaskId: internals.parentTaskId } : {}),
255
257
  ...(internals?.parentSessionId !== undefined ? { parentSessionId: internals.parentSessionId } : {}),
@@ -30,7 +30,7 @@ export function prepareMemoryEngineSession(input) {
30
30
  onNotice: deps.onNotice,
31
31
  });
32
32
  if (memoryEngineSession?.settlement !== undefined) {
33
- delegationSettlementRef.current = { governance: memoryEngineSession.settlement.governance, controlDir: memoryEngineSession.settlement.controlDir, sessionId: memoryEngineSession.settlement.sessionId };
33
+ delegationSettlementRef.current = { governance: memoryEngineSession.settlement.governance, sessionId: memoryEngineSession.settlement.sessionId };
34
34
  }
35
35
  const recordExternal = () => {
36
36
  if (delegationProvenanceChannel !== undefined)