Skip to content

refactor(qqbot): localize internal declarations#102048

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/deadcode-all-surfaces-20260708-v87
Jul 8, 2026
Merged

refactor(qqbot): localize internal declarations#102048
vincentkoc merged 1 commit into
mainfrom
refactor/deadcode-all-surfaces-20260708-v87

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 8, 2026

Copy link
Copy Markdown
Member

What Problem This Solves

QQBot still exported nine declaration-only implementation types that have no consumers outside their defining modules. That unnecessarily widens the plugin's internal TypeScript surface.

Why This Change Was Made

Repository-wide search and the refreshed codebase-memory graph found no external consumers. QQBot's public API exports the intentional account/config contracts and callable functions, not these helper declarations, so they can remain module-local without changing runtime behavior or structural signatures.

User Impact

None. This is a dead-export cleanup; QQBot runtime behavior and public entrypoints are unchanged.

Evidence

  • Changed gates passed on Testbox tbx_01kx04ehb2dsm7mh9v56x13s7x
  • Six directly touched QQBot test files: 67 tests passed
  • Broad QQBot suite: 73 files and 669 tests passed; one unrelated existing failure in engine/approval/index.test.ts
  • The same approval test fails with the six PR files restored from exact base 8cbcc41ccbb93f9143f58c86b39b0c35c20fa504, proving it is present on current main
  • pnpm build: passed, including declaration generation and plugin SDK export checks
  • fresh post-rebase branch autoreview: clean, confidence 0.85
  • git diff --check: passed

@vincentkoc vincentkoc self-assigned this Jul 8, 2026
@vincentkoc
vincentkoc force-pushed the refactor/deadcode-all-surfaces-20260708-v87 branch from 7065e15 to c1bfb9c Compare July 8, 2026 05:50
@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 1:56 AM ET / 05:56 UTC.

Summary
The branch removes export from nine declaration-only QQBot helper types across private QQBot engine/config modules.

PR surface: Source 0. Total 0 across 6 files.

Reproducibility: not applicable. this is a declaration-surface cleanup, not a bug report. Current-main source shows the exports still exist, and the PR removes only export modifiers from private QQBot helper declarations.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed: this maintainer draft has no concrete defect from review, so normal maintainer readiness and landing checks should own the next step.

Security
Cleared: No security or supply-chain concern found; the diff only changes TypeScript export modifiers in QQBot source files.

Review details

Best possible solution:

Keep only the intentionally promoted QQBot API/runtime exports public, and land this cleanup after normal draft readiness and exact-head declaration/build checks remain green.

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

Not applicable: this is a declaration-surface cleanup, not a bug report. Current-main source shows the exports still exist, and the PR removes only export modifiers from private QQBot helper declarations.

Is this the best way to solve the issue?

Yes: localizing helper declarations in private QQBot src/** modules matches the extension boundary while leaving top-level QQBot API exports intact.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P3: This is a low-risk internal declaration-surface cleanup with no runtime 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. Not applicable: Maintainer-authored internal cleanup; the external contributor real-behavior proof gate does not apply, and the PR body reports Testbox/build validation.

Label justifications:

  • P3: This is a low-risk internal declaration-surface cleanup with no runtime 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. Not applicable: Maintainer-authored internal cleanup; the external contributor real-behavior proof gate does not apply, and the PR body reports Testbox/build validation.
Evidence reviewed

PR surface:

Source 0. Total 0 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 6 9 9 0
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 6 9 9 0

What I checked:

  • Repository policy applied: Root review policy requires full-code-path review, and the extensions policy treats plugin src/** helpers as private unless promoted through top-level API surfaces. (extensions/AGENTS.md:42, 8cbcc41ccbb9)
  • Public QQBot API stays explicit: The promoted QQBot API exports selected config/account/runtime types from src/types.js; QQBotGroupConfig and the other localized helper declarations are not listed there. (extensions/qqbot/api.ts:9, 8cbcc41ccbb9)
  • Runtime API stays explicit: The runtime API exports only ResolvedQQBotAccount and QQBotAccountConfig from src/types.js, so this patch does not remove a named runtime API export. (extensions/qqbot/runtime-api.ts:9, 8cbcc41ccbb9)
  • No external consumers found: Repository search found the localized declarations only at their definitions and same-module type positions, while callers import exported functions or the still-exported MentionGatePort/GatewayCfgLoader contracts. (8cbcc41ccbb9)
  • Caller surface checked: The group gate consumes MentionGatePort and classifyCoreCommandForGroup rather than importing the helper declaration types that this PR localizes. (extensions/qqbot/src/engine/gateway/stages/group-gate-stage.ts:139, 8cbcc41ccbb9)
  • PR validation evidence: The PR body reports Testbox changed gates, touched QQBot tests, broad QQBot suite coverage with an unrelated baseline failure, pnpm build, autoreview, and git diff --check passing. (c1bfb9caeeb0)

Likely related people:

  • vincentkoc: Authored this maintainer draft and multiple merged sibling declaration-localization cleanups across other plugin surfaces, making them the best routing candidate for consistency of this cleanup series. (role: recent adjacent cleanup owner; confidence: medium; commits: c1bfb9caeeb0, 401926c7b119, cf3950ca633a; files: extensions/qqbot/src/types.ts, extensions/qqbot/src/engine/adapter/mention-gate.port.ts)
  • vishal-dharm: Local blame for the affected QQBot declaration lines in this shallow checkout points to d708df4. (role: current checked-out line provenance; confidence: low; commits: d708df47a319; files: extensions/qqbot/src/types.ts, extensions/qqbot/src/engine/adapter/mention-gate.port.ts, extensions/qqbot/src/engine/gateway/active-cfg.ts)
  • ly-wang19: Recent merged QQBot markdown chunking fixes touch one of the same implementation areas, though this PR changes only that module's local return helper type. (role: recent adjacent contributor; confidence: low; commits: d1cf63cae0f4; files: extensions/qqbot/src/engine/messaging/markdown-table-chunking.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.

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 8, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for c1bfb9caeeb0743678938fca987a6bbdcf961188:

  • Testbox tbx_01kx04ehb2dsm7mh9v56x13s7x / Actions run https://github.com/openclaw/openclaw/actions/runs/28920740560
  • changed gates passed
  • six directly touched QQBot test files: 67 tests passed
  • broad QQBot suite: 73 files and 669 tests passed; one existing failure remains in extensions/qqbot/src/engine/approval/index.test.ts
  • the same approval assertion fails after restoring all six PR files from exact base 8cbcc41ccbb93f9143f58c86b39b0c35c20fa504, confirming it is unrelated to this patch
  • full pnpm build passed, including declaration generation and plugin SDK export checks
  • fresh post-rebase branch autoreview: no findings, confidence 0.85
  • git diff --check passed
  • repo-native review artifacts and scripts/pr prepare-run 102048 passed

@vincentkoc
vincentkoc marked this pull request as ready for review July 8, 2026 06:01
@vincentkoc
vincentkoc merged commit 6f6c3e2 into main Jul 8, 2026
116 of 120 checks passed
@vincentkoc
vincentkoc deleted the refactor/deadcode-all-surfaces-20260708-v87 branch July 8, 2026 06:01
@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

channel: qqbot maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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