Repository navigation
refactor(plugins): extract ClawHub plugin archives once - #156246
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 2:03 AM ET / 06:03 UTC. ClawSweeper reviewWhat this changesClawHub plugin installs reuse one archive extraction for file verification and installation, preserving typed failures and cleanup. Merge readiness✅ Ready for maintainer review Keep open: this useful consolidation is absent from current main and the latest release. No blocking correctness or security defect was found in the introduced changes. Priority: P3 Review scores
Verification
How this fits togetherThe plugin installer receives downloaded archives and registry integrity metadata. It verifies the archive, selects the package, and passes approved contents to the existing installation and publication machinery. flowchart TD
A[Downloaded archive and registry metadata] --> B[ZIP metadata preflight]
B --> C[Single bounded extraction]
C --> D[Verify complete file inventory and hashes]
D -->|Rejected| E[Typed failure and cleanup]
D -->|Verified| F[Select package root]
F --> G[Existing policy and publication guards]
G --> H[Installed plugin and cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -51, Tests +178, Other 0. Total +127 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one bounded extraction owner, with complete archive verification before package selection and existing guarded publication. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: source inspection confirms the redundant decompression on current main, and the PR reports direct filesystem validation of its replacement. Is this the best way to solve the issue? Yes. Reusing the existing extraction workspace removes duplicate ownership while retaining complete-inventory verification and downstream installation guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f50ce061649. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Corrected-head CI 35826268422 passed on Measured CI test cost:
The original CI failure, owner-routing correction, and local focused proof remain recorded in the PR body. |
|
Merged via squash auto-merge.
|
* commit '3ab93b4ea59804b34d02a696382db16dc95189bb': (80 commits) fix(gateway): keep session refreshes moving during unrelated writes (openclaw#156286) chore(deps): update fs-safe to 0.18.2 (openclaw#156262) refactor(plugins): extract ClawHub plugin archives once (openclaw#156246) improve(llm-core): avoid unnecessary tool validation sets (openclaw#152066) fix(backup): verification accepts archives missing captured databases (openclaw#156211) fix: cancel Guest work when its original access is revoked (openclaw#156106) fix(test): classify drained legacy migration refusals fix(anthropic): finish Opus 5.5 defaults and thinking display (openclaw#156093) refactor(agents): share native harness tool execution (openclaw#154217) fix(ui): carry typed ownership through short-route resolution test(worktrees): accept additive gc result fields (openclaw#156127) test(tasks): close sqlite borrowers before registry reload (openclaw#156131) chore(autoreview): sync Astra high defaults (openclaw#156175) refactor(node-host): await prepared workspace storage (openclaw#149519) improve: speed up cold Node test planning (openclaw#156234) fix(doctor): avoid slow legacy ownership repair in source checkouts (openclaw#156238) improve: speed up native build artifact validation (openclaw#156219) fix(ui): preserve short-route resolution ownership fix(doctor): name retained session metadata conflicts (openclaw#156162) perf(tasks): bound creation selection to matching runs (openclaw#156183) ...
Related: #154370
What Problem This Solves
ClawHub plugin archives without a whole-archive hash are currently decompressed for file verification and then extracted again for installation.
User Impact
These installs now extract once and verify the complete extraction before selecting a package root or starting installation. Integrity refusals, archive limits, transaction authority, cleanup, and existing plugin configuration remain enforced.
Why This Change Was Made
The existing installer owns extraction and its temporary workspace. ClawHub keeps a metadata-only ZIP preflight and supplies verification of the resulting files to that owner. The preflight inventory remains authoritative for entries that extraction cannot materialize, so unsupported records cannot disappear from integrity verification. Hashing uses the existing bounded file-digest owner and fs-safe handles instead of a second custom ZIP stream implementation.
The verification hook runs before package-root selection can hide sibling files. Typed ClawHub failures pass back through the installer, and success events are emitted only for successful installs. Filesystem access and directory walking use OpenClaw's existing policy owners. This removes 48 production lines; no dependency, configuration, or stored-format change is included.
Evidence
./extra.txtand repeated separators. The unsupported-record comparison proves refusal after real extraction; the final source-install step is mocked in that specific case.node scripts/run-vitest.mjs src/plugins/clawhub.test.ts src/infra/install-flow.test.ts src/plugins/install.work-deadline.test.ts --maxWorkers=1 --reporter=dot: 113 tests passed in 172.37 seconds wall time, including 79.385 seconds of worker preparation.git diff --checkpassed, and retired helpers have no remaining references.NoInferadjustment and equivalent property access. The assertion-safety baseline shrinks exactly from 10 to 7.~/entries remain an existing fs-safe 0.18.1 extraction limitation in both native modes; this change adds no policy exception.