Skip to content

groundBlocks

groundBlocks(blocks, pendingDiff, changedFiles): VisualBlock[]

Defined in: src/visual-blocks.ts:715

Ground LLM-emitted blocks against the real diff.

  • Carrier present (pendingDiff non-empty): join diff blocks to real DiffFiles (drop unmatched), cap each joined file’s hunks, and reconcile file-tree entries against the real diff.
  • Carrier empty (e.g. a server bounce lost it before finalize): FAIL CLOSED — drop all diff blocks (no real hunks to show), keep file-tree entries whose path is in changedFiles (paths survive teardown; status does not, so the authored change is kept as-is), and pass rich-text/callout through untouched.

VisualBlock[]

DiffFile[]

string[]

VisualBlock[]