Repository navigation
fix(review): avoid false source and config warnings for tests - #1323
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:33 PM ET / 16:33 UTC. ClawSweeper reviewWhat this changesThe PR centralizes recognition of explicitly named OpenClaw test-role paths so surface statistics classify them as tests and config-change detection avoids false config warnings. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this PR open for normal maintainer review: current main lacks the shared test-role classifier, and the introduced change has focused coverage plus an exact-head compiled-path proof. No actionable correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper reads changed-file metadata from OpenClaw PRs to classify their surface and decide whether additional review gates apply. Those classifications feed the rendered review comment and trusted automation markers. flowchart LR
A[OpenClaw PR file list] --> B[Test-role path classifier]
B --> C[Surface statistics]
B --> D[Config change detector]
C --> E[Review comment]
D --> E
E --> F[Automation markers]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Merge the shared classifier and its focused regression coverage so explicitly named OpenClaw test support is consistently excluded from source and config-specific review warnings without relaxing contributor-proof or storage gates. Do we have a high-confidence way to reproduce the issue? Yes. The base and introduced source establish both classification paths, and the PR body provides exact-head compiled producer-and-consumer before/after evidence. Is this the best way to solve the issue? Yes. A small shared naming predicate removes the divergent classification logic while preserving existing generated-file precedence, uncertainty handling, contributor proof, and storage detection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 659dee73d070. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes an issue where OpenClaw PR reviews count explicitly named test-support files as production Source changes and treat assertion-only colocated config tests as configuration changes. The latter can emit a false human-review blocker even when the review is otherwise eligible.
The concrete source-stat repro is the 57-line Vitest support file
src/agents/embedded-agent-runner/run.workspace-ownership.test-support.ts. Its deterministic Source +57 disagreed with the separate, correct reviewer production +0/-0 assessment. The config repro is an assertion-only change insrc/config/schema.test.ts.Related review context: openclaw/openclaw#133209 (comment)
Why This Change Was Made
Share one bounded test-role fact between surface statistics and config-path eligibility, rather than importing presentation buckets or runnable-test selectors into policy detection. Recognize explicit test/spec and test-support/helpers/utils/harness/fixtures roles; generic production support/harness/helper names remain eligible.
Each rename side is scoped independently before config-patch uncertainty. Production config and semantic documentation evidence, missing/truncated production patches, whole-list truncation, generated/docs precedence, and production roots remain unchanged. The independently landed storage repair and unknown-count handling on main are preserved. Storage, contributor-proof, close/merge and router gates are not generalized or relaxed.
Production LOC: +13/-9 (net +4). Tests and test support: +449/-0. The small production increase is the wiring for a shared naming fact while removing the duplicate private predicate.
User Impact
The support-only example now reports Source 0 and Tests +57 without rewriting model-owned review metrics. Test-only config patches no longer create a config-specific blocker. Applicable external test-only PRs still need contributor proof; missing, mock-only, insufficient and N/A assessments do not gain pass/fix markers.
This changes classification for subsequent review/rendering work, not existing persisted config flags. No historical records, original target PR comments, or stored user data are rewritten by this PR.
OpenClaw Bay Impact
No Bay change is needed. Its observer API, data contract, routes and controls are unchanged.
Documentation Impact
Updated the active implementation guidance in
docs/pr-review-comments.mdand the ClawSweeper changelog. The documentation distinguishes role facts, model metrics, uncertainty, contributor proof and storage ownership. No OpenClaw governance or release-owned files are changed.Evidence
git diff --checkpass.CI=1 pnpm run checkexited 0: 4,191 passed, 0 failed, 8 skipped (4,199 tests), plus 13/13 changed-coverage tests.Real Behavior Proof
Exercised head:
fa9d272e472378a34258339af81b1f107fb693d3Comparison base:
659dee73d0706fee9776f7986d9861e82b897d24Environment: AWS Crabbox, clean Linux checkout, Node v24.18.1, pnpm 11.10.0. The published branch was cloned afresh and its HEAD checked before execution. The task-owned lease was stopped afterward.
Claim and exercised surface: actual compiled file-role/config producers, decision normalization, report serialization, full review-comment rendering and trusted-marker parsing. Inputs are controlled file diffs and supplied reviewer decisions; the proof does not execute a model, publish a live target review, or execute a router action. Unrelated formatting dependencies are substituted and unexpected capabilities fail closed.
Observed before → after:
change: true,unknown-config-surface-changechange: false, no keysThe comparison substitutes only the two original owner modules from the pinned base; current report and marker consumers remain the same on both sides. The separate storage fix already on main is included in both sides. The focused regressions additionally exercise mock-only and insufficient proof.
Commands executed: the exact-head clean Linux checkout ran
pnpm install --frozen-lockfile,pnpm run build:all, the before/after producer-and-consumer proof, storage parity, andCI=1 pnpm run check. The minimal exported-producer result is reproducible after the build with:Trace/provenance: The captured source/result record is below. The uploaded proof/check script SHA-256 was
4ae3f3b808dfbe9db5bcb10f0d58aa7fa68f1134d7546648bdb27f6ff59aeb4f; only task-specific synthetic evidence is included here.{ "head": "fa9d272e472378a34258339af81b1f107fb693d3", "provider": "AWS Crabbox", "node": "v24.18.1", "pnpm": "11.10.0", "before": { "bucket": "source", "config": { "change": true, "keys": [ "unknown-config-surface-change" ] } }, "after": { "bucket": "tests", "config": { "change": false, "keys": [] } }, "storageComparisons": 2540, "fullCheck": { "tests": 4199, "passed": 4191, "failed": 0, "skipped": 8, "exitCode": 0 } }Canonical naming evidence was read as data from OpenClaw
5ce7518f720a2ce9af8ebde7642010b4083c8ecd:scripts/check-file-utils.tsandscripts/lib/changed-path-facts.mjs, plus five actual pinned support-role files. Their different surface and runnable-selector policies were not copied wholesale.Limits: deterministic source/report behavior on a clean Linux checkout, not a live OpenClaw PR review, model-quality assessment, or authorization to merge the original target PR. No migration, governance, storage, proof-policy, workflow, or deployment change is included.