Skip to content

test: keep the opener test off the host; typecheck the GUI's Node side - #6

Merged
lr00rl merged 2 commits into
mainfrom
claude/trusting-cray-5o5bz3
Sep 30, 2026
Merged

lr00rl merged 2 commits into
mainfrom
claude/trusting-cray-5o5bz3

Conversation

@lr00rl

@lr00rl lr00rl commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

This started as a fix for three problems that kept holt changes from being verified automatically. While it was open, #5 merged to main and fixed most of the same ground: the gui/tsconfig.json flag, the two-project typecheck script, CI running pnpm verify with pnpm 11.18.0 and Node 22, and a launchDetached helper whose 'error' listener stops a missing opener from crashing the CLI or the GUI server.

I merged main into this branch and kept all of that as is. Two gaps are left, and this PR now closes them. The defaults of the CLI, the GUI and the file model are unchanged.

1. The opener test still starts a real process on the host

After holt#5, "openTaskBody prefers noto via override without EDITOR" passes on Linux because the launch no longer crashes, but it still starts a real open process. On Linux that process fails asynchronously with ENOENT. On macOS it runs open -a <temp dir>/Noto.app <task>. So the test's behaviour still depends on the host.

OpenTaskBodyOptions already has test overrides (notoApp, platform, home). This PR adds spawn?: SpawnDetached. launchDetached now takes the spawn function as an argument, and openTaskBody passes it opts.spawn ?? spawn, which covers every detached launch, including the non-waiting $EDITOR path. The CLI and GUI callers do not set it.

The test injects a recorder and checks more than before. It still checks path, via and opened, and it now also asserts that exactly one launch happened:

  • command open, args ['-a', <Noto.app>, <task path>]
  • options { detached: true, stdio: 'ignore' }
  • one 'error' listener attached
  • one unref() call

The 'error' listener is the protection holt#5 added. The test now guards it on every host, where before the protection was exercised only by a real ENOENT on Linux. I confirmed the test fails on each of these changes: removing child.on('error', …), changing the argv, or removing unref().

2. The GUI's Node side is not typechecked

pnpm typecheck runs tsconfig.json, which covers src/**, and gui/tsconfig.json, which covers the browser bundle gui/src/**. The Node-side GUI files (gui/api.ts, config.ts, dev.ts, vite.config.ts and their tests) are in neither project. The root include now adds gui/*.ts. These files typecheck with no source changes.

Also

On main, launchDetached sits between openTaskBody's doc comment and the function, so the doc comment no longer attaches to openTaskBody. This PR rewrites launchDetached anyway, so it moves above that comment.

Verification

I replayed main's CI steps on a clean clone of this branch: pnpm install --frozen-lockfile then pnpm verify with pnpm 11.18.0 on Linux and Node 22. Both typecheck projects pass, the tests pass 58/58, and the working tree stays clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D7P3PhbidfM5fMi1uyWFk5

Three pre-existing problems kept changes from being verified
automatically:

- gui/tsconfig.json did not allow .ts import extensions, so
  gui/src/main.ts failed with TS5097, and the root config only
  covered src/, so the GUI was never typechecked. The GUI config
  now allows them, the root config also covers the GUI's Node
  side (gui/*.ts), and `pnpm typecheck` runs both projects.
- "openTaskBody prefers noto via override without EDITOR" spawned
  the real macOS `open`, which raised `spawn open ENOENT` after the
  test ended on Linux. openTaskBody takes an optional launcher for
  platform openers, and the test injects a recorder that asserts
  the exact command, argv, options and unref.
- Add .github/workflows/ci.yml: install with a frozen lockfile,
  then typecheck and test on ubuntu-latest with Node 22.

Default behaviour of the CLI, GUI and file model is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7P3PhbidfM5fMi1uyWFk5
main now carries #5, which fixes the same three problems.
Keep its CI workflow, packageManager pin, verify script and the
launchDetached error listener as they are. On top of that, keep what
this branch adds:

- launchDetached takes the spawn function, and openTaskBody passes
  opts.spawn when a test injects one, so the opener test never starts
  a real process on any host. The recorder also asserts the error
  listener that keeps a missing opener from crashing the process.
- The root config still typechecks the GUI's Node side (gui/*.ts).
- launchDetached moves above openTaskBody's doc comment, which the
  insertion on main had detached from the function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7P3PhbidfM5fMi1uyWFk5
@lr00rl lr00rl changed the title ci: typecheck the GUI, make the opener test portable, add CI test: keep the opener test off the host; typecheck the GUI's Node side Sep 29, 2026
@lr00rl
lr00rl merged commit b33832a into main Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants