Location: universal-refiner/src/history/
This module is responsible for the "Compounding Memory" of the system. It records every prompt, execution, and commit to derive engineering lessons and autonomous prompt templates.
- event-store.ts: Singleton manager for the SQLite database. Handles all CRUD for events, prompts, and executions.
- schema.ts: Contains the SQL schema definitions.
- commit-ingest.ts: Worker for watching git history and ingesting commits.
- correlation-engine.ts: Logic for linking prompts to specific code changes (commits).
- lesson-extractor.ts: LLM-driven engine for deriving reusable lessons from history.
- timeline.ts: API for retrieving chronological views of project activity.
- SQLite Integrity: Always use parameterized queries via
better-sqlite3. - Event Correlation: When recording an execution, ensure it is linked back to a
prompt_id. - Execution Feedback: Use
updateExecutionto log agent outcomes and final summaries. - Commit Ingestion: The
CommitIngesterfetches commits dynamically from thelastShafound in the database. - Commit Linking: Commits should be linked to an
execution_idonly if the timestamp and author align with a recorded refinement task. - Data Privacy: Never store raw secrets or credentials in the event store.