Diagnostic logging #9111

Closed
opened 2026-02-16 18:11:40 -05:00 by yindo · 1 comment
Owner

Originally created by @florianleibert on GitHub (Feb 11, 2026).

Originally assigned to: @rekram1-node on GitHub.

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.ts created
  • 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 alerts
    • verbose: 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.logging config (default: true)
  • Log level controlled via quality.logLevel config
  • 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() and Bun.write() for efficient file I/O
  • Append mode for normal writes, rotate when size threshold crossed
  • Rotation check: stat the 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)
Originally created by @florianleibert on GitHub (Feb 11, 2026). Originally assigned to: @rekram1-node on GitHub. # 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.ts` created - [ ] 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 alerts - `verbose`: 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.logging` config (default: true) - [ ] Log level controlled via `quality.logLevel` config - [ ] 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()` and `Bun.write()` for efficient file I/O - Append mode for normal writes, rotate when size threshold crossed - Rotation check: `stat` the 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)
yindo closed this issue 2026-02-16 18:11:40 -05:00
Author
Owner

@R44VC0RP commented on GitHub (Feb 11, 2026):

denounce

@R44VC0RP commented on GitHub (Feb 11, 2026): denounce
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9111