Skip to content

perf(test): import package manifest helper directly - #123841

Merged
steipete merged 1 commit into
mainfrom
steipete/test-suite-performance-pass-7-aug14
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/test-suite-performance-pass-7-aug14

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The package-manifest contract test imported one helper through the aggregate plugin-test-contracts test barrel. That made this focused contract evaluate unrelated contract-testkit, registry/config, host-hook, and session-delivery modules before running its own assertions, adding avoidable time, CPU, and memory to a frequently selected test lane.

This is a bounded maintainer-requested test-performance change. It does not alter runtime behavior, the public Plugin SDK, package output, or production code.

Why This Change Was Made

Import describePackageManifestContract directly from its internal test-helper module. This keeps the aggregate barrel and its independent registration/testing-harness coverage intact while giving the manifest contract the narrow dependency graph it actually needs.

The direct target is internal test support. package.json and scripts/lib/plugin-sdk-entries.mts continue to classify the aggregate barrel as test-only/excluded from the shipped package, so no public SDK export or build surface changes.

User Impact

There is no user-visible or runtime behavior change. Maintainers get a materially cheaper package-manifest contract test with all 46 manifest cases, parameter rows, filesystem reads, parsers, and assertions unchanged.

Production LOC: +0/-0 (net 0). Tests: +1/-1 (net 0).

AI-assisted: yes. The patch and proof were inspected by the maintainer campaign lead and passed a fresh Codex autoreview.

Evidence

Focused post-rebase proof:

  • node scripts/run-vitest.mjs src/plugins/contracts/package-manifest.contract.test.ts src/plugins/contracts/plugin-registration.contract.test.ts src/plugins/contracts/plugin-testing-harness.contract.test.ts --maxWorkers=1
  • 3 files passed, 137 tests passed, including all 46 package-manifest contract tests.
  • git diff --check origin/main...HEAD passed.
  • Changed-plan dry run selected core, coreTests, extensions, and extensionTests.
  • Actual node scripts/check-changed.mjs -- src/plugins/contracts/package-manifest.contract.test.ts passed on Blacksmith Testbox tbx_01m010yga64jen8fv6brxn6630, backed by Actions run 31840157168. The environment-variable ratchet passed at 502/502.
  • Fresh global Codex autoreview against origin/main with gpt-5.6-sol/high reasoning: clean, no accepted/actionable findings, overall 0.98.

Controlled local symmetric warm A/B, same machine and command shape, two warm samples per state, with state-specific module caches and Vitest import-duration reporting:

Metric Aggregate barrel Direct helper Change
Wall 1.73 s 1.32 s -23.7%
Vitest 1.40 s 0.197 s -86.0%
Import 1.29 s 0.089 s -93.1%
CPU user+sys 2.175 s 0.705 s -67.6%
Peak RSS 522.0 MiB 223.8 MiB -57.1%

Test-body time stayed approximately flat (~9 ms before, ~12 ms after); the improvement comes from removing unrelated module evaluation. An earlier fresh Testbox (tbx_01m00tq82j1k67r0sx5c9p5y08) never received capacity and was stopped, so the performance measurements above are local, not remote. The later Testbox run proves the changed gate, not the performance delta.

No changelog entry is required for this internal test-only change. No agent transcript is attached.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete steipete self-assigned this Aug 14, 2026
@steipete
steipete marked this pull request as ready for review August 14, 2026 21:18
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 5:23 PM ET / 21:23 UTC.

ClawSweeper review

What this changes

The PR changes the package-manifest contract test to import its manifest-specific helper directly instead of loading the aggregate plugin test-contracts barrel.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This maintainer-owned PR remains necessary because current main still imports the broad test barrel; the direct helper is the correct narrower seam and produces a clean merge result with current main. No blocking findings.

Priority: P3
Reviewed head: a29ea4c745f7e7a7b54804a6d36f16a6e5c26f7b

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow, clean test-only optimization with source-backed boundary justification and focused validation evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored internal test-only change; the PR body provides focused terminal test evidence, and no external contributor proof is required.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored internal test-only change; the PR body provides focused terminal test evidence, and no external contributor proof is required.
Evidence reviewed 6 items Current-main behavior: Current main still imports describePackageManifestContract through the aggregate plugin-test-contracts barrel, so the proposed performance change is not already implemented.
Direct helper is narrow: The target helper only defines the package-manifest contract suite; the aggregate barrel also re-exports registry fixtures, smoke helpers, public-artifact helpers, and public-surface loading.
Aggregate-barrel coverage remains: Sibling registration and testing-harness contract tests continue importing from the aggregate barrel, preserving its independent import and registration coverage.
Findings None None.
Security None None.

How this fits together

Plugin contract tests validate bundled plugin manifests and registration metadata before packaging. This test installs manifest assertions for each bundled plugin, then sends pass/fail results to Vitest.

flowchart LR
  A[Plugin package manifests] --> B[Manifest contract test]
  B --> C{Helper import path}
  C --> D[Direct manifest helper]
  C -. current main .-> E[Aggregate test barrel]
  D --> F[Manifest assertions]
  F --> G[Vitest result]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed; this is a current maintainer PR with no actionable defect in the patch.
Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 1 0

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +1/-1 The patch is a test-only import substitution with no runtime, package, configuration, or SDK export change.

Technical review

Best possible solution:

Retain the manifest test’s direct internal helper import while keeping the aggregate barrel covered by its remaining registration and harness consumers.

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

Not applicable: this is an internal test-load performance optimization, and the PR supplies focused after-change test and timing evidence.

Is this the best way to solve the issue?

Yes. Importing the dedicated helper removes unrelated aggregate-barrel evaluation while sibling tests continue to exercise the barrel itself.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 204416747e8d.

Labels

Label changes:

  • add P3: This is a bounded internal test-performance cleanup with no user-visible runtime behavior change.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored internal test-only change; the PR body provides focused terminal test evidence, and no external contributor proof is required.

Label justifications:

  • P3: This is a bounded internal test-performance cleanup with no user-visible runtime behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored internal test-only change; the PR body provides focused terminal test evidence, and no external contributor proof is required.

Evidence

What I checked:

Likely related people:

  • steipete: Introduced the current manifest helper, aggregate barrel, and consuming test in the merged current-main commit. (role: introduced current test-contract surface; confidence: high; commits: 727a4a621a2e; files: src/plugins/contracts/package-manifest.contract.test.ts, src/plugin-sdk/plugin-test-contracts.ts, src/plugin-sdk/test-helpers/package-manifest-contract.ts)

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

Copy link
Copy Markdown
Contributor Author

Landing evidence for exact head a29ea4c745f7e7a7b54804a6d36f16a6e5c26f7b:

  • Focused post-rebase proof: 3 files / 137 tests passed, including all 46 package-manifest contract tests; registration and testing-harness sibling coverage remained green.
  • Changed plan: core, coreTests, extensions, extensionTests. The actual changed gate passed with exit 0 on Testbox tbx_01m010yga64jen8fv6brxn6630 (run 31840157168); env ratchet 502/502.
  • Exact-head CI: run 31841835585, attempt 1, green including openclaw/ci-gate.
  • Fresh global Codex autoreview against origin/main: clean, no accepted/actionable findings, overall 0.98.
  • Native review artifacts validated READY FOR /prepare-pr with findings []. ClawSweeper's only rank-up move was completion of maintainer review; the native review fulfills it, so no repair lane or re-review is needed.
  • LOC: production +0/-0; tests +1/-1.

Controlled local warm A/B (two warm samples per state, same machine/command shape):

Metric Aggregate barrel Direct helper Change
Wall 1.73 s 1.32 s -23.7%
Vitest 1.40 s 0.197 s -86.0%
Import 1.29 s 0.089 s -93.1%
CPU user+sys 2.175 s 0.705 s -67.6%
Peak RSS 522.0 MiB 223.8 MiB -57.1%

Test-body time stayed approximately flat (~9 ms -> ~12 ms), so the gain is import-graph reduction. These performance numbers are local; the Testbox run proves the changed gate, not the performance delta.

@steipete
steipete merged commit 9f125bc into main Aug 14, 2026
251 checks passed
@steipete
steipete deleted the steipete/test-suite-performance-pass-7-aug14 branch August 14, 2026 21:27
@steipete

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: 🦞 diamond lobster Very strong PR readiness with only minor 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