Expand description
§areev-loop-adapter
The Areev substrate adapter for the areev_loop engine. It implements
areev_loop::OmsSubstrate over areev_cal::AreevFacade, so the governed
self-improvement loop runs against real Areev .mg/Turso memory files.
use areev_loop_adapter::{AreevSubstrate, now_ms};
use areev_store::Areev;
use areev_loop::{Engine, RunOptions};
let store = Areev::open("agent.db").unwrap();
let mut sub = AreevSubstrate::new(store, None);
let engine = Engine::with_builtins();
let result = engine.run(&mut sub, &RunOptions::default(), now_ms()).unwrap();
println!("proposed {} recommendation(s)", result.stored);Structs§
- Areev
Substrate - An Areev-backed substrate that owns its facade (CLI path).
- Borrowed
Substrate - An Areev-backed substrate that borrows a facade (bindings path). Construct
one per areev-loop call over the host object’s existing
&AreevFacade. - Loop
Decider - An Areev decision backend, seen by the loop.
- Loop
Governance - Governance over
Engine::with_builtins()plus an optional host policy. LLM backends deliberately have no seam here:RUN LOOPfrom CAL is the deterministic pass — model-attached runs stay on the host surfaces where credentials live.
Functions§
- covers_
rec - Whether this session may SEE a recommendation with this scope (#312).
- find_
recommendation - The one recommendation among
recswhose hash starts withprefix— the lookupareev loop showand the bindings’recommendation(hash)share. Pass the coverage-filtered list (visible_recommendations) on a principal-bindable surface, so a hash the caller cannot see is “no match”, indistinguishable from one that does not exist. - loop_
state_ of - The loop’s persisted state, read straight off an open store.
- now_ms
- Wall-clock now in epoch milliseconds — the
now_msthe engine’srun,review,apply, androllbacktake. Kept out ofareev-loopitself so the engine stays deterministic (the caller supplies the clock). - observer_
for_ principal - The observer type an actor label implies, used where no credential record
declares one (the credential map will carry an explicit
observerfield when the multi-token surfaces land; this prefix heuristic is the interim derivation — a statement must never be able to claim humanity, so the answer always comes from the host-held actor label, not request text). - proposal_
fields - The flattened proposal body (
proposalkind tag + its fields) — whatrecommendations({"include": "proposal"})adds to a listing row. - recommendation_
detail - One recommendation as the review surface shows it:
areev loop showand the bindings’recommendation(hash)print exactly this object (#348). - scopes_
for - Map a session’s grants onto the loop engine’s scope set — the one
translation between Areev’s verb model (
areev_core::authz) andareev_loop::Scope, so surfaces stop handing outScopeSet::all()unconditionally. Loop verbs are checked against the loop’s own namespace (areev_loop::LOOP_NS), which a grant covers by naming it or*. An owner session maps to every scope — the CLI’s local-root-of-trust behavior, unchanged. - scopes_
for_ rec - The scopes a session holds over ONE recommendation, given the namespaces it was derived from (#312).
- visible_
recommendations - Every recommendation a session may SEE, filtered by coverage (#312).