@sema-agent/core 7.71.1 → 7.72.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 (151) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/dist/agents/cross-session-ref.d.ts +2 -2
  3. package/dist/agents/cross-session-ref.js +7 -2
  4. package/dist/agents/inherited-tool-pool.d.ts +4 -1
  5. package/dist/agents/inherited-tool-pool.js +7 -5
  6. package/dist/agents/send-message-tool.js +6 -2
  7. package/dist/agents/subagent.js +5 -1
  8. package/dist/agents/verify.js +1 -0
  9. package/dist/core/a2a.d.ts +24 -3
  10. package/dist/core/a2a.js +27 -8
  11. package/dist/core/agent-state.d.ts +28 -7
  12. package/dist/core/agent-state.js +19 -6
  13. package/dist/core/approval-object.d.ts +7 -3
  14. package/dist/core/approval-object.js +30 -9
  15. package/dist/core/checkpoint-features.d.ts +13 -3
  16. package/dist/core/checkpoint-features.js +34 -5
  17. package/dist/core/checkpoint-row-verdict.d.ts +1 -1
  18. package/dist/core/checkpoint-row-verdict.js +3 -3
  19. package/dist/core/effective-path-target.d.ts +19 -0
  20. package/dist/core/effective-path-target.js +95 -38
  21. package/dist/core/engine-notice.d.ts +4 -1
  22. package/dist/core/engine-version.js +1 -1
  23. package/dist/core/file-history-store.d.ts +15 -4
  24. package/dist/core/file-history-store.js +53 -23
  25. package/dist/core/gate-fold.js +3 -1
  26. package/dist/core/governance-codes.d.ts +4 -1
  27. package/dist/core/governance-codes.js +4 -0
  28. package/dist/core/judged-read.d.ts +57 -0
  29. package/dist/core/judged-read.js +1 -0
  30. package/dist/core/mcp-host-seat.d.ts +5 -0
  31. package/dist/core/mcp-host-seat.js +7 -1
  32. package/dist/core/mcp.js +3 -1
  33. package/dist/core/memory-engine/index.d.ts +1 -1
  34. package/dist/core/memory-engine/index.js +1 -1
  35. package/dist/core/memory-engine/layout.js +6 -4
  36. package/dist/core/memory-engine/scope-contract.d.ts +59 -6
  37. package/dist/core/memory-engine/scope-contract.js +90 -25
  38. package/dist/core/mounted-mcp.d.ts +7 -2
  39. package/dist/core/mounted-mcp.js +10 -1
  40. package/dist/core/param-rule-reach.d.ts +8 -3
  41. package/dist/core/param-rule-reach.js +9 -1
  42. package/dist/core/parent-spec-seat.d.ts +11 -1
  43. package/dist/core/parent-spec-seat.js +14 -0
  44. package/dist/core/peer-registration.d.ts +52 -0
  45. package/dist/core/peer-registration.js +37 -0
  46. package/dist/core/peer-seat.d.ts +3 -1
  47. package/dist/core/permission-rule-model.js +1 -1
  48. package/dist/core/runner/chain-mismatch.d.ts +32 -0
  49. package/dist/core/runner/chain-mismatch.js +29 -0
  50. package/dist/core/runner/changes-history.d.ts +1 -0
  51. package/dist/core/runner/changes-history.js +2 -2
  52. package/dist/core/runner/contracts.d.ts +3 -0
  53. package/dist/core/runner/file-history-restore.d.ts +3 -1
  54. package/dist/core/runner/file-history-restore.js +9 -6
  55. package/dist/core/runner/loaded-skills.d.ts +2 -0
  56. package/dist/core/runner/loaded-skills.js +10 -0
  57. package/dist/core/runner/person-path-rows.d.ts +2 -4
  58. package/dist/core/runner/person-path-rows.js +2 -3
  59. package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -0
  60. package/dist/core/runner/prepare-caps-and-workflow.js +7 -2
  61. package/dist/core/runner/prepare-file-history.js +1 -1
  62. package/dist/core/runner/prepare-hands-readface.d.ts +5 -0
  63. package/dist/core/runner/prepare-hands-readface.js +24 -21
  64. package/dist/core/runner/prepare-inherited-gate.d.ts +2 -2
  65. package/dist/core/runner/prepare-inherited-gate.js +1 -1
  66. package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -2
  67. package/dist/core/runner/prepare-memory-engine-session.js +2 -2
  68. package/dist/core/runner/prepare-memory.js +3 -15
  69. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  70. package/dist/core/runner/prepare-project-context.js +3 -7
  71. package/dist/core/runner/prepare-protocol-tools.d.ts +5 -0
  72. package/dist/core/runner/prepare-protocol-tools.js +2 -2
  73. package/dist/core/runner/prepare-task.js +20 -16
  74. package/dist/core/runner/prepare-wiring-manifest.d.ts +2 -0
  75. package/dist/core/runner/prepare-wiring-manifest.js +4 -3
  76. package/dist/core/runner/read-session-changes.js +1 -1
  77. package/dist/core/runner/resume-checkpoint-screen.d.ts +8 -7
  78. package/dist/core/runner/resume-checkpoint-screen.js +7 -6
  79. package/dist/core/runner/rewind-files.js +3 -2
  80. package/dist/core/runner/run-leg.js +6 -2
  81. package/dist/core/runner/terminal-account.d.ts +4 -0
  82. package/dist/core/runner/terminal-account.js +7 -2
  83. package/dist/core/runner/tool-face-overlay.d.ts +2 -11
  84. package/dist/core/runner/tool-face-overlay.js +39 -0
  85. package/dist/core/runner/trim-stretch.js +7 -2
  86. package/dist/core/scheduler.d.ts +47 -7
  87. package/dist/core/scheduler.js +19 -7
  88. package/dist/core/secret-env.d.ts +7 -0
  89. package/dist/core/secret-env.js +1 -1
  90. package/dist/core/sensitive-path-policy.js +14 -7
  91. package/dist/core/shell-read-silence.js +1 -0
  92. package/dist/core/store-contracts/checkpoint-store-contract.js +7 -0
  93. package/dist/core/task-event.d.ts +4 -3
  94. package/dist/core/task-notification.d.ts +2 -1
  95. package/dist/core/task-spec.d.ts +13 -5
  96. package/dist/core/tool-catalog-entries.js +2 -0
  97. package/dist/core/tool-face-reader.js +1 -1
  98. package/dist/core/tool-face.d.ts +7 -0
  99. package/dist/core/tool-face.js +1 -0
  100. package/dist/core/tool-mount-facts.d.ts +4 -2
  101. package/dist/core/tool-mount-facts.js +3 -3
  102. package/dist/core/tool-mount-plan.d.ts +4 -2
  103. package/dist/core/tool-mount-plan.js +5 -5
  104. package/dist/core/tool-mount-static.d.ts +1 -1
  105. package/dist/core/tool-mount-static.js +25 -13
  106. package/dist/core/tool-registry.d.ts +33 -1
  107. package/dist/core/tool-registry.js +33 -0
  108. package/dist/core/tool-roster.d.ts +16 -0
  109. package/dist/core/tool-roster.js +6 -0
  110. package/dist/core/tool-spec.d.ts +4 -2
  111. package/dist/core/tools.d.ts +6 -0
  112. package/dist/core/tools.js +1 -1
  113. package/dist/core/wiring-manifest.d.ts +66 -12
  114. package/dist/core/wiring-manifest.js +37 -1
  115. package/dist/engine/harness/messages.d.ts +1 -1
  116. package/dist/engine/harness/messages.js +2 -1
  117. package/dist/engine/loop/types.d.ts +2 -0
  118. package/dist/engine/session/session.js +1 -1
  119. package/dist/index.d.ts +9 -5
  120. package/dist/index.js +7 -4
  121. package/dist/orchestration/workflow.js +2 -1
  122. package/dist/stores/file/adoption/marker.d.ts +2 -27
  123. package/dist/stores/file/adoption/marker.js +12 -0
  124. package/dist/stores/file/index.d.ts +1 -1
  125. package/dist/stores/file/index.js +1 -1
  126. package/dist/tools/artifact/artifact-tool.js +11 -6
  127. package/dist/tools/fs/file-read-check.d.ts +45 -11
  128. package/dist/tools/fs/file-read-check.js +200 -57
  129. package/dist/tools/fs/judged-reads.d.ts +51 -0
  130. package/dist/tools/fs/judged-reads.js +68 -0
  131. package/dist/tools/fs/safety.d.ts +8 -0
  132. package/dist/tools/fs/safety.js +12 -1
  133. package/dist/tools/fs/shell-read-check.d.ts +16 -3
  134. package/dist/tools/fs/shell-read-check.js +4 -1
  135. package/dist/tools/fs/shell-read-establish.js +13 -3
  136. package/dist/tools/scheduler-store-move.d.ts +74 -0
  137. package/dist/tools/scheduler-store-move.js +103 -0
  138. package/dist/tools/scheduler-tools.d.ts +43 -29
  139. package/dist/tools/scheduler-tools.js +161 -118
  140. package/package.json +2 -2
  141. package/test/export-surface.snapshot.json +43 -3
  142. package/wire-changes/answers/core-stores-sql@7.72.0.json +12 -0
  143. package/wire-changes/answers/core@7.72.0.json +84 -0
  144. package/wire-changes/answers/mods-kernel@7.72.0.json +7 -0
  145. package/wire-changes/answers/primitives@7.72.0.json +6 -0
  146. package/wire-changes/answers/wiki-gate@7.72.0.json +7 -0
  147. package/wire-changes/core-stores-sql@7.72.0.json +215 -0
  148. package/wire-changes/core@7.72.0.json +2426 -0
  149. package/wire-changes/mods-kernel@7.72.0.json +147 -0
  150. package/wire-changes/primitives@7.72.0.json +143 -0
  151. package/wire-changes/wiki-gate@7.72.0.json +145 -0
@@ -1,17 +1,18 @@
1
1
  import { Type } from "typebox";
2
2
  import { defineTool, errorResult } from "../core/tools.js";
3
3
  import { CRON_FIELD_SEPARATOR, cronIntakeRefusal } from "../core/cron.js";
4
- import { hasScheduler, SchedulerError, } from "../core/scheduler.js";
4
+ import { declaresLaneKeys, describeScopeKeys, readSchedulerDeclaration, SchedulerError, } from "../core/scheduler.js";
5
5
  import { mountRuleFace, toolFace } from "../core/tool-catalog-entries.js";
6
- import { ANONYMOUS_SCOPE, isolationScopeOf, legIdentityOf, scopeKeyOf } from "../core/isolation-scope.js";
6
+ import { legIdentityOf, scopeKeyOf } from "../core/isolation-scope.js";
7
7
  import { envErrorDetail } from "./fs/env-error-detail.js";
8
8
  import { codedRefusal } from "../core/thrown-value.js";
9
9
  import { describeRejectedValue } from "../core/tool-search-setting.js";
10
10
  import { isValidTimeZone } from "../prompts/default.js";
11
+ import { deliverEngineNotice } from "../core/engine-notice.js";
11
12
  export const SCHEDULE_WAKEUP_TOOL_NAME = "ScheduleWakeup";
12
13
  export const AUTONOMOUS_LOOP_SENTINEL = "<<autonomous-loop>>";
13
14
  export const AUTONOMOUS_LOOP_DYNAMIC_SENTINEL = "<<autonomous-loop-dynamic>>";
14
- const WAKEUP_LABEL = "loop-wakeup";
15
+ export const WAKEUP_LABEL = "loop-wakeup";
15
16
  const SCHEDULE_WAKEUP_PROMPT = `Schedule when to resume work in /loop dynamic mode — the user invoked /loop without an interval, asking you to self-pace iterations of a specific task.
16
17
 
17
18
  A wakeup only fires while THIS session is alive — it does not survive the session's end (a single-shot headless run ends when your final answer lands, taking pending wakeups with it). Do not park deliverable-producing work behind a wakeup near the end of a task; finish it, or start it in a self-detaching form.
@@ -36,55 +37,71 @@ The runtime clamps to [60, 3600], so you don't need to clamp yourself.
36
37
 
37
38
  One short sentence on what you chose and why. Goes to telemetry and is shown back to the user. "watching CI run" beats "waiting." The user reads this to understand what you're doing without having to predict your cadence in advance — make it specific.
38
39
  `;
39
- function durableScopeOf(c) {
40
- return scopeKeyOf(c);
41
- }
42
- function toSchedulerContext(c, scope) {
40
+ function toSchedulerContext(c, scope, sessionId) {
43
41
  const person = legIdentityOf(c).principal;
44
42
  return {
45
43
  scope,
46
44
  ...(person !== undefined ? { principal: person } : {}),
47
- ...(c.sessionId !== undefined ? { sessionId: c.sessionId } : {}),
45
+ ...(sessionId !== undefined ? { sessionId: sessionId } : {}),
48
46
  ...(c.taskConfig !== undefined ? { taskConfig: c.taskConfig } : {}),
49
47
  ...(c.timeZone !== undefined ? { timeZone: c.timeZone } : {}),
50
48
  };
51
49
  }
52
- function laneKeyRefusal(member, value) {
53
- return codedRefusal("config.invalid_argument", `${member} is ${describeRejectedValue(value)}, not a non-empty string — a scheduler lane needs a key that names whose entries it reads. Derive the lanes from the session or run the host has verified (schedulerLanesOf over a context whose scope comes from sessionLaneScopeOf).`);
50
+ export function laneKeyOf(lane, owner) {
51
+ return `${lane}:${owner}`;
52
+ }
53
+ function laneScopeOf(lane, owner) {
54
+ return typeof owner === "string" ? laneKeyOf(lane, owner) : owner;
55
+ }
56
+ export function isLaneKey(lane, scope) {
57
+ return typeof scope === "string" && scope.length > lane.length + 1 && scope.startsWith(`${lane}:`);
58
+ }
59
+ function laneKeyRefusal(lane, value) {
60
+ return codedRefusal("config.invalid_argument", `the ${lane} lane's scope is ${describeRejectedValue(value)}, not \`${lane}:\` followed by a non-empty owner — a scheduler lane needs a key that names whose entries it reads. Derive the lanes with schedulerLanesOf from the session or run the host has verified.`);
54
61
  }
55
62
  function checkedLanes(lanes) {
56
- for (const member of ["session", "durable"]) {
57
- const scope = lanes?.[member]?.scope;
58
- if (typeof scope !== "string" || scope === "")
59
- throw laneKeyRefusal(`the ${member} lane's scope`, scope);
60
- }
63
+ const held = lanes;
64
+ const session = held?.session;
65
+ if (session !== undefined && !isLaneKey("session", session?.scope))
66
+ throw laneKeyRefusal("session", session?.scope);
67
+ if (!isLaneKey("durable", held?.durable?.scope))
68
+ throw laneKeyRefusal("durable", held?.durable?.scope);
61
69
  return lanes;
62
70
  }
63
- export function sessionLaneScopeOf(c) {
64
- const scope = c.sessionId ?? isolationScopeOf(c) ?? c.taskId ?? ANONYMOUS_SCOPE;
65
- if (typeof scope !== "string" || scope === "")
66
- throw laneKeyRefusal("the session lane's key", scope);
67
- return scope;
68
- }
69
71
  export function schedulerLanesOf(ctx) {
70
- return checkedLanes({ session: toSchedulerContext(ctx, ctx.scope), durable: toSchedulerContext(ctx, durableScopeOf(ctx)) });
72
+ const sessionId = ctx.sessionId;
73
+ return checkedLanes({
74
+ ...(sessionId !== undefined ? { session: toSchedulerContext(ctx, laneScopeOf("session", sessionId), sessionId) } : {}),
75
+ durable: toSchedulerContext(ctx, laneScopeOf("durable", scopeKeyOf(ctx)), sessionId),
76
+ });
71
77
  }
72
- function distinctLanesOf(lanes) {
73
- return lanes.session.scope !== lanes.durable.scope ? [lanes.session, lanes.durable] : [lanes.session];
78
+ function lanesToRead(lanes) {
79
+ return lanes.session !== undefined ? [lanes.session, lanes.durable] : [lanes.durable];
80
+ }
81
+ export function laneOfIntent(intent) {
82
+ return intent.lifetime === "session" || intent.mode === "session-wakeup" ? "session" : "durable";
74
83
  }
75
84
  const UNSUPPORTED = () => ({ ok: false, error: new SchedulerError("unsupported", "this execution environment carries no scheduler seam") });
85
+ const UNMOVED = (capabilities) => ({
86
+ ok: false,
87
+ error: new SchedulerError("unsupported", `this scheduler seam does not declare that its store holds lane keys (schedulerCapabilities.scopeKeys is ${describeScopeKeys(capabilities?.scopeKeys)}, not "lane"): a seam with no store, or a store still filed under bare keys, is read by no lane key. Move such a store once with migrateSchedulerStore and declare scopeKeys: "lane" in the same write.`),
88
+ });
76
89
  function schedulerSeamOf(env) {
77
90
  const e = env;
78
- return typeof e.list === "function" && typeof e.cancel === "function" ? env : undefined;
91
+ if (typeof e.list !== "function" || typeof e.cancel !== "function")
92
+ return { answer: UNSUPPORTED() };
93
+ const capabilities = e.schedulerCapabilities;
94
+ return declaresLaneKeys(capabilities) ? { seam: env } : { answer: UNMOVED(capabilities) };
79
95
  }
80
96
  export async function listScheduled(env, lanes) {
81
- checkedLanes(lanes);
82
- const seam = schedulerSeamOf(env);
83
- if (seam === undefined)
84
- return UNSUPPORTED();
97
+ const judged = checkedLanes(lanes);
98
+ const held = schedulerSeamOf(env);
99
+ if ("answer" in held)
100
+ return held.answer;
101
+ const { seam } = held;
85
102
  const rows = [];
86
103
  const seen = new Set();
87
- for (const lane of distinctLanesOf(lanes)) {
104
+ for (const lane of lanesToRead(judged)) {
88
105
  const listed = await seam.list(lane);
89
106
  if (!listed.ok)
90
107
  return { ok: false, error: listed.error };
@@ -98,11 +115,12 @@ export async function listScheduled(env, lanes) {
98
115
  return { ok: true, value: rows };
99
116
  }
100
117
  export async function cancelScheduled(env, lanes, id) {
101
- checkedLanes(lanes);
102
- const seam = schedulerSeamOf(env);
103
- if (seam === undefined)
104
- return UNSUPPORTED();
105
- const [first, ...others] = await cancelLanesFor(seam, lanes, id);
118
+ const judged = checkedLanes(lanes);
119
+ const held = schedulerSeamOf(env);
120
+ if ("answer" in held)
121
+ return held.answer;
122
+ const { seam } = held;
123
+ const [first, ...others] = await cancelLanesFor(seam, judged, id);
106
124
  let r = await seam.cancel(id, first);
107
125
  for (const lane of others) {
108
126
  if (r.ok || r.error.code !== "not_found")
@@ -112,15 +130,15 @@ export async function cancelScheduled(env, lanes, id) {
112
130
  return r;
113
131
  }
114
132
  async function cancelLanesFor(env, lanes, id) {
115
- const distinct = distinctLanesOf(lanes);
116
- if (distinct.length === 1)
117
- return distinct;
118
- for (const lane of distinct) {
133
+ const read = lanesToRead(lanes);
134
+ if (read.length === 1)
135
+ return read;
136
+ for (const lane of read) {
119
137
  const listed = await env.list(lane);
120
138
  if (listed.ok && listed.value.some((s) => s.id === id))
121
139
  return [lane];
122
140
  }
123
- return distinct;
141
+ return read;
124
142
  }
125
143
  export function cronScheduleError(expr, timeZone = "UTC") {
126
144
  return cronIntakeRefusal(expr, { after: Date.now(), timeZone });
@@ -222,24 +240,110 @@ export function cronToHuman(expr) {
222
240
  return `weekdays at ${time}`;
223
241
  return expr;
224
242
  }
225
- export function createSchedulerTools(env, ctx) {
226
- if (!hasScheduler(env))
243
+ const toldUnmoved = new WeakMap();
244
+ const CONSOLE_SINK = {};
245
+ export function announceSchedulerStoreUnmoved(scheduler, onNotice) {
246
+ if (scheduler.kind !== "unmoved")
247
+ return;
248
+ const declared = describeScopeKeys(scheduler.capabilities.scopeKeys);
249
+ const sink = typeof onNotice === "function" ? onNotice : CONSOLE_SINK;
250
+ let told = toldUnmoved.get(sink);
251
+ if (told === undefined)
252
+ toldUnmoved.set(sink, (told = new Set()));
253
+ const line = JSON.stringify([scheduler.capabilities.supported, declared]);
254
+ if (told.has(line))
255
+ return;
256
+ told.add(line);
257
+ deliverEngineNotice(onNotice, {
258
+ code: "config.scheduler_store_unmoved",
259
+ message: `The scheduler backend does not declare that its store holds lane keys (schedulerCapabilities.scopeKeys is ${declared}, not "lane"), so CronCreate, CronDelete, CronList and ScheduleWakeup are not mounted, and the host readers answer "unsupported" — while the jobs already in the store still fire on schedule, nobody can list or stop them through the engine. Move the store once with migrateSchedulerStore, then declare scopeKeys: "lane" in the same write.`,
260
+ detail: { declared },
261
+ });
262
+ }
263
+ export function createSchedulerTools(env, ctx, scheduler = readSchedulerDeclaration(env)) {
264
+ if (scheduler.kind !== "mounted")
227
265
  return [];
228
- const sched = env;
266
+ const sched = scheduler.seam;
267
+ const caps = scheduler.capabilities;
229
268
  const lanes = schedulerLanesOf(ctx);
230
269
  const sessionCtx = lanes.session;
231
270
  const durableCtx = lanes.durable;
271
+ const schedulerZone = caps.timeZone;
272
+ if (schedulerZone !== undefined && (typeof schedulerZone !== "string" || !isValidTimeZone(schedulerZone))) {
273
+ throw Object.assign(codedRefusal("config.invalid_argument", `SchedulerCapability.schedulerCapabilities.timeZone: ${describeRejectedValue(schedulerZone)} is not a time zone the runtime knows — declare a name \`Intl\` accepts (an IANA name such as "UTC" or "Europe/Berlin"), or leave it out.`), { detail: { field: "SchedulerCapability.schedulerCapabilities.timeZone" } });
274
+ }
232
275
  let cronCreateChain = Promise.resolve();
233
276
  const serializedCronCreateOp = (fn) => {
234
277
  const next = cronCreateChain.then(fn, fn);
235
278
  cronCreateChain = next.then(() => undefined, () => undefined);
236
279
  return next;
237
280
  };
281
+ const cronCancel = defineTool({
282
+ name: "CronDelete",
283
+ ...toolFace("cron-delete"),
284
+ ruleFace: mountRuleFace("cron-delete"),
285
+ description: "Cancel a cron job previously scheduled with CronCreate. Idempotent; ids also appear in CronList.",
286
+ parameters: Type.Object({ id: Type.String({ description: "Job ID returned by CronCreate." }) }),
287
+ execute: async (args) => {
288
+ const { id } = args;
289
+ const r = await cancelScheduled(sched, lanes, id);
290
+ if (!r.ok) {
291
+ if (r.error.code === "not_found")
292
+ return `CronDelete: no scheduled task "${id}" (already gone or not yours).`;
293
+ return errorResult(`Error (CronDelete): ${envErrorDetail(r.error.message)}`);
294
+ }
295
+ return { content: `Cancelled scheduled task ${id}.`, details: { type: "cron-delete", id } };
296
+ },
297
+ });
298
+ const cronList = defineTool({
299
+ name: "CronList",
300
+ ...toolFace("cron-list"),
301
+ ruleFace: mountRuleFace("cron-list"),
302
+ description: "List all cron jobs scheduled via CronCreate (id, when, label, and the first line of the task text when the scheduler has it).",
303
+ parameters: Type.Object({}),
304
+ execute: async () => {
305
+ const listed = await listScheduled(sched, lanes);
306
+ if (!listed.ok)
307
+ return errorResult(`Error (CronList): ${envErrorDetail(listed.error.message)}`);
308
+ const rows = listed.value;
309
+ if (rows.length === 0) {
310
+ return { content: "No scheduled tasks.", details: { type: "cron-list", jobs: [] } };
311
+ }
312
+ const now = Date.now();
313
+ const read = rows.map((s) => ({ s, prompt: promptOf(s) }));
314
+ const content = read
315
+ .map(({ s, prompt }) => {
316
+ const shown = cronExprFromSummary(s.when);
317
+ const human = cronToHuman(s.when);
318
+ const tier = s.lifetime === "session" ? " [session]" : "";
319
+ const once = s.recurring === false ? " [once]" : "";
320
+ const at = nextFireAtOf(s, now);
321
+ const next = at === undefined ? "" : `, next run ${new Date(at).toISOString()}`;
322
+ const text = prompt === undefined ? "" : `: ${promptGlimpse(prompt)}`;
323
+ return `- ${s.id}: ${shown}${human !== s.when ? ` — ${human}` : ""}${s.label ? ` (${s.label})` : ""}${tier}${once}${next}${text}`;
324
+ })
325
+ .join("\n");
326
+ const jobs = read.map(({ s, prompt }) => {
327
+ const human = cronToHuman(s.when);
328
+ const nextFireAt = nextFireAtOf(s, now);
329
+ return {
330
+ id: s.id,
331
+ cron: cronExprFromSummary(s.when),
332
+ humanSchedule: human !== s.when ? human : s.when,
333
+ ...(prompt !== undefined ? { prompt } : {}),
334
+ ...(s.label !== undefined ? { label: s.label } : {}),
335
+ ...(s.recurring !== undefined ? { recurring: s.recurring } : {}),
336
+ ...(s.lifetime !== undefined ? { durable: s.lifetime === "durable" } : {}),
337
+ ...(nextFireAt !== undefined ? { nextFireAt } : {}),
338
+ };
339
+ });
340
+ return { content, details: { type: "cron-list", jobs } };
341
+ },
342
+ });
343
+ if (sessionCtx === undefined)
344
+ return [cronCancel, cronList];
345
+ const laneFor = (intent) => (laneOfIntent(intent) === "session" ? sessionCtx : durableCtx);
238
346
  const userZone = sessionCtx.timeZone !== undefined;
239
- const schedulerZone = sched.schedulerCapabilities.timeZone;
240
- if (schedulerZone !== undefined && (typeof schedulerZone !== "string" || !isValidTimeZone(schedulerZone))) {
241
- throw Object.assign(codedRefusal("config.invalid_argument", `SchedulerCapability.schedulerCapabilities.timeZone: ${describeRejectedValue(schedulerZone)} is not a time zone the runtime knows — declare a name \`Intl\` accepts (an IANA name such as "UTC" or "Europe/Berlin"), or leave it out.`), { detail: { field: "SchedulerCapability.schedulerCapabilities.timeZone" } });
242
- }
243
347
  const cronCreateDescription = `Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders. When a job fires, its \`prompt\` is enqueued into this session as its next input, once the session is idle (not mid-turn). Use CronList to see what you've scheduled, CronDelete to remove one.
244
348
 
245
349
  ## One-shot tasks (schedule kind "delay" or "at")
@@ -318,7 +422,7 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
318
422
  }
319
423
  const durable = a.durable ?? a.schedule !== undefined;
320
424
  if (!durable) {
321
- if (sched.schedulerCapabilities.supportsSessionLifetime !== true) {
425
+ if (caps.supportsSessionLifetime !== true) {
322
426
  return errorResult("Error (CronCreate): this scheduler backend does not support session-scoped jobs (they could not be cleaned up when the session ends). Pass `durable: true` to schedule a persistent job instead.");
323
427
  }
324
428
  }
@@ -329,7 +433,7 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
329
433
  ...(!durable ? { lifetime: "session" } : {}),
330
434
  ...(a.recurring !== undefined ? { recurring: a.recurring } : {}),
331
435
  };
332
- const opCtx = durable ? durableCtx : sessionCtx;
436
+ const opCtx = laneFor(intent);
333
437
  const before = await sched.list(opCtx);
334
438
  const knownIds = before.ok ? new Set(before.value.map((s) => s.id)) : undefined;
335
439
  const r = await sched.schedule(intent, opCtx);
@@ -365,68 +469,6 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
365
469
  };
366
470
  }),
367
471
  });
368
- const cronCancel = defineTool({
369
- name: "CronDelete",
370
- ...toolFace("cron-delete"),
371
- ruleFace: mountRuleFace("cron-delete"),
372
- description: "Cancel a cron job previously scheduled with CronCreate. Idempotent; ids also appear in CronList.",
373
- parameters: Type.Object({ id: Type.String({ description: "Job ID returned by CronCreate." }) }),
374
- execute: async (args) => {
375
- const { id } = args;
376
- const r = await cancelScheduled(sched, lanes, id);
377
- if (!r.ok) {
378
- if (r.error.code === "not_found")
379
- return `CronDelete: no scheduled task "${id}" (already gone or not yours).`;
380
- return errorResult(`Error (CronDelete): ${envErrorDetail(r.error.message)}`);
381
- }
382
- return { content: `Cancelled scheduled task ${id}.`, details: { type: "cron-delete", id } };
383
- },
384
- });
385
- const cronList = defineTool({
386
- name: "CronList",
387
- ...toolFace("cron-list"),
388
- ruleFace: mountRuleFace("cron-list"),
389
- description: "List all cron jobs scheduled via CronCreate (id, when, label, and the first line of the task text when the scheduler has it).",
390
- parameters: Type.Object({}),
391
- execute: async () => {
392
- const listed = await listScheduled(sched, lanes);
393
- if (!listed.ok)
394
- return errorResult(`Error (CronList): ${envErrorDetail(listed.error.message)}`);
395
- const rows = listed.value;
396
- if (rows.length === 0) {
397
- return { content: "No scheduled tasks.", details: { type: "cron-list", jobs: [] } };
398
- }
399
- const now = Date.now();
400
- const read = rows.map((s) => ({ s, prompt: promptOf(s) }));
401
- const content = read
402
- .map(({ s, prompt }) => {
403
- const shown = cronExprFromSummary(s.when);
404
- const human = cronToHuman(s.when);
405
- const tier = s.lifetime === "session" ? " [session]" : "";
406
- const once = s.recurring === false ? " [once]" : "";
407
- const at = nextFireAtOf(s, now);
408
- const next = at === undefined ? "" : `, next run ${new Date(at).toISOString()}`;
409
- const text = prompt === undefined ? "" : `: ${promptGlimpse(prompt)}`;
410
- return `- ${s.id}: ${shown}${human !== s.when ? ` — ${human}` : ""}${s.label ? ` (${s.label})` : ""}${tier}${once}${next}${text}`;
411
- })
412
- .join("\n");
413
- const jobs = read.map(({ s, prompt }) => {
414
- const human = cronToHuman(s.when);
415
- const nextFireAt = nextFireAtOf(s, now);
416
- return {
417
- id: s.id,
418
- cron: cronExprFromSummary(s.when),
419
- humanSchedule: human !== s.when ? human : s.when,
420
- ...(prompt !== undefined ? { prompt } : {}),
421
- ...(s.label !== undefined ? { label: s.label } : {}),
422
- ...(s.recurring !== undefined ? { recurring: s.recurring } : {}),
423
- ...(s.lifetime !== undefined ? { durable: s.lifetime === "durable" } : {}),
424
- ...(nextFireAt !== undefined ? { nextFireAt } : {}),
425
- };
426
- });
427
- return { content, details: { type: "cron-list", jobs } };
428
- },
429
- });
430
472
  const listPendingWakeups = async () => {
431
473
  const r = await sched.list(sessionCtx);
432
474
  if (!r.ok)
@@ -452,11 +494,11 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
452
494
  wakeupChain = next.then(() => undefined, () => undefined);
453
495
  return next;
454
496
  };
455
- const wakeupMountNote = sched.schedulerCapabilities.supportsSessionWakeup === false
497
+ const wakeupMountNote = caps.supportsSessionWakeup === false
456
498
  ? `
457
499
 
458
500
  MOUNT NOTE: this host has no resident wakeup leg, so ${SCHEDULE_WAKEUP_TOOL_NAME} refuses every scheduling call here — do not plan a self-paced loop around it (\`stop: true\` still works).`
459
- : sched.schedulerCapabilities.supportsSessionLifetime === true
501
+ : caps.supportsSessionLifetime === true
460
502
  ? ""
461
503
  : `
462
504
 
@@ -501,22 +543,23 @@ MOUNT NOTE: this host does not vouch for session-scoped scheduling, so a wakeup
501
543
  if (a.noop === undefined) {
502
544
  return errorResult(`Error (${SCHEDULE_WAKEUP_TOOL_NAME}): \`noop\` is required unless \`stop\` is true — pass \`noop: true\` if this tick changed nothing, \`noop: false\` if something happened worth keeping.`);
503
545
  }
504
- if (sched.schedulerCapabilities.supportsSessionWakeup === false) {
546
+ if (caps.supportsSessionWakeup === false) {
505
547
  return errorResult(`Error (${SCHEDULE_WAKEUP_TOOL_NAME}): this environment has no resident scheduler that can honor a session wakeup — the wakeup would never fire. Wait in the foreground instead, or start the work in a self-detaching form.`);
506
548
  }
507
- const sessionReapVouched = sched.schedulerCapabilities.supportsSessionLifetime === true;
549
+ const sessionReapVouched = caps.supportsSessionLifetime === true;
508
550
  const clampedDelaySeconds = Math.min(3600, Math.max(60, Math.round(a.delaySeconds)));
509
551
  const wasClamped = clampedDelaySeconds !== a.delaySeconds;
510
552
  const pending = await listPendingWakeups();
511
553
  const cancelledCount = "err" in pending ? 0 : await cancelWakeups(pending.ids);
512
554
  const cleanupIncomplete = "err" in pending || cancelledCount < pending.ids.length;
513
- const r = await sched.schedule({
555
+ const wakeup = {
514
556
  prompt: a.prompt,
515
557
  when: { kind: "delay", delaySec: clampedDelaySeconds },
516
558
  label: WAKEUP_LABEL,
517
559
  mode: "session-wakeup",
518
560
  ...(sessionReapVouched ? { lifetime: "session" } : {}),
519
- }, sessionCtx);
561
+ };
562
+ const r = await sched.schedule(wakeup, laneFor(wakeup));
520
563
  if (!r.ok)
521
564
  return errorResult(`Error (${SCHEDULE_WAKEUP_TOOL_NAME}): ${envErrorDetail(r.error.message)}`);
522
565
  const scheduledFor = Date.now() + clampedDelaySeconds * 1000;
@@ -534,5 +577,5 @@ MOUNT NOTE: this host does not vouch for session-scoped scheduling, so a wakeup
534
577
  };
535
578
  }),
536
579
  });
537
- return ctx.sessionId !== undefined ? [cronCreate, cronCancel, cronList, scheduleWakeup] : [cronCancel, cronList];
580
+ return [cronCreate, cronCancel, cronList, scheduleWakeup];
538
581
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "7.71.1",
3
+ "version": "7.72.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -141,7 +141,7 @@
141
141
  "dependencies": {
142
142
  "@modelcontextprotocol/client": "2.4.0",
143
143
  "@modelcontextprotocol/core": "2.4.0",
144
- "@sema-agent/primitives": "7.71.1",
144
+ "@sema-agent/primitives": "7.72.0",
145
145
  "typebox": "1.1.39",
146
146
  "undici": "7.30.2"
147
147
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a BREAKING change: name every removed entry in the CHANGELOG's BREAKING lines (what was removed / who is hurt / what to read instead) and update this fixture in the SAME commit. Regenerate via REGEN in test/export-surface.test.ts.",
3
3
  "_tierComment": "#435 v1 — machine-readable layering of the public surface: stable = demonstrated by README.md / src/examples; internal = an `Internal`-marked name or a runner/engine deep-subtree declaration (the model seam src/engine/llm is excluded — it is the BYOM contract, not an engine internal); advanced = a supported export the front door does not walk you through. THIS IS AN INITIAL HEURISTIC, derived mechanically and expected to be refined ticket by ticket: no human reviewed these 1700+ entries one by one, and nothing here claims otherwise. Known bias: a short or English-word export name (ok, err, Result, Usage) can match ordinary prose in README.md and land `stable` on a coincidence. Every export MUST carry a tier — a new export with no row fails the gate in export-surface.test.ts.",
4
- "count": 3912,
4
+ "count": 3932,
5
5
  "exports": {
6
6
  "A2APeerStateReading": "interface",
7
7
  "A2ARefusalClass": "type",
@@ -34,9 +34,11 @@
34
34
  "ACCEPT_EDITS_FILE_COMMANDS": "variable",
35
35
  "ACCOUNT_ORIGINS": "variable",
36
36
  "ACTOR_ASSERTION_FROZEN_FIELDS": "variable",
37
+ "ADOPTION_ERROR_CODES": "variable",
37
38
  "ADVISOR_NOT_ATTACHED_REASONS": "variable",
38
39
  "ADVISOR_OUTCOMES": "variable",
39
40
  "AGENT_MESSAGE_TAG": "variable",
41
+ "AGENT_PARK_UNREADABLE_CAUSES": "variable",
40
42
  "AGENT_TRANSCRIPT_TOOL_NAME": "variable",
41
43
  "AGGREGATE_TOOL_RESULT_BUDGET_CHARS": "variable",
42
44
  "ALLOW_ENTRY_INERT_REASONS": "variable",
@@ -130,6 +132,7 @@
130
132
  "AgentPark": "interface",
131
133
  "AgentParkGate": "type",
132
134
  "AgentParkState": "type",
135
+ "AgentParkUnreadableCause": "type",
133
136
  "AgentPollDetailsInput": "interface",
134
137
  "AgentSpawnAnswer": "type",
135
138
  "AgentState": "interface",
@@ -967,6 +970,11 @@
967
970
  "InvariantViolation": "interface",
968
971
  "JOURNAL_INCOMPATIBLE_ERROR_CODE": "variable",
969
972
  "JOURNAL_OVERSIZE_ERROR_CODE": "variable",
973
+ "JUDGED_READS_UNAVAILABLE": "variable",
974
+ "JudgedFile": "interface",
975
+ "JudgedRead": "interface",
976
+ "JudgedReads": "type",
977
+ "JudgedReadsUnavailable": "type",
970
978
  "KERNEL_CONTRACT_VERSION": "variable",
971
979
  "KillProcessTreeOptions": "type",
972
980
  "LEG_LABEL_KINDS": "variable",
@@ -1464,9 +1472,11 @@
1464
1472
  "PRINCIPAL_NAME_REFUSALS": "variable",
1465
1473
  "PROCESS_ANCHOR_DIR": "variable",
1466
1474
  "PROGRAM_RUN_REACHES": "variable",
1475
+ "PROJECT_IDENTITY_REFUSAL_KINDS": "variable",
1467
1476
  "PROJECT_ID_HINTS_FILE": "variable",
1468
1477
  "PROJECT_ID_REGEX": "variable",
1469
1478
  "PROJECT_MARKER_PATH": "variable",
1479
+ "PROJECT_MARKER_UNREADABLE_REASONS": "variable",
1470
1480
  "PROMPT_BANDS": "variable",
1471
1481
  "PROMPT_BINDING_LIST_MAX": "variable",
1472
1482
  "PROMPT_BINDING_MAX_CHARS": "variable",
@@ -1663,6 +1673,9 @@
1663
1673
  "ProcessFingerprint": "interface",
1664
1674
  "ProcessGroupReading": "type",
1665
1675
  "ProgramRunReachOutcome": "type",
1676
+ "ProjectIdentityRefusalDetail": "type",
1677
+ "ProjectIdentityRefusalKind": "type",
1678
+ "ProjectMarkerUnreadableReason": "type",
1666
1679
  "PromotedRecord": "interface",
1667
1680
  "PromptArtifact": "interface",
1668
1681
  "PromptArtifactEvidence": "interface",
@@ -2123,6 +2136,11 @@
2123
2136
  "SchedulerError": "class",
2124
2137
  "SchedulerErrorCode": "type",
2125
2138
  "SchedulerLanes": "interface",
2139
+ "SchedulerRowRefusalCode": "type",
2140
+ "SchedulerScopeKeys": "type",
2141
+ "SchedulerStoreMove": "interface",
2142
+ "SchedulerStoreRows": "interface",
2143
+ "SchedulerStoredRow": "interface",
2126
2144
  "SchedulerToolContext": "interface",
2127
2145
  "ScopeHomeForm": "type",
2128
2146
  "ScopePlanes": "interface",
@@ -3240,6 +3258,7 @@
3240
3258
  "isModeReleaseReason": "function",
3241
3259
  "isModelGatedForClass": "function",
3242
3260
  "isModelPriced": "function",
3261
+ "isNamespaceCredentialName": "function",
3243
3262
  "isNotificationInjectionOutcome": "function",
3244
3263
  "isOrgDeliveryRefusalCode": "function",
3245
3264
  "isOrgScopeKey": "function",
@@ -3396,6 +3415,7 @@
3396
3415
  "mergeRecallHits": "function",
3397
3416
  "mergeStopAnswers": "function",
3398
3417
  "mergeWorkflowArgs": "function",
3418
+ "migrateSchedulerStore": "function",
3399
3419
  "migrateScope": "function",
3400
3420
  "mintCapabilityId": "function",
3401
3421
  "mintCheckpointId": "function",
@@ -3707,6 +3727,7 @@
3707
3727
  "retryBackoffMs": "function",
3708
3728
  "rewriteSessionRules": "function",
3709
3729
  "riskSeverity": "function",
3730
+ "rollbackSchedulerStore": "function",
3710
3731
  "rosterCanPersistMemory": "function",
3711
3732
  "rosterMemberBoundProblem": "function",
3712
3733
  "rosterToolName": "function",
@@ -3789,7 +3810,6 @@
3789
3810
  "sessionDeletionCascadeContract": "function",
3790
3811
  "sessionEntryDigest": "function",
3791
3812
  "sessionIdHasScopeTail": "function",
3792
- "sessionLaneScopeOf": "function",
3793
3813
  "sessionLogDigest": "function",
3794
3814
  "sessionLogDigestsComparable": "function",
3795
3815
  "sessionLogMarkOf": "function",
@@ -3948,9 +3968,11 @@
3948
3968
  "ACCEPT_EDITS_FILE_COMMANDS": "advanced",
3949
3969
  "ACCOUNT_ORIGINS": "advanced",
3950
3970
  "ACTOR_ASSERTION_FROZEN_FIELDS": "advanced",
3971
+ "ADOPTION_ERROR_CODES": "advanced",
3951
3972
  "ADVISOR_NOT_ATTACHED_REASONS": "advanced",
3952
3973
  "ADVISOR_OUTCOMES": "advanced",
3953
3974
  "AGENT_MESSAGE_TAG": "advanced",
3975
+ "AGENT_PARK_UNREADABLE_CAUSES": "advanced",
3954
3976
  "AGENT_TRANSCRIPT_TOOL_NAME": "advanced",
3955
3977
  "AGGREGATE_TOOL_RESULT_BUDGET_CHARS": "advanced",
3956
3978
  "ALLOW_ENTRY_INERT_REASONS": "advanced",
@@ -4044,6 +4066,7 @@
4044
4066
  "AgentPark": "advanced",
4045
4067
  "AgentParkGate": "advanced",
4046
4068
  "AgentParkState": "advanced",
4069
+ "AgentParkUnreadableCause": "advanced",
4047
4070
  "AgentPollDetailsInput": "advanced",
4048
4071
  "AgentSpawnAnswer": "advanced",
4049
4072
  "AgentState": "advanced",
@@ -4881,6 +4904,11 @@
4881
4904
  "InvariantViolation": "advanced",
4882
4905
  "JOURNAL_INCOMPATIBLE_ERROR_CODE": "advanced",
4883
4906
  "JOURNAL_OVERSIZE_ERROR_CODE": "advanced",
4907
+ "JUDGED_READS_UNAVAILABLE": "advanced",
4908
+ "JudgedFile": "advanced",
4909
+ "JudgedRead": "advanced",
4910
+ "JudgedReads": "advanced",
4911
+ "JudgedReadsUnavailable": "advanced",
4884
4912
  "KERNEL_CONTRACT_VERSION": "advanced",
4885
4913
  "KillProcessTreeOptions": "internal",
4886
4914
  "LEG_LABEL_KINDS": "internal",
@@ -5378,9 +5406,11 @@
5378
5406
  "PRINCIPAL_NAME_REFUSALS": "advanced",
5379
5407
  "PROCESS_ANCHOR_DIR": "advanced",
5380
5408
  "PROGRAM_RUN_REACHES": "advanced",
5409
+ "PROJECT_IDENTITY_REFUSAL_KINDS": "advanced",
5381
5410
  "PROJECT_ID_HINTS_FILE": "advanced",
5382
5411
  "PROJECT_ID_REGEX": "advanced",
5383
5412
  "PROJECT_MARKER_PATH": "advanced",
5413
+ "PROJECT_MARKER_UNREADABLE_REASONS": "advanced",
5384
5414
  "PROMPT_BANDS": "advanced",
5385
5415
  "PROMPT_BINDING_LIST_MAX": "advanced",
5386
5416
  "PROMPT_BINDING_MAX_CHARS": "advanced",
@@ -5577,6 +5607,9 @@
5577
5607
  "ProcessFingerprint": "advanced",
5578
5608
  "ProcessGroupReading": "advanced",
5579
5609
  "ProgramRunReachOutcome": "advanced",
5610
+ "ProjectIdentityRefusalDetail": "advanced",
5611
+ "ProjectIdentityRefusalKind": "advanced",
5612
+ "ProjectMarkerUnreadableReason": "advanced",
5580
5613
  "PromotedRecord": "advanced",
5581
5614
  "PromptArtifact": "advanced",
5582
5615
  "PromptArtifactEvidence": "advanced",
@@ -6037,6 +6070,11 @@
6037
6070
  "SchedulerError": "advanced",
6038
6071
  "SchedulerErrorCode": "advanced",
6039
6072
  "SchedulerLanes": "advanced",
6073
+ "SchedulerRowRefusalCode": "advanced",
6074
+ "SchedulerScopeKeys": "advanced",
6075
+ "SchedulerStoreMove": "advanced",
6076
+ "SchedulerStoreRows": "advanced",
6077
+ "SchedulerStoredRow": "advanced",
6040
6078
  "SchedulerToolContext": "advanced",
6041
6079
  "ScopeHomeForm": "advanced",
6042
6080
  "ScopePlanes": "advanced",
@@ -7154,6 +7192,7 @@
7154
7192
  "isModeReleaseReason": "advanced",
7155
7193
  "isModelGatedForClass": "advanced",
7156
7194
  "isModelPriced": "advanced",
7195
+ "isNamespaceCredentialName": "advanced",
7157
7196
  "isNotificationInjectionOutcome": "advanced",
7158
7197
  "isOrgDeliveryRefusalCode": "advanced",
7159
7198
  "isOrgScopeKey": "advanced",
@@ -7310,6 +7349,7 @@
7310
7349
  "mergeRecallHits": "advanced",
7311
7350
  "mergeStopAnswers": "advanced",
7312
7351
  "mergeWorkflowArgs": "advanced",
7352
+ "migrateSchedulerStore": "advanced",
7313
7353
  "migrateScope": "advanced",
7314
7354
  "mintCapabilityId": "advanced",
7315
7355
  "mintCheckpointId": "advanced",
@@ -7621,6 +7661,7 @@
7621
7661
  "retryBackoffMs": "advanced",
7622
7662
  "rewriteSessionRules": "advanced",
7623
7663
  "riskSeverity": "advanced",
7664
+ "rollbackSchedulerStore": "advanced",
7624
7665
  "rosterCanPersistMemory": "advanced",
7625
7666
  "rosterMemberBoundProblem": "advanced",
7626
7667
  "rosterToolName": "advanced",
@@ -7703,7 +7744,6 @@
7703
7744
  "sessionDeletionCascadeContract": "advanced",
7704
7745
  "sessionEntryDigest": "internal",
7705
7746
  "sessionIdHasScopeTail": "internal",
7706
- "sessionLaneScopeOf": "advanced",
7707
7747
  "sessionLogDigest": "internal",
7708
7748
  "sessionLogDigestsComparable": "internal",
7709
7749
  "sessionLogMarkOf": "internal",
@@ -0,0 +1,12 @@
1
+ {
2
+ "leaves": {
3
+ "L-1835a5ccb3cb": {
4
+ "answer": "breaking",
5
+ "why": "This package's own emitted declarations are byte-identical to 7.71.1, but SqlStorageBackend extends @sema-agent/core's EngineStorageBackend, whose checkpointStore hands out parked tool_approval rows carrying core's widened ApprovalTargets (each role may be a readonly (string | null)[]), so a host that holds a SqlStorageBackend or createSqlStorageBackend's result as its 7.71.1 type, or reads a row's targets as one string per role, fails to compile; putting core's 7.71.1 ApprovalTargets back alone moves the EngineStorageBackend reader probe off this message (onto core's CheckpointErrorReason widening, answered in core's manifest)."
6
+ }
7
+ },
8
+ "mustCheck": {
9
+ "deep-nesting": "Not measurable by the run, so the hole was checked: the package's own emitted declarations are byte-identical at both ends (diff of the judge's two cached trees: only the timing sidecar differs), and its 32 method-syntax members' 36 parameters compare equal both ways with the checker against each end's core; what it takes from @sema-agent/core (EngineStorageBackend, SessionStore, SessionLogTransfer, ManagedRetentionCapability) is covered by core's depth-unbounded scan of all 1,914 method-syntax members, which finds no differing method parameter outside ApprovalTargets, ShellReadRefusalDetails and CheckpointErrorReason, each answered breaking in core's manifest.",
10
+ "exact-optional": "Not measurable (a consumer's compiler option): the package's own emitted declarations are byte-identical at both ends, so no `?` or `| undefined` of its own moved, and in core's declaration diff (what it reaches through @sema-agent/core) no member both ends declare gained or lost `| undefined`; core's optionality changes are SchedulerLanes.session (answered breaking in core's manifest) and two prepare inputs no published declaration reaches."
11
+ }
12
+ }