Skip to content

fix(ci): declaration suites fail when runtime modules gain new imports - #172913

Merged
steipete merged 1 commit into
mainfrom
test/declaration-fixture-closure
Oct 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/declaration-fixture-closure

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the tsdown declaration suites fail with ERR_MODULE_NOT_FOUND on 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) broke dist-artifact-ownership, write-plugin-sdk-entry-dts, write-unified-entry-dts and tsdown-declaration-resolution until 54921ca added one line to test/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):

  • resolveTsdownDeclarationGeneratorInputs for both declaration writers. This is the writers' own cache-input owner, built on the same runtime-import-closure.mts module the PR wrapper inventory checks use.
  • The static collectRuntimeImportClosure of those sources, scripts/build-all.mts and scripts/lib/dist-artifact-ownership.mts (loaded by runUnifiedBuild), 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, which tsdown.config.ts passes 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.mts it reaches about 11,100 files in 36–65s. The generator owner already follows the literal dynamic imports that matter here (managed-memory.mts on Linux, managed-windows-job.mts on 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.md is unchanged; that note's description of the fixture is updated. scripts/pr-lib/wrapper-components.txt intentionally stays a committed manifest: scripts/pr reads it from anchor commits via git 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 head 61efe4fd017a43f87918fc0320240b4c29bd6ce2 (wall times):

Suite Result
test/scripts/write-unified-entry-dts.test.ts 11 passed (137.09s)
test/scripts/write-plugin-sdk-entry-dts.test.ts 10 passed, 1 skipped (115.11s)
test/scripts/tsdown-declaration-resolution.test.ts 22 passed, 3 Windows-only skipped (154.94s)
test/scripts/dist-artifact-ownership.test.ts 32 passed (174.13s)
test/scripts/pr-wrapper-source-closure.test.ts 3 passed (25.26s)

Negative controls (run against the derived set, then reverted):

  • Owner gap reproduces the incident. Filtering src/infra/runtime-process-manifest.ts out of the derived set fails the narrow write-plugin-sdk-entry-dts case with ERR_MODULE_NOT_FOUND: Cannot find module '<fixture>/Project/src/infra/runtime-process-manifest.ts' imported from <fixture>/Project/src/infra/runtime-process-entrypoints.ts.
  • New imports are picked up automatically. Adding src/infra/runtime-process-probe.ts and import "./runtime-process-probe.ts"; to runtime-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.ts names the probe as missing from wrapper-components.txt, as intended for that anchored manifest.

Path aliasing: the set is computed against fs.realpathSync of 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-resolution exercised the nested .claude/worktrees/validation and 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) and git diff --check pass. After pnpm install --frozen-lockfile refreshed this worktree's dependencies, pnpm tsgo:test:root passed all four shards (88.99s wall time). Linux proof via the supported Crabbox wrapper on Blacksmith Testbox tbx_01m4z7k1st3av53fk7014h2f75 passed all four declaration suites sequentially with --maxWorkers=1 on 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.ts already derives from collectRuntimeImportClosure and narrows src/ on purpose for its SDK compile scope. dist-artifact-fixture.ts copies 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:

Job Result and declaration proof
checks-node-compact-large-1 (116309147916) Success; unified 11 passed
checks-node-compact-small-2 (116309147920) Success; SDK 10 passed, 1 Windows-only skipped
checks-node-compact-small-1 (116309147929) Failure in separate partition test; resolution 21 passed/4 platform or filesystem skips, ownership 32 passed
checks-node-changed (116309148081) Success
checks-node-changed-boundary (116309147979) Success
Windows job `matrix.check_name
openclaw/ci-gate (116311693894) Failure from the partition test

pnpm test:ci-failed 172913 was 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 is test/scripts/test-projects.test.ts → Windows CI partitions → keeps explicit coverage disjoint without repeating small project setup: expected tooling and infra shared configs, but received test/vitest/vitest.plugins.config.ts as 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 exact origin/main (f3f61f8474f8ba2574132f82a3778605d0f6ced3) bytes (107.50s wall). A finally block restored all PR bytes. This establishes an inherited failure at the rebased base despite the older scheduled-main classification. Base commit a10d95485b5d added src/plugins/plugin-source-capture-path.test.ts to 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 derived openclaw/ci-gate (job 116311693894). The failing case is test/scripts/test-projects.test.ts > Windows CI partitions > keeps explicit coverage disjoint without repeating small project setup, which received an extra test/vitest/vitest.plugins.config.ts. #172769 (a10d95485b5d) registered src/plugins/plugin-source-capture-path.test.ts in 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 fix d09442030ed8 removes that duplicate registration. Matching-signature baseline: scheduled-main run 38699948035, head 47b0a1cc734cbfc5dd7fc40548bd5c8ec6bdac87, failed job 116305824024 (checks-node-compact-small-44, shard core-tooling-14-hosted-2) with the identical case, expected [ …(3) ] to deeply equal [ …(2) ], and extra test/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_01m4za1pnq28k3xt5esh3xmxr0 was 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@steipete
steipete marked this pull request as ready for review October 15, 2026 07:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T07:48:57.189608Z 61efe4f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Declaration fixtures fail with ERR_MODULE_NOT_FOUND until someone adds the module to their copy list.
  • After: The fixture follows the import and copies runtime-process-manifest.ts automatically.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful fixture repair with no identified defects and substantial compiler-harness evidence; Windows-specific coverage remains unexercised on this head.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-fixture PR is outside the contributor runtime-proof gate; its body supplies compiler-suite results and targeted negative controls for the changed source-copy behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers lose declaration CI coverage when ordinary runtime import extraction leaves the reduced fixture incomplete.
Reason: The maintainer-authored change removes a demonstrated recurring source of fixture failures through existing owners without expanding product behavior or weakening assertions.

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
Reviewed head: 61efe4fd017a43f87918fc0320240b4c29bd6ce2

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Windows 8.3 and junction cases were skipped on this head; supplied Linux and macOS evidence exercises the changed fixture through real declaration writers and compilers.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Private compiler fixture and synthetic declaration contracts keeps the original intent (0c82ca6: Provide bounded real-compiler coverage for declaration output, cache reuse, failure, and cleanup without copying the full source graph.)
  • Generator input ownership keeps the original intent (4015f0b: Track transitive executable generator inputs instead of invalidating declarations for every scripts-directory edit.)
  • Concurrent declaration case lifecycle keeps the original intent (53cc262: Run independent compiler commands concurrently while retaining private physical inputs, owned children, deadlines, and cleanup.)
  • Fixture owner selection policy keeps the original intent (d46d562: Keep runtime owner paths out of static PR-selection edges because broader selection had measured CI cost disproportionate to escaped fixture failures.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 53cc262 adds test/scripts/tsdown-declaration-fixture.ts:31 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 53cc262cc619; files: test/scripts/tsdown-declaration-fixture.ts)

PR surface

Tests +4, Docs 0. Total +4 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 75 71 +4
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 77 73 +4

Labels

Label changes:

  • add P2: A demonstrated declaration-fixture maintenance defect interrupts CI coverage but does not change shipped runtime behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A demonstrated declaration-fixture maintenance defect interrupts CI coverage but does not change shipped runtime behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 4:14 AM ET / 08:14 UTC.

@steipete
steipete merged commit 23b9e28 into main Oct 15, 2026
168 of 173 checks passed
@steipete
steipete deleted the test/declaration-fixture-closure branch October 15, 2026 08:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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