pub struct Reflexion {Show 17 fields
pub id: String,
pub domain: String,
pub session_id: String,
pub trigger: String,
pub context: String,
pub intervention: String,
pub reflexion_text: String,
pub error_type: Option<String>,
pub confidence: Option<f64>,
pub is_processed: bool,
pub leap_run_id: Option<String>,
pub created_at: String,
pub origin: Origin,
pub evidence: Evidence,
pub edited_at: Option<String>,
pub dropped_at: Option<String>,
pub dropped_reason: Option<String>,
}Expand description
One learned note, tied to the intervention that produced it.
Fields§
§id: String§domain: Stringbehavior for now; writing once drafting exists.
session_id: String§trigger: StringWhat kind of intervention triggered it: steer, denial, followup.
context: StringWhat mecha was doing, compactly — the evidence a rule can be argued from.
intervention: StringWhat the user said or did.
reflexion_text: StringThe inferred lesson, phrased as a reusable directive.
error_type: Option<String>§confidence: Option<f64>§is_processed: boolSet once an abstraction pass has consumed it.
leap_run_id: Option<String>§created_at: String§origin: OriginProvenance of the session the lesson was drawn from. Reflections
recorded before this field existed load as Untrusted — see
Origin.
evidence: EvidenceWhat the reflector saw: the full excerpts, or only user-authored
evidence. Records from before the field load as Full — every
reflection was, and their origin already says what to make of it.
edited_at: Option<String>When the owner rewrote the lesson in their own words.
An edited lesson is the owner’s, and that is a provenance promotion
rather than a cosmetic flag. The argument is evidence_for’s, one
step stronger: when a conversation held third-party content the
reflector is shown only the user’s typed words and the reflection
classifies clean, because third-party bytes never reached the model
that wrote it. A lesson the owner typed skips the model entirely, so
there is nothing left to launder. context is withheld on the way
through, since that is the field the untrusted bytes were in.
dropped_at: Option<String>When the owner dropped it, and why.
A flag, never a deletion, on the rule retired_at and the outbox’s
resolved items already follow: the record is the evidence that this was
considered and refused, and a store that forgets its refusals lets the
same lesson come back next pass with nothing to say it was already
judged.
dropped_reason: Option<String>Implementations§
Source§impl Reflexion
impl Reflexion
Sourcepub fn learnable(&self) -> bool
pub fn learnable(&self) -> bool
Whether a learning pass may consume this reflection. Structural, not a score: there is deliberately no knob that loosens it, because a switch that lets untrusted content into every future prompt is the silently-degrading-sandbox shape.
One domain is exempt, and the exemption is keyed on the consumer
rather than on a setting. The gate above exists because a learned
rule rides in every future run’s cached prefix, in front of an agent
with tools, a network and the ability to send. That premise is false
for TRIAGE_DOMAIN: its rules ride only in the mail classifier’s own
frame — a tool-less, history-less pass that emits a fixed schema and
can neither send nor reach the network — because triage is not in
RUN_DOMAINS. A triage reflection necessarily saw mail, so demanding
Clean there would not make it safe, it would make the domain
impossible: a correction with no context cannot generalise.
The exemption disables itself if its premise stops holding. Adding
triage to RUN_DOMAINS would put those rules in front of a
tool-having agent, and the check below goes false the moment that
happens rather than needing anyone to remember. LEARNING-AUTONOMY-DESIGN.md
§4 is the argument; an_untrusted_triage_reflection_stops_being_learnable_if_it_reaches_a_run
is the test.
The residual, stated because nothing enforces it. The check keys on
RUN_DOMAINS membership, which is a proxy for the consumer rather
than the consumer itself. It catches the likely breakage — someone
routes triage into ordinary runs — and it does not catch a second
one: a future caller that has tools calling
LearningStore::rules_prompt_block_for with triage directly.
Nothing stops that today, and this function would keep answering
true while its premise had quietly stopped holding.
Expressing that in the type system would need “this domain has exactly
one load site”, which Rust cannot say cheaply and a registry would cost
more than it protects. So it is written here instead, where the next
person meets it: if you are adding a consumer of triage rules that
has tools, a network, or a way to send, this exemption is no longer
sound and has to be argued again rather than inherited.
Sourcepub fn provenance(&self) -> Origin
pub fn provenance(&self) -> Origin
The origin this record would be classified as today.
The stored field is what the miner decided at the time, and the store is
append-only — so records written before is_harness_voice existed carry
clean for interventions mecha wrote itself. Two are on disk now, and
one of them had already reached a pending rule proposal. Deriving the
effective value here rather than migrating the file keeps the record as
written (the evidence) and the judgement current, which is the same
split Session::taint_timeline makes about checkpoints.
One place, so a future decision to let self-authored reflections consolidate — with their own budget, or behind a probe that can actually grade them — changes a gate rather than a scattering of checks.
Reaches a stored record only in the shape the live guard now
produces. is_harness_voice is a whole-string match (== for the
nudges, starts_with/contains for the three stemmed voices), which
recognises a harness voice recorded alone but not one folded into a
joined string a pre-fix miner produced — a nudge concatenated with a
real steer, from before extract_interventions filtered per block.
The two records this method exists to reclassify happen to be pure
nudges, so this reaches them; a joined-string record from the same
era would not reclassify here even though it should.