Expand description
Full-autonomy loop — stacks on the Track A curator daemon (#278).
This module provides the four passes beyond auto-tag that are required to earn a defensible “100% autonomous” claim:
- Consolidation — find near-duplicate memories in the same
namespace, LLM-summarise them into a single canonical memory,
archive the originals. Uses
db::consolidatefor the DB work andAutonomyLlm::summarize_memoriesfor the synthesis. - Forgetting of superseded memories — when a memory carries
metadata.confirmed_contradictions, demote or forget the older contradicted entry (the curator keeps the fresher one). Usesdb::forget_countwith a targeted id list. - Priority feedback — nudge
priorityup for memories that are getting recalled, nudge it down for cold ones. Purely arithmetic; no LLM call. - Rollback log + self-report — every autonomous action lands
in a
_curator/rollback/<ts>memory describing what happened and how to reverse it, and every cycle lands in_curator/reports/<ts>as a summary the operator (and other agents) can recall.
§Trait boundary — AutonomyLlm
The curator previously coupled directly to llm::OllamaClient,
which blocked unit-testable end-to-end coverage. This module
defines a narrow trait that both OllamaClient (in prod) and
the [tests::StubLlm] (in tests) implement. The autonomy passes
are generic over &dyn AutonomyLlm.
Structs§
- Autonomy
Pass Report - Structured outcome of a single autonomy pass. Aggregated into the
curator cycle’s
CuratorReportand also written back as a self- report memory.
Enums§
- Rollback
Entry - Rollback-log entry stored as a memory in
_curator/rollback/<rfc3339>.
Constants§
- CONSOLIDATE_
JACCARD_ THRESHOLD - Minimum Jaccard-keyword overlap required to treat two memories as “near-duplicates” candidates for a consolidation cluster. Tuned loosely — actual merge decision is still gated by an LLM pass.
- CONSOLIDATE_
MAX_ CLUSTER_ SIZE - Cap on the number of memories in a single consolidation cluster — prevents pathological mega-merges that would destroy provenance.
- CURATOR_
NAMESPACE - Reserved namespace prefix the curator writes to. Excluded from further curator passes (the curator never acts on its own rollback / report memories).
Traits§
- Autonomy
Llm - LLM surface the autonomy passes use. Implemented for
OllamaClientin prod and stubbed in tests. Theauto_taganddetect_contradictionmethods are here for completeness — the autonomy passes themselves currently only callsummarize_memories, but exposing the three together keeps the trait a single, testable LLM boundary that the curator’srun_oncepath can switch to in a follow-up PR.
Functions§
- persist_
self_ report - Write the cycle’s report as a memory in
_curator/reports/<ts>so other agents can recall “what did the curator do”. - reverse_
rollback_ entry - Reverse a single rollback-log entry. Returns
trueif a reverse action was applied,falseif the entry was already superseded (idempotent rollback). - run_
autonomy_ passes - Run all autonomy passes over the provided candidates in order:
consolidate → forget superseded → priority feedback → record
rollback log → write self-report.
dry_runsuppresses all writes.