Skip to main content

Crate ev

Crate ev 

Source

Modules§

canonical
Canonical-JSON (RFC 8785 / JCS) + content-addressed identity. For our string-only payload, serde_json’s default output (sorted BTreeMap keys, compact separators, raw non-ASCII, no /-escape) IS JCS — verified by the golden vectors. Liveness arrays are sorted+deduped here so set-valued fields are order-insensitive; grounds[] keeps authored order.
capture
ev decide — walk the trailing args left-to-right into a draft, validate, append a child.
cmd
config
The .evolving/config reader: one typed Config parsed once from the flat key = value file. Defaults match DEFAULT_CONFIG. No TOML dependency — the file is ev-authored and fixed-shape, so a whole-token line scan is enough.
events
A local, append-only events log (results/events.jsonl) — the decision-data埋点 for metrics. Gitignored, 0-network, best-effort (a write failure never fails the command).
guard
ev guard "<selector>" <id> [<ground>] — attach an existing test to a ground as a data check (after the fact). Because check is hashed, this writes a NEW CHILD.
lint
Best-effort lexical lints over built-in, deterministic word lists. R3: the subject of self-evolve/self-improve language must be a human, not the system. R5: no auto-close / auto-prune / self-stop op language. Honest limit: a re-wording evades these — they are heuristics, not semantic guarantees.
liveness
Event-driven liveness: has a triggering change landed since a check last ran? Impure (shells git), mirroring staleness.rs. The verdict engine stays pure — this produces a bool the caller passes into verdict_for.
migrate
ev migrate — backfill an existing decision history into the ledger.
receipt
Run-receipts: the non-hashed evidence that a bound test ran — one JSON object per line in results/receipts/.jsonl. Deleting receipts never changes a tick id (the hashed/cached split). Unsigned, trust-on-write for 0.1.0.
runner
ev check –run: execute a bound test locally and produce a run-receipt. A THIN runner — the production receipt-writer is CI / a supervisor hook; –run is for local verification. exit == the configured green_exit_code => green, anything else => red (gray comes from external writers, never from –run).
selected
The external selected-list: which check refs the latest diff selected, and which declared triggers it changed. An affinity tool / CI writes results/selected.json; ev READS it and never recomputes affinity. Absent ⇒ L2 (silently-unbound) is not evaluated.
staleness
Resolve the staleness-reference sha per the configured policy. No network — live-origin reads the last-fetched upstream tracking ref. Returns None when the reference can’t be determined (“stale-unknown”), in which case sha-staleness is simply not evaluated.
state
The verdict-cache read contract: results/state/<tick_id>.json — a per-host, gitignored snapshot of each tick’s per-ground verdicts that a consumer hook reads WITHOUT shelling ev check. Facts, no scores; one row per ground.
store
The .evolving/ store: a committed hashed chain + a non-hashed results cache.
tick
The decision tick and its parts. No serde derives: canonical and on-disk encodings are built by hand (tick.rs / canonical.rs) for exact byte control.
verdict
The pure verdict engine: per Test-bound ground, the resurface precedence. No I/O — receipts, the live-origin sha, and the selected-list are passed in. Facts, not verdicts: every not-green state is a co-equal fact, never ranked or scored.
verify
ev verify: R1 (closed schema), R2 (check shape), R4/R6 (id == hash + chain integrity), R3 (self-evolve subject) + R5 (blame present + forbidden-op).