Repository navigation
perf(test): import package manifest helper directly - #123841
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 5:23 PM ET / 21:23 UTC. ClawSweeper reviewWhat this changesThe PR changes the package-manifest contract test to import its manifest-specific helper directly instead of loading the aggregate plugin test-contracts barrel. Merge readinessKeep 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 Review scores
Verification
How this fits togetherPlugin 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]
Before merge
Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 1 file. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landing evidence for exact head
Controlled local warm A/B (two warm samples per state, same machine/command shape):
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. |
|
Merged via squash.
|
What Problem This Solves
The package-manifest contract test imported one helper through the aggregate
plugin-test-contractstest 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
describePackageManifestContractdirectly 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.jsonandscripts/lib/plugin-sdk-entries.mtscontinue 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=1git diff --check origin/main...HEADpassed.core,coreTests,extensions, andextensionTests.node scripts/check-changed.mjs -- src/plugins/contracts/package-manifest.contract.test.tspassed on Blacksmith Testboxtbx_01m010yga64jen8fv6brxn6630, backed by Actions run 31840157168. The environment-variable ratchet passed at 502/502.origin/mainwithgpt-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:
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.