Skip to main content

Module consolidation_engine

Module consolidation_engine 

Source
Expand description

Canonical session→knowledge consolidation (#995 Phase 4).

One session-import core (import_session_into) and one option set (ConsolidateOptions) back every consolidation driver — the CLI/MCP consolidate, the post-dispatch scheduled pass, startup auto-consolidate and the cognition loop — so promotion budgets, fact keys, confidences and the lossless capacity reclaim stay identical regardless of who triggers a run.

The full, locked orchestrator (import + history + lifecycle + per-store reclaim + report) lives in ctx_knowledge::consolidate_project_knowledge_with; this module owns the shared import primitive plus the thin scheduled wrapper the background drivers call.

Structs§

ConsolidateOptions
How a consolidation run imports the session and reclaims capacity. One option set per driver — see the constructors. Replaces the four divergent, copy-pasted import loops (each with subtly different keys, caps and confidences).
ConsolidationBudgets
Promotion budgets for the scheduled (post-dispatch / cognition) pass.
ConsolidationOutcome
Leaner outcome kept for the scheduled callers (post_dispatch / tool_lifecycle) that only need the promotion + lifecycle headline, not the full report.
ImportCounts
Counts of items promoted by a single import_session_into call.

Functions§

consolidate_latest
Scheduled background consolidation. Thin wrapper over the canonical orchestrator with ConsolidateOptions::scheduled; kept for the post-dispatch / tool-lifecycle callers and their ConsolidationOutcome.