Repository navigation
refactor(scripts): separate syntax parsing from import resolution - #164243
Conversation
Use the pinned native TypeScript standalone syntax API inside the runtime import graph. Keep compiler-based configuration and module resolution with the existing outer project. Validation: independent source review and Linux parser/graph contract parity passed. Whole-command timing and consumer/static checks remain pending remote admission.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 3, 2026, 8:46 AM ET / 12:46 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR parses import syntax directly with native TypeScript while retaining compiler-based dependency resolution, making repository validation and build-input discovery faster. Merge readiness✅ Ready for maintainer review The optimization remains useful on current main, and the pinned patch has no actionable correctness findings. The recorded command benchmark supports the performance claim; the failed CI assertion concerns a main-side import edge rather than an established defect introduced here. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's import-graph tooling reads source files and compiler configuration to discover dependencies without executing them. Boundary checks and build tooling consume the resulting dependency graph. flowchart TD
A[Source files] --> B[Standalone syntax parser]
B --> C[Selected import references]
D[Compiler configuration] --> E[Compiler module resolution]
C --> E
E --> F[Dependency graph]
F --> G[Boundary checks and build inputs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther -2. Total -2 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep syntax extraction lightweight and leave configuration, package conditions, and dependency resolution with the existing compiler owner. Do we have a high-confidence way to reproduce the issue? Not applicable to a bug reproduction: this is a performance refactor, supported by recorded baseline and candidate runs of the actual affected command. Is this the best way to solve the issue? Yes. The standalone parser removes unnecessary compiler-project work while preserving the existing resolution owner and dependency contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3bfa7cd91059. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
/allow-dependencies-change |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* origin/main: fix(test): restore fixture state and await async completion (#164222) refactor(sessions): stage and settle pending inputs in workers (#164284) fix: speech-only replies fail when models include reasoning (#164285) fix(nextcloud-talk): avoid webhook migration for unconfigured channels fix: guide background skill reviews through Workshop proposals (#164292) test(build): reject AI dependencies in retained config repairs refactor(channels): require canonical private-network settings (#163535) fix(memory): migrate embedding cache in bounded batches and record oversized rows (#164303) feat(state): incognito actor memory and Codex history routing (P5c, inactive) (#164224) refactor(synology-chat): remove unused route account ID (#164280) test(ui): await web push preference publications (#164295) perf(scripts): avoid compiler projects for runtime import parsing (#164243) fix(worktrees): create workspaces from nested Windows repositories (#164249) test(agents,channels,cli): remove low-value tests (batch d173) (#164302) perf(workboard): serve cards per board revision and push changes instead of polling (#164301) refactor(sqlite): deslop sqlite stores (#164271) chore(ui): refresh control ui locales (#164299) refactor(events): deslop listener and disposal plumbing (#164221) fix: canonicalize fresh worker reasoning signatures (#164287)
…enclaw#164243) Use the pinned native TypeScript standalone syntax API inside the runtime import graph. Keep compiler-based configuration and module resolution with the existing outer project. Validation: independent source review and Linux parser/graph contract parity passed. Whole-command timing and consumer/static checks remain pending remote admission.
What Problem This Solves
The Control UI import-boundary check and build dependency discovery create a compiler project for each file even when they only need its import syntax. Parsing that syntax directly cuts the measured Control UI check's whole-command time by 52%.
User Impact
Faster repository validation and dependency discovery, with no intended product behavior change. On one Linux x64 Testbox, the existing Control UI import-boundary command averaged 9.32 seconds before and 4.47 seconds after. This is a focused test-command result, not a whole-suite or production-runtime claim.
Why This Change Was Made
Use the pinned native TypeScript
API.createSourceFilefor syntax extraction. The existing outer compiler project continues to own configuration and module resolution, including late roots and import/require conditions. The change removes the inner per-file project without changing assertions, fixtures, test selection, or deadlines.Evidence
Independent review found no actionable findings. The committed candidate bytes match the verified baseline/candidate proof on source
ca77256127e6ba13c00d68bca42194d1b9e2a780.The contiguous A–B–B–A comparison ran
node scripts/run-vitest.mjs test/control-ui-import-boundary.test.tson the same native Blacksmith Testbox, using Node 24.19.0, Linux x64, four available CPUs, and 16,555,134,976 bytes of reported system memory. All four runs passed the same single test. No source rewrite or cache reset occurred between B1 and B2.Mean wall time fell 52.04% (9.32 → 4.47 seconds); mean CPU time fell 47.51% (11.955 → 6.275 seconds). Both candidate runs beat both baselines.
be50da254e0ebc799c3e0c2e2b1bdfc752ba76b005f544eb7f8861ae45165476. The holder job was later cancelled by canonical lease cleanup after the benchmark and a separate discovery invocation had both settled; the benchmark command and result receipts passed independently.Hosted CI attribution
Exact-head CI run passed the boundary, lint, production-type, and test-type checks but failed the changed-test shard's
get-reply.imports.test.tsassertion: the inline-actions closure reachesskills/library/errors.ts.The actual CI merge was
16c62eb647d63436a7d699437d2ea596f9294b1e, incorporating basea6748f0731aade9063e07e905bf88ca6721221c3. Independent source tracing found the new value edge in main commita06f24e1edb6a4b25873ff60dd4f139b855609b9(#164165):openclaw-state-worker-error-identity.tsimportsSkillLibraryError. The preceding path to the worker-error adapter is unchanged from this PR's frozen base; the main-side import in the error-identity module is the new edge. This PR changes onlyscripts/lib/runtime-import-closure.mts.The main-source origin is verified; the exact CI merge has not been rerun with the baseline parser through the Bun shard route. The red result is retained, with no assertion change, CI rerun, or push to obtain green.
Post-merge verification
Merged as
e9edca4c578317b03b56b67a4b6fec44032e64d1. A fresh-descendant smoke at main9a190f34b9c3198e40b43bdbd0f802088ea631d5passed the fulltest/control-ui-import-boundary.test.tscommand: one file and one case on Node 24.19.0, Linux x64, four available CPUs. The landed helper bytes matched the reviewed candidate, both the managed command and wrapper joined, and the source remained unchanged. This is post-merge correctness proof, with no new speed comparison. Post-merge Testbox run. Its holder was subsequently stopped after the smoke and a separate diagnostic had settled.The merge-push CI run succeeded with only security-fast executed; its skipped test jobs are not counted as UI test proof.