Repository navigation
test: derive package-root launcher fixtures from their import closure - #188338
Conversation
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a29096ee6a
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,15 +1,14 @@ | |||
| import { collectPackageRootModules } from "./package-root-modules.mts"; | |||
There was a problem hiding this comment.
Include the collector and its inputs in the wrapper inventory
The trusted-anchor extraction in scripts/pr copies only scripts/pr, scripts/pr-lib, and wrapper-components.txt entries. That inventory includes vitest-worker-declarations.mts but not the newly imported package-root-modules.mts, so loading the extracted declaration now throws ERR_MODULE_NOT_FOUND, and the existing PR-wrapper inventory test in test/scripts/eager-import-closure.test.ts detects the missing dependency. Adding only the collector is insufficient: its eager filesystem scan then throws missing entry module node-host-launcher.mjs, which is also absent from the inventory. Include both the collector and its required package-root input closure in the extraction inventory.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR derives launcher fixture files from sibling imports instead of maintaining separate copy lists. Example: cli-invocation.mjs imports node-runtime-env.mjs.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this useful maintainer-authored PR open, but repair the wrapper extraction and compiled-runner regressions before merging. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherTest fixtures and worker compilation consume package-root entry modules and produce isolated runtime trees; the shared declaration registry also enters the trusted PR wrapper and preserved compiled tooling. flowchart TD
A[Package root entry modules] --> B[Sibling import collector]
B --> C[Fixture staging]
B --> D[Worker declaration registry]
C --> E[Isolated runtime trees]
D --> F[Trusted wrapper extraction]
D --> G[Preserved compiled tooling]
Technical reviewBest possible solution: Keep automatic closure collection at staging boundaries while preserving metadata-only consumers and complete trusted extraction inventories. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the missing extraction dependency and incompatible compiled filesystem root, with exact-head CI failures supporting both paths; no target code was executed during this review. Is this the best way to solve the issue? Deriving narrow fixture closures is justified, but eager filesystem work in the shared metadata registry crosses existing extraction and compiled-tooling boundaries. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1891469e2bf5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceTests +43, Other +37. Total +80 across 12 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label 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 30, 2026, 8:58 AM ET / 12:58 UTC. |
a29096e to
2c94805
Compare
Fixtures that stage package-root .mjs launcher modules kept hand-maintained copy lists, so a new sibling import (#182306, #182856) broke integration shards instead of a fast test. Fixtures now compute the closure of their entry modules, and a unit test checks the scanner against a module parser and that packaging includes every sibling import.
…est-line budget check-limits.mts now imports release-context.mjs (#192806); the trusted-harness fixture copies scripts by hand. Raise the test-line scalar by the exact measured gap: +25 lines for package-root closure coverage plus 49 lines of inherited main debt.
2c94805 to
76f017b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76f017bb6a
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1 +1 @@ | |||
| 6326566 | |||
| 6326640 | |||
There was a problem hiding this comment.
Keep the shared test-line ceiling unchanged without approval
This raises the shared ceiling by 74 lines, including the 49 lines of inherited debt described in the commit message, rather than allocating only this change’s justified growth. Root AGENTS.md requires the baseline-exception policy, which explicitly preserves inherited debt and requires approval for scalar-only reconciliation; explaining why the allocation cap rejects the increase does not satisfy that requirement. Keep the scalar unchanged and use a per-change allocation for eligible growth, or obtain explicit approval for this broader reconciliation.
AGENTS.md reference: AGENTS.md:L99-L99
Useful? React with 👍 / 👎.
Integrate main 94bea34 to resolve the inherited test-line gate failure through the canonical #188338 reconciliation. Preserve all 20 reviewed renderer, cache, and backup candidate blobs. Co-authored-by: galiniliev <[email protected]>
…openclaw#188338) Fixtures that staged package-root launcher modules kept about ten hand-maintained copy lists, so a new sibling import (openclaw#182306, openclaw#182856) broke integration shards instead of a fast test. Fixtures now name only their entry modules, and collectPackageRootModules computes the closure. vitestWorkerRuntimeAssets moved out of vitest-worker-declarations into the new module, so the trusted PR-wrapper inventory is unchanged. A unit test checks the scanner against an acorn parse and checks that package.json files includes every sibling import of each packaged root module. The docker harness also stages release-context.mjs (openclaw#192806). The test-line ceiling is raised by the exact measured gap: +25 lines for this coverage plus 49 lines of inherited debt.
What Problem This Solves
Fixes: CI integration shards break with
ERR_MODULE_NOT_FOUNDwhen a package-root launcher module (cli-invocation.mjs,node-runtime-env.mjs, ...) gains a new sibling import. About ten test fixtures copied these modules from independent, hand-maintained lists. On 2026-10-24 that broke CI twice: #182306 (fixed by #182464) and #182856 (fixed by #182990).User Impact
User impact: no user-visible change. Contributors who add a sibling import between package-root
.mjsmodules no longer break unrelated integration shards. A fast unit test names the missing file instead.Why This Change Was Made
scripts/lib/package-root-modules.mtsexportscollectPackageRootModules(entries). It closes entry modules over their./<name>.mjssibling imports: static, re-export, side-effect, and dynamic. Every fixture now names only its entry modules:The computed sets equal the previous hand lists (16 launcher files, 5 worker assets). There are no production code changes.
vitestWorkerRuntimeAssetsmoved fromvitest-worker-declarations.mtsinto the new module, so the declarations file stays pure metadata and the trusted PR-wrapper inventory is unchanged.test/scripts/package-root-modules.test.tsreplaces the single-list check from #182464 and checks three things:.mjs, the scanner matches an acorn parse.package.jsonfilescontains every sibling import of each packaged module, failing asa.mjs -> b.mjs.Evidence
import("./docker-entrypoint.mjs")tocli-invocation.mjsfails the packaging test withcli-invocation.mjs -> docker-entrypoint.mjs.scripts/lib/check-limits.mtsnow importsrelease-context.mjs(fix: stop line-limit checks from blocking release branches #192806), so the harness also stagesrelease-context.mjsandrelease-version.mjs. The trusted-harness test passes locally.Test-line budget
The test-line ceiling is raised manually by exactly 74 lines (6479235 to 6479309, slack 0):
An allocation file can't cover this, because a combined allocation and scalar change exceeds the per-PR credit cap.