Repository navigation
fix(ci): declaration suites fail when runtime modules gain new imports - #172913
Conversation
The shared tsdown declaration fixture copied real source bytes from three hand-maintained lists: ten scripts, the whole scripts/lib directory, and 28 runtime owners. Extracting src/infra/runtime-process-manifest.ts (5c34fc6) left it off the owner list, so the four declaration suites failed with ERR_MODULE_NOT_FOUND inside the reduced copy on Linux and Windows until 54921ca added the line. Compute the copy at run time instead: the declaration writers' own resolveTsdownDeclarationGeneratorInputs closure for both writers, plus the static collectRuntimeImportClosure of those sources, build-all.mts, dist-artifact-ownership.mts and the URL-selected Windows job launcher. Tests that execute another script or config pass it as an extra entrypoint instead of hand-copying it. The copy shrinks from 588 to 109 files; three stale owner entries that nothing imports any more drop out. The set is computed at run time, so owner edits still add no static import edges and CI selection is unchanged. scripts/pr-lib/wrapper-components.txt stays a committed manifest: scripts/pr reads it from anchor commits, and its existing closure check already names missing imports.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR derives declaration fixture sources from existing import-closure owners instead of maintaining source-copy lists. Example: runtime-process-entrypoints.ts imports the extracted runtime-process-manifest.ts module.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this useful maintainer-authored PR open: it addresses a demonstrated fixture failure mechanism still present on main, with no actionable patch defects found; the failing CI check is inherited. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared test fixture copies build tooling and selected runtime sources into isolated projects, where declaration suites execute real writers and compilers and inspect their outputs. flowchart LR
A[Declaration writer entrypoints] --> B[Generator input resolver]
B --> C[Static import closure]
D[Additional test entrypoints] --> C
C --> E[Isolated declaration fixture]
E --> F[Real writers and compilers]
F --> G[Declaration assertions]
Technical reviewBest possible solution: Retain the closure-derived fixture and handle the unrelated inherited CI failure through the repository's native landing workflow. Do we have a high-confidence way to reproduce the issue? Source shows why an unlisted relative dependency is absent from the isolated project, and the incident repair plus the body's missing-manifest negative control establish the failure path; this review executed no reproduction. Is this the best way to solve the issue? Reusing the canonical generator-input owner and supplementing its opaque compiler sources with static traversal addresses the fixture producer directly while preserving isolation, synthetic configuration, and the accepted CI selection policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2c4d5f0397a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +4, Docs 0. Total +4 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 4:14 AM ET / 08:14 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
openclaw#172913) The shared tsdown declaration fixture copied real source bytes from three hand-maintained lists: ten scripts, the whole scripts/lib directory, and 28 runtime owners. Extracting src/infra/runtime-process-manifest.ts (7b3c702) left it off the owner list, so the four declaration suites failed with ERR_MODULE_NOT_FOUND inside the reduced copy on Linux and Windows until 854ade4 added the line. Compute the copy at run time instead: the declaration writers' own resolveTsdownDeclarationGeneratorInputs closure for both writers, plus the static collectRuntimeImportClosure of those sources, build-all.mts, dist-artifact-ownership.mts and the URL-selected Windows job launcher. Tests that execute another script or config pass it as an extra entrypoint instead of hand-copying it. The copy shrinks from 588 to 109 files; three stale owner entries that nothing imports any more drop out. The set is computed at run time, so owner edits still add no static import edges and CI selection is unchanged. scripts/pr-lib/wrapper-components.txt stays a committed manifest: scripts/pr reads it from anchor commits, and its existing closure check already names missing imports.
What Problem This Solves
Fixes: the tsdown declaration suites fail with
ERR_MODULE_NOT_FOUNDon Linux and Windows CI whenever a runtime module the declaration build loads gains a new relative import, because the shared fixture copied real sources from a hand-maintained list.On 2026-10-14, extracting
src/infra/runtime-process-manifest.ts(5c34fc6) brokedist-artifact-ownership,write-plugin-sdk-entry-dts,write-unified-entry-dtsandtsdown-declaration-resolutionuntil 54921ca added one line totest/scripts/tsdown-declaration-fixture.ts. That cost two hourly runs of real coverage.User Impact
No user-visible change. For developers, extracting or adding a relative runtime import no longer requires editing a test fixture list, and the declaration suites no longer go red on main for that reason.
Why This Change Was Made
The fixture now computes its real-byte copy at run time from the existing closure owners instead of three hand lists (ten scripts, all of
scripts/lib, and 28 runtime owners):resolveTsdownDeclarationGeneratorInputsfor both declaration writers. This is the writers' own cache-input owner, built on the sameruntime-import-closure.mtsmodule the PR wrapper inventory checks use.collectRuntimeImportClosureof those sources,scripts/build-all.mtsandscripts/lib/dist-artifact-ownership.mts(loaded byrunUnifiedBuild), plus the Windows job launcher, which is selected by URL and has no import edge.Tests that execute an extra script or config (
build-workspace-package.mts,tsdown.ai.config.ts) pass it as an extra entrypoint instead of hand-copying it, so its imports come along too. The copy shrinks from 588 to 109 files. Three stale owner entries that nothing imports any more drop out (pid-alive.ts,windows-process-start.ts,process-env.ts, left over from before the live-Gateway dist fence became lazy).tsconfig.packages.json, whichtsdown.config.tspasses by path to package declaration builds (#171658), stays an explicit fixture input because it is compiler configuration, not an import edge.Dynamic traversal is deliberately not used for the supplemental walk: through
scripts/lib/live-gateway-dist-fence.mtsit reaches about 11,100 files in 36–65s. The generator owner already follows the literal dynamic imports that matter here (managed-memory.mtson Linux,managed-windows-job.mtson Windows).The set is computed at run time, so owner edits still add no static import edges and the CI selection tradeoff recorded under "Declaration-fixture owner selection" in
.agents/skills/openclaw-ci-limits/SKILL.mdis unchanged; that note's description of the fixture is updated.scripts/pr-lib/wrapper-components.txtintentionally stays a committed manifest:scripts/prreads it from anchor commits viagit show, and its existing closure check already names missing imports. No test assertions changed.Evidence
Local macOS,
node scripts/run-vitest.mjs <file> --maxWorkers=1, rebased head61efe4fd017a43f87918fc0320240b4c29bd6ce2(wall times):test/scripts/write-unified-entry-dts.test.tstest/scripts/write-plugin-sdk-entry-dts.test.tstest/scripts/tsdown-declaration-resolution.test.tstest/scripts/dist-artifact-ownership.test.tstest/scripts/pr-wrapper-source-closure.test.tsNegative controls (run against the derived set, then reverted):
src/infra/runtime-process-manifest.tsout of the derived set fails the narrowwrite-plugin-sdk-entry-dtscase withERR_MODULE_NOT_FOUND: Cannot find module '<fixture>/Project/src/infra/runtime-process-manifest.ts' imported from <fixture>/Project/src/infra/runtime-process-entrypoints.ts.src/infra/runtime-process-probe.tsandimport "./runtime-process-probe.ts";toruntime-process-entrypoints.ts, with no list edits, grows the derived set from 109 to 110 with the probe copied, and the same case passes.pr-wrapper-source-closure.test.tsnames the probe as missing fromwrapper-components.txt, as intended for that anchored manifest.Path aliasing: the set is computed against
fs.realpathSyncof the source root, the same physical root the generator owner returns paths under, and never compares fixture-root paths with source-root paths. A symlinked source-root alias produced the identical 109 paths.tsdown-declaration-resolutionexercised the nested.claude/worktrees/validationand directory/case alias cases locally; the Windows 8.3 and Windows junction cases require Windows. This PR's CI plan skipped the Windows job, so those cases remain unproven on this head.Format (
oxfmt --check), type-aware lint (run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.test.root.json) andgit diff --checkpass. Afterpnpm install --frozen-lockfilerefreshed this worktree's dependencies,pnpm tsgo:test:rootpassed all four shards (88.99s wall time). Linux proof via the supported Crabbox wrapper on Blacksmith Testboxtbx_01m4z7k1st3av53fk7014h2f75passed all four declaration suites sequentially with--maxWorkers=1on the exact rebased source: unified 11 passed (26.05s), SDK 10 passed/1 Windows-only skipped (21.04s), resolution 21 passed/4 platform or filesystem skips (20.68s), ownership 32 passed (27.18s). The focused workflow requested 4-class; the box reported 2 available CPUs and 8.22 GB RAM. Allocation took 4.5s; the wrapper completed with exit 0. The task-owned lease was stopped after proof; remote settlement is complete. Its Actions run 38699379018 is cancelled by lease cleanup; the payload and wrapper exited 0. The first stop timed out during reconciliation; exact-ID inspection confirmed completion before retrying settlement. Codex autoreview through P2 is clean.A sweep of other reduced-copy fixtures found none with the same hand-maintained src owner list.
prepare-extension-package-boundary-artifacts.native.test.tsalready derives fromcollectRuntimeImportClosureand narrowssrc/on purpose for its SDK compile scope.dist-artifact-fixture.tscopies whole directories, and a static closure there would drop platform-lazy imports.CI run 38700920288 completed failure on the exact rebased head; the bounded repository watcher emitted
FAILING. All four declaration suites passed on Linux:checks-node-compact-large-1(116309147916)checks-node-compact-small-2(116309147920)checks-node-compact-small-1(116309147929)checks-node-changed(116309148081)checks-node-changed-boundary(116309147979)openclaw/ci-gate(116311693894)pnpm test:ci-failed 172913was run once. Its classification is new, because the matching job in scheduled-main run 38694591842 passed; the report explicitly says selected scope was not compared. The failure istest/scripts/test-projects.test.ts→Windows CI partitions→keeps explicit coverage disjoint without repeating small project setup: expected tooling and infra shared configs, but receivedtest/vitest/vitest.plugins.config.tsas a third config. The exact case fails on this PR head (150.54s wall) and identically with all three PR-changed files temporarily replaced by their exactorigin/main(f3f61f8474f8ba2574132f82a3778605d0f6ced3) bytes (107.50s wall). Afinallyblock restored all PR bytes. This establishes an inherited failure at the rebased base despite the older scheduled-main classification. Base commita10d95485b5daddedsrc/plugins/plugin-source-capture-path.test.tsto Windows part 2; part 1 already selected a plugin-config test, producing the extra shared config. No assertions were weakened, no CI rerun/dispatch was requested, and no follow-up code push was made. The inherited-only failure is handled through the native landing exception.Inherited CI failure
CI run 38700920288, attempt 1, failed only
checks-node-compact-small-1(job 116309147929) and its derivedopenclaw/ci-gate(job 116311693894). The failing case istest/scripts/test-projects.test.ts > Windows CI partitions > keeps explicit coverage disjoint without repeating small project setup, which received an extratest/vitest/vitest.plugins.config.ts. #172769 (a10d95485b5d) registeredsrc/plugins/plugin-source-capture-path.test.tsin Windows part 2 while part 1 already selected the plugins project. The case also failed with every PR file restored to the recorded main baseline bytes; this PR does not change the partition inputs. Main fixd09442030ed8removes that duplicate registration. Matching-signature baseline: scheduled-main run 38699948035, head47b0a1cc734cbfc5dd7fc40548bd5c8ec6bdac87, failed job 116305824024 (checks-node-compact-small-44, shardcore-tooling-14-hosted-2) with the identical case,expected [ …(3) ] to deeply equal [ …(2) ], and extratest/vitest/vitest.plugins.config.ts. Main uses a different shard layout, so matching by compact-small job suffix alone misses this baseline. The failed CI remains recorded as failure; no rerun or branch refresh was requested.Optional Windows proof: Blacksmith Testbox
tbx_01m4za1pnq28k3xt5esh3xmxr0was queued rather than granted immediately and was stopped (completed) without executing tests. No Windows run URL was assigned. The Windows 8.3/junction cases remain unproven on this exact head; existing macOS/Linux proof is unchanged.