Skip to content

feat(multireview): emit 8-col per-reviewer td-stream rows#33

Merged
samestrin merged 4 commits into
mainfrom
feat/unified-td-stream-format
May 15, 2026
Merged

feat(multireview): emit 8-col per-reviewer td-stream rows#33
samestrin merged 4 commits into
mainfrom
feat/unified-td-stream-format

Conversation

@samestrin
Copy link
Copy Markdown
Owner

Summary

Companion to samestrin/claude-prompts#9. Updates the multi_review Go binary to emit per-reviewer td-stream.txt files in the unified 8-column format that the entire code-review pipeline now uses:

SEVERITY|FILE:LINE|PROBLEM|FIX|CATEGORY|EST_MINUTES|EVIDENCE|REVIEWER

Before: multi_review wrote 6-col rows (SEVERITY|FILE:LINE|PROBLEM|FIX|CATEGORY|REVIEWER). The reconcile reader in claude-prompts keeps a 6-col compat shim so old files on disk still parse, but new output now matches Claude /code-review Phase 5 + Step 10 pre-seed.

Changes

File Change
internal/support/multireview/stream.go New padTo7Columns helper. WriteReviewerOutput pads inbound 5-col reviewer prose to 7 columns (empty EST_MINUTES + EVIDENCE) before appending the agent name as REVIEWER. MergeStreams header comment updated to the 8-col contract.
internal/support/multireview/stream_test.go RED tests updated to 8-col fixtures. New TestPadTo7Columns covers 5-col padding, already-7 pass-through, 8+ pass-through (no truncation), 2-col pathological.
internal/support/commands/multi_review.go Reviewer task message gains instruction to replace literal | with / (same convention Claude writers already use).
CHANGELOG.md Unreleased entry under Changed.

TDD trail

Commit TDD step
4a47ee4 RED — tests expect 8-col, fail against current impl
392e516 GREEN — padTo7Columns + 8-col write
b8f9cf7 Adversarial — pipe-escape instruction + dedicated pad helper tests
1897afc CHANGELOG

Test plan

  • go test ./... — full repo passes
  • Coverage on internal/support/multireview/ — 84.2% (≥80% target)
  • go install ./cmd/llm-support builds clean
  • All previous multi_review behavior preserved (file layout, agent invocation, cleanup, etc.) — only the per-row column count changed

Rollback / mixed-state safety

The reconcile reader's compat shim handles 5/6/10-col rows alongside 8-col. So mid-rollout (claude-prompts merged, this PR not yet) the system works: openclaw output is 6-col, reconcile recognizes it. After this merges: openclaw output is 8-col, reconcile recognizes both new and old.

samestrin added 4 commits May 15, 2026 11:33
Updates the fixture expectations for WriteReviewerOutput and
MergeStreams to the unified format:

  SEVERITY|FILE:LINE|PROBLEM|FIX|CATEGORY|EST_MINUTES|EVIDENCE|REVIEWER

Inbound openclaw reviewer prose contains 5-col rows
(SEVERITY|FILE:LINE|PROBLEM|FIX|CATEGORY); WriteReviewerOutput must
pad with empty EST_MINUTES + EVIDENCE before appending the agent name.

MergeStreams header is updated to document the new 8-col contract.

Tests fail against current impl. GREEN follows.
WriteReviewerOutput now writes per-reviewer td-stream.txt files in the
unified 8-col format used across the entire system:

  SEVERITY|FILE:LINE|PROBLEM|FIX|CATEGORY|EST_MINUTES|EVIDENCE|REVIEWER

New padTo7Columns helper pads inbound 5-col reviewer prose lines to 7
columns (empty EST_MINUTES + EVIDENCE) before appending the agent name.
Reviewers don't currently emit EST_MINUTES/EVIDENCE; leaving them empty
preserves the column count contract without inventing values.

MergeStreams header comment updated to document the new format.

The reconcile reader (claude-prompts PR #9) already recognizes the 8-col
shape as its primary branch. Together this PR closes the loop: every
per-source td-stream.txt in the system has the same shape.
…pad helper

Adversarial review surfaced two robustness gaps in the new 8-col output:

1. Reviewers might emit a literal '|' character inside PROBLEM or FIX
   (e.g. "use the | operator"), corrupting the row's column count.
   Updated the task message in buildDefaultTaskMessage to instruct
   reviewers to replace any literal '|' with '/'. (Same convention
   already used by Claude Phase 5 and Step 10 pre-seed.)

2. padTo7Columns had no explicit test for edge cases. Added a table-
   driven test covering: 5-col padded to 7, already-7 pass-through,
   8+ pass-through (no truncation), and a 2-col pathological case.

Coverage holds at 84.2%.
@samestrin samestrin merged commit b080c21 into main May 15, 2026
15 of 16 checks passed
@samestrin samestrin deleted the feat/unified-td-stream-format branch May 15, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant