Repository navigation
fix: avoid persistence warnings for test fixtures - #1257
Conversation
Reuse the existing production-path scope for persistence detection so test fixture writes do not request migration proof. Preserve production, rename, semantic documentation, and unknown-evidence detection. Includes the diagnostic-only diff from openclaw/openclaw#130585 as regression evidence; the already-landed OpenGrep fix is unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:53 AM ET / 04:53 UTC. ClawSweeper reviewWhat this changesThe PR limits persistent-data-model detection to production and semantic documentation paths so test and fixture writes do not trigger migration-proof warnings. Merge readinessKeep open for landing: the narrow classifier fix is correct and is not yet on current main. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherClawSweeper turns GitHub PR file metadata and patches into review signals and a maintainer comment. This detector decides whether a PR receives a stored-data warning that requests upgrade evidence. flowchart LR
A[GitHub PR files] --> B[Change detector]
B --> C{Production or docs path?}
C -->|Yes| D[Persistence analysis]
C -->|No| E[Ignore test support path]
D --> F[Review report fields]
E --> F
F --> G[Maintainer comment]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the production-path scoping rule with its captured-payload regression coverage so persistence warnings stay reserved for meaningful production or documentation changes. Do we have a high-confidence way to reproduce the issue? Yes. The PR body records the prior warning and after-fix absence using the captured PR-file payload through the compiled production detector and renderer, and the fixture is checked in. Is this the best way to solve the issue? Yes. Reusing the established production-path predicate is the narrowest shared boundary for excluding test support paths while retaining production rename and incomplete-evidence handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f211e21fb89d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready review for exact head The source repair, real captured-input replay, and regression coverage are verified. Exact-head CI is green, including the full The earlier local full-check failures remain disclosed in the PR body and independently reproduced on unchanged baseline source. The Git-pruning refspec and offline-pnpm repairs remain separate; this PR neither weakens their checks nor disables containment. Production remains +4/-1; no OpenGrep source, persistence contract, or proof-rendering behavior is changed. One history clarification: the general persistence heuristic originated in the stored-data warning feature, commit f41ed1bc4a40. The recent SQLite warning work added the adjacent production-path predicate; it did not introduce this older generic-classifier false positive. |
Additional instructions
Maintainers can edit this same-repository branch.
Related: openclaw/openclaw#130585 — diagnostic-only OpenGrep repair, already merged and unchanged by this PR.
What Problem This Solves
Fixes an issue where maintainers reviewing test-only setup would receive a persistent-data-model warning and a migration-proof requirement even though no runtime persistence contract changed.
The review of the OpenGrep diagnostic repair classified
test/scripts/run-opengrep.test.tsas serialized state. That real two-file patch changes only missing-tool installation guidance (+1/-3) and adds a subprocess regression (+31/-0). The maintainer disposition identifies the warning as inapplicable.Why This Change Was Made
The generic persistence detector matched the test fixture's
writeFile(...)call without first excluding test/support paths. The producer now reuses the existing SQLite classifier's production-path predicate before both semantic detection and missing/truncated-patch handling, while preserving semantic documentation checks.Current and previous filenames are filtered independently: moving production persistence code into a test or fixture path still retains the original production-side evidence. This changes the classification owner, not the renderer or upgrade-proof gate. It introduces no new regex family, dependency, config, schema, migration, or test-only production seam.
User Impact
Test, fixture, and example setup no longer creates a persistence warning merely by writing temporary data. Actual production serialization, schemas, migrations/backfills, cache/vector/durable storage, semantic documentation changes, and conservative incomplete-evidence warnings retain their existing behavior.
The already-landed OpenGrep fix is not modified. The original review's separate terminal-completion discrepancy is not changed or labeled a proven reporter defect here.
OpenClaw Bay Impact
No Bay changes are needed. Publication fields, queue/lifecycle behavior, and observer API contracts are unchanged; future review records carry corrected values in the existing data-model fields.
Documentation Impact
Updated the active implementation reference
docs/pr-review-comments.mdto explain production/test scope, rename handling, conservative unknown warnings, and the distinction between a review signal and proof of a changed persistence contract. Its owning source remainssrc/clawsweeper-change-detection.tsand the report renderer; review this paragraph when those detection or rendering contracts change.Evidence
7415491d399e97288a1e5c58eea8273a0d3e12e0, and verified them against the head-parent diff. The permanent fixture retains both complete patches and their additions/deletions.a2641b27c403012451cf307d03fb699933fef6a5and the current-main baseline. The production renderer emitted the original warning sentence.node --test test/pr-surface-policy.test.tspassed all 34 tests.pnpm run build:all, formatting, docs checks, all lint lanes, and focused coverage passed. Fresh isolated Codex reviews before commit and on the rebased committed branch both returned no findings (P0 scope; patch is correct). On the committed head, all three builds, formatting and docs checks, all 34 focused tests, and the production classifier/renderer replay passed again.pnpm run checkran 3,767 tests: 3,710 passed, 48 failed, and 9 skipped. The failures were independently reproduced from an extracted, rebuilt unchanged baseline and are separate from this patch: 42 failures from abbreviated fetch refspecs pruningorigin/mainwithfetch.prune=true, and 6 from an unprepared pinned pnpm runtime in a fresh offline validation profile. These have separate active repairs; this PR does not disable pruning, enable network access in containment, or weaken their assertions. Current-main hosted CI is green; exact-head hosted CI must also be green before merge.Real Behavior Proof
Verified ClawSweeper head:
b45a0380ccfe72d9dd9091c6bada26bea9871cf5, rebased ontof211e21fb89d00777ac07cc13c358f9f7b02a939. All four task-file blobs are unchanged from the accepted precommit patch.Claim: The actual reviewed two-file diagnostic/test diff must not produce a persistent-data-model warning, while real production persistence and incomplete-evidence signals remain intact.
Exercised surface: Captured GitHub
pullFilespayload → compiled productiondataModelChangeFromContext→ report frontmatter → productionrenderReviewCommentFromReport. No publisher, apply, repair, or GitHub mutation path is used.Scenario and environment: Exact OpenClaw PR 130585 head above; isolated ClawSweeper checkout on macOS, repository-pinned pnpm 11.10.0. Initial proof ran on Node 24.19.0; the committed-head rebuild, 34 focused tests, and production replay passed on Node 26.7.0. This is a controlled replay of real review input, not a mocked classifier or a claim of deployed/live model review.
Commands:
pnpm run build:all; direct Node invocation of the compiled classifier and comment renderer usingtest/fixtures/persistence-classifier-130585.json;node --test test/pr-surface-policy.test.ts.The classifier portion is independently reproducible from the checked-in real payload after building:
Observed before:
{"change":true,"surfaces":["serialized state: test/scripts/run-opengrep.test.ts"]}The rendered comment contained:
Persistent data-model change detected: serialized state: test/scripts/run-opengrep.test.ts. Confirm migration or upgrade compatibility proof before merge.Observed after:
{"change":false,"surfaces":[]}The rendered comment has no stored-data warning. Companion production and rename scenarios retain their expected warnings.
Limits: No deployment is part of this PR. The original terminal-proof artifact records a completion-observation timeout and both output assertions as
not_run; its passing test summary does not prove outer-process exit. Missing original pane/PID/exit telemetry prevents assigning that separate discrepancy to the reporter or wrapper, so neither is changed here.