perf(prompt): stabilize review cache prefix - #163
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 9:42 PM ET / August 2, 2026, 01:42 UTC. ClawSweeper reviewWhat this changesReorders review prompts so shared policy and the JSON response contract precede per-feature project, evidence, and file context, then adds a test that two features share that prefix. Merge readiness⛔ Blocked until real behavior proof is added - 5 items remain Keep this PR open: the prompt reordering is focused and has a useful regression test, but the current branch has a concrete Priority: P3 Review scores
Verification
How this fits togetherClawpatch maps a repository into semantic features, then builds one provider-review prompt per feature. The provider returns structured findings that are schema-validated and fed into the review workflow, so prompt ordering affects both cache reuse and model-facing review context. flowchart LR
Project[Mapped project] --> Prompt[Review prompt builder]
Feature[Semantic feature] --> Prompt
Files[Selected source and test excerpts] --> Prompt
Prompt --> Provider[Review provider]
Provider --> Validation[Schema validation]
Validation --> Findings[Review findings]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current Do we have a high-confidence way to reproduce the issue? No high-confidence real provider reproduction is included. The new unit test proves prompt-text ordering, but it does not show cache reuse or after-fix structured output from a provider. Is this the best way to solve the issue? Yes, the proposed static-prefix ordering and focused regression test are a maintainable approach, provided the branch is rebased and real provider behavior confirms the performance claim. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4a5028c27f01. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (24 earlier review cycles; latest 8 shown)
|
|
I reproduced this on the built CLI with two different features reviewed sequentially through the real Codex provider ( The structural test passes, but it only proves that the prompt text before Focused proof otherwise passed: 454 tests across prompt, mapper, and Rust mapper coverage; formatting; type-checking; linting; and production build. The problem is specifically that the performance claim did not survive live validation. My triage recommendation is CLOSE rather than land an unverified prompt reordering. |
Summary
Why
Clawpatch starts a provider call per feature. Provider prompt caches require an exact matching prefix, but the feature record previously appeared before most shared review instructions. That made the common instruction tail ineligible for reuse across feature reviews.
This change only reorders existing prompt content; the provider output schema and validation behavior are unchanged.
Checks