Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Pure-function lifecycle + decay layer. Functions take inputs, return outputs, never touch disk. M5b’s sweep calls these to decide transitions and persist; M5a’s doctor calls them for read-only display.

Structs§

LifecycleThresholds
Runtime-immutable lifecycle thresholds, derived from SkillLifecycleConfig.

Enums§

NoteKind
The two knowledge shapes a Category::Note skill can carry.

Constants§

AUTO_ARCHIVE_AGE_DAYS
AUTO_ARCHIVE_CONFIDENCE
DEMOTE_EMERGING_SUCCESS_RATE
DEMOTE_EMERGING_USES
Demotion thresholds — values that MUST drop BELOW. Hysteresis: lower than the symmetric promotion threshold to prevent flap.
DEMOTE_STABLE_SUCCESS_RATE
DEMOTE_STABLE_USES
DEPRECATED_NO_SUCCESS_DAYS
DEPRECATED_SUCCESS_RATE
MIN_CONFIDENCE
MIN_DWELL_HOURS
NOTE_FACT_HALF_LIFE_FACTOR
Default half-life multiplier for kind=fact notes.
NOTE_RULE_HALF_LIFE_FACTOR
Default half-life multiplier for kind=rule notes.
PROMOTE_DRAFT_USES
Promotion thresholds — values that MUST be exceeded.
PROMOTE_EMERGING_AGE_DAYS
PROMOTE_EMERGING_SUCCESS_RATE
PROMOTE_EMERGING_USES
PROMOTE_STABLE_AGE_DAYS
PROMOTE_STABLE_SUCCESS_RATE
PROMOTE_STABLE_USES

Functions§

calculate_decay
Compute decayed confidence given an anchor, last success time, and the half-life for the current lifecycle state.
cap_for_provenance
Cap a proposed lifecycle state for LLM-authored, uncurated skills.
half_life_days
Half-life (days) for confidence decay, indexed by current state.
half_life_factor_for
Decay half-life multiplier for manifest under thresholds t — notes get per-kind curves; everything else (and a missing manifest) is 1.0.
lifecycle_rank
Total order over lifecycle states. Public because the federation snapshot floor (mur-core) compares against the same ranking — a duplicated table drifting from this one would silently change what federates.
next_state
Compute what state the skill should be in given its current stats and the current time. PURE — does not mutate. Idempotent: calling this twice with the same inputs returns the same output.
note_kind
Kind of a note manifest: Category::Note + a rule tag → Rule; a plain note is a Fact (facts are the default larval form; rules are explicit). Non-note skills have no kind.
on_promotion
Called by the M5b sweep AFTER persisting a promotion. Resets the confidence anchor so the new half-life applies from current, not stale, confidence. Without this, a skill promoted from Draft to Emerging would carry its already-decayed anchor under the longer Emerging half-life and appear artificially fresh forever.
transition_allowed
Returns true if the transition from from to to may be persisted right now. Even when next_state says a transition is warranted, this guard prevents: