-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Closed as not planned
Description
Task: Diagnostic logging
Description
Implement the diagnostic log file system for quality monitoring. Supports three verbosity levels (minimal, normal, verbose), configurable log path, and automatic rotation to prevent unbounded disk usage.
Acceptance Criteria
-
packages/opencode/src/quality/logger.tscreated - Log file created at configurable path (default:
.opencode/quality.log) - Three log levels:
minimal: score and model ID only (one line per response)normal: score breakdown, diagnostic notes, regression alertsverbose: full prompt summary, response summary, all metadata
- Log entries are structured with: timestamp, session_id, model_id, level-appropriate content
- Log rotation: when file exceeds configurable max size (default: 50MB), rotate to
.log.1,.log.2,.log.3, delete oldest - Logging toggleable via
quality.loggingconfig (default: true) - Log level controlled via
quality.logLevelconfig - Logger called from scoring pipeline after each score computation
- Logger is non-blocking — writes are buffered/async
- Logger handles file I/O errors gracefully (warn once, don't spam)
Technical Details
- Use
Bun.file()andBun.write()for efficient file I/O - Append mode for normal writes, rotate when size threshold crossed
- Rotation check:
statthe file size before each write batch, rotate if over limit - For verbose level: truncate prompt/response to first 500 chars to keep logs manageable
- Expose
QualityLogger.log(entry)as main API, called from scorer.ts after scoring
Dependencies
- Task 002: Quality configuration (for log settings)
- Task 003: Scoring engine (provides data to log)
Effort Estimate
- Size: S
- Hours: 3-4
- Parallel: true (can run alongside 004, 005)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels