@sema-agent/core 5.57.0 → 5.58.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 (183) hide show
  1. package/CHANGELOG.md +48 -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/status-sink.d.ts +2 -2
  20. package/dist/brain/stream-shared.d.ts +1 -1
  21. package/dist/config/catalog.d.ts +5 -5
  22. package/dist/core/arg-summary.d.ts +4 -4
  23. package/dist/core/ask-class.d.ts +2 -2
  24. package/dist/core/ask-question.d.ts +1 -1
  25. package/dist/core/auto-compaction.d.ts +15 -15
  26. package/dist/core/auto-mode.d.ts +5 -5
  27. package/dist/core/background-agent-store.d.ts +20 -20
  28. package/dist/core/background-shell.d.ts +4 -4
  29. package/dist/core/checkpoint-store.d.ts +35 -27
  30. package/dist/core/context-edit.d.ts +1 -1
  31. package/dist/core/context-guard.d.ts +1 -1
  32. package/dist/core/exec-output-tail.d.ts +6 -6
  33. package/dist/core/file-snapshot-store.d.ts +8 -8
  34. package/dist/core/git-worktree-env.d.ts +3 -3
  35. package/dist/core/governance-codes.js +2 -0
  36. package/dist/core/hooks.d.ts +73 -33
  37. package/dist/core/hooks.js +87 -25
  38. package/dist/core/image-downsample.d.ts +1 -1
  39. package/dist/core/locked-config.d.ts +1 -1
  40. package/dist/core/lsp.d.ts +1 -1
  41. package/dist/core/mailbox-store.d.ts +1 -1
  42. package/dist/core/mcp.d.ts +3 -3
  43. package/dist/core/memory-engine/consolidation-driver.d.ts +207 -0
  44. package/dist/core/memory-engine/consolidation-driver.js +378 -0
  45. package/dist/core/memory-engine/consolidation.d.ts +46 -2
  46. package/dist/core/memory-engine/consolidation.js +1 -0
  47. package/dist/core/memory-engine/data-plane.d.ts +1 -1
  48. package/dist/core/memory-engine/distiller.d.ts +550 -0
  49. package/dist/core/memory-engine/distiller.js +598 -0
  50. package/dist/core/memory-engine/dual-root.d.ts +1 -1
  51. package/dist/core/memory-engine/engine.d.ts +47 -3
  52. package/dist/core/memory-engine/engine.js +37 -3
  53. package/dist/core/memory-engine/file-backend.d.ts +1 -1
  54. package/dist/core/memory-engine/index.d.ts +4 -2
  55. package/dist/core/memory-engine/index.js +4 -2
  56. package/dist/core/memory-engine/origin-clearance.d.ts +1 -1
  57. package/dist/core/memory-engine/scope-contract.d.ts +4 -4
  58. package/dist/core/memory-engine/sync-client.d.ts +16 -16
  59. package/dist/core/memory-engine/sync.d.ts +4 -4
  60. package/dist/core/memory-recall.d.ts +1 -1
  61. package/dist/core/memory.d.ts +2 -2
  62. package/dist/core/permission-rule-consent.d.ts +185 -36
  63. package/dist/core/permission-rule-consent.js +219 -44
  64. package/dist/core/permission-rule-model.d.ts +194 -31
  65. package/dist/core/permission-rule-model.js +93 -35
  66. package/dist/core/permission-rules.d.ts +9 -9
  67. package/dist/core/remote-env.d.ts +8 -8
  68. package/dist/core/roles.d.ts +3 -3
  69. package/dist/core/roles.js +1 -0
  70. package/dist/core/runner/assemble-result.d.ts +2 -2
  71. package/dist/core/runner/compaction-call-options.d.ts +3 -3
  72. package/dist/core/runner/memory-consolidation-driver.d.ts +49 -0
  73. package/dist/core/runner/memory-consolidation-driver.js +60 -0
  74. package/dist/core/runner/memory-consolidation.d.ts +1 -1
  75. package/dist/core/runner/prepare-config-doors.d.ts +3 -3
  76. package/dist/core/runner/prepare-task.d.ts +21 -21
  77. package/dist/core/runner/prepare-task.js +21 -14
  78. package/dist/core/runner/prepare-workspace-restore.d.ts +2 -2
  79. package/dist/core/runner/runtask.d.ts +11 -11
  80. package/dist/core/runner/session-rule-policy.d.ts +1 -1
  81. package/dist/core/runner/teardown-bounded.d.ts +1 -1
  82. package/dist/core/runner/tool-disclosure.d.ts +2 -2
  83. package/dist/core/runner/turn-attachments.d.ts +11 -11
  84. package/dist/core/scheduler.d.ts +5 -5
  85. package/dist/core/secret-env.d.ts +1 -1
  86. package/dist/core/sensitive-path-policy.d.ts +1 -1
  87. package/dist/core/session-policy-store.d.ts +2 -2
  88. package/dist/core/session-reconcile.d.ts +2 -2
  89. package/dist/core/session-store.d.ts +3 -3
  90. package/dist/core/session.d.ts +1 -1
  91. package/dist/core/shutdown-debug.d.ts +2 -2
  92. package/dist/core/side-query.d.ts +2 -2
  93. package/dist/core/spec-contract.d.ts +1 -1
  94. package/dist/core/store-contracts/contract-harness.d.ts +2 -2
  95. package/dist/core/store-contracts/contract-kit-version.d.ts +2 -2
  96. package/dist/core/store-contracts/mailbox-store-contract.d.ts +1 -1
  97. package/dist/core/store-contracts/mailbox-store-contract.js +1 -1
  98. package/dist/core/task-notification.d.ts +5 -5
  99. package/dist/core/task-registry-agent.d.ts +12 -12
  100. package/dist/core/task-registry-monitor.d.ts +1 -1
  101. package/dist/core/task-registry-shared.d.ts +41 -41
  102. package/dist/core/task-registry.d.ts +12 -12
  103. package/dist/core/tool-detach.d.ts +2 -2
  104. package/dist/core/tool-errors.d.ts +3 -3
  105. package/dist/core/tool-policy.d.ts +55 -28
  106. package/dist/core/tool-result-budget.d.ts +1 -1
  107. package/dist/core/tool-result-store.d.ts +2 -2
  108. package/dist/core/tools.d.ts +1 -1
  109. package/dist/core/trace.d.ts +26 -23
  110. package/dist/core/types.d.ts +123 -70
  111. package/dist/core/untrusted-egress.d.ts +1 -1
  112. package/dist/core/untrusted-text.d.ts +7 -7
  113. package/dist/core/wiring-manifest.d.ts +5 -5
  114. package/dist/core/workflow-journal-store.d.ts +14 -14
  115. package/dist/core/workflow-run-store-contract.d.ts +1 -1
  116. package/dist/core/workflow-run-store-contract.js +1 -1
  117. package/dist/core/workflow-run-store.d.ts +4 -4
  118. package/dist/engine/compaction/compaction.d.ts +3 -3
  119. package/dist/engine/compaction/utils.d.ts +2 -2
  120. package/dist/engine/execution-env/kill-tree.d.ts +1 -1
  121. package/dist/engine/execution-env/node-execution-env.d.ts +8 -8
  122. package/dist/engine/harness/agent-harness.d.ts +6 -6
  123. package/dist/engine/harness/messages.d.ts +1 -1
  124. package/dist/engine/harness/types.d.ts +10 -10
  125. package/dist/engine/llm/types.d.ts +14 -14
  126. package/dist/engine/loop/agent-loop.d.ts +3 -3
  127. package/dist/engine/loop/types.d.ts +4 -4
  128. package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
  129. package/dist/engine/session/import-validate.d.ts +1 -1
  130. package/dist/engine/session/log-digest.d.ts +1 -1
  131. package/dist/engine/session/memory-repo.d.ts +2 -2
  132. package/dist/engine/session/session.d.ts +4 -4
  133. package/dist/fixtures/index.d.ts +4 -4
  134. package/dist/index.d.ts +5 -4
  135. package/dist/index.js +3 -2
  136. package/dist/orchestration/goal.d.ts +1 -1
  137. package/dist/orchestration/run-spec.d.ts +1 -1
  138. package/dist/orchestration/run-workflow-tool.d.ts +12 -12
  139. package/dist/orchestration/workflow-governance.d.ts +4 -4
  140. package/dist/orchestration/workflow-observe.d.ts +1 -1
  141. package/dist/orchestration/workflow-script-runner.d.ts +1 -1
  142. package/dist/orchestration/workflow-script-store.d.ts +9 -9
  143. package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
  144. package/dist/orchestration/workflow-types.d.ts +5 -5
  145. package/dist/orchestration/workflow.d.ts +10 -10
  146. package/dist/prompt-assembly/artifact-store.d.ts +1 -1
  147. package/dist/prompt-assembly/artifact.d.ts +1 -1
  148. package/dist/prompt-assembly/assemble.d.ts +1 -1
  149. package/dist/prompt-assembly/composer.d.ts +2 -2
  150. package/dist/prompt-assembly/epoch.d.ts +2 -2
  151. package/dist/prompt-assembly/event-registry.d.ts +1 -1
  152. package/dist/prompt-assembly/explain.d.ts +3 -3
  153. package/dist/prompt-assembly/tool-catalog.d.ts +1 -1
  154. package/dist/prompt-assembly/turn-snapshot.d.ts +4 -4
  155. package/dist/prompt-assembly/types.d.ts +12 -12
  156. package/dist/prompts/coordinator.d.ts +1 -1
  157. package/dist/prompts/default.d.ts +8 -8
  158. package/dist/prompts/simple-sections.d.ts +3 -3
  159. package/dist/prompts/supervisor.d.ts +2 -2
  160. package/dist/scenarios/full-body.d.ts +3 -3
  161. package/dist/scenarios/scenario-registry.d.ts +1 -1
  162. package/dist/stores/cc/sidecar-transcript.d.ts +3 -3
  163. package/dist/stores/file/fs-atomic.d.ts +2 -2
  164. package/dist/stores/file/index.d.ts +1 -1
  165. package/dist/stores/file/session-store.d.ts +2 -2
  166. package/dist/stores/file/workflow-journal-store.d.ts +4 -4
  167. package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
  168. package/dist/tools/fs/encoding.d.ts +4 -4
  169. package/dist/tools/fs/fs-bash.d.ts +3 -3
  170. package/dist/tools/fs/fs-pdf.d.ts +1 -1
  171. package/dist/tools/fs/fs-shared.d.ts +6 -6
  172. package/dist/tools/fs/index.d.ts +2 -2
  173. package/dist/tools/fs/notebook.d.ts +1 -1
  174. package/dist/tools/fs/pdf.d.ts +1 -1
  175. package/dist/tools/fs/read-deny.d.ts +1 -1
  176. package/dist/tools/fs/safety.d.ts +9 -9
  177. package/dist/tools/fs/search.d.ts +2 -2
  178. package/dist/tools/monitor.d.ts +3 -3
  179. package/dist/tools/task-list.d.ts +2 -2
  180. package/dist/tools/web.d.ts +4 -4
  181. package/dist/tools/worktree.d.ts +5 -5
  182. package/package.json +1 -1
  183. package/test/export-surface.snapshot.json +56 -3
@@ -1,5 +1,5 @@
1
1
  import type { EngineNotice } from "../types.js";
2
- import { type ConsolidationGateRow, type ConsolidationPlanFile, type ConsolidationProposal, type MemoryConsolidationOptions } from "./consolidation.js";
2
+ import { type ConsolidationGateRow, type ConsolidationPlanFile, type ConsolidationProposal, type ConsolidationRunStopReason, type MemoryConsolidationOptions } from "./consolidation.js";
3
3
  import { foreignDanglingSessionAccounts, type EffectiveSettlement, type HoldRow } from "./delegation-settlement.js";
4
4
  import { type OriginClearanceRow } from "./origin-clearance.js";
5
5
  import { type CommittedBinding, type EraseMemoryEntriesInput, type MemoryErasureAttestation, type TransferEvidence } from "./file-backend.js";
@@ -251,7 +251,7 @@ export interface MemoryInjection {
251
251
  * session's harvest / the backend's read-side external-change detection). Already rendered into
252
252
  * {@link block}; exposed raw for observability/tests. Absent when the queue was empty. */
253
253
  announcements?: MemoryAnnouncement[];
254
- /** The RENDERED announcements segment of {@link block} (design/142 S2b, codex H11): dual-root
254
+ /** The RENDERED announcements segment of {@link block} (design/142 S2b): dual-root
255
255
  * merging composes from STRUCTURED fields — never by re-parsing `block` (whose instruction/index
256
256
  * segments contain blank lines a split would shred). Absent when the queue was empty. */
257
257
  announceBlock?: string;
@@ -485,7 +485,7 @@ export interface ConsolidationReconcileReport {
485
485
  state: "completed" | "conflict";
486
486
  };
487
487
  releasedOrphanSeat?: string;
488
- /** codex r2 — a seat whose plan file is absent but whose claim is YOUNGER than the freeze grace:
488
+ /** a seat whose plan file is absent but whose claim is YOUNGER than the freeze grace:
489
489
  * a live commit is (very likely) mid-freeze; reconcile leaves it alone and reports it here. */
490
490
  seatInFlight?: string;
491
491
  corruptPlan?: {
@@ -543,6 +543,28 @@ export declare function memoryConsolidationConflictNotice(input: {
543
543
  planId: string;
544
544
  scope: string;
545
545
  }): EngineNotice;
546
+ /**
547
+ * design/376 §1.6-2 — the ADVISORY notice for a driver run that stopped short of its fixpoint
548
+ * (`memory.consolidation_incomplete`). Partial folds are measurably worse than no fold (currency
549
+ * queries regress to the unconsolidated baseline while the residue stays buried), so a run that
550
+ * committed some cycles and stopped must be visible as a TRANSITIONAL state — without this code an
551
+ * operator sees only a trail of `_committed` notices and cannot tell a settled library from one
552
+ * mid-fold. `stop` takes its value from the ONE closed set the run receipt uses
553
+ * ({@link ConsolidationRunStopReason}); the two channels never carry different vocabularies.
554
+ *
555
+ * The message branches on `cyclesDone` (truthfulness, both arms pinned): a run that stopped at
556
+ * the door — a parked seat, a failed mint — committed NOTHING, and its line says the library is
557
+ * unchanged by this run rather than asserting a partial fold this run never produced. (The
558
+ * PARTIAL-fold claim stays a per-run statement; whether the library was already mid-fold from an
559
+ * earlier run is the gate's account, not this line's.)
560
+ */
561
+ export declare function memoryConsolidationIncompleteNotice(input: {
562
+ scope: string;
563
+ runId: string;
564
+ stop: ConsolidationRunStopReason;
565
+ residueProducts: number;
566
+ cyclesDone: number;
567
+ }): EngineNotice;
546
568
  /** The refusal's notice dialect (the verb itself throws the coded {@link ConsolidationRefusedError};
547
569
  * a host converting the throw into its notice stream uses this one spelling). */
548
570
  export declare function memoryConsolidationRefusedNotice(input: {
@@ -1006,6 +1028,28 @@ export declare class MemoryEngine {
1006
1028
  /** §6.2 — host read face: one scope's gate row (undefined when the store has no row — reading
1007
1029
  * never creates the file, so the OFF deployment stays byte-identical, G1). */
1008
1030
  readConsolidationGate(scope: string): ConsolidationGateRow | undefined;
1031
+ /**
1032
+ * design/376 片② — host read face: one scope's committed FOLD STATE, in the freeze's own
1033
+ * accounting (`active` counts entries neither superseded nor excluded — byte-for-byte the
1034
+ * denominator `commitConsolidationPlan` re-derives for the supersession fuse). The driver plans
1035
+ * UNDER the fuse instead of discovering it as a refusal, and every count it publishes is a store
1036
+ * delta read through here — the fuse denominator and the published counts are store facts, never
1037
+ * driver assumptions. Side-effect-free committed read; an unreadable governance overlay refuses
1038
+ * coded (a silently wrong denominator would mis-schedule every remaining cycle).
1039
+ */
1040
+ readConsolidationFoldState(scope: string): Promise<{
1041
+ active: number;
1042
+ superseded: number;
1043
+ products: number;
1044
+ }>;
1045
+ /**
1046
+ * Host read face: the engine's RESOLVED control-plane directory (the same coordinate a
1047
+ * directory-pinned backend already publishes as `controlPlaneRoot`; this accessor answers it
1048
+ * after the engine's own precedence — backend pin > constructor argument > derived default).
1049
+ * The shipped consolidation driver keeps its run account and mint archives in this plane
1050
+ * (design/376 §1.6-4); path knowledge is not authority — nothing here bypasses a verb.
1051
+ */
1052
+ get controlPlaneRoot(): string;
1009
1053
  /** The committed, side-effect-free audit read: the adoption-restricted committed view when the
1010
1054
  * backend offers one (zero-copy File — ledger+shadow, no disk adoption), else the non-adopting
1011
1055
  * retrieval view (copy-out File), else the backend itself (Pg/TiDB shapes — naturally committed
@@ -197,6 +197,15 @@ export function memoryConsolidationConflictNotice(input) {
197
197
  detail: { planId: input.planId, scope: inlineUntrusted(input.scope, 80) },
198
198
  };
199
199
  }
200
+ export function memoryConsolidationIncompleteNotice(input) {
201
+ return {
202
+ code: "memory.consolidation_incomplete",
203
+ message: input.cyclesDone === 0
204
+ ? `Memory consolidation run ${input.runId} for scope ${inlineUntrusted(input.scope, 80)} stopped ${input.stop} after 0 committed cycle(s) — this run made no writes and the library is unchanged by it (the stop reason names the block; a fresh run re-distills from a full snapshot).`
205
+ : `Memory consolidation run ${input.runId} for scope ${inlineUntrusted(input.scope, 80)} stopped ${input.stop} after ${input.cyclesDone} committed cycle(s) with ${input.residueProducts} proposed product(s) unfolded — the library is in a PARTIAL fold (committed cycles stand; the next run's full snapshot re-distills the remainder).`,
206
+ detail: { scope: inlineUntrusted(input.scope, 80), runId: input.runId, stop: input.stop, residueProducts: input.residueProducts, cyclesDone: input.cyclesDone },
207
+ };
208
+ }
200
209
  export function memoryConsolidationRefusedNotice(input) {
201
210
  return {
202
211
  code: "memory.consolidation_refused",
@@ -2579,7 +2588,7 @@ export class MemoryEngine {
2579
2588
  const marked = candidates.some((c) => c.marked);
2580
2589
  const epoch = row?.epoch ?? 0;
2581
2590
  const cycleToken = createHash("sha256").update(JSON.stringify([scope, epoch, at, Object.entries(candidateRevs).sort()]), "utf8").digest("hex").slice(0, 32);
2582
- updateConsolidationGate(this.controlDir, (file) => {
2591
+ const announceForce = updateConsolidationGate(this.controlDir, (file) => {
2583
2592
  const fresh = file.scopes[scope] ?? { sessions: { count: 0, ring: [] }, epoch: 0 };
2584
2593
  if (fresh.openPlanId !== undefined) {
2585
2594
  throw new ConsolidationRefusedError("memory.consolidation_busy", `memory consolidation refused: plan ${fresh.openPlanId} claimed the ${JSON.stringify(scope)} seat during the snapshot read.`);
@@ -2588,10 +2597,15 @@ export class MemoryEngine {
2588
2597
  throw new ConsolidationRefusedError("memory.consolidation_stale_snapshot", `memory consolidation refused: the ${JSON.stringify(scope)} watermark advanced during the snapshot read — retake the snapshot.`);
2589
2598
  }
2590
2599
  fresh.snapshot = { token: cycleToken, at, epoch, candidates: candidateRevs, eligible: eligibleRevs, marked };
2600
+ let announce = false;
2601
+ if (opts.force !== undefined && fresh.lastForcedRequestId !== opts.force.requestId) {
2602
+ fresh.lastForcedRequestId = opts.force.requestId;
2603
+ announce = true;
2604
+ }
2591
2605
  file.scopes[scope] = fresh;
2592
- return { next: file, result: undefined };
2606
+ return { next: file, result: announce };
2593
2607
  });
2594
- if (opts.force !== undefined) {
2608
+ if (opts.force !== undefined && announceForce) {
2595
2609
  try {
2596
2610
  enqueueMemoryAnnouncement(this.controlDir, { kind: "gate", at, items: [`memory consolidation snapshot FORCED past the time/session gates for scope ${inlineUntrusted(scope, 80)} (requestId ${inlineUntrusted(opts.force.requestId, 80)})`] });
2597
2611
  }
@@ -3444,6 +3458,26 @@ export class MemoryEngine {
3444
3458
  return undefined;
3445
3459
  }
3446
3460
  }
3461
+ async readConsolidationFoldState(scope) {
3462
+ const face = this.committedAuditFace();
3463
+ const headers = await face.listHeaders([scope]);
3464
+ let exclusions;
3465
+ try {
3466
+ exclusions = this.readChallengeExclusions();
3467
+ }
3468
+ catch (err) {
3469
+ throw new ConsolidationRefusedError("memory.consolidation_governance_unreadable", `memory consolidation fold-state read refused: the challenge/lineage ledger cannot be trusted (fail-closed): ${err instanceof Error ? err.message : String(err)}`);
3470
+ }
3471
+ const superseded = deriveSupersededSet(headers, { excluded: (id) => exclusions.has(id) });
3472
+ return {
3473
+ active: headers.filter((h) => !superseded.has(h.id) && !exclusions.has(h.id)).length,
3474
+ superseded: superseded.size,
3475
+ products: headers.filter((h) => h.distilled !== undefined).length,
3476
+ };
3477
+ }
3478
+ get controlPlaneRoot() {
3479
+ return this.controlDir;
3480
+ }
3447
3481
  committedAuditFace() {
3448
3482
  const b = this.backend;
3449
3483
  return b.restrictedAdoptionView?.({ audit: false }) ?? b.retrievalView?.() ?? this.backend;
@@ -357,7 +357,7 @@ export interface FileMemoryEngineBackendOptions {
357
357
  onIncident?: MemoryPartitionIncidentSink;
358
358
  }
359
359
  /**
360
- * ⚠️ DEPLOYMENT BOUNDARY (N0 定谳,channel 给service-AI.md [412],2026-07-09):this backend — and the
360
+ * ⚠️ DEPLOYMENT BOUNDARY (ruled 2026-07-09): this backend — and the
361
361
  * file memory engine's materialize/harvest — operates on the WORKER-HOST fs plane (node:fs), matching
362
362
  * CC's `~/.claude` host-plane memory (the only behavior anchor). It is NOT ExecutionEnv-aware: when a
363
363
  * deployment routes the model's file tools to a REMOTE sandbox (e2b/k8s/ssh/adb/local-docker), the two
@@ -1,4 +1,4 @@
1
- export { MemoryEngine, buildMemoryInstruction, truncateIndex, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, memoryRecallDisciplineSegment, entryFileHeadCarriesOrigin, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, renderAnnouncements, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationRefusedNotice, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, } from "./engine.js";
1
+ export { MemoryEngine, buildMemoryInstruction, truncateIndex, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, memoryRecallDisciplineSegment, entryFileHeadCarriesOrigin, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, renderAnnouncements, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, } from "./engine.js";
2
2
  export { MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, type MemoryGetDetails, } from "./tools.js";
3
3
  export { MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, MEMORY_PROVENANCE_RECALL_SENTENCE, MEMORY_PROVENANCE_SEARCH_SENTENCE, memoryExposureIndexRow, parseMemoryExposureIndexRow, } from "./provenance-wording.js";
4
4
  export { scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE } from "./scan.js";
@@ -8,7 +8,9 @@ export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlane
8
8
  export { readV2HeaderHints, isInstructionEntry, type V2HeaderHints } from "./header-hints.js";
9
9
  export { parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, committedOriginOf, originEquals, ambiguousOriginRepresentation, type ParsedEntryFile } from "./frontmatter.js";
10
10
  export { committedDistilledOf, distilledEquals } from "./frontmatter.js";
11
- export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type MemoryConsolidationOptions, } from "./consolidation.js";
11
+ export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type MemoryConsolidationOptions, CONSOLIDATION_RUN_STOP_REASONS, type ConsolidationRunStopReason, } from "./consolidation.js";
12
+ export { DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintLlmConsolidationPlan, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, } from "./distiller.js";
13
+ export { CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type RunMemoryConsolidationOptions, } from "./consolidation-driver.js";
12
14
  export { MEMORY_ORIGIN_CAUSES } from "./types.js";
13
15
  export type { MemoryBackend, MemoryEntry, MemoryEntryFrontmatter, MemoryEntryOrigin, MemoryOriginCause, MemoryEntryDistilled, MemoryEntryDistilledInput, MemoryEntryHeader, ScoredMemoryEntry, NotePatch, PatchReport, MaterializedFile, MemorySessionHandle, HarvestReport, HarvestRejection, HarvestRejectionCode, MemoryAnnouncement, ScanFinding, } from "./types.js";
14
16
  export { memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, } from "./memory-backend-contract.js";
@@ -1,4 +1,4 @@
1
- export { MemoryEngine, buildMemoryInstruction, truncateIndex, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, memoryRecallDisciplineSegment, entryFileHeadCarriesOrigin, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, renderAnnouncements, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationRefusedNotice, } from "./engine.js";
1
+ export { MemoryEngine, buildMemoryInstruction, truncateIndex, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, memoryRecallDisciplineSegment, entryFileHeadCarriesOrigin, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, renderAnnouncements, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, } from "./engine.js";
2
2
  export { MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, } from "./tools.js";
3
3
  export { MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, MEMORY_PROVENANCE_RECALL_SENTENCE, MEMORY_PROVENANCE_SEARCH_SENTENCE, memoryExposureIndexRow, parseMemoryExposureIndexRow, } from "./provenance-wording.js";
4
4
  export { scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE } from "./scan.js";
@@ -8,7 +8,9 @@ export { ControlPlaneCorruptError, deriveControlPlaneDir, deriveRepoControlPlane
8
8
  export { readV2HeaderHints, isInstructionEntry } from "./header-hints.js";
9
9
  export { parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, committedOriginOf, originEquals, ambiguousOriginRepresentation } from "./frontmatter.js";
10
10
  export { committedDistilledOf, distilledEquals } from "./frontmatter.js";
11
- export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, } from "./consolidation.js";
11
+ export { CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, readIntentCredentials, supersessionFuseCeiling, CONSOLIDATION_RUN_STOP_REASONS, } from "./consolidation.js";
12
+ export { DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintLlmConsolidationPlan, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, } from "./distiller.js";
13
+ export { CONSOLIDATION_DRIVER_PLANS_DIR, CONSOLIDATION_DRIVER_RUNS_FILE, archiveDistillerPlan, readConsolidationDriverRun, runMemoryConsolidationDriver, } from "./consolidation-driver.js";
12
14
  export { MEMORY_ORIGIN_CAUSES } from "./types.js";
13
15
  export { memoryBackendContract, assertMemoryBackendSearchEquivalence, } from "./memory-backend-contract.js";
14
16
  export { SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, } from "./scope-contract.js";
@@ -63,7 +63,7 @@ export declare function markOriginClearanceTombstoned(controlDir: string, input:
63
63
  /**
64
64
  * Terminal event append + status flip. Unknown clearanceId is a corrupt-caller refusal.
65
65
  *
66
- * SINGLE-WINNER terminal (codex r1): a row already terminal ignores a late contradictory
66
+ * SINGLE-WINNER terminal: a row already terminal ignores a late contradictory
67
67
  * settlement — two concurrent resumers race the store legs (the store's own CAS decides those),
68
68
  * and the loser's stale verdict must not overwrite the winner's audit state (a successfully
69
69
  * cleared entry reading `failed` with contradictory events). The loser's own thrown refusal is
@@ -10,7 +10,7 @@ export declare const SCOPE_SEGMENT_MAX_ENCODED = 64;
10
10
  */
11
11
  export declare function encodeScopeSegment(raw: string): string;
12
12
  /**
13
- * Inverse of {@link encodeScopeSegment}, CANONICAL-FORM ONLY (codex 复审 B6): the input must be
13
+ * Inverse of {@link encodeScopeSegment}, CANONICAL-FORM ONLY: the input must be
14
14
  * exactly what the encoder produces — safe chars stay bare (so `%41` for `A` is refused: two
15
15
  * spellings of one identity must not mint two keys), `%XX` sequences must decode as valid UTF-8
16
16
  * (fatal decoder — no U+FFFD smoothing), and the 64-char cap holds here too (parse side enforces
@@ -52,7 +52,7 @@ export declare function parseScopeKey(key: string): ParsedScopeKey;
52
52
  export declare function isPersonalScope(parsed: ParsedScopeKey): boolean;
53
53
  /** True when the key's AUTHORITY is central (design/142 §2 表: user/userproj/org rows) — these keys
54
54
  * must never project into an in-repo memory dir (they would leak to every collaborator AND enter
55
- * commit history; codex 复审 B1 extended the F9 gate from personal to org). `proj:`/legacy stay
55
+ * commit history; extended the F9 gate from personal to org). `proj:`/legacy stay
56
56
  * repo-planed. */
57
57
  export declare function isCentralAuthorityScope(parsed: ParsedScopeKey): boolean;
58
58
  /**
@@ -71,14 +71,14 @@ export declare function assertScopeContractPlacement(args: {
71
71
  /** Repo-root marker file: minted once (by scaffold/deployment, NEVER by the engine), committed, and
72
72
  * from then on the project's identity survives clone/copy/rename/machine/cloud-sandbox. */
73
73
  export declare const PROJECT_MARKER_PATH = ".sema/project";
74
- /** projectId 格式单源([637]① 承诺):generic UUID,version nibble 不收紧——宽读严写(读面认外部/
74
+ /** projectId 格式单源:generic UUID,version nibble 不收紧——宽读严写(读面认外部/
75
75
  * 历史 v4;铸造面 formatProjectMarker / center mint 统一产 uuidv7)。center 侧自持镜像+dev-only
76
76
  * drift 锁对着这条(registry-core coreTypes 先例)。 */
77
77
  export declare const PROJECT_ID_REGEX: RegExp;
78
78
  /** Serialize a marker file body (scaffold-side helper; the engine itself never writes one). */
79
79
  export declare function formatProjectMarker(projectId: string): string;
80
80
  /** Parse a marker body: TOML-subset `key = value` lines, `#` comments and blank lines ignored,
81
- * optional quotes around the value. Unknown keys are ignored (forward-compatible). codex 复审 H7:
81
+ * optional quotes around the value. Unknown keys are ignored (forward-compatible).
82
82
  * ANY line that starts a `projectId` assignment but is not one canonical UUID assignment is a
83
83
  * CORRUPT marker (fail-loud, `config.memory_project_marker`) — an empty value, an unclosed quote,
84
84
  * a non-UUID, or a DUPLICATE projectId line must never degrade to "no marker" (that would be a
@@ -5,7 +5,7 @@ import { type MemoryBackend, type MemoryEntry, type PatchReport } from "./types.
5
5
  * DECODED JSON body of a 2xx response; any non-2xx / network failure should THROW (the round then
6
6
  * aborts with zero local side effects — the transport runs before any local write). */
7
7
  export type MemorySyncTransport = (path: string, body: unknown) => Promise<unknown>;
8
- /** The wire REQUEST of one round (the server's `parseMemorySyncRequest` twin — [671]①): the push
8
+ /** The wire REQUEST of one round (the server's `parseMemorySyncRequest` twin): the push
9
9
  * half as computed against the client's own cursor. `deletes` ⊆ `Object.keys(baseRevs)` by
10
10
  * construction (a delete is CAS'd on its baseline; an id never synced cannot be delete-propagated). */
11
11
  export interface MemorySyncRequestBody {
@@ -14,20 +14,20 @@ export interface MemorySyncRequestBody {
14
14
  baseRevs: Record<string, string>;
15
15
  /** Full state of every entry new/changed here since the baseline. When
16
16
  * {@link SyncMemoryScopeOptions.maxPushEntries} is set this is the id-ascending PREFIX of the
17
- * full push set ([767]③ batching — the remainder rides later rounds). */
17
+ * full push set (batching — the remainder rides later rounds). */
18
18
  entries: MemoryEntry[];
19
19
  /** Ids deleted here since the baseline (tombstoned or gone from the local plane). Deletes are
20
- * NEVER batched/split — they are id+baseRev pairs, weightless next to entry bodies ([767]③). */
20
+ * NEVER batched/split — they are id+baseRev pairs, weightless next to entry bodies. */
21
21
  deletes: string[];
22
- /** [767]③ pull-half batching (wire contract; server implements the response side): ask the
23
- * server to cap this round's pull half at `limit` items. Absent ⇔ unbatched (the pre-[767]③
22
+ /** pull-half batching (wire contract; server implements the response side): ask the
23
+ * server to cap this round's pull half at `limit` items. Absent ⇔ unbatched (the prior
24
24
  * wire shape byte-for-byte — old servers never see the key). */
25
25
  pull?: {
26
26
  limit?: number;
27
27
  };
28
28
  }
29
- /** The wire RESPONSE of one round (server `MemorySyncResponse` twin — [671]①: one RTT, both
30
- * directions; `serverDeletes` is the delete-propagation leg [codex B4 — without it a central
29
+ /** The wire RESPONSE of one round (server `MemorySyncResponse` twin: one RTT, both
30
+ * directions; `serverDeletes` is the delete-propagation leg [without it a central
31
31
  * removal never crosses = livelock]; `cursor` is the server-computed next baseline with the
32
32
  * retention discipline ALREADY applied to the pull half). */
33
33
  export interface MemorySyncResponseBody {
@@ -57,7 +57,7 @@ export interface MemorySyncResponseBody {
57
57
  baseRevs: Record<string, string>;
58
58
  updatedAtMs: number;
59
59
  };
60
- /** [767]③ pull-half batching (wire contract; server sets it): true ⇔ the server withheld part
60
+ /** pull-half batching (wire contract; server sets it): true ⇔ the server withheld part
61
61
  * of the pull half under the requested `pull.limit` — the caller should run another round.
62
62
  * The server MUST retain every withheld id at the OLD baseline inside `cursor` (the client
63
63
  * refuses prefilled undelivered revs — see ⑤ defense — so violating this only costs the
@@ -87,22 +87,22 @@ export interface SyncMemoryScopeOptions {
87
87
  peer?: string;
88
88
  /** Caller-injected clock (engine precedent) — stamps the returned cursor's updatedAtMs. */
89
89
  now?: () => number;
90
- /** [767]③ push-half batching: cap the number of push-half ENTRIES sent this round. The full
90
+ /** push-half batching: cap the number of push-half ENTRIES sent this round. The full
91
91
  * push set is put in STABLE order (id ascending — deterministic across rounds/replicas) and the
92
92
  * first `maxPushEntries` ride the wire; a cut round reports `pushTruncated: true`. Deletes are
93
93
  * never split (id+baseRev pairs are weightless next to bodies). CALLER CONTRACT: on
94
94
  * `pushTruncated`/`pullTruncated`, persist the returned cursor and run ANOTHER round until both
95
95
  * flags clear — core deliberately never loops internally (the runner loop is the deployment's,
96
- * server-side semantics per [767]③); bound your loop (e.g. a fixed max-rounds cap ≥
96
+ * server-side semantics apply); bound your loop (e.g. a fixed max-rounds cap ≥
97
97
  * ⌈expected entries / limit⌉ + slack) so a misbehaving peer cannot spin it forever. Must be a
98
98
  * POSITIVE integer (≥ 1 — C5: a 0 cap would flag pushTruncated forever and livelock the caller
99
- * loop); absent ⇔ unbatched (pre-[767]③ behavior byte-for-byte). */
99
+ * loop); absent ⇔ unbatched (prior behavior byte-for-byte). */
100
100
  maxPushEntries?: number;
101
- /** [767]③ pull-half batching: forwarded verbatim as the wire request's `pull.limit`; a server
101
+ /** pull-half batching: forwarded verbatim as the wire request's `pull.limit`; a server
102
102
  * that withholds part of its pull half answers `pullTruncated`, passed through on the result.
103
103
  * Same caller contract as {@link maxPushEntries}: continue rounds (bounded) until it clears.
104
104
  * Must be a POSITIVE integer (≥ 1 — C5, same livelock gate); absent ⇔ the request carries NO
105
- * `pull` key (old-server compatible, pre-[767]③ wire bytes). */
105
+ * `pull` key (old-server compatible, pre- wire bytes). */
106
106
  maxPullEntries?: number;
107
107
  /** design/178 §3 — per-entry byte bound for the PUSH gate, matched against the entry's serialized
108
108
  * file form (the same domain the harvest gate measures). Defaults to {@link MAX_MEMORY_BYTES},
@@ -130,11 +130,11 @@ export interface MemorySyncClientResult {
130
130
  /** The cursor the caller should now persist: advanced on full success, otherwise the INPUT
131
131
  * cursor unchanged (undefined on a failed first round) — the retention discipline. */
132
132
  cursor: MemorySyncCursor | undefined;
133
- /** [767]③: present (true) ⇔ `maxPushEntries` cut this round's push set — run another round off
133
+ /** present (true) ⇔ `maxPushEntries` cut this round's push set — run another round off
134
134
  * the persisted cursor until it clears (see the {@link SyncMemoryScopeOptions.maxPushEntries}
135
135
  * caller contract). Never present on an uncut round (additive: old callers see no new key). */
136
136
  pushTruncated?: true;
137
- /** [767]③: present (true) ⇔ the server reported its pull half was cut under `pull.limit` —
137
+ /** present (true) ⇔ the server reported its pull half was cut under `pull.limit` —
138
138
  * same continue-until-clear caller contract. */
139
139
  pullTruncated?: true;
140
140
  /** Honest-disclosure channel for tolerated protocol violations (present only when non-empty).
@@ -146,7 +146,7 @@ export interface MemorySyncClientResult {
146
146
  warnings?: string[];
147
147
  }
148
148
  /**
149
- * One full CLIENT sync round for one (scope, peer) against the [671]① central sync API — see the
149
+ * One full CLIENT sync round for one (scope, peer) against the central sync API — see the
150
150
  * module header for the ①-⑤ flow and the cursor retention discipline. Pure orchestration: all I/O
151
151
  * rides the injected backend/transport; the caller persists the returned cursor.
152
152
  */
@@ -3,7 +3,7 @@ import type { MemoryEntry, ScoredMemoryEntry } from "./types.js";
3
3
  * design/142 §3 — the per-replica per-scope sync cursor: the COMMON BASELINE a reconciliation run
4
4
  * judges divergence against (`id → rev` as of the last completed sync round). This is a NEW
5
5
  * persistence face — deliberately NOT revs.json (that is the local disk-vs-committed ledger): File
6
- * plane = a control-plane sidecar, DB plane = a service-owned table (PG+TiDB, [628] dual-dialect).
6
+ * plane = a control-plane sidecar, DB plane = a service-owned table (PG+TiDB dual-dialect).
7
7
  * Serializable by construction.
8
8
  */
9
9
  export interface MemorySyncCursor {
@@ -31,7 +31,7 @@ export interface MemorySyncPlan {
31
31
  /** Entries the LOCAL side should adopt from the peer (new there or changed-there-only). Same CAS
32
32
  * discipline as {@link push}, mirrored: local conditional write with `baseRevs[id]`. */
33
33
  pull: MemoryEntry[];
34
- /** codex 复审 B4 — DELETE propagation (without these the removal never crosses and every round
34
+ /** DELETE propagation (without these the removal never crosses and every round
35
35
  * re-plans the same state = livelock): the peer removed an entry the local side left UNCHANGED
36
36
  * since baseline ⇒ delete locally (CAS on baseRev — a local edit racing in makes the delete a
37
37
  * conflict on the next round instead of silent loss). */
@@ -61,7 +61,7 @@ export interface MemorySyncPlan {
61
61
  * - changed on exactly ONE side → push/pull;
62
62
  * - changed on BOTH sides, or delete-on-one × edit-on-the-other → conflict (caller's ladder);
63
63
  * - deleted on one side × UNCHANGED on the other → the delete propagates (deleteLocal/deleteRemote,
64
- * CAS on baseRev — codex B4: without this leg removals never cross and the plan livelocks);
64
+ * CAS on baseRev: without this leg removals never cross and the plan livelocks);
65
65
  * - present only on one side with NO baseline → new entry → propagate;
66
66
  * - absent on both but present in baseline → cleared (cursor cleanup).
67
67
  */
@@ -81,7 +81,7 @@ export declare function nextSyncBaseline(local: readonly MemoryEntry[], remote:
81
81
  * because the seat is advisory: the authoritative body is re-read from the real backend by id/slug
82
82
  * when a hit is followed. Mount point: a deployment composes its RecallSource(s) inside its recall
83
83
  * select hook (the design/65 selective-recall trust seat) or pre-queries before prepare; core adds
84
- * no RunnerDeps seat until a real integration signals the need (YAGNI, [622]③ two-lane ruling).
84
+ * no RunnerDeps seat until a real integration signals the need (YAGNI two-lane ruling).
85
85
  */
86
86
  export interface RecallSource {
87
87
  /** Stable adapter name (diagnostics/attribution: hits are labeled, never silently mixed). */
@@ -164,7 +164,7 @@ export declare function composeSelectiveBody(manifestText: string, selected: Mem
164
164
  * both. Core owns the FORMAT so a caller can't drift the wire format (decision 7) — the encoding is OPAQUE
165
165
  * and length-prefixes the scope so a scope/id containing the separator cannot self-declare a collision.
166
166
  *
167
- * ONE-WAY by design (codex MINOR (d)): the key is only ever PRODUCED here (`surfacedKeys`) and compared by
167
+ * ONE-WAY by design ((d)): the key is only ever PRODUCED here (`surfacedKeys`) and compared by
168
168
  * STRING EQUALITY against the caller's persisted set ({@link LayeredRecallOptions.priorSurfacedKeys}, applied
169
169
  * at memory-recall.ts via `priorSurfacedKeys.has(encodeSurfacedKey(h.scope, h.id))`). Nothing ever needs the
170
170
  * `(scope, id)` BACK out of a key, so there is intentionally NO `decodeSurfacedKey` — adding a decode would
@@ -282,7 +282,7 @@ export declare class MemoryGateError extends Error {
282
282
  * prose that merely mentions tokens/keys/passwords passes through untouched (false-positives are the head
283
283
  * risk — a wrongly-rejected normal note silently breaks legitimate memory).
284
284
  *
285
- * 🔴 RB-445 (blackboard [2230]): this is a BEST-EFFORT tripwire for a handful of high-signal token
285
+ * 🔴 RB-445: this is a BEST-EFFORT tripwire for a handful of high-signal token
286
286
  * formats, NOT a data-loss-prevention boundary — "the write gate passed" never means "the text contains
287
287
  * no credential". Known-through shapes (deliberate, per the false-positive stance above): connection
288
288
  * strings carrying passwords, `password=`/`Authorization:` header values, bare high-entropy bodies
@@ -530,7 +530,7 @@ export type MemorySpecInput = {
530
530
  * - `writeScope` defaults to the LAST scope (the highest-priority layer); an EXPLICIT `null` means read-only
531
531
  * (no `remember` tool, no consolidation); an explicit non-null string is taken as-is (it need NOT be one
532
532
  * of `scopes` — a deployment may write a layer it does not inject, though normally it is the last scope).
533
- * ⚠️ Layered READ seeding (service [646]①, 142-S4): when `scopes` comes from a registry's defaultScopes
533
+ * ⚠️ Layered READ seeding (142-S4): when `scopes` comes from a registry's defaultScopes
534
534
  * (shared read layers), ALWAYS pin `writeScope` explicitly — the last-scope default would land every
535
535
  * harvest in whichever shared layer happens to be listed last (a cross-tenant write surface).
536
536
  * - returns `undefined` when there are no usable scopes (the caller treats it like "no memory configured").