@sema-agent/core 5.57.0 → 5.59.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 +96 -0
  2. package/dist/agents/cascade.d.ts +1 -1
  3. package/dist/agents/cumulative-stats.d.ts +1 -1
  4. package/dist/agents/observer.d.ts +2 -2
  5. package/dist/agents/peer-admission.d.ts +1 -1
  6. package/dist/agents/retain-ledger.d.ts +2 -2
  7. package/dist/agents/roster-store.d.ts +8 -8
  8. package/dist/agents/send-message-tool.d.ts +2 -2
  9. package/dist/agents/subagent-steps.d.ts +1 -1
  10. package/dist/agents/subagent.d.ts +13 -13
  11. package/dist/agents/team.d.ts +5 -5
  12. package/dist/agents/tool-filter.d.ts +2 -2
  13. package/dist/agents/verify.d.ts +1 -1
  14. package/dist/bench/metrics.d.ts +35 -35
  15. package/dist/brain/degrading.d.ts +1 -1
  16. package/dist/brain/errors.d.ts +3 -3
  17. package/dist/brain/reasoning.d.ts +2 -2
  18. package/dist/brain/repetition.d.ts +1 -1
  19. package/dist/brain/route-adjudicator.d.ts +8 -1
  20. package/dist/brain/route-adjudicator.js +8 -1
  21. package/dist/brain/status-sink.d.ts +2 -2
  22. package/dist/brain/stream-shared.d.ts +1 -1
  23. package/dist/config/catalog.d.ts +5 -5
  24. package/dist/core/arg-summary.d.ts +4 -4
  25. package/dist/core/ask-class.d.ts +2 -2
  26. package/dist/core/ask-question.d.ts +1 -1
  27. package/dist/core/auto-compaction.d.ts +15 -15
  28. package/dist/core/auto-mode.d.ts +5 -5
  29. package/dist/core/background-agent-store.d.ts +20 -20
  30. package/dist/core/background-shell.d.ts +4 -4
  31. package/dist/core/checkpoint-store.d.ts +35 -27
  32. package/dist/core/context-edit.d.ts +1 -1
  33. package/dist/core/context-guard.d.ts +1 -1
  34. package/dist/core/exec-output-tail.d.ts +6 -6
  35. package/dist/core/file-snapshot-store.d.ts +8 -8
  36. package/dist/core/git-worktree-env.d.ts +3 -3
  37. package/dist/core/governance-codes.d.ts +37 -10
  38. package/dist/core/governance-codes.js +54 -1
  39. package/dist/core/hooks.d.ts +73 -33
  40. package/dist/core/hooks.js +87 -25
  41. package/dist/core/image-downsample.d.ts +1 -1
  42. package/dist/core/locked-config.d.ts +1 -1
  43. package/dist/core/lsp.d.ts +1 -1
  44. package/dist/core/mailbox-store.d.ts +1 -1
  45. package/dist/core/mcp.d.ts +3 -3
  46. package/dist/core/memory-engine/consolidation-driver.d.ts +211 -0
  47. package/dist/core/memory-engine/consolidation-driver.js +427 -0
  48. package/dist/core/memory-engine/consolidation.d.ts +119 -3
  49. package/dist/core/memory-engine/consolidation.js +22 -1
  50. package/dist/core/memory-engine/data-plane.d.ts +1 -1
  51. package/dist/core/memory-engine/distiller.d.ts +550 -0
  52. package/dist/core/memory-engine/distiller.js +598 -0
  53. package/dist/core/memory-engine/dual-root.d.ts +1 -1
  54. package/dist/core/memory-engine/engine.d.ts +143 -10
  55. package/dist/core/memory-engine/engine.js +149 -23
  56. package/dist/core/memory-engine/file-backend.d.ts +14 -2
  57. package/dist/core/memory-engine/file-backend.js +3 -0
  58. package/dist/core/memory-engine/index.d.ts +6 -3
  59. package/dist/core/memory-engine/index.js +4 -2
  60. package/dist/core/memory-engine/layout.js +20 -6
  61. package/dist/core/memory-engine/origin-clearance.d.ts +1 -1
  62. package/dist/core/memory-engine/scope-contract.d.ts +4 -4
  63. package/dist/core/memory-engine/sync-client.d.ts +16 -16
  64. package/dist/core/memory-engine/sync.d.ts +4 -4
  65. package/dist/core/memory-engine/types.d.ts +17 -0
  66. package/dist/core/memory-recall.d.ts +1 -1
  67. package/dist/core/memory.d.ts +2 -2
  68. package/dist/core/permission-rule-consent.d.ts +185 -36
  69. package/dist/core/permission-rule-consent.js +219 -44
  70. package/dist/core/permission-rule-model.d.ts +235 -31
  71. package/dist/core/permission-rule-model.js +105 -35
  72. package/dist/core/permission-rules.d.ts +9 -9
  73. package/dist/core/remote-env.d.ts +8 -8
  74. package/dist/core/roles.d.ts +3 -3
  75. package/dist/core/roles.js +1 -0
  76. package/dist/core/runner/assemble-result.d.ts +2 -2
  77. package/dist/core/runner/compaction-call-options.d.ts +3 -3
  78. package/dist/core/runner/memory-consolidation-driver.d.ts +49 -0
  79. package/dist/core/runner/memory-consolidation-driver.js +60 -0
  80. package/dist/core/runner/memory-consolidation.d.ts +1 -1
  81. package/dist/core/runner/prepare-config-doors.d.ts +3 -3
  82. package/dist/core/runner/prepare-task.d.ts +21 -21
  83. package/dist/core/runner/prepare-task.js +24 -17
  84. package/dist/core/runner/prepare-workspace-restore.d.ts +2 -2
  85. package/dist/core/runner/runtask.d.ts +11 -11
  86. package/dist/core/runner/runtask.js +4 -4
  87. package/dist/core/runner/session-rule-policy.d.ts +1 -1
  88. package/dist/core/runner/teardown-bounded.d.ts +1 -1
  89. package/dist/core/runner/tool-disclosure.d.ts +2 -2
  90. package/dist/core/runner/turn-attachments.d.ts +11 -11
  91. package/dist/core/scheduler.d.ts +5 -5
  92. package/dist/core/secret-env.d.ts +1 -1
  93. package/dist/core/sensitive-path-policy.d.ts +1 -1
  94. package/dist/core/session-policy-store.d.ts +2 -2
  95. package/dist/core/session-reconcile.d.ts +2 -2
  96. package/dist/core/session-store.d.ts +3 -3
  97. package/dist/core/session.d.ts +1 -1
  98. package/dist/core/shutdown-debug.d.ts +2 -2
  99. package/dist/core/side-query.d.ts +2 -2
  100. package/dist/core/spec-contract.d.ts +1 -1
  101. package/dist/core/store-contracts/contract-harness.d.ts +2 -2
  102. package/dist/core/store-contracts/contract-kit-version.d.ts +2 -2
  103. package/dist/core/store-contracts/mailbox-store-contract.d.ts +1 -1
  104. package/dist/core/store-contracts/mailbox-store-contract.js +1 -1
  105. package/dist/core/task-notification.d.ts +5 -5
  106. package/dist/core/task-registry-agent.d.ts +12 -12
  107. package/dist/core/task-registry-monitor.d.ts +1 -1
  108. package/dist/core/task-registry-shared.d.ts +41 -41
  109. package/dist/core/task-registry.d.ts +12 -12
  110. package/dist/core/tool-detach.d.ts +2 -2
  111. package/dist/core/tool-errors.d.ts +3 -3
  112. package/dist/core/tool-policy.d.ts +113 -28
  113. package/dist/core/tool-policy.js +80 -1
  114. package/dist/core/tool-result-budget.d.ts +1 -1
  115. package/dist/core/tool-result-store.d.ts +2 -2
  116. package/dist/core/tools.d.ts +1 -1
  117. package/dist/core/trace.d.ts +26 -23
  118. package/dist/core/types.d.ts +164 -86
  119. package/dist/core/types.js +4 -3
  120. package/dist/core/untrusted-egress.d.ts +1 -1
  121. package/dist/core/untrusted-text.d.ts +7 -7
  122. package/dist/core/wiring-manifest.d.ts +5 -5
  123. package/dist/core/workflow-journal-store.d.ts +14 -14
  124. package/dist/core/workflow-run-store-contract.d.ts +1 -1
  125. package/dist/core/workflow-run-store-contract.js +1 -1
  126. package/dist/core/workflow-run-store.d.ts +4 -4
  127. package/dist/engine/compaction/compaction.d.ts +3 -3
  128. package/dist/engine/compaction/utils.d.ts +2 -2
  129. package/dist/engine/execution-env/kill-tree.d.ts +1 -1
  130. package/dist/engine/execution-env/node-execution-env.d.ts +8 -8
  131. package/dist/engine/harness/agent-harness.d.ts +6 -6
  132. package/dist/engine/harness/messages.d.ts +1 -1
  133. package/dist/engine/harness/types.d.ts +10 -10
  134. package/dist/engine/llm/types.d.ts +14 -14
  135. package/dist/engine/loop/agent-loop.d.ts +3 -3
  136. package/dist/engine/loop/types.d.ts +4 -4
  137. package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
  138. package/dist/engine/session/import-validate.d.ts +1 -1
  139. package/dist/engine/session/log-digest.d.ts +1 -1
  140. package/dist/engine/session/memory-repo.d.ts +2 -2
  141. package/dist/engine/session/session.d.ts +4 -4
  142. package/dist/fixtures/index.d.ts +4 -4
  143. package/dist/index.d.ts +6 -5
  144. package/dist/index.js +5 -4
  145. package/dist/orchestration/goal.d.ts +1 -1
  146. package/dist/orchestration/run-spec.d.ts +1 -1
  147. package/dist/orchestration/run-workflow-tool.d.ts +12 -12
  148. package/dist/orchestration/workflow-governance.d.ts +4 -4
  149. package/dist/orchestration/workflow-observe.d.ts +1 -1
  150. package/dist/orchestration/workflow-script-runner.d.ts +1 -1
  151. package/dist/orchestration/workflow-script-store.d.ts +9 -9
  152. package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
  153. package/dist/orchestration/workflow-types.d.ts +5 -5
  154. package/dist/orchestration/workflow.d.ts +10 -10
  155. package/dist/prompt-assembly/artifact-store.d.ts +1 -1
  156. package/dist/prompt-assembly/artifact.d.ts +1 -1
  157. package/dist/prompt-assembly/assemble.d.ts +1 -1
  158. package/dist/prompt-assembly/composer.d.ts +2 -2
  159. package/dist/prompt-assembly/epoch.d.ts +2 -2
  160. package/dist/prompt-assembly/event-registry.d.ts +1 -1
  161. package/dist/prompt-assembly/explain.d.ts +3 -3
  162. package/dist/prompt-assembly/tool-catalog.d.ts +1 -1
  163. package/dist/prompt-assembly/turn-snapshot.d.ts +4 -4
  164. package/dist/prompt-assembly/types.d.ts +12 -12
  165. package/dist/prompts/coordinator.d.ts +1 -1
  166. package/dist/prompts/default.d.ts +8 -8
  167. package/dist/prompts/simple-sections.d.ts +3 -3
  168. package/dist/prompts/supervisor.d.ts +2 -2
  169. package/dist/scenarios/full-body.d.ts +3 -3
  170. package/dist/scenarios/scenario-registry.d.ts +1 -1
  171. package/dist/stores/cc/sidecar-transcript.d.ts +3 -3
  172. package/dist/stores/file/fs-atomic.d.ts +2 -2
  173. package/dist/stores/file/index.d.ts +1 -1
  174. package/dist/stores/file/session-store.d.ts +2 -2
  175. package/dist/stores/file/workflow-journal-store.d.ts +4 -4
  176. package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
  177. package/dist/tools/fs/encoding.d.ts +4 -4
  178. package/dist/tools/fs/fs-bash.d.ts +3 -3
  179. package/dist/tools/fs/fs-pdf.d.ts +1 -1
  180. package/dist/tools/fs/fs-shared.d.ts +6 -6
  181. package/dist/tools/fs/index.d.ts +2 -2
  182. package/dist/tools/fs/notebook.d.ts +1 -1
  183. package/dist/tools/fs/pdf.d.ts +1 -1
  184. package/dist/tools/fs/read-deny.d.ts +1 -1
  185. package/dist/tools/fs/safety.d.ts +9 -9
  186. package/dist/tools/fs/search.d.ts +2 -2
  187. package/dist/tools/monitor.d.ts +3 -3
  188. package/dist/tools/task-list.d.ts +2 -2
  189. package/dist/tools/web.d.ts +4 -4
  190. package/dist/tools/worktree.d.ts +5 -5
  191. package/package.json +1 -1
  192. package/test/export-surface.snapshot.json +1826 -3
@@ -3,7 +3,7 @@ import type { ExecutionEnv } from "../../internal/harness.js";
3
3
  import type { RemoteEnvFailureNote, RunnerDeps, TaskSpec } from "../types.js";
4
4
  import type { PrepareResume, RunInternals } from "./prepare-task.js";
5
5
  /**
6
- * codex 1360 r2-r4 — rebase one checkpointed absolute path from the OLD workspace root onto the RESTORED
6
+ * rebase one checkpointed absolute path from the OLD workspace root onto the RESTORED
7
7
  * one (divergent `resumeVM`). POSIX-ONLY by contract: every remote lane's `mountPath` is a container
8
8
  * path (e2b/k8s/ssh/adb/local-docker are all Linux targets), so a backslash ANYWHERE in the inputs marks
9
9
  * the value outside this function's domain and it returns `p` UNCHANGED — an un-rebased path is honestly
@@ -71,7 +71,7 @@ export interface PrepareWorkspaceRestoreInput {
71
71
  internals: Pick<RunInternals, "onWorkspaceResolved" | "isolation"> | undefined;
72
72
  /** borrowed-readonly — the durable-resume seats this phase reads: the checkpointed
73
73
  * `workspaceHandle` (restore target) and `executesApprovedAction` (the divergence fail-closed
74
- * key — codex 1360 r6). Absent for a fresh/non-durable run: the phase is then root-passthrough. */
74
+ * key). Absent for a fresh/non-durable run: the phase is then root-passthrough. */
75
75
  resume: Pick<PrepareResume, "workspaceHandle" | "executesApprovedAction"> | undefined;
76
76
  /** owned (value) — the pre-restore task root (isolation-aware initial derivation, computed in the
77
77
  * driver). Dead after this call by design (R-5): later phases read the returned
@@ -145,17 +145,17 @@ export declare class Runner {
145
145
  readonly sessions: SessionStore;
146
146
  /** Per-sessionId serialization so two tasks never mutate one session concurrently. */
147
147
  private sessionLocks;
148
- /** service [403](a) — roots whose rewind-files snapshot hit `too_large`, with the refusal time.
148
+ /** (a) — roots whose rewind-files snapshot hit `too_large`, with the refusal time.
149
149
  * A 20G workspace otherwise pays a full bounded tree-walk (stat tens of thousands of files) EVERY
150
150
  * task just to re-discover the same refusal; once too_large, skip further snapshots for that root
151
151
  * (announced once via onError). E19 semantics unchanged — rewind for that root was already
152
- * impossible. codex 131 审 C: TTL'd (30min), not permanent — a long-lived Runner over a tree the
152
+ * impossible. TTL'd (30min), not permanent — a long-lived Runner over a tree the
153
153
  * user later SHRINKS re-probes instead of being locked out until restart.
154
154
  * RB-430-b: `skipAnnounced` makes the SKIP itself observable — one announcement per cooldown window,
155
155
  * so an operator can tell "this turn produced no snapshot" from "snapshots are working", without the
156
156
  * per-turn log spam the latch exists to prevent. Cleared with the entry when the window elapses. */
157
157
  private snapshotTooLargeRoots;
158
- /** 飞轮 [492]② — task notifications born BETWEEN turns (run torn down / harness already idle), parked
158
+ /** task notifications born BETWEEN turns (run torn down / harness already idle), parked
159
159
  * per session and drained into the session's next run at its first boundary. Runner-lived (outlives any
160
160
  * single run, like the registry handles that produce into it); bounded + drop-disclosing, see
161
161
  * {@link PendingSessionNotifications}. Not checkpointed — the producing handles are process-local. */
@@ -189,7 +189,7 @@ export declare class Runner {
189
189
  builtinAgents?: boolean;
190
190
  models?: Record<string, Model>;
191
191
  };
192
- /** design/125 (codex 实现审 B1) — the deployment-level gating baseline, exposed READ-ONLY so thin
192
+ /** design/125 (实现审 B1) — the deployment-level gating baseline, exposed READ-ONLY so thin
193
193
  * assemblers over the Runner (`runSpec`) can COMPOSE with it. The task-level engine semantic is a
194
194
  * WHOLE-SLOT override (`spec.toolPolicy ?? deps.toolPolicy`, same for hooks — prepare-task), so any
195
195
  * assembler that sets `spec.toolPolicy`/`spec.hooks` without folding these in silently shadows the
@@ -228,7 +228,7 @@ export declare class Runner {
228
228
  models: Record<string, Model>;
229
229
  tiers?: Record<string, ModelRef>;
230
230
  }): void;
231
- /** [1463]① — one-shot brain-routed utility query (see {@link runSideQuery} for the full contract):
231
+ /** one-shot brain-routed utility query (see {@link runSideQuery} for the full contract):
232
232
  * preserves system/multi-turn messages/tool DEFINITIONS, routes through the deployment's brain with
233
233
  * the same model resolution as tasks, returns real usage/model. No session, no tool execution, no
234
234
  * policy gate, no accounting — caller-trusted. */
@@ -252,7 +252,7 @@ export declare class Runner {
252
252
  /**
253
253
  * design/101 §E19 — capture a working-tree snapshot of the just-finished turn, keyed by the leaf
254
254
  * `SessionTreeEntry.id`. Best-effort + never throws (errors route to `onError(phase:"rewind")`). Runs against
255
- * ANY ExecutionEnv (local or remote) when a `fileSnapshotStore` is wired (GATE-SPLIT, service [263]) — the
255
+ * ANY ExecutionEnv (local or remote) when a `fileSnapshotStore` is wired (GATE-SPLIT) — the
256
256
  * snapshot is portable (env FileSystem ops). A deployment wanting VM-snapshot instead wires a VM-backed store.
257
257
  */
258
258
  private snapshotTurn;
@@ -276,7 +276,7 @@ export declare class Runner {
276
276
  * v1 serves only the `human`/`policy_ask` gate (F4). A `task_done` checkpoint (1C Path A) is not
277
277
  * resumable here — the caller orchestrates that one and reads its handle directly.
278
278
  *
279
- * **🔒 Authorization boundary (design/80 D-2 / [122] invariant #1) — token-as-auth, scope is store-level
279
+ * **🔒 Authorization boundary (design/80 D-2 invariant #1) — token-as-auth, scope is store-level
280
280
  * isolation, NOT caller authorization.** `resume` is TOKEN-AS-AUTH: whoever presents a valid, still-`pending`
281
281
  * checkpoint token resolves it. The scope passed to the store CAS is the checkpoint's OWN `cp.scope` (read
282
282
  * off the row), so the store's scope-WHERE is store-level multi-tenant DATA isolation (one tenant's reaper /
@@ -318,13 +318,13 @@ export declare class Runner {
318
318
  * trigger to execute the pending action — a lost CAS rejects, never returns a re-running stream).
319
319
  *
320
320
  * **Eager (like {@link runTaskStream}):** once this resolves, the resumed run is already executing — the
321
- * pending action runs exactly once and the run-loop tail's `teardownOwnedEnv` (service [325]) tears down the
321
+ * pending action runs exactly once and the run-loop tail's `teardownOwnedEnv` tears down the
322
322
  * rebuilt remote env even if you never iterate the stream. So abandoning the returned stream is safe (no leak,
323
323
  * no hang); it only means you
324
324
  * don't observe the resumed segment's events.
325
325
  */
326
326
  resumeStream(token: CheckpointToken, outcome: ResumeOutcome, taskConfig: ResumeTaskConfig,
327
- /** service [371]①: the TRUSTED run-internals seam, symmetric with {@link runTaskStream} — a resume leg
327
+ /** the TRUSTED run-internals seam, symmetric with {@link runTaskStream} — a resume leg
328
328
  * otherwise has no `onForwardEvent`席位, so a subagent's task_progress ticks (child-isolated stream,
329
329
  * only exit = the forward sink) were unreachable on resume. Deployment-owned, never a TaskSpec field.
330
330
  * Parent effective-policy inheritance CONTRACT: a checkpoint whose `state.inheritedGate.
@@ -397,7 +397,7 @@ export declare class Runner {
397
397
  private recordCompactionReuse;
398
398
  private finish;
399
399
  /**
400
- * design/48 remote seam + service [325]: tear down a per-task env minted by `executionEnvFactory` (e.g. a
400
+ * design/48 remote seam +: tear down a per-task env minted by `executionEnvFactory` (e.g. a
401
401
  * remote container, or a `withWorktreeIsolation` worktree) — this task owned its lifetime. Best-effort, like
402
402
  * `mcp.dispose`: a `destroy()` failure must not break the run. Only `ownedEnv` (factory-produced) is destroyed;
403
403
  * a caller-owned static `deps.executionEnv` outlives the task and is left untouched. The service control plane's
@@ -405,7 +405,7 @@ export declare class Runner {
405
405
  *
406
406
  * Runs from the run-loop tail AFTER every env-reader (finish()'s compaction `attachWorkingFiles` +
407
407
  * `snapshotTurn`'s rewind-files capture), so the working tree is still readable when they run. This ORDER is the
408
- * fix for service [325]: the old in-`finish()` destroy ran BEFORE `snapshotTurn`, so a factory-minted
408
+ * fix for a teardown-order defect: the old in-`finish` destroy ran BEFORE `snapshotTurn`, so a factory-minted
409
409
  * remote/worktree lane snapshotted an already-destroyed env (plain host/static lanes were false-green).
410
410
  *
411
411
  * design/49 v1.5 / design/76 §2.5: a SUSPENDED (`suspendRef.token`) or `needs_review` (`reviewRef.token`) pause
@@ -2095,7 +2095,7 @@ export class Runner {
2095
2095
  message: `a notification was injected with priority "now", which this engine does not implement: all injection ` +
2096
2096
  `priorities deliver at the NEXT turn boundary and none aborts the running turn. The notification is ` +
2097
2097
  `delivered — only the interrupting semantics are absent.`,
2098
- detail: { priority: "now", ...(spec.taskId !== undefined ? { taskId: spec.taskId } : {}) },
2098
+ detail: { priority: "now", ...(spec.taskId !== undefined ? { taskId: spec.taskId } : {}), sessionId: prepared.sessionId },
2099
2099
  });
2100
2100
  }
2101
2101
  if (deliveredAtTurnOpen.has(taskNotificationDedupKey(notification)))
@@ -2172,7 +2172,7 @@ export class Runner {
2172
2172
  undrainedUserAtEnd = counts;
2173
2173
  return;
2174
2174
  }
2175
- for (const notice of undrainedUserInputNotices(counts, spec.taskId)) {
2175
+ for (const notice of undrainedUserInputNotices(counts, spec.taskId, prepared.sessionId)) {
2176
2176
  deliverEngineNotice(this.deps.onNotice, notice);
2177
2177
  }
2178
2178
  };
@@ -3572,7 +3572,7 @@ export class Runner {
3572
3572
  steer: Math.max(0, undrainedUserAtEnd.steer - migratedParked.steer),
3573
3573
  followUp: Math.max(0, undrainedUserAtEnd.followUp - migratedParked.followUp),
3574
3574
  };
3575
- for (const notice of undrainedUserInputNotices(remaining, spec.taskId)) {
3575
+ for (const notice of undrainedUserInputNotices(remaining, spec.taskId, prepared.sessionId)) {
3576
3576
  deliverEngineNotice(this.deps.onNotice, notice);
3577
3577
  }
3578
3578
  }
@@ -3933,7 +3933,7 @@ export class Runner {
3933
3933
  if (!sameRouteIdentity(model, prepared.model)) {
3934
3934
  const verdict = await adjudicateDerivedRoute({ brain: this.deps.brain, model, getApiKeyAndHeaders: spec.getApiKeyAndHeaders });
3935
3935
  if (verdict !== undefined && !verdict.ok) {
3936
- deliverEngineNotice(this.deps.onNotice, fallbackToPrimaryNotice({ seat: "prompt-suggestions", from: model.id, to: prepared.model.id, verdict }));
3936
+ deliverEngineNotice(this.deps.onNotice, fallbackToPrimaryNotice({ seat: "prompt-suggestions", from: model.id, to: prepared.model.id, verdict, sessionId: prepared.sessionId }));
3937
3937
  model = prepared.model;
3938
3938
  thinking = prepared.thinking;
3939
3939
  }
@@ -15,7 +15,7 @@ import type { SessionPermissionRules } from "../session-policy-store.js";
15
15
  * skill face is a separate capability decision with its own review). */
16
16
  export declare const PATH_WRITE_TOOLS: ReadonlySet<string>;
17
17
  /** The FULL path-confinable write-tool set: {@link PATH_WRITE_TOOLS} plus `NotebookEdit`, whose write
18
- * target is `notebook_path` and is extracted by the shared tool-aware {@link writeTargetPath} ([886]①b —
18
+ * target is `notebook_path` and is extracted by the shared tool-aware {@link writeTargetPath} (
19
19
  * notebook_path outranks a decoy `file_path` for that tool).
20
20
  *
21
21
  * REF-B3 — the ONE spelling of "tools this codebase can confine by path". Consumers:
@@ -1,5 +1,5 @@
1
1
  /**
2
- * RB-470 (blackboard [2310], the D4 never-settle class) — bounded await for BEST-EFFORT teardown /
2
+ * RB-470 (the D4 never-settle class) — bounded await for BEST-EFFORT teardown /
3
3
  * cleanup legs on a run's settle path.
4
4
  *
5
5
  * The defect class: `resume()`/`runTask` settle only when the run body returns, and the body's tail
@@ -77,7 +77,7 @@ export declare function classifyDeferred(opts: {
77
77
  fullTools: ReadonlyArray<ToolFingerprintInput>;
78
78
  deferMode?: "auto";
79
79
  model: Model;
80
- /** [1044]② TaskSpec.deferTools — defer ALREADY-MOUNTED tools by wire name (built-ins included;
80
+ /** TaskSpec.deferTools — defer ALREADY-MOUNTED tools by wire name (built-ins included;
81
81
  * `ToolSpec.defer` only reaches caller specs). Caller pre-filters to mounted names. */
82
82
  deferNames?: ReadonlyArray<string>;
83
83
  /** RB-400-a — inline-pin names (`TaskSpec.alwaysLoadTools` + the MCP tools whose server declared
@@ -253,7 +253,7 @@ export declare function createToolSearchTool(opts: {
253
253
  * the listing text here and it rides THIS search's own result content — tail of the log, cache
254
254
  * prefix untouched, same channel the activation announcement already uses. */
255
255
  listingRide?: (newlyActivated: readonly string[]) => string | undefined;
256
- /** [1413]②b (TOOLS-PERFECT): the names callable DIRECTLY right now (mounted non-deferred + activated),
256
+ /** The names callable DIRECTLY right now (mounted non-deferred + activated),
257
257
  * computed at call time (setTools swaps mutate the surface). Lets the miss note tell the model
258
258
  * "Workflow is already available — call it" instead of a generic not-found that reads as absence
259
259
  * (observed: the model treated the miss as unavailability and only recovered by guessing). */
@@ -166,7 +166,7 @@ export interface AttachmentState {
166
166
  skillsListingStarved?: boolean;
167
167
  }
168
168
  /**
169
- * [918] A1-R (codex reopen ①) — the date_change lane's OWN state, deliberately NOT an
169
+ * A1-R — the date_change lane's OWN state, deliberately NOT an
170
170
  * {@link AttachmentState} member: allocating that for a date-only run would activate the cadence
171
171
  * content scan + projection reducers on every non-opted run (the reopen's exact finding). Two
172
172
  * fields, zero reducers. `announcedDate` starts at the leg's frozen prefix date; the RUN LOOP
@@ -185,7 +185,7 @@ export interface DateChangeState {
185
185
  * (`ProjectMemoryLoad.instructionSources` — what the model is already seeing) and the RUN LOOP
186
186
  * commits it via {@link commitInstructionsChange} when it actually appends the frame (the producer
187
187
  * below is pure). The frame rides ABOVE the 8KB bundle cap as a fixed ≤{@link INSTRUCTIONS_CHANGE_BYTE_CAP}
188
- * item — no clipping face exists, so commit-at-append is sound (the [918] A1-R argument verbatim).
188
+ * item — no clipping face exists, so commit-at-append is sound (the A1-R argument verbatim).
189
189
  * `null` value = "announced as removed" (a reappearing file re-announces by hash inequality).
190
190
  */
191
191
  export interface InstructionsChangeState {
@@ -475,10 +475,10 @@ export declare function renderToolSearchUsageReminder(undiscovered: readonly str
475
475
  * float accumulator; no rounding anywhere in QFm or the renderer), kept verbatim: sema's inputs come
476
476
  * from integer micro-USD ÷ 1e6, so they render with ≤6 decimals by construction.
477
477
  */
478
- /** [915] A1 — CC messages.ts:4162 verbatim shape (de-branded is a no-op here: the text is neutral). */
478
+ /** A1 — CC messages.ts:4162 verbatim shape (de-branded is a no-op here: the text is neutral). */
479
479
  export declare function renderDateChange(newDate: string): string;
480
480
  /**
481
- * [918] A1-R — the date_change producer (CC attachments.ts:1400-1443 parity): the system-prefix
481
+ * A1-R — the date_change producer (CC attachments.ts:1400-1443 parity): the system-prefix
482
482
  * date is FROZEN for the leg (upstream: "cached for the duration of the conversation" — re-rendering
483
483
  * the prefix at midnight costs ~920K effective tokens per overnight session, upstream's own comment);
484
484
  * when the boundary-time LOCAL date walks away from the last announced one, the model is told at the
@@ -625,7 +625,7 @@ export declare const AMBIENT_CONTEXT_NOTE = "This is ambient context \u2014 do n
625
625
  * AND the run loop's resume transcript probe (MED-3②: "was the listing ever delivered?"). */
626
626
  export declare function agentListingInitialHeader(toolName: string): string;
627
627
  /**
628
- * [clay session-dedup, codex F1] Rebuild the EXACT announced name-set by replaying every listing
628
+ * [session-dedup] Rebuild the EXACT announced name-set by replaying every listing
629
629
  * frame in a transcript, in order: an initial frame RESETS the set to its names, a delta frame ADDS,
630
630
  * a removal frame DELETES. Header-presence alone is NOT a safe seed (it proves "announced once", not
631
631
  * WHAT was announced — seeding the current entries would swallow the A→A+B delta and removal-to-zero
@@ -684,12 +684,12 @@ export declare function agentListingDeltaHeader(toolName: string): string;
684
684
  */
685
685
  export declare function renderAgentListingDelta(state: AttachmentState, entries: ReadonlyArray<AgentListingEntry>, toolName: string, models?: readonly string[]): string | undefined;
686
686
  /** [c209-C] R2 C7 — the Q4 catalog line, single-sourced for the initial frame's tail AND the
687
- * drift re-announce arm so the two can never diverge byte-wise. [c209-C] codex 收口 C7 补口: an
687
+ * drift re-announce arm so the two can never diverge byte-wise. [c209-C] 收口 C7 补口: an
688
688
  * EMPTY catalog renders an honest "(none)" — reachable only from the DRIFT arm (a known announced
689
689
  * catalog shrank to nothing; the initial frame still omits the line when there is nothing to offer). */
690
690
  /** Single-sourced carrier prefix of the model-catalog line (renderer + replay parser). */
691
691
  export declare const MODELS_AVAILABLE_PREFIX = "Models available for the 'model' parameter: ";
692
- /** [codex S3 round 3] Replay the ANNOUNCED model catalog from stamped transcript texts — the last
692
+ /** [] Replay the ANNOUNCED model catalog from stamped transcript texts — the last
693
693
  * carried "Models available…" line wins (the line is re-carried in full on every drift, [c209-C]
694
694
  * C7). Undefined = the catalog was never carried (unknowable — the drift compare stays silent,
695
695
  * same conservative arm as an old checkpoint). */
@@ -734,7 +734,7 @@ export declare function commitSkillsListing(state: AttachmentState, entries: Rea
734
734
  * bundle byte cap ({@link ATTACHMENT_BYTE_CAP}) is a per-frame structural backstop on the delta lane
735
735
  * and does not exist AT ALL on the stable system-prompt lane, so without this a single server could
736
736
  * pin an arbitrarily large blob into the cached prompt prefix for the whole task (and, on the delta
737
- * lane, wedge the frame permanently against the 8KB cap — the codex 1362 F2 failure shape).
737
+ * lane, wedge the frame permanently against the 8KB cap — the failure shape).
738
738
  * Sized at the delta lane's own order of magnitude (the 8KB frame budget), leaving fence + header
739
739
  * room under the bundle cap once the "…" truncation marker lands.
740
740
  */
@@ -802,18 +802,18 @@ export declare function renderMcpInstructionsDelta(added: ReadonlyArray<{
802
802
  * loop's intact-survival consumption check (tools_delta discipline).
803
803
  */
804
804
  export declare function renderMcpDroppedTools(entries: ReadonlyArray<McpDroppedTool>): string;
805
- /** codex 1362 F2: per-boundary byte bound for one mcp_dropped_tools frame — half the bundle cap, so
805
+ /** per-boundary byte bound for one mcp_dropped_tools frame — half the bundle cap, so
806
806
  * the batch can never monopolize the boundary against the listing family/changed_files. */
807
807
  export declare const MCP_DROPPED_BATCH_MAX_BYTES = 4096;
808
808
  /**
809
- * codex 1362 F2 (medium) — bounded-batch selection for the dropped-tools announce. An UNBOUNDED
809
+ * (medium) — bounded-batch selection for the dropped-tools announce. An UNBOUNDED
810
810
  * render larger than the 8KB bundle cap gets prefix-CLIPPED by capAttachments; the intact-survival
811
811
  * drain predicate then never matches, the full array is retained, and every later boundary re-renders
812
812
  * and re-clips the identical prefix forever (tail entries never disclosed, permanent cap churn).
813
813
  * Selecting the longest prefix of COMPLETE entries whose render fits {@link MCP_DROPPED_BATCH_MAX_BYTES}
814
814
  * (always ≥1) restores monotonic drainage: the run loop splices exactly the delivered batch, the
815
815
  * tail rides later boundaries. Pure/deterministic so the drain predicate can re-derive the exact
816
- * snapshot. codex r2 F3: the ≥1 floor is SAFE only because entries are bounded at the mcp.ts
816
+ * snapshot. the ≥1 floor is SAFE only because entries are bounded at the mcp.ts
817
817
  * producer (tool ≤160 cps, reason ≤240 cps, both single-lined) — one rendered entry is always a
818
818
  * few hundred bytes, far under both this bound and the 8KB bundle cap, so the single-entry frame
819
819
  * can never be cap-clipped into a permanent re-render wedge.
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * core 薄壳裁定:core 只出接口 + 工具壳 + `hasScheduler` 门控;**持久化存储 / cron 时钟 / idle 触发 / 起新 task 全在
11
11
  * backend(daemon)**——core 是 request-driven 不常驻,绝不假装调度器。NodeExecutionEnv 不自带 daemon(不同于
12
- * background-shell 自带 spawn),而是**委托一个注入的 backend**(飞轮的 shell daemon 实现本接口)。
12
+ * background-shell 自带 spawn),而是**委托一个注入的 backend**(由一个 shell daemon 实现本接口)。
13
13
  */
14
14
  import type { ExecutionEnv, Result } from "../internal/harness-types.js";
15
15
  /** 一个已排未来意图的句柄。**backend-local、durable(daemon 持久化、重启存活)、对调用方不透明** —— 绝不暴露可枚举的 raw id。 */
@@ -114,11 +114,11 @@ export interface ScheduledTaskSummary {
114
114
  * wakeup(cron/task 意图不受 stop 影响——CC 206 D9 语义)。老 backend 不回 = undefined(工具壳以
115
115
  * label 兜底过滤)。 */
116
116
  mode?: "task" | "session-wakeup";
117
- /** [c209-D2] codex B4:生命周期层级回显({@link ScheduledIntent.lifetime})——缺了它,任务创建后就再无
117
+ /** [c209-D2]:生命周期层级回显({@link ScheduledIntent.lifetime})——缺了它,任务创建后就再无
118
118
  * 公开面能辨认自己是会话级还是持久级(CronCreate 的即时 details 是唯一一瞥)。老 backend 不回 =
119
119
  * undefined(层级未知,按既有 durable 直觉读)。 */
120
120
  lifetime?: "durable" | "session";
121
- /** [c209-D2] codex B4:one-shot cron 回显({@link ScheduledIntent.recurring});undefined = 老 backend
121
+ /** [c209-D2]:one-shot cron 回显({@link ScheduledIntent.recurring});undefined = 老 backend
122
122
  * 或非 cron 意图。 */
123
123
  recurring?: boolean;
124
124
  }
@@ -143,7 +143,7 @@ export interface SchedulerCapability {
143
143
  * reap)。缺省 undefined/false = 不支持:工具壳收到 session 语义调用(CC 形 `durable` 缺省 false)时
144
144
  * 诚实拒绝并引导 `durable: true`——**绝不静默落成永生任务**。声明 `true` 的 backend MUST 实现 session
145
145
  * intent 的 reap 消费契约(见 {@link ScheduledIntent.lifetime} 注释)。
146
- * 🔴 codex B2(TOCTOU 契约条款):本能力位 MUST 在 backend **实例生命周期内不可变**(`readonly` 快照,
146
+ * 🔴(TOCTOU 契约条款):本能力位 MUST 在 backend **实例生命周期内不可变**(`readonly` 快照,
147
147
  * 不得热翻)——工具壳的门控读与 `schedule()` 是两次操作,中途翻位会让 session intent 落到不会 reap 的
148
148
  * backend 上。防线双置:声明面不可变 + `schedule()` 实现 MUST 自行拒绝它无法履行 reap 契约的
149
149
  * `lifetime:"session"` intent(fail-closed 兜底,不依赖工具壳的先行探测)。
@@ -155,7 +155,7 @@ export interface SchedulerCapability {
155
155
  */
156
156
  readonly supportsSessionLifetime?: boolean;
157
157
  /**
158
- * TB [991]②b / [997] 裁决 — 宿主是否有会兑现 `mode:"session-wakeup"` intent 的常驻唤醒腿。
158
+ * TB 裁决 — 宿主是否有会兑现 `mode:"session-wakeup"` intent 的常驻唤醒腿。
159
159
  * **opt-out 方向(与 supportsSessionLifetime 的 fail-closed 缺省相反,有意)**:session-wakeup
160
160
  * 是既有工作语义(daemon 宿主已在兑现),缺省关断=误伤现网——缺省/undefined=支持;headless 单发
161
161
  * 宿主(如 `-p` print 路径:零 daemon,进程终答即退)**显式声明 false** ⇒ 工具壳对 ScheduleWakeup
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * This lives in `src/core/` — NOT `src/vendor/` — on purpose. It is OUR security invariant (D1 is a first-party
10
10
  * edit, not openclaw upstream), shared by the (currently-vendored) {@link NodeExecutionEnv} AND a downstream
11
- * adapter (service host adapter, [265]). Keeping the single source of the secret PATTERN here means:
11
+ * adapter (service host adapter). Keeping the single source of the secret PATTERN here means:
12
12
  * 1. A consumer imports it instead of mirroring a regex that would silently DRIFT when the pattern is extended.
13
13
  * 2. The public export points at a STABLE first-party path that SURVIVES the planned de-vendoring refactor —
14
14
  * when NodeExecutionEnv is naturalized out of `src/vendor/`, this module does not move and nothing rebinds.
@@ -1,7 +1,7 @@
1
1
  import type { ExecutionEnv } from "../internal/harness-types.js";
2
2
  import type { ToolPolicy } from "./tool-policy.js";
3
3
  /**
4
- * RECOMMENDED default pattern set for {@link createSensitivePathPolicy} ([871]② — additive export).
4
+ * RECOMMENDED default pattern set for {@link createSensitivePathPolicy} (additive export).
5
5
  * NO upstream verbatim anchor exists (cc-anchors/2.1.209 carries no sensitive/dangerous file-pattern
6
6
  * material), so this is an ENGINEERING-CONSENSUS set — each line states its tradeoff. The factory's
7
7
  * default behavior is unchanged (no implicit default list; wiring this set is the caller's opt-in:
@@ -3,7 +3,7 @@
3
3
  * task-time {@link import("./tool-policy.js").ToolPolicy} (see {@link import("./runner/session-rule-policy.js").createSessionRulePolicy}).
4
4
  *
5
5
  * Why core-owned (not a parallel service store): the rules must be ENFORCED by the same policy fold that runs
6
- * every tool call, so storage and enforcement can't drift (the [210] capability-token invariant). core defines
6
+ * every tool call, so storage and enforcement can't drift (the capability-token invariant). core defines
7
7
  * the seam + an InMemory default; a deployment supplies a DURABLE cross-replica backend (its CAS-rev semantics
8
8
  * must match this InMemory one byte-for-byte — a cross-backend equivalence test is the contract).
9
9
  *
@@ -68,7 +68,7 @@ export interface SessionPolicyStore {
68
68
  getRules(sessionId: string, principal?: string): Promise<StoredSessionRules | null>;
69
69
  putRules(sessionId: string, principal: string | undefined, rules: SessionPermissionRules, opts?: PutRulesOptions): Promise<StoredSessionRules>;
70
70
  /**
71
- * 2c session-sync ([271]): every (principal, rules) record for `sessionId` across ALL principals — `getRules`
71
+ * 2c session-sync: every (principal, rules) record for `sessionId` across ALL principals — `getRules`
72
72
  * is per-(sessionId, principal), but a cross-backend session EXPORT must bundle the WHOLE session's policy.
73
73
  * The importer replays each via `putRules(sessionId, record.principal, record.rules)`. Optional — a backend
74
74
  * that supports cross-backend policy export implements it (local backend uses the in-memory/file impl).
@@ -20,7 +20,7 @@ import type { ToolEffect } from "./types.js";
20
20
  * decision to the model under its verification discipline.
21
21
  * - Use the tool's {@link ToolEffect} to tune the message: `read` carries no risk at all; `idempotent`
22
22
  * is replayable (re-issuing converges the state, but the interrupted attempt may have partially
23
- * landed — RB-221 [1937]); `write` (and unknown tools, conservatively) must be verified/confirmed
23
+ * landed — RB-221); `write` (and unknown tools, conservatively) must be verified/confirmed
24
24
  * before repeating.
25
25
  *
26
26
  * This runs on `acquire` of a resumed session, before the next turn starts. New/empty sessions and
@@ -31,7 +31,7 @@ export interface OrphanToolCall {
31
31
  toolCallId: string;
32
32
  toolName: string;
33
33
  /**
34
- * RB-398-a part 2 (blackboard [2105]): which half of the pair is missing.
34
+ * RB-398-a part 2: which half of the pair is missing.
35
35
  * - absent (the historical shape) = a **call-orphan**: an assistant `toolCall` with no matching
36
36
  * `toolResult` — the reconcile-actionable kind ({@link reconcileInterruptedSession} closes it
37
37
  * with a synthetic interrupted result).
@@ -95,14 +95,14 @@ export declare class TtlSessionStore implements SessionStore {
95
95
  private owners;
96
96
  /** In-flight acquisitions keyed by id, so concurrent acquire(sameId) share one session. */
97
97
  private pending;
98
- /** Subagent transcript persistence (codex 323-r2) — placed ids whose durable deletion FAILED: the
98
+ /** Subagent transcript persistence — placed ids whose durable deletion FAILED: the
99
99
  * placed fact for the retry lives HERE, not on a retained cache entry, because the repo may have
100
100
  * torn down the shared session authority before its removal failed (the File repo closes the
101
101
  * append fd pre-rmSync) — a retained entry would serve a session whose log is closed while the
102
102
  * file still exists (append → log_closed, transcript revival broken until restart). The entry is
103
103
  * dropped instead, so a re-acquire replays a FRESH authority from disk; success clears the row. */
104
104
  private pendingPlacedDeletes;
105
- /** Subagent transcript persistence (codex 323-r3) — placed deletions IN FLIGHT: acquire awaits the
105
+ /** Subagent transcript persistence — placed deletions IN FLIGHT: acquire awaits the
106
106
  * settlement before resolving the id, because the repo's delete tears down the shared session
107
107
  * authority mid-flight — an acquire racing the await window could capture (or rebuild and then
108
108
  * lose) an authority the delete is about to close, and the caller would hold a session whose
@@ -126,7 +126,7 @@ export declare class TtlSessionStore implements SessionStore {
126
126
  * (the trusted-internals form; the creating call and its dedup/retry re-acquires stay legal, and
127
127
  * placement immutability means the argument can never REWRITE anything — the persisted tuple wins).
128
128
  *
129
- * …and the MIRROR direction (codex 323-r1 F1 — the pre-claim SQUAT race): the child session id is
129
+ * …and the MIRROR direction (the pre-claim SQUAT race): the child session id is
130
130
  * published on the spawn frame BEFORE the child's prepare creates the session, so a concurrent
131
131
  * claim-form acquire could win first creation and hand the trusted placement caller an ORDINARY
132
132
  * session — host-listable, never really-deleted, the declared full tier falsified in silence. On
@@ -58,7 +58,7 @@ export interface AcquiredSession {
58
58
  * Named `*StoreSummary` (not the bare `SessionSummary` an earlier version used) because that name collided
59
59
  * with an unrelated, differently-shaped `SessionSummary` downstream (the SDK's wire GET /v1/sessions row) —
60
60
  * same name, two shapes, the exact "同名异形" pattern a cross-repo cleanup was independently eradicating
61
- * elsewhere (黑板 [1912]/[1913]/[1914]). This type is this store interface's own projection, never itself
61
+ * elsewhere. This type is this store interface's own projection, never itself
62
62
  * serialized onto the wire — a service backend re-projects/renames its fields (`lastTaskId` → `lastRunId`)
63
63
  * when building the actual wire response.
64
64
  */
@@ -1,7 +1,7 @@
1
- /** [1093]②/[1105] shutdown forensics — opt-in (`SEMA_DEBUG_SHUTDOWN=1`) stderr trace of every
1
+ /** shutdown forensics — opt-in (`SEMA_DEBUG_SHUTDOWN=1`) stderr trace of every
2
2
  * teardown kill/reap action. stderr lands in the host's engine log, so a "who killed my process"
3
3
  * hunt no longer dead-ends at the drain marker with zero shutdown-phase evidence (test-line pain,
4
- * three times: [1076]④, [1093]②, [1103]③ — the reap lane was the blind spot of the first cut).
4
+ * three times — the reap lane was the blind spot of the first cut).
5
5
  * Zero default noise. Single source: the exec env's kill paths AND the task registry's reap paths
6
6
  * ride this one function, so the flag can never half-cover the kill surface again. */
7
7
  export declare function shutdownDebug(msg: string, extra?: Record<string, unknown>): void;
@@ -9,7 +9,7 @@ export interface SideQueryToolDef {
9
9
  parameters: Tool["parameters"];
10
10
  }
11
11
  /**
12
- * The side-query INPUT message union (codex 1361 r2) — REQUEST shapes, not transcript entries. Each
12
+ * The side-query INPUT message union — REQUEST shapes, not transcript entries. Each
13
13
  * role keeps only what the brain wire actually consumes; the assistant arm drops the response
14
14
  * metadata (`api`/`provider`/`model`/`usage`/`stopReason`) a transcript entry carries — requiring
15
15
  * those would force callers to FABRICATE attribution, the exact shape-forging this verb exists to
@@ -85,7 +85,7 @@ export interface SideQueryResult {
85
85
  /** The RESOLVED pool model id the query was ROUTED to (the caller's ref resolved). See
86
86
  * `servedModel` for the model that actually answered. */
87
87
  model: string;
88
- /** The model that ACTUALLY served the reply (codex 1361: a degrading-brain deployment may fall
88
+ /** The model that ACTUALLY served the reply (a degrading-brain deployment may fall
89
89
  * back mid-query — billing/quality attribution must follow the real server, not the routing
90
90
  * intent). Equals `model` when no degradation occurred. */
91
91
  servedModel: string;
@@ -136,7 +136,7 @@ export declare function snapshotFrozenPaths(resolvedPaths: string[]): Map<string
136
136
  * Restore any frozen file whose on-disk bytes differ from the snapshot (belt for `echo > test/x`-style
137
137
  * bash writes the Write/Edit deny policy cannot see — fable-MIN2). Returns the number of files restored.
138
138
  *
139
- * Symlink-safe (codex 实现审 B2): a tampered entry that is no longer a regular file (the model swapped
139
+ * Symlink-safe (实现审 B2): a tampered entry that is no longer a regular file (the model swapped
140
140
  * it for a symlink pointing outside the root) is REMOVED first — the snapshot bytes are then written to
141
141
  * a fresh regular file, never THROUGH a link. When `rootDir` is given, the parent directory's physical
142
142
  * path is containment-checked too (a symlinked PARENT dir would also carry the write outside); an entry
@@ -4,13 +4,13 @@
4
4
  * already consumes in production). vitest-free BY CONTRACT: the kits run under any harness — a
5
5
  * vitest binding passes `(name, fn) => { it(name, fn); }`, a bare script passes nothing and gets
6
6
  * the sequential default — so a third-party store implementor needs NO test framework to verify
7
- * their backend (cli [2081]: shell/client-core run self-written runners).
7
+ * their backend (shell/client-core run self-written runners).
8
8
  */
9
9
  /**
10
10
  * Labels + schedules one contract case. May return a promise (collected and awaited by the kit's
11
11
  * final `Promise.all`) or register the case with a harness and return void (vitest `it`).
12
12
  *
13
- * ⚠️ Binding note (service [390], inherited from workflowRunStoreContract): cases are REGISTERED
13
+ * ⚠️ Binding note (inherited from workflowRunStoreContract): cases are REGISTERED
14
14
  * eagerly — an async runner that starts work immediately will interleave cases. Every case builds
15
15
  * its own fresh store via `make()`, so interleaving is safe UNLESS your binding's stores share
16
16
  * state (e.g. SQL twins on one table); such bindings must serialize inside `runAssertion`.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/159 S1 — the contract kit's version-lockstep constant (server [2058] requirement).
2
+ * design/159 S1 — the contract kit's version-lockstep constant (a downstream consumer requirement).
3
3
  *
4
4
  * The store-contract kit ships INSIDE `@sema-agent/core` and evolves in lockstep with the engine —
5
5
  * an assertion added because an engine release changed a store's semantics is only meaningful
@@ -15,7 +15,7 @@
15
15
  * ```
16
16
  *
17
17
  * A third party running an old kit against a new engine (or the reverse) would otherwise get a
18
- * silent false-green ([2021] A1 form) — e.g. a pre-2.2.0 kit has no idempotent-reopen entry, so a
18
+ * silent false-green — e.g. a pre-2.2.0 kit has no idempotent-reopen entry, so a
19
19
  * wiping SessionRepo passes it. Compare this constant against the `@sema-agent/core` version you
20
20
  * actually resolved (read the installed package.json — the lock file can pin something older than
21
21
  * what your manifest says).
@@ -9,7 +9,7 @@ import { type ContractAssertionRunner } from "./contract-harness.js";
9
9
  * 后端,于是没进 harness 的那个后端反复独立漂移 ——
10
10
  * - RB-86:`stores/cc/mailbox-store.ts` 注释自陈 "the contract both bundled backends already
11
11
  * honor, missing only here"(空箱 claimLease 不返回 null,还装上幽灵租约);
12
- * - MB1(黑板 [1937]):CC 后端的 `ack` 根本不查 lease 表,注释自陈 "worse than the other two
12
+ * - MB1:CC 后端的 `ack` 根本不查 lease 表,注释自陈 "worse than the other two
13
13
  * backends' pre-fix bug"。
14
14
  * 两次漏的都是同一个后端。修法不是再补一次点,而是把契约本身变成全后端共跑的资产 —— design/159
15
15
  * 再进一步:第三方后端也拿得到同一份资产。
@@ -167,7 +167,7 @@ export async function mailboxAckOwnershipContract(mk, runAssertion) {
167
167
  export async function mailboxBundledOnlyContract(mk, runAssertion) {
168
168
  const { run: runRaw, settle } = beginContract(runAssertion);
169
169
  const run = (name, fn) => runRaw(name, () => withStores(mk, fn));
170
- run("RB-251(黑板 [1937]):handle 含 NUL 被两个后端一致拒绝,且不得跨 (scope,handle) 串箱", async (make) => {
170
+ run("RB-251:handle 含 NUL 被两个后端一致拒绝,且不得跨 (scope,handle) 串箱", async (make) => {
171
171
  const s = make();
172
172
  const NUL = String.fromCharCode(0);
173
173
  await assert.rejects(s.append("s", `a${NUL}b`, msg("secret")));
@@ -55,7 +55,7 @@ export interface TaskNotificationPayload {
55
55
  * to default copy. */
56
56
  stoppedBy?: "user" | "parent" | "system" | (string & {});
57
57
  summary: string;
58
- /** RB-386① ([2090]) — the failure reason DIGEST on a `status:"failed"` terminal notification
58
+ /** RB-386① — the failure reason DIGEST on a `status:"failed"` terminal notification
59
59
  * (background_agent lanes): the same bounded text the settle stored as the registry row's `error`
60
60
  * (the completed frame carries the full `result`; the failed frame used to carry NOTHING machine-
61
61
  * readable — consumers had to parse the summary prose, which pre-fix didn't even include the
@@ -78,7 +78,7 @@ export interface TaskNotificationPayload {
78
78
  partial?: boolean;
79
79
  output_file?: string;
80
80
  usage?: unknown;
81
- /** [1409] CC `<diagnostics>` parity: ENGINE-MINTED teaching text for the "result is empty/unexpected —
81
+ /** CC `<diagnostics>` parity: ENGINE-MINTED teaching text for the "result is empty/unexpected —
82
82
  * now what" moment (per-agent read route / journal coordinate / resume command). Producers must mint it
83
83
  * from engine values only (ids, store locators) — never from model-influenceable text. */
84
84
  diagnostics?: string;
@@ -98,7 +98,7 @@ export interface TaskNotificationPayload {
98
98
  * preconditions, so the claim and the next SendMessage agree. Lets the parent decide
99
99
  * continue-vs-restart without trial-and-error. Background-agent lane only. */
100
100
  resumable?: boolean;
101
- /** P1-3(黑板 [1920]/[1921]/[1924]/[1925], cli/server 商定项) — a cross-channel correlation key for
101
+ /** A cross-channel correlation key for
102
102
  * ONE completion event. The same task's completion fans out across several independent read faces
103
103
  * today (this live notification frame, a durable inbox entry, and the `TaskOutput` poll projection)
104
104
  * — a consumer previously had to reconstruct "are these the same completion?" from weaker signals
@@ -107,7 +107,7 @@ export interface TaskNotificationPayload {
107
107
  * {@link "./task-registry.js".UnifiedTaskOutput.completionId} for the shared contract (open-shape
108
108
  * `string`, absent until terminal settle, absent on a pre-P1-3 core build). Deliberately ABSENT on
109
109
  * the `"external"` lane (`TaskStream.notify()`) — that lane has its own caller-supplied `seq`
110
- * correlation key ([1837]/[1925] cross-repo confirmed posture) and no registry-side settle point to
110
+ * correlation key (confirmed posture) and no registry-side settle point to
111
111
  * mint this from; core-minting one there would create two competing correlation keys on the same
112
112
  * frame. */
113
113
  completionId?: string;
@@ -174,7 +174,7 @@ export interface SystemInjection<TPayload = unknown> {
174
174
  priority: SystemInjectionPriority;
175
175
  dedupKey: string;
176
176
  payload: TPayload;
177
- /** S2b codex R2-F2' — resolved with the ACTUAL injection outcome by the runner's subscribe
177
+ /** S2b' — resolved with the ACTUAL injection outcome by the runner's subscribe
178
178
  * listener: "queued" once the boundary steer accepted, "parked" when the idle tail-race (or the
179
179
  * engine-note backlog cap) rejected and the payload was pended per session. Absent =
180
180
  * fire-and-forget producer (no receipt to honor). */