@sema-agent/core 7.15.0 → 7.16.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 (119) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/core/governance-codes.js +2 -0
  3. package/dist/core/memory-engine/delegation-settlement.d.ts +37 -12
  4. package/dist/core/memory-engine/delegation-settlement.js +128 -39
  5. package/dist/core/memory-engine/engine.d.ts +9 -8
  6. package/dist/core/memory-engine/engine.js +115 -120
  7. package/dist/core/memory-engine/file-backend.d.ts +17 -5
  8. package/dist/core/memory-engine/file-backend.js +78 -34
  9. package/dist/core/memory-engine/index.d.ts +2 -2
  10. package/dist/core/memory-engine/index.js +2 -2
  11. package/dist/core/memory-engine/layout.d.ts +152 -54
  12. package/dist/core/memory-engine/layout.js +441 -104
  13. package/dist/core/memory-engine/types.d.ts +8 -3
  14. package/dist/core/memory-engine/types.js +5 -0
  15. package/dist/core/runner/abort-race.d.ts +3 -3
  16. package/dist/core/runner/active-skill-scope.d.ts +2 -2
  17. package/dist/core/runner/assemble-result.d.ts +29 -29
  18. package/dist/core/runner/checkpoint-scope.d.ts +4 -4
  19. package/dist/core/runner/clock-and-limits.d.ts +3 -3
  20. package/dist/core/runner/compaction-call-options.d.ts +11 -11
  21. package/dist/core/runner/compaction-knobs.d.ts +4 -4
  22. package/dist/core/runner/compaction-seams.d.ts +5 -5
  23. package/dist/core/runner/contracts.d.ts +222 -224
  24. package/dist/core/runner/decide-continuation.d.ts +6 -6
  25. package/dist/core/runner/denial-limit-arms.d.ts +8 -8
  26. package/dist/core/runner/derived-route-fallback.d.ts +2 -2
  27. package/dist/core/runner/gate-exit.d.ts +6 -6
  28. package/dist/core/runner/git-status-frame.d.ts +7 -7
  29. package/dist/core/runner/inherited-ask-grants.d.ts +6 -6
  30. package/dist/core/runner/memory-capture-optout.d.ts +1 -1
  31. package/dist/core/runner/memory-consolidation-driver.d.ts +4 -4
  32. package/dist/core/runner/memory-consolidation.d.ts +6 -6
  33. package/dist/core/runner/park-commit.d.ts +6 -6
  34. package/dist/core/runner/permission-rule-lanes.d.ts +19 -19
  35. package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -4
  36. package/dist/core/runner/prepare-ask-lane.d.ts +3 -3
  37. package/dist/core/runner/prepare-boundary-parks.d.ts +3 -3
  38. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -5
  39. package/dist/core/runner/prepare-config-doors.d.ts +21 -21
  40. package/dist/core/runner/prepare-context-lane.d.ts +6 -6
  41. package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
  42. package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
  43. package/dist/core/runner/prepare-file-history.d.ts +2 -2
  44. package/dist/core/runner/prepare-gate-stations.d.ts +5 -5
  45. package/dist/core/runner/prepare-hands-readface.d.ts +33 -33
  46. package/dist/core/runner/prepare-inherited-gate.d.ts +4 -4
  47. package/dist/core/runner/prepare-listings.d.ts +3 -3
  48. package/dist/core/runner/prepare-lsp.d.ts +3 -3
  49. package/dist/core/runner/prepare-memory-engine-session.d.ts +5 -5
  50. package/dist/core/runner/prepare-memory.js +6 -7
  51. package/dist/core/runner/prepare-offload-wrappers.d.ts +2 -2
  52. package/dist/core/runner/prepare-park-ask.d.ts +6 -6
  53. package/dist/core/runner/prepare-policy-chain.d.ts +4 -4
  54. package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -5
  55. package/dist/core/runner/prepare-protocol-tools.d.ts +1 -1
  56. package/dist/core/runner/prepare-question-face.d.ts +4 -4
  57. package/dist/core/runner/prepare-run-refs.d.ts +11 -11
  58. package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
  59. package/dist/core/runner/prepare-suspend-saga.d.ts +4 -4
  60. package/dist/core/runner/prepare-task.d.ts +12 -12
  61. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +2 -3
  62. package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -4
  63. package/dist/core/runner/prepare-workspace-restore.d.ts +1 -1
  64. package/dist/core/runner/remote-env-retry.d.ts +3 -3
  65. package/dist/core/runner/resume-admission.d.ts +1 -1
  66. package/dist/core/runner/resume-claim.d.ts +1 -1
  67. package/dist/core/runner/resume-internals-and-config.d.ts +1 -1
  68. package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
  69. package/dist/core/runner/resume-preflight.d.ts +1 -1
  70. package/dist/core/runner/resume-review-outcome.d.ts +1 -1
  71. package/dist/core/runner/run-brain-sinks.d.ts +1 -1
  72. package/dist/core/runner/run-clock-and-content.d.ts +4 -4
  73. package/dist/core/runner/run-compaction-machinery.d.ts +3 -3
  74. package/dist/core/runner/run-git-lane.d.ts +1 -1
  75. package/dist/core/runner/run-harness-handlers.d.ts +2 -2
  76. package/dist/core/runner/run-identity-wiring.d.ts +4 -4
  77. package/dist/core/runner/run-leg.d.ts +3 -3
  78. package/dist/core/runner/run-notification-lane.d.ts +2 -2
  79. package/dist/core/runner/run-reasoning-seat.d.ts +2 -2
  80. package/dist/core/runner/run-settle-and-teardown.d.ts +4 -4
  81. package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +2 -2
  82. package/dist/core/runner/run-terminal-adoption.d.ts +5 -5
  83. package/dist/core/runner/runtask.d.ts +14 -14
  84. package/dist/core/runner/session-file-state-replay.d.ts +3 -3
  85. package/dist/core/runner/session-rule-policy.d.ts +2 -2
  86. package/dist/core/runner/steer-admission.d.ts +2 -2
  87. package/dist/core/runner/stream-halt-verbs.d.ts +1 -1
  88. package/dist/core/runner/stream-reap.d.ts +1 -1
  89. package/dist/core/runner/synthetic-tools.d.ts +8 -8
  90. package/dist/core/runner/teardown-bounded.d.ts +2 -2
  91. package/dist/core/runner/tool-defer-gate.d.ts +1 -1
  92. package/dist/core/runner/tool-disclosure.d.ts +33 -33
  93. package/dist/core/runner/tool-end-body.d.ts +3 -3
  94. package/dist/core/runner/tool-face-overlay.d.ts +2 -2
  95. package/dist/core/runner/tool-output-projection.d.ts +2 -2
  96. package/dist/core/runner/turn-attachments.d.ts +53 -53
  97. package/dist/core/runner/usage-accounting.d.ts +4 -4
  98. package/dist/core/runner/workspace-path.d.ts +1 -1
  99. package/dist/engine/llm/types.d.ts +1 -1
  100. package/dist/index.d.ts +2 -2
  101. package/dist/index.js +2 -2
  102. package/dist/tools/fs/bash-readonly-classifier.d.ts +40 -40
  103. package/dist/tools/fs/encoding.d.ts +31 -40
  104. package/dist/tools/fs/fs-bash.d.ts +35 -35
  105. package/dist/tools/fs/fs-pdf.d.ts +8 -8
  106. package/dist/tools/fs/fs-search-tools.d.ts +4 -4
  107. package/dist/tools/fs/fs-shared.d.ts +144 -158
  108. package/dist/tools/fs/fs-write.d.ts +8 -8
  109. package/dist/tools/fs/gh-rate-limit.d.ts +13 -14
  110. package/dist/tools/fs/index.d.ts +74 -78
  111. package/dist/tools/fs/notebook.d.ts +24 -25
  112. package/dist/tools/fs/pdf.d.ts +3 -3
  113. package/dist/tools/fs/read-deny.d.ts +22 -22
  114. package/dist/tools/fs/read-face.d.ts +21 -24
  115. package/dist/tools/fs/repo-map.d.ts +8 -8
  116. package/dist/tools/fs/safety.d.ts +116 -129
  117. package/dist/tools/fs/search.d.ts +63 -71
  118. package/package.json +5 -2
  119. package/test/export-surface.snapshot.json +5 -1
@@ -1,13 +1,13 @@
1
1
  /**
2
- * design/390 §1.2 M8 — prepareTask's LSP phase, verbatim from the driver: the manager fold (spec > deps), the
2
+ * PrepareTask's LSP phase, verbatim from the driver: the manager fold (spec > deps), the
3
3
  * LSP tool mount over the per-task env with its git-ignore filter, the diagnostics lane behind its four
4
4
  * preconditions (a manager whose sessions feed a registry, write-capable hands, not opted out), the run-scoped
5
5
  * registry key, and the edit nudge (raw path → the SAME resolution the tool leg uses → registry reset +
6
6
  * session didChange). No manager ⇒ nothing mounts and both lane seats are undefined. The interface is the
7
- * dependency list the segment had implicitly (design/238 R-1).
7
+ * dependency list the segment had implicitly.
8
8
  *
9
9
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await, so the phase adds no yield between the
10
- * fork-governance note before it and the memory trio's occupancy read after it (design/390 §1.5 S1: a stretch
10
+ * fork-governance note before it and the memory trio's occupancy read after it (a stretch
11
11
  * with no await is extracted as a sync function — an `async` wrapper would open a microtask window).
12
12
  * Read-stability of the host handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
13
13
  */
@@ -1,16 +1,16 @@
1
1
  /**
2
- * design/390 §1.2 M12 — prepareTask's MEMORY-ENGINE-SESSION phase, verbatim from the driver: the content-origin
3
- * classification + one-way session pollution wrap section (design/178 §3 / design/180 half A / design/324 /
4
- * design/336 §3.3 + §5.5 / design/378 D-4 / design/380 O9a). Its arming predicate (a mounted memory session OR an
2
+ * PrepareTask's MEMORY-ENGINE-SESSION phase, verbatim from the driver: the content-origin
3
+ * classification + one-way session pollution wrap section (consolidating several design threads).
4
+ * Its arming predicate (a mounted memory session OR an
5
5
  * upstream recorder channel), the chain-narrowed classification config, the children's provenance seat, the
6
6
  * declared-MCP-class announcement, the settlement seat, the per-tool wrap with its three record verbs (mark /
7
7
  * recordExternal / recordIncomplete), the Read tool's recall-taint arm and the delegation arm's three-valued
8
8
  * attestation judgment all live here; the announcement helper only this section called moved with it. The
9
- * interface is the dependency list the segment had implicitly (design/238 R-1).
9
+ * interface is the dependency list the segment had implicitly.
10
10
  *
11
11
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await of its own (the awaits sit inside the wrappers it
12
12
  * installs, which run at tool-call time), so the phase adds no yield between the deferred classification before it
13
- * and the prompt assembly after it (design/390 §1.5: a stretch with no await is extracted as a sync function).
13
+ * and the prompt assembly after it (a stretch with no await is extracted as a sync function).
14
14
  * Read-stability of the host handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
15
15
  *
16
16
  * One read changed spelling and nothing else: the declared-class announcement read `mcp?.statuses` while `mcp` had
@@ -10,6 +10,7 @@ import { readSessionCaptureOptOut } from "../memory-engine/layout.js";
10
10
  import { createMemoryEngineTools } from "../memory-engine/tools.js";
11
11
  import { assertScopeContractPlacement, parseScopeKey, resolveProjectId } from "../memory-engine/scope-contract.js";
12
12
  import { FileMemoryEngineBackend } from "../memory-engine/file-backend.js";
13
+ import { writableRootOf } from "../memory-engine/types.js";
13
14
  let undeclaredCapturePostureAnnounced = false;
14
15
  export async function prepareMemory(input) {
15
16
  const { spec, deps, sessionId, taskRootPath, memoryWriteGateRef, admissionCtx } = input;
@@ -460,20 +461,18 @@ export async function prepareMemory(input) {
460
461
  }
461
462
  const foreignUnderRoot = [];
462
463
  if (input.writeToolsMounted && writeHandle.writeScope !== null && input.advertisedWritableDirs !== undefined) {
463
- for (const d of [...writeEngine.readonlyDirNamesUnderRoot(writeHandle)].sort())
464
- foreignUnderRoot.push(`another scope's directory ${d}`);
465
464
  const controlPlane = canonicalize(writeEngine.controlPlaneDir);
466
- if (isContainedIn(writeHandle.writableRoot, controlPlane))
465
+ if (isContainedIn(writableRootOf(writeHandle), controlPlane))
467
466
  foreignUnderRoot.push(`the engine's control plane ${controlPlane}`);
468
467
  }
469
468
  if (foreignUnderRoot.length > 0) {
470
- deps.onError?.(new Error(`memory advertised writable directory refused: the write scope's root ${writeHandle.writableRoot} contains what is not the model's to touch (${foreignUnderRoot.join("; ")}) — the file tools' root fence is directory-granular, so admitting it would expose those files; memory writes through the file tools stay closed this session and the write instruction is not taught.`), { phase: "config", sessionId });
469
+ deps.onError?.(new Error(`memory advertised writable directory refused: the write scope's root ${writableRootOf(writeHandle)} contains what is not the model's to touch (${foreignUnderRoot.join("; ")}) — the file tools' root fence is directory-granular, so admitting it would expose those files; memory writes through the file tools stay closed this session and the write instruction is not taught.`), { phase: "config", sessionId });
471
470
  }
472
471
  writeChannelOpen =
473
472
  input.writeToolsMounted &&
474
473
  writeHandle.writeScope !== null &&
475
474
  foreignUnderRoot.length === 0 &&
476
- (input.advertisedWritableDirs === undefined || (await input.advertisedWritableDirs.admit({ path: writeHandle.writableRoot, advertiser: "memory", expectCanonical: writeHandle.writableRoot })));
475
+ (input.advertisedWritableDirs === undefined || (await input.advertisedWritableDirs.admit({ path: writableRootOf(writeHandle), advertiser: "memory", expectCanonical: writableRootOf(writeHandle) })));
477
476
  memoryWriteGateRef.current = async (w) => {
478
477
  if (readOnlyEngine !== undefined && readOnlyHandle !== undefined) {
479
478
  const ro = readOnlyEngine.gateWrite(readOnlyHandle, w.key, w.content);
@@ -482,7 +481,7 @@ export async function prepareMemory(input) {
482
481
  }
483
482
  if (input.memoryPersistenceDeclared === false) {
484
483
  const root = writeHandle.writableRoot;
485
- if (w.key === root || w.key.startsWith(`${root}${sep}`)) {
484
+ if (root !== null && (w.key === root || w.key.startsWith(`${root}${sep}`))) {
486
485
  return {
487
486
  ok: false,
488
487
  code: "read_only_layering",
@@ -493,7 +492,7 @@ export async function prepareMemory(input) {
493
492
  }
494
493
  {
495
494
  const root = writeHandle.writableRoot;
496
- if (w.key === root || w.key.startsWith(`${root}${sep}`)) {
495
+ if (root !== null && (w.key === root || w.key.startsWith(`${root}${sep}`))) {
497
496
  const state = captureOptedOut ? { record: { at: 0, reason: "in-run state" }, fault: false } : await writeEngine.sessionCaptureOptOutOrFault(sessionId);
498
497
  if (state.record !== undefined || state.fault) {
499
498
  return {
@@ -1,11 +1,11 @@
1
1
  /**
2
- * design/390 §1.2 M0 (the offload half of the prelude) — prepareTask's nested-usage accumulator, the
2
+ * (The offload half of the prelude) — prepareTask's nested-usage accumulator, the
3
3
  * large-tool-result offload store resolution and the THREE offload wrappers every later mount site
4
4
  * applies (caller tools, first-party hand tools, remote MCP/A2A peers), verbatim from the driver.
5
5
  *
6
6
  * SYNCHRONOUS by construction: the segment held no await in the driver, and a phase that yields where
7
7
  * the driver did not would open a microtask window between two steps that used to be adjacent (the
8
- * design/238 T1 posture). Nothing here touches the store — the wrappers close over it and only the
8
+ * posture). Nothing here touches the store — the wrappers close over it and only the
9
9
  * wrapped tools' `execute` reach it, at run time.
10
10
  *
11
11
  * What stays in the driver: the trust-axis choice of `offloadScope` (`spec.principal ?? "default"`)
@@ -1,11 +1,11 @@
1
1
  /**
2
- * design/390 §1.2 M19 (park ask) — prepareTask's PARK CLOSURE and CONTENT-ASK ROUTING closure, verbatim from the driver's
2
+ * PrepareTask's PARK CLOSURE and CONTENT-ASK ROUTING closure, verbatim from the driver's
3
3
  * gate-machinery block: `resolveContentAsk` (the question face's delivery race, the binding table's cap and redemption
4
4
  * identity, the stranded-answer disclosure) and `suspendAsk` (the sync-first decline and the park-priority mandates, the
5
5
  * args capture / fidelity projection / re-adjudication steps, the pause-then-cut fence, the gate-kind choice, the row
6
6
  * mint, the commit through the saga and the post-commit publication). The one module-scope helper only this segment
7
- * threw (`ParkRefusal`) moved with it. The interface is the dependency list the segment had implicitly (design/238
8
- * R-1) — the two closures used to capture every seat here off the driver's scope, which is the capture surface this
7
+ * threw (`ParkRefusal`) moved with it. The interface is the dependency list the segment had implicitly
8
+ * — the two closures used to capture every seat here off the driver's scope, which is the capture surface this
9
9
  * decomposition exists to make explicit.
10
10
  *
11
11
  * The thirteen-argument park closure is unchanged: twelve positional seats then the structural {@link AskCarry}, the
@@ -13,7 +13,7 @@
13
13
  * carry onto the row exactly as before — this phase mints no origin, changes no word, adds no arm to the closed set.
14
14
  *
15
15
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await of its own (both closures run per tool call), so the
16
- * phase adds no yield between the boundary parks before it and the gate station after it (design/390 §1.5).
16
+ * phase adds no yield between the boundary parks before it and the gate station after it.
17
17
  * Read-stability of the host handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
18
18
  *
19
19
  * Both closures exist exactly when the ask lane and the saga do (the same predicate) — an absent lane answers two absent
@@ -50,7 +50,7 @@ export interface PrepareParkAskInput {
50
50
  /** borrowed-readonly — the leg's checkpoint store, or undefined (then `suspendAsk` is absent — the park predicate's store
51
51
  * term). Read: the declared fidelity; the saga writes to it. */
52
52
  checkpointStore: CheckpointStore | undefined;
53
- /** borrowed-readonly — the leg's delta seat (design/388 B18): the park reads the gated tool's identity off its
53
+ /** borrowed-readonly — the leg's delta seat (B18): the park reads the gated tool's identity off its
54
54
  * CURRENT roster snapshot so the row carries who the action was minted against. */
55
55
  toolRosterDeltas: ToolRosterDeltaSeat;
56
56
  /** borrowed-readonly — the wiring-manifest phase's park predicate (`parkLane.effective`): arms `suspendAsk`. */
@@ -155,7 +155,7 @@ export interface PrepareParkAskResult {
155
155
  /** The M19 park-ask phase body — prepareTask's park closure and content-ask routing stretch, verbatim (see the module header). */
156
156
  export declare function prepareParkAsk(input: PrepareParkAskInput): PrepareParkAskResult;
157
157
  /**
158
- * From the resumed/active transcript, the batch position of `currentId` (design/45 §4.ter): the tool-call
158
+ * From the resumed/active transcript, the batch position of `currentId`: the tool-call
159
159
  * ids of the assistant message that issued it (the batch), and the subset already resolved (executed
160
160
  * before the suspend — #1..k-1). ID-based, not positional (council Question #1): immune to reordering.
161
161
  */
@@ -1,14 +1,14 @@
1
1
  /**
2
- * design/390 §1.2 M17 (design/238 P21) — prepareTask's POLICY-CHAIN phase, verbatim from the driver: the caller policy
2
+ * PrepareTask's POLICY-CHAIN phase, verbatim from the driver: the caller policy
3
3
  * and its name audit (advisory once per deployment; the two hard refusals), the session / ancestor / frozen-projection /
4
4
  * skill-scope deny-narrowing layers and their fold, the resume-edit base policy, the hook record with its timeout seat
5
5
  * and observational half, the same-instance arbitration machinery (the caller slot's first-decision record), the
6
- * inherited-unavailable marker channel, the RB-40 grant record, the sandbox-admission mode's arming and its three
6
+ * inherited-unavailable marker channel, the grant record, the sandbox-admission mode's arming and its three
7
7
  * sideband maps, the source-identity and risk-axes factories, the two permission-rule lanes and the rule-offer
8
8
  * factory, the approved-edit re-check, the inherited-constraint wrappers (the same-instance adapter and the true
9
9
  * wrapper), the rewrite-emitter index and the instrumented chain, the integrity guards, the fold, and the final-form
10
10
  * re-check that is the effective policy. The advised-names dedupe pair only this section reads moved with it.
11
- * The interface is the dependency list the segment had implicitly (design/238 R-1).
11
+ * The interface is the dependency list the segment had implicitly.
12
12
  *
13
13
  * ASYNC PHASE: the stretch awaits the session-policy store (the task's own rules and each ancestor's live re-read)
14
14
  * exactly where the segment did; the closures it builds await at tool-call time. The phase boundary adds one
@@ -148,7 +148,7 @@ export interface PreparePolicyChainResult {
148
148
  /** borrowed-mutable — the inherited-unavailable marker channel. Writers: the inherited arms here (mark); the gate station
149
149
  * (the lifecycle-end sweep) and the park lane's consumers (delete on consumption). */
150
150
  inheritedUnavailableAsks: Set<string>;
151
- /** borrowed-mutable — the RB-40 grant record. Writers: the inherited arms here (record a clean allow at a live approver);
151
+ /** borrowed-mutable — the grant record. Writers: the inherited arms here (record a clean allow at a live approver);
152
152
  * the gate station (consume on reuse, sweep at settlement). */
153
153
  inheritedAskGrants: Map<string, {
154
154
  approver: unknown;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * design/390 M10 — prepareTask's PROMPT-INPUTS phase: the prompt provider selection, the runtime
2
+ * PrepareTask's PROMPT-INPUTS phase: the prompt provider selection, the runtime
3
3
  * feature flags the harness-context block gates on (so it never claims a mechanism the task lacks),
4
4
  * the three-source user system prompt + the caller's append block, the fenced MCP server-instructions
5
5
  * block, the environment facts (client zone + date basis, knowledge cutoff, the deployment's sandbox
6
6
  * axes, resume-continuity facts on a durable-resume leg only, the hands facts + the one batched env
7
- * probe with its cwd/pwd alignment guard) and the git-status lane probe. The body is the driver's
8
- * stretch moved verbatim; the interface is the dependency list it had implicitly (design/238 R-1).
7
+ * probe with its cwd/pwd alignment guard) and the git-status lane probe. The body is moved verbatim
8
+ * from the driver's own stretch; its interface is the dependency list that stretch had implicitly.
9
9
  *
10
10
  * ASYNC BY CONTENT: the stretch awaits the env probe (hands) and the git-status lane probe (always).
11
11
  * It sits past prepareTask's first await, so the driver's `await` adds no window a caller could reach.
@@ -13,7 +13,7 @@
13
13
  * The one input computed by the DRIVER rather than read here: `failClosedReason` — the
14
14
  * self-orchestration fail-closed advisory's text. Its helper takes the whole `TaskSpec`/`RunnerDeps`
15
15
  * (it audits several deployment seats), which this phase's narrow `spec`/`deps` seats cannot satisfy
16
- * (design/238 R-4); the driver evaluates the helper in the Input literal and this phase only announces
16
+ * The driver evaluates the helper in the Input literal and this phase only announces
17
17
  * the result on the operator lane, exactly where the stretch always did.
18
18
  *
19
19
  * Nothing here throws on its own: the env probe and the alignment guard are best-effort (a stub/odd env
@@ -91,7 +91,7 @@ export interface PreparePromptInputsInput {
91
91
  additionalRootsCanonical: readonly string[];
92
92
  /** borrowed-readonly — the canonical extra read-only roots (copied into the env facts). */
93
93
  additionalReadRootsCanonical: readonly string[];
94
- /** borrowed-readonly — #691: the advertised-writable-directory seat (hands only). The scratchpad section is
94
+ /** borrowed-readonly — the advertised-writable-directory seat (hands only). The scratchpad section is
95
95
  * rendered only when the seat did not SKIP the scratchpad — a directory the fence refused is not advertised. */
96
96
  advertisedWritableDirs?: AdvertisedWritableDirs;
97
97
  /** borrowed-readonly — the acquired session's id (operator-line context). */
@@ -36,7 +36,7 @@ export interface PrepareProtocolToolsInput {
36
36
  * wrapper) and, at RUN time, the refresh closure's splice within a server's name-prefix domain. Later
37
37
  * phases push their own mounts; the roster's full writer table is the delegation-surface phase's. */
38
38
  roster: RosterBuilder;
39
- /** borrowed-mutable — the run-time delta seat (design/388 §2.5): the refresh closure re-mints the roster through it after
39
+ /** borrowed-mutable — the run-time delta seat: the refresh closure re-mints the roster through it after
40
40
  * every re-splice so the stream learns of the change. Armed by the driver after the roster is minted. */
41
41
  rosterSeat: ToolRosterDeltaSeat;
42
42
  /** borrowed-readonly — the large-result wrapper for protocol tools (per-tool `_meta` bar, 50K default). */
@@ -1,17 +1,17 @@
1
1
  /**
2
- * design/390 §1.2 M7 — prepareTask's QUESTION-FACE phase, verbatim from the driver: the leg's ONE checkpoint-store
2
+ * PrepareTask's QUESTION-FACE phase, verbatim from the driver: the leg's ONE checkpoint-store
3
3
  * read, the durable mandate as it binds at the question seat, the content-ask binding table (with the leak
4
4
  * bound the routing lane checks against — the constant below), the stranded-answer disclosure and the leg-end
5
5
  * settle, the three-way mount decision (live face / durable face / override), and the AskUserQuestion mount
6
6
  * with its redeemed-approval, posture, fallback and synthetic-continuation arms. The interface is the
7
- * dependency list the segment had implicitly (design/238 R-1).
7
+ * dependency list the segment had implicitly.
8
8
  *
9
9
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await, so the phase adds no yield between the
10
- * offload-reader mount before it and the scheduler mount after it (design/390 §1.5 S1: a stretch with no await
10
+ * offload-reader mount before it and the scheduler mount after it (a stretch with no await
11
11
  * is extracted as a sync function — an `async` wrapper would open a microtask window). Read-stability of the
12
12
  * host handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
13
13
  *
14
- * One seat is a LIVE GETTER (design/238 D-3): the inherited-unavailable marker set is declared by the driver's
14
+ * One seat is a LIVE GETTER: the inherited-unavailable marker set is declared by the driver's
15
15
  * gate-fold section AFTER this phase and read per call at RUN time, so it enters as `() => ReadonlySet` — a
16
16
  * read before the driver declares it throws (temporal dead zone), which is the fail-loud an uninitialized
17
17
  * live read owes.
@@ -1,17 +1,17 @@
1
1
  /**
2
- * design/390 §1.2 M3a — prepareTask's RUN-REFS phase, verbatim from the driver: the run's own edited-files
2
+ * PrepareTask's RUN-REFS phase, verbatim from the driver: the run's own edited-files
3
3
  * ledger, the harness ref, the per-task skill scope, the display-forwarding wrapper, the three run-local refs
4
4
  * (review request / stop-after-turn / plan mode) with the ctx primitives that write them, the subagent-retain
5
5
  * ledger and the worktree-isolation helper. Nothing here has behavior of its own: the phase MINTS SEATS —
6
6
  * mutable cells and the closures bound to them — that later phases, the tool ctx and the run loop read and
7
- * write. The interface is the dependency list the segment had implicitly (design/238 R-1).
7
+ * write. The interface is the dependency list the segment had implicitly.
8
8
  *
9
9
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await, so the phase adds no yield between the
10
- * file-history phase before it and the inherited-gate fold after it (design/390 §1.5 S1: a stretch with no
10
+ * file-history phase before it and the inherited-gate fold after it (a stretch with no
11
11
  * await is extracted as a sync function — an `async` wrapper would open a microtask window).
12
12
  *
13
- * Every cell that leaves here as `borrowed-mutable` carries its writer table on the Result member (design/238
14
- * R-3): the closures minted here, the driver's harness build, the project-context phase's inherited-skill
13
+ * Every cell that leaves here as `borrowed-mutable` carries its writer table on the Result member:
14
+ * the closures minted here, the driver's harness build, the project-context phase's inherited-skill
15
15
  * seed, the skill tool, and the run loop's two writes — nothing else writes them. Read-stability of the host
16
16
  * handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
17
17
  */
@@ -43,8 +43,8 @@ export interface PrepareRunRefsResult {
43
43
  /** owned — the ledger's LIVE read face (`Prepared.editedFilesSnapshot`, read at result assembly). */
44
44
  editedFilesSnapshot: EditedFilesLedger["snapshot"];
45
45
  /** borrowed-mutable — the harness seat: holds the harness once built, so a tool's execute can read the model
46
- * the parent is CURRENTLY on (design/38 1B: the `ToolExecuteContext.model` snapshot a delegation tool uses
47
- * for `inherit`), and breaks the harness↔tool_search build cycle (design/36 rematerialize). Writers (R-3):
46
+ * the parent is CURRENTLY on (the `ToolExecuteContext.model` snapshot a delegation tool uses
47
+ * for `inherit`), and breaks the harness↔tool_search build cycle (rematerialize). Writers (R-3):
48
48
  * the driver, ONCE, when the harness is built (`harnessRef.current = harness`) — before any run. Readers:
49
49
  * `requestStopAfterTurn` here (mirrors the stop onto the harness's one-way flag), the tool ctx's model
50
50
  * snapshot, the rebuild seam and the delegation mounts. Identity is the contract: every closure minted
@@ -63,7 +63,7 @@ export interface PrepareRunRefsResult {
63
63
  * (the first request wins) and the run loop's turn-boundary consumer, which clears `pending` once the
64
64
  * `plan_review` checkpoint is minted. */
65
65
  reviewRequestRef: Prepared["reviewRequestRef"];
66
- /** owned — the ctx primitive that arms `reviewRequestRef` (design/80 D-B). */
66
+ /** owned — the ctx primitive that arms `reviewRequestRef`. */
67
67
  requestReview: (opts?: {
68
68
  reason?: string;
69
69
  }) => void;
@@ -79,7 +79,7 @@ export interface PrepareRunRefsResult {
79
79
  /** owned — the ctx primitive (mounted on the ctx only under `enablePlanMode`). */
80
80
  enterPlanMode: () => void;
81
81
  /** ownership-ref — the parent-run subagent-retain ledger, or undefined when the spec did not opt in. Its
82
- * lifecycle protocol belongs to the Runner (disposed in the task's terminal finally, design/122 D4); a
82
+ * lifecycle protocol belongs to the Runner (disposed in the task's terminal finally); a
83
83
  * prepare that throws has nothing to release here — the ledger is empty until a delegation retains. */
84
84
  subagentRetain: SubagentRetainLedger | undefined;
85
85
  /** owned — the Agent tool's worktree-isolation helper (lazy; write-capable runs only), or undefined. */
@@ -90,8 +90,8 @@ export interface PrepareRunRefsResult {
90
90
  * A run that opted into `forwardSubagentEvents` may have BACKGROUND children whose frames are forwarded to the
91
91
  * deployment's sink from the child's own run. Those forwards are scheduled on later microtasks than the parent's
92
92
  * turn, so "the parent stream ended" and "the child's already-emitted frames reached the sink" are two different
93
- * moments — the gap is one microtask ladder deep and moves whenever the gate's station structure changes (design/393
94
- * / #594: the three-layer gate added three async frames to a child's gated call, and a consumer that read the parent
93
+ * moments — the gap is one microtask ladder deep and moves whenever the gate's station structure changes
94
+ * (the three-layer gate added three async frames to a child's gated call, and a consumer that read the parent
95
95
  * to `done` then inspected the sink lost the child's `tool_end`). The rule is not a tick count: **before the parent
96
96
  * says `done`, every frame a child had already handed to the forward channel is delivered.** One macrotask turn is
97
97
  * the smallest boundary that strictly orders after all pending microtasks; it is taken only on the opted-in run,
@@ -9,7 +9,7 @@ export interface PrepareSafetyScanInput {
9
9
  deps: RunnerDeps;
10
10
  }
11
11
  /**
12
- * The scan's outputs. Ownership annotations (design/238 §4.2 four-class form):
12
+ * The scan's outputs. Ownership annotations (four-class form):
13
13
  *
14
14
  * `ownToolNames` is **borrowed-readonly** — a first-await snapshot with no mutation anywhere after
15
15
  * the scan; its one later read is the sandbox-boundary predicate's `.has()`.
@@ -1,16 +1,16 @@
1
1
  /**
2
- * design/390 §1.2 M19 (suspend saga) — prepareTask's DURABLE SETTLEMENT machinery, verbatim from the driver's
2
+ * PrepareTask's DURABLE SETTLEMENT machinery, verbatim from the driver's
3
3
  * gate-machinery block: the in-flight spend and repair-bundle folds, the §4.bis correctness-state serializer, the shared
4
4
  * paused-VM compensation bound to this task's failure ledger, the put-commit + put-failure saga (the pre-put cut
5
5
  * checkpoint, the screening-park disclosure, the rejection read-back with its three answers), the suspend-loop cap, the
6
6
  * env capability split (suspendable / park-only / neither) and the park-only handle. The module-scope helpers only this
7
7
  * segment called moved with it (the compensation's bound and body, the auto-mode latch reading, the placement stamp).
8
- * The interface is the dependency list the segment had implicitly (design/238 R-1) — every seat below used to be
8
+ * The interface is the dependency list the segment had implicitly — every seat below used to be
9
9
  * captured off the driver's scope.
10
10
  *
11
11
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await of its own (every await lives inside the closures it
12
12
  * builds, which run at park time), so the phase adds no yield between the ask lane before it and the boundary parks
13
- * after it (design/390 §1.5). Read-stability of the host handles for the call: {@link RunInternals}
13
+ * after it. Read-stability of the host handles for the call: {@link RunInternals}
14
14
  * (`@contract prepare.deps-read-stable`).
15
15
  *
16
16
  * The saga exists exactly when the wiring-manifest phase's `gateMachineryActive` holds (the ask lane's presence law) —
@@ -27,7 +27,7 @@ import type { OutputRef } from "./synthetic-tools.js";
27
27
  import type { HookInvocationIdentity } from "../hooks.js";
28
28
  import type { InheritedGate, Prepared, PrepareResume, RunInternals, SuspendSaga } from "./contracts.js";
29
29
  /**
30
- * design/384 slice 2 — the ONE compensation for a paused-but-unparked VM, shared by the fence's
30
+ * The ONE compensation for a paused-but-unparked VM, shared by the fence's
31
31
  * post-pause checkpoints (③ in the park closure, ④ in the saga) and the saga's put-failure absent
32
32
  * arm (previously inline there: same two hops, one implementation now, so the three sites cannot
33
33
  * drift). Restores the workspace (bounded transient retry) then re-establishes consistency
@@ -26,7 +26,7 @@ export declare function __resetToolModelGateAnnouncements(): void;
26
26
  export declare const TOOL_MODEL_GATE_RESTORE_SENTENCE = "restore via TaskSpec.restoreGatedTools, SEMA_TOOL_MODEL_GATE=off, or RunnerDeps.toolModelGate: false";
27
27
  export { __resetReadFaceClampAnnouncement } from "./prepare-hands-readface.js";
28
28
  /**
29
- * design/164 件四 — how long before an execution environment's declared `lifetimeMs` expires the engine
29
+ * How long before an execution environment's declared `lifetimeMs` expires the engine
30
30
  * stops the run and checkpoints it. The margin has to cover ONE suspend: pausing/snapshotting the
31
31
  * workspace, minting the checkpoint, committing it durably, and letting the loop stop cleanly — with
32
32
  * room for a slow durable store. 60s is generous for that work and small next to any real sandbox
@@ -39,7 +39,7 @@ export { __resetReadFaceClampAnnouncement } from "./prepare-hands-readface.js";
39
39
  */
40
40
  export declare const ENV_LIFETIME_SUSPEND_MARGIN_MS = 60000;
41
41
  /**
42
- * design/164 件四 — resolve the moment an env's lifetime EXPIRES (epoch ms), or `undefined` when the env
42
+ * Resolve the moment an env's lifetime EXPIRES (epoch ms), or `undefined` when the env
43
43
  * declares none / cannot be aged. Split out as a pure function so the anchor rules are testable and
44
44
  * stated once.
45
45
  *
@@ -66,7 +66,7 @@ export { isFableFamilyModelId, resolveAttachmentsConfig, resolveModelPromptTrait
66
66
  export { rebaseWorkspacePath, rebaseWorkspacePathAcross } from "./workspace-path.js";
67
67
  /** Everything the run loop needs, built once by {@link prepareTask} (task setup, isolated from the loop). */
68
68
  /**
69
- * RB-330 + 5.38 r2 件2 — the SINGLE effective-delegation derivation for a leg, minted once per prepare
69
+ * The SINGLE effective-delegation derivation for a leg, minted once per prepare
70
70
  * and read by EVERY consumer face; two facets, one source:
71
71
  *
72
72
  * - `isDelegatedChild` — the raw delegation fact, forks included. Trusted internals first; on a
@@ -79,10 +79,10 @@ export { rebaseWorkspacePath, rebaseWorkspacePathAcross } from "./workspace-path
79
79
  * the `hookIdentity` mint.
80
80
  * - `isNonForkChild` — the fact minus forks, for the authority/context faces: the `loadProjectMemory`
81
81
  * ctx flag ({@link RunnerDeps.loadProjectMemory} `isSubagent`) and the prompt runtime fact
82
- * `isSubagent` (RB-204's `SUBAGENT_CONSENT_NOTICE` gate). A FORK is excluded on both, deliberately:
83
- * a fork IS the parent continuing (design/110), so it inherits the parent's authority — and, on the
82
+ * `isSubagent` (the `SUBAGENT_CONSENT_NOTICE` gate). A FORK is excluded on both, deliberately:
83
+ * a fork IS the parent continuing, so it inherits the parent's authority — and, on the
84
84
  * memory face, the parent's own project context; trimming a fork's CLAUDE.md would hand the
85
- * continuation LESS context than the run it continues. (RB-330 history: the memory face once used
85
+ * continuation LESS context than the run it continues. (The memory face must not use
86
86
  * `parentTaskId !== undefined` alone, which {@link RunInternals.isDelegatedChild}'s own docstring
87
87
  * forbids — a directly-started workflow's children have no nameable parent.)
88
88
  *
@@ -95,7 +95,7 @@ export declare function effectiveDelegationFacts(internals: Pick<RunInternals, "
95
95
  isNonForkChild: boolean;
96
96
  };
97
97
  /**
98
- * Build everything a task run needs (council design/34 ②: a free function with EXPLICIT deps, not a
98
+ * Build everything a task run needs (a free function with EXPLICIT deps, not a
99
99
  * Runner method — testable and decoupled). Resolves the model/role/thinking, acquires + reconciles the
100
100
  * session (with the conflict-detecting Proxy + bounded re-wake on a lost CAS), assembles the tool set
101
101
  * (caller tools + offload wrap + report_blocked + submit_output + MCP + memory + read_tool_result),
@@ -104,19 +104,19 @@ export declare function effectiveDelegationFacts(internals: Pick<RunInternals, "
104
104
  * flow** lives here — that stays in the Runner loop.
105
105
  */
106
106
  export declare function prepareTask(spec: TaskSpec, deps: RunnerDeps, sessions: SessionStore, resume?: PrepareResume, internals?: RunInternals,
107
- /** design/98 §3.1 (S8c): a TRUSTED self-reference to the Runner, passed by the Runner itself (never a
107
+ /** A TRUSTED self-reference to the Runner, passed by the Runner itself (never a
108
108
  * TaskSpec field) so the `run_workflow` tool can execute child tasks via `runner.runTask`. Undefined when
109
109
  * prepareTask is exercised standalone (then run_workflow is simply not mounted). */
110
110
  runnerSelf?: RunnerSelfSeat,
111
- /** #499 — carrier for the id minted below, so a prepare that THROWS still lets its caller name the
111
+ /** Carrier for the id minted below, so a prepare that THROWS still lets its caller name the
112
112
  * run (prepare emits run-scoped notices of its own; each needs a terminal that names it). Same seat
113
113
  * shape the Runner uses for the generated taskId/sessionId. */
114
114
  runIdSink?: {
115
115
  runId?: string;
116
116
  }): Promise<Prepared>;
117
- /** design/393 S7 (#675) — the entry IS the contract the notification lane's seat names ({@link PrepareTaskFn}, contracts.ts):
118
- * a signature change reds HERE, at the declaration, as `false` failing the `true` bound. IDENTITY, not assignability (review
119
- * round 1): the parameter tuple (arity, optionality, each type) and the return type must be the SAME type in both directions —
117
+ /** The entry IS the contract the notification lane's seat names ({@link PrepareTaskFn}, contracts.ts):
118
+ * a signature change reds HERE, at the declaration, as `false` failing the `true` bound. IDENTITY, not assignability:
119
+ * the parameter tuple (arity, optionality, each type) and the return type must be the SAME type in both directions —
120
120
  * one-way `extends` let a dropped trailing parameter, an added optional one or a narrowed return slip through. Type-level only —
121
121
  * nothing is emitted. */
122
122
  type Holds<T extends true> = T;
@@ -1,12 +1,11 @@
1
1
  /**
2
- * design/390 §1.2 M14 — prepareTask's TOOL-DISCLOSURE-MOUNT phase, verbatim from the driver: the deferred registry
2
+ * PrepareTask's TOOL-DISCLOSURE-MOUNT phase, verbatim from the driver: the deferred registry
3
3
  * and its placeholders, the ToolSearch mount with its serialized activation section, the materialize strategy's
4
4
  * two-layer resolution (spec over the env channel, the safety interlock, the loud arms for a discarded env value), the
5
5
  * per-tool static exemption with its monotone ledger, the activation seed from the transcript / compaction snapshots /
6
6
  * checkpoint, the callable-names accessor the offload preview and ToolSearch share, the delta ref with its failed-server
7
7
  * arm, and the RefreshMcpTools rebuild seam's two arms. The env-channel announce ledger (per sink, per line) moved with
8
- * the segment — only this phase announces through it. The interface is the dependency list the segment had implicitly
9
- * (design/238 R-1).
8
+ * the segment — only this phase announces through it. The interface is the dependency list the segment had implicitly.
10
9
  *
11
10
  * ASYNC PHASE: with deferred names present the segment awaits the session's context and branch (the activation seed),
12
11
  * exactly where the driver awaited them; with nothing deferred the body has no await of its own. The phase adds no yield
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/390 §1.2 M18 — prepareTask's WIRING-MANIFEST phase, verbatim from the driver: the run's own frozen approver
2
+ * PrepareTask's WIRING-MANIFEST phase, verbatim from the driver: the run's own frozen approver
3
3
  * seat, the loud ungated-write warning (hand band / destructive MCP / first-party write tools with no effect-aware gate,
4
4
  * deduped per deployment and tool-set shape), the PreToolUse context stash and the blocked-call set, the settlement and
5
5
  * bare-rejection sidebands, the turn halt fact, the suspend infrastructure predicates (restore surface gap, durable
@@ -7,10 +7,10 @@
7
7
  * durableApproval, the effective wiring manifest, the peer lane's ask fold and drain binding, the park predicate as ONE
8
8
  * named const, the durable-gate-unavailable notice, the hook identity mint and the hook env face. The four helpers only
9
9
  * this segment called moved with it (usage governance, the per-deployment warn ledger, the MCP manifest projection, the
10
- * durable-gate notice). The interface is the dependency list the segment had implicitly (design/238 R-1).
10
+ * durable-gate notice). The interface is the dependency list the segment had implicitly.
11
11
  *
12
12
  * SYNCHRONOUS FUNCTION, SYNCHRONOUS CALL: the stretch has no await, so the phase adds no yield between the policy-chain
13
- * station before it and the gate registration after it (design/390 §1.5: a stretch with no await is extracted as a sync
13
+ * station before it and the gate registration after it (a stretch with no await is extracted as a sync
14
14
  * function). Read-stability of the host handles for the call: {@link RunInternals} (`@contract prepare.deps-read-stable`).
15
15
  *
16
16
  * One read changed spelling and nothing else: the manifest's MCP face read `mcp?.statuses ?? []` while `mcp` had long
@@ -103,7 +103,7 @@ export interface PrepareWiringManifestInput {
103
103
  sessions: SessionStore;
104
104
  /** borrowed-readonly — the model gate's per-leg read face, or undefined. */
105
105
  modelGateManifest: WiringManifest["modelGate"];
106
- /** borrowed-readonly — the leg's minted tool roster (design/388): rides the manifest's `tools` section and is the
106
+ /** borrowed-readonly — the leg's minted tool roster: rides the manifest's `tools` section and is the
107
107
  * source of the hand band's write-capable names for the ungated-write warning (what actually MOUNTED). */
108
108
  toolRoster: ToolRoster;
109
109
  /** borrowed-readonly — the arming outcome the caps phase minted (the manifest's auto-mode face). */
@@ -45,7 +45,7 @@ export interface PrepareWorkspaceRestoreResult {
45
45
  * phases, so a consumer moved ahead of this call is a lexical error. */
46
46
  taskRootFinal: string;
47
47
  /** owned (pure function; closes over the phase-armed rebase state) — migrates one checkpointed
48
- * absolute path from the OLD workspace root onto the restored one (RB-439-c: any accepted
48
+ * absolute path from the OLD workspace root onto the restored one (any accepted
49
49
  * spelling of the old root); the identity function when no divergence was armed. Consumers (T7):
50
50
  * the readFileState checkpoint seed, the handsCwd seed, the activeWorktree restore. */
51
51
  rebaseRestoredPath: (p: string) => string;
@@ -1,13 +1,13 @@
1
1
  import type { RemoteExecutionEnv, RemoteExecutionError, SnapshotId, VmLifecycleOptions } from "../remote-env.js";
2
2
  import type { RemoteEnvFailureNote } from "../types.js";
3
3
  /**
4
- * RB-439-a — project one failed remote lifecycle call onto the caller-facing note. ONE builder for all
4
+ * Project one failed remote lifecycle call onto the caller-facing note. ONE builder for all
5
5
  * three ops so the `retryable` classification can never drift between the lane that reports a `suspendVM`
6
6
  * refusal and the lane that reports a failed restore.
7
7
  */
8
8
  export declare function remoteEnvFailureNote(op: RemoteEnvFailureNote["op"], error: RemoteExecutionError, attempts: number): RemoteEnvFailureNote;
9
9
  /**
10
- * RB-439-a — `resumeVM` with a bounded retry on the TRANSIENT codes, plus the attempt count for the
10
+ * `resumeVM` with a bounded retry on the TRANSIENT codes, plus the attempt count for the
11
11
  * caller-facing note.
12
12
  *
13
13
  * Why this op and no other: `resumeVM` is the one lifecycle call the seam documents as "idempotent +
@@ -19,7 +19,7 @@ export declare function remoteEnvFailureNote(op: RemoteEnvFailureNote["op"], err
19
19
  * attempt — `withRetry` will not spend a second call on a permanent refusal.
20
20
  */
21
21
  export declare function restoreWorkspaceWithRetry(env: RemoteExecutionEnv, snapshotId: SnapshotId, options: VmLifecycleOptions,
22
- /** design/384 slice 2 (additive): observe each attempt AS IT STARTS. The returned `attempts` is
22
+ /** Observe each attempt AS IT STARTS. The returned `attempts` is
23
23
  * only readable after settlement, and a caller whose wait on this promise is BOUNDED (the park
24
24
  * compensation) must report the live attempt count when its bound fires mid-call — without this
25
25
  * seat a deaf second attempt was reported as `attempts: 1`. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's ADMISSION rung (E1) and the wake's shaping (E2), verbatim from
2
+ * The resume ladder's ADMISSION rung (E1) and the wake's shaping (E2), verbatim from
3
3
  * `Runner.resumeStream`: the outcome container's domain, the one-read snapshots of the caller's config and
4
4
  * the trusted internals bag, the store resolution, the row read and its terminal-status confirm, the
5
5
  * same-process parent-constraint re-supply, then the wake pre-ladder (gate purity, pendingAction purity,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's CLAIM rung (E10), verbatim from `Runner.resumeStream`: the atomic
2
+ * The resume ladder's CLAIM rung (E10), verbatim from `Runner.resumeStream`: the atomic
3
3
  * CAS (`claimTerminal` when the store provides it — one round trip carrying the loser's truth — else the
4
4
  * two-step `resolve` + diagnostic read), the same-Runner claim mark around it, and the loss classification
5
5
  * (`reopened_concurrently` for a live row whose rev moved, `already_resolved` for a consumed one, with the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's INTERNALS-AND-CONFIG rung (E7), verbatim from `Runner.resumeStream`:
2
+ * The resume ladder's INTERNALS-AND-CONFIG rung (E7), verbatim from `Runner.resumeStream`:
3
3
  * the locked-policy guard on the resume-edit seat, the principal and placement identity-continuity rungs,
4
4
  * and the governance-window ENTRANCE check for a row that still owes a delivery.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's APPROVAL-LANE capture and binding rung (E4), verbatim from
2
+ * The resume ladder's APPROVAL-LANE capture and binding rung (E4), verbatim from
3
3
  * `Runner.resumeStream`: on a human / irreversible_ask row every deployment-supplied field of the
4
4
  * `policy_ask` decide is read exactly once into a plain twin (answer canonicalized, updatedInput cloned to the
5
5
  * JSON domain, the decision word, the refused keys, the host's decision facts and attribution, the deny note),
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's deployment PREFLIGHT rung (E9), verbatim from `Runner.resumeStream`:
2
+ * The resume ladder's deployment PREFLIGHT rung (E9), verbatim from `Runner.resumeStream`:
3
3
  * the LAST rung before the CAS. The deployment's `resumePreflight` screens the resume off the persisted row's
4
4
  * facts under its own validated deadline; every non-answer arm refuses retry-later (the row stays pending);
5
5
  * only an explicit, fully readable `terminal` verdict settles the row through the single-shot expire CAS
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S3 — the resume ladder's gate-match rung and the review / park TWINS (E3), verbatim from
2
+ * The resume ladder's gate-match rung and the review / park TWINS (E3), verbatim from
3
3
  * `Runner.resumeStream`: the outcome arm must match the persisted gate kind; a review-gate outcome
4
4
  * (plan_review / dry_run_review) is captured into a plain twin with its domain and text-payload checks, the
5
5
  * break-out-tag hygiene and the env_failed replay guard; the two tool-less park lanes (wake / resource_limit)
@@ -21,7 +21,7 @@ export interface RunBrainSinksInput {
21
21
  observeReasoningWireFacts: (facts: ReasoningWireFacts) => void;
22
22
  }
23
23
  export interface RunBrainSinksResult {
24
- /** design/99 BC-2: the subagent's human display name for its `task_progress` ticks, or undefined. */
24
+ /** The subagent's human display name for its `task_progress` ticks, or undefined. */
25
25
  subagentName: string | undefined;
26
26
  /** Compose the three brain ALS sinks around a brain-driving call. */
27
27
  withBrainSinks: <T>(fn: () => Promise<T>) => Promise<T>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * design/393 S5 — the run body's CLOCK and CONTENT seats (R6), verbatim from `Runner.runLocked`: the per-slice
2
+ * The run body's CLOCK and CONTENT seats (R6), verbatim from `Runner.runLocked`: the per-slice
3
3
  * walltime window and its MONOTONIC deadline anchored at task start, the hard-abort timer armed against that same
4
4
  * deadline (a suspendable task gets the backstop grace), the content-event push that also forwards a sub-agent's
5
5
  * events to the parent's display sink, the run's own committed-tail ref and the `message_committed` mint that
@@ -34,15 +34,15 @@ export interface RunClockAndContentInput {
34
34
  startedToolCallIds: Set<string>;
35
35
  }
36
36
  export interface RunClockAndContentResult {
37
- /** design/164: the PER-SLICE active clock, or undefined (0 is a valid, exhausted window). */
37
+ /** The PER-SLICE active clock, or undefined (0 is a valid, exhausted window). */
38
38
  effectiveTimeoutMs: number | undefined;
39
- /** RB-20: the monotonic deadline every walltime enforcement decision reads, or undefined. */
39
+ /** The monotonic deadline every walltime enforcement decision reads, or undefined. */
40
40
  walltimeMonotonicDeadline: number | undefined;
41
41
  /** The hard walltime backstop: its fired flag / lateness, and the clear the teardown calls. */
42
42
  timeout: ReturnType<typeof startTimeout>;
43
43
  /** Push a content event to the run's queue and, for a sub-agent, to the parent's display sink. */
44
44
  pushContent: (e: TaskEvent) => void;
45
- /** #483: the id of the LAST entry this run committed — the settle-time seal's provenance anchor. */
45
+ /** The id of the LAST entry this run committed — the settle-time seal's provenance anchor. */
46
46
  ownCommittedTailRef: {
47
47
  current: string | undefined;
48
48
  };