Skip to content
2 min read · 313 words

@nhtio/adk/batteries/orchestration/raw

The machine-readable reading surface for a plan's op log.

Remarks

The prose views (render, outline) are for humans and for model re-consumption: they adapt their audience, frame trust, and narrate. A UI showing "here is what changed and what will be applied" needs machine-readable state instead, and the op log makes that well-defined. This module is that surface.

Three properties this view has that the prose views deliberately do NOT:

  1. It is NOT audience-adapted. It is data — no narrative, no trust framing, no prose. A RawPlanView is the folded content of the log, and nothing more.
  2. It is STABLE. A given revision folds to the same bytes forever, which is what makes a digest meaningful. The fold is a pure function of the op set (see foldOps), so the same prefix always yields the same view and the same digest.
  3. It is reachable both ways. As a plain exported function, for a UI talking to a PlanStore directly and never going through an agent; and later as a tool, so a model can read the same data through the same seam.

RawPlanView carries NO lifecycle state, and that is deliberate. Lifecycle state is not a PlanOp, so it cannot be folded from the log, and a historical revision therefore has no recoverable state to report. A view at revision 7 answers "what did the CONTENT look like then", not "what state was it in then". state is a property of the plan NOW — read it from store.readState(). Do not add a state field.

Functions

FunctionDescription
rawDiffA STRUCTURAL delta between two folded states of a plan.
rawOpsRead the plan's raw op log.
rawPlanFold the plan's op log up to a revision into a RawPlanView.