Skip to content

chore: remove unused test support exports - #183134

Merged
shakkernerd merged 1 commit into
mainfrom
fix/test-support-private-declarations-313
Oct 25, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/test-support-private-declarations-313

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw's full-tree export analysis reports test-support declarations that are either used only inside their defining module or have no remaining consumer. Leaving those declarations exported makes internal fixture implementation look like a supported cross-module surface and keeps retired helpers in the source tree.

User Impact

There is no user-visible behavior change. Active test fixtures, assertions, timeouts, cleanup paths, and runtime behavior remain unchanged. The team-reports benchmark's dynamically loaded fetchWithSsrFGuard export is explicitly preserved for both direct and worker modes.

Why This Change Was Made

The change removes the export modifier from 15 declarations whose only callers are in the same module. It also deletes nine source-qualified zero-consumer declarations and the three private types/constants that become unreachable with the retired Gateway-node MCP helper cluster.

This keeps the cleanup at the existing test-support owners: no analyzer ignores, compatibility shims, new abstractions, configuration changes, or test-only production seams are introduced.

Evidence

  • Remote changed-file formatting and lint passed, including oxfmt/Bun parity and the first-party mock-export ratchet.
  • All 37 affected type graphs passed across core tests, production core, UI, extensions, extension tests, scripts, and test-root.
  • The native related-test owner selected 108 files and ran one required build plus 17 Vitest shards: 3,216 tests passed, with no failed or unrun row.
  • The full-tree export scan no longer reports any declaration removed or privatized here. It still reports the intentionally retained dynamic fetchWithSsrFGuard export and unrelated existing residuals elsewhere, so this does not claim a globally green unused-export scan.
  • Hosted CI, independent review, and exact-head ClawSweeper evidence remain pending on the initial non-draft PR head.

@clawsweeper

clawsweeper Bot commented Oct 25, 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.

@shakkernerd shakkernerd self-assigned this Oct 25, 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 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes module-local test declarations private and removes unused test-support helpers.

Example: The team-reports benchmark loads its fixture transport in direct and worker modes.

  • Before: Both createReportRunFixtureFetch and fetchWithSsrFGuard are exported.
  • After: The factory is private, while the dynamically loaded fetchWithSsrFGuard export remains available.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, correct maintenance patch supported by consumer inspection and passing exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored, test-support-only cleanup introduces no shipped behavior requiring live demonstration; exact-head CI independently validates the retained consumers.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes misleading internal export surfaces and dead fixture code without changing active test coverage or product behavior.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, maintainer-authored cleanup with no actionable findings; active fixtures and their consumers remain intact.

Priority: P3
Reviewed head: 9312be9c5ea0765a79e192f7b36ac3c8f2041f2c

Before merge

None.

Findings

None.

Agent review details

How this fits together

These modules supply fixtures, mocks, and assertions to existing test suites; they do not define public plugin APIs or change shipped runtime behavior.

flowchart LR
  A[Test suites] --> B[Retained support exports]
  B --> C[Private fixture helpers]
  C --> D[Existing runtime owners]
  E[Benchmark transport loader] --> F[Retained transport export]
  F --> C
Loading

Technical review

Best possible solution:

Merge the focused cleanup while retaining the existing fixture entry points and dynamic benchmark transport export.

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

There is no reported runtime defect to reproduce; source inspection confirms the unused or module-local declarations, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch uses the smallest existing-owner cleanup: remove unnecessary exports and unreachable helpers without adding abstractions, analyzer exceptions, or compatibility paths.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced patch reviewed: The pinned introduction changes only test-support declarations: export removal, deletion of unused helpers, and formatting around one newly private mock; no active assertion or production implementation changes. (9312be9c5ea0)
  • Dynamic benchmark contract preserved: Both benchmark entry points install the existing fixture transport loader, which redirects the SSRF runtime import to this module; fetchWithSsrFGuard remains exported and calls the unchanged private factory. (extensions/team-reports/src/report-run.benchmark-fixtures.test-support.ts:138, 9312be9c5ea0)
  • Consumer and current-main checks: Reference searches found no surviving consumers of the deleted declarations; remaining matches for compactDetails belong to an unrelated local variable. The affected modules are unchanged between the introduction base and fetched main. (9312be9c5ea0)
  • Exact-head CI passed: The completed CI run passed on the reviewed head, including the aggregate gate, affected test shards, core test types, production types, lint, UI checks, and build artifacts: https://github.com/openclaw/openclaw/actions/runs/40153018498. (9312be9c5ea0)
  • Discussion and merge state: The complete body and comments contain no unresolved human objection or additional behavior claim; GitHub reports the reviewed head as cleanly mergeable. (9312be9c5ea0)
  • Repository policy applied: Read the root and all applicable ancestor AGENTS.md files, applied the simplification and test-retention guidance, and found no maintainer-notes directory; the checkout remains clean. (AGENTS.md, 9312be9c5ea0)

Likely related people:

  • Vincent Koc: Raw commit 7a45c8a adds test/scripts/pr-baseline-native.test-support.ts:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7a45c8a7d6e3; files: test/scripts/pr-baseline-native.test-support.ts)

PR surface

Source 0, Tests -64. Total -64 across 17 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 6 6 0
Tests 15 10 74 -64
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 16 80 -64

Labels

Label changes:

  • add P3: This is low-risk test-support maintenance with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is low-risk test-support maintenance with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 10:19 PM ET / October 25, 2026, 02:19 UTC.

@shakkernerd
shakkernerd merged commit 6673c38 into main Oct 25, 2026
153 checks passed
@shakkernerd
shakkernerd deleted the fix/test-support-private-declarations-313 branch October 25, 2026 02:30
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Simplified: Test-support helpers now expose only their live cross-module surface while retired declarations are removed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
Test-support helpers now expose only their live cross-module surface while retired declarations are removed.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 25, 2026
Three fork test files merged cleanly but broke against seams upstream
changed in the jump window:

- session-recipient-authority.caller-thread: the maintenance owner fixture
  now provides assertCurrent, which OpenClawStateLeaseContext requires since
  openclaw#183336 (tsgo:core:test TS2741 at the merge).
- session-delivery-queue-runtime: upstream removed withRuntime and builds the
  runtime fixture through withSessionDeliveryQueue (openclaw#183214). The capacity
  retry case does the same: each bound still gets a fresh queue and clock,
  with the same teardown order. The clock-jump case takes upstream's
  r.start() back: the wake assertion that the fork's pendingSweep: false
  served was removed upstream.
- diagnostic.continuation-queue: upstream dropped the startDiagnosticHeartbeat
  test-support export (openclaw#183134); the enabled-config variant is the same
  call.

RED at the merge 86ed749: withRuntime is not defined;
startDiagnosticHeartbeatForTest is not a function; TS2741. GREEN: 20/20,
2/2, 9/9 solo, and tsgo:core:test passes. Assertions are unchanged.

Refs karmaterminal/openclaw-bootstrap#1727

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations extensions: codex extensions: xai gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: team-reports rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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