Repository navigation
refactor(plugins): share enablement mutation ownership - #140215
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 6, 2026, 11:46 AM ET / 15:46 UTC. ClawSweeper reviewWhat this changesShares plugin enable/disable persistence between the CLI and plugin management while preserving their existing policy, consent, settings, and output behavior. Merge readiness✅ Ready for maintainer review Keep open: this useful, maintainer-owned refactor remains distinct from current main and the broader draft. No actionable introduced defect was found, including in the follow-up removing the unused re-export. Priority: P3 Review scores
Verification
How this fits togetherPlugin management receives operator enable/disable requests from the CLI and Gateway management interface. It checks policy and capability consent, saves configuration, and refreshes the plugin inventory used by subsequent operations. flowchart TD
A[CLI request] --> C[Shared mutation owner]
B[Management request] --> C
C --> D[Caller-specific policy and consent]
D --> E[Save settings and slot selection]
E --> F[Refresh plugin inventory]
F --> G[Terminal result or management catalog]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -32, Tests +157, Other -1. Total +124 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Maintain one leased persistence flow with explicit caller policies, keeping terminal presentation and hosted catalog projection in their adapters. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing behavior, and source review found no introduced failure to reproduce. Is this the best way to solve the issue? Yes: reusing the existing mutation owner removes duplication while explicitly retaining the CLI and management contracts; the deleted barrel has no remaining production consumer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ba3c15a03d64. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* refactor(plugins): share enablement mutation ownership * refactor(plugins): remove unused CLI config re-export
CLI enable/disable and plugin management duplicated config, consent, slot and registry mutations. Share one leased mutation owner and leave terminal output and hosted catalog projection in their respective adapters.
Preserve each caller’s existing contract: restrictive CLI allowlists and policy-before-consent ordering; admin allowlist admission and consent-first ordering; explicit CLI review of already-enabled plugins; distinct ID normalization; original include/hash and canonical-entry write handling; slot lookup, warning order, Nix checks and output before the lease’s final ownership check. Commands retain their existing restart guidance.
Validation: 95 focused tests passed, along with the complete changed-code gate and an independent P0–P2 review. The policy tests now use real metadata, enablement and slot owners instead of asserting mocked helper calls. Eight real CLI scenarios (27 commands plus the canonical build) matched the pinned-main baseline’s semantics and output: consent, global/deny/allow blocks, include writes/rejections and alias settings. Proof used synthetic local packages and isolated state. Cold index refreshes were recorded separately from config and capability-acceptance writes.
Production LOC: 130 added, 162 removed, net −32. Tests: +157. The assertion baseline shrinks by one obsolete entry. Part of the smaller refactors extracted from #135599.
CI found the CLI config re-export had become production-dead after the shared owner removed its last runtime caller. The follow-up deletes that three-line barrel and imports the unchanged implementation directly in all seven retained config tests. Both production/full-tree unused-file scans and independent review pass; the earlier real CLI proof remains applicable because executable mutation code is unchanged.