Repository navigation
refactor(hooks): consolidate validated npm archive installs - #138267
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 9:07 AM ET / 13:07 UTC. ClawSweeper reviewWhat this changesThe PR inlines validated npm archive installation into its sole entry point, removes the obsolete adapter module and private runtime exports, and consolidates coverage. Merge readiness✅ Ready for maintainer review Keep open. No introduced correctness defect was found: the refactor preserves validation, packing, prerelease, integrity, result, and cleanup ordering while current main still retains the two adapter layers it removes. Priority: P3 Review scores
Verification
How this fits togetherHook installation validates a registry npm spec, packs it into a temporary archive, applies prerelease and integrity checks, then hands it to the hook installer. The resulting install outcome and resolution metadata feed hook installation or update after workspace cleanup. flowchart LR
A[Hook npm request] --> B[Registry spec validation]
B --> C[Pack temporary archive]
C --> D[Prerelease and integrity gates]
D --> E[Hook archive installer]
E --> F[Install result and metadata]
E --> G[Temporary workspace cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -93, Tests -61, Other -1. Total -155 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the single canonical validated archive-install flow once ordinary exact-head checks complete; retain the direct hook caller and its cleanup-order coverage. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors the existing archive-install path rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes. Moving the duplicated flow into its sole validated entry point leaves one canonical owner and removes unused runtime exports without changing the hook caller’s contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a220f55bbbe1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The hook npm installer still passed through two generic archive adapters left behind after plugin installation moved to its managed npm path. The extra layers duplicated result handling and exposed unused helpers through the plugin install runtime.
Why This Change Was Made
Move the archive flow into its sole validated entry point, remove the unused adapters and runtime exports, and consolidate their tests. The existing workspace owner still finishes cleanup before the caller receives decorated results. Domain failures retain their identity and codes, and successful results retain transaction symbols and npm resolution metadata.
User Impact
No intended behavior change. Hook installation and update retain registry validation, prerelease policy, integrity checks, dry-run behavior, rollback, and temporary-workspace cleanup. Plugin managed installation, public APIs, configuration, and persistent stores are unchanged.
Evidence
Native proof used synthetic packages, an isolated npm cache/config, and a local registry; no operator state or real credentials were used.