@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:
- It is NOT audience-adapted. It is data — no narrative, no trust framing, no prose. A
RawPlanViewis the folded content of the log, and nothing more. - 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. - It is reachable both ways. As a plain exported function, for a UI talking to a
PlanStoredirectly 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
| Function | Description |
|---|---|
| rawDiff | A STRUCTURAL delta between two folded states of a plan. |
| rawOps | Read the plan's raw op log. |
| rawPlan | Fold the plan's op log up to a revision into a RawPlanView. |