Repository navigation
feat(records): read-only dry run for the review_record backfill - #1841
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesAdds a command and manual workflow that preview converting stored review reports into structured decisions, reporting conversion losses without changing the reports. Example: An operator classifies nine saved review reports.
Review scores
ProductKind: Feature · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR remains useful, distinct work and is ready for maintainer consideration; no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherClawSweeper stores review reports in its canonical Worker store. This tool reads local copies of those reports, reconstructs their decisions with existing readers, and produces a JSON summary for evaluating a later migration. flowchart TD
A[Manual workflow] --> B[Read canonical reports]
B --> C[Local report copies]
C --> D[Validate existing structured record]
D --> E[Reconstruct legacy decision]
E --> F[Render and compare decision fields]
D --> G[Classification summary]
F --> G
Technical reviewBest possible solution: Keep the dry-run stage separate from record writes and use its results to evaluate the later migration. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a migration preview capability; its recorded CLI run demonstrates classification on saved reports. Is this the best way to solve the issue? Yes: reconstructing with the existing readers and comparing through the shipped renderer exposes conversion loss without introducing a competing report format. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e6419367a4d4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 9, 2026, 5:16 PM ET / 21:16 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What
S2a of the approved review-record plan (row 2): a read-only dry run that shows what the backfill would do for every stored report. Nothing here writes to records.
node dist/clawsweeper.js backfill-review-records --records-dir records/<slug> --output <json>(src/review-record-backfill.ts). For eachitems/*.mdandclosed/*.mdit reports exactly one of these statuses:typed: the report already has a validreview_recordline.invalid_record: the report has areview_recordline that does not read back.unparseable: the typed decision cannot be made, or it would not read back. The reason is reported.losslessorlossy: the decision was made from the report's front matter and sections, re-rendered with the shippedmarkdownFor, and compared with the stored report on every decision front-matter key (about 80) and every decision section. The comparison skips the action-onlyClose Commentsection and theAction taken:line. JSON values are compared by value, not by key order. Alossyreport lists the fields that differ, with short samples that start at the first differing character. This catches the silent fallbacks in the report readers (audit Finding 4) instead of storing them..github/workflows/review-record-backfill.yml:workflow_dispatchonly,permissions: contents: read. Its steps: build, hydrate records only (no git state, no blobs), run the command for each slug, uploadreview-record-backfillas an artifact.review-record.ts:reviewRecordProblem(decision, subject)is now exported, andreviewRecordFrontMatterLinetakes aReviewRecord, so a backfilled line can carry"origin":"backfill".The converter reuses the existing report readers, which are the last users the design keeps. It corrects three reader quirks that the re-render check found on real reports:
["none"]lists in Vision Fit and in PR rating next steps;shathat the reader takes from the file-link URL, kept only where the report prints a- sha:line;local_checkout_accesswhen its source isunknown.The module is deleted with the readers in S7.
Why
Audit agent://SlopDataModel/report, Findings 1 and 4. Approved plan: S2 is split into S2a (dry run) and S2b (writes, only after a go on the dry-run counts). This PR is S2a; it gives the counts.
Proof
Shipped CLI, on sample reports: the saved real reviews in
~/Developer/.agents/handoffs/clawsweeper-review-qualityand the S1 proof outputs.For #167817, the decision rebuilt from the legacy report equals the decision that S1 stored. It differs only in
fixedPullRequest(absent there,nullhere), which renders the same.The source files did not change after the run.
Tests (
test/review-record-backfill.test.ts):markdownForwithout the record line come backlosslesswithorigin: backfill, and their decision equals the original apart from the empty optional fields, the published owners, and the close comment of a kept-open report;lossyand names only## Testing Review;build:all,lint,format:check, the workflow invariant tests and the touched tests pass. The full suite runs in CI.Codex dispositions
codex review --base origin/main: "No actionable defects were found." Nothing to fix.Merge Danger
CLAWSWEEPER_WEBHOOK_SECRETand uploads one JSON artifact. Before S2b may write, it must hash reports without thereview_recordline, so that a backfill does not change implementation-intake keys. That change is a separate small PR with a failing-first test.