Repository navigation
refactor(scripts): migrate JavaScript tools to TypeScript - #121005
Merged
steipete merged 11 commits intoAug 9, 2026
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 9, 2026 08:48
Contributor
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Contributor
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
steipete
force-pushed
the
steipete/typescript-script-declaration-cleanup-b5e899
branch
3 times, most recently
from
August 9, 2026 12:14
beaf13b to
3842cd9
Compare
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 10, 2026
…21005) * refactor(scripts): migrate JavaScript tools to TypeScript * fix(ci): keep changed-scope preflight zero-install * fix(ci): preserve zero-install script owners * fix(ci): complete script migration follow-through * fix(release): keep stable closeout zero-install * fix(scripts): preserve standalone execution boundaries * fix(scripts): repair standalone loader boundaries * fix(scripts): normalize gateway observation ids * fix(scripts): keep Docker packager standalone * test(scripts): preserve rebase cleanup helpers * test(sessions): use tracked temp directory
Rorqualx
pushed a commit
to Rorqualx/cortex
that referenced
this pull request
Aug 23, 2026
Upstream openclaw#121005 deleted scripts/lib/failed-trailer.mjs (migrated to .mts), but fork-owned check-upstream-merge-delta.mjs still imported the .mjs path, crashing the stage-init delta scan and the finish-land gate (line 926). Inline the 15-line helper; a plain .mjs cannot import the migrated .mts.
This was referenced Aug 27, 2026
steipete
added a commit
that referenced
this pull request
Oct 12, 2026
## What Problem This Solves The script tree retains dormant one-off tools and CI inventory rows that its current selector already discards. ## User Impact No user-facing OpenClaw feature or active test selection changes. The maintained `.mts` entrypoints, runtime security checks, and existing CI filter remain in place. ## Why This Change Was Made Delete the 642-line private acceptance probe and 214-line dormant connect installer with their dedicated tests and obsolete test inventory/timing entries. The full reference graph separates package/workflow/docs/skill/config callers from test-only references. The probe has only its dedicated test/timing reference and was last changed September 13 in #146807. The connect wrapper describes itself as dormant and unactivated, has only its dedicated test/Bash inventory references, and was last changed September 27 in #159199. Neither was active this week. Delete 265 literal rows from `ci-proof-test-inventory.mts` that the existing `isOwnerSelectedUiE2eTest` filter already excludes. This is not a change to selection policy: the filter is unchanged and its ordered effective inventory remains 4,098 entries, byte-for-byte identical. The relevant selection policy was established in `cfa5dbf12434053460c60a25ee88fc771c666921` on October 1. Two obsolete five-line `.mjs` aliases are also removed: `check-memory-fd-repro` and `resolve-openclaw-package-candidate`. All current package, workflow, and test callers already use the maintained `.mts` entrypoints; these aliases had no inbound references and no changes since August 9 (#121005). The same reference audit deliberately retained active orphan-looking tools and the iOS sidebar fixture consumed through `OPENCLAW_IOS_ATTENTION_FIXTURE_URL`. No protected PR-tooling closure file changed. Net production reduction: **1,131 lines**, excluding tests and timing data. ## Best-effort tradeoffs accepted None in live behavior. This removes entire uncalled, dormant tools, not their security checks from a maintained path; the CI change removes only rows already filtered out. ## Evidence - Fresh-main reference graph covered 54,316 tracked files, 1,783 scripts and 25,095 edges, including package scripts, workflows/actions, docs, skills, test/runner configs and dynamic resource roots. Independent audit found no live caller or current-week activity for the four deleted tools; all five script targets are outside the 261-file executable PR-tooling closure. - Before/after evaluation of the actual applied commit: all 265 removed rows match the unchanged filter. Ordered effective array SHA-256 stays `048bb0503adb374dbe431844df8c0acc65e0cb42cd44b24c2badea55c3b89ba9`; all three predicates match on 10,279 inputs. Ordered exports and live exempt enumeration also match. - Focused proof: 253 tests passed, including both inventory cases, 140 macOS script cases, 33 maintained memory-FD cases, 61 maintained package-candidate/security cases, lint suppressions and the protected wrapper inventory. Three additional wrapper-extraction cases failed because the existing local install has `mdast-util-from-markdown` 2.0.3 while current main requires 2.1.0. The dependency manifest, lockfile, materializer and failing test are unchanged by this PR. Total wrapper wall time: 443.45 seconds; Vitest reported 397.90 seconds. No timeout, assertion, retry or skip was changed. - Runtime and static cycle checks passed with zero cycles. Independent P0/P1 autoreview was scoped-clean; the applied commit has the identical stable patch ID to that reviewed cut. - Changed-file verification passed all preceding guards, formatting, script types and all four root-test type shards. Script Knip passed with zero entries. The production/full-tree Knip scans both hit their unchanged 600-second deadlines, so the overall command is incomplete at that stage, not green. Its default remote backend did not authenticate or run checks; these are local-fallback results. Full script lint and changed-test lint passed separately. Exact-head hosted CI remains the landing gate. - Hosted CI [run 38204018042](https://github.com/openclaw/openclaw/actions/runs/38204018042) passed at `392e950df000e7dbd095fe9447392d11af7a041c`. Final exact-head census: 177 terminal checks, 79 successful, 97 intentionally skipped, one neutral, no failures or cancellations; dependency/security review and combined CI statuses are successful. No CI reruns or green-only pushes.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 13, 2026
…#169606) ## What Problem This Solves The script tree retains dormant one-off tools and CI inventory rows that its current selector already discards. ## User Impact No user-facing OpenClaw feature or active test selection changes. The maintained `.mts` entrypoints, runtime security checks, and existing CI filter remain in place. ## Why This Change Was Made Delete the 642-line private acceptance probe and 214-line dormant connect installer with their dedicated tests and obsolete test inventory/timing entries. The full reference graph separates package/workflow/docs/skill/config callers from test-only references. The probe has only its dedicated test/timing reference and was last changed September 13 in openclaw#146807. The connect wrapper describes itself as dormant and unactivated, has only its dedicated test/Bash inventory references, and was last changed September 27 in openclaw#159199. Neither was active this week. Delete 265 literal rows from `ci-proof-test-inventory.mts` that the existing `isOwnerSelectedUiE2eTest` filter already excludes. This is not a change to selection policy: the filter is unchanged and its ordered effective inventory remains 4,098 entries, byte-for-byte identical. The relevant selection policy was established in `4544bdc0121b1d8fdc917d456015078338775fac` on October 1. Two obsolete five-line `.mjs` aliases are also removed: `check-memory-fd-repro` and `resolve-openclaw-package-candidate`. All current package, workflow, and test callers already use the maintained `.mts` entrypoints; these aliases had no inbound references and no changes since August 9 (openclaw#121005). The same reference audit deliberately retained active orphan-looking tools and the iOS sidebar fixture consumed through `OPENCLAW_IOS_ATTENTION_FIXTURE_URL`. No protected PR-tooling closure file changed. Net production reduction: **1,131 lines**, excluding tests and timing data. ## Best-effort tradeoffs accepted None in live behavior. This removes entire uncalled, dormant tools, not their security checks from a maintained path; the CI change removes only rows already filtered out. ## Evidence - Fresh-main reference graph covered 54,316 tracked files, 1,783 scripts and 25,095 edges, including package scripts, workflows/actions, docs, skills, test/runner configs and dynamic resource roots. Independent audit found no live caller or current-week activity for the four deleted tools; all five script targets are outside the 261-file executable PR-tooling closure. - Before/after evaluation of the actual applied commit: all 265 removed rows match the unchanged filter. Ordered effective array SHA-256 stays `048bb0503adb374dbe431844df8c0acc65e0cb42cd44b24c2badea55c3b89ba9`; all three predicates match on 10,279 inputs. Ordered exports and live exempt enumeration also match. - Focused proof: 253 tests passed, including both inventory cases, 140 macOS script cases, 33 maintained memory-FD cases, 61 maintained package-candidate/security cases, lint suppressions and the protected wrapper inventory. Three additional wrapper-extraction cases failed because the existing local install has `mdast-util-from-markdown` 2.0.3 while current main requires 2.1.0. The dependency manifest, lockfile, materializer and failing test are unchanged by this PR. Total wrapper wall time: 443.45 seconds; Vitest reported 397.90 seconds. No timeout, assertion, retry or skip was changed. - Runtime and static cycle checks passed with zero cycles. Independent P0/P1 autoreview was scoped-clean; the applied commit has the identical stable patch ID to that reviewed cut. - Changed-file verification passed all preceding guards, formatting, script types and all four root-test type shards. Script Knip passed with zero entries. The production/full-tree Knip scans both hit their unchanged 600-second deadlines, so the overall command is incomplete at that stage, not green. Its default remote backend did not authenticate or run checks; these are local-fallback results. Full script lint and changed-test lint passed separately. Exact-head hosted CI remains the landing gate. - Hosted CI [run 38204018042](https://github.com/openclaw/openclaw/actions/runs/38204018042) passed at `392e950df000e7dbd095fe9447392d11af7a041c`. Final exact-head census: 177 terminal checks, 79 successful, 97 intentionally skipped, one neutral, no failures or cancellations; dependency/security review and combined CI statuses are successful. No CI reruns or green-only pushes.
This was referenced Oct 23, 2026
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
OpenClaw's repository scripts were maintained as JavaScript implementations plus 255 handwritten
scripts/**/*.d.mtsdeclaration sidecars. Every script API change therefore carried a duplicate declaration tax: the runtime source and a parallel type contract could drift, and a dedicated checker, test, package command, CI gate, and changed-lane wiring were needed only to keep those copies aligned.Why This Change Was Made
This migration makes the typed implementation the owner of each eligible script contract. Eligible
scripts/*.mjs,scripts/lib/*.mjs, and necessary source-checkout subdirectory scripts now live as.mtsor.ts; all 255 declaration sidecars and the 697-line declaration checker are removed together with its test and CI/check/lane wiring.Stable documented executable paths remain thin
.mjsshims that load their typed implementations. Scripts that must run directly under plain Node during install, packaging, zero-install, Docker pruning, or loader closure remain JavaScript, including the package-manager warning, bundled-plugin postinstall, Git-hook preparation, postpack, startup-memory check, production-store package inventory, changelog/docs packaging helpers, and docs listing entrypoint. The resulting diff changes 938 files with 48,082 insertions and 50,039 deletions, net -1,957 lines.User Impact
There is no intended end-user behavior change. Contributors get one typed source of truth for script behavior and contracts, while existing documented commands and lifecycle entrypoints keep their stable executable paths.
Evidence
pnpm check:script-declarationsconfirmed all 255 declaration contracts matched their implementations.tbx_01kzjespvfwba1qqq6xdcbb88y: iterative script/root test types and focused behavior — https://github.com/openclaw/openclaw/actions/runs/31296069861tbx_01kzjgpv5eakb9hbrnm7xkrtac:tsgo:scripts,tsgo:test:root,tsgo:all, workflow checks, 1,660 focused migration tests, updater/UI behavior, Knip export scans, andcheck:changedthroughtsgo:all— https://github.com/openclaw/openclaw/actions/runs/31297277245pnpm lint,pnpm deadcode:exports,pnpm check:import-cycles,pnpm tsgo:all, andpnpm buildpassed.node --import tsx scripts/release-check.tspassed package/release inventory.--import tsx.git diff --check origin/main...HEAD, the 9/9 plain-Node lifecycle import smoke, andnode scripts/check-changed.mjs --dry-run -- scripts/check-changed.mjsall passed..mjsowner; the complete audited closure is 10 checked-in files using only Node built-ins or local dependency-free.mjsmodules. The manifest bootstrap now explicitly selects Node 24. The failure runs are preserved as evidence: https://github.com/openclaw/openclaw/actions/runs/31305853722, https://github.com/openclaw/openclaw/actions/runs/31305853753, and https://github.com/openclaw/openclaw/actions/runs/313058537206d0cd214187: 797 focused tests covering every repaired loader/standalone boundary, the exact Windows package-harness failure, and current-main updater fixture cleanup; fulllint:scripts; scripts and root-test tsgo lanes; targeted e2e lint; workflow validation; docs inventory; arbitrary-CWD entrypoint smokes;git diff --check; clean range-diff for seven patch-identical repair commits; and fresh Codex autoreviews for the rebase integration and Windows standalone-graph fix, all TruffleHog-clean with no actionable findings (0.99).tbx_01kzk0vnvgyj3tx6kfw525tqv4: exact deadcode gates,tsgo:all, and full lint shards — https://github.com/openclaw/openclaw/actions/runs/31308273437tbx_01kzk48n2d5g05w45gkf4vmyqw: exact Knip dependency, unused-file, and unused-export gates after restoring standalone script owners — https://github.com/openclaw/openclaw/actions/runs/31310706143tbx_01kzk5jt3fdx77jt47qx0ctf84: final exact Knip dependency, unused-file, and unused-export gates after the remaining loader-boundary repair — https://github.com/openclaw/openclaw/actions/runs/31311661057tbx_01kzk6rc2hjwxqd18c25nmaajf: rebased exact Knip dependency, unused-file, and unused-export gates after integrating currentmain— https://github.com/openclaw/openclaw/actions/runs/31312517038ec94e15eed9: 174 rebase conflict-owner tooling tests, 30 passing Docker packager E2E tests (3 skipped), and fresh focused autoreviews passed. Blacksmith Testboxtbx_01kzkaazt369ph5q6thwhqcwkhpassedtsgo:scripts,tsgo:test:root,lint:scripts, workflow validation, and exact Knip dependency/unused-file/unused-export gates — https://github.com/openclaw/openclaw/actions/runs/31315129367createTempDircall outside the migration surface — https://github.com/openclaw/openclaw/actions/runs/31315494236. The file's canonical tracked temp-directory owner now handles that case; 40 focused tests andtsgo:core:testpassed on Blacksmith Testboxtbx_01kzkb6zk9t2exwqtk87rpc34k— https://github.com/openclaw/openclaw/actions/runs/31315787377ec94e15eed9482717f451f83455757871c5c9193— https://github.com/openclaw/openclaw/actions/runs/31316074497. The latest ClawSweeper review has no code findings, and both rank-up moves are complete.pnpm release:checkreaches unrelated generated locale drift (one missingzh-CNnative entry plus Control UI locale drift). This refactor intentionally does not modify generated locale artifacts.pnpm release:openclaw:npm:checkis inapplicable without a release tag.