Skip to content

refactor(plugins): simplify diagnostics and state wrappers - #139775

Merged
steipete merged 1 commit into
mainfrom
codex/plugin-lifecycle-cleanups
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/plugin-lifecycle-cleanups

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin diagnostics and state-store wrappers carry redundant branches and type declarations that make their owners harder to maintain.

Why This Change Was Made

Failure diagnostics share one grouping path while preserving phase and plugin order. State-store wrappers infer return types from their typed factories and retain the runtime interface check.

User Impact

No runtime behavior or public API changes. This independent extraction from #135599 removes 13 production lines across two files.

Evidence

349 comparisons of the actual diagnostic helpers produced identical output. The complete registry-runtime module compiled to byte-identical JavaScript. The full changed-file gate and independent review passed, including production/test typechecks, typed lint, unused-export scans, and architecture/storage guards. No tests were added for the behavior-preserving cleanup.

@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: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 05:14
@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, 2:05 AM ET / 06:05 UTC.

ClawSweeper review

What this changes

Simplifies plugin diagnostic formatting and state-store wrappers while preserving operator output and public runtime APIs.

Merge readiness

✅ Ready for maintainer review

This maintainer-authored extraction remains a useful, bounded cleanup. The introduced patch preserves behavior, and no actionable correctness or security defect was found.

Priority: P3
Reviewed head: af90ef5aaf2ac2b67a465a89fcf36b5f330b2fcb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with appropriate reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored cleanup is exempt from external-contributor runtime proof. Reported diagnostic comparisons and compiled-JavaScript equivalence match the changed owners; no material authority change triggers additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored cleanup is exempt from external-contributor runtime proof. Reported diagnostic comparisons and compiled-JavaScript equivalence match the changed owners; no material authority change triggers additional proof.
Evidence reviewed 7 items Verified introduced scope: The merge-base-to-head diff contains only diagnostic simplifications and removal of type-only imports and return annotations. The supplied verified test merge likewise changes only these two files.
Diagnostic semantics preserved: Undefined or empty activation reasons still return undefined. Failure grouping retains first-seen phase order, plugin order within each phase, and the default load phase; setting an existing Map key does not reorder it.
Public storage contract remains unchanged: The blob factory explicitly returns PluginBlobStore; keyed factories return Required versions of the existing store types. The resolver still returns PluginRuntime and retains its satisfies PluginRuntime["state"] check, so more precise local inference does not change the public API. Trust checks, plugin identifiers, options, and factory calls are unchanged.
Findings None None.
Security None None.

How this fits together

The plugin loader turns activation reasons and failures into operator diagnostics. The runtime registry also gives trusted plugins access to plugin-scoped storage through typed factories.

flowchart TD
  A[Plugin activation and failures] --> B[Diagnostic formatting]
  B --> C[Status and startup messages]
  D[Plugin storage request] --> E[Runtime trust check]
  E --> F[Plugin-scoped storage factories]
  F --> G[Typed storage handles]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -13. Total -13 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 7 20 -13
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 7 20 -13

Review metrics

None.

Technical review

Best possible solution:

Keep the simplification within the existing diagnostic helpers and typed storage factories, preserving their output and public contracts.

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

Not applicable: this PR claims behavior-preserving cleanup rather than a runtime defect; source inspection supports that scope.

Is this the best way to solve the issue?

Yes. Reusing the existing grouping path and inferring wrapper returns from typed factories is a narrow simplification that retains the public interface check.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a low-risk internal cleanup with no intended change to user behavior, configuration, or public APIs.
  • 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 maintainer-authored cleanup is exempt from external-contributor runtime proof. Reported diagnostic comparisons and compiled-JavaScript equivalence match the changed owners; no material authority change triggers additional proof.

Evidence

What I checked:

  • Verified introduced scope: The merge-base-to-head diff contains only diagnostic simplifications and removal of type-only imports and return annotations. The supplied verified test merge likewise changes only these two files. (src/plugins/registry-runtime.ts:219, af90ef5aaf2a)
  • Diagnostic semantics preserved: Undefined or empty activation reasons still return undefined. Failure grouping retains first-seen phase order, plugin order within each phase, and the default load phase; setting an existing Map key does not reorder it. (src/plugins/loader-records.ts:267, af90ef5aaf2a)
  • Public storage contract remains unchanged: The blob factory explicitly returns PluginBlobStore; keyed factories return Required versions of the existing store types. The resolver still returns PluginRuntime and retains its satisfies PluginRuntime["state"] check, so more precise local inference does not change the public API. Trust checks, plugin identifiers, options, and factory calls are unchanged. (src/plugins/runtime/types-core.ts:499, af90ef5aaf2a)
  • Existing boundary coverage: The trust-diagnostics suite exercises registration-time keyed storage across trusted and rejected installation provenance. Existing runtime-registry coverage also exercises synchronous and asynchronous storage before and after broad runtime loading. These tests were inspected, not executed. (src/plugins/loader.trust-diagnostics.test.ts:29, af90ef5aaf2a)
  • Current main and review continuity: Comparing fetched main with the reviewed head shows the same scoped cleanup remains outstanding. The previous review projection contains no findings or published rank-up moves. The earlier reviewed commit and release file could not be retrieved because required objects were unavailable and GitHub DNS failed; no release inclusion or earlier-head equivalence is claimed. (src/plugins/loader-records.ts, fd882d75190a)
  • Related work and supplied validation: The captured body identifies this as an independent extraction from feat: manage and reload plugins without restarting the Gateway #135599, whose body confirms an intentional split into independently landable changes. It reports 349 equivalent diagnostic comparisons, byte-identical compiled registry JavaScript, and passing changed-file checks. These are contributor-reported results, not reviewer executions; the broader PR's runtime evidence is not attributed to this head. (af90ef5aaf2a)

Likely related people:

  • steipete: 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-06T05:19:53.783Z sha b562d3c871b88e2962fd6c77d0bdc737aab7c86d :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/plugin-lifecycle-cleanups branch from b562d3c to af90ef5 Compare September 6, 2026 06:00
@steipete
steipete merged commit 397ec2e into main Sep 6, 2026
173 checks passed
@steipete
steipete deleted the codex/plugin-lifecycle-cleanups branch September 6, 2026 06:25
@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: XS 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