Skip to content

fix: remove stale private plugin declarations - #183086

Merged
shakkernerd merged 1 commit into
mainfrom
fix/extension-private-declarations-310
Oct 25, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/extension-private-declarations-310

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

The dead-code CI gate reports eight declarations from bundled plugins even though six are module-private implementation details and two have no callers. Those stale export edges and dead aliases block the analyzer from reaching a clean result and make the supported plugin boundaries less clear.

User Impact

There is no user-visible runtime change. Plugin behavior, package entrypoints, public SDK/API surfaces, configuration, and persisted data remain unchanged; maintainers get a more accurate dead-code signal for these private modules.

Why This Change Was Made

Bundled plugin source helpers are private unless they are intentionally promoted through the plugin's API surface. Complete caller and package-boundary inspection found that six reported declarations are used only inside their defining module, so this change removes only their export modifiers. It also deletes the zero-caller GitHub item-target wrapper and Zalouser block-span type while retaining every live body, constituent type, caller, and canonical parsing path.

The patch is deliberately mechanical: seven source files, no new abstractions or compatibility paths, and no test, package, dependency, configuration, database, or documentation changes.

Evidence

Remote checks on the exact candidate tree 06dda93e641507bfe4c7ae76ffa65d2fe3045290 established:

  • changed-file formatting and selected extension lint passed with zero warnings or errors;
  • the affected extension, extension-test, script, and root-test type graphs passed;
  • eight direct-importing test files passed 128 assertions across GitHub, Feishu, and visitor-access owners; and
  • the repository's dead-export aggregate still reported independent residual groups, while none of the eight declarations changed here remained in its output.

The published head still requires the normal hosted CI, exact-head automated review, and independent engineering review before landing.

@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.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram channel: zalouser Channel integration: zalouser channel: feishu Channel integration: feishu extensions: openai plugin: visitor-access extensions: github GitHub plugin: link previews and reader channel: x size: XS labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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 six plugin declarations module-private and deletes two unused declarations.

Example: The dead-export analyzer examines extensions/github/src/targets.ts.

  • Before: parseGitHubItemTarget is exported despite having no callers.
  • After: The unused wrapper is removed while callers continue using parseGitHubTarget.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-verifiable cleanup supported by matching candidate-tree validation and successful exact-head checks.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored mechanical cleanup is outside the ordinary contributor proof gate; caller and barrel inspection confirm no changed runtime scenario or authority boundary.
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 aligns with the documented private-plugin boundary and improves dead-export signal without adding machinery or changing behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR removes unused private declarations without changing supported APIs or runtime behavior; no actionable defects were found.

Priority: P3
Reviewed head: 52515f5f4e89027f22b18de2c49e18f5a1adaf96

Before merge

None.

Findings

None.

Agent review details

How this fits together

These bundled-plugin modules handle message parsing, GitHub targets, voice authentication, Telegram resource retirement, visitor records, OAuth, and Markdown styles; their existing runtime inputs and outputs remain unchanged.

flowchart LR
  A[Plugin entry points] --> B[Public plugin barrels]
  B --> C[Plugin implementation modules]
  C --> D[Module private helpers and types]
  E[Dead export analyzer] --> C
  C --> F[Existing runtime behavior]
Loading

Technical review

Best possible solution:

Land the existing mechanical cleanup while preserving the current public barrels and runtime implementations.

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

Source inspection confirms the unused export edges and zero-caller declarations; the analyzer was not executed during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete fix: retain module-local implementations, remove their unnecessary exports, and delete the two unused declarations.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • GitHub target declarations keeps the original intent (a46de01: The GitHub reader introduced plugin-owned target parsing; its current public barrel exposes the canonical parsers rather than the unused item-only wrapper.)
  • Feishu mention helper keeps the original intent (b86bc9d: The recorded refactor split monitor runtime helpers; this patch retains mention detection and its local caller.)
  • OpenAI realtime error constant keeps the original intent (dac940b: The realtime voice refactor separated session policy while preserving the public provider facade; the constant's value and use remain intact.)
  • Telegram throttler retirement helper keeps the original intent (b2918fe: Token retirement releases unused throttlers while preserving shared-token state; all three local retirement paths remain unchanged.)
  • Visitor onboarding state alias keeps the original intent (4a0d0f2: Invitation metadata added onboarding progress to existing grant records; making the constituent alias private preserves its shape and storage behavior.)
  • X refresh claim type keeps the original intent (6a4ac84: Provider-owned refresh evidence supports safe credential recovery; the claim type, callbacks, and runtime authority checks remain unchanged.)
  • Zalouser block-span alias keeps the original intent (f749481: The renderer derives metadata types from the canonical parser; deleting an unused derived alias retains that ownership.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Introduced patch: The pinned introduction diff contains only six export-modifier removals and deletion of parseGitHubItemTarget and the unused Zalouser MarkdownBlockSpan alias; retained function bodies and type shapes are unchanged. (52515f5f4e89)
  • Private implementation boundary: The extensions guide explicitly makes local helpers private unless promoted through api.ts; repository-wide symbol searches and inspected public barrels found no affected public re-export or external caller. (extensions/AGENTS.md, 52515f5f4e89)
  • Current main still contains the declarations: REST reads of all seven files at fetched main confirmed that the eight declarations remain exported there. An unavailable local promisor blob prevented one local main comparison; pinned GitHub source reads supplied the relevant current-main evidence. (extensions/github/src/targets.ts:132, 31bbd0fbc4d9)
  • Validation identity and hosted checks: HEAD's tree is 06dda93e641507bfe4c7ae76ffa65d2fe3045290, matching the candidate tree in the PR body. Paginated exact-head check results contained no failed or pending runs, including successful production/test typechecks, lint, and affected extension checks. (52515f5f4e89)
  • Original intent preserved: The GitHub reader introduction placed transport and mapping inside the plugin, and the Zalo metadata refactor preserved parser-owned types and rendering behavior; this cleanup preserves both decisions. Sources: feat: read GitHub issues, pull requests, and commits beside chat #148464 and refactor(markdown): derive Zalo parser metadata from its owner #175880. (extensions/zalouser/src/text-styles-shared.ts:4, f749481b6a38)

Likely related people:

  • Peter Steinberger: Raw commit f749481 adds extensions/zalouser/src/text-styles-shared.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f749481b6a38; files: extensions/zalouser/src/text-styles-shared.ts)
  • Shakker: Raw commit 19d311e adds extensions/github/src/targets.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 19d311e00246; files: extensions/github/src/targets.ts)
  • Peter Lee: Raw commit b2918fe adds extensions/telegram/src/account-throttler-lifecycle.ts:56 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b2918fe90753; files: extensions/telegram/src/account-throttler-lifecycle.ts)
  • RoboClaw: Raw commit 4a0d0f2 adds extensions/visitor-access/src/grant-record.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4a0d0f2f1d36; files: extensions/visitor-access/src/grant-record.ts)

PR surface

Source -6. Total -6 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 6 12 -6
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 6 12 -6

Labels

Label changes:

  • add P3: This is low-risk private-declaration cleanup with no user-facing runtime 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 private-declaration cleanup with no user-facing runtime 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, 9:23 PM ET / October 25, 2026, 01:23 UTC.

@shakkernerd
shakkernerd merged commit 09f9ec8 into main Oct 25, 2026
130 checks passed
@shakkernerd
shakkernerd deleted the fix/extension-private-declarations-310 branch October 25, 2026 01:28
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Simplified: removed stale private plugin declarations while preserving runtime behavior and public plugin surfaces.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
Removes stale plugin-private export edges and two dead declarations while preserving runtime behavior and public plugin surfaces.
RomneyDa added a commit that referenced this pull request Oct 29, 2026
Telegram hunk of 09f9ec8 (#183086) only. The release-only test
called the private helper directly; its surviving-alias case is already
asserted through releaseRemovedTelegramAccountThrottler, so drop the
duplicate direct call.

(cherry picked from commit 09f9ec8, partial)
RomneyDa added a commit that referenced this pull request Oct 29, 2026
…eadcode after backports (#187570)

* refactor: keep Teams allowlist sentinel private (#185484)

The Microsoft Teams fail-closed allowlist sentinel now remains module-private while preserving its exact restrictive projection and lifecycle coverage.

(cherry picked from commit 59b1ddd)

* test: teach the live-wrapper fake Bun to answer --revision

Partial cherry-pick of the test/scripts/test-live.test.ts hunk only.
#173807 (backported as e72f868) made the CI Bun --revision probe
mandatory; the fake Bun fixture must answer it from the checkout pin.

(cherry picked from commit 08dd80a)

* test(ci): expect watchdog exit 124 from wedged run-tsgo

#184639 (backported as d9a91b5) intentionally changed the run-tsgo
watchdog exit from 1 to 124 so CI collectors stop admitting work. Main
realigned this case in run-tsgo-worktree.test.ts (9b14a38); on the
release branch the same watchdog case lives in run-tsgo.test.ts and was
not realigned by the backport.

* test(vitest): keep gateway database-worker routes in canonical order

The beta.5 adaptation of #178415 (23a2bcd) prepended three
integration proofs to gatewayDatabaseWorkerTestFiles. Canonical project
ownership compares that list against sorted discovery, so the
out-of-order entries failed vitest-cli-ownership. Move them to their
sorted positions; routing membership is unchanged.

* refactor: keep Slack reconnect policy private (#181690)

Keeps Slack reconnect policy details module-private while preserving the exact invalid-auth cutoff, reset, and blocked-status behavior.

(cherry picked from commit cd65901)

* fix: keep retired Telegram throttler release private

Telegram hunk of 09f9ec8 (#183086) only. The release-only test
called the private helper directly; its surviving-alias case is already
asserted through releaseRemovedTelegramAccountThrottler, so drop the
duplicate direct call.

(cherry picked from commit 09f9ec8, partial)

* refactor: keep Claude partial-message measurement private

src/agents/cli-output-stream-limits.ts hunk of 28e2774 (#184686) only;
the backport of #184352 left this export without a consumer.

(cherry picked from commit 28e2774, partial)

* refactor: keep managed plugin cache selector private

src/plugins/management-catalog.ts hunk of 2c0c30b (#185269) only;
the backport of #184921 left this export without a consumer.

(cherry picked from commit 2c0c30b, partial)

* refactor(agents): keep requester settle batch callbacks type private

The backport of #181260 (2f7589a) moved RequesterSettleWakeParams
into the state module, leaving RequesterSettleWakeBatchCallbacks exported
only for a test fixture. Main keeps it module-private; type the fixture
through RequesterSettleWakeParams instead.

* refactor(infra): drop unconsumed streaming UTF-8 decoder

The minimal backport of #180861 (8d3183d) added decodeUtf8Chunks as
a prerequisite, but its main consumers (streaming state-migration
importers) were intentionally not backported, so production Knip flags
it. Remove the export and its unit case; decodeUtf8Input is unchanged.

* refactor(scripts): keep pinned Bun CI detection private

The minimal #172625 backport (e6c3639) deferred the dev-tool,
test-runtime and run-format callers that consume isCiEnvironment on main,
so the export has no consumer on the release branch.

* test(update): drop orphaned recovery version-mismatch fixture

The #185692 backport in 39f9bde removed the last consumer of
recoveryVersionMismatch from update-cli.plugin-convergence.test.ts. Main
removed the same fixture in eae9bc4 (#181717).

* test(gateway): type config removal mocks through inline module imports

The release adaptation of #152052 (41aa7a6, de41770) typed its
partial mocks through type-only namespace imports. Knip treats the
secrets runtime namespace as the only consumer of its exports, so the
full-tree scan reported prepareSecretsRuntimeSnapshotRestore and
SecretResolverWarning as unused. Use main's inline typeof import() form.

* refactor(shared): drop unconsumed async-store helper

The backport of #179213 (6d9852d, plus f3fb0e9 registering it
as a wrapper component) took the runWithAsyncStore helper and its test
without the plugin-instance-invocation consumer, leaving
src/shared/async-store.ts unused in production. Remove the helper, its
test and its wrapper-components entry rather than complete a perf change
during beta stabilization.

* chore(knip): model backported perf scripts and Telegram worker fixture

Mirror main's Knip entries for files added by beta.5 backports:
- scripts/perf/{node-event-session-source-measure.mjs,
  stream-dispatch-scope-measure.ts,system-prompt-report-retention.ts}
  as path-invoked script roots (#183931, #183552, #183010);
- the Telegram ingress context Worker fixture loaded by URL (#178909) in
  production ignoreFiles.
Also register scripts/test-security-mail-parser.mjs, the standalone
nodemailer sender-parsing regression added by #187301 (release-only).

* refactor(doctor): keep dashboard migration guard at the repair boundary

Release adaptation of 50b532d (#183153). The backport of #182345
(51f63cb) exported isUnstampedDashboardRoot only for its unit test.
Main made it private and drove the eligibility cases through
repairLegacyDashboardChatTypes using a canonical-repair fixture this
branch does not carry. Keep every accepted and rejected row case, now
asserted through the repair boundary with the branch's session accessor.

* test(agents): hold requester preparation for the settle capacity case after #181260 backport

Backport 2f7589a (#181260) filters delivered child findings from
settle wakes (needsRequesterSettleFindings), so this delivered-row case
no longer reads the child transcript where it injected worker capacity
and failed with 'expected findTranscriptEvent to be called'. Main
realigned the same case in 411b2e6 (#178104): inject capacity at
captureRequesterSessionEntryCurrent and assert the delivered result is
not repeated in the resumed wake. Apply that realignment; the
'Already delivered child results' wording that main also asserts belongs
to #178104's message change, which this branch does not carry.

(adapted from commit 411b2e6)

---------

Co-authored-by: Shakker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: telegram Channel integration: telegram channel: x channel: zalouser Channel integration: zalouser extensions: github GitHub plugin: link previews and reader extensions: openai P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: visitor-access rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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