Skip to content

refactor(review): let Codex judge changed PR content - #1328

Merged
steipete merged 2 commits into
mainfrom
codex/simplify-codex-orchestration
Sep 1, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/simplify-codex-orchestration

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper was reparsing TypeScript/JavaScript patches to decide whether a changed PR could reuse an old review. That duplicated code judgment outside Codex and required a semantic cache, separate patch hydration and revalidation, per-file Git mode probes, and a native compiler installation in review shards.

This removes that path. Structural and exact-content caches still reuse unchanged inputs with the existing policy, freshness, durable-comment identity, checkout-access, and lease checks. Changed PR content—including source comments and formatting—goes to Codex. Git history and blob hydration remain explicit preparation for the restricted review checkout. Historical semantic-cache metadata is ignored and ages out through normal reviews; there is no bulk invalidation.

The review artifact now includes its matching config, prompts, and schemas and needs no compiler installation. TypeScript remains a build dependency. The architecture guide records the design principle: Codex owns reasoning; ClawSweeper owns authorization, isolation, scheduling, durable state, and GitHub writes.

Net reduction: 3,469 lines across 34 files, including 1,716 lines of source and scripts. The tradeoff is more model reviews for content changes that the old cache treated as equivalent. No GitHub mutation or close policy is weakened.

OpenClaw Bay impact: no Bay lane, status, projection, endpoint, or UI contract changes. Comment-only and formatting-only PR revisions now produce ordinary full-review activity instead of a semantic-cache hit. The removed semantic-cache counters were per-run review artifacts, not Bay read-model inputs; existing queue deduplication metrics are separate and remain intact. The full dashboard test suite passed with the refactor, so no Bay code or visual update is needed.

Validation: full pnpm run check passed on Node 24 in AWS Crabbox: 4,233 tests passed, eight skipped, plus 13 focused coverage tests and all build/lint/static checks. Workflow regressions cover unchanged structural/content cache hits, changed PR handoff, scanner refusal before inference, and durable terminal events. The actual runtime archive was extracted in a neutral directory and loaded without TypeScript or an install step.

Live proof: extracted the runtime archive outside the repository and ran review --local-only --local-range on a synthetic comment-only Git change through real TruffleHog and the authenticated Codex CLI. One session completed with review_status: complete, runner-verified checkout access, the exact fixture head, high-confidence keep_open, and zero findings. The transcript confirms source and raw Git-history inspection; the target checkout remained clean. No GitHub item was mutated. A shortened attempt timed out amid local thread-store contention; the normal ten-minute review budget completed successfully. The full-check runtime differs from the live-tested JavaScript only by a comment cleanup.

After-fix receipt from the actual local-range command (synthetic repository; no mocked Codex process):

review --local-only --local-range --base proof-base
  --target-repo openclaw/clawsweeper --codex-timeout-ms 600000

review_status: complete
local_checkout_access: verified
local_checkout_access_source: runner_preflight_v1
pull_head_sha: 4e6701e46a86a257e36331d42cb48b50ad17ca15
decision: keep_open
confidence: high
review_findings: 0
thread.started: 1
turn.started: 1
turn.completed: 1
target_git_status: clean

The fixture head adds only a comment to add.js; both implementation and test source were read by Codex. Scheduled cache selection is covered separately by the production workflow-factory tests with controlled GitHub inputs; the live smoke exercises archive loading, restricted source access, inference, schema validation, and final report production.

Remove the compiler-backed semantic cache and its patch, tree-mode, revalidation, telemetry, and runtime-install plumbing. Keep exact-input caches, restricted checkout hydration, scanner admission, and durable publication gates. Bundle matching runtime configuration, prompts, and schemas.
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed September 1, 2026, 12:09 AM ET / 04:09 UTC.

ClawSweeper review

What this changes

This PR removes compiler-backed semantic equivalence caching so any changed pull-request content receives a normal Codex review, while exact structural and content cache reuse remains.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: the refactor is coherent and the PR body supplies archive-backed real-behavior evidence, but the previously raised requirement to record the OpenClaw Bay impact remains unresolved.

Priority: P2
Reviewed head: c776012c3fec13fe73b0f78ea4f6f3f7de5564c9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, substantial simplification with credible real-path proof; only the required Bay-impact declaration remains before landing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.
Evidence reviewed 6 items Introduced review behavior: The branch removes the review-shard compiler-install step while retaining extraction of the prepared runtime artifact.
Exact-input cache contract: The updated documentation states that changed PR content, including comments and formatting, goes to Codex while structural and content reuse remain exact-input stages.
Runtime packaging: The runtime preparation script excludes TypeScript and adds config, prompts, and schema directories alongside compiled runtime dependencies.
Findings 1 actionable finding [P3] Record the OpenClaw Bay impact
Security None None.

How this fits together

The scheduled review pipeline receives pull-request metadata and source history, reuses only exact unchanged inputs, and sends changed content through a restricted Codex checkout. It emits a durable review report and workflow ledger outcome.

flowchart LR
  A[Scheduled pull request] --> B[Exact cache checks]
  B -->|Changed content| C[History and blob hydration]
  C --> D[Restricted Codex review]
  D --> E[Durable report and ledger]
  B -->|Exact unchanged input| E
Loading

Before merge

  • Record the OpenClaw Bay impact (P3) - This change alters scheduled review cache behavior and review-runtime packaging. Repository policy requires the PR body or handoff to state whether OpenClaw Bay is affected; add the no-impact rationale or the required Bay update and proof before landing.
  • Resolve merge risk (P1) - This changes scheduled review cache admission and runtime packaging; the required explicit OpenClaw Bay impact determination is still absent.
  • Complete next step (P2) - The remaining action is a PR-body policy declaration followed by a fresh review, not a repair-lane code task.

Findings

  • [P3] Record the OpenClaw Bay impact — docs/scheduler.md:41-44
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Net code reduction 34 files; 155 added, 3,624 removed The change removes the semantic-cache and compiler-install path while retaining exact cache and review orchestration.

Merge-risk options

Maintainer options:

  1. Record the Bay determination (recommended)
    Add the required statement in the PR body explaining whether the review-workflow and runtime change affects OpenClaw Bay, with Bay proof/update if it does.

Technical review

Best possible solution:

Retain the exact-input cache design, add a concise statement that Bay is unaffected (or update and prove Bay if it is affected), then obtain a review of the updated PR body.

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

Not applicable as a bug report: the changed review path has a high-confidence after-fix local-range receipt in the PR body, while the remaining item is a required Bay-impact declaration.

Is this the best way to solve the issue?

Yes. Removing the duplicate compiler-backed source-equivalence judgment while preserving exact-input cache gates is the narrowest maintainable direction; the remaining policy declaration should be added before merge.

Full review comments:

  • [P3] Record the OpenClaw Bay impact — docs/scheduler.md:41-44
    This change alters scheduled review cache behavior and review-runtime packaging. Repository policy requires the PR body or handoff to state whether OpenClaw Bay is affected; add the no-impact rationale or the required Bay update and proof before landing.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1bcce8bcf392.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded change to the repository's scheduled review automation and runtime packaging.
  • merge-risk: 🚨 automation: The PR changes cache selection and the GitHub Actions review-shard runtime path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are review-runtime packaging and changed-content Codex handoff; the PR body supplies a terminal receipt from an extracted archive running the real local-range entrypoint against a comment-only Git change, with verified checkout access, a completed Codex session, and a clean checkout. The receipt is limited to the synthetic local-range scenario; focused workflow tests cover scheduled cache selection separately.

Evidence

What I checked:

  • Introduced review behavior: The branch removes the review-shard compiler-install step while retaining extraction of the prepared runtime artifact. (.github/workflows/sweep.yml:4280, c776012c3fec)
  • Exact-input cache contract: The updated documentation states that changed PR content, including comments and formatting, goes to Codex while structural and content reuse remain exact-input stages. (docs/review-cache.md:67, c776012c3fec)
  • Runtime packaging: The runtime preparation script excludes TypeScript and adds config, prompts, and schema directories alongside compiled runtime dependencies. (scripts/prepare-review-runtime.mjs:104, c776012c3fec)
  • Provided behavior proof: The reviewed PR body records a completed authenticated Codex local-range session against a synthetic comment-only Git change, with verified checkout access, a complete report, zero findings, and a clean target checkout. (c776012c3fec)
  • Repository policy: Because this changes review workflow and runtime packaging, repository policy requires the PR or handoff to state whether OpenClaw Bay is affected; neither the current PR body nor its changed cache/scheduler documentation makes that determination. (AGENTS.md:93, c776012c3fec)
  • Feature history: The main refactor commit records removal of the semantic-cache and compiler-install plumbing while preserving exact-input caches, checkout hydration, scanning, and publication gates. (src/clawsweeper-review-command-workflow.ts:1138, 2611a421d6b1)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • State whether OpenClaw Bay is affected in the PR body and explain why no Bay update is needed if it is unaffected.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-01T03:56:56.881Z sha 2611a42 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-01T04:06:20.178Z sha c776012 :: found issues before merge. :: [P3] Record the OpenClaw Bay impact

@steipete
steipete marked this pull request as ready for review September 1, 2026 04:00
@steipete
steipete requested a review from a team as a code owner September 1, 2026 04:00
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now includes the completed archive-backed Codex proof: one real session, a complete report for the synthetic comment-only head, verified checkout access, zero findings, and a clean target checkout. The final documentation commit updates the cache guide; runtime code is unchanged.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 1, 2026
@steipete
steipete merged commit ba95477 into main Sep 1, 2026
25 of 27 checks passed
@steipete
steipete deleted the codex/simplify-codex-orchestration branch September 1, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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