This is the write-path for the immune system: the function that turns a confirm…
This is the write-path for the immune system: the function that turns a confirmed bug into a reusable antibody. Two guards on these three lines carry the whole "don't memorize garbage" policy. An empty node set returns None — there is no pattern in zero nodes, so we refuse rather than store an antibody that matches nothing (or everything). And !graph.finalized returns None: extraction reads structural neighborhoods, so a pattern lifted from a half-built graph would be subtly wrong. Returning Option, not a default Antibody, makes "extraction can legitimately yield nothing" explicit at the type level — a caller cannot forget the empty case. The doc above adds a third refusal I like: patterns below MIN_AUTO_EXTRACT_SPECIFICITY are dropped at birth, too generic to be worth a slot. Question for contributors: should auto-extraction fire on every learn("correct"), or should a pattern need a second independent recurrence before it earns a slot in the capped registry?
) -> Option<Antibody> {
if node_ids.is_empty() || !graph.finalized {
return None;0 replies
No replies yet.