Repository navigation
Closed as not planned
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Description
Task: SQLite storage layer
Description
Create the SQLite storage layer for the quality monitoring system using bun:sqlite. This includes database initialization, schema creation, migrations, CRUD operations for responses and regressions, query helpers for aggregations, and automatic retention cleanup.
Acceptance Criteria
-
packages/opencode/src/quality/store.tscreated with full SQLite wrapper - Database initialized at configurable path (default
.opencode/quality.db) -
responsestable with columns: id, session_id, model_id, provider_id, timestamp, prompt_hash, response_hash, composite_score, correctness_score, feedback_score, analysis_score, diagnostic_notes (JSON), is_collaborative, tokens_input, tokens_output, cost -
regressionstable with columns: id, response_id, detected_at, score_delta, severity, component, description - Indexes on: responses(session_id), responses(model_id), responses(timestamp), regressions(severity)
- CRUD operations: insertResponse, updateResponseScore, insertRegression, getResponsesBySession, getResponsesByModel, getRecentResponses(limit)
- Aggregation queries: getModelAverages, getRollingAverage(windowSize), getScoreTrend(days)
- Retention cleanup: deleteOlderThan(days) runs on DB init
- Schema version tracking for future migrations
- Graceful error handling — DB failures logged, never crash main workflow
Technical Details
- Use
bun:sqlite(built-in, zero dependencies) - Use
Databaseclass frombun:sqlitewith WAL mode for performance - Store DB path resolved relative to project directory via
Instance.directory - Follow existing
Instance.state()pattern for per-project DB lifecycle - Create
packages/opencode/src/quality/schema.tswith Zod schemas for type safety on insert/query results
Dependencies
- None — this is a foundation task
Effort Estimate
- Size: M
- Hours: 6-8
- Parallel: true
Metadata
Metadata
Assignees
Labels
needs:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.
Activity
github-actions commentedon Feb 11, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to follow one of the required templates within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Feb 11, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.