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.
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 - 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.
- 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.
- 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
fromtotomay be persisted right now. Even whennext_statesays a transition is warranted, this guard prevents: