Skip to content

refactor(plugins): unify setup registration and artifact selection - #130474

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-setup-registration-20260826
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-setup-registration-20260826

Conversation

@steipete

@steipete steipete commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin setup registration and runtime artifact selection duplicated the same ownership decisions across the registry and artifact resolver. The parallel layers made setup execution, artifact preference, and fallback ordering harder to keep consistent.

Why This Change Was Made

The setup registry now uses one canonical artifact-selection contract shared with runtime resolution. The new internal selector owns candidate preference and fallback ordering, while the public setup/runtime surfaces and plugin activation boundaries remain unchanged.

User Impact

There is no intended public API or configuration change. Plugin setup and runtime artifact resolution now follow the same deterministic registration contract with fewer private layers.

Evidence

  • Two focused regressions failed before the repair and pass afterward.
  • Setup-registry owner and sibling coverage passes 175 tests.
  • Exact changed-path type checks, lint, formatting, and full changed-gate checks pass.
  • Fresh autoreview and independent review report no actionable findings.
  • Production delta: +193/-250, net -57 lines; tests +106/-13.
  • A task-owned exact-lock dependency overlay links workspace packages to this worktree's own build outputs. The recovered runtime-postbuild verifies 48 built modules across 11 phases, and full pnpm build passes end to end: tsdown 9/9, packages, 63 external plugins, CLI bootstrap, runtime postbuild, SDK 147, UI/build-info, and CLI metadata. No dependency or overlay change is committed.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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 Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:53 PM ET / 22:53 UTC.

ClawSweeper review

What this changes

Centralizes plugin artifact selection and reuses the setup registry for provider and CLI-backend setup lookup.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review. The refactor has a coherent shared ownership boundary and no concrete patch defect was found; exact-head package-import confirmation remains the relevant pre-merge check.

Priority: P2
Reviewed head: 04260dcb3671eeba52b99cf23228e08d0fb054d9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused net-negative refactor with relevant regression coverage; exact-head package-import confirmation remains the material merge check.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 5 items Current-main behavior: Current main still has separate setup artifact rewriting and focused setup-registration paths, so this PR is not already implemented.
Shared selection owner: The new selector owns package-local, bundled-root, and source-external artifact preference without importing runtime state.
Runtime integration: Runtime resolution retains canonicalization and registry memoization before delegating selection to the shared helper.
Findings None None.
Security None None.

Live Verification

Command: pnpm test src/plugins/setup-registry.test.ts

Result: PASS (completed)

$ node --import tsx scripts/test-projects.mts src/plugins/setup-registry.test.ts
[test] starting test/vitest/vitest.plugins.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130474-xDykRF/target

 ✓  plugins  src/plugins/setup-registry.test.ts (36 tests) 1316ms

 Test Files  1 passed (1)
      Tests  36 passed (36)
   Start at  22:54:28
   Duration  2.35s (transform 1.63s, setup 659ms, import 137ms, tests 1.32s, environment 0ms)

[test] passed 1 Vitest shard in 6.29s
$ node --import tsx scripts/test-projects.mts src/plugins/setup-registry.test.ts
[test] starting test/vitest/vitest.plugins.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130474-xDykRF/target

Assertions:

  • PASS expect_output: setup-registry

How this fits together

Plugin manifests feed setup registration and runtime loading. Both paths choose a source or built artifact before passing it to the plugin module loader.

flowchart LR
  A[Plugin manifest] --> B[Setup lookup]
  A --> C[Runtime lookup]
  B --> D[Shared artifact selector]
  C --> D
  D --> E[Selected artifact]
  E --> F[Plugin module loader]
Loading

Before merge

  • Resolve merge risk (P1) - The PR body reports an environment-blocked final runtime-postbuild import; exact-head CI or package-import confirmation is still needed before merge.
  • Complete next step (P2) - This member-authored PR has a protected maintainer label and needs normal maintainer and exact-head CI handling, not automated repair or closure.
Agent review details

Security

None.

PR surface

Source -57, Tests +93. Total +36 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 193 250 -57
Tests 1 106 13 +93
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 299 263 +36

Review metrics

Metric Value Why it matters
Production versus test delta production +193/-250 (net -57); tests +106/-13 (net +93) The refactor removes duplicated production logic while adding focused setup-registry coverage.

Merge-risk options

Maintainer options:

  1. Verify packaged artifact selection (recommended)
    Obtain exact-head CI or package-import evidence that setup and runtime select the intended bundled and source-external artifacts.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require exact-head package-import proof for bundled and source-external plugin artifacts.

Technical review

Best possible solution:

Retain the runtime-independent shared selector and confirm exact-head packaged imports for bundled and source-external plugins.

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

Yes. The changed setup/runtime artifact-selection paths and their focused tests provide a high-confidence source reproduction path; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Centralizing the duplicated policy keeps setup control-plane loading separate from stateful runtime resolution while preventing preference drift.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 34ccf63e1379.

Labels

Label changes:

  • add P2: This plugin-loader refactor can affect setup and runtime behavior, but no current user-facing regression is demonstrated.
  • add merge-risk: 🚨 compatibility: Changing artifact preference can affect which module existing packaged or source-external plugins load.
  • 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 PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P2: This plugin-loader refactor can affect setup and runtime behavior, but no current user-facing regression is demonstrated.
  • merge-risk: 🚨 compatibility: Changing artifact preference can affect which module existing packaged or source-external plugins load.
  • 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 PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Current blame and history attribute the runtime resolver, setup registry, and source-external packaging work to this contributor. (role: feature owner and recent area contributor; confidence: high; commits: f378c6c663b8, e8c761ea7080, 04260dcb3671; files: src/plugins/plugin-runtime-artifact-resolution.ts, src/plugins/setup-registry.ts, src/plugins/plugin-runtime-artifact-resolution.test.ts)
  • Shakker: History includes a focused setup-provider diagnostic correction in the same registry. (role: adjacent setup-registry contributor; confidence: medium; commits: aa8be5acf90e; files: src/plugins/setup-registry.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide exact-head package-import or CI evidence, redacting environment-specific paths and credentials.

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 02a60e0 into main Aug 26, 2026
215 checks passed
@steipete
steipete deleted the codex/refactor-setup-registration-20260826 branch August 26, 2026 23:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (26 commits)
  fix(plugins): preserve registry epoch on activation rollback (#129232)
  refactor(plugins): make discovery invocation-owned (#130486)
  feat(ui): save appearance preferences per user profile (#130340)
  fix: Buzz bots recover relay stalls and reject revoked senders (#130467)
  fix(code-mode): serialize catalog handles nested in final values (#130276)
  fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427)
  fix(agents): read the published model catalog owner from session_status (#130277)
  fix(channels): preserve long presentation text (#130368)
  fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325)
  refactor(plugins): unify setup registration and artifact selection (#130474)
  fix(memory): prevent forgotten session content from returning (#130451)
  refactor(outbound): consolidate transport completion (#130460)
  fix(workers): protect in-flight workspace manifests from concurrent retention (#130449)
  fix(portals): keep worker previews reachable and owned by the active environment (#130434)
  fix(config): keep core channels keys in the generated config schema (#120736)
  chore(deps): refresh dependencies after seven-day cooldown (#130296)
  fix(agents): remind exec models to quote shell metacharacters (#125485)
  fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437)
  fix(openshell): preserve file writes during concurrent mirror commands (#130447)
  fix(workers): report full nodes as at capacity, not offline (#130445)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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