Skip to content

test(core,plugins): remove low-value tests (batch d118) - #162138

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d118-1790797778
Sep 30, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d118-1790797778

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

This maintainer-requested test audit batch removes repeated test cases and fixture setup across installer, node execution, provider transport, model picker, realtime voice, board, worker pool, questions, Doctor, and Signal suites.

User Impact

No runtime behavior, public API, configuration, schema, or dependency changes. The test suite is smaller while retaining the campaign's identified security, lifecycle, transport, and historical regression cases.

Why This Change Was Made

Consolidate overlapping cases at their existing owner boundaries and remove obsolete split files. Remove the two CI inventory entries for deleted files whose retained cases moved into the surviving suites. No test routing, timeout, assertion baseline, or expected-failure changes.

All ten requested commits were replayed in order onto main at ecb897146e5c47a6cde4e0d5552ce7d70c3700c3. No content conflicts, skipped commits, or dropped hunks. Current main's CI inventory changes were preserved by the clean three-way application.

Diff split: runtime production +0 / -0; tests +5,313 / -16,197 (net -10,884 LOC); CI inventory tooling +0 / -2. Static test declarations decrease 649 → 356 (-293); table-driven executed-case counts are separate below. No changed path matches the current CODEOWNERS rules.

Evidence

Original in-shard validation

These are the source campaign's before/after measurements, not a newly measured whole-repository coverage claim. LOC counts cover changed test files; declarations count each static it/test declaration once, including .each once.

Shard Test LOC before → after Declarations before → after Executed cases before → after Covered statements; branches; functions
t0421 3,432 → 2,653 (-779) 77 → 57 (-20) 122 → 80 0 → 0; 0 → 0; 0 → 0
t0420 3,267 → 1,881 (-1,386) 80 → 42 (-38) 90 → 48 357 → 354; 438 → 435; 34 → 34
t0414 3,411 → 1,705 (-1,706) 74 → 37 (-37) 110 → 46 2,239 → 2,240; 1,650 → 1,634; 375 → 375
t0423 2,491 → 1,242 (-1,249) 67 → 25 (-42) 74 → 34 170 → 170; 12 → 12; 20 → 20
t0416 2,602 → 1,301 (-1,301) 75 → 36 (-39) 84 → 41 554 → 552; 421 → 417; 80 → 80
t0409 3,246 → 2,130 (-1,116) 65 → 43 (-22) 115 → 57 1,958 → 1,955; 1,094 → 1,091; 269 → 269
t0410 1,011 → 580 (-431) 32 → 19 (-13) 48 → 21 1,061 → 1,059; 476 → 473; 216 → 216
t0429 1,865 → 1,444 (-421) 41 → 35 (-6) 83 → 46 1,530 → 1,525; 920 → 917; 242 → 241
t0422 3,227 → 1,604 (-1,623) 69 → 27 (-42) 77 → 29 288 → 288; 39 → 39; 37 → 37
t0426 1,722 → 799 (-923) 69 → 33 (-36) 74 → 41 318 → 318; 168 → 168; 62 → 62

Measured statement/branch losses stay within 1% in each shard. No test groups were excluded. The t0420 report also includes an unchanged 164-line sibling, giving whole-shard LOC 3,431 → 2,045 with the same net reduction. The missing t0416 summary was reconstructed from successful before/after coverage JSON and its successful changed-check retry.

Coverage limitations: t0421's spawned shell/script paths are not measured by V8 (zero totals); t0423 measured src/commands/** while the picker implementation lives under src/flows; t0422 measured src/commands/** without migration implementation under src/infra. These totals do not establish coverage preservation of those production owners. Several shards intentionally retained enough distinct regression/security cases to miss the campaign's 50% reduction targets.

Files by shard
  • t0421: test/scripts/test-install-sh-docker.test.ts.
  • t0420: src/node-host/invoke-system-run.test.ts.
  • t0414: under packages/ai/src/providers/, openai-chatgpt-responses.cache.test.ts, openai-chatgpt-responses.encrypted-retry.test.ts, openai-chatgpt-responses.model-attestation.test.ts, openai-chatgpt-responses.retry.test.ts, openai-chatgpt-responses.sse-parse-error.test.ts, openai-chatgpt-responses.test.ts, openai-chatgpt-responses.tools.test.ts, and openai-chatgpt-responses.websocket-errors.test.ts.
  • t0423: src/commands/model-picker.default-agent.test.ts and src/commands/model-picker.test.ts.
  • t0416: extensions/google/realtime-voice-provider.gemini38.test.ts and extensions/google/realtime-voice-provider.test.ts.
  • t0409: under src/gateway/server-methods/, board.content-kinds.test.ts, board.events.test.ts, board.github-actions.test.ts, board.plugin-capabilities.test.ts, board.runtime-boundaries.test.ts, and board.test.ts.
  • t0410: src/infra/worker-task-pool.logging.test.ts, src/infra/worker-task-pool.source-loader.test.ts, src/infra/worker-task-pool.test.ts, and one removed row in scripts/lib/ci-proof-test-inventory.mts.
  • t0429: src/gateway/server-methods/question.host-consent.test.ts, src/gateway/server-methods/question.recovery.test.ts, src/gateway/server-methods/question.test.ts, and one removed row in scripts/lib/ci-proof-test-inventory.mts.
  • t0422: src/commands/doctor-state-migrations.test.ts.
  • t0426: under extensions/signal/src/, client-container.handshake.loopback.test.ts, client-container.real-server.test.ts, client-container.test.ts, and client-container.websocket.test.ts.

Review corrections

Independent review raised ten findings. Four were accepted wholly or narrowly, restoring four executed cases (51 net test lines): automatic migration must leave default approvals untouched; manual model entry must honor the target agent's explicit primary; a successful nonroot installer must execute and clean up; and GitHub credentials rotated during an awaited fetch must prevent delivery. The original shard table above remains the historical campaign measurement. Final test LOC are t0421 2,661, t0423 1,248, t0409 2,137, and t0422 1,634; each gains one executed case. Static declarations increase only for the two restored standalone cases.

Six findings were rejected after source review: the BytePlus ownership mock remains hoisted; the inactive requester asserts abort and returns before the pending assertion; scoped legacy allowlist preservation and migration stamping remain covered; deleted shell-denial rows repeat shared authorization-owner coverage; pre-retired board request cases fail at the common admission guard rather than distinct write sites; and secret questions use the same tool-independent human-input recovery registration with separate secret-settlement tests. The GitHub race restoration retains only the missing post-fetch credential boundary, alongside existing session, ticket, and shared-owner coverage.

Replayed-tree validation

  • pnpm install --frozen-lockfile --prefer-offline: passed.
  • node_modules/.bin/oxfmt --write <all surviving changed files>, plain oxlint -c .oxlintrc.json <changed TS/MTS files>, and git diff --check: passed.
  • Blacksmith Testbox run 36773831461, lease tbx_01m3t0h4hebgxyfmwxb1twfevv: CI=1 pnpm test covering all 19 surviving changed test files passed 446 tests, including the four restored cases. The installer reporter repeated its identical 81-test summary; it is counted once.
  • Full batch independent review completed; a second review of all four corrections found no actionable P0–P2 findings.

The first focused attempt was killed with exit 137 during local source staging before executing tests; its ready lease was stopped. The initial separate changed gate was canceled before execution to apply review corrections. The corrected focused suite and changed gate share one fresh source preparation and one remote command. These preparation interruptions are not reported as test failures or passing checks.

The full changed-file gate also passed with exit 0 in the same Testbox command: 27 core typecheck groups, extension/script/root-test types, all dead-export scans, repository guards, and type-aware lint. Runtime lint reported zero warnings/errors. The wrapper recorded source tree 2d78b20713a1128dd74c6cb974fe75cc0c4c1579 and a successful 43m49s remote command. Both task-owned leases are stopped. The backing Actions Testbox step may display cancellation when its successful one-shot lease is stopped; the wrapper's completed command result is the Testbox evidence. Hosted PR CI remains the merge gate.

Remove repeated policy-drift inputs, generic route checks, and replays of
pager, wrapper-depth, and approval-plan owner tests. Consolidate durable
approval fixtures and lifecycle cleanup; infer mock result types instead
of casting partial copies of production contracts. Preserve Vitest routing.

The 50% campaign target is not reached. Retention ledger below names each
remaining case (table rows expanded), using the requested rules:
1 = unique covered execution path; 2 = historical regression; 3 = distinct
security boundary. No unrelated behaviors were combined to reduce counts.

- Native cwd refusal: 2, d88e10a, preserve preparation-refusal classification.
- Lost companion response: 3, disabled fallback must never replay locally.
- Already-cancelled command: 1, entry cancellation return.
- Cancelled local completion: 1, post-run cancellation return and signal forwarding.
- Pending Mac cancellation: 1, post-bridge cancellation return without replay/publication.
- Medium-risk auto review: 2, 3b26947, ordinary audit-related argv must reach review and execution.
- Auto review without a plan: 3, unbound commands cannot obtain model authority.
- Login-shell startup: 3, startup effects cannot bypass review through a forged plan.
- Reviewer asks: 1, defer-to-human switch branch.
- Reviewer denies: 3, explicit model refusal cannot execute.
- Approved env wrapper argv: 3, preserve approved positional execution semantics locally and over the bridge.
- Transparent versus semantic env wrappers: 3, only transparent carriers may unwrap into an allowlisted executable.
- Nested safe-bin chains: 3, bind rewritten shell payloads to canonical safe-bin paths.
- PowerShell wrappers: 1, non-POSIX transport must bypass POSIX rewriting.
- PATH-token allowlist execution: 3, launch the canonical approved executable rather than a mutable PATH alias.
- Live policy revocation at commit: 3, recheck authority after awaited persistence before real launch.
- Live policy revocation at callback: 3, the launch adapter must recheck immediately before spawning.
- Live policy unchanged at callback: 3, positive control proves authorized real execution succeeds.
- Unbindable auto executable identity: 3, model review cannot authorize an unbound dispatch chain.
- Human executable identity drift at commit: 3, changed executable resolution invalidates the approved command.
- Script drift after commit: 3, recheck mutable operands after the persistence await.
- Runtime script binding at dispatch: 3, reject changed operands and omitted required bindings.
- Relative skill-bin invocation: 3, skill trust cannot authorize an arbitrary relative executable.
- Unsafe environment inputs: 3, block dangerous overrides, argv assignments, and invalid env keys.
- Shell executable env allowlist: 3, filter shell environments even without an inline payload.
- Revoked rule during allow-always commit: 3, do not resurrect revoked authority through grant persistence.
- Unprompted ask tightening during commit: 3, current-policy authority must not survive a newly required prompt.
- Auto-review ask tightening during commit: 3, forwarded model authority remains bound to its prepared policy snapshot.
- Exact-plan forwarded strict inline review: 3, authenticated one-shot authority remains scoped to its bound plan.
- Unavailable screen recording: 3, deny before execution or durable grant mutation.
- Tightened timeout fallback policy: 3, reevaluate fallback authority at commit.
- Fallback without canonical plan: 3, reject unbound fallback provenance.
- Explicit approval without canonical plan: 3, reject unbound explicit authority.
- Delayed approval without policy snapshot: 3, require the prepared policy identity.
- Allowlist revocation after prepare: 3, reject stale authority before committing.
- Mixed fallback and explicit provenance: 3, refuse contradictory authority sources.
- Durable allowlist timeout fallback: 3, positive control for an exact durable grant.
- Revoked durable timeout source: 3, source downgrade removes fallback authority.
- Mac fallback bridge: 3, forward fallback provenance without inventing explicit approval.
- Fallback versus strict inline review: 3, timeout fallback cannot satisfy mandatory review.
- Unknown approval provenance: 3, reject unsupported authority markers.
- Benign awk durable grant: 3, a file-based grant must not reopen inline programs.
- Make inline grant: 3, explicitly approved runtime payloads remain one-shot.
- Windows cmd transport: 3, unwrap transport before deciding shell approval requirements.
- Windows durable trust downgrade: 3, revalidate the exact durable source at commit.
- Durable cwd replacement: 3, directory identity remains bound through execution.
- Safe builtin with redundant exact grant: 1, builtin authorization must survive revocation of an unused grant.
- Socket response loss: 2, adf5c67, real completed execution must never replay after its reply is lost.

Measurements and validation:
- Executed tests: 90 -> 48, down 46.67%.
- Shard test LOC: 3431 -> 2045, down 40.40%.
- Covered statements: 357 -> 354 (-0.84%).
- Covered branches: 438 -> 435 (-0.68%). Functions: 34 -> 34.
- Only invoke-system-run-plan.ts drops coverage: 3 statements, 3 branches.
  These are removed preparation-only probes; no source file drops >5 statements.
- Both Vitest coverage groups succeeded; no groups were excluded.
- Blacksmith Testbox: both shard files pass (47 infra + 1 unit tests).
  Final file durations: 2.80s infra; 1.95s unit.
- check:changed passes, including core-test types, boundary checks, all
  dead-export scans, and type-aware lint (0 warnings, 0 errors).
- Local oxfmt, plain oxlint, and git diff --check pass.
- No production or shared test-support changes; no bugs or flakes found.
- Proof workflow: https://github.com/openclaw/openclaw/actions/runs/36738903333
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@steipete
steipete enabled auto-merge (squash) September 30, 2026 21:25
@openclaw-barnacle openclaw-barnacle Bot added channel: signal Channel integration: signal gateway Gateway runtime scripts Repository scripts commands Command implementations extensions: google size: XL labels Sep 30, 2026
@steipete
steipete merged commit be25a24 into main Sep 30, 2026
177 of 181 checks passed
@steipete
steipete deleted the tcr/land-d118-1790797778 branch September 30, 2026 21:36
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
)

* test(scripts): deslop t0421 tests

* test(node-host): deslop t0420 tests

Remove repeated policy-drift inputs, generic route checks, and replays of
pager, wrapper-depth, and approval-plan owner tests. Consolidate durable
approval fixtures and lifecycle cleanup; infer mock result types instead
of casting partial copies of production contracts. Preserve Vitest routing.

The 50% campaign target is not reached. Retention ledger below names each
remaining case (table rows expanded), using the requested rules:
1 = unique covered execution path; 2 = historical regression; 3 = distinct
security boundary. No unrelated behaviors were combined to reduce counts.

- Native cwd refusal: 2, 9c8fecb, preserve preparation-refusal classification.
- Lost companion response: 3, disabled fallback must never replay locally.
- Already-cancelled command: 1, entry cancellation return.
- Cancelled local completion: 1, post-run cancellation return and signal forwarding.
- Pending Mac cancellation: 1, post-bridge cancellation return without replay/publication.
- Medium-risk auto review: 2, bd93e54, ordinary audit-related argv must reach review and execution.
- Auto review without a plan: 3, unbound commands cannot obtain model authority.
- Login-shell startup: 3, startup effects cannot bypass review through a forged plan.
- Reviewer asks: 1, defer-to-human switch branch.
- Reviewer denies: 3, explicit model refusal cannot execute.
- Approved env wrapper argv: 3, preserve approved positional execution semantics locally and over the bridge.
- Transparent versus semantic env wrappers: 3, only transparent carriers may unwrap into an allowlisted executable.
- Nested safe-bin chains: 3, bind rewritten shell payloads to canonical safe-bin paths.
- PowerShell wrappers: 1, non-POSIX transport must bypass POSIX rewriting.
- PATH-token allowlist execution: 3, launch the canonical approved executable rather than a mutable PATH alias.
- Live policy revocation at commit: 3, recheck authority after awaited persistence before real launch.
- Live policy revocation at callback: 3, the launch adapter must recheck immediately before spawning.
- Live policy unchanged at callback: 3, positive control proves authorized real execution succeeds.
- Unbindable auto executable identity: 3, model review cannot authorize an unbound dispatch chain.
- Human executable identity drift at commit: 3, changed executable resolution invalidates the approved command.
- Script drift after commit: 3, recheck mutable operands after the persistence await.
- Runtime script binding at dispatch: 3, reject changed operands and omitted required bindings.
- Relative skill-bin invocation: 3, skill trust cannot authorize an arbitrary relative executable.
- Unsafe environment inputs: 3, block dangerous overrides, argv assignments, and invalid env keys.
- Shell executable env allowlist: 3, filter shell environments even without an inline payload.
- Revoked rule during allow-always commit: 3, do not resurrect revoked authority through grant persistence.
- Unprompted ask tightening during commit: 3, current-policy authority must not survive a newly required prompt.
- Auto-review ask tightening during commit: 3, forwarded model authority remains bound to its prepared policy snapshot.
- Exact-plan forwarded strict inline review: 3, authenticated one-shot authority remains scoped to its bound plan.
- Unavailable screen recording: 3, deny before execution or durable grant mutation.
- Tightened timeout fallback policy: 3, reevaluate fallback authority at commit.
- Fallback without canonical plan: 3, reject unbound fallback provenance.
- Explicit approval without canonical plan: 3, reject unbound explicit authority.
- Delayed approval without policy snapshot: 3, require the prepared policy identity.
- Allowlist revocation after prepare: 3, reject stale authority before committing.
- Mixed fallback and explicit provenance: 3, refuse contradictory authority sources.
- Durable allowlist timeout fallback: 3, positive control for an exact durable grant.
- Revoked durable timeout source: 3, source downgrade removes fallback authority.
- Mac fallback bridge: 3, forward fallback provenance without inventing explicit approval.
- Fallback versus strict inline review: 3, timeout fallback cannot satisfy mandatory review.
- Unknown approval provenance: 3, reject unsupported authority markers.
- Benign awk durable grant: 3, a file-based grant must not reopen inline programs.
- Make inline grant: 3, explicitly approved runtime payloads remain one-shot.
- Windows cmd transport: 3, unwrap transport before deciding shell approval requirements.
- Windows durable trust downgrade: 3, revalidate the exact durable source at commit.
- Durable cwd replacement: 3, directory identity remains bound through execution.
- Safe builtin with redundant exact grant: 1, builtin authorization must survive revocation of an unused grant.
- Socket response loss: 2, 6d6a3f7, real completed execution must never replay after its reply is lost.

Measurements and validation:
- Executed tests: 90 -> 48, down 46.67%.
- Shard test LOC: 3431 -> 2045, down 40.40%.
- Covered statements: 357 -> 354 (-0.84%).
- Covered branches: 438 -> 435 (-0.68%). Functions: 34 -> 34.
- Only invoke-system-run-plan.ts drops coverage: 3 statements, 3 branches.
  These are removed preparation-only probes; no source file drops >5 statements.
- Both Vitest coverage groups succeeded; no groups were excluded.
- Blacksmith Testbox: both shard files pass (47 infra + 1 unit tests).
  Final file durations: 2.80s infra; 1.95s unit.
- check:changed passes, including core-test types, boundary checks, all
  dead-export scans, and type-aware lint (0 warnings, 0 errors).
- Local oxfmt, plain oxlint, and git diff --check pass.
- No production or shared test-support changes; no bugs or flakes found.
- Proof workflow: https://github.com/openclaw/openclaw/actions/runs/36738903333

* test(ai): deslop t0414 tests

* test(commands): deslop t0423 tests

* test(google): deslop t0416 tests

* test(board): deslop t0409 tests

* test(infra): deslop t0410 tests

* test(gateway): deslop t0429 tests

* test(doctor): deslop t0422 tests

* test(signal): deslop t0426 tests

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

Labels

channel: signal Channel integration: signal commands Command implementations extensions: google gateway Gateway runtime scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant