chore(tooling): typecheck scripts/** with a dedicated tsgo lane#104348
Conversation
Typing-only except bugs the lane surfaced: gh-read timeout race, Discord Headers spread dropping entries, undefined allowedHeadBranches match, plugin-boundary matchAll crash. Deletes retired config keys from fixtures/benches (prompt snapshots regenerated, config dump only) and the orphaned non-runnable sync-moonshot-docs script. Adds full-surface .d.mts declarations for existing .mjs boundaries.
| duplex: "half", | ||
| }); | ||
| } as RequestInit & { duplex: "half" }; | ||
| const upstreamRes = await fetch(upstreamUrl, upstreamInit); |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4de962efd8
ℹ️ 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".
| // E2E clients import built dist artifacts and are validated by Docker runs, | ||
| // so they cannot join this source-only program. | ||
| "scripts/e2e/**" |
There was a problem hiding this comment.
Align the scripts lane with excluded e2e TypeScript files
When editing any existing scripts/e2e/**/*.ts file, scripts/changed-lanes.mjs still classifies it into lanes.scripts and check:changed schedules tsgo:scripts, but this exclusion removes the changed file from the tsgo:scripts program. That makes the new scripts typecheck lane report coverage without actually checking those files; either keep e2e TS paths out of the scripts lane or include the intended subset here.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…claw#104348) * feat(tooling): add tsgo typecheck lane for scripts/** * fix(scripts): burn down scripts type debt surfaced by the new lane Typing-only except bugs the lane surfaced: gh-read timeout race, Discord Headers spread dropping entries, undefined allowedHeadBranches match, plugin-boundary matchAll crash. Deletes retired config keys from fixtures/benches (prompt snapshots regenerated, config dump only) and the orphaned non-runnable sync-moonshot-docs script. Adds full-surface .d.mts declarations for existing .mjs boundaries.
- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks, fixtures excluded; two Docker E2E clients that import built dist/** stay out, same rationale as the scripts/e2e exclusion in tsconfig.scripts.json) - tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348) - changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig now trigger 'typecheck test root' in check:changed; previously test/ paths ran lint only, so harness type errors surfaced first in CI (#104287 envDir case) - burn down all 1071 latent type errors in the program: precise param/local types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e program members; 205 sibling .d.mts declaration files for imported .mjs modules (committed separately); zero any, zero ts-expect-error - resolve the pre-existing testing star-export ambiguity in scripts/e2e/parallels/common.ts with an explicit re-export Closes #104388
…04475) * chore(types): add declaration files for scripts/lib and scripts/e2e modules * chore(types): add declaration files for top-level script modules (a-m) * chore(types): add declaration files for top-level script modules (n-z) * test: use a non-secret-shaped gateway token fixture * test: type ci workflow guard helpers for the root test lane * chore(tooling): typecheck root test/** with a dedicated tsgo lane - test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks, fixtures excluded; two Docker E2E clients that import built dist/** stay out, same rationale as the scripts/e2e exclusion in tsconfig.scripts.json) - tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348) - changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig now trigger 'typecheck test root' in check:changed; previously test/ paths ran lint only, so harness type errors surfaced first in CI (#104287 envDir case) - burn down all 1071 latent type errors in the program: precise param/local types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e program members; 205 sibling .d.mts declaration files for imported .mjs modules (committed separately); zero any, zero ts-expect-error - resolve the pre-existing testing star-export ambiguity in scripts/e2e/parallels/common.ts with an explicit re-export Closes #104388 * chore(types): correct declaration fidelity per structured review - re-derive 51 .d.mts files from implementation data flow instead of initializers: fix a wrong never return (runTestProjectsDelegation returns the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore the full release profile union, make parsed paths string | null, add missing parseArgs fields via help/non-help unions, add a missing sibling declaration (budget-number-args), drop 15 unused lint directives - precise install-record/tuple typing removes the type-aware oxlint regressions the first declarations caused in scripts/e2e implementations - route .mts declaration edits under test/ to the testRoot lane and reference the test-root project from tsconfig.projects.json so tsgo:all covers it (closes both review findings against the lane wiring) * chore(scripts): keep telegram runner dist typing structural for the boundary guard * chore(types): declare runtime pack and gateway readiness exports added on main * test: pin the importTargetPlan form of the plugin-contract plan import The guard expectation still referenced the raw await import( form that 7ae5996 (#103975) replaced with the importTargetPlan fallback helper; the assertion fails on current main.
…claw#104348) * feat(tooling): add tsgo typecheck lane for scripts/** * fix(scripts): burn down scripts type debt surfaced by the new lane Typing-only except bugs the lane surfaced: gh-read timeout race, Discord Headers spread dropping entries, undefined allowedHeadBranches match, plugin-boundary matchAll crash. Deletes retired config keys from fixtures/benches (prompt snapshots regenerated, config dump only) and the orphaned non-runnable sync-moonshot-docs script. Adds full-surface .d.mts declarations for existing .mjs boundaries.
…enclaw#104475) * chore(types): add declaration files for scripts/lib and scripts/e2e modules * chore(types): add declaration files for top-level script modules (a-m) * chore(types): add declaration files for top-level script modules (n-z) * test: use a non-secret-shaped gateway token fixture * test: type ci workflow guard helpers for the root test lane * chore(tooling): typecheck root test/** with a dedicated tsgo lane - test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks, fixtures excluded; two Docker E2E clients that import built dist/** stay out, same rationale as the scripts/e2e exclusion in tsconfig.scripts.json) - tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and the ci.yml test-types shard, mirroring the tsgo:scripts lane (openclaw#104348) - changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig now trigger 'typecheck test root' in check:changed; previously test/ paths ran lint only, so harness type errors surfaced first in CI (openclaw#104287 envDir case) - burn down all 1071 latent type errors in the program: precise param/local types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e program members; 205 sibling .d.mts declaration files for imported .mjs modules (committed separately); zero any, zero ts-expect-error - resolve the pre-existing testing star-export ambiguity in scripts/e2e/parallels/common.ts with an explicit re-export Closes openclaw#104388 * chore(types): correct declaration fidelity per structured review - re-derive 51 .d.mts files from implementation data flow instead of initializers: fix a wrong never return (runTestProjectsDelegation returns the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore the full release profile union, make parsed paths string | null, add missing parseArgs fields via help/non-help unions, add a missing sibling declaration (budget-number-args), drop 15 unused lint directives - precise install-record/tuple typing removes the type-aware oxlint regressions the first declarations caused in scripts/e2e implementations - route .mts declaration edits under test/ to the testRoot lane and reference the test-root project from tsconfig.projects.json so tsgo:all covers it (closes both review findings against the lane wiring) * chore(scripts): keep telegram runner dist typing structural for the boundary guard * chore(types): declare runtime pack and gateway readiness exports added on main * test: pin the importTargetPlan form of the plugin-contract plan import The guard expectation still referenced the raw await import( form that 7250680 (openclaw#103975) replaced with the importTargetPlan fallback helper; the assertion fails on current main.
Addresses openclaw#104386. Two preventive tooling hardenings: 1. Enables `typescript/no-floating-promises` in .oxlintrc.json to catch unawaited promises in the async-heavy gateway codebase. Adds the generated A2UI bundle to ignorePatterns. 2. Splits DOM globals from Node-side typechecking by creating tsconfig.ui.json for ui/** with DOM libs, while tsconfig.core.json now uses only ES2023 for src/** and packages/**. Changes: - .oxlintrc.json: adds no-floating-promises rule and a2ui.bundle.js ignore - tsconfig.core.json: removes DOM libs and ui/**, uses ES2023 only - tsconfig.ui.json: new DOM-enabled project for ui/** - tsconfig.core.projects.json: references tsconfig.ui.json Intentionally avoids package.json changes to prevent Dependency Guard bot blocking. The tsgo:ui command can be added separately if needed. Follow-up to openclaw#104348 (scripts tsgo lane) and openclaw#104313 (harness hardening).
Closes #104313
What Problem This Solves
Resolves a coverage gap where
scripts/**TypeScript files — including release checks, release verifiers, and build-pipeline scripts — were never typechecked. They only received type-aware linting, so ~413 type errors accumulated silently and would surface only at runtime undertsx, in the worst case during a release. PR #104239 explicitly deferred this because the debt could not be hidden behind a config-only change.Why This Change Was Made
Adds a root
tsconfig.scripts.jsonlane (strict,noUnusedLocals/noUnusedParameters, same base as the core/extensions lanes) that coversscripts/**and excludes onlyscripts/e2e/**, whose clients import builtdist/**artifacts and are validated by their own Docker runs. The lane is wired intopnpm tsgo:scripts,tsgo:all(project references),scripts/check.mjs, the CItest-typesshard, andcheck:changedrouting (newscriptslane inchanged-lanes.mjs, covered by table-driven tests).The 413-error burn-down is typing-only except for genuine bugs it surfaced:
scripts/gh-read.ts: the fetch-timeout wrapper never passed its timeout promise into the callback, so the callback's inner race silently omitted the timeout.scripts/openclaw-cross-os-release-checks.ts: Discord fetch init spread aHeadersInitobject; spreading aHeadersinstance yields no entries, dropping caller headers. Now normalized throughnew Headers(...).scripts/lib/release-beta-verifier.ts:allowedHeadBranchesembeddedundefinedwhen--workflow-refwas unset, which would wrongly match a workflow run with a missing head branch. Now built conditionally.scripts/plugin-boundary-report.ts: guarded amatchAllon a possibly-undefined record field that would have thrown at runtime.tools.profiles, heartbeatenabled,memory.active,plugins.loadPaths,web.fetch.firecrawl). The prompt-snapshot fixture cleanup changes only the serialized config dump in three snapshot.mdfiles; dynamic tool-spec snapshots are byte-identical, proving the deleted keys had no runtime effect. Snapshots regenerated viaprompt:snapshots:gen.scripts/sync-moonshot-docs.tsimported a UI catalog module that no longer exists (script was non-runnable) and had no callers; removed.Twelve
*.d.mtsdeclaration files type existing.mjsboundaries with their full export surfaces. Noany, no@ts-nocheck, no@ts-expect-error, no weakened compiler options.User Impact
No product runtime change. Contributors and CI now get type errors for scripts at check time instead of runtime; release tooling is hardened by the three bug fixes above.
Evidence
node scripts/run-tsgo.mjs -p tsconfig.scripts.json→ 0 errors (was 413).pnpm tsgo:all(now including the scripts lane),tsgo:core,tsgo:extensions→ green.pnpm prompt:snapshots:check→ clean on Linux Node 24 (Testbox).pnpm lint+pnpm format:check→ clean.changed-lanes,test-projects,check,gh-read,npm-verify-exec,release-check,release-beta-verifier,openclaw-cross-os-release-checks,prompt-snapshots(Testbox run ID in PR checks).