Skip to content

refactor(review): read PR readiness and comments from typed records - #1891

Merged
obviyus merged 4 commits into
mainfrom
review-record-s4b
Oct 10, 2026
Merged

obviyus merged 4 commits into
mainfrom
review-record-s4b

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Complete row 2 slice S4b after #1861.

  • reportReviewDecision supplies proof, rating, showcase, readiness and public-comment fields from the typed record. Reports without the line retain their existing readers; an unreadable line never falls back.
  • One host proof function applies proof: override, maintainer/bot exemptions, empty-summary handling and the authority-chain marker (including leading whitespace). Independent data-model compatibility remains intact.
  • PR labels, merge readiness, comment bodies, automation markers and the close/keep-open choice use the same saved decision.
  • Preserve existing publication semantics: first-line scalar prose, same-repository reviewed-main evidence links, public attribution policy and host-owned identity/receipt metadata. Legacy parsers remain for S7.
  • Update a zero-diff promotion's typed decision before rendering and saving its close comment.

No stored format or schema changes. OpenClaw Bay is unaffected: this changes the source of already-existing comment and label decisions, not its observer data contract.

Proof

Frozen branch head: 545172673195895f7bef8e0b697fe04875050cd3.
Main baseline: 9e8717ba669e480507db031901d8787cf3d077e5.

Run the S4 saved-corpus driver against both built trees:

node ~/Developer/.agents/handoffs/clawsweeper-review-record/s4b/complete/proof.ts \
  ~/Developer/.worktrees/clawsweeper/review-record-s4b-baseline \
  ~/Developer/.worktrees/clawsweeper/review-record-s4b

The driver exercises renderReviewCommentFromReport and the shipped apply-decisions --sync-comments-only --item-numbers N CLI. Its recording GitHub transport is the existing promotionGhMock, with its hard-coded head-sha replaced by each saved report's head so check/status requests address the same fixture. No live GitHub mutations are exercised. Volatile apply timestamps and scratch paths are masked as in S4a.

Corpus: the same 73 saved real reports used by S4a (59 PR reports, nine saved production reports, five issues), with no-record, backfilled, real-record and corrupt-record variants.

Variant Reports Identical rendered comment bytes Render failures, main / branch
No record 73 73/73 0 / 0
Backfilled record 71 71/71 0 / 0
Real record 1 1/1 0 / 0
Backfill not possible 2 2/2 0 / 0
Corrupt record 12 No comment rendered 12 / 12

147/147 readable comments are byte-identical. All 159/159 CLI comparisons are identical, including label calls, all recorded GitHub calls, published comment bodies, apply results and report markdown. Every corrupt record is skipped with skipped_changed_since_review and zero GitHub calls. The render harness includes local stack traces in failures, so their path-dependent error strings are not byte-equal; both implementations reject all 12.

Artifacts: ~/Developer/.agents/handoffs/clawsweeper-review-record/s4b/complete/{proof.ts,proof.out,proof-table.md,render-*.json}.

Checks

  • pnpm run build:all — pass.
  • Focused record, label, readiness, comment, decision-packet and close tests — 204 pass, 0 fail.
  • Three existing forged-publication regression tests — 3 pass, 0 fail.
  • pnpm run lint and pnpm run format:check — pass.
  • codex review --base origin/main on the frozen committed head — no actionable findings; its reported build and 207 focused tests passed.
  • No full-suite run; CI remains the gate. No merge requested.

Earlier local reviews found and this head fixes: mixed automation-marker readers, reviewed-main evidence-link loss, multiline scalar prose leakage, whitespace-prefixed authority requirements, and zero-diff promotion rendering before the record update.

A supplemental pre-final-projection 80,000-record reader run processed 6.4 GB without retaining the corpus (about 174 MiB peak heap on the branch). It is not claimed as an exact-head full production-corpus benchmark; additional memory sweeps were deferred as requested.

CI repair after rebasing on main

Current head: 2c1f380671efb42511bd2a2c687abeeb51433ae3.
Rebased on 56f90615e6cd5cd24ea1507e020f32d7487bf414, including #1887, #1885 and #1888. The earlier corpus results above remain historical evidence at their explicitly named head, not a claim that they were rerun here.

The failing test in https://github.com/openclaw/clawsweeper/actions/runs/38048164365 failed during fixture construction, before apply ran: it corrupted the record and then tried to render a synced comment. S4b correctly makes that renderer reject unreadable typed records. This is not a regression in the apply fail-closed path or an interaction with the security-label/source-revision changes.

The fixture now renders the last valid synced comment first and corrupts the stored record afterward. Its non-dry-run apply-decisions invocation uses temporary item/closed directories and a recording GitHub transport. It asserts the persisted skipped_changed_since_review disposition, the explicit fresh-review-required reason, no closed report, and zero GitHub calls (therefore zero mutations). No production fallback was added and no assertion was weakened.

Validation (pueue task 1401): pnpm run build:all, six focused files including test/apply-stale-version-bug-policy.test.ts, record/label/close-policy tests (45 passed, zero failed), pnpm run lint, pnpm run format:check, and codex review --base origin/main all passed; Codex reported no actionable defects. Committed-head review (pueue task 1408) also reported no actionable defects. This is a fixture-only CI repair; existing changelog and Bay scope remain unchanged. No live GitHub mutations or full-suite execution are claimed.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes readiness, proof policy, labels, automation markers and public comments read the saved typed review decision.

Example: A report’s typed record contains an A rating while its legacy markdown fields contain C.

  • Before: Rating labels and readiness use the legacy C rating.
  • After: Labels, readiness and the public comment use the saved A rating.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cutover is coherent and no actionable defect was found; available runtime evidence is historical and uses a mocked transport.
Proof confidence 🦐 gold shrimp (3/6) Ordinary proof is exempt under the supplied maintainer-author classification; the reported corpus driver exercises rendering and apply with a mocked GitHub transport at an explicitly historical head, and local artifact paths are not viewable here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Comments, labels and readiness can disagree when they reconstruct the saved review through separate markdown readers.
Reason: This completes the existing typed-record migration through its shared reader without introducing another decision source.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it completes a useful typed-record cutover absent from current main, and source review found no actionable introduced defect.

Priority: P3
Reviewed head: 2c1f380671efb42511bd2a2c687abeeb51433ae3

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied comparisons do not show current-head publication of the typed comment, labels and readiness through the real GitHub client.
Agent review details

How this fits together

Stored review reports enter the publication readers, which produce GitHub comments, labels and advisory repair-loop readiness markers.

flowchart TD
  A[Stored review report] --> B[Strict typed record reader]
  A --> C[Legacy readers when record absent]
  B --> D[Shared decision projection]
  C --> D
  D --> E[Proof and readiness policy]
  E --> F[Comments labels and automation markers]
Loading

Technical review

Best possible solution:

Complete the shared typed-decision cutover while preserving strict validation, legacy compatibility and existing publication guards.

Do we have a high-confidence way to reproduce the issue?

This is a refactor; current-main source confirms that readiness and publication still reconstruct the affected fields from markdown.

Is this the best way to solve the issue?

Extending the existing typed projection keeps dependent consumers together and retains the established record format and fallback boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 56f90615e6cd.

Provenance checked

  • Typed decision projection and consumer cutover keeps the original intent (27ed20b: The preceding label slice established strict typed reads and explicitly deferred the interdependent readiness and public-comment consumers.)
  • Readiness and automation markers keeps the original intent (35e637e: Visible blockers and advisory automation eligibility must share one exact readiness interpretation.)
  • Proof publication policy keeps the original intent (76636fa: Proof comments and status labels must agree while retaining the recorded assessment and existing merge gate.)
  • Promotion record update ordering keeps the original intent (410f120: Decision mutations keep the stored typed record aligned with promoted report fields.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 27ed20b adds src/report-review-decision.ts:50 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 27ed20b60e58; files: src/report-review-decision.ts)
  • Vincent Koc: Raw commit 35e637e adds src/clawsweeper-review-comment-automation.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 35e637efc9ea; files: src/clawsweeper-review-comment-automation.ts)
  • Peter Steinberger: Raw commit 76636fa adds src/clawsweeper-proof-policy.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 76636fabadbb; files: src/clawsweeper-proof-policy.ts)

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is an internal consistency refactor with no established urgent user-facing regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide current-head real-client publication evidence for the typed comment, labels and readiness path.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-10T11:25:16.701Z sha 5451726 :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 8:02 AM ET / 12:02 UTC (Revision 2).

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 10, 2026
@obviyus
obviyus merged commit 8c2f602 into main Oct 10, 2026
28 of 30 checks passed
@obviyus
obviyus deleted the review-record-s4b branch October 10, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant