Skip to content

fix: run ts-topology entrypoint on Windows#105397

Merged
steipete merged 2 commits into
openclaw:mainfrom
VectorPeak:fix/ts-topology-windows-entrypoint
Jul 13, 2026
Merged

fix: run ts-topology entrypoint on Windows#105397
steipete merged 2 commits into
openclaw:mainfrom
VectorPeak:fix/ts-topology-windows-entrypoint

Conversation

@VectorPeak

@VectorPeak VectorPeak commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Windows developers running the ts-topology package script directly could get a silent no-op because the ESM direct-run guard compared import.meta.url against a manually concatenated file:// path that does not match Windows file URL formatting.

Why This Change Was Made

The direct-run guard now converts process.argv[1] with Node's pathToFileURL(...) before comparing it to import.meta.url, matching Node's cross-platform path-to-file-URL boundary instead of manually concatenating a file URL. This keeps the behavior change scoped to the ts-topology entrypoint and does not change topology analysis logic.

The regression test is also included in test:windows:ci, so the Windows-only entrypoint behavior is covered by the Windows CI selection rather than only by POSIX-friendly unit-fast runs.

User Impact

Developers and automation can run pnpm ts-topology or node --import tsx scripts/ts-topology.ts ... on Windows and have the CLI execute instead of exiting successfully with no output.

Imported usage through main(...) is unchanged.

Evidence

Before on Windows, the direct script invocation skipped the CLI entrypoint and exited silently:

node --import tsx scripts/ts-topology.ts --help

Observed before:

exit=0
stdout:
stderr:

After on Windows, the same entrypoint reaches the CLI parser and prints usage:

node --import tsx D:\ZXY\Github\openclaw\scripts\ts-topology.ts --help

Observed after:

exit=1
stdout:
stderr:
Usage: ts-topology [analyze] [options]

Call chain / sibling surfaces checked:

pnpm ts-topology
  -> package.json scripts.ts-topology
  -> node --import tsx scripts/ts-topology.ts
  -> import.meta.url direct-run guard
  -> main(process.argv.slice(2))

The PR affects only direct CLI execution. The imported main(...) test path and topology analysis/reporting helpers remain unchanged.

Validation:

node scripts/test-projects.mjs test/scripts/ts-topology.test.ts test/package-scripts.test.ts
pnpm format:check --no-error-on-unmatched-pattern -- scripts/ts-topology.ts test/scripts/ts-topology.test.ts package.json test/package-scripts.test.ts test/scripts/openclaw-cross-os-release-workflow.test.ts
pnpm tsgo:scripts
pnpm tsgo:test:root
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/ts-topology.ts
node scripts/check-changed.mjs --dry-run -- scripts/ts-topology.ts test/scripts/ts-topology.test.ts package.json test/package-scripts.test.ts test/scripts/openclaw-cross-os-release-workflow.test.ts
node --import tsx scripts/ts-topology.ts --help
git diff --check

Local limitation: pnpm test:windows:ci reaches the updated test:windows:ci selection locally, but this Windows machine's WSL harness path currently emits node is required to run cross-OS release checks from test/scripts/openclaw-cross-os-release-workflow.test.ts; the failure occurs in the pre-existing release-harness execution path and is unrelated to the ts-topology code path changed here.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Jul 12, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 7:58 PM ET / 23:58 UTC.

Summary
The PR replaces the ts-topology CLI’s manually concatenated direct-run file URL with pathToFileURL and adds spawned entrypoint coverage to the Windows CI lane.

PR surface: Tests +17, Config 0, Other +2. Total +19 across 5 files.

Reproducibility: yes. Invoking node --import tsx scripts/ts-topology.ts --help from a Windows filesystem path silently bypasses the parser before the fix; the PR supplies before-and-after terminal output and a focused spawned-process regression.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The branch is behind current main, so the merge-base review should be refreshed before landing; GitHub reports it mergeable, with no concrete conflict or behavior regression identified.

Maintainer options:

  1. Decide the mitigation before merge
    Refresh the branch against current main, retain the canonical pathToFileURL guard and Windows-lane regression, then merge once exact-head checks remain green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; this correct, proof-positive PR only needs routine current-main refresh and maintainer merge review.

Security
Cleared: The diff adds one Node built-in URL conversion and focused tests only; it does not broaden permissions, secrets access, dependency resolution, downloads, or third-party code execution.

Review details

Best possible solution:

Refresh the branch against current main, retain the canonical pathToFileURL guard and Windows-lane regression, then merge once exact-head checks remain green.

Do we have a high-confidence way to reproduce the issue?

Yes. Invoking node --import tsx scripts/ts-topology.ts --help from a Windows filesystem path silently bypasses the parser before the fix; the PR supplies before-and-after terminal output and a focused spawned-process regression.

Is this the best way to solve the issue?

Yes. Converting the CLI path with Node’s pathToFileURL fixes the platform boundary at the direct-run guard without changing topology analysis or imported usage, and the Windows CI inclusion tests the affected surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f87492539ba2.

Label changes

Label justifications:

  • P2: This is a focused Windows developer-tool regression with limited blast radius and a complete, bounded fix.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR includes concrete Windows terminal before-and-after output for the changed CLI path, and the Windows CI plus real-behavior-proof checks succeeded on the current head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes concrete Windows terminal before-and-after output for the changed CLI path, and the Windows CI plus real-behavior-proof checks succeeded on the current head.
Evidence reviewed

PR surface:

Tests +17, Config 0, Other +2. Total +19 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 18 1 +17
Docs 0 0 0 0
Config 1 1 1 0
Generated 0 0 0 0
Other 1 3 1 +2
Total 5 22 3 +19

What I checked:

  • Entrypoint fix: The PR head converts the filesystem argument to a canonical file URL before comparing it with import.meta.url, addressing Windows drive-letter and slash formatting without changing imported main(...) behavior. (scripts/ts-topology.ts:168, 8c0784520093)
  • Regression coverage: The test launches the real TypeScript CLI entrypoint through Node and tsx, then verifies that --help reaches the parser rather than silently exiting. (test/scripts/ts-topology.test.ts:50, 8c0784520093)
  • Windows CI coverage: The focused ts-topology regression is included in test:windows:ci, resolving the earlier review finding that POSIX-only execution would not prove the Windows boundary. (package.json:1966, 8c0784520093)
  • Upstream contract: Node defines import.meta.url as an absolute file URL and recommends url.pathToFileURL for converting paths because it resolves and encodes them correctly across platforms. (nodejs.org) (scripts/ts-topology.ts:3, 8c0784520093)
  • Real Windows proof: The PR body records the same direct invocation producing no output before the fix and reaching the usage parser after the fix on Windows; the Real behavior proof and Windows test checks completed successfully. (8c0784520093)
  • Review continuity: The earlier P2 request to run this regression in Windows CI is fixed on the current head; the immediately previous review found no remaining findings, and all reported checks are complete without failure. (package.json:1966, 8c0784520093)

Likely related people:

  • steipete: The current head includes steipete’s follow-up commit tightening the central entrypoint guard, and the timeline shows assignment on this PR. (role: recent area contributor and assigned decision owner; confidence: high; commits: 8c0784520093; files: scripts/ts-topology.ts, test/scripts/ts-topology.test.ts, package.json)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-12T13:37:24.443Z sha 6dab010 :: needs changes before merge. :: [P2] Run the entrypoint regression in Windows CI
  • reviewed 2026-07-12T14:19:11.577Z sha 7728ab9 :: needs maintainer review before merge. :: none

@VectorPeak
VectorPeak force-pushed the fix/ts-topology-windows-entrypoint branch from 6dab010 to 7734774 Compare July 12, 2026 13:57
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 12, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 12, 2026
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
@VectorPeak
VectorPeak force-pushed the fix/ts-topology-windows-entrypoint branch from 7734774 to 7728ab9 Compare July 12, 2026 14:10
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 12, 2026
@steipete steipete self-assigned this Jul 12, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer pass complete; this is land-ready.

  • Tightened the entrypoint guard so a missing process.argv[1] cannot normalize to the current directory.
  • Removed duplicate Windows-lane membership coverage while preserving the real spawned CLI regression and package-script assertion.
  • Testbox: pnpm test test/scripts/ts-topology.test.ts test/package-scripts.test.ts — 22 tests passed.
  • Testbox: pnpm check:changed — passed.
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/29213562238
  • Fresh autoreview: clean, no actionable findings.
  • Exact PR head 8c0784520093c70b7d8437d54b342b8005c0c37b: hosted CI green, including checks-windows-node-test.
  • Repo-native scripts/pr prepare-run 105397: passed.

Thank you @VectorPeak for the fix.

@steipete
steipete merged commit b4d3a03 into openclaw:main Jul 13, 2026
88 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 13, 2026
* fix: run ts-topology entrypoint on Windows

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

* refactor: tighten ts-topology entrypoint guard

---------

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants