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
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§
- 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). - 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.