Skip to content

ci: Windows in the kbot test matrix + POSIX→PowerShell bash polyfill#49

Open
isaacsight wants to merge 2 commits into
mainfrom
ci/windows-matrix
Open

ci: Windows in the kbot test matrix + POSIX→PowerShell bash polyfill#49
isaacsight wants to merge 2 commits into
mainfrom
ci/windows-matrix

Conversation

@isaacsight

Copy link
Copy Markdown
Owner

What

  1. kbot CI job: ubuntu-only → {ubuntu, windows, macos} matrix. fail-fast: false so one OS failing doesn't mask the others; workflow_dispatch added for manual runs.
  2. bash tool POSIX→PowerShell polyfill. On Windows, simple POSIX commands the model habitually emits (pwd/ls/cat/head/tail/rm/cp/mv/mkdir/touch/which/grep) translate to PowerShell; anything with shell operators or flags that can't be mapped faithfully passes through untouched. Safety check runs on the original command, before translation.
  3. kbot build scriptchmod +x replaced with a platform-guarded node one-liner (chmod doesn't exist on Windows; npm run build was broken there).

Why

The v4.2 Windows sprint existed because 46/1370 tests failed the first time the suite ran on real Windows (2026-05-13). Unix-first bugs stay invisible without a Windows runner in the loop — this closes the class, not the instances. The Acer worker becomes a real-hardware testbed instead of the only verification gate.

Evidence

  • 43/43 bash.test.ts (16 new pure-function translation tests, run on every platform)
  • 15/15 live smoke against real PowerShell 7.5.2: verified touch does not truncate existing files, grep stays case-sensitive by default (POSIX semantics), apostrophe filenames quote correctly
  • bash+git+files regression: 100/100; tsc --noEmit clean
  • Generated syntax is Windows PowerShell 5.1-compatible (what ships on stock Windows)

Watch on first run

This PR's Windows job is the first time kbot's suite runs on a GitHub Windows runner — flakes it shakes out are the point.

🤖 Generated with Claude Code

Your Name and others added 2 commits June 9, 2026 20:21
Two changes that close the Windows gap as a class, not as instances:

1. ci.yml kbot job: ubuntu-only -> {ubuntu, windows, macos} matrix,
   fail-fast off, workflow_dispatch added. The v4.2 sprint existed
   because 46/1370 tests failed the first time the suite touched real
   Windows (2026-05-13) - bugs of this class stay invisible without a
   Windows runner in the loop. The Acer worker becomes real-hardware
   testbed, not the verification gate.

2. bash.ts: translatePosixForWindows(). On win32, simple POSIX
   commands (pwd/ls/cat/head/tail/rm/cp/mv/mkdir/touch/which/grep)
   translate to PowerShell and run via powershell.exe; anything with
   shell operators or unmappable flags (ls -t, tail -f, grep -r)
   passes through untouched. Mistranslation is worse than no
   translation. Safety check runs on the ORIGINAL command first.

Evidence: 43/43 bash.test.ts (16 new pure-function tests, run on all
platforms); 15/15 live smoke against real pwsh 7.5.2 (standalone
binary - verified touch does not truncate, grep stays case-sensitive
by default, apostrophe quoting); bash+git+files regression 100/100;
tsc --noEmit clean. Generated syntax is PS 5.1-compatible.

Also: kbot build script chmod -> platform-guarded node one-liner
(chmod does not exist on Windows; build was broken there), and
package.json picks up the bounty:* scripts from the bounty-hunter
session (already-shipped src/bounty/).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
First windows-latest CI run (PR #49) failed 23 tests across 5 files.
22 were test bugs - assertions hardcoded POSIX separators while the
source correctly uses path.join:

- memory.test.ts (8), graph-memory.test.ts (5), agent-protocol.test.ts
  (1): expected-path constants now built with join(); fs-mock
  comparisons normalize backslashes before matching POSIX literals.
- context.test.ts (8): same normalization via norm() helper.
- computer.test.ts (1): skip coordinator-status test on win32 -
  computer use is unsupported there and errors before coordinator
  output (known feature gap).

1 was a real product bug: context.ts getFileTree built relPath with
fullPath.replace(root + '/') - join() emits backslashes on Windows
while git's root uses forward slashes, so the replace never matched
and Windows users got absolute paths in their file tree. Now
relative() + POSIX-normalized display on all platforms.

Evidence: the 5 suites = 287/287 on macOS; tsc --noEmit clean;
windows-latest verdict comes from this PR's CI run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant