Elamur Groupants⌕
☰

prag-rules

The groupant beside prag/src/rules.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartial source modelforward
astpartialsyntax.json
compositionpartial source modelcomposition
costpartial source modelcost
descriptantpartial source modelepoch-memory
invariantpartial source modelinvariant
testspartial source modelchecks

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
prag-rules-behavior-complementbehavior_complementpartial source modelbehavior-complement
prag-rules-reverse-reconstructionreverse_reconstructionpartial source modelreverse-reconstruction
prag-rules-specializationpriority_interventionpartial source modelspecialization

Parts

Model text

model

prag-rules

forward

For supplied aligned Read R and Rule q, H=[s in sites(R) | kind-compatible(s,q) and q.atoms subset atoms(R,s,q.action)]. apply_rule snapshots H, folds actions over the changing Read in H order, collecting Drop indices, and remaps deletions last. Output is final Read and successful-site count. Multiple rules compose in supplied file order. active has process-global override and first-load cache; only its pure select_rules path is executed here.

invariant

Frame coordinates and predicate pairs remain aligned on valid transitions. apply_at rejects missing/wrong-kind sites and mismatched frames/pred before cloning. Count is successful sites, not changed fields. Tests do not call active/set_override or lexical acquisition.

cost

F frames, T tokens, S sites, Q quote edges, A rule atoms, H emitted atoms: site scan O(F+T+F log F); atoms rebuilds frame_at O(F log F), can scan F+Q and ancestry T. Rule envelope O(S*(F log F+F+Q+T+A*H)+action costs); apply_at clones O(Read bytes). No speed claim.

behavior-complement

U contains supplied (R,q,candidate final Read,candidate count). Partial C contains candidates violating snapshot/fold: PatientToTo overwrites occupied recipient, Drop retains deleted roots, or invalid direct frame produces Some. External/lexical traces are unknown; finite tests do not prove all excluded transitions.

reverse-reconstruction

B(final,count) contains all compatible (R,q) satisfying the forward fold. Fixed AgentNone maps otherwise equal reads with agents alpha and beta to identical agent=None output/count1. Drop loses entire removed frames. Reverse composition must preserve shared hit snapshot and remapping.

specialization

Order intervention: Event followed by KindSay(Ask),KindEvent yields Event; reversed rules yield Say(Ask). Equal rule sets do not imply equal results.

composition

Codec feeds selection without reordering. Sites and action-dependent atoms share the pre-rule Read; ordered action fold sees evolving state, then deletion remaps coordinates. Selection nested in codec retains status distinctions. Exact byte scopes constrain composition; no child alone proves the parent.

checks

Ten rules::wave15_models tests, tiny supplied fixtures only; two debug and two release passes with identical named outcomes. File-root receipts.md retains hashes. Finite catalogs, nine transfer states and sixteen deletion subsets; compiled production vacancy-guard mutant fails finite_transfer_and_drop_relations.

epoch-memory

2026-10-30: first rules tree. Review predicted unchanged valid-site transitions and O(1) validation before O(Read bytes) cloning. Old invalid_direct_sites_are_no_change failed because absent Drop returned Some; seven other initial tests passed. Repair rejects absent coordinates/unaligned reads. select_rules exposes the existing production filter; no selection policy change or speedup claimed.

limitations

Partial syntax, no expanded macros or semantic AST proof. No live parser, teacher, corpus, environment mutation, override or cache acquisition in tests. Empty verbs/entities avoid lexical matching acquisition; populated entity tests use direct actions. Token creation, full lexical/ancestry/action branches, IO/cache lifetime and all multi-site interactions remain unexecuted. Public atoms/drop_frames still require valid coordinates/alignment.

receipts

Wave15 rules evidence

Ten focused rules::wave15_models checks pass twice debug and twice release; normalized identities/results match. Initial old-code run: seven pass, invalid_direct_sites_are_no_change fails because an absent Drop returns Some. Compiled production mutation changes PatientToTo vacancy guard from OR to AND; finite_transfer_and_drop_relations and roles_transfer_preserves_fields_and_blocks_overwrite fail. Source restored byte-for-byte before all four positive passes.

Syntax projections are byte-identical across two fresh runs. Full structural reports pass twice identically with temporary root registration/binding restored afterward; root integration owns permanent registry changes. Structural checks do not prove semantics.

SHA-256 receipts

Evidence bundle: octopus-wave15-rules-2026-10-30 under the external runs directory. Source tree contains one file root and six fragments (codec includes nested selection). Each has forward/invariant/cost, concrete behavior complement, ambiguous reverse relation and specialized observation. Finite evidence, no live acquisition or performance claim.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/prag/src/rules.rs.groupant/