Skip to content

fix: stop storage warnings for test-support-only changes - #1314

Merged
steipete merged 1 commit into
mainfrom
fix/stored-data-test-support
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/stored-data-test-support

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: OpenClaw test-isolation PR and false-positive review.

Additional instructions

Maintainer edits are available on this same-repository branch.

What Problem This Solves

Resolves a problem where maintainers reviewing test-only changes receive a persistent-data warning and a request for migration proof. The reported review correctly assessed production +0/-0, but independently warned that a 57-line Vitest workspace guard changed vector/embedding metadata.

The exact reported head is 5ce7518f720a2ce9af8ebde7642010b4083c8ecd; the offending file is src/agents/embedded-agent-runner/run.workspace-ownership.test-support.ts. It only guards workspace ownership before forwarding calls to existing consumers and restoring its spies.

Why This Change Was Made

The host computes stored-data facts independently of model-authored review metrics. Its shared production-path predicate recognized .test. and .spec. but omitted .test-support.. That admitted test instrumentation into the persistence scanner, where the ordinary metadata variable triggered vector/embedding classification.

Recognize the missing colocated test-support role in the existing bounded basename matcher. Both stored-data and SQLite detection inherit the repair. Do not suppress renderer output, trust model-authored LOC as an exemption, or weaken production persistence, rename-side, unknown-evidence, configuration, or contributor-proof gates. No OpenClaw core/governance change or stored schema change is included.

Production LOC: +1/-1 (net 0). Tests and fixture: +107/-25. Documentation/release notes explain the corrected role.

User Impact

Test-support-only changes no longer invent stored-data migration work. Genuine production vector, index, retention, serialization, browser/durable storage, and schema changes still warn and require the existing review/proof handling. Historical comments are not rewritten by this patch.

OpenClaw Bay Impact

Unaffected. No observer fields, routes, schemas, or controls change.

Documentation Impact

Updated the active implementation reference docs/pr-review-comments.md to identify colocated test-support files as test code. The source of truth remains src/clawsweeper-change-detection.ts; future changes to file-role eligibility must keep this reference aligned. Added a ClawSweeper changelog entry; OpenClaw's release-owned changelog is untouched.

Evidence

  • The new full and production-normalized fixture regressions failed before the production edit with the exact reported warning; afterward, node --test test/pr-surface-policy.test.ts passed 57/57.
  • Extended existing cases for mixed production/test changes, missing/truncated patches, truncated file lists, both rename directions, casing, basename boundaries, and real vector/index/cache-retention changes. No new production testing seam.
  • Pinned OpenClaw scripts/check-file-utils.ts and scripts/lib/changed-path-facts.mjs identify .test-support.* as test-only. Direct inspection of Vitest 4.1.11's @vitest/spy implementation confirms custom implementation forwarding and original-property restoration; no persistence behavior is introduced by this guard.
  • pnpm run build and git diff --check passed. The earlier complete-check attempt also passed static/docs/format checks, all three builds, lint, and the 13-test changed-coverage lane.
  • Validation limitation: the local macOS full-coverage run reported an untouched producer-lock test failure and later stopped producing output, so it was interrupted rather than called green. The exact test passed 1/1 in isolation. That test and its production modules are unchanged from base 99fa19072766106fdf1586196d450b613bf2b09e, whose hosted CI passed. Exact PR-head hosted CI remains a landing gate; the local failure/stall has a separate follow-up.

Real Behavior Proof

Claim and surface: execute the real compiled persistence classifiers, production input normalization, comment renderer, and automation-marker generation. The captured PR patches are inert input. Reports are controlled otherwise-clear inputs so migration-only warning/gate differences are observable independently of a new model review.

Scenario and environment: Node 24.20.0 on macOS; all 25 files captured read-only from the reported PR, plus production vector/SQLite/mixed controls. The 57-line guard was reconstructed from the patch and byte-compared with its pinned Git blob. SHA-256: 97c758d403414f36efc9bd05c4e3cf05793983d46d73d291a80b4e470cbe7238. The exact guard input is retained in test/fixtures/persistence-classifier-133209.json.

Executed commands: pnpm run build; the task-local node /tmp/clawsweeper-stored-data-proof.mjs before and after replay; and the repeatable checked-in boundary proof node --test test/pr-surface-policy.test.ts. In the dependency-sharing worktree, pnpm used its existing pnpm_config_verify_deps_before_run=false control to avoid reconciling the shared installation; no package or dependency changes were made.

Observed trace: all ten replay cases passed after the repair (each row exercised with both full and production-normalized patches).

Scenario Before After
Exact 57-line guard Vector/embedding warning; migration-only human-review marker No stored-data/SQLite surface or migration warning
Complete 25-file PR Stored-data warnings; normalized input matches the reported single warning exactly No stored-data/SQLite surface or migration warning
Production vector metadata Warning and human-review marker Warning and human-review marker retained
Production SQLite column Stored-data/SQLite warnings and human-review marker Warnings and human-review marker retained
PR plus real production serialization change Test-support and production warnings Only the genuine production warning remains

Before-rendered excerpt:

Persistent data-model change detected: vector/embedding metadata: src/agents/embedded-agent-runner/run.workspace-ownership.test-support.ts. Confirm migration or upgrade compatibility proof before merge.

After, the exact guard and complete PR both return {"change":false,"surfaces":[]} and {"change":false,"files":[]}. The renderer emits no stored-data section, and the controlled otherwise-clear report has no migration-only gate.

Limits: controlled offline runtime replay, not a live publication or a new model review. No live service, existing stored decision, mutation gate, deployment, or advisory workflow was changed during the proof. This proves the changed classification/rendering path, not unrelated contributor-proof exemptions. Local before/after rendered comments and verdict JSON are retained with the task artifacts.

Recognize colocated test-support files at the shared persistence and SQLite classifier boundary while preserving production, rename, and incomplete-evidence warnings. Regress the exact 57-line fixture from openclaw/openclaw#133209; production LOC remains net zero.
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 30, 2026 21:59
@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 Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 6:03 PM ET / 22:03 UTC.

ClawSweeper review

What this changes

The PR updates ClawSweeper’s pull-request file classifier so colocated *.test-support.* files do not trigger stored-data or SQLite migration warnings, with regression fixtures and documentation.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open: current main still treats the reported *.test-support.* path as production-like input, while this focused change corrects that shared classifier and preserves the conservative production and rename paths. No correctness finding was identified.

Priority: P3
Reviewed head: 07514ea3bf8dd4d6f708c78dbabbfa8867e7f884

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with comprehensive boundary coverage and a concrete compiled-runtime before/after trace.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.
Evidence reviewed 6 items Shared classifier repair: The introduced basename predicate excludes .test-support. alongside the existing .spec. and .test. markers; both persistence and SQLite detection call this predicate before classifying a path.
Current-main necessity: The pinned base implementation contains only .spec. and .test. exclusions, so it still admits the reported test-support filename into the detector path.
Boundary coverage: Tests cover the exact fixture through full and normalized pull-file inputs, renderer and marker effects, production persistence controls, both rename directions, truncated evidence, and basename boundaries.
Findings None None.
Security None None.

How this fits together

ClawSweeper classifies pull-request paths and patches before detecting persistence or SQLite changes. Those detector results feed the review comment and its merge-gate markers for OpenClaw pull requests.

flowchart LR
A[Pull-request paths and patches] --> B[File-role classifier]
B --> C[Persistence detector]
B --> D[SQLite detector]
C --> E[Review report]
D --> E
E --> F[Warnings and merge gates]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head pnpm check workflow is still in progress and should complete successfully before merge.
  • Complete next step (P2) - No repair dispatch is needed because no actionable patch defect was found; only the normal exact-head check remains before landing.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-1; tests and fixture +107/-25; docs and changelog +4/-1 The behavioral change is confined to one shared predicate, with most of the patch establishing boundary coverage.
Changed files 5 files affected The scope is limited to the classifier, its tests and fixture, operator guidance, and release notes.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single shared filename-classification correction after the current exact-head check completes, retaining the covered production, rename, and incomplete-evidence safeguards.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the single shared filename-classification correction after the current exact-head check completes, retaining the covered production, rename, and incomplete-evidence safeguards.

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

Yes, source-reproducible: the base classifier accepts a test-support basename and passes it to the persistence detector; the checked-in fixture supplies the reported storage-like patch. This read-only review did not independently execute the failing base revision.

Is this the best way to solve the issue?

Yes: extending the existing bounded basename predicate fixes both consumers at their shared boundary, while the tests explicitly retain production, rename, and truncated-evidence handling.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 99fa19072766.

Labels

Label changes:

  • add P3: This is a narrowly scoped false-positive correction in review automation with limited user-facing blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.

Label justifications:

  • P3: This is a narrowly scoped false-positive correction in review automation with limited user-facing blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the shared path classifier used by the persistence and SQLite detectors; the captured PR body supplies an after-fix compiled Node trace over the exact test-support fixture, normalized input, renderer, markers, and production controls, showing the false warning removed while real warnings remain. This review did not rerun that trace in the read-only checkout.

Evidence

What I checked:

  • Shared classifier repair: The introduced basename predicate excludes .test-support. alongside the existing .spec. and .test. markers; both persistence and SQLite detection call this predicate before classifying a path. (src/clawsweeper-change-detection.ts:215, 07514ea3bf8d)
  • Current-main necessity: The pinned base implementation contains only .spec. and .test. exclusions, so it still admits the reported test-support filename into the detector path. (src/clawsweeper-change-detection.ts:215, 99fa19072766)
  • Boundary coverage: Tests cover the exact fixture through full and normalized pull-file inputs, renderer and marker effects, production persistence controls, both rename directions, truncated evidence, and basename boundaries. (test/pr-surface-policy.test.ts:35, 07514ea3bf8d)
  • Aligned operator guidance: The documentation states that colocated test-support files are test code while retaining warnings for production, rename-side, and incomplete evidence. (docs/pr-review-comments.md:127, 07514ea3bf8d)
  • Feature history: Recent history on the classifier includes the prior data-model false-positive repair, bounded test-path classification, and SQLite-warning introduction, indicating a shared maintained surface. (src/clawsweeper-change-detection.ts:202, 8b30fe715ba2)
  • Real behavior trace: The full captured PR body records a Node 24 compiled-classifier before/after replay over the reported fixture and controls, with warnings removed only for test-support inputs and retained for production vector and SQLite inputs. (test/fixtures/persistence-classifier-133209.json:7, 07514ea3bf8d)

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)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 07514ea3bf8dd4d6f708c78dbabbfa8867e7f884:

The latest ClawSweeper review applies to this head and unchanged PR body, reports no actionable findings, and records proof: sufficient. Its only remaining work was the exact-head CI check; that has now completed successfully. No Rank-up moves were requested.

  • Full CI: pnpm check, sparse repair build smoke, and Windows launcher checks passed.
  • CodeQL: both analyses passed.
  • Local pnpm_config_verify_deps_before_run=false pnpm run build, node --test test/pr-surface-policy.test.ts (57/57), the compiled before/after replay (10/10 after cases), and git diff --check passed.
  • Fresh independent Codex reviews ran before commit and against the committed branch/base; both were scoped-clean at their configured P0 threshold. The separate ClawSweeper review found no actionable defects and judged this the shared-owner fix.

The original exact fixture failed before the repair with the reported warning. The repair changes one production line (+1/-1), preserves genuine production/rename/incomplete-evidence warnings, and adds no storage schema, OpenClaw governance, or runtime-policy change. The earlier macOS full-suite failure/stall is disclosed in the PR body and remains separate from the now-green hosted exact-head full gate. Proof was controlled offline classification/rendering, not live publication or deployment.

Proceeding with the user-authorized squash merge of this exact head, without a bypass.

@steipete
steipete merged commit 995ab70 into main Aug 30, 2026
19 checks passed
@steipete
steipete deleted the fix/stored-data-test-support branch August 30, 2026 22:07
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