PR #3271 review history
Smoke prerequisite · trusted MinIO images
Review rounds
Three-number pills mean: found (raw) / accepted here (useful) / routed
Recorded review history
Reviews and findings
- Subagent Review 1 CompletedModel: gpt-6-luna · XhighFound: 0 Accepted: 0 Routed: 0
- No findings recorded for this run
- CLI Review 1 CompletedRuntime 1m 16sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- Hosted Review 1 CompletedRuntime 5m 12sFound: 1 Accepted: 0/1/0 Routed: 0
- Reject unsupported
codegenInstructionsvalues in successful mode.MinorSuccessful mode currently accepts objects and numbers without validating them. The projection helper converts those values to empty text, so the finding can be stored without issue content. Preserve the existing list handling because
_cli_instruction_textexplicitly supports lists.🛡️ Proposed fix
--- "a/dev-tools/pr_review/evidence.py" +++ "b/dev-tools/pr_review/evidence.py" @@ -685,8 +685,10 @@ if not isinstance(event_type, str): raise EvidenceError(f"capture stdout has an invalid event type at line {number}") if event_type == "finding": instructions = event.get("codegenInstructions") + if instructions is not None and not isinstance(instructions, (str, list)): + raise EvidenceError(f"capture stdout has invalid finding instructions at line {number}") if not successful and (not isinstance(instructions, str) or not instructions.strip()): raise EvidenceError(f"capture stdout has a finding without instruction text at line {number}") # Historical successful findings can carry title/comment or message # instead of instructions. Preserve that projection contract while- Accepted Non-null object/numeric instruction values collapse to empty projection; reject unsupported types while preserving legitimate strings, lists and legacy title/comment payloads.
- Hosted Review 2 CompletedRuntime 13m 45sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 2 CompletedRuntime 1m 18sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 3 CompletedRuntime 1m 17sFound: 1 Accepted: 1/0/0 Routed: 0
- Verify that the stricter successful-capture grammar does not invalidate retained historical evidence.Major
parse_capture_eventsnow delegates to_parse_strict_capture_events(successful=True). This reader is shared._cli_capture_from_sql(Line 1000) uses it for native SQLite archives._parse_capture_stdoutuses it for legacy capture directories. The runner uses it to classify new results.The updated tests show that the old successful loader accepted streams that the new grammar rejects:
- unknown event types such as
{"type":"other"}, which the missing-completion case previously used; review_contextevents without all five string fields;heartbeatevents without a validstatus;- progress events after
complete; - any
errorevent.
Some already-completed runs may contain these events in archived
cli_eventsor legacystdout. For those runs,load_cli_capturenow raisesCaptureInvalid. The completed run then loses taper credit. Fix-proof clearance for its checkpoint also fails closed. No visible format error explains the change.Confirm that no retained archive contains such events. For example, scan
review_artifactsrows wherekind = 'cli_events', and scan legacycoderabbit-review-logs/*/stdout, for event types outside{finding, complete, start, reviewing, review_context, heartbeat}.If any match exists, choose one of these fixes:
- Apply the strict grammar only to new writer and recovery paths. Keep the previous grammar for reading historical archives.
- Document a deliberate fail-closed reclassification together with an explicit repair path.
- Accepted Main accepted retroactive eligibility changes in retained successful reads; no affected live archive is claimed. Preserve original archived interpretation and explicit strict ingestion/recovery. No archive or count rewrite.
- unknown event types such as
- CLI Review 4 CompletedRuntime 1m 14sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 5 CompletedRuntime 1m 25sFound: 1 Accepted: 0/0/1 Routed: 0
- Make the strict-mode choice explicit at every caller.Trivial
_parse_capture_stdoutdefaults tostrict=False, which selects the lenient retained-success parsing.parse_capture_eventsdefaults tostrict=True. These two entry points sit side by side and have opposite defaults.If a new caller of
_parse_capture_stdoutomits the flag, it gets lenient parsing. That parsing ignores unknown events, ignores error events, and skips the size and event limits. The caller can then accept a success that current ingestion refuses. The runner and the strict tests already passstrict=Trueexplicitly.Make
stricta required keyword on both functions. Each caller then states which parsing it needs.♻️ Proposed refactor
-def _parse_capture_stdout(path: Path, *, strict: bool = False) -> tuple[list[dict[str, Any]], dict[str, Any]]: +def _parse_capture_stdout(path: Path, *, strict: bool) -> tuple[list[dict[str, Any]], dict[str, Any]]: @@ -def parse_capture_events(value: str, *, strict: bool = True) -> tuple[list[dict[str, Any]], dict[str, Any]]: +def parse_capture_events(value: str, *, strict: bool) -> tuple[list[dict[str, Any]], dict[str, Any]]:Update the legacy loader call sites to pass
strict=False. Update the current-ingestion call sites to passstrict=True.- Accepted Main accepted explicit required parser mode at every caller, including retained archive/display reads. Prevent omitted-mode mistakes; preserve strict current ingestion/recovery and original historical interpretation without schema or history changes.
- CLI Review 6 CompletedRuntime 1m 38sFound: 1 Accepted: 0/0/1 Routed: 0
- Add
stderrandreview-duration-secondsto the symlink refusal cases.Trivialcli-recoverreads these capture files:stdoutstderrmetadata.jsonexit-statusreview-duration-secondscapture-complete
This loop checks symlink refusal for only four of them.
stderrmatters most. Recovery archives its content into SQLite. A symlinkedstderrcould therefore copy an external file into the retained review artifacts. No test currently checks for that case. The refusal guard could miss these two files without a test failing. Add both names so the test covers every file that recovery reads.♻️ Proposed change
- for name in ("stdout", "metadata.json", "exit-status", "capture-complete"): + for name in ( + "stdout", + "stderr", + "metadata.json", + "exit-status", + "review-duration-seconds", + "capture-complete", + ):- Accepted Accepted scoped proof gap: include stderr and review-duration-seconds in the existing symlink refusal loop so every recovery-read artifact has fixture coverage. Existing guard already covers them; no runtime behavior or scope expansion.
Routed Findings
No routes recorded
Unlinked items
no items unlinked