Skip to main content

Module render

Module render 

Source
Expand description

Top-level run-brief rendering — the one engine entry point that both the CLI (memstead ingest brief) and UniFFI (macOS app) call, so the brief a client emits is byte-identical to the CLI’s by construction (a single code path), not by parallel re-implementation.

Given a loaded Engine, the workspace root, and an ingest name, it loads the four-primitive config, resolves the ingest, and — for discovery mode — assembles the full brief: writing guidance from the destination mem’s schema + config, the paired-process-mem view, and the changed-slice preface from live source state.

Enums§

RenderBriefError
Why render_ingest_brief could not produce a brief.

Functions§

mem_predates_binding
Whether the destination mem predates its binding — the adopt / onboarding signal (E1). True when the mem carries no anchors and the binding has no recorded #synced baseline for any facet: there is nothing to diff against and nothing anchored yet, so 0% anchored is expected (a first sync), not drift. A genuinely-fresh mem legitimately gets the same first-sync framing — the signal is deliberately generic.
mode_name
The mode string used in messages (discovery / one-shot).
render_ingest_brief
Render the run-brief for a binding — the Markdown prompt an agent consumes. The single engine entry point shared by the CLI and UniFFI. ingest_name is the canonical binding id (or a legacy flat-ingest stem — see [find_binding]).
render_sync_brief_for
Render the sync brief (C2/C3) for a binding — the single channel through which maintenance-writing work reaches an agent. The one engine entry point the CLI (projection brief --sync) and UniFFI share. It assembles both inputs in one render: the live cursor slice (compute_source_cursor) and the open findings the verify pass recorded (current(key)), plus the adopt framing when the mem predates its binding (E1). Read-only on the destination mem (shared &Engine) — every repair happens only when an agent acts on this brief through the normal MCP mutation surface.
render_verify_brief_for
Render the verify brief (C1) for a binding — the measurement + capped-adjudication prompt an agent consumes. The one engine entry point the CLI (projection brief --verify) and UniFFI share, mirroring render_ingest_brief. Read-only on the destination mem: it borrows &Engine (shared), reads the durable findings store for the backlog count, and renders. It emits no destination-mutation instruction (C1) — the refusal is carried by render_verify_brief itself.