Skip to content

fix(review): avoid false source and config warnings for tests - #1323

Merged
steipete merged 2 commits into
mainfrom
steipete/adjacent-file-role-local
Sep 1, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/adjacent-file-role-local

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 in src/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.md and 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

  • 136 focused tests pass on the final candidate, including four regressions that fail against the pre-fix owner modules with the intended assertion failures—not missing imports or fixture setup failures.
  • Build, static/docs/format checks, lint, and git diff --check pass.
  • Fresh isolated independent Codex review of the committed branch found no actionable P0–P2 findings.
  • Full Linux owner check: CI=1 pnpm run check exited 0: 4,191 passed, 0 failed, 8 skipped (4,199 tests), plus 13/13 changed-coverage tests.
  • Earlier local validation at the original base had six failures outside the patch; five passed targeted retries and the remaining Rustup retry-count failure also reproduced on that untouched base. No retry budgets, timeout assertions, or unrelated implementations were changed to make this patch pass.

Real Behavior Proof

Exercised head: fa9d272e472378a34258339af81b1f107fb693d3
Comparison base: 659dee73d0706fee9776f7986d9861e82b897d24
Environment: 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:

Scenario Before After
57-line support fixture Source +57; Tests 0 Source 0; Tests +57
Supplied production/test metric production +0/-0; tests +57/-0 Unchanged
Assertion-only config test change: true, unknown-config-surface-change change: false, no keys
Otherwise eligible config-test report with sufficient proof Human-only marker Pass intent
Missing/N/A contributor proof, real production config/storage, truncated file list Human-only marker Still human-only
Storage and SQLite detectors, including rename and uncertainty cases Pinned-main behavior 2,540/2,540 comparisons identical across 1,270 scenarios

The 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, and CI=1 pnpm run check. The minimal exported-producer result is reproducible after the build with:

node --input-type=module <<'NODE'
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { openClawPrSurfaceBucket, buildOpenClawPrSurfaceStats, renderOpenClawPrSurfaceTable } from './dist/pr-surface-stats.js';
import { configSurfaceChangeFromContext } from './dist/clawsweeper-change-detection.js';
const path = 'src/agents/embedded-agent-runner/run.workspace-ownership.test-support.ts';
const context = { issue: {}, comments: [], timeline: [], pullFiles: [{ filename: 'src/config/schema.test.ts', patch: '@@\n+  expect(result).toEqual(expected);' }] };
const bucket = openClawPrSurfaceBucket(path);
const config = configSurfaceChangeFromContext('openclaw/openclaw', context);
assert.equal(bucket, 'tests');
assert.deepEqual(config, { change: false, keys: [] });
const stats = buildOpenClawPrSurfaceStats([{ path, additions: 57, deletions: 0 }]);
assert.ok(stats);
console.log(JSON.stringify({ head: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(), bucket, config }));
console.log(renderOpenClawPrSurfaceTable(stats));
NODE

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.ts and scripts/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.

@steipete steipete self-assigned this Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:33 PM ET / 16:33 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible 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
Reviewed head: fa9d272e472378a34258339af81b1f107fb693d3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong exact-head behavioral proof and thorough focused coverage support a normal mergeable repair.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.
Evidence reviewed 5 items Introduced shared classification: The branch adds an explicit test-role path helper and uses it both before config-surface matching and in surface statistics after generated-file precedence.
Current-main gap: The PR base, which is the fetched current main revision, still has the older private surface-stat predicate and no shared helper.
Focused regression coverage: New coverage checks naming boundaries, generated/docs precedence, rename sides, conservative truncation handling, surface rendering, and proof-marker preservation.
Findings None None.
Security None None.

How this fits together

ClawSweeper 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]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production vs test LOC production +13/-9; tests and test support +449/-0 The production change is a small shared predicate while most of the patch is focused regression coverage.
Affected files 11 files, 474 added, 9 removed The repair spans classification, rendering coverage, and documentation without changing workflows or dependencies.

Technical review

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

Labels

Label changes:

  • add P2: This repair affects automated PR review classification and can remove a false human-review gate, with limited direct user blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.

Label justifications:

  • P2: This repair affects automated PR review classification and can remove a false human-review gate, with limited direct user blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are the compiled test-role classifier and config detector; the PR body maps exact-head controlled file-diff inputs through them and the real comment/marker consumers in a clean AWS Crabbox checkout, recording the expected before/after result. It appropriately does not claim a live OpenClaw review.

Evidence

What I checked:

  • Introduced shared classification: The branch adds an explicit test-role path helper and uses it both before config-surface matching and in surface statistics after generated-file precedence. (src/openclaw-file-role.ts:2, fa9d272e4723)
  • Current-main gap: The PR base, which is the fetched current main revision, still has the older private surface-stat predicate and no shared helper. (src/pr-surface-stats.ts:73, 659dee73d070)
  • Focused regression coverage: New coverage checks naming boundaries, generated/docs precedence, rename sides, conservative truncation handling, surface rendering, and proof-marker preservation. (test/pr-surface-policy.test.ts:16, fa9d272e4723)
  • Area history: Recent merged history includes a test-support detection repair in this module, supporting Peter Steinberger as a routing candidate for the adjacent review-classification work. (src/clawsweeper-change-detection.ts:267, 995ab70f113a)
  • Compiled behavior trace: The PR body records an exact-head AWS Crabbox run through compiled classification, config detection, comment rendering, and marker parsing, with the intended before/after results. (src/openclaw-file-role.ts:2, fa9d272e4723)

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)

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
steipete merged commit ae37f02 into main Sep 1, 2026
19 checks passed
@steipete
steipete deleted the steipete/adjacent-file-role-local branch September 1, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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