Ack Gate

_archivesourcetypescript
Path: _archive/loom-stale-pre-sprint-snapshot/src/execution/ack-gate.tsRelative: loom-stale-pre-sprint-snapshot/src/execution/ack-gate.tsSubproject: _archiveCategory: archived
Lines: 55Bytes: 2,076Imports: 0Exports: 2

Content Preview

  1. /**
  2. * H3.1 — Observation acknowledgment gate (P1 feedback closure).
  3. * After tool results are re-injected, the NEXT assistant turn must open its
  4. * first text block with <ack obs="h1[,h2,...]"> covering exactly the hashes
  5. * of the re-injected batch. A turn that ignores its observations never
  6. * reaches the tool executor.
  7. */
  8. const ACK_RE = /^\s*<ack\s+obs="([a-f0-9]{64}(?:\s*,\s*[a-f0-9]{64})*)"\s*\/?>/;
  9. export type AckCheck =
  10. | { ok: true }
  11. | { ok: false; reason: "missing" | "hash_misma