Skip to content

refactor(review): state each review rule once and keep schema descriptions to what a value is - #1864

Merged
obviyus merged 5 commits into
mainfrom
review-prompt-slim
Oct 10, 2026
Merged

obviyus merged 5 commits into
mainfrom
review-prompt-slim

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Text-only writing-for-agents pass on the review prompt and decision schema. Every rule stays; each is stated once, in one owner:

  • Schema descriptions say what a value is (34.4k → 8.0k chars). Policy that sat in descriptions (UX override, triage priority, automation merge-risk, root-cause cluster, implemented-on-main evidence, vision fit) moved to the prompt section that applies it. Label catalogs stay (sync test still holds). Schema shape is unchanged.
  • PR template follows the review order (read → product → provenance → correctness → security → proof → merge work and rating), with each rule next to the field it fills. Five copies of the screenshot-only proof rule, three of the accepted-tradeoff rule, and the enum meanings repeated in "Review Rules" collapse to one.
  • No-ops and caches cut: "Likely related people" (host renders it), ClawHub packaging checklist (host appends it), TruffleHog explanation, git recipe lists, host-verified blame internals.
  • Prompt assembly code is unchanged. Wording-pin tests are deleted; behavior tests kept.
chars (openclaw profile) main branch
PR review: static prompt 74,979 51,266
Issue review: static prompt 35,230 28,079
Schema sent with --output-schema (minified) 51,156 23,999
PR review: prompt + schema 126,135 75,265 (−40%)
Issue review: prompt + schema 86,386 52,078 (−40%)

Proof

Hosted-like local reviews (pnpm run review -- --local-only … --codex-model gpt-6.1-sol --codex-sandbox clawsweeper-review, review-permissions CODEX_HOME), main b4ba39fa5 vs this branch, same item heads, run as pairs:

Item main branch first-turn input tokens wall (s)
PR 157845 (has findings) keep open; [P2] post-ACK steering rejection; C/C/C (3 runs) keep open; same [P2] in all 3 runs; a second finding on the heartbeat exemption (main records it as a risk) in 2 of 3 runs; patch tier D in all 3 70.1k → 59.9k 387 / 635 (final pair)
PR 166947 (clean, MEMBER) keep open; no findings; A/A/A (2 runs) keep open; no findings; A/A/A 68.4k → 59.0k 344 / 311
PR 167985 keep open; no findings; C/B/C; maintainer decision (2 runs) same, C/B/C 71.6k → 60.7k 370 / 392
Issue 137361 close duplicate_or_superseded → #110379, P2, impact:ux-friction same (2 pairs, final commit included) 44.7k → 38.2k 157 / 161
Issue 167865 keep open, bug, source_reproducible, strict_bug, queue_fix_pr same (2 pairs, final commit included) 43.0k → 36.5k 158 / 209

The first pairs caught three places where compression changed output (nextStep restating other blockers, risks restating an open owner decision, patch tier dropping a step because the product cap had lost its overallTier anchor and the tier meanings were cut to one word). Those are fixed in the later commits, and the 166947/167985 reruns on the fixed text match main. Open difference: on 157845 the branch rates the patch D where main rates it C, in every run, even after the tier meanings were restored. Decisions, the shared finding, and labels otherwise hold. Model variance: the extra P1 on 157845 showed up in 1 of 2 branch runs. Main put the same concern in risks in both of its runs. Total input tokens per run are dominated by how many tool turns the model takes, which varies by run, so the table shows first-turn input.

Local: pnpm run build:all, pnpm run lint, pnpm run format:check, check:changelog, check:docs, focused prompt/schema test files (883 pass). codex review --base origin/main: no actionable findings.

Merge Danger

Door: two-way. This changes prompt and description text only and bumps the policy version; revert restores it.

Blast radius: every hosted review. If a compressed rule reads weaker, the matching decision field drifts. The paired reviews above are the check.

@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. 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. 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 shortens ClawSweeper’s review instructions and schema descriptions, reorganizes rules by review stage, and removes tests that pin the old wording.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, narrow maintenance backed by real review-command comparisons and an unchanged structured-output contract.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR records after-change runs through the production local review CLI, with copied decisions for finding-bearing, clean, product-decision, and issue scenarios, including reruns after the compression corrections. This exercises the changed model-visible instructions; the unchanged schema structure introduces no stored-data upgrade requirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
User problem: Repeated policy text increases review input and makes the authoritative location of each rule harder to maintain.
Reason: The measured reduction benefits every review without adding runtime machinery or changing the output contract. Real paired review runs support the value of the cleanup.

Merge readiness

✅ Ready for maintainer review

This PR remains useful and distinct from the earlier prompt refactors. Current main does not contain this cleanup, and no concrete introduced correctness or security defect was found.

Priority: P3
Reviewed head: 01ee8083c8fa0e6d6145548bc9622ca221794cd2

Before merge

None.

Findings

None.

Agent review details

How this fits together

ClawSweeper combines repository policy, GitHub evidence, review instructions, and an output schema into a model request. The model returns a structured decision that drives review comments and maintenance proposals.

flowchart LR
  A[GitHub item and evidence] --> C[Review prompt assembly]
  B[Repository policy] --> C
  D[Shortened review instructions] --> C
  E[Decision schema] --> F[Reviewer model]
  C --> F
  F --> G[Structured review decision]
  G --> H[Review comment and maintenance proposal]
Loading

Technical review

Best possible solution:

Keep one authoritative statement of each review rule while preserving the existing decision contract.

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

Not applicable: this is a refactor rather than a reported bug; the PR records paired executions through the real review CLI.

Is this the best way to solve the issue?

Yes: consolidating instructions without changing schema structure or prompt assembly is a narrow approach, supported by source checks and paired review outcomes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 27ed20b60e58.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Review metrics

Metric Value Why it matters
Schema contract 0 structural changes Existing structured decisions remain compatible with the same parser and storage format.
Production and test LOC Production +1/-1; tests +1/-630 Executable production scope is limited to the policy version, while obsolete wording assertions are removed.

Labels

Label changes:

  • add P3: This is review-instruction maintenance with demonstrated input reduction and no identified urgent user-facing failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is review-instruction maintenance with demonstrated input reduction and no identified urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

Reviewed October 9, 2026, 8:30 PM ET / October 10, 2026, 00:30 UTC.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor(review): state each review rule once and keep schema descriptions to what a value is This is item 1/1 in the current shard. Shard 0/1.

This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

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