Repository navigation
test(gateway,agents): remove low-value tests (batch d535) - #183604
Conversation
Remove mock-only list forwarding and cancellation replay. Real conversation discovery remains in conversation-list.test.ts, cancellation and reply retirement in conversation-turns.test.ts, and validated envelope behavior in validation.test.ts. Retain the numeric list-limit guard and conversation identity/race checks. Remove unused TTS mock exports and a conversion success payload from a conversion-rejection-only fixture. CI-only static gates pass; no tests run. Shard now 3011 lines versus 3499 baseline; the 25 percent target remains unmet.
Share launchctl shell fixtures, export ordinary stop helpers at their definitions, and consolidate relative EnvironmentFile setup. Retain both authored and manager rejection cases, every native ownership boundary, and all rollback and lifecycle assertions. No behavior cases deleted; the safety-focused shard does not admit a 25 percent cut without removing distinct proof.
Fold the discovered-unit assertions into the retained strict account inspection case using requireLoaded. Exercise percent quoting in argv and environment together, and combine multiline shell values into one representative round trip. Trim generated-shell wording checks while retaining executed retry/order proof and the 345-second drain bound. Reuse the exact command-result comparison for diagnostics and assertions. Distinct ownership, cleanup, persistence and parser boundaries remain covered; no whole sibling suite was redundant.
Remove unused directory inventory fields, the filtered one-row manager table, and its single-use wrapper. Preserve all literal, wildcard, optional, relative-path, provenance, and start-policy cases. A read-only cross-layer audit found no safe whole-file deletions: HOME removal has its own reinsertion guard, concurrent-edit rollback retains still-referenced candidate inputs, and malformed membership rows reach distinct native-authority checks.
Reuse preparation fixtures, cleanup, diagnostic assertions, and history parameters. Keep trajectory opt-out branches as distinct table rows. The retained disabled-and-agent-scoped MCP projection test covers selectCodexProjectableMcpServers enabled=false filtering; the separate disabled-server replay is removed. All authority, privacy, recovery, and lifecycle assertions remain. CI-only: oxfmt, plain oxlint, and diff-check passed. No tests or coverage run. Lines 3611 to 3503 (3.0%); the 25% target is not reached because remaining cases exercise distinct boundaries.
Keep model-call capture, budget, and redaction proof in model-call-diagnostics.test.ts instead of replaying it in run-diagnostics.test.ts. Keep queue/adoption proof in queue/settings.test.ts and agent-runner-steer-adoption.worker.test.ts; retain native stdin authority, persistence, and lifecycle checks. Prompt rendering keepers: embedded-agent-runner/system-prompt.test.ts advertises ClawHub and uses config-backed delegation; system-prompt.test.ts leaves custom button guidance to the plugin; system-prompt-config.test.ts renders only current supplied aliases; prepare.test.ts renders sandbox-readable CLI skills. Keep CLI credit and plugin-command surface selection here. Codex scoping and remote OAuth isolation remain covered by thread-lifecycle.user-mcp-servers.test.ts: projects only the current agent's MCP servers without starting excluded servers, and omits MCP OAuth servers before policy discovery for a remote app-server. Disabled filtering remains asserted in the session override projection case. Remove grant metadata inventories already owned by mcp-grant-context.test.ts, mcp-http.test.ts, and prepare.test.ts. Share configured-server lifecycle and prepare fixtures; replace trajectory's test-written subprocess driver with backend event fixtures while keeping production runner, recovery, cancellation, and SQLite recording. CI-only: formatting, plain oxlint, and diff-check pass; no tests or coverage run. Additional reduction 3503 to 3084 lines; cumulative 3611 to 3084 (14.6%), below the 25% target. No production changes or files deleted.
Remove generic controller-recovery replay that explicitly disabled the CLI watchdog. The backend row of diagnostic-controller-recovery.integration.test.ts 'uses the controller-owned allowance through its exact boundary' retains heartbeat, exact deadline, cancellation and once-only run_stalled proof. Keep compaction-specific executor/watchdog paths. Remove disconnected steering-mode probes: commands-steer.test.ts retains active steer/body-rewrite behavior, the tell alias uses the same parser branch, and queue/settings.test.ts retains persisted session-mode override behavior. Remove run-owner attribution replay already covered by cli-runner.before-agent-reply-cron.test.ts while retaining prepared-config commentary capture and trace/private-content assertions. Combine MCP admission binding with the same grant's transfer and cleanup lifecycle, preserving every identity, projection, delegated authority, binding, transfer and revocation assertion. Share admission construction and OAuth config preparation. No production changes or files deleted. CI-only: formatting, plain oxlint and diff-check passed; no tests run. Additional 3083 to 2930 lines, cumulative 3611 to 2930 (-18.9%); 25% target remains unmet. Authority and command suites cannot merge because Vitest assigns different projects.
Factor repeated policy expectations, bridge setup, elicitation replies, and turn-input lookup without removing distinct boundary cases. Preserve interruption, process containment, permission, replay, provenance, and lifecycle coverage. CI-only validation: oxfmt, plain oxlint, and diff check. Shard test LOC 3627 -> 3564; all 78 declarations and 124 expanded cases retained. The 25% target is not safely reachable by these structural edits.
Remove repeated warm-model replay covered by thread-lifecycle.native-config and run-attempt.native-config. Exercise attribution directly through the admitted runner, retaining real SQLite bindings and ready/cached/picker model separation. Outer code-mode output remains covered by run-attempt.checkpoint: checkpoints the complete native response, not the earlier execution preview. The oversized-summary case retains echo suppression; run-attempt.channel-tool-progress retains channel progress identity. Keep nonzero command failure in the null-aggregate response case. Consolidate terminal outcomes, permission tuples, negative media cases and FIFO snapshot setup. Remove redundant projection-wrapper proof covered by dynamic-tools: quarantines dynamic tools with unsupported input schemas. Keep each security and lifecycle branch. CI-only: plain oxlint, oxfmt and diff-check pass; no test or coverage runs. Original shard LOC 3641 -> 3295, with 283 lines removed in this follow-up. No production changes or files deleted; reduction remains below the 25 percent target.
Call native compaction owner directly instead of intercepting the harness wrapper; harness.test.ts retains the legacy compaction authority guard. Reuse supported attempt and projector fixtures instead of replaying generic transport/event plumbing. Retain real SQLite model bindings and all ready/cached/picker and reroute assertions. Centralize input gateway teardown and consolidate quarantine fixtures while preserving executable and registered projections. Nonregistered projection remains covered by dynamic-tools.test.ts: quarantines dynamic tools with unsupported input schemas. Keep distinct security, retirement, process and protocol paths. CI-only: oxfmt, plain oxlint and diff-check passed; no tests or coverage ran. Additional 69 lines removed; original shard LOC 3641 -> 3226. No production changes or files deleted. The 25 percent target remains unmet because further identified cuts would remove distinct boundary proof.
Consolidate repeated provider config, catalog transport, skill, and tool-result fixtures without dropping distinct behavior assertions. Keep recovery, replay, privacy, and authority coverage intact; no safe cross-file duplicate cases were found.
Keep timeout recovery at its owning boundary; runs.test and subagent-announce-direct-delivery.test cover marker isolation, queued completion, steering, and terminal suppression. Keep ordinary projection lifecycle in session-prompt-state.test and attempt-stream-settle.test; tool-result-truncation.test and session-manager-cache-ttl.test cover compaction and restored bytes. Replace the checkpoint shadow model with explicit snapshot transitions across rollover, branches, reset, uncertain append, and damage. Narrow configured catalog setup to the actual lookup owner, reuse skill owner coverage, and retain the bounded fingerprint case instead of duplicating its dump in the outbound wire test. CI-only: format, diff-check, and plain oxlint passed; no runtime tests run.
Remove five duplicate publication lifecycle cases and their private setup. Keepers are the identically named tests in src/gateway/github-personal-publication.lifecycle.test.ts: revokes captured publication authority after committed receipt cleanup; preserves repository receipts when a session is recreated before receipt deletion admission; preserves receipts and repository ownership when an owner write crosses the native receipt grant; preserves a same-key successor receipt while direct deletion removes historical receipts; retains logical-session receipts across archive and reset, then removes them through permanent deletion. The narrower-scope replay remains covered by server-methods/device-scope-upgrade.test.ts, rejects current scopes even with an admin ceiling. Ordinary grant expiry remains covered by cron-creator-authority-grant.test.ts, retains only the stream mutation through one bounded approval wait. Publication supersession remains covered by github-publication-relevance.test.ts exact-tree and newer unpublished snapshot cases. Consolidate widget publication lifecycle fixtures, remove malformed-query variants reaching the same unexpected-key guard, and replace startup metric inventories with representative timing and accumulation assertions. Preserve distinct security and lifecycle behaviors. CI-only: plain oxlint, formatting, and diff checks passed; no tests run.
Use closeBoardDatabases and createGatewayRuntimeStateForTest instead of duplicate teardown and raw transport assembly. Let connectGatewayClient own its signed test identity and inspect the observed tool result rather than asserting an incidental provider request count. Share public media status/body assertions and remove redundant mock argument shapes, common header checks, and unused PR fixture metadata. Preserve all remaining cases and security/lifecycle assertions. CI-only: plain oxlint, formatting, and diff checks passed; no tests or builds run.
Share scanner fixtures, finding assertions, collector-scope setup and install record builders. Retain distinct security boundaries and targeted remediation commands. Redundant install metadata drift variants remain covered by "keeps install metadata precedence and reads hooks after plugin versions" for both plugins and hooks. Pinning still checks authored specs despite resolved metadata. CI-only validation: formatting, plain oxlint and diff-check passed. Tests and coverage intentionally deferred to hosted CI.
Table gateway exposure, ingress, SecretRef and response decision paths. Reuse install and collector fixtures. Replace the fix target inventory with on-disk permission checks for default and named rosters. Keep debris filtering in the plugin trust test "ignores install backup and debris dirs when auditing installed plugin roots". Keep pinning, integrity and drift in "keeps install metadata precedence and reads hooks after plugin versions". Keep dangerous Gmail/applyPatch flags in "keeps unrelated dangerous flags active when one dangerous flag is suppressed". Static-only proof: plain oxlint, oxfmt and diff-check. No test or coverage runs. Total shard reduction remains below 25%; distinct security and lifecycle checks retained.
Consolidate snapshot-store fixtures, migration expectations, recovery fixture validation, and password UIA rejection setup. Split conditional DM/to-device setup without dropping either case; retain transport backpressure and cancellation assertions. CI-only campaign: plain oxlint, oxfmt, and diff checks pass. All 135 expanded cases retained; 3259 -> 3200 lines (1.81%). The 25% target is not safely attainable here without cutting distinct authority, durability, and lifecycle coverage.
Remove repeated facade forwarding and rehydration tests covered by crypto-facade.test.ts; preserve the real manager request boundary. Keep staged-key acceptance and non-persistence in sdk.test.ts and SDK persistence ordering in recovery-key-store.test.ts. Consolidate concurrent snapshot round-trip and stale-key replacement, peer identity collisions, and crypto shutdown/initialization fixtures. Remove repeated call-shape assertions and equivalent transport input rows while retaining authority, durability, and lifecycle boundaries. Simplify the paced HTTP fixture with a backpressured Node stream. CI-only: oxfmt, plain oxlint, and diff checks pass; no tests or builds run. Shard is 3259 -> 2995 lines (-8.1% cumulatively), still below the 25% target. Static cases 135 -> 125.
Keep exact-byte snapshot reassembly and Matrix payload/metadata validation. Remove the raw-SQL corruption replay already covered by file-sync-store.test.ts: validates selected chunk JSON after earlier gaps with bulk stores, and plugin-state-store.test.ts: reports the explicit path for corrupt reads and rolls back decoding mutations. Both snapshot readers use the same readMatrixStateChunks error propagation. Use the native mock-order matcher and directly check the requested reset flag. CI-only static checks pass; no tests or builds run. Original shard 3259 -> 2952 lines (-9.42%); the 25% target remains unmet without dropping distinct behavior or changing out-of-shard registrations.
Reuse devices.test-support and remove duplicate lifecycle cases retained in devices.lifecycle.test.ts: denial privacy, teardown ordering, failed cleanup, normalized removal, token redaction/delivery and wake ownership. Keep unique node reapproval coverage. Keep one start and one resume command across every terminal authority scenario; openTerminalSession's final dispatch guard is provider-neutral. Consolidate ClawHub mock reset setup without removing its security or install cases. CI-only campaign: plain oxlint, oxfmt and diff check passed. No runtime tests or coverage run. Shard LOC 4016 to 3460; retain distinct authority, privacy, recovery and lifecycle contracts rather than force the 25 percent target.
Remove the redundant ClawHub network-error replay: validation.test.ts covers handler error mapping and clawhub-client.test.ts covers transport failures. Use actual configured-agent workspace resolution instead of the ClawHub agent-scope mock layer. Reuse audit event metadata and minimize the opaque redaction fixture while preserving raw-decision exclusion. audit.trim.store.test.ts owns padded filters and pagination; session-change-event.prepared.test.ts owns coalescing counts. Preserve privacy, SQL-idle, authority and lifecycle outcomes while removing duplicate wiring assertions and response plumbing. CI-only: plain oxlint, formatting and diff-check passed; no tests run. Additional 189 lines removed; cumulative shard LOC 4016 to 3271 (18.6 percent), short of the 25 percent target. Remaining shared fixtures and distinct boundary cases retained.
Remove abandonment replays covered by placement-force-abandon.test.ts and targeted recovery replays covered by placement-targeted-recovery.test.ts in the same Gateway project. Preserve unique restart, authority, durability and ordering checks. Consolidate repeated staged-read and workspace fixture setup.
Keep the repository preparation failure boundary while dropping replayed checkout and fetch variants covered by node-worker-repository-preparation.test.ts. Preserve seed invalidation, credential filtering, and authority behavior. Remove the lower-limit rebase replay covered by workspace-reconcile-recovery.test.ts inventory and payload limit cases, with worker admission retained locally. Replace materialization call inventories with real directory contents and reuse the attached environment fixture.
Bind staging, application, artifact reads and file setup to one local workspace fixture. Share memo-scoped capture invocation and serialized GC fixture input. Remove repeated internal query counters while retaining candidate visibility, invalidation races and immutable projections. Unicode journal persistence stays covered by placement-store.test.ts: persists a workspace rollback journal and clears it with manifest acceptance.
Consolidate deleted-agent store fixtures while retaining key, label, and session-ID rejection. The binding-demand table retains idle-corpus discovery proof; the nearest-preceding-tool case retains full-transcript reconstruction proof. Reuse managed-media store scope and worker launch parameters, and remove a mock self-assertion from local model refresh. CI-only campaign: formatting, plain oxlint, and diff checks pass. Preserve distinct auth, approval, shutdown, recovery, and privacy cases; the safe reduction is 80 of 3514 lines (2.3%), below the 25% target. No tests or coverage run.
Keep lockout non-extension in the live-policy case. Keep local catalog routing while removing auth replay covered by server-model-catalog defers-prepared-auth and server-methods/models-auth-login.catalog.integration tests. Mention delivery remains in mention-inbox keeps-view-revisions-private proof; directory privacy and invalidation assertions stay. Reuse approval RPC and tracked HTTP fixtures, disposable spies/databases, and defined-value assertions. No test/build/coverage runs under CI-only instructions; plain oxlint, formatting, and diff checks pass. Additional reduction: 99 lines; cumulative 3514 to 3335 (5.1%). The 25% target remains unmet rather than dropping distinct boundary proof.
Remove freshness replay covered by sessions-resolve-projection keeps-the-freshest-same-session-id, and direct catalog replay covered by server-model-catalog forwards-the-requested-lifecycle-owner. Consolidate event capture, approval waits, and PR state setup while retaining tracked-work drainage and every distinct lifecycle/security assertion. CI-only: plain oxlint, oxfmt and diff checks pass; no tests/builds/coverage run. Additional 39 lines removed; cumulative 3514 to 3296 (6.2%). Full owner/sibling audit found no safe whole-file deletion; 25% target remains unmet under the required retention bar.
Share native scenario setup and repeated assertions while preserving all executed cases. Retain distinct redaction, lifecycle, configuration, artifact integrity, and compaction contracts. CI-only: formatting, plain oxlint, and diff checks passed; runtime proof deferred to hosted CI.
Keep module-flow selection proof in scenario-lane.test.ts and suite-planning-module-flows.test.ts; keep evidence construction and slim projection proof in evidence-summary.test.ts and evidence-containment.test.ts; keep retry-policy evaluation in profile-evidence-plan.test.ts. Retain real delivery, acknowledgement, artifact integrity, routing and redaction checks. CI-only: plain oxlint, formatting and diff checks passed. No tests or coverage run. This additional pass removes 307 lines; cumulative shard reduction is 373 of 3489 lines, below the 25 percent target.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR consolidates repeated test fixtures and overlapping assertions across Gateway, agent, daemon, Codex, Matrix, security, and QA Lab suites. Example: An authentication failure occurs 1,000 ms into an existing 4,000 ms lockout.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed test cleanup has useful, coherent scope, and review found no actionable introduced defect; the exact-head CI gate remains pending. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe changed test suites feed synthetic requests, transport events, and filesystem fixtures through existing runtime owners and check their observable results. flowchart LR
A[Test fixtures] --> B[Gateway and agent owners]
A --> C[Plugin and daemon owners]
B --> D[Transport and storage boundaries]
C --> D
D --> E[Contract assertions]
E --> F[Hosted CI gate]
Technical reviewBest possible solution: Land the test consolidation with its retained boundary assertions after the existing exact-head CI gate passes. Do we have a high-confidence way to reproduce the issue? This PR addresses test maintenance rather than a reported runtime defect; review used source comparisons and existing hosted results without executing target code. Is this the best way to solve the issue? The retained patch reuses existing fixture owners and combines overlapping scenarios while keeping distinct rejection, cancellation, recovery, and ordering assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c78aa483ab74. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -724. Total -724 across 37 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 25, 2026, 9:45 AM ET / 13:45 UTC. |
…83604) * test(gateway): prune s0388 wrapper replays Remove mock-only list forwarding and cancellation replay. Real conversation discovery remains in conversation-list.test.ts, cancellation and reply retirement in conversation-turns.test.ts, and validated envelope behavior in validation.test.ts. Retain the numeric list-limit guard and conversation identity/race checks. Remove unused TTS mock exports and a conversion success payload from a conversion-rejection-only fixture. CI-only static gates pass; no tests run. Shard now 3011 lines versus 3499 baseline; the 25 percent target remains unmet. * test(daemon): deslop s0390 tests Share launchctl shell fixtures, export ordinary stop helpers at their definitions, and consolidate relative EnvironmentFile setup. Retain both authored and manager rejection cases, every native ownership boundary, and all rollback and lifecycle assertions. No behavior cases deleted; the safety-focused shard does not admit a 25 percent cut without removing distinct proof. * test(daemon): consolidate s0390 boundary proof Fold the discovered-unit assertions into the retained strict account inspection case using requireLoaded. Exercise percent quoting in argv and environment together, and combine multiline shell values into one representative round trip. Trim generated-shell wording checks while retaining executed retry/order proof and the 345-second drain bound. Reuse the exact command-result comparison for diagnostics and assertions. Distinct ownership, cleanup, persistence and parser boundaries remain covered; no whole sibling suite was redundant. * test(daemon): trim s0390 scalar fixture scaffolding Remove unused directory inventory fields, the filtered one-row manager table, and its single-use wrapper. Preserve all literal, wildcard, optional, relative-path, provenance, and start-policy cases. A read-only cross-layer audit found no safe whole-file deletions: HOME removal has its own reinsertion guard, concurrent-edit rollback retains still-referenced candidate inputs, and malformed membership rows reach distinct native-authority checks. * test(cli-runner): deslop s0389 tests Reuse preparation fixtures, cleanup, diagnostic assertions, and history parameters. Keep trajectory opt-out branches as distinct table rows. The retained disabled-and-agent-scoped MCP projection test covers selectCodexProjectableMcpServers enabled=false filtering; the separate disabled-server replay is removed. All authority, privacy, recovery, and lifecycle assertions remain. CI-only: oxfmt, plain oxlint, and diff-check passed. No tests or coverage run. Lines 3611 to 3503 (3.0%); the 25% target is not reached because remaining cases exercise distinct boundaries. * test(cli-runner): remove duplicated s0389 proof layers Keep model-call capture, budget, and redaction proof in model-call-diagnostics.test.ts instead of replaying it in run-diagnostics.test.ts. Keep queue/adoption proof in queue/settings.test.ts and agent-runner-steer-adoption.worker.test.ts; retain native stdin authority, persistence, and lifecycle checks. Prompt rendering keepers: embedded-agent-runner/system-prompt.test.ts advertises ClawHub and uses config-backed delegation; system-prompt.test.ts leaves custom button guidance to the plugin; system-prompt-config.test.ts renders only current supplied aliases; prepare.test.ts renders sandbox-readable CLI skills. Keep CLI credit and plugin-command surface selection here. Codex scoping and remote OAuth isolation remain covered by thread-lifecycle.user-mcp-servers.test.ts: projects only the current agent's MCP servers without starting excluded servers, and omits MCP OAuth servers before policy discovery for a remote app-server. Disabled filtering remains asserted in the session override projection case. Remove grant metadata inventories already owned by mcp-grant-context.test.ts, mcp-http.test.ts, and prepare.test.ts. Share configured-server lifecycle and prepare fixtures; replace trajectory's test-written subprocess driver with backend event fixtures while keeping production runner, recovery, cancellation, and SQLite recording. CI-only: formatting, plain oxlint, and diff-check pass; no tests or coverage run. Additional reduction 3503 to 3084 lines; cumulative 3611 to 3084 (14.6%), below the 25% target. No production changes or files deleted. * test(cli-runner): consolidate s0389 lifecycle proof Remove generic controller-recovery replay that explicitly disabled the CLI watchdog. The backend row of diagnostic-controller-recovery.integration.test.ts 'uses the controller-owned allowance through its exact boundary' retains heartbeat, exact deadline, cancellation and once-only run_stalled proof. Keep compaction-specific executor/watchdog paths. Remove disconnected steering-mode probes: commands-steer.test.ts retains active steer/body-rewrite behavior, the tell alias uses the same parser branch, and queue/settings.test.ts retains persisted session-mode override behavior. Remove run-owner attribution replay already covered by cli-runner.before-agent-reply-cron.test.ts while retaining prepared-config commentary capture and trace/private-content assertions. Combine MCP admission binding with the same grant's transfer and cleanup lifecycle, preserving every identity, projection, delegated authority, binding, transfer and revocation assertion. Share admission construction and OAuth config preparation. No production changes or files deleted. CI-only: formatting, plain oxlint and diff-check passed; no tests run. Additional 3083 to 2930 lines, cumulative 3611 to 2930 (-18.9%); 25% target remains unmet. Authority and command suites cannot merge because Vitest assigns different projects. * test(codex): deslop s0391 tests Factor repeated policy expectations, bridge setup, elicitation replies, and turn-input lookup without removing distinct boundary cases. Preserve interruption, process containment, permission, replay, provenance, and lifecycle coverage. CI-only validation: oxfmt, plain oxlint, and diff check. Shard test LOC 3627 -> 3564; all 78 declarations and 124 expanded cases retained. The 25% target is not safely reachable by these structural edits. * test(codex): consolidate s0391 owner-boundary proof Remove repeated warm-model replay covered by thread-lifecycle.native-config and run-attempt.native-config. Exercise attribution directly through the admitted runner, retaining real SQLite bindings and ready/cached/picker model separation. Outer code-mode output remains covered by run-attempt.checkpoint: checkpoints the complete native response, not the earlier execution preview. The oversized-summary case retains echo suppression; run-attempt.channel-tool-progress retains channel progress identity. Keep nonzero command failure in the null-aggregate response case. Consolidate terminal outcomes, permission tuples, negative media cases and FIFO snapshot setup. Remove redundant projection-wrapper proof covered by dynamic-tools: quarantines dynamic tools with unsupported input schemas. Keep each security and lifecycle branch. CI-only: plain oxlint, oxfmt and diff-check pass; no test or coverage runs. Original shard LOC 3641 -> 3295, with 283 lines removed in this follow-up. No production changes or files deleted; reduction remains below the 25 percent target. * test(codex): reuse s0391 owner fixtures Call native compaction owner directly instead of intercepting the harness wrapper; harness.test.ts retains the legacy compaction authority guard. Reuse supported attempt and projector fixtures instead of replaying generic transport/event plumbing. Retain real SQLite model bindings and all ready/cached/picker and reroute assertions. Centralize input gateway teardown and consolidate quarantine fixtures while preserving executable and registered projections. Nonregistered projection remains covered by dynamic-tools.test.ts: quarantines dynamic tools with unsupported input schemas. Keep distinct security, retirement, process and protocol paths. CI-only: oxfmt, plain oxlint and diff-check passed; no tests or coverage ran. Additional 69 lines removed; original shard LOC 3641 -> 3226. No production changes or files deleted. The 25 percent target remains unmet because further identified cuts would remove distinct boundary proof. * test(agents): deslop s0394 tests Consolidate repeated provider config, catalog transport, skill, and tool-result fixtures without dropping distinct behavior assertions. Keep recovery, replay, privacy, and authority coverage intact; no safe cross-file duplicate cases were found. * test(agents): remove duplicate s0394 proof layers Keep timeout recovery at its owning boundary; runs.test and subagent-announce-direct-delivery.test cover marker isolation, queued completion, steering, and terminal suppression. Keep ordinary projection lifecycle in session-prompt-state.test and attempt-stream-settle.test; tool-result-truncation.test and session-manager-cache-ttl.test cover compaction and restored bytes. Replace the checkpoint shadow model with explicit snapshot transitions across rollover, branches, reset, uncertain append, and damage. Narrow configured catalog setup to the actual lookup owner, reuse skill owner coverage, and retain the bounded fingerprint case instead of duplicating its dump in the outbound wire test. CI-only: format, diff-check, and plain oxlint passed; no runtime tests run. * test(gateway): deslop s0392 tests * test(gateway): remove duplicate s0392 test layers Remove five duplicate publication lifecycle cases and their private setup. Keepers are the identically named tests in src/gateway/github-personal-publication.lifecycle.test.ts: revokes captured publication authority after committed receipt cleanup; preserves repository receipts when a session is recreated before receipt deletion admission; preserves receipts and repository ownership when an owner write crosses the native receipt grant; preserves a same-key successor receipt while direct deletion removes historical receipts; retains logical-session receipts across archive and reset, then removes them through permanent deletion. The narrower-scope replay remains covered by server-methods/device-scope-upgrade.test.ts, rejects current scopes even with an admin ceiling. Ordinary grant expiry remains covered by cron-creator-authority-grant.test.ts, retains only the stream mutation through one bounded approval wait. Publication supersession remains covered by github-publication-relevance.test.ts exact-tree and newer unpublished snapshot cases. Consolidate widget publication lifecycle fixtures, remove malformed-query variants reaching the same unexpected-key guard, and replace startup metric inventories with representative timing and accumulation assertions. Preserve distinct security and lifecycle behaviors. CI-only: plain oxlint, formatting, and diff checks passed; no tests run. * test(gateway): reuse s0392 fixture owners Use closeBoardDatabases and createGatewayRuntimeStateForTest instead of duplicate teardown and raw transport assembly. Let connectGatewayClient own its signed test identity and inspect the observed tool result rather than asserting an incidental provider request count. Share public media status/body assertions and remove redundant mock argument shapes, common header checks, and unused PR fixture metadata. Preserve all remaining cases and security/lifecycle assertions. CI-only: plain oxlint, formatting, and diff checks passed; no tests or builds run. * test(security): deslop s0393 tests Share scanner fixtures, finding assertions, collector-scope setup and install record builders. Retain distinct security boundaries and targeted remediation commands. Redundant install metadata drift variants remain covered by "keeps install metadata precedence and reads hooks after plugin versions" for both plugins and hooks. Pinning still checks authored specs despite resolved metadata. CI-only validation: formatting, plain oxlint and diff-check passed. Tests and coverage intentionally deferred to hosted CI. * test(security): consolidate s0393 boundary fixtures Table gateway exposure, ingress, SecretRef and response decision paths. Reuse install and collector fixtures. Replace the fix target inventory with on-disk permission checks for default and named rosters. Keep debris filtering in the plugin trust test "ignores install backup and debris dirs when auditing installed plugin roots". Keep pinning, integrity and drift in "keeps install metadata precedence and reads hooks after plugin versions". Keep dangerous Gmail/applyPatch flags in "keeps unrelated dangerous flags active when one dangerous flag is suppressed". Static-only proof: plain oxlint, oxfmt and diff-check. No test or coverage runs. Total shard reduction remains below 25%; distinct security and lifecycle checks retained. * test(matrix): deslop s0395 tests Consolidate snapshot-store fixtures, migration expectations, recovery fixture validation, and password UIA rejection setup. Split conditional DM/to-device setup without dropping either case; retain transport backpressure and cancellation assertions. CI-only campaign: plain oxlint, oxfmt, and diff checks pass. All 135 expanded cases retained; 3259 -> 3200 lines (1.81%). The 25% target is not safely attainable here without cutting distinct authority, durability, and lifecycle coverage. * test(matrix): consolidate s0395 boundary coverage Remove repeated facade forwarding and rehydration tests covered by crypto-facade.test.ts; preserve the real manager request boundary. Keep staged-key acceptance and non-persistence in sdk.test.ts and SDK persistence ordering in recovery-key-store.test.ts. Consolidate concurrent snapshot round-trip and stale-key replacement, peer identity collisions, and crypto shutdown/initialization fixtures. Remove repeated call-shape assertions and equivalent transport input rows while retaining authority, durability, and lifecycle boundaries. Simplify the paced HTTP fixture with a backpressured Node stream. CI-only: oxfmt, plain oxlint, and diff checks pass; no tests or builds run. Shard is 3259 -> 2995 lines (-8.1% cumulatively), still below the 25% target. Static cases 135 -> 125. * test(matrix): remove duplicated storage-driver proof in s0395 Keep exact-byte snapshot reassembly and Matrix payload/metadata validation. Remove the raw-SQL corruption replay already covered by file-sync-store.test.ts: validates selected chunk JSON after earlier gaps with bulk stores, and plugin-state-store.test.ts: reports the explicit path for corrupt reads and rolls back decoding mutations. Both snapshot readers use the same readMatrixStateChunks error propagation. Use the native mock-order matcher and directly check the requested reset flag. CI-only static checks pass; no tests or builds run. Original shard 3259 -> 2952 lines (-9.42%); the 25% target remains unmet without dropping distinct behavior or changing out-of-shard registrations. * test(gateway): deslop s0397 tests Reuse devices.test-support and remove duplicate lifecycle cases retained in devices.lifecycle.test.ts: denial privacy, teardown ordering, failed cleanup, normalized removal, token redaction/delivery and wake ownership. Keep unique node reapproval coverage. Keep one start and one resume command across every terminal authority scenario; openTerminalSession's final dispatch guard is provider-neutral. Consolidate ClawHub mock reset setup without removing its security or install cases. CI-only campaign: plain oxlint, oxfmt and diff check passed. No runtime tests or coverage run. Shard LOC 4016 to 3460; retain distinct authority, privacy, recovery and lifecycle contracts rather than force the 25 percent target. * test(gateway): reduce s0397 fixture and assertion layers Remove the redundant ClawHub network-error replay: validation.test.ts covers handler error mapping and clawhub-client.test.ts covers transport failures. Use actual configured-agent workspace resolution instead of the ClawHub agent-scope mock layer. Reuse audit event metadata and minimize the opaque redaction fixture while preserving raw-decision exclusion. audit.trim.store.test.ts owns padded filters and pagination; session-change-event.prepared.test.ts owns coalescing counts. Preserve privacy, SQL-idle, authority and lifecycle outcomes while removing duplicate wiring assertions and response plumbing. CI-only: plain oxlint, formatting and diff-check passed; no tests run. Additional 189 lines removed; cumulative shard LOC 4016 to 3271 (18.6 percent), short of the 25 percent target. Remaining shared fixtures and distinct boundary cases retained. * test(gateway): deslop s0396 tests Remove abandonment replays covered by placement-force-abandon.test.ts and targeted recovery replays covered by placement-targeted-recovery.test.ts in the same Gateway project. Preserve unique restart, authority, durability and ordering checks. Consolidate repeated staged-read and workspace fixture setup. * test(gateway): reduce redundant s0396 proof layers Keep the repository preparation failure boundary while dropping replayed checkout and fetch variants covered by node-worker-repository-preparation.test.ts. Preserve seed invalidation, credential filtering, and authority behavior. Remove the lower-limit rebase replay covered by workspace-reconcile-recovery.test.ts inventory and payload limit cases, with worker admission retained locally. Replace materialization call inventories with real directory contents and reuse the attached environment fixture. * test(gateway): consolidate s0396 workspace fixtures Bind staging, application, artifact reads and file setup to one local workspace fixture. Share memo-scoped capture invocation and serialized GC fixture input. Remove repeated internal query counters while retaining candidate visibility, invalidation races and immutable projections. Unicode journal persistence stays covered by placement-store.test.ts: persists a workspace rollback journal and clears it with manifest acceptance. * test(gateway): deslop s0399 tests Consolidate deleted-agent store fixtures while retaining key, label, and session-ID rejection. The binding-demand table retains idle-corpus discovery proof; the nearest-preceding-tool case retains full-transcript reconstruction proof. Reuse managed-media store scope and worker launch parameters, and remove a mock self-assertion from local model refresh. CI-only campaign: formatting, plain oxlint, and diff checks pass. Preserve distinct auth, approval, shutdown, recovery, and privacy cases; the safe reduction is 80 of 3514 lines (2.3%), below the 25% target. No tests or coverage run. * test(gateway): consolidate s0399 owner proof and fixtures Keep lockout non-extension in the live-policy case. Keep local catalog routing while removing auth replay covered by server-model-catalog defers-prepared-auth and server-methods/models-auth-login.catalog.integration tests. Mention delivery remains in mention-inbox keeps-view-revisions-private proof; directory privacy and invalidation assertions stay. Reuse approval RPC and tracked HTTP fixtures, disposable spies/databases, and defined-value assertions. No test/build/coverage runs under CI-only instructions; plain oxlint, formatting, and diff checks pass. Additional reduction: 99 lines; cumulative 3514 to 3335 (5.1%). The 25% target remains unmet rather than dropping distinct boundary proof. * test(gateway): remove remaining s0399 duplicate proof Remove freshness replay covered by sessions-resolve-projection keeps-the-freshest-same-session-id, and direct catalog replay covered by server-model-catalog forwards-the-requested-lifecycle-owner. Consolidate event capture, approval waits, and PR state setup while retaining tracked-work drainage and every distinct lifecycle/security assertion. CI-only: plain oxlint, oxfmt and diff checks pass; no tests/builds/coverage run. Additional 39 lines removed; cumulative 3514 to 3296 (6.2%). Full owner/sibling audit found no safe whole-file deletion; 25% target remains unmet under the required retention bar. * test(qa-lab): deslop s0398 tests Share native scenario setup and repeated assertions while preserving all executed cases. Retain distinct redaction, lifecycle, configuration, artifact integrity, and compaction contracts. CI-only: formatting, plain oxlint, and diff checks passed; runtime proof deferred to hosted CI. * test(qa-lab): remove duplicate proof layers in s0398 Keep module-flow selection proof in scenario-lane.test.ts and suite-planning-module-flows.test.ts; keep evidence construction and slim projection proof in evidence-summary.test.ts and evidence-containment.test.ts; keep retry-policy evaluation in profile-evidence-plan.test.ts. Retain real delivery, acknowledgement, artifact integrity, routing and redaction checks. CI-only: plain oxlint, formatting and diff checks passed. No tests or coverage run. This additional pass removes 307 lines; cumulative shard reduction is 373 of 3489 lines, below the 25 percent target. * test: preserve current boundary proof after campaign replay * test: retain distinct security and lifecycle coverage * test: preserve authority and cache regression contracts * test: retain admitted mock factory boundaries * test(daemon): retain launchd failure capture contract
What Problem This Solves
Removes duplicate test layers and repeated fixture scaffolding from batch d535 across Gateway, CLI runner, daemon, Codex, security, Matrix, and QA Lab tests.
User Impact
No production behavior change. All 37 changed files are tests or test support: +947/-1,595 test-file lines and +122/-198 test-support lines; production +0/-0. Total +1,069/-1,793, net -724 lines. No runtime performance or measured coverage claim is made.
Why This Change Was Made
Replayed all 30 requested campaign commits in order onto pinned main
2442ba495e109f7c06d98a2c50bb8fce79089769. No whole commits skipped. Existing owner-boundary proof remains; reductions remove redundant wrappers, repeated assertions, and shared fixture setup.Initial replay decisions (later full-file restorations below take precedence)
Current main wins wherever the campaign's old fixture/coverage shape has changed:
Review and first-CI corrections
Initial head
0f3b26d29b23failed CI; auto-merge was disabled before repair. Independent review identified nine files needing restored resource cleanup or distinct boundary coverage, plus a ClawHub mock-reset default and an audit table type issue. All findings were accepted.The correction restores the pinned-main versions of the preauth HTTP fixture; audit nested-redaction, cron replay, steering routes, timeout completion delivery, compaction watchdog, warm model-attribution, private terminal-output, and deep-scanner debris tests. It restores the default ClawHub base URL after resetting mocks.
CI additionally exposed removed helpers still used by main's callers, obsolete fixture argument shapes, and incompatible table types. Rather than weakening assertions, the affected file-level reductions were dropped: CLI MCP support/configured-MCP/model-routing/trajectory; tool-result cache-TTL; conversation-list; security gateway exposure/plugin trust/install policy; Codex native compaction/output fidelity; QA gateway config; session-PR staleness; node-launch; systemd scope; and scheduled-task capture support. The entire audit-exposure restoration also supersedes the initial proposed severity-only repair.
First-run failure evidence: https://github.com/openclaw/openclaw/actions/runs/40195513126 . These were treated as batch-caused, not inherited failures. No bypass requested. Fresh-head hosted CI must validate the reduced patch.
Final review and gate reductions
The second review retained private image headers/token validation, auth-driven catalog refresh, cold Matrix chunk corruption, nonempty Node flags, checkout/fetch recovery, large rebase manifests, scoped unsubscribe, fourth-candidate supersession, keyless-event flushing, and QA planner/taxonomy/retry/slim-evidence/catalog-pattern contracts. The third review retained device scope downgrade, newest duplicate-session selection, lifecycle/model telemetry ownership, and placement cache-hit counters. All affected files were restored wholesale to pinned main.
The next full-diff review was scoped-clean through P2. CI on
ab6f24b0b8c4subsequently flagged changed first-party mock factory identities inskills.clawhub.test.tsandaudit-plugin-readonly-scope.test.ts; those entire file changes were also dropped instead of expanding the baseline or adding isolation exceptions. Hosted lint on915002a53461then flagged the compacted launchd rejection callback (use-unknown-in-catch-callback-variable). Its complete error-capture block was restored byte-for-byte from pinned main; no new callback, cast, guard, or suppression was added. The final inventory below is authoritative for retained changes.No changed path matches the current CODEOWNERS rules. This is test-only work, including tests of security behavior; no security implementation or policy changes.
Evidence
pnpm install --frozen-lockfile --prefer-offline: passed.git diff --name-only -z <pinned-base>...HEAD | xargs -0 node_modules/.bin/oxfmt --write: passed on 37 files.git diff --name-only -z <pinned-base>...HEAD | xargs -0 node_modules/.bin/oxlint -c .oxlintrc.json: exit 0.git diff --check <pinned-base>: passed.openclaw/ci-gatesupplies execution proof on the pushed head.Per-shard replay inventory and static declaration counts
Counts below are source declaration sites, not expanded runtime cases. LOC is measured against the pinned main base, not the older campaign reports.
s0388
Replayed test/support LOC: +1/-12 (net -11); static declaration sites: 6 → 6. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/gateway/server-methods/tts.test.ts.s0389
Replayed test/support LOC: +4/-37 (net -33); static declaration sites: 16 → 15. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/agents/cli-runner/bundle-mcp-codex.user-config.test.ts,src/agents/cli-runner/history-boundary.incognito.test.ts.s0390
Replayed test/support LOC: +144/-241 (net -97); static declaration sites: 20 → 19. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/daemon/launchd-restart-handoff.test.ts,src/daemon/schtasks.stop.test-support.ts,src/daemon/systemd-scalar-paths.test.ts.s0391
Replayed test/support LOC: +172/-326 (net -154); static declaration sites: 39 → 36. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
extensions/codex/src/app-server/dynamic-tools.gateway-policy.test.ts,extensions/codex/src/app-server/plugin-read-only.test.ts,extensions/codex/src/app-server/remote-workspace-media.test.ts,extensions/codex/src/app-server/run-attempt.protocol-validation.test.ts,extensions/codex/src/app-server/user-input-bridge.elicitation.test.ts.s0392
Replayed test/support LOC: +34/-54 (net -20); static declaration sites: 17 → 17. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/gateway/board-http.test.ts,src/gateway/github-repository-publication-snapshot.test.ts.s0393
Replayed test/support LOC: +53/-95 (net -42); static declaration sites: 25 → 24. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/security/audit-exec-surface.test.ts,src/security/external-content.test.ts.s0394
Replayed test/support LOC: +86/-150 (net -64); static declaration sites: 17 → 17. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/agents/embedded-agent-runner/model-request-body.test.ts,src/agents/embedded-agent-runner/model.compat-route.test.ts,src/agents/embedded-agent-runner/model.static-catalog.snapshot-cache.test.ts,src/agents/embedded-agent-runner/skill-runtime.workspace.test.ts.s0395
Replayed test/support LOC: +82/-126 (net -44); static declaration sites: 28 → 26. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
extensions/matrix/src/matrix/sdk/crypto-persistence.test-support.ts,extensions/matrix/src/matrix/sdk/live-room-readiness.test.ts,extensions/matrix/src/matrix/sdk/recovery-key-store.test.ts.s0396
Replayed test/support LOC: +147/-214 (net -67); static declaration sites: 11 → 11. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/gateway/worker-environments/computer-transport.test-support.ts,src/gateway/worker-environments/workspace-large-inventory.test.ts,src/gateway/worker-environments/workspace-result-staging.reads.test.ts.s0397
Replayed test/support LOC: +171/-241 (net -70); static declaration sites: 10 → 10. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/gateway/server-methods/terminal.dispatch-authority.test.ts,src/gateway/server-methods/worktrees.test.ts.s0398
Replayed test/support LOC: +100/-159 (net -59); static declaration sites: 23 → 22. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
extensions/qa-lab/src/scenario-retained-final.test.ts,extensions/qa-lab/src/suite-runtime-gateway.test.ts,extensions/qa-lab/src/token-efficiency-report.test.ts.s0399
Replayed test/support LOC: +75/-138 (net -63); static declaration sites: 43 → 42. Coverage totals: not available; shard report says coverage was not run under CI-only instructions.
src/gateway/approval-fixture.test.ts,src/gateway/auth-rate-limit.test.ts,src/gateway/github-publication-discovery.test.ts,src/gateway/managed-image-attachments.test-support.ts,src/gateway/mention-directory.test.ts,src/gateway/server-close.memory.test.ts,src/gateway/server.chat-recovered-output.test.ts.