Skip to content

test(gateway): remove low-value tests (batch d139) - #162964

Merged
steipete merged 9 commits into
mainfrom
tcr/land-d139-1790880830
Oct 1, 2026
Merged

steipete merged 9 commits into
mainfrom
tcr/land-d139-1790880830

Conversation

@steipete

@steipete steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway session tests contain duplicate matrix rows, repeated setup, and an already-skipped reporting benchmark that add maintenance without independent regression protection.

User Impact

No user-visible behavior changes. This maintainer-requested batch removes low-value tests and consolidates fixtures while retaining lifecycle, authorization, storage, concurrency, and RPC boundary coverage. No production files, configuration, or schemas change.

Why This Change Was Made

Replay nine audited cleanup commits onto main at 84dc4c73ceee27d8067570fc1cdc6e2bc5dbe272. The separate profile-setter fixture-import commit 465afe04631c is omitted because main already carries the correct worker-owned import in ed961d55486 (#162571).

Conflict resolutions preserve current main: retain the new row-publication and transcript dependencies in session-row-event-parity.test.ts; retain the static sessions-read import while consolidating cold-storage setup; retain category invalidation, membership readiness, and SQL-idleness assertions while using the shared describe helper in session-row-projection.prepared-read.test.ts. No current-main regression cases were dropped.

None of the changed paths match current CODEOWNERS rules.

Evidence

  • Focused Blacksmith Testbox proof: 359 passed, 1 existing skipped case across 38 files, covering every surviving changed test file plus session-create-collision.test.ts. Command: CI=1 pnpm install --frozen-lockfile --prefer-offline >/dev/null && CI=1 pnpm test <38 focused paths>. Source admission pinned this candidate to c14068033727bab30212032dce5db6e1a6f4d34b; run exited 0. Testbox run, lease tbx_01m3wdyh3p8bp89mjmrpp3fnsw, stopped.
  • oxfmt --write <changed files>, plain oxlint -c .oxlintrc.json <changed TS files>, and git diff --check passed for the pinned batch diff. No formatter changes remained.
  • Infrastructure gap: OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <39 changed paths> was attempted. Lease tbx_01m3wfgwvzye4294q9wsbh2cjp remained queued for more than 13 minutes with no runner or checks started, then was explicitly stopped. This gate is unrun locally; it is not a passing result. Per the campaign arming rule, hosted CI is the merge gate.
  • Independent audit found no actionable deletion concern. Autoreview reported eight P2 test-gap findings; all were rejected after inspecting the retained owner tests. Specific evidence is below.
  • Production LOC: +0 / -0. Tests and test support: net -1,182 lines across 39 changed paths; syntactic declarations -15. The only added support module is the shared session-row event peer fixture.

Historical shard coverage below comes from each original campaign report; it is not a new coverage measurement against current main. s813 excludes its failed worker-read baseline group; its report separately records repaired full-file tests and all final shard tests passing. Other noted failing baselines were repaired before their reported complete comparisons. The original reduction targets were deliberately not forced beyond supported deletions.

Shard Replayed test/support LOC (+ / -; net) Declaration count before → after Original executed cases before → after
s810 +128 / -212; -84 19 → 18 31 → 27
s808 +120 / -379; -259 37 → 34 90 → 67
s817 +99 / -150; -51 23 → 22 54 → 47
s815 +24 / -124; -100 14 → 11 46 → 43
s816 +143 / -279; -136 31 → 29 73 → 53
s806 +12 / -165; -153 7 → 6 23 → 23
s812 +270 / -414; -144 31 → 28 52 → 47
s813 +93 / -300; -207 47 → 46 103 → 92
s814 +227 / -275; -48 15 → 15 61 → 58

Declaration counts count syntactic it/test declarations, including table declarations; executed-case totals are the original per-shard reports.

s810: files and historical coverage
  • src/gateway/session-row-changes.gateway.test.ts
  • src/gateway/session-row-event-ancestor-placement.test.ts
  • src/gateway/session-row-event-parity.test.ts
  • src/gateway/session-row-event-trees.test.ts
  • src/gateway/session-row-event.test-support.ts
  • src/gateway/session-row-placement-projection.lifecycle.test.ts
  • src/gateway/session-row-prepared-read.test.ts
covered statements 5155 -> 5153 (-2); branches 4074 -> 4060 (-14); functions 971 -> 971 (0)
s808: files and historical coverage
  • src/gateway/session-history-worker-runtime.test.ts
  • src/gateway/session-history-worker.integration.test.ts
  • src/gateway/session-history.subagent-visibility.test.ts
  • src/gateway/session-lifecycle-state.recovery.test.ts
statements 3,096 → 3,090 (−0.19%); branches 2,056 → 2,054 (−0.10%); functions 500 → 498
s817: files and historical coverage
  • src/gateway/sessions-history-http.model-policy.test.ts
  • src/gateway/sessions-patch.operator-model-policy.test.ts
  • src/gateway/stale-install.test.ts
  • src/gateway/test-helpers.listener.test.ts
covered statements 17564 -> 17574 (10); branches 9207 -> 9215 (8); functions 3321 -> 3320 (-1)
s815: files and historical coverage
  • src/gateway/session-subagent-resume.test.ts
  • src/gateway/session-utils-row.materialize.test.ts
covered statements 2029 -> 2025 (-4); branches 1421 -> 1417 (-4); functions 327 -> 326 (-1)
s816: files and historical coverage
  • src/gateway/session-utils.agent-models.test.ts
  • src/gateway/session-utils.filters.test.ts
  • src/gateway/session-utils.fs.preview.test.ts
  • src/gateway/session-utils.metadata-perf.test.ts
  • src/gateway/session-utils.navigation-lineage.test.ts
covered statements 4599 -> 4591 (-8); branches 3618 -> 3600 (-18); functions 828 -> 824 (-4)
s806: files and historical coverage
  • src/gateway/session-cold-storage-maintenance.test.ts
  • src/gateway/session-companion-runtime.test.ts
  • src/gateway/session-create-collision.benchmark.test.ts
covered statements 3022 -> 3022 (0); branches 1736 -> 1736 (0); functions 540 -> 540 (0)
s812: files and historical coverage
  • src/gateway/session-row-projection.foreground.test.ts
  • src/gateway/session-row-projection.incognito.test.ts
  • src/gateway/session-row-projection.invalidation.test.ts
  • src/gateway/session-row-projection.membership.test.ts
  • src/gateway/session-row-projection.prepared-read.test.ts
covered statements 4325 -> 4325 (0); branches 3256 -> 3256 (0); functions 826 -> 826 (0)
s813: files and historical coverage
  • src/gateway/session-row-projection.subagent-index.test.ts
  • src/gateway/session-row-projection.test.ts
  • src/gateway/session-row-projection.topology.test.ts
  • src/gateway/session-row-projection.transcript-regression.test.ts
  • src/gateway/session-row-projection.worker-read.test.ts
  • src/gateway/session-row-selection.test.ts
covered statements 5458 -> 5455 (-3); branches 3980 -> 3971 (-9); functions 967 -> 967 (0)
s814: files and historical coverage
  • src/gateway/session-runtime-selection-projection.test.ts
  • src/gateway/session-sharing-preparation.test.ts
  • src/gateway/session-startup-orphan-races.test.ts
covered statements 2704 -> 2704 (0); branches 2129 -> 2129 (0); functions 492 -> 492 (0)
Autoreview disposition

Autoreview completed with eight P2 test-gap findings, all rejected after current-source verification:

  1. Metadata-filter visibility: the deleted fixture prefilters unauthorized entries before the production selector (src/gateway/session-list.test-support.ts:80), so those rows could not establish the claimed authorization interaction. Foreign-draft authorization remains in src/gateway/session-sharing.test.ts:717.
  2. Initial task-completion rejection: src/gateway/server.sessions-send-resume.test.ts:197 uses the real tool and checks the exact error, unchanged paused record, absent successor, and no input, receipts, execution, result, or announcement.
  3. Initial caller authorization: the same owner suite at :172 exercises an unrelated visible controller before binding and verifies the rejection and absence of side effects.
  4. Stale recovery generation: src/agents/main-session-recovery/main-session-recovery-run-ownership.test.ts:110 covers old/current generations of the same run and both admitted-delivery and foreground ownership; only the stale marker is removed.
  5. In-place config publication: src/config/runtime-snapshot.preparation.test.ts:139 retains the full same-object/value/provenance matrix, and src/gateway/session-row-projection.invalidation.test.ts:711 proves the resulting list refresh.
  6. New-ID keyed replacement: src/gateway/session-row-projection.worker-read.test.ts:279 preserves the replacement while an older worker reply is pending, including current-identity and snapshot assertions. Recovery owner coverage also remains.
  7. Replaced ACP ownership: src/gateway/session-row-projection.worker-read.test.ts:862 proves missing ownership, both backend publications, and unlock after lifecycle replacement at :903.
  8. Installation retirement: the deleted variant resolves and awaits its helper before disposal; it did not cover disposal while the helper was pending. The retained coalesces disk reads and rejects an observation after its lifecycle registration retires case in src/gateway/stale-install.test.ts retires an actual in-flight observation and suppresses both retired and current callbacks. The retained resume/rollback tests protect suspension settlement.

No accepted/actionable findings remain. The automated verdict itself was not clean; these are evidence-backed maintainer rejections of its limited-diff-context findings.

@clawsweeper

clawsweeper Bot commented Oct 1, 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 1, 2026 19:54
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL labels Oct 1, 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 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 3:59 PM ET / 19:59 UTC.

ClawSweeper review

What this changes

Removes redundant Gateway session test cases and benchmark diagnostics, consolidates fixtures, and preserves assertions in stronger retained tests.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains useful test cleanup absent from pinned main, and no actionable patch defect was found. The retained boundary tests support the documented deletion dispositions.

Priority: P3
Reviewed head: c14068033727bab30212032dce5db6e1a6f4d34b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent test cleanup with retained boundary coverage and no concrete correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-requested test-only cleanup changes no production owner or runtime behavior; ordinary real-setup proof does not apply. The reported focused test run is supplemental validation, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-requested test-only cleanup changes no production owner or runtime behavior; ordinary real-setup proof does not apply. The reported focused test run is supplemental validation, and no stored-data contract changes.
Evidence reviewed 8 items Introduced scope and necessity: The pinned merge-base-to-head diff contains only tests and test support. The verified test merge retains the same cleanup against fetched main; it changes no production code, configuration, dependencies, or stored schema.
Resume rejection coverage retained: The unchanged Gateway suite exercises the real sessions-send tool for an unrelated controller and a child without task-owned completion. It checks exact rejection, unchanged paused ownership, absent successor, and no input consumption, execution, result, or announcement.
Exact reads remain independent of bulk refresh: The retained sessions.describe test holds a bulk placement refresh while an exact request completes with current placement and label, checks category membership readiness, and asserts zero caller-thread SQL.
Findings None None.
Security None None.

How this fits together

Gateway session services turn stored conversation, membership, and lifecycle facts into session lists, history, and events. These tests protect that behavior across storage workers, authorization checks, and concurrent updates.

flowchart TD
  A[Stored session facts] --> B[Storage workers]
  B --> C[Session projection]
  D[Viewer authority] --> E[Gateway session requests]
  C --> E
  E --> F[Lists history and events]
  G[Retained boundary tests] --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -1182. Total -1182 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 39 1105 2287 -1182
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 1105 2287 -1182

Review metrics

None.

Technical review

Best possible solution:

Keep one meaningful test owner per contract and retain the public Gateway, storage, authorization, and race coverage while removing redundant setup and reporting.

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

Not applicable: this PR consolidates tests rather than repairing a reported product defect; its production behavior is unchanged.

Is this the best way to solve the issue?

Yes: the inspected fixture consolidation and retained owner-boundary assertions support this cleanup without adding production seams or competing implementations.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is internal test maintenance with no introduced production behavior or user-facing configuration change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-requested test-only cleanup changes no production owner or runtime behavior; ordinary real-setup proof does not apply. The reported focused test run is supplemental validation, and no stored-data contract changes.

Label justifications:

  • P3: This is internal test maintenance with no introduced production behavior or user-facing configuration change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-requested test-only cleanup changes no production owner or runtime behavior; ordinary real-setup proof does not apply. The reported focused test run is supplemental validation, and no stored-data contract changes.

Evidence

What I checked:

  • Introduced scope and necessity: The pinned merge-base-to-head diff contains only tests and test support. The verified test merge retains the same cleanup against fetched main; it changes no production code, configuration, dependencies, or stored schema. (c14068033727)
  • Resume rejection coverage retained: The unchanged Gateway suite exercises the real sessions-send tool for an unrelated controller and a child without task-owned completion. It checks exact rejection, unchanged paused ownership, absent successor, and no input consumption, execution, result, or announcement. (src/gateway/server.sessions-send-resume.test.ts:172, c14068033727)
  • Exact reads remain independent of bulk refresh: The retained sessions.describe test holds a bulk placement refresh while an exact request completes with current placement and label, checks category membership readiness, and asserts zero caller-thread SQL. (src/gateway/session-row-projection.prepared-read.test.ts:391, c14068033727)
  • Visibility deletion disposition supported: The removed metadata association cases used a fixture that filtered unauthorized rows before invoking the production list selector. Foreign-draft rejection remains covered by the sharing owner suite. (src/gateway/session-list.test-support.ts:80, c14068033727)
  • Installation lifecycle coverage retained: The complete surviving suite retains pending-observation retirement, helper settlement across suspension, rollback reconciliation, and stable pnpm-link replacement. The removed retirement variant had already awaited its helper before disposal. (src/gateway/stale-install.test.ts:287, c14068033727)
  • Validation and reviewer limitations: The captured PR body reports 359 passing tests and one existing skipped case on the pinned candidate, and explicitly records the unrun changed-check gate. GitHub marks the linked Testbox wrapper run cancelled; its logs redirect to a host blocked by the review proxy, so the focused transcript was not independently verified. No tests were executed during this read-only review. (c14068033727)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 7b4623d into main Oct 1, 2026
120 of 121 checks passed
@steipete
steipete deleted the tcr/land-d139-1790880830 branch October 1, 2026 20:05
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
* test(gateway): deslop s810 tests

* test(gateway): deslop s808 tests

* test(gateway): deslop s817 tests

* test(gateway): deslop s815 tests

* test(gateway): deslop s816 tests

* test(gateway): deslop s806 tests

* test(gateway): deslop s812 tests

* test(gateway): deslop s813 tests

* test(gateway): deslop s814 tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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