Skip to content

refactor(plugins): consolidate loader test fixtures - #118076

Merged
steipete merged 1 commit into
mainfrom
codex/goal100k-plugin-loader-fixture-wave14
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/goal100k-plugin-loader-fixture-wave14

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The plugin loader fixture suite repeated large manifest, package, channel, setup-runtime, and built-artifact constructions. That duplication made loader security and lifecycle invariants harder to review and maintain.

Why This Change Was Made

This test-only refactor introduces narrow fixture writers and explicit scenario data for repeated setup-runtime and artifact cases. Security-boundary tests, failure-path assertions, timer restoration, fixture write order, and each individual test name remain intact. No production, config, API, default, compatibility, or dependency behavior changes.

User Impact

No user-visible behavior changes. The loader tests are 418 net lines smaller and their shared invariants are easier for maintainers to audit.

Evidence

  • Final diff: one test-support file, +386/-804, net -418; production LOC delta 0.
  • Static parity: 29 ordinary tests plus two parameterized tables with 8 and 2 rows (39 runtime cases), 73 expectations, and exactly three each of fake-timer setup, timer advancement, and real-timer restoration.
  • Blacksmith Testbox tbx_01kz1q195r4x38wcadpw4pyejd: full pnpm check:changed passed on the exact final diff.
  • The exact final diff passed the complete 27-file loader/hook/security selection: 419/419 tests across unit-fast, contracts-plugin, bundled, and plugins projects.
  • Hosted proof: https://github.com/openclaw/openclaw/actions/runs/30758125174
  • Two independent xhigh reviews passed after tracing loader ownership, hook/security policy, history, sibling tests, and @openclaw/fs-safe 0.5.0.
  • Exact-path open-PR collision audit found no competing changes through the final pre-publish check.
  • git diff --check passed.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 17:17
@steipete steipete self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 1:22 PM ET / 17:22 UTC.

ClawSweeper review

What this changes

This PR consolidates repeated temporary plugin-package, setup-entry, channel, and built-artifact fixture construction in the plugin-loader test suite while preserving the existing test cases and assertions.

Merge readiness

⚠️ Ready for maintainer review - 6 items remain

Keep this fresh, maintainer-labelled refactor open for its assigned owner. The branch changes only plugin-loader test support; source inspection found the same 29 ordinary test titles and 73 expectations as current main, with shared fixture helpers replacing repeated construction. No patch defect or security concern was identified, but pending exact-head checks and unavailable live GitHub/comment retrieval mean this should receive normal human merge review rather than an automated terminal action.

Likely related people: Shakker (high confidence) introduced the current test module history; steipete (medium confidence) has recent adjacent plugin-refactor history and is the assigned PR author.

Priority: P3
Reviewed head: 721ad02bb7e1f72867f1b70b7257f2d959f6f4d6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, apparently behavior-preserving test refactor with no actionable source finding; final confidence depends on completing the current-head checks.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labelled, test-only refactor has no user-visible runtime behavior to demonstrate; the PR body supplies focused automated validation evidence, while pending exact-head CI remains the merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labelled, test-only refactor has no user-visible runtime behavior to demonstrate; the PR body supplies focused automated validation evidence, while pending exact-head CI remains the merge gate.
Evidence reviewed 5 items Test-support-only patch: The PR modifies only the loader fixture test module; the production loader entry point remains outside the diff.
Case and assertion parity: Current main and the PR have identical ordered ordinary-test title hashes, 29 ordinary tests, and 73 expect calls; the branch centralizes fixture construction rather than dropping those checks.
Focused fixture abstraction: The branch uses typed scenario data and one loader invocation helper to preserve bundled/workspace artifact variants while retaining separate assertions in the test cases.
Findings None None.
Security None None.

How this fits together

OpenClaw's plugin loader discovers manifests and resolves plugin runtime or setup paths into a registry used by the gateway and configuration flows. This test-support module creates temporary plugin packages to verify loader security boundaries, setup behavior, and built-artifact selection without changing the production loader.

flowchart LR
  A[Loader test cases] --> B[Shared fixture helpers]
  B --> C[Temporary plugin packages]
  C --> D[Plugin loader]
  D --> E[Plugin registry]
  E --> F[Status and diagnostic assertions]
Loading

Decision needed

Question Recommendation
Should the assigned owner merge this maintainer-labelled test-fixture refactor once the pending exact-head checks complete? Review and merge: Confirm the pending checks on the current head and merge the focused test-only fixture consolidation.

Why: The protected maintainer label and active assignment require an explicit owner decision even though source review found no concrete patch defect.

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labelled, test-only refactor has no user-visible runtime behavior to demonstrate; the PR body supplies focused automated validation evidence, while pending exact-head CI remains the merge gate.
  • Resolve merge risk (P1) - The PR is marked maintainer and assigned, so repository policy requires explicit human handling even though no code-level blocker was found.
  • Resolve merge risk (P1) - Several exact-head CI jobs were still in progress in the provided context; merge should wait for the required checks to finish.
  • Resolve merge risk (P1) - Live GitHub retrieval and a promisor-history parent lookup failed because DNS/network access was unavailable, so this review could not independently read the latest ClawSweeper comment or re-check the base-parent diff.
  • Complete next step (P2) - The protected maintainer label, active assignment, and pending exact-head checks require human merge review; there is no narrow mechanical repair finding to dispatch.
Agent review details

Security

None.

PR surface

Source -418. Total -418 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 386 804 -418
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 1 386 804 -418

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/plugins/loader.hooks-and-runtime.test-utils.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the fixture refactor as one focused test-only change, have the assigned owner confirm the pending exact-head checks, and merge only if that review confirms the helper scenarios preserve loader security and lifecycle coverage.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the fixture refactor as one focused test-only change, have the assigned owner confirm the pending exact-head checks, and merge only if that review confirms the helper scenarios preserve loader security and lifecycle coverage.

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

Not applicable: this PR refactors test fixtures rather than reporting a runtime defect. Source comparison establishes that its ordinary test titles and expectation count are preserved.

Is this the best way to solve the issue?

Yes: centralizing repeated temporary-plugin fixture setup in the test owner module is a cleaner path than changing production loader code or duplicating scenario setup, and the retained assertions continue to exercise the loader outcomes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 492b8841c837.

Labels

Label changes:

  • add P3: This is a test-only maintenance refactor with no claimed production, configuration, or user-visible behavior change.
  • 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: This maintainer-labelled, test-only refactor has no user-visible runtime behavior to demonstrate; the PR body supplies focused automated validation evidence, while pending exact-head CI remains the merge gate.

Label justifications:

  • P3: This is a test-only maintenance refactor with no claimed production, configuration, or user-visible behavior change.
  • 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-labelled, test-only refactor has no user-visible runtime behavior to demonstrate; the PR body supplies focused automated validation evidence, while pending exact-head CI remains the merge gate.

Evidence

What I checked:

Likely related people:

  • Shakker: Blame attributes the current module's opening fixture and test structure to the commit that introduced the present test file after the suite split. (role: current test-module introducer; confidence: high; commits: 4c6e1f0d4cc1; files: src/plugins/loader.hooks-and-runtime.test-utils.ts)
  • steipete: Recent file history includes a plugin compatibility-surface refactor by Peter Steinberger, and this PR is assigned to steipete. (role: recent adjacent plugin refactor contributor; confidence: medium; commits: c7e7ac272891; files: src/plugins/loader.hooks-and-runtime.test-utils.ts, src/plugins/AGENTS.md)

Rank-up moves

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

  • Wait for the pending exact-head checks, then have the assigned owner perform the protected-label merge review.

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 74f3ec1 into main Aug 2, 2026
158 of 164 checks passed
@steipete
steipete deleted the codex/goal100k-plugin-loader-fixture-wave14 branch August 2, 2026 17:31
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 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: XL 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