Expand description
A tiny CAL writer. The engine never parses CAL (that is the substrate’s
job — validate_cal/execute_cal); it only emits the handful of statements
built-in analyzers propose. Statements are newline-separated to form a
batch. Keeping this a writer, not a parser, is what lets the engine claim
zero CAL-grammar ownership (proposal §10).
Functions§
- add
ADD <type> {json}— a Tier-1 non-destructive evolve write.- batch
- Join statements into a batch.
- contains_
destructive - True if any statement is destructive: FORGET (single-grain or SUBJECT)
or PURGE.
Recommendation::destructiveis stamped from this and the apply gate (admin scope +allow_destructive) keys off that stamp, so this list must cover every destructive statement a proposal could carry — LLM-enriched and--analyzer-cmdproposals are arbitrary CAL text, not just what this writer emits. - contains_
forget - Cheap engine-side destructive check (defense in depth; the substrate’s
validate_calis authoritative). True if any statement is a FORGET. - forget
FORGET <hash>— the only destructive statement the writer emits, single-grain (§6.4).- parse_
own_ supersede - Round-trip a line this module’s own
supersedeemitted back into(target_hash, grain_type, fields). This is a strict inverse of the writer’s own output — not a CAL parser (any other shape returnsNone; the substrate’s grammar stays authoritative). The auto-apply gate uses it to value-verify a replacement against the grain it supersedes. - supersede
SUPERSEDE <hash> WITH <type> {json}— replace a head non-destructively.