Concepts
Learning Signals
What learning signals are
LearningSignal captures predicted vs actual outcome data at loop completion boundaries.
It is produced by extractLearningSignal() in @loop-engine/events.
LearningSignal fields
loopIdaggregateIdoutcomeIdpredicted: Record<string, unknown>actual: Record<string, unknown>delta: Record<string, number>occurredAtconfidence?
extractLearningSignal signature
1extractLearningSignal(2 completed: LoopCompletedEvent,3 history: TransitionRecord[],4 predicted?: Record<string, unknown>5): LearningSignalCurrent implementation behavior:
- derives
actual.cycle_time_daysfrom completion time minus first history timestamp - computes numeric deltas where both
predicted[key]andactual[key]are numbers - returns empty
deltawhen keys do not numerically align
Business metrics
BusinessMetric (from @loop-engine/core):
idlabelunitimprovableByAI
Example metrics from loops/scm/procurement.yaml:
cycle_time_daysthree_way_match_first_attemptsupplier_lead_time_accuracy
Marking improvableByAI: true identifies metrics appropriate for model optimization loops.
Feedback cycle
1Loop completes2 -> extractLearningSignal()3 -> store signal in training dataset4 -> retrain/tune model5 -> deploy improved agent behavior6 -> faster, safer loop completion