Expand description
Lonca’s deterministic decision layer.
state::Stateis a pure fold over the operation log.decide::decideis a pure function from (state, request, recorded evidence, time, policy) to a decision.chain::Chaincombines both into the single-writer sequencer the daemon runs; the auditor replays the same functions over a stored log.whatif::comparedecides a log again with another policy.
Re-exports§
pub use chain::Chain;pub use config::Config;pub use config::PolicyBundle;pub use decide::Ctx;pub use decide::decide;pub use state::State;
Modules§
- chain
- The single-writer sequencer: decide, sign, apply.
- config
- Policy bundle:
lonca.toml(limits and switches) pluspolicy.cedar(rules). Both live in the commit thatrefs/lonca/policypoints to, never in a code branch. - decide
- The decision function.
- details
- What a client reads to recover from a lease denial, or to avoid one.
- events
- A session’s inbox: what happened that it should know of, derived from the
log and the state. Nothing is written for it, so the single writer stays
the only way into the log, and
decide()never reads it. - harness
- Harness profiles: what Lonca needs to know about an agent harness, as
data. Which events it sends, what its tools do, and how it wants an answer.
A new harness is a table in
lonca.toml, not a change to Lonca, as long as it can run a command with a JSON event on stdin. - human
- Verification of human signatures.
- refs
- Which refs a repository may hold, and what the log says each must name.
The daemon’s
reconcile()and the auditor ask the same function, so a write behind the daemon’s back reads the same to both. - state
- Repository state as a pure fold over the operation log.
- symbols
- Symbol ids and their containment hierarchy.
- whatif
- What another policy would have decided: every entry of a log decided again with a candidate policy, and the decisions that come out different.