ReviewOS

home-lang/home

Support bun run stdin execution and argv semantics

#187
Closed chris opened this 9 days ago ·
9 days ago

Parent: #66 Follows completed publish corpus milestone #185.

Tracks the sorted untouched corpus boundary in cli/install/bun-run.test.ts.

Root cause

Home's real run argument scanner treated a lone - as an ignorable runtime flag. home run - therefore skipped its entrypoint and started the REPL instead of consuming stdin.

Scope

  • recognize - as the stdin entrypoint before generic runtime flags
  • read stdin with Bun's approximately-1-GiB ceiling and surface read errors
  • execute stdin as a virtual [stdin] TypeScript module through the full native VM
  • preserve relative resolution from cwd and process.argv === [exe, "-", ...args]
  • model the same pipeline semantics in the Bun shell corpus runtime
  • gate the complete untouched bun-run.test.ts result

Acceptance

  • real printf ... | home run - smoke prints expected JavaScript output
  • TypeScript stdin executes through the native VM
  • stdin script arguments retain - in process.argv
  • untouched bun-run.test.ts: 291 passed / 0 failed / 0 unsupported / 1 upstream TODO
  • full home_test gate passes
  • commit lands on main and #66 is updated

Landed

  • e248d15c4 feat(cli): support bun run stdin
  • Related resolver hardening: #188
9 days ago

Landed on main in e248d15c4.

Final verification:

  • untouched cli/install/bun-run.test.ts: 291 passed / 0 failed / 0 unsupported / 1 upstream TODO
  • native JavaScript stdin: hello
  • native TypeScript stdin: 42
  • native argv: [home-debug, "-", "alpha", "beta"]
  • full zig build test -Dfilter=home_test --summary failures: exit 0
  • Zig format and git diff --check: clean

The file-specific Bun shell hardcode is gone; the harness now models stdin-run pipelines through a reusable helper, while the actual CLI consumes stdin through the full VM as virtual [stdin] source.

The full gate also exposed and drove the focused cross-host resolver fix in #188.

Sign in to comment on this issue.