Runner records gate violations per repair round in a pipeline-DB table #507

Closed
opened 2026-08-25 13:57:59 +00:00 by jared · 3 comments
Owner

Context

To mine coding conventions with real provenance, the Runner should persist each gate failure — rubocop cop name or failing test name, offending snippet, file:line, repair round — as rows in a new pipeline-DB table (lib/os_sdlc/runner/db.rb), recorded by the Runner in the background at gate-result persistence time, without slowing or involving the agent. On green, the fix should be linkable to the recorded violations. Evidence: session ccd9c3d0 (#502 run) burned 3 test-writer rounds and 3 programmer repair rounds, and no cop-level record survived — gate outputs were opaque blobs, so no conventions could be mined afterwards. Design probes (change-interpreter + code-probe) were dispatched 2026-08-25 in-session; work may start this session.

Tasks

  • Add violations table to db.rb (cop/test name, snippet, file:line, round, implementation id)
  • Hook recording into the Runner's gate-result persistence path, off the agent's critical path
  • Determine whether captured gate output has enough detail or an enrichment step (e.g. rubocop --format json re-run) is needed
  • Defer or slice: linking green-state fix code to recorded violations

Acceptance criteria

  • After a red gate run, violation rows exist with cop/test name, file:line, snippet, round number
  • Agent loop timing unchanged (no added agent sub-steps in the default path)

Origin

  • Trigger: analysis of session ccd9c3d0 (#502 run) — repair-round violations left no minable record
  • Improvised this session: none
  • Chain: no convention provenance <- gate failures not persisted per violation <- DESIGN (runner persists verdicts only, lib/os_sdlc/runner)
  • Root candidate: this ticket
## Context To mine coding conventions with real provenance, the Runner should persist each gate failure — rubocop cop name or failing test name, offending snippet, file:line, repair round — as rows in a new pipeline-DB table (lib/os_sdlc/runner/db.rb), recorded by the Runner in the background at gate-result persistence time, without slowing or involving the agent. On green, the fix should be linkable to the recorded violations. Evidence: session ccd9c3d0 (#502 run) burned 3 test-writer rounds and 3 programmer repair rounds, and no cop-level record survived — gate outputs were opaque blobs, so no conventions could be mined afterwards. Design probes (change-interpreter + code-probe) were dispatched 2026-08-25 in-session; work may start this session. ## Tasks - [ ] Add violations table to db.rb (cop/test name, snippet, file:line, round, implementation id) - [ ] Hook recording into the Runner's gate-result persistence path, off the agent's critical path - [ ] Determine whether captured gate output has enough detail or an enrichment step (e.g. rubocop --format json re-run) is needed - [ ] Defer or slice: linking green-state fix code to recorded violations ## Acceptance criteria - [ ] After a red gate run, violation rows exist with cop/test name, file:line, snippet, round number - [ ] Agent loop timing unchanged (no added agent sub-steps in the default path) ## Origin - Trigger: analysis of session ccd9c3d0 (#502 run) — repair-round violations left no minable record - Improvised this session: none - Chain: no convention provenance <- gate failures not persisted per violation <- DESIGN (runner persists verdicts only, lib/os_sdlc/runner) - Root candidate: this ticket
Author
Owner

Tracer slice shipped in commit 4170f46 (ADR-0149). Done: correction_rounds + violations tables (SCHEMA_VERSION 17, DB wipe on bump), rubocop --format json lint gate, ViolationRecorder in the GateSettlement step_recorder path (transactional; green steps resolve only their own gate type's open rows), Thor violations --format md|json|csv export. Codex-reviewed; two findings (over-broad resolve scope, non-atomic writes) fixed. Remaining tasks on this ticket: agent-facing lint output is now raw JSON (readability), expected-red gates still record a round (mining noise), test violations lack snippets when minitest omits a bracketed location, fix-diff linking deferred.

Tracer slice shipped in commit 4170f46 (ADR-0149). Done: correction_rounds + violations tables (SCHEMA_VERSION 17, DB wipe on bump), rubocop --format json lint gate, ViolationRecorder in the GateSettlement step_recorder path (transactional; green steps resolve only their own gate type's open rows), Thor violations <implementation-id> --format md|json|csv export. Codex-reviewed; two findings (over-broad resolve scope, non-atomic writes) fixed. Remaining tasks on this ticket: agent-facing lint output is now raw JSON (readability), expected-red gates still record a round (mining noise), test violations lack snippets when minitest omits a bracketed location, fix-diff linking deferred.
Author
Owner

Work started on remaining corrections (expected-red rounds recorded as mining noise; agent-facing lint feedback is raw rubocop JSON). Branch: 507-recorder-corrections. Design: recorder now told classification by GateVerdict; new LintFeedback renderer at the GateReply relay seam.

Work started on remaining corrections (expected-red rounds recorded as mining noise; agent-facing lint feedback is raw rubocop JSON). Branch: 507-recorder-corrections. Design: recorder now told classification by GateVerdict; new LintFeedback renderer at the GateReply relay seam.
Author
Owner

Resolution

Done: Tracer slice (4170f46) plus corrections (merge 2f41ff0439): violations/correction_rounds tables, rubocop JSON lint gate, ViolationRecorder in gate persistence path, Thor export; corrections — expected-red gates no longer record rounds (classification-driven recording), agent-facing lint feedback rendered as path:line:col cop lines instead of raw JSON. Acceptance criteria met: violation rows carry cop/test name, file:line, snippet, round; recording stays off the agent's critical path.

Evidence: Commits 4170f46, 7b048b1, merge 2f41ff0439; ADR-0149 (amended 2026-08-26); suite 1154 runs 0 failures; rubocop clean on changed files.

Follow-ups: Fix-diff linking: deferred by the ticket's own task list, dropped here. Snippet-less test violations when minitest omits a bracketed location: inherent to minitest output, dropped. Rubocop-cwd subprocess quirk: user is fixing it in another ticket, no capture needed.

## Resolution **Done:** Tracer slice (4170f46) plus corrections (merge 2f41ff043983102743d77983fd709140d6809258): violations/correction_rounds tables, rubocop JSON lint gate, ViolationRecorder in gate persistence path, Thor export; corrections — expected-red gates no longer record rounds (classification-driven recording), agent-facing lint feedback rendered as path:line:col cop lines instead of raw JSON. Acceptance criteria met: violation rows carry cop/test name, file:line, snippet, round; recording stays off the agent's critical path. **Evidence:** Commits 4170f46, 7b048b1, merge 2f41ff043983102743d77983fd709140d6809258; ADR-0149 (amended 2026-08-26); suite 1154 runs 0 failures; rubocop clean on changed files. **Follow-ups:** Fix-diff linking: deferred by the ticket's own task list, dropped here. Snippet-less test violations when minitest omits a bracketed location: inherent to minitest output, dropped. Rubocop-cwd subprocess quirk: user is fixing it in another ticket, no capture needed.
jared closed this issue 2026-08-26 16:45:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#507
No description provided.