Skip to content

refactor(plugins): share enablement mutation ownership - #140215

Merged
steipete merged 2 commits into
mainfrom
codex/plugin-toggle-owner
Sep 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/plugin-toggle-owner

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: L maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 15:26
@steipete steipete self-assigned this Sep 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 11:46 AM ET / 15:46 UTC.

ClawSweeper review

What this changes

Shares 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
Reviewed head: 244a5229fe5670de15640c0e80dc5c65d0aef1e5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused consolidation with meaningful contract coverage and no blocking finding; runtime validation is author-reported rather than independently executed here.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a maintainer-authored PR, so the external-contributor gate does not apply. The captured body reports isolated real CLI comparisons covering the shared mutation path; the follow-up changes no executable mutation behavior, and no material authority expansion was found.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a maintainer-authored PR, so the external-contributor gate does not apply. The captured body reports isolated real CLI comparisons covering the shared mutation path; the follow-up changes no executable mutation behavior, and no material authority expansion was found.
Evidence reviewed 10 items Introduced implementation: The complete local merge-base comparison preserves caller-specific normalization, policy-before-consent for CLI, management allowlist admission, canonical-entry writes, and warning ordering.
Current-main necessity: The two mutation implementation files on fetched main match the pre-PR merge-base versions; the shared mutation owner is still branch work.
Latest-release comparison: The supplied latest release, v2026.9.2, still implements CLI enablement separately, including its restrictive policy check and explicit consent handling.
Findings None None.
Security None None.

How this fits together

Plugin 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -32, Tests +157, Other -1. Total +124 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 130 162 -32
Tests 2 235 78 +157
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 6 365 241 +124

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a bounded internal consolidation intended to preserve existing operator behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies a maintainer-authored PR, so the external-contributor gate does not apply. The captured body reports isolated real CLI comparisons covering the shared mutation path; the follow-up changes no executable mutation behavior, and no material authority expansion was found.

Evidence

What I checked:

  • Introduced implementation: The complete local merge-base comparison preserves caller-specific normalization, policy-before-consent for CLI, management allowlist admission, canonical-entry writes, and warning ordering. (src/plugins/management-mutations.ts:383, 244a5229fe56)
  • Current-main necessity: The two mutation implementation files on fetched main match the pre-PR merge-base versions; the shared mutation owner is still branch work. (src/plugins/management-mutations.ts, ba3c15a03d64)
  • Latest-release comparison: The supplied latest release, v2026.9.2, still implements CLI enablement separately, including its restrictive policy check and explicit consent handling. (src/cli/plugins-cli.runtime.ts:185, 3928bad9badf)
  • Re-review continuity: The earlier completed review retained no findings or rank-up moves. The subsequent commit only removes the unused CLI barrel and redirects retained tests to the unchanged implementation. (src/cli/plugins-config.test.ts:3, 244a5229fe56)
  • Behavioral coverage: Read the complete changed policy suite: it checks refused requests leave config and consent records unchanged, explicit consent for already-enabled installations, alias preservation, missing IDs, Nix rejection, slot selection, and absence of hosted-catalog requests. Tests were inspected, not executed. (src/cli/plugins-cli.policy.test.ts:296, 244a5229fe56)
  • Lease and consent contracts: Nested lifecycle calls reuse the active lease after ownership validation. The existing consent owner rereads the installed artifact after an interactive callback and checks the review token before persisting acceptance; this refactor retains that owner. (src/plugins/plugin-lifecycle-lease.ts:49, 244a5229fe56)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • PollyBot13: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-06T15:32:22.249Z sha b335346 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 3b90108 into main Sep 6, 2026
179 checks passed
@steipete
steipete deleted the codex/plugin-toggle-owner branch September 6, 2026 16:10
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
* refactor(plugins): share enablement mutation ownership

* refactor(plugins): remove unused CLI config re-export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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: L 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