improve: doctor migration checks no longer load every bundled plugin runtime (#120678)

* perf(plugins): declare doctor contract surfaces

* perf(doctor): slim migration import closures

* perf(plugins): narrow doctor declaration record surface and wire owner-test lane

Registry records carry only the doctorContract declaration instead of the whole
parsed manifest, and check:changed now selects the src/plugins-owned declaration
honesty and closure-guard tests for extension module/manifest changes so
cross-lane drift cannot pass PR classification.

* fix(doctor): keep control-plane dist imports require-safe

Keep doctor and channel control-plane chunks off exec-class dependencies, and enforce native require(esm) loading during postbuild.

* chore(plugin-sdk): regenerate API baseline

* chore(plugin-sdk): sync export ordering

* fix(plugins): satisfy doctor contract CI boundaries

* perf(doctor): make qqbot doctor closure dependency-light

qqbot was the last plugin above 5s in doctor state-migration enumeration
(~8s under tsx/jiti). The cost was not the state-key builder (already a
leaf): its doctor closure value-imported the runtime-doctor SDK barrel,
whose plugin-state-store/state-db re-exports pull kysely (~330 modules),
plus security-runtime for one fileExists (~200 modules), all resolved
per-module by jiti during enumeration.

Split the migration-define helpers and light re-exports into a new
private-local plugin-sdk/runtime-doctor-migrations subpath; runtime-doctor
re-exports it so its public surface is byte-identical (API baseline hash
unchanged). qqbot's doctor-contract and state-migrations now import only
the light subpath, swapping fileExists for the equivalent async
legacyStateFileExists already in the closure.

qqbot enumeration: ~8.0s/531 modules -> ~0.25s/18 modules.

* chore(plugin-sdk): drop private-local subpath from API baseline

runtime-doctor-migrations is private-local-only; the baseline tracks public
modules, and the earlier line was generated before the classification.

* fix(plugins): register runtime-doctor-migrations boundary paths

The private-local subpath list feeds the extension package boundary map;
the shared paths config and xai's derived overrides must carry the same
entry or the boundary contract test fails.
This commit is contained in:
Peter Steinberger
2026-08-08 13:29:18 -07:00
committed by GitHub
parent bb23b6b5ca
commit da4a656cdb
117 changed files with 2082 additions and 951 deletions
+20
View File
@@ -107,8 +107,11 @@
"!dist/plugin-sdk/markdown-table-runtime.d.ts",
"!dist/plugin-sdk/media-generation-runtime.d.ts",
"!dist/plugin-sdk/memory-core-host-embedding-registry.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-curated.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-embeddings.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-fs.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-qmd.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-schema.d.ts",
"!dist/plugin-sdk/memory-core-host-engine-storage.d.ts",
"!dist/plugin-sdk/memory-core-host-runtime-cli.d.ts",
"!dist/plugin-sdk/memory-core-host-runtime-core.d.ts",
@@ -178,6 +181,7 @@
"!dist/plugin-sdk/request-url.d.ts",
"!dist/plugin-sdk/response-limit-runtime.d.ts",
"!dist/plugin-sdk/retry-runtime.d.ts",
"!dist/plugin-sdk/runtime-doctor-migrations.d.ts",
"!dist/plugin-sdk/runtime-doctor.d.ts",
"!dist/plugin-sdk/runtime-fetch.d.ts",
"!dist/plugin-sdk/sandbox.d.ts",
@@ -400,6 +404,9 @@
"./plugin-sdk/runtime-doctor": {
"default": "./dist/plugin-sdk/runtime-doctor.js"
},
"./plugin-sdk/runtime-doctor-migrations": {
"default": "./dist/plugin-sdk/runtime-doctor-migrations.js"
},
"./plugin-sdk/runtime-env": {
"types": "./dist/plugin-sdk/runtime-env.d.ts",
"default": "./dist/plugin-sdk/runtime-env.js"
@@ -677,6 +684,10 @@
"types": "./dist/plugin-sdk/text-chunking.d.ts",
"default": "./dist/plugin-sdk/text-chunking.js"
},
"./plugin-sdk/agent-scope-runtime": {
"types": "./dist/plugin-sdk/agent-scope-runtime.d.ts",
"default": "./dist/plugin-sdk/agent-scope-runtime.js"
},
"./plugin-sdk/agent-runtime": {
"types": "./dist/plugin-sdk/agent-runtime.d.ts",
"default": "./dist/plugin-sdk/agent-runtime.js"
@@ -1183,13 +1194,22 @@
"./plugin-sdk/memory-core-host-engine-embeddings": {
"default": "./dist/plugin-sdk/memory-core-host-engine-embeddings.js"
},
"./plugin-sdk/memory-core-host-engine-curated": {
"default": "./dist/plugin-sdk/memory-core-host-engine-curated.js"
},
"./plugin-sdk/memory-core-host-engine-foundation": {
"types": "./dist/plugin-sdk/memory-core-host-engine-foundation.d.ts",
"default": "./dist/plugin-sdk/memory-core-host-engine-foundation.js"
},
"./plugin-sdk/memory-core-host-engine-fs": {
"default": "./dist/plugin-sdk/memory-core-host-engine-fs.js"
},
"./plugin-sdk/memory-core-host-engine-qmd": {
"default": "./dist/plugin-sdk/memory-core-host-engine-qmd.js"
},
"./plugin-sdk/memory-core-host-engine-schema": {
"default": "./dist/plugin-sdk/memory-core-host-engine-schema.js"
},
"./plugin-sdk/memory-core-host-engine-storage": {
"default": "./dist/plugin-sdk/memory-core-host-engine-storage.js"
},