Skip to content

refactor(plugins): simplify registration lifecycle policy - #133364

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup20k-api-lifecycle-membership-20260830
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup20k-api-lifecycle-membership-20260830

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The plugin registration lifecycle carries an unused policy layer even though its only decision is whether a method remains callable after registration. The nearby module-export resolver also repeats a callable fallback that its earlier candidate walk already handles.

Why This Change Was Made

Use one typed set for the existing eight late-callable methods and remove the unreachable callable fallback. Registration closes at the same boundary; the object-definition fallback and its observable second register property read remain intact. The assertion baseline only shrinks to record the two removed assertions.

This is a bounded, maintainer-requested cleanup. It does not add configuration, change plugin API methods, relax registration ownership, or remove an external compatibility path. The reachability argument assumes ordinary JavaScript intrinsics, not arbitrary mutation of built-in collection methods by a plugin.

User Impact

No intended user-visible change. Plugins retain the same registration-only and runtime-callable behavior with less internal policy machinery to maintain.

Production LOC: +12 / -40 (28 removed). Tests: +21 / -0. Assertion baseline: +1 / -2. Whole change: 8 lines removed.

Evidence

The current candidate is 3a276728a803153a98cfe077b83d267b867539be, based on 84fde8560d9ac0269c2fc186fd933bb1f11888d1. The previous candidate's CI run failed the Gateway shutdown admission assertion. Canonical #133466 repairs the non-isolated test runner's between-file cleanup ordering; this candidate incorporates that landed repair rather than adding a duplicate fix. The three cleanup production/test afterimages remain identical; the shrink-only assertion baseline also preserves the upstream model-scan row change.

  • The composed candidate passed 270 outer cases across the non-isolated runner, Gateway shutdown, work admission, plugin lifecycle, run-context contract, CLI metadata loading, and loader suites. The existing runner test additionally exercises 34 nested child cases; these are not added to the 270 count. No outer cases were skipped or retried.
  • All original 239 lifecycle/loader cases retain their emitted identities and within-file order. The lifecycle table checks all eight permitted names plus registration-only, unknown, empty, and prototype-like names. Existing registration-close and grouped/flat API behavior tests remain.
  • All 30 changed checks passed on the composed source, including core and core-test types, core/scripts lint, assertion/dead-export ratchets, plugin boundaries, and runtime import cycles.
  • Earlier baseline/candidate proof passed the original 239 cases; the previous composed candidate also passed 108 Workshop and test-report-owner cases. These older results are retained as history, not relabeled as execution on the new head.
  • Earlier direct-Node and pnpm exec attempts failed eight isolated Corepack bootstrap cases. The normal package-script npm_execpath contract was then verified, and unchanged tests passed through pnpm test, without enabling networking, weakening assertions, or changing timeouts. Both those setup failures and the later hosted shutdown failure remain recorded.
  • A separate authenticated read-only Codex review of the exact composed commit completed all three input batches with no actionable findings at P0. Context was partitioned across batches; the final batch did not contain the full caller/export traversal context present in the earlier input. This is static review, not a fresh test execution or landing certificate.

Exact composed commands (pinned Node 24.19.0 and repository pnpm 12.1):

pnpm test test/non-isolated-runner.test.ts src/gateway/worker-environments/computer-transport.shutdown.test.ts src/process/gateway-work-admission.test.ts src/plugins/api-lifecycle.test.ts src/plugins/contracts/run-context-lifecycle.contract.test.ts src/plugins/loader.cli-metadata.test.ts src/plugins/loader.test.ts -- --reporter=verbose
node scripts/check-changed.mjs --base 84fde8560d9ac0269c2fc186fd933bb1f11888d1 -- config/assertion-safety-baseline.txt src/plugins/api-lifecycle.test.ts src/plugins/api-lifecycle.ts src/plugins/loader-module-runtime.ts

These are local owner-boundary tests and checks, not a live Gateway, channel, provider, or packaged-plugin run. Exact-head CI33333932606 completed successfully on 3a276728a803153a98cfe077b83d267b867539be; the normal exact-head watcher returned GREEN. Normal native hosted preparation and merge remain unexecuted. No earlier failed or older-head run is treated as green evidence.

The watcher retained a raw aggregate FAILURE from six superseded old contexts while the attached current CI run completed successfully. This is the canonical normalized result, not a claim that every historical context passed.

The latest ClawSweeper review, reviewed at 20:39 UTC on the exact candidate, found no actionable source or security defect. Its outstanding exact-head-check item is now satisfied; there was no separate Rank-up moves list. Normal maintainer preparation and merge handling remain. The fixed current-main observation at 661fedfe55e7b9620ef89747c381e5a6fc88622c retained all 38 reviewed owner/context files and the trusted launcher closure; unrelated assertion-baseline changes do not alter the two cleanup reductions. This is a static composition check, not new full-main runtime proof.

Final source comparison against 69b819680ba8d38e4717ff91267376164fb57d6a also preserves the upstream test-runner cleanup from #133368. Its two ordered admission cases were not part of this candidate's recorded 34 nested cases. The plugin owners and other reviewed contexts remain unchanged; this comparison is not a new test execution.

@steipete steipete self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 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: S maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 16:04
@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 Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:39 PM ET / 20:39 UTC.

ClawSweeper review

What this changes

The PR replaces the plugin lifecycle policy table with a typed set of the eight runtime-callable methods and removes an unreachable duplicate function-export fallback.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking introduced defect was found. The branch preserves the existing registration boundary and supported plugin-export shapes; it should remain open for completed exact-head checks and normal maintainer merge handling.

Priority: P3
Reviewed head: 3a276728a803153a98cfe077b83d267b867539be
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused, net-negative refactor preserves the reviewed behavior and adds relevant classifier coverage; exact-head checks remain a merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned, behavior-neutral internal refactor is covered by focused lifecycle and loader checks; 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: This maintainer-owned, behavior-neutral internal refactor is covered by focused lifecycle and loader checks; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 6 items Registration lifecycle owner: The proxy checks a method's value before consulting the late-callable predicate, so only function-valued API fields can bypass the post-registration closure; the changed set lists the same eight prior runtime methods.
Resolver reachability: Candidate zero is processed by the loop before the former fallback; a function at that position returns at lines 282-284, while the object fallback and its register-property read remain.
Caller and sibling coverage: Both full runtime loading and CLI-metadata loading consume the resolver result and reject a missing register callback; the channel setup path uses the same guarded registration helper.
Findings None None.
Security None None.

How this fits together

Plugin modules are resolved by the loader and synchronously register capabilities into a registry. The registration guard closes afterward, allowing only selected runtime-safe API methods to be retained by plugins.

flowchart LR
  A[Plugin module] --> B[Module export resolver]
  B --> C[Plugin registration]
  C --> D[Lifecycle guard]
  D --> E[Runtime-safe API methods]
  D --> F[Closed registration methods]
Loading

Decision needed

Question Recommendation
Once the exact-head checks finish green, should this behavior-neutral plugin-loader cleanup be merged? Merge after green checks: Merge the existing focused cleanup once the exact-head required checks complete successfully.

Why: The PR is maintainer-owned and carries the protected maintainer label, which requires explicit human merge handling even though no source defect was found.

Before merge

  • Resolve merge risk (P1) - Exact-head required checks are still in progress, so merge readiness is not yet established despite the clean source review.
Agent review details

Security

None.

PR surface

Source -28, Tests +21, Other -1. Total -8 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 40 -28
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 2 -1
Total 4 34 42 -8

Review metrics

Metric Value Why it matters
Production versus test LOC production +12/-40 (net -28); tests +21/-0; assertion baseline +1/-2 The refactor reduces production policy machinery while adding focused coverage for the retained lifecycle classification.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the direct set-based policy and single resolver path, then merge after the exact head has completed its required checks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the direct set-based policy and single resolver path, then merge after the exact head has completed its required checks.

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

Not applicable: this PR is a behavior-neutral internal refactor, not a reported user-facing defect.

Is this the best way to solve the issue?

Yes. A set directly expresses the sole binary policy decision, and the removed fallback is already covered by the preceding candidate loop; retaining the former policy objects or fallback would add redundant paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 05e9030d7380.

Labels

Label justifications:

  • P3: This is a behavior-neutral internal cleanup with no identified user-facing regression.
  • 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: This maintainer-owned, behavior-neutral internal refactor is covered by focused lifecycle and loader checks; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

  • Registration lifecycle owner: The proxy checks a method's value before consulting the late-callable predicate, so only function-valued API fields can bypass the post-registration closure; the changed set lists the same eight prior runtime methods. (src/plugins/loader-module-runtime.ts:56, 3a276728a803)
  • Resolver reachability: Candidate zero is processed by the loop before the former fallback; a function at that position returns at lines 282-284, while the object fallback and its register-property read remain. (src/plugins/loader-module-runtime.ts:275, 3a276728a803)
  • Caller and sibling coverage: Both full runtime loading and CLI-metadata loading consume the resolver result and reject a missing register callback; the channel setup path uses the same guarded registration helper. (src/plugins/loader-runtime-candidate.ts:450, 3a276728a803)
  • Focused behavior coverage: Existing tests retain a nested and flat late runtime call plus a blocked registration call; the added table covers all eight permitted names and representative non-permitted names. (src/plugins/api-lifecycle.test.ts:109, 3a276728a803)
  • Current-main comparison: Fetched current main still has the original policy table and duplicate function fallback, so this cleanup is neither implemented on main nor superseded. (src/plugins/api-lifecycle.ts:4, 05e9030d7380)
  • Lifecycle provenance: The lifecycle module was introduced as a new file by this merged commit; its unchanged opening lines remain the current ownership anchor. (src/plugins/api-lifecycle.ts:1, 1e2408cd92fd)

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)
  • 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 (2 earlier review cycles)
  • reviewed 2026-08-30T16:12:34.068Z sha 71bb96e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T19:38:16.341Z sha 8a893db :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/cleanup20k-api-lifecycle-membership-20260830 branch from 71bb96e to 8a893db Compare August 30, 2026 19:31
@steipete
steipete force-pushed the codex/cleanup20k-api-lifecycle-membership-20260830 branch from 8a893db to 3a27672 Compare August 30, 2026 20:32
@steipete
steipete merged commit 416057e into main Aug 30, 2026
245 of 246 checks passed
@steipete
steipete deleted the codex/cleanup20k-api-lifecycle-membership-20260830 branch August 30, 2026 21:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to shojikumaru/openclaw that referenced this pull request Aug 30, 2026
…cked-delivery

* origin/main: (261 commits)
  fix(clawdock): keep credentials out of diagnostic output (openclaw#133547)
  refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548)
  fix(agents): recognize internal requester completion replies (openclaw#133543)
  fix: prevent duplicate queued user messages in chat clients (openclaw#133542)
  chore(ui): refresh control ui locales (openclaw#133544)
  fix(beam): restart delivery when the receiver changes (openclaw#133533)
  fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221)
  perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527)
  perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512)
  fix(line): offer the card command only on LINE (openclaw#132895)
  fix: keep Android publication independent of core release (openclaw#133471)
  refactor(agents): simplify compaction accounting (openclaw#133521)
  refactor(plugins): simplify registration lifecycle policy (openclaw#133364)
  perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518)
  refactor(ui): consolidate chat rendering ownership (openclaw#133508)
  test(auto-reply): prepare memory flush model capabilities (openclaw#133532)
  fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470)
  fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493)
  fix(ui): deduplicate participant and viewer avatars (openclaw#133519)
  feat(ui): add CRT terminal theme (openclaw#133495)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
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: S 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