consolidate
Automatically promote observed patterns to behavioral rules based on confidence thresholds and detect sequential action chains.
Instructions
Re-evaluate pattern levels; promote via confidence thresholds and detect chains.
Promotes patterns that crossed a level boundary since the last run:
raw -> mature (confidence >= 5), mature -> rule (>= 10), rule ->
universal (observed in 2+ distinct projects). Patterns seen in the
last 7 days get a +1 recency bonus toward the mature threshold.
Side effects: (1) writes new "promoted" values, (2) runs detect_chains()
to discover sequential patterns from the observation log, (3) rebuilds
the FTS5 search index. Idempotent across promotion: already-promoted
patterns are untouched. session_summary() invokes this automatically.
Call after a bulk import_patterns() / import_claude_md() or at the
end of an agent session so downstream queries (suggest,
export_rules, inject_claude_md) see the latest promotions.
Returns:
{"promoted_to_mature": int, "promoted_to_rule": int,
"promoted_to_universal": int, "chains_detected": int,
"chains_created": int, "total": int, "timestamp": iso8601}
"total" is the current row count after promotion. "chains_*"
fields reflect the bundled detect_chains() pass: "detected"
counts candidate pairs above threshold, "created" counts new
seq:A->B records actually inserted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||