Repository navigation
fix: capture namespace SDK imports in published plugins - #104
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs changes before merge. What this changesThis PR discovers static SDK namespace members and supplies doctor descriptor mocks for published plugin capture. Example: Capture the published @openclaw/feishu@2026.9.9 package.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR fixes a concrete capture failure still present on main; no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherOffline runtime capture scans plugin imports, generates temporary SDK mocks, and imports plugin entrypoints to record registrations. flowchart LR
A[Published plugin source] --> B[Runtime import collector]
B --> C[Generated SDK mocks]
C --> D[Capture subprocess]
A --> D
D --> E[Registration report]
Technical reviewBest possible solution: Land the focused collector and descriptor repair after completing the repository-required consumer validation. Do we have a high-confidence way to reproduce the issue? Main's source establishes the missing namespace exports; the author also reports a base-failing, head-passing run against published Feishu, which this read-only review did not execute. Is this the best way to solve the issue? Reusing the existing binding analysis and modeling public descriptors fixes the capture owner without changing plugins or pretending to execute migrations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d0cfd5ef980e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 14, 2026, 2:41 AM ET / 06:41 UTC. |
|
Completed the remaining Before merge item at unchanged head AWS consumer run Source-ref adoption is coordinated with the Crabpot execution owner for post-merge exact qualification. Its published package pin remains unchanged. No package was published, release created, or tag pushed. The PR body contains the evidence and scope limits; no code changed after review. |
What Problem This Solves
Fixes capture failures when published plugins access SDK helpers through namespace imports or compiled doctor-contract re-exports. The observed Feishu capture failure reports a missing mock function although the public host exports it.
User Impact
Offline capture can inspect these published plugin descriptors. Actual doctor migration execution remains explicitly unsupported by the mock and raises an error.
Why This Change Was Made
Reuse the existing parser and scope analysis for static namespace members, preserving closures, shadowed bindings and type-only imports. Supply the verified public doctor-builder exports and descriptor shapes required by namespace enumeration; avoid inferring arbitrary bundler data flow or changing plugins.
Contracts checked directly: OpenClaw v2026.9.9
src/plugin-sdk/runtime-doctor-migrations.ts,src/config/channel-alias-migration.ts, and the published@openclaw/feishu@2026.9.9doctor bundle (provenance2b988ee83444f08ccaf37aa5e98f370726c75f6e). No dependency, package-version or release changes. Production delta: +38 lines, justified by namespace discovery and the public descriptor contract; regression tests: +82 lines.Evidence
ece61ce8212dd18cfb2a8f40a22993a0ae7f65b8: Node 22 CI passes all 577 tests, package contents, 12 retained-import contracts, and 7 Bun import tests. CodeQL passes.run_d28fc7531eed, leasecbx_7458f538731d, Node 24.19.0: downloaded the actual published Feishu 2026.9.9 tarball, verified npm SHA-512 integrity and the provenance subject/source SHA above, then compared based0cfd5ewith this exact head. The actualdist/.setup/doctor-contract-3XC0vbIw.mjsfails on base becausedefineChannelAliasMigrationis not a function; it imports successfully with this fix. The actualdist/index.jscaptures one channel, two hooks, and 14 tool registrations. Exit 0; mock SDK temporary-directory cleanup passes; plugin execution has no credentials. This proves import/registration capture, not doctor normalization or live Feishu API behavior.run_30e53a34d424, Node 24.19.0: frozen consumer82f2c52781b7869bd638133e9c79fa90cec4f959, controlled published Feishu 2026.9.9 fixture with its unchanged channel/tool expectations, and both this exact source CLI and an unpublished npm-packed/install CLI. All 61 installed package files equal candidate source bytes. Both--check --runtime --resourcesruns report one fixture and zero breakages, preserve the intentional Gateway rejection (one passing and one intentionally failing runtime probe), and pass resource collector checks. Source and packed static reports are identical. Exit 0; lease released. This is scoped consumer smoke, not full fixture qualification or a resource workload.Related: openclaw/crabpot#449