Skip to content

fix(review): avoid false persistent data-model findings - #983

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/data-model-classifier
Closed

vincentkoc wants to merge 1 commit into
mainfrom
fix/data-model-classifier

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where OpenClaw pull requests with runtime repair, telemetry, cache-usage, or test-fixture vocabulary could be reported as persistent data-model changes even when they did not alter stored state. This produced misleading merge risk in reviews such as openclaw/openclaw#115869.

Why This Change Was Made

The detector now keeps persistence matching tied to explicit storage operations, semantic schema language, and production data-model paths while excluding test-only surfaces. It preserves real schema, migration, cache, vector, serialized-state, compound-path, prose, and production snapshot signals.

User Impact

Maintainers get fewer false stored-data warnings without losing review gates for actual persistence or migration changes.

Evidence

  • pnpm run build && node --test test/pr-surface-policy.test.ts: 28/28 passed.
  • Focused regressions cover production snapshot schemas, prose forms such as cache version and embedding dimension, and compound identifiers such as checkpointFilePath.
  • git diff --check: clean.
  • Fresh autoreview: clean, 0 accepted/actionable findings.

Real Behavior Proof

Claim: the detector no longer classifies the Code Mode reliability patch as a stored data-model change while retaining concrete persistence findings.

Exercised surface: dataModelChangeFromPullFilesForTest, using the complete 118-file GitHub pull-file fixture from openclaw/openclaw#115869.

Command and environment: built @openclaw/clawsweeper on Node 26, then executed the compiled detector 50 times over the captured 118-file fixture.

Observed result: { "change": false, "surfaces": [] }; p50 3.77 ms, p90 3.87 ms, max 7.53 ms. The prior published review reported 12 unrelated data-model surfaces.

Artifact or trace: focused test output and benchmark summary are included in the task handoff; CI will rerun repository gates on this exact branch.

Limits: this PR fixes classifier precision only. Complete pull-file materialization for PRs above the compact review limit remains a separate change.

Combined Integration Proof - July 31, 2026

Both exact merge orders were tested from base 16f01b29508632ab3a904087191e39b20968ab68:

  • 983 -> 984: clean cherry-picks; 66/66 focused tests passed.
  • 984 -> 983: clean cherry-picks; 66/66 focused tests passed.
  • Both orders produced identical Git tree 609478921e5b04e2b1844001bfe81ca713f4f099, with 6 files changed, 560 insertions, and 25 deletions.
  • git diff --check 16f01b29508632ab3a904087191e39b20968ab68..HEAD passed in both worktrees.
  • Live GitHub pagination for OpenClaw PR 115869 returned pages of 100 and 18 files, exactly 118 total.
  • Both orders produced the same compiled-detector output: { "config": { "change": false, "keys": [] }, "data": { "change": false, "surfaces": [] } }.
  • Positive persistence guards remained green in both orders, including schema, serialized-state, cache, vector metadata, production snapshot, compound persisted-path, missing-patch, and truncated-input fixtures.
  • Complete-file guards also remained green in both orders: exact count, unique filenames, stable base/head snapshot, fetch failure, and the 3,000-file API ceiling all fail closed.

Commands used direct tsc plus node --test test/context.test.ts test/pr-surface-policy.test.ts test/review-prompt-context.test.ts; no dependency reconciliation occurred in the proof worktrees.

Maintainer Decision - July 31, 2026

Approved: retain the narrower production-path and explicit-signal classifier boundary. The demonstrated Code Mode false positive is not useful merge-risk signal, while the positive schema, migration, serialized-state, cache, vector, compound-path, missing-patch, and truncated-input guards preserve the conservative cases that matter. No broader vocabulary fallback is requested.

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 3, 2026, 5:05 AM ET / 09:05 UTC.

ClawSweeper review

What this changes

This PR narrows persistent data-model detection and adds regression cases so runtime, telemetry, and test-only vocabulary does not create misleading stored-state merge-risk findings.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

Keep this maintainer-authored draft open, but it needs changes before merge: the branch edits the pre-refactor monolith while current reviews call the extracted detector module, so its intended false-positive fix is not on the live path.

Priority: P2
Reviewed head: 89e434454729baea1d490fbbb3e3e2094c5bb1af

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The intended classifier boundary and original proof are useful, but the unchanged branch does not modify the current implementation path and its proof is stale for the required rebase.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR body describes real detector output from an older-base integration worktree, but it does not prove the rebased active-module behavior that would actually land; add fresh redacted terminal or live-output evidence after porting the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body describes real detector output from an older-base integration worktree, but it does not prove the rebased active-module behavior that would actually land; add fresh redacted terminal or live-output evidence after porting the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Active report path: Current report generation invokes the exported persistent-data classifier from the extracted change-detection module, not the legacy monolith.
Current false-positive behavior remains: The active classifier still scans every candidate path and treats broad repair, JSON/file, cache, metadata, and vector vocabulary as persistent-data surfaces; it does not contain this PR's production-path/test exclusion or narrowed matching.
Patch targets legacy implementation: The proposed functional change is in the former in-file detector inside the old monolith, including the added production-candidate filter, rather than in the extracted module used on current main.
Findings 1 actionable finding [P1] Port the detector change into the active module
Security None None.

How this fits together

ClawSweeper turns GitHub pull-file patches into deterministic merge-risk signals before composing the durable review report. The persistent-data classifier feeds the report builder, which can require migration proof and add stored-data risk labels for OpenClaw pull requests.

flowchart LR
  A[GitHub pull-file patches] --> B[Review context]
  B --> C[Persistent-data classifier]
  C --> D[Review report builder]
  D --> E[Merge-risk labels and proof gate]
  E --> F[Maintainer review]
Loading

Before merge

  • Port the detector change into the active module (P1) - Current reports call src/clawsweeper-change-detection.ts, but this patch changes the former detector in src/clawsweeper.ts. Because the extraction commit is absent from this dirty branch, resolving its merge without moving these edits leaves the live broad matching—and the reported false positives—unchanged.
  • Resolve merge risk (P1) - Merging or resolving the dirty branch without moving the semantic changes into the extracted detector would retain the current broad false-positive classifier while creating misleading test/proof confidence.
  • Complete next step (P2) - The contributor needs to rebase the dirty draft, port the change to the active module, and refresh exact-head real-behavior proof; the maintainer-authored item must remain open rather than be auto-closed.
  • Improve patch quality - Rebase on current main and move the semantic edits into src/clawsweeper-change-detection.ts.
  • Improve patch quality - Run the focused detector regressions and show redacted exact-head output for both the false-positive fixture and persistence-positive cases.

Findings

  • [P1] Port the detector change into the active module — src/clawsweeper.ts:13771-13774
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Original branch scope 2 files affected; production +30/-15, tests +130 The focused original diff is small, but its functional edits land in a legacy file that current main no longer uses for this detector.

Merge-risk options

Maintainer options:

  1. Rebase and port the active detector fix (recommended)
    Move the semantic classifier changes and regressions into the extracted module used by current report generation, then rerun focused real behavior proof on the rebased head.

Technical review

Best possible solution:

Rebase onto current main, implement the narrowed production-path and explicit-persistence boundary in src/clawsweeper-change-detection.ts, preserve the positive persistence guards, and attach fresh exact-head detector output before merge.

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

Yes—source inspection gives a high-confidence reproduction path: current report rendering calls the extracted detector, whose broad matching still classifies the vocabulary that this PR intended to exclude. A focused regression should be established against the rebased active module before landing.

Is this the best way to solve the issue?

No—the proposed branch is not the best current solution because it changes a legacy copy of the detector. Porting the narrow classifier boundary and its regression cases to the active module is the maintainable repair.

Full review comments:

  • [P1] Port the detector change into the active module — src/clawsweeper.ts:13771-13774
    Current reports call src/clawsweeper-change-detection.ts, but this patch changes the former detector in src/clawsweeper.ts. Because the extraction commit is absent from this dirty branch, resolving its merge without moving these edits leaves the live broad matching—and the reported false positives—unchanged.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2d1a40bfa643.

Labels

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body describes real detector output from an older-base integration worktree, but it does not prove the rebased active-module behavior that would actually land; add fresh redacted terminal or live-output evidence after porting the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: The PR addresses a bounded but real review-automation precision defect that can add misleading persistence risk to otherwise unrelated OpenClaw pull requests.
  • merge-risk: 🚨 automation: The classifier feeds automated review gates, and the dirty legacy-targeted patch can leave the live automation behavior unchanged after conflict resolution.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body describes real detector output from an older-base integration worktree, but it does not prove the rebased active-module behavior that would actually land; add fresh redacted terminal or live-output evidence after porting the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Active report path: Current report generation invokes the exported persistent-data classifier from the extracted change-detection module, not the legacy monolith. (src/clawsweeper-report-document.ts:504, 2d1a40bfa643)
  • Current false-positive behavior remains: The active classifier still scans every candidate path and treats broad repair, JSON/file, cache, metadata, and vector vocabulary as persistent-data surfaces; it does not contain this PR's production-path/test exclusion or narrowed matching. (src/clawsweeper-change-detection.ts:83, 2d1a40bfa643)
  • Patch targets legacy implementation: The proposed functional change is in the former in-file detector inside the old monolith, including the added production-candidate filter, rather than in the extracted module used on current main. (src/clawsweeper.ts:13771, 89e434454729)
  • Extraction provenance: The active detector was introduced by the modularization commit, which is on current main but absent from this PR head; blame attributes the active classifier lines to that extraction. (src/clawsweeper-change-detection.ts:71, 8fd1140e7aa9)
  • Current-base status: The PR head is based before the July 31, 2026 extraction and GitHub reports a dirty merge state; its current proof was produced against the older base rather than the active-module result on current main. (test/pr-surface-policy.test.ts:297, 89e434454729)

Likely related people:

  • Peter Steinberger: Introduced the extracted change-detection module that current review rendering calls, and authored the subsequent main-branch rendering/automation refactor. (role: current-module extractor and recent area contributor; confidence: high; commits: 8fd1140e7aa9, 2d1a40bfa643; files: src/clawsweeper-change-detection.ts, src/clawsweeper-report-document.ts, src/clawsweeper.ts)

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 (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-02T08:54:37.725Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-02T12:47:28.070Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-02T15:25:51.850Z sha 89e4344 :: needs changes before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-02T17:35:07.231Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-02T21:03:44.642Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-03T01:09:19.704Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-03T02:51:28.566Z sha 89e4344 :: found issues before merge. :: [P1] Port the classifier changes to the active module
  • reviewed 2026-08-03T06:40:45.015Z sha 89e4344 :: needs changes before merge. :: [P1] Port the classifier changes to the active module

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 31, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 31, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

1 similar comment
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision for head 89e4344: accept the narrower persistent-data classifier boundary. Keep the explicit production-path and persistence-signal positives and the added false-positive regressions; ordinary runtime/test vocabulary must not create a persistent-data merge gate.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient Contributor real behavior proof is sufficient. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 1, 2026
@vincentkoc
vincentkoc force-pushed the fix/data-model-classifier branch from 89e4344 to 9737573 Compare August 4, 2026 01:17
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closing during maintainer queue cleanup: this draft has been idle since Aug 4 while main has moved substantially underneath it (history rewrite aftermath plus the token-routing and review-lane changes of Aug 7-8). Closing to keep the queue decision-ready — nothing against the fix itself. @vincentkoc if this is still on your stack, reopen or recut against current main and it will get a fast review. 🦞

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants