Skip to content

refactor(plugins): bind registration owners once - #139898

Merged
steipete merged 1 commit into
mainfrom
codex/plugin-registrar-bindings
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/plugin-registrar-bindings

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin API construction repeats the same record binding across dozens of registration methods, and the registry builder duplicates the composed registrar list.

Why This Change Was Made

Bind the leading plugin record once and return the existing composed registrars directly. Keep explicit adapters where configuration, policy, registration mode, or generic hook types require them. The API builder still selects the public methods.

User Impact

No public API or lifecycle changes. Receivers, diagnostics, rollback and registration-mode behavior are preserved. This independent extraction from #135599 removes 157 production lines across two files.

Evidence

391 existing loader, registry, setup, provider, service, diagnostic and API-lifecycle tests passed. The complete changed-file gate passed, including production/test typechecks, lint, dead-export scans and other routed guards. Independent P2 review found no actionable issues. No tests were added merely to mirror the refactor.

@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 size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 07:35
@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, 3:39 AM ET / 07:39 UTC.

ClawSweeper review

What this changes

The PR centralizes plugin-owner binding for registration methods while retaining explicit configuration, policy, and registration-mode adapters.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, maintainer-led extraction that is not superseded on the fetched main. Source review found no actionable correctness or security regression.

Priority: P3
Reviewed head: e79e806689d655f1dfeb333ee8f5352fec540eb6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable refactor with preserved public selection and policy adapters and no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied member-authored classification exempts this internal refactor from the external-contributor proof gate; it changes registration forwarding without materially changing authority. Reported tests are supplemental, and the aggregate PR's live evidence is not attributed to this head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied member-authored classification exempts this internal refactor from the external-contributor proof gate; it changes registration forwarding without materially changing authority. Reported tests are supplemental, and the aggregate PR's live evidence is not attributed to this head.
Evidence reviewed 7 items Introduced scope and current-main comparison: The pinned introduced delta changes only registry-api.ts and registry.ts. Comparing the merge base with fetched main produced no changes for either file, so the refactor remains absent from that main snapshot.
Public methods remain explicitly selected: The complete API builder reads named handlers individually rather than spreading the supplied handlers into the public API. Internal registrar names therefore do not become additional plugin methods.
Owner and policy arguments preserved: The binding prepends the same captured record. Explicit adapters retain hook configuration, node policy configuration, context-engine registration mode, middleware policy, generic typed-hook policy, and channel runtime selection. The referenced registrar implementations retain their validation and ownership checks.
Findings None None.
Security None None.

How this fits together

The plugin registry receives contributions from loaded plugins and associates them with their owning plugin records. The API builder selects which registration methods plugins receive, while domain registrars validate and store their contributions.

flowchart LR
  A[Plugin record] --> C[Bind registration methods]
  B[Domain registrars] --> C
  C --> D[Mode and policy adapters]
  D --> E[Public API selection]
  E --> F[Plugin registration calls]
  F --> G[Validated registry contributions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -157. Total -157 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 29 186 -157
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 29 186 -157

Review metrics

None.

Technical review

Best possible solution:

Keep registration ownership centralized while preserving the explicit public API selection and specialized policy adapters.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a behavior-preserving refactor, and source inspection did not identify an introduced failure. Tests were not run during this read-only review.

Is this the best way to solve the issue?

Yes: the shared binding removes repeated forwarding while the existing API builder and explicit adapters preserve the supported contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8c03d61c62ca.

Labels

Label changes:

  • add P3: This is internal registration cleanup with no demonstrated user-facing defect or new capability.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied member-authored classification exempts this internal refactor from the external-contributor proof gate; it changes registration forwarding without materially changing authority. Reported tests are supplemental, and the aggregate PR's live evidence is not attributed to this head.

Label justifications:

  • P3: This is internal registration cleanup with no demonstrated user-facing defect or new capability.
  • 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: The supplied member-authored classification exempts this internal refactor from the external-contributor proof gate; it changes registration forwarding without materially changing authority. Reported tests are supplemental, and the aggregate PR's live evidence is not attributed to this head.

Evidence

What I checked:

  • Introduced scope and current-main comparison: The pinned introduced delta changes only registry-api.ts and registry.ts. Comparing the merge base with fetched main produced no changes for either file, so the refactor remains absent from that main snapshot. (src/plugins/registry-api.ts:118, 8c03d61c62ca)
  • Public methods remain explicitly selected: The complete API builder reads named handlers individually rather than spreading the supplied handlers into the public API. Internal registrar names therefore do not become additional plugin methods. (src/plugins/api-builder.ts:140, e79e806689d6)
  • Owner and policy arguments preserved: The binding prepends the same captured record. Explicit adapters retain hook configuration, node policy configuration, context-engine registration mode, middleware policy, generic typed-hook policy, and channel runtime selection. The referenced registrar implementations retain their validation and ownership checks. (src/plugins/registry-api.ts:118, e79e806689d6)
  • Existing boundary coverage: Read existing tests covering interleaved plugin ownership, call-time diagnostic provenance, rollback isolation, disabled workspace rejection before input access, and setup-only channel behavior. These tests were inspected, not executed; the PR body separately reports 391 passing tests and the changed-file gate. (src/plugins/registry.diagnostics.test.ts:33, e79e806689d6)
  • Latest-release comparison: The supplied latest release, v2026.9.2, still uses explicit per-method record forwarding in its API factory; it does not contain this binding refactor. (src/plugins/registry-api.ts:183, 3928bad9badf)
  • Related extraction context: The supplied bodies explicitly connect this extraction to feat: manage and reload plugins without restarting the Gateway #135599, whose broader reload implementation is being split into independently landable PRs. That open draft is related work, not a merged replacement. (e79e806689d6)

Likely related people:

  • Peter Steinberger: 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.

@steipete
steipete merged commit bc7c529 into main Sep 6, 2026
246 checks passed
@steipete
steipete deleted the codex/plugin-registrar-bindings branch September 6, 2026 08:01
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: M 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