Skip to content

test: remove redundant subset assertions - #124198

Merged
steipete merged 1 commit into
mainfrom
test/remove-strict-subset-assertions
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/remove-strict-subset-assertions

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several tests carried weaker assertions immediately beside stronger assertions that already fail for every meaningful regression. One tooling test also duplicated the exact static-asset inventory owned by the executable metadata-discovery test.

Why This Change Was Made

Tests should protect behavior or an independent contract, not add maintenance-only assertions that must be updated alongside stronger neighboring proof. This removes strict subsets while retaining the exact route inventories, structural package assertions, explicit provider guards, owner-colocated route-path coverage, and the runtime postbuild discovery/no-filesystem-scan contract.

User Impact

No production behavior changes. The test suite has less duplicated maintenance surface while preserving the same behavioral and packaging coverage.

Evidence

  • node scripts/run-vitest.mjs test/scripts/runtime-postbuild.test.ts test/scripts/bundled-plugin-assets.test.ts — 51 passed
  • node scripts/run-vitest.mjs ui/src/app-routes.test.ts ui/src/app-navigation-groups.test.ts ui/src/app-navigation.test.ts ui/src/app-route-paths.test.ts — 137 passed
  • node scripts/run-vitest.mjs packages/model-catalog-core/src/remote-catalog-bundle.test.ts packages/ai/src/host.test.ts packages/ai/src/api-registry.test.ts — 8 passed
  • node scripts/check-changed.mjs -- <changed files> — passed via the documented local fallback because no remote provider was available
  • git diff --check — passed
  • Structured autoreview — clean

Production delta: 0 lines. Test delta: -25 lines.

@clawsweeper

clawsweeper Bot commented Aug 15, 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 15, 2026 15:47
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:53 AM ET / 15:53 UTC.

ClawSweeper review

What this changes

This PR deletes 25 redundant test assertions across AI registry, remote catalog, postbuild asset, and Control UI route/navigation tests.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking findings. The branch removes only assertions already implied by retained owner-boundary checks, while preserving exact route, package, and runtime-asset contracts.

Priority: P3
Reviewed head: 6ce0a282eee25178f065f4200b24807b597f3151

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, source-backed test cleanup with retained owner-boundary coverage and no correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only cleanup is supported by focused test evidence; the external real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only cleanup is supported by focused test evidence; the external real-behavior-proof gate does not apply.
Evidence reviewed 6 items Patch scope: The branch is a clean test-only deletion: no production files change, and all 25 removed lines are assertions or one now-unused test import.
AI assertions remain covered: The registry wrapper throws on an API mismatch, and the retained toThrow assertion fails if the optional provider lookup is absent; the host test also retains shape and callable-result checks that fail for an absent provider.
Asset inventory has one stronger owner test: The retained no-filesystem-scan test asserts the identical ten-output inventory and source metadata, while runtime postbuild still copies those discovered assets to both dist and the runtime overlay.
Findings None None.
Security None None.

How this fits together

The affected tests verify provider registration, remote-catalog sanitization, postbuild asset copying, and Control UI routes. These contracts feed runtime provider calls, release packaging, and user navigation.

flowchart LR
  A[Provider and catalog definitions] --> B[AI and catalog tests]
  C[Extension asset metadata] --> D[Postbuild tests]
  E[Route and sidebar definitions] --> F[Control UI tests]
  B --> G[Runtime and security contracts]
  D --> H[Release package]
  F --> I[User navigation]
Loading

Before merge

  • Resolve merge risk (P1) - One UI E2E shard was still running in the supplied check snapshot; merge should wait for required exact-head checks to finish.
  • Complete next step (P2) - No repair is needed; this is a correct cleanup pending routine exact-head CI completion.
Agent review details

Security

None.

PR surface

Tests -25. Total -25 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 0 25 -25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 0 25 -25

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +0/-25 All deleted lines are redundant test assertions, so the change reduces maintenance surface without changing runtime code.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused deletion after exact-head checks are green, keeping the retained owner-boundary tests as the single source of each contract.
  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 focused deletion after exact-head checks are green, keeping the retained owner-boundary tests as the single source of each contract.

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

Not applicable: this PR removes duplicate test assertions rather than addressing a reported runtime failure.

Is this the best way to solve the issue?

Yes. The deletions retain the stronger exact owner-boundary checks, rather than weakening route, packaging, provider, or sanitization coverage.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is low-risk test-maintenance cleanup with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only cleanup is supported by focused test evidence; the external real-behavior-proof gate does not apply.

Label justifications:

  • P3: This is low-risk test-maintenance cleanup with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only cleanup is supported by focused test evidence; the external real-behavior-proof gate does not apply.

Evidence

What I checked:

  • Patch scope: The branch is a clean test-only deletion: no production files change, and all 25 removed lines are assertions or one now-unused test import. (6ce0a282eee2)
  • AI assertions remain covered: The registry wrapper throws on an API mismatch, and the retained toThrow assertion fails if the optional provider lookup is absent; the host test also retains shape and callable-result checks that fail for an absent provider. (packages/ai/src/api-registry.ts:67, a5603681c617)
  • Asset inventory has one stronger owner test: The retained no-filesystem-scan test asserts the identical ten-output inventory and source metadata, while runtime postbuild still copies those discovered assets to both dist and the runtime overlay. (test/scripts/runtime-postbuild.test.ts:87, a5603681c617)
  • Route and sidebar contracts remain owner-local: Portals and Secrets retain exact bidirectional route tests, while exact default and sidebar arrays already prove the removed absence and uniqueness assertions. (ui/src/app-route-paths.test.ts:100, a5603681c617)
  • Current-main provenance: Blame attributes the removed checks and their retained stronger neighbors to the current-main cleanup commit, which is contained by main. (ui/src/app-routes.test.ts:13, 447393dc3221)
  • Focused validation supplied: The PR body reports focused Vitest runs covering all seven changed test files: 51 postbuild/asset tests, 137 UI tests, and 8 AI/catalog tests. (6ce0a282eee2)

Likely related people:

  • steipete: Current-main blame ties the deleted assertions and the stronger retained checks to the same recent cleanup commit by Peter Steinberger; this PR continues that work. (role: recent test-area contributor; confidence: high; commits: 447393dc3221, 6ce0a282eee2; files: packages/ai/src/api-registry.test.ts, test/scripts/runtime-postbuild.test.ts, ui/src/app-routes.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the remaining exact-head UI E2E check to complete before merge.

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 proof for exact head 6ce0a282eee25178f065f4200b24807b597f3151:

  • Runtime postbuild/bundled asset owners: node scripts/run-vitest.mjs test/scripts/runtime-postbuild.test.ts test/scripts/bundled-plugin-assets.test.ts — 51 passed.
  • Control UI route/navigation owners: node scripts/run-vitest.mjs ui/src/app-routes.test.ts ui/src/app-navigation-groups.test.ts ui/src/app-navigation.test.ts ui/src/app-route-paths.test.ts — 137 passed.
  • Package registry/host/catalog owners: node scripts/run-vitest.mjs packages/model-catalog-core/src/remote-catalog-bundle.test.ts packages/ai/src/host.test.ts packages/ai/src/api-registry.test.ts — 8 passed.
  • Changed-surface gate passed through the documented local fallback after the Blacksmith Testbox CLI was unavailable; formatting, type checks, lint, dead-export scan, boundaries, UI i18n, and repository guards were green.
  • git diff --check passed.
  • Structured autoreview reported no actionable findings.
  • Exact-head hosted CI run 31893708919 passed.
  • Native review artifacts validated with READY FOR /prepare-pr, zero findings; Testbox-enabled scripts/pr prepare-run 124198 completed without changing the PR head.
  • ClawSweeper exact review run 31893779552 succeeded. Its durable PR comment remains at the start marker due publication lag, so there are no published findings or rank-up moves to apply.

This removes 25 test-only lines and no production lines. Stronger exact inventories, structural assertions, explicit guards, owner-colocated route mappings, and executable metadata-discovery coverage remain. No docs or changelog change is required.

@steipete
steipete merged commit aad6469 into main Aug 15, 2026
224 of 233 checks passed
@steipete
steipete deleted the test/remove-strict-subset-assertions branch August 15, 2026 15:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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