Skip to content

improve: reuse prepared plugins in startup corpus tests - #148465

Merged
steipete merged 1 commit into
mainfrom
codex/startup-corpus-compiled-plugins
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/startup-corpus-compiled-plugins

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Startup corpus tests explicitly selected the source plugin tree even after their normal prerequisite had built the bundled runtime. That repeatedly sent eligible Doctor contracts through the TypeScript loader during an already expensive migration matrix.

Why This Change Was Made

Both corpus fixtures now use the existing package-root bundled-plugin resolver. This selects the prepared runtime from the same checkout and retains the loader's existing source-only contracts. No production loader, dependency, schema, worker count, timeout, shard, fixture matrix or assertion changes. The CI documentation records the fixture representation.

Production LOC: 0. Tests: +19/-3. Documentation: +4/-0.

User Impact

No product behavior change. CI avoids unnecessary TypeScript loading while retaining the complete operator configuration and prior-release state checks. This is an incremental import-work reduction; it does not establish an eight-minute full-workflow result.

Evidence

  • Full corpus on base a6093ef81fa8e08e659982de0e32c3db750de24f: 58 passed, zero skipped, in original per-file order, including both state repair passes and both complete release matrices. Native suite 546.402s, normal prerequisite build 72.3s, complete command 625.112s on a busy local host. All generation cleanup checks passed. This is coverage evidence, not a normalized before/after timing comparison.
  • Earlier same-source 28-case A/B/A screening: prepared-plugin candidate 86.960s, warm source reversal 93.725s. The first source run was 141.172s; host load varied, so the large first-run difference is not claimed as the improvement.
  • Instrumented loader comparison retained all ordered Doctor declarations and callbacks. In the state screening, actual Doctor loads changed from 261 forced-source + 255 cached to 212 native + 49 forced-source + 255 cached, with no native misses. Legacy session-surface loads and intentional source opt-outs remained intact.
  • Generated plugin metadata is intentionally richer than source metadata. The affected configured channel schema matches the existing validation seed; the observed repair ordering difference affects disjoint configuration domains. Complete corpus assertions still cover config, sessions, auth, cron, preferences, catalogs and SQLite integrity.
  • Classified repository checks passed, including core test types, changed-file lint, formatting, boundary/ratchet guards and dead-export checks. Independent P0–P2 review found no actionable findings.

Remaining measurement: one warm state row took 71.309s during the busy full run; its cause remains unassigned. Retain that observation for the next timing audit and measure the native CI job before claiming full-suite savings. No tests or assertions were removed to hide it.

Refreshed onto main b8de9f88996b296ffd7d1cfcfe4d72b2d388636e after #148425 repaired the inherited duplicate test registration that stopped the first preflight. The three-file patch is byte-identical. Main also updated its Vitest worker-exit patch; the local frozen install adopted it, and refreshed exact-head CI must validate the new dependency bytes. Fresh independent P0–P2 review found no actionable findings.

@clawsweeper

clawsweeper Bot commented Sep 14, 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 docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete
steipete force-pushed the codex/startup-corpus-compiled-plugins branch from 9a424a8 to 3e5a4bd Compare September 14, 2026 19:15
@steipete steipete closed this Sep 14, 2026
@steipete steipete reopened this Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 3:33 PM ET / 19:33 UTC (Revision 2).

ClawSweeper review

What this changes

The startup compatibility tests reuse prepared plugins through the existing directory resolver, with CI documentation explaining the selection.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused optimization absent from current main. No actionable correctness or security findings were found, and the prior review contains no unresolved findings.

Priority: P3
Reviewed head: 3e5a4bd9e19cb7025f00e38f54d4da15c65e5b96

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused reuse of existing behavior with preserved assertions and useful, appropriately qualified validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test optimization is exempt from external-contributor runtime proof. Its reported corpus and loader measurements directly exercise the changed fixture selection; they do not establish normalized full-CI savings.
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 test optimization is exempt from external-contributor runtime proof. Its reported corpus and loader measurements directly exercise the changed fixture selection; they do not establish normalized full-CI savings.
Evidence reviewed 9 items Verified introduced scope: The merge-base-to-head diff changes only plugin-directory selection in the two corpus tests and explanatory CI prose; assertions, fixture matrices, repair passes, and timeouts are unchanged.
Existing resolver preserves fallback: The package-root resolver prefers usable, contained dist/extensions and dist-runtime/extensions trees, then source extensions in a source checkout. Existing resolver tests cover prepared trees, missing builds, and incomplete build directories.
Build prerequisite already owns preparation: Both corpus files are registered as runtime-build consumers for the runtime-config suite before workers execute; the patch adds no competing build or freshness owner.
Findings None None.
Security None None.

How this fits together

The startup corpus checks operator configurations and prior-release state through Doctor repair and Gateway startup. Plugin discovery supplies the migration contracts used by those checks.

flowchart TD
  A[Operator config fixtures] --> D[Startup corpus tests]
  B[Prior-release state fixtures] --> D
  C[Checkout plugin resolver] --> E[Prepared plugins or source fallback]
  E --> D
  D --> F[Doctor and Gateway startup]
  F --> G[State and configuration assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +16, Docs +4. Total +20 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 19 3 +16
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 23 3 +20

Review metrics

None.

Technical review

Best possible solution:

Keep plugin selection with the existing resolver and preserve the full compatibility corpus without adding loader policy or weakening assertions.

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

Not applicable as a product bug: source confirms the forced-source test setup, and the PR supplies loader measurements; this review did not execute the corpus.

Is this the best way to solve the issue?

Yes. Reusing the established package-root resolver is a narrow solution that preserves existing build preparation, source fallbacks, and migration coverage.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-execution optimization with no production 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: The maintainer-authored test optimization is exempt from external-contributor runtime proof. Its reported corpus and loader measurements directly exercise the changed fixture selection; they do not establish normalized full-CI savings.

Label justifications:

  • P3: This is a bounded test-execution optimization with no production 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: The maintainer-authored test optimization is exempt from external-contributor runtime proof. Its reported corpus and loader measurements directly exercise the changed fixture selection; they do not establish normalized full-CI savings.

Evidence

What I checked:

  • Verified introduced scope: The merge-base-to-head diff changes only plugin-directory selection in the two corpus tests and explanatory CI prose; assertions, fixture matrices, repair passes, and timeouts are unchanged. (src/config/config-startup-corpus.test.ts:16, 3e5a4bd9e19c)
  • Existing resolver preserves fallback: The package-root resolver prefers usable, contained dist/extensions and dist-runtime/extensions trees, then source extensions in a source checkout. Existing resolver tests cover prepared trees, missing builds, and incomplete build directories. (src/plugins/bundled-dir.ts:175, 3e5a4bd9e19c)
  • Build prerequisite already owns preparation: Both corpus files are registered as runtime-build consumers for the runtime-config suite before workers execute; the patch adds no competing build or freshness owner. (scripts/lib/vitest-build-prerequisites.mts:125, 3e5a4bd9e19c)
  • Source-loading exceptions remain owned by discovery: Discovery loads bundledDist opt-outs from the source checkout and excludes their compiled duplicates; the module loader retains explicit source transforms and native-load fallback. Neither owner changes in this PR. (src/plugins/discovery.ts:1409, 3e5a4bd9e19c)
  • Current-main and release necessity check: Fetched main still explicitly selects ../../extensions/ at both config-corpus call sites and the state-corpus call site. The config corpus file does not exist in v2026.9.4, so that release does not contain this test optimization. (src/config/config-startup-corpus.test.ts:110, 5d6453e092ae)
  • Captured validation and review continuity: The supplied body snapshot, sourceRevision 5f16cd05870d6d8ba437358954fbef8e1fc8873a644243a86fbf50509803585f, reports 58 passing cases with zero skips, an instrumented shift from forced-source to native loads, and bounded A/B/A timing evidence. It explicitly declines a normalized full-workflow performance claim. The prior completed review examined the same head and recorded no findings; these tests were not rerun during this read-only review. (3e5a4bd9e19c)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 (1 earlier review cycle)
  • reviewed 2026-09-14T19:26:18.647Z sha 3e5a4bd :: needs maintainer review before merge. :: none

@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 14, 2026
@steipete
steipete merged commit cbc5d7e into main Sep 14, 2026
166 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/startup-corpus-compiled-plugins branch September 14, 2026 20:26
vincentkoc added a commit that referenced this pull request Sep 14, 2026
* origin/main:
  perf(secrets): keep pure helpers out of file writer imports (#148096)
  perf(models): normalize suppression policy once per compilation (#148428)
  test: route provider integration and wizard recovery tests correctly (#148504)
  test: reuse prepared bundled plugins in startup corpus (#148465)
  fix(agents): attribute tool preparation delays to the correct stages (#148349)
  refactor: remove redundant Parallels source checks (#148394)
  fix(test): avoid timeout failures before descendant readiness (#148410)
  fix: open browser side panel without creating a dashboard (#148471)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation 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