Skip to content

refactor(routing): trim private exports#105691

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/trim-routing-private-exports
Jul 12, 2026
Merged

refactor(routing): trim private exports#105691
vincentkoc merged 1 commit into
mainfrom
refactor/trim-routing-private-exports

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

The routing owner modules exposed nine symbols that had no consumers through their module boundaries. Those stale exports inflated the internal API surface and the dead-code baseline.

Why This Change Was Made

Keep six routing-only types private to their owner modules and remove three redundant forwarding exports. Canonical implementations and all runtime behavior remain unchanged.

User Impact

No user-visible behavior change. The internal routing surface is smaller, and the unused-export baseline drops by nine entries.

Evidence

  • Full codebase-memory graph audit: 305,916 nodes / 1,266,685 edges.
  • pnpm test:serial src/routing/channel-route-targets.test.ts src/routing/resolve-route.test.ts src/routing/session-key.test.ts src/routing/session-key.continuity.test.ts: 4 files, 158 tests passed on Testbox tbx_01kxc0dwjjeegpbgspyhbfcxxe.
  • node scripts/check-deadcode-exports.mjs: baseline matched 5,964 entries, down from 5,973.
  • pnpm check:changed -- scripts/deadcode-exports.baseline.mjs src/routing/binding-scope.ts src/routing/channel-route-targets.ts src/routing/resolve-route.ts src/routing/session-key.ts: passed on the same Testbox.
  • pnpm build: passed on the same Testbox, including the public plugin SDK declaration graph check.
  • Fresh gpt-5.6-sol medium autoreview: local clean at 0.94; branch clean at 0.98.

@vincentkoc vincentkoc self-assigned this Jul 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Jul 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 12, 2026 20:43
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 4:47 PM ET / 20:47 UTC.

Summary
The branch makes six routing-only types private, removes three redundant forwarding exports, and deletes nine matching entries from the dead-code export baseline.

PR surface: Source -4, Other -9. Total -13 across 5 files.

Reproducibility: not applicable. This PR addresses static unused-export surface rather than a user-facing runtime defect.

Review metrics: 1 noteworthy metric.

  • Internal export surface: 9 removed. Six owner-local types and three redundant forwards leave the public plugin SDK contract unchanged while reducing the dead-code baseline.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🌊 off-meta tidepool
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P2] No repair is needed; the clean maintainer-authored patch should proceed through ordinary review and merge gates.

Security
Cleared: The patch only removes TypeScript exports and baseline records, with no dependency, workflow, permission, credential, artifact-download, or code-execution change.

Review details

Best possible solution:

Merge the narrow cleanup after ordinary maintainer gates, keeping canonical account/session utilities and the public plugin SDK routing contract unchanged.

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

Not applicable; this PR addresses static unused-export surface rather than a user-facing runtime defect.

Is this the best way to solve the issue?

Yes. Directly privatizing owner-local types and removing redundant forwarding exports is the narrowest maintainable solution, while canonical implementations and supported plugin SDK exports remain unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c25cd32c287a.

Label changes

Label changes:

  • add P3: This is a small, low-risk internal maintenance cleanup with no intended runtime or user-visible behavior change.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.

Label justifications:

  • P3: This is a small, low-risk internal maintenance cleanup with no intended runtime or user-visible behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
Evidence reviewed

PR surface:

Source -4, Other -9. Total -13 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 6 10 -4
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 9 -9
Total 5 6 19 -13

What I checked:

  • Change remains necessary: Current main still exports all nine names and lists them in the unused-export baseline; the PR head removes those exports and baseline entries. (scripts/deadcode-exports.baseline.mjs:5226, c25cd32c287a)
  • Diff scope: The branch changes only TypeScript export modifiers, re-export lists, and the dead-code baseline; no runtime expression or function body changes. (src/routing/session-key.ts:15, 2fbeb7c02c6d)
  • Owner-local type use: The six privatized types are referenced only inside their defining routing modules on both current main and the PR head, so removing their export modifiers does not break repository callers. (src/routing/binding-scope.ts:9, 2fbeb7c02c6d)
  • Exact caller boundary: Callers of the four changed routing modules import other supported functions and types, not the nine removed names. (src/routing/resolve-route.ts:34, c25cd32c287a)
  • Public SDK preserved: The published plugin-sdk/routing surface exports supported routing functions and types but none of the removed names; DEFAULT_ACCOUNT_ID remains available through the canonical session-key/account-id path. (src/plugin-sdk/routing.ts:4, c25cd32c287a)
  • Validation supplied: The PR body reports 158 focused routing tests, the dead-code baseline check, changed-file checks, the full build, and the plugin SDK declaration graph all passing on Testbox tbx_01kxc0dwjjeegpbgspyhbfcxxe. (2fbeb7c02c6d)

Likely related people:

  • Peter Steinberger: Commit 5b7b2d0 owns the current versions of all four touched routing files, and earlier history connects him to multi-agent routing and session-key maintenance. (role: introduced current routing module split and earlier routing behavior; confidence: high; commits: 5b7b2d0fe0, dbfa316d19, 155915e7dc; files: src/routing/binding-scope.ts, src/routing/channel-route-targets.ts, src/routing/resolve-route.ts)
  • Tyler Yust: Commit b8f66c2 introduced nested-subagent orchestration behavior underlying getSubagentDepth, whose redundant routing forward is removed while the canonical implementation remains. (role: introduced adjacent nested-subagent depth behavior; confidence: medium; commits: b8f66c260d; files: src/sessions/session-key-utils.ts, src/routing/session-key.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for 2fbeb7c02c6d928fd864b87aae27d3f85368ca4a:

  • Exact-head CI: run 29208263093 passed.
  • Blacksmith Testbox: tbx_01kxc0dwjjeegpbgspyhbfcxxe, run 29207886619.
  • pnpm test:serial src/routing/channel-route-targets.test.ts src/routing/resolve-route.test.ts src/routing/session-key.test.ts src/routing/session-key.continuity.test.ts: 4 files, 158 tests passed.
  • node scripts/check-deadcode-exports.mjs: baseline reduced from 5,973 to 5,964.
  • Scoped pnpm check:changed -- <touched paths> passed.
  • Full pnpm build passed, including the public plugin SDK declaration graph.
  • Fresh gpt-5.6-sol medium autoreview passed twice: local review confidence 0.94; branch review confidence 0.98; no findings.
  • scripts/pr review-validate-artifacts 105691 passed and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 105691 prepared this exact SHA.

No known proof gaps. The patch changes export visibility and the matching baseline only; supported routing and plugin SDK surfaces remain intact.

@vincentkoc
vincentkoc merged commit e3163d1 into main Jul 12, 2026
177 of 180 checks passed
@vincentkoc
vincentkoc deleted the refactor/trim-routing-private-exports branch July 12, 2026 20:50
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant