Skip to content

chore(tooling): typecheck scripts/** with a dedicated tsgo lane#104348

Merged
steipete merged 2 commits into
mainfrom
claude/typescript-setup-verification-e967a9
Jul 11, 2026
Merged

chore(tooling): typecheck scripts/** with a dedicated tsgo lane#104348
steipete merged 2 commits into
mainfrom
claude/typescript-setup-verification-e967a9

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 under tsx, 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.json lane (strict, noUnusedLocals/noUnusedParameters, same base as the core/extensions lanes) that covers scripts/** and excludes only scripts/e2e/**, whose clients import built dist/** artifacts and are validated by their own Docker runs. The lane is wired into pnpm tsgo:scripts, tsgo:all (project references), scripts/check.mjs, the CI test-types shard, and check:changed routing (new scripts lane in changed-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 a HeadersInit object; spreading a Headers instance yields no entries, dropping caller headers. Now normalized through new Headers(...).
  • scripts/lib/release-beta-verifier.ts: allowedHeadBranches embedded undefined when --workflow-ref was unset, which would wrongly match a workflow run with a missing head branch. Now built conditionally.
  • scripts/plugin-boundary-report.ts: guarded a matchAll on a possibly-undefined record field that would have thrown at runtime.
  • Stale retired config keys that the type system flagged were deleted from fixtures/benches (tools.profiles, heartbeat enabled, memory.active, plugins.loadPaths, web.fetch.firecrawl). The prompt-snapshot fixture cleanup changes only the serialized config dump in three snapshot .md files; dynamic tool-spec snapshots are byte-identical, proving the deleted keys had no runtime effect. Snapshots regenerated via prompt:snapshots:gen.
  • scripts/sync-moonshot-docs.ts imported a UI catalog module that no longer exists (script was non-runnable) and had no callers; removed.

Twelve *.d.mts declaration files type existing .mjs boundaries with their full export surfaces. No any, 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.
  • Targeted tests green: 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).
  • Fresh autoreview run with no accepted findings before landing.

steipete added 2 commits July 11, 2026 10:23
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.
@steipete
steipete requested a review from a team as a code owner July 11, 2026 09:24
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Jul 11, 2026
duplex: "half",
});
} as RequestInit & { duplex: "half" };
const upstreamRes = await fetch(upstreamUrl, upstreamInit);

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tsconfig.scripts.json
Comment on lines +13 to +15
// E2E clients import built dist artifacts and are validated by Docker runs,
// so they cannot join this source-only program.
"scripts/e2e/**"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit 2e2366b into main Jul 11, 2026
110 of 114 checks passed
@steipete
steipete deleted the claude/typescript-setup-verification-e967a9 branch July 11, 2026 09:31
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 11, 2026
…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.
steipete added a commit that referenced this pull request Jul 11, 2026
- 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
steipete added a commit that referenced this pull request Jul 11, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…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.
zhangyan2026 pushed a commit to zhangyan2026/openclaw that referenced this pull request Jul 13, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts/** TypeScript files are not typechecked; ~413 hidden type errors

2 participants