Skip to content

test(doctor,cli,config,sessions): remove low-value tests (batch d176) - #164348

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d176-1791035825
Oct 3, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d176-1791035825

Conversation

@steipete

@steipete steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Doctor, update CLI, config, and session suites repeat fixture setup, equivalent matrix rows, and assertions already covered at their owning boundaries. This increases test maintenance without adding independent regression protection.

Why This Change Was Made

Replay the ten validated d176 campaign commits onto current main. Consolidate equivalent cases into tables, remove redundant executions, and remove an unused direct-handler interception from a shard-only test helper. Distinct migration, custody, recovery, authority, ordering, and platform regressions remain.

All ten commits applied; none skipped. A retention audit found that the consolidated environment-default cases only exercised the warning-callback route. Retain a three-line strict-mode assertion for missing and empty variables without adding a declaration; logging uses this strict route. One replay conflict in src/config/sessions/session-pending-input-withdrawal.test.ts was resolved by combining the campaign's consumed/superseded custody table with main's receipt-settlement wait from d6c1b1f9e14aa06443c685d81414911628e18914 (#164284). The newer cleanup behavior is preserved for both table rows; no intended case or main-only behavior was dropped.

User Impact

No production behavior, config, schema, or public API changes. The replay changes 61 test files and one test-support file: tests +4,750 / -7,048 lines (net -2,298), test support +0 / -11, production +0 / -0. There are no paths matched by the current CODEOWNERS rules.

Evidence

Local formatting, plain Oxlint, and git diff --check origin/main passed. Each replay commit also passed plain Oxlint before committing. Focused Testbox proof and the changed gate are recorded below. Hosted CI is the merge gate; independent autoreview findings are resolved below.

Original in-shard campaign measurements

These are the previously validated shard measurements, not a fresh coverage run on this PR head. Each includes all coverage groups; covered statements and branches decreased by at most 1%. Counts include unchanged files within the shard. The campaign retained distinct proofs when further reduction would lose behavior coverage.

Shard Test LOC before → after Declarations before → after Original coverage totals
u0153 3,800 → 3,516 (-284) 83 → 64 (-19) covered statements 3069 -> 3069 (0); branches 1920 -> 1920 (0); functions 521 -> 521 (0)
u0141 4,602 → 4,486 (-116) 74 → 60 (-14) covered statements 5858 -> 5846 (-12); branches 5205 -> 5178 (-27); functions 914 -> 914 (0)
u0159 1,886 → 1,659 (-227) 35 → 20 (-15) covered statements 1987 -> 1972 (-15); branches 1298 -> 1289 (-9); functions 410 -> 406 (-4)
u0157 2,029 → 1,942 (-87) 47 → 32 (-15) covered statements 2642 -> 2642 (0); branches 1473 -> 1473 (0); functions 536 -> 536 (0)
u0156 3,255 → 2,960 (-295) 60 → 41 (-19) covered statements 2434 -> 2434 (0); branches 1517 -> 1517 (0); functions 436 -> 436 (0)
u0162 1,958 → 1,498 (-460) 66 → 45 (-21) covered statements 3398 -> 3397 (-1); branches 1743 -> 1741 (-2); functions 642 -> 642 (0)
u0160 991 → 869 (-122) 19 → 13 (-6) covered statements 984 -> 984 (0); branches 697 -> 697 (0); functions 172 -> 172 (0)
u0158 2,952 → 2,655 (-297) 67 → 46 (-21) covered statements 5972 -> 5972 (0); branches 3870 -> 3870 (0); functions 1134 -> 1134 (0)
u0163 2,956 → 2,768 (-188) 75 → 51 (-24) covered statements 4338 -> 4338 (0); branches 2485 -> 2485 (0); functions 839 -> 839 (0)
u0168 3,369 → 3,113 (-256) 62 → 43 (-19) covered statements 5995 -> 5991 (-4); branches 3498 -> 3499 (1); functions 1334 -> 1332 (-2)

Coverage drops above five statements in the original reports retain separate owner coverage: update target-schema sibling cases (u0141), retired-runtime/config-snapshot cases (u0159), and diagnostics fake-clock logging tests (u0168). The original u0141 changed gate encountered an inherited environment-variable budget mismatch; its remaining checks passed. Current replay validation is separate below.

Files touched by each shard

u0153

  • src/commands/doctor-memory-recall.test.ts
  • src/commands/doctor-retired-models.ordering.test.ts
  • src/commands/doctor-retired-models.successor-guard.test.ts
  • src/commands/doctor-sandbox-legacy-registry.test.ts
  • src/commands/doctor-sandbox.warns-sandbox-enabled-without-docker.test.ts
  • src/commands/doctor-session-sqlite-recovery-inventory.test.ts

u0141

  • src/cli/skills-search-cli.test.ts
  • src/cli/update-cli.admission-ledger.test.ts
  • src/cli/update-cli.already-current.test.ts
  • src/cli/update-cli.config-convergence.test.ts
  • src/cli/update-cli.finalizer.test.ts
  • src/cli/update-cli.git-service.test.ts

u0159

  • src/commands/doctor/shared/legacy-config-migrations.runtime.code-mode.test.ts
  • src/commands/doctor/shared/legacy-config-migrations.runtime.mcp.test.ts
  • src/commands/doctor/shared/legacy-config-migrations.runtime.tool-policy-conflicts.profiles.test.ts
  • src/commands/doctor/shared/legacy-config-migrations.runtime.tool-policy-conflicts.test.ts
  • src/commands/doctor/shared/legacy-config-migrations.runtime.tool-search.test.ts
  • src/commands/doctor/shared/legacy-context-budget.test.ts
  • src/commands/doctor/shared/legacy-tools-by-sender.test.ts
  • src/commands/doctor/shared/missing-configured-plugin-install.dependency-health.test.ts

u0157

  • src/commands/doctor-sqlite-reclamation.test.ts
  • src/commands/doctor-update-rehearsal-inventory.test.ts
  • src/commands/doctor-update-schema-guard.test.ts
  • src/commands/doctor-web-fetch-proxy.test.ts

u0156

  • src/commands/doctor-session-sqlite.retirement-disposal.test.ts
  • src/commands/doctor-session-sqlite.retirement-mutations.test.ts
  • src/commands/doctor-session-sqlite.retirement-verification.test.ts
  • src/commands/doctor-session-sqlite.source-conflict-recovery.test.ts
  • src/commands/doctor-session-sqlite.targets.test.ts
  • src/commands/doctor-session-title-repair.test.ts
  • src/commands/doctor-sqlite-compact.test.ts
  • src/commands/doctor-sqlite-nocow.test.ts

u0162

  • src/config/config.browser-engines.test.ts
  • src/config/config.decision-model.test.ts
  • src/config/env-substitution.test.ts
  • src/config/includes.top-level-key.test.ts

u0160

  • src/commands/doctor/shared/missing-configured-plugin-install.health.test.ts
  • src/commands/doctor/shared/missing-configured-plugin-install.version-drift.test.ts
  • src/commands/doctor/shared/release-configured-plugin-installs.persistence.test.ts
  • src/commands/gateway-setup-runtime.test.ts

u0158

  • src/commands/doctor/auth-alias-migration.test.ts
  • src/commands/doctor/finalize-config-flow.test.ts
  • src/commands/doctor/shared/automatic-config-repair.test.ts
  • src/commands/doctor/shared/channel-doctor.test.ts
  • src/commands/doctor/shared/github-preview-upgrade.test.ts
  • src/commands/doctor/shared/legacy-config-compat.test.ts
  • src/commands/doctor/shared/legacy-config-migrate.e2e.test.ts

u0163

  • src/config/io.runtime-async.test.ts
  • src/config/io.runtime-models.test.ts
  • src/config/io.snapshot.recovery.test.ts
  • src/config/io.write-effects.test.ts
  • src/config/io.write-effects.windows.test.ts
  • src/config/model-provider-config.test.ts
  • src/config/runtime-snapshot.preparation.test.ts

u0168

  • src/config/sessions/session-history-worker-errors.test-support.ts
  • src/config/sessions/session-history-worker-errors.test.ts
  • src/config/sessions/session-pending-input-withdrawal.test.ts
  • src/config/sessions/session-reaction-store.test.ts
  • src/config/sessions/session-row-changes.test.ts
  • src/config/sessions/session-sqlite-target.worker.test.ts
  • src/config/sessions/session-transcript-fts.test.ts
  • src/config/sessions/session-transcript-projection-catchup.test.ts

Current replay validation

  • oxfmt --write on all 63 changed files, plain oxlint -c .oxlintrc.json on changed TypeScript, and git diff --check: passed.
  • Blacksmith Testbox tbx_01m410yzw4x2d7assvay5ea0gg, run 37128030484: CI=1 pnpm install --frozen-lockfile --prefer-offline followed by CI=1 pnpm test with all 62 changed test files passed 817 tests, with five unchanged Windows-only skips, across six Vitest shards. The command took 17m26s including dependency installation and required runtime build; Vitest wrapper time was 987.08s including its build preparation.
  • After retaining strict-mode fallback coverage, CI=1 pnpm test src/config/env-substitution.test.ts passed all six tests on the same lease (503 ms Vitest duration, 1.25s test wrapper). Subsequent review corrections and their focused validation are recorded below.

Review corrections and retained duplicates

Accepted five coverage findings. Retained the strict-mode fallback assertion; restored NOCOW regular-file mutation; restored Discord, Microsoft Teams, and Telegram sender-policy path rows. Dropped both campaign hunks in src/config/schema.tiers.test.ts, preserving its published UI-tier policy assertions and anyOf/oneOf/allOf matrix unchanged from the base.

Rejected six proposed restorations after tracing the owners and remaining tests:

  • The deleted Doctor nested-dependency symlink case repeats findMissingRequiredPluginDependencies coverage in src/plugins/status-dependencies-core.test.ts, whose scoped/unscoped managed-project matrices retain outside-symlink rejection. Doctor still tests its ancestor/hoisted dependency-root handoff. The owner suite is included in the correction validation.

  • The deleted repeated-worker registry case is covered by the retained registration in-flight case in session-sqlite-target.worker.test.ts: the real single-worker pool executes before and after switching the registered owner from ops to main, and the result must name main.

  • Non-default NOCOW modes were already set by the retained seedDatabase() fixture (0640 for the database and 0750 for its directory); the success case still records and compares those modes.

  • The deleted NOCOW busy fixture sets fuser status 0; it never simulates a busy atomic exchange. The retained holders case covers the same pre-exchange refusal with stronger batched-PID assertions, zero exchanges, and original-inode preservation.

  • Symlinked launcher resolution belongs to resolveOpenClawPackageRootsSync, called directly by Doctor. src/infra/openclaw-root.test.ts retains positive symlinked argv, nested symlink-target precedence, and node_modules fallback cases; Doctor retains script selection and execution checks.

  • The cold-load registration race is folded into prepares registrations added during a cold load before publishing and reusing its config: it starts loadPinnedRuntimeConfigAsync with an unresolved loader gate, registers preparers, then resolves loading and requires their contribution before publication.

The first remote changed-gate attempt on tbx_01m4127jp1tbc644et2ygnz21p (run 37129287173) did not execute: the Matrix native dependency download returned HTTP 503 during frozen installation. That lease stopped automatically. Correction proof and the changed gate use the already-installed first lease.

Autoreview completed two rounds. Five accepted findings are corrected; the six rejected findings above require no further change.

Final correction gate

CI=1 pnpm test src/config/env-substitution.test.ts src/config/schema.tiers.test.ts src/commands/doctor-sqlite-nocow.test.ts src/commands/doctor/shared/legacy-tools-by-sender.test.ts src/plugins/status-dependencies-core.test.ts passed 120 tests across five files. The same warm Testbox then ran the delegated pnpm check:changed -- <all 62 changed paths> payload with the repository's remote-child environment flags: all gates passed, including five core test type graphs, all three dead-export scans, and type-aware lint (0 warnings, 0 errors). Combined correction tests and changed checks took 7m31s. The earlier HTTP 503 is recovered; there is no remaining Testbox validation gap. The only later cleanup removes two redundant chmod calls already performed identically by seedDatabase; final plain Oxlint and whitespace checks pass.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete enabled auto-merge (squash) October 3, 2026 14:36
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: XL labels Oct 3, 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 Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 10:47 AM ET / 14:47 UTC (Revision 2).

ClawSweeper review

What this changes

Consolidates Doctor, update CLI, configuration, and session regression tests into shared fixtures and tables, removes redundant cases, and deletes an unused test-handler interception.

Merge readiness

✅ Ready for maintainer review

Keep open: the cleanup remains distinct from current main, and the retention audit found no actionable correctness defect. The prior completed review also reported no findings.

Likely related people: steipete and etzelm, as routing candidates supported by relevant merged history.

Priority: P3
Reviewed head: e7545d600c9550ca8ba0ef65411dc4d239ceabd1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful test consolidation with retained boundary regressions and documented focused validation; no actionable defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified trusted-author test cleanup changes no production owner or runtime contract; recorded Testbox tests are supplemental validation, and no stored-data format changes require upgrade proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified trusted-author test cleanup changes no production owner or runtime contract; recorded Testbox tests are supplemental validation, and no stored-data format changes require upgrade proof.
Evidence reviewed 9 items Introduced scope: The pinned introduction contains only test files and one test-support file; the exclusion check found no production changes. No dependency, workflow, public API, or stored-data contract changes are introduced.
Strict fallback coverage retained: The consolidated environment-template suite retains a strict call without a warning callback that verifies fallback resolution for both missing and empty variables. The production substitution owner distinguishes this route from warning-mode resolution.
Session settlement survives the merge: The verified test merge has the recorded main/base parent followed by the exact PR head. Its change preserves receipt-settlement waits in both consumed and superseded withdrawal cases, retaining behavior from the merged #164284.
Findings None None.
Security None None.

How this fits together

These suites exercise OpenClaw’s diagnostics, updater, configuration loader, and session storage using controlled fixtures. Their assertions protect repair, recovery, ordering, and ownership behavior against future regressions.

flowchart TD
  A[Configuration and session fixtures] --> B[Regression test suites]
  B --> C[Doctor and update operations]
  B --> D[Configuration and session owners]
  C --> E[Observed results and state]
  D --> E
  E --> F[Contract assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -2309. Total -2309 across 62 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 62 4717 7026 -2309
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 62 4717 7026 -2309

Review metrics

None.

Technical review

Best possible solution:

Keep regression protection at its owning boundary while sharing fixtures and eliminating equivalent executions.

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

Not applicable: this PR reduces redundant test maintenance rather than reporting a runtime bug; tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes: shared fixtures and tables preserve the reviewed distinct contracts without introducing production seams or competing implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against db01f6d520b8.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal test-maintenance cleanup without a production behavior change or urgent user-facing defect.
  • 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: Verified trusted-author test cleanup changes no production owner or runtime contract; recorded Testbox tests are supplemental validation, and no stored-data format changes require upgrade proof.

Evidence

What I checked:

  • Introduced scope: The pinned introduction contains only test files and one test-support file; the exclusion check found no production changes. No dependency, workflow, public API, or stored-data contract changes are introduced. (e7545d600c95)
  • Strict fallback coverage retained: The consolidated environment-template suite retains a strict call without a warning callback that verifies fallback resolution for both missing and empty variables. The production substitution owner distinguishes this route from warning-mode resolution. (src/config/env-substitution.test.ts:79, e7545d600c95)
  • Session settlement survives the merge: The verified test merge has the recorded main/base parent followed by the exact PR head. Its change preserves receipt-settlement waits in both consumed and superseded withdrawal cases, retaining behavior from the merged refactor(sessions): stage and settle pending inputs in workers #164284. (src/config/sessions/session-pending-input-withdrawal.test.ts:186, 862835a8431f)
  • Retained owner-boundary coverage: Worker-error assertions now use the transport round trip rather than the removed direct-handler interception. The retained target-discovery matrix exercises registration changes before a worker reply and requires the new physical owner; dependency-owner tests retain outside-symlink rejection, and package-root tests retain symlinked launcher resolution. (src/config/sessions/session-history-worker-errors.test.ts:285, e7545d600c95)
  • Captured validation body completed: The fetched full body matches captured SHA-256 648bf926b6a6b2b1d72d42975eb5ee4a345e856302677ef1633135c858a61102. Its omitted ending records 120 passing correction tests and a passing changed-code gate, following the earlier 817-test campaign run. These are contributor-recorded results; this read-only review did not rerun them. (e7545d600c95)
  • Still necessary on current main: The environment-substitution test blob on fetched main equals the introduction base blob and differs from the PR head. The live PR remains open, unmerged, and mergeable at the reviewed head; no verified merged replacement was established. (src/config/env-substitution.test.ts, db01f6d520b8)

Likely related people:

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

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-03T14:40:15.681Z sha e7545d6 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 878a03b into main Oct 3, 2026
130 of 131 checks passed
@steipete
steipete deleted the tcr/land-d176-1791035825 branch October 3, 2026 14:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…openclaw#164348)

* test(doctor): deslop u0153 tests

* test(cli): deslop u0141 tests

* test(doctor): deslop u0159 tests

* test(doctor): deslop u0157 tests

* test(doctor): deslop u0156 tests

* test(config): deslop u0162 tests

* test(commands): deslop u0160 tests

* test(doctor): deslop u0158 tests

* test(config): deslop u0163 tests

* test(sessions): deslop u0168 tests

* test: retain distinct regression coverage in batch d176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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