ReviewOS

home-lang/home

Native CLI: activate workspace-filter script execution

#519
Open chris opened this 9 days ago ·
9 days ago

Follow-up to #66 and #508. Native workspace-filter dispatch is implemented and verified on Darwin in 7286e0f29, published on codex/runtime-port as Chris Breuer without coauthors. It is not merged to main. This issue remains open for integration and other-platform verification.

Implemented and verified

  • Implicit and explicit run forms activate the owned --filter/--workspaces runner before ordinary entrypoint lookup, using the parsed context.
  • Package selection, per-package cwd/PATH, dependency/lifecycle ordering and cycles, package-manager script rewrites, argument escaping, exit codes, missing-script handling and --if-present pass their unchanged workspace corpus.
  • Fast-process exit drains already-written nonblocking pipe output before completion. Forced-color display and elision work before VM setup, and malformed-package warnings identify the package.json path.
  • Empty arguments are preserved. SIGINT wakes the existing event loop, preserves errno and reaches the running script; the native regression verifies the child's handler and natural exit. The local Bun release control drops empty arguments and hangs in the parent-only SIGINT diagnostic, so these are explicit correctness improvements beyond those pinned edge cases.
  • Expected unsafe-node-shim directory/target rejections now report concise CLI errors without a Zig source traceback. The validation is unchanged; exact diagnostic assertions replace looser matches. The earlier directory diagnostic spent 28.33 seconds symbolizing DWARF and exceeded the unchanged 15-second command deadline.

Verification

At source pin 4982b91e3702094330f3be3883354c52b8c01323:

  • Complete unchanged workspace suites: 58 pass / 0 fail / 192 assertions (workspaces 3/3, filter-workspace 55/55). The published parent fails all three workspace tests and times out in the full filter file; the local release control passes 58/58.
  • Complete unchanged bun-run suite: 288 pass / 3 fail / 413 assertions, versus a final published-parent rerun of 287 pass / 4 fail / 411 assertions. Workspace argument preservation resolves, with no new failing names. The three remaining failures are native bunx dispatch in #518. Additional optional-config scanning remains #517.
  • 55/55 runtime regression commands, including all 24 native files, complete spawn (126 pass / 5 skips / 5,484 assertions) and child-process (32 pass / 1 skip / 1 TODO / 72 assertions).
  • The expanded native package regression passes normally and with VM destruction plus JSC exception checks. It checks actual Home child identity, cwd, shell-sensitive/empty arguments, fast unterminated output, display selection and cancellation.
  • Native build 17/17 steps; runtime units 1,819 pass / 19 skips / 0 failures, 19/19 build steps. Pickier, changed CLI-file Zig formatting and scoped whitespace checks pass.
  • All 31 upstream source files exercised by this regression set are byte-identical to the pinned Git objects. No upstream assertion, workload, fixture or deadline was changed. Skips and TODOs are not completed parity.

Earlier candidates, invalid/empty build artifacts, disk failures, cancellations and diagnostic failures remain recorded. Four SIGILL timeouts occurred in an earlier full CLI run on both candidate and parent; neither final rerun has them. Those earlier failed runs are not counted as passes.

Remaining scope

  • Integration into main and Linux/Windows execution/cross-compilation remain unverified. Verification used the shared Darwin checkout; unrelated compiler edits are excluded from this commit.
  • Confirm platform-specific console/cancellation behavior, process cleanup and all other workspace coverage on those platforms. Source presence and Darwin success do not establish cross-platform parity.
  • #66 remains the full-port tracker and is not complete. #508 tracks remaining CLI work; #518 includes the real installer chain, not just malformed-spec cases.

Evidence: docs/docs/NATIVE_RUNTIME_BINDINGS.md, zig-out/filter-build9.{log,json}, filter-unit.{log,json}, filter-regressions.json, filter-native-{final9,destruction}.json, filter-corpus-final9.json, package-wide-filter-{parent-final9,final9}.json, filter-comparison-final9.json, filter-source-integrity-final9.json and filter-publication.json. Final binary SHA-256: 58fd4565c743021a5aa1256a69bf06a319a3af0b5db9f1a7052e6066f9a0fa4d.

9 days ago

Implementation is in progress after published checkpoint 626346be5b9f0e679c39f75faa6046d44435cd90; these filter changes are not yet committed or published.

Native dispatch now reaches the owned workspace runner. The first runnable candidate passes all 3 workspace tests and 47/55 filter-workspace tests. The failures exposed a POSIX exit-before-pipe-drain race and missing forced-color render selection. Fixes are rebuilding, with added native coverage for child identity, argument quoting, partial final output, color controls and SIGINT cleanup. The local Bun release control passes all 58 tests in those two unchanged files.

An overlapping bun-run/native test attempt had timeouts; those attempts remain failures. The exact prior native regression subsequently passed both the published binary and the filter candidate when run separately (40.35 s and 41.29 s). Final corpus verification will run without overlapping suites and without increasing deadlines.

Resource failures are not passes: one build reported success but produced a zero-byte executable, which was rejected by launch checks; a later build was canceled to correct a known API mismatch. Obsolete artifacts removed for space are individually recorded and limited to this task's runtime cache. The current build includes an executable/VM smoke check. #66 and #508 still report the last verified published checkpoint, not this unfinished candidate.

9 days ago

Further verification (still uncommitted/unpublished): build7 produced a real native executable and passed its VM smoke test. The complete unchanged workspace files now pass 58/58 tests, 192 assertions: workspaces 3/3 and filter-workspace 55/55. This verifies the output drain and forced-color fixes against the unchanged corpus.

The broader native regression exposed additional work, so this is not a completed checkpoint:

  • The existing unsafe-shim-directory check timed out at its unchanged 15-second deadline. An isolated diagnostic completed with the correct rejection but took 28.33 seconds; a process sample shows the time spent in Zig's native error-trace/DWARF symbolization. Expected unsafe-directory/target errors are now handled as concise CLI failures; safety validation is unchanged and the assertions are stronger (exact diagnostic text). Verification is pending.
  • The new filter argument regression found dropped empty arguments. A local release control also drops the empty argument. Home now explicitly quotes it, matching Home's ordinary package-script behavior. This is an intentional correctness improvement beyond that pinned edge case, not an upstream test modification.
  • The new parent-only SIGINT regression found that an idle kqueue loop retries EINTR without noticing the abort flag. The local release control also times out after printing readiness. The runner now notifies its existing async loop wakeup from the signal handler and preserves errno. Verification is pending. Actual script signal forwarding and natural exit remain required.
  • Current serial full bun-run runs are candidate 284 pass / 7 fail versus an immediate published-parent recheck 283 pass / 8 fail. The workspace argument case resolves, with no newly failing names in that comparison. Four SIGILL timeout cases occur on both binaries; the other three candidate failures remain #518. The earlier published 287/4 result is historical, not the current rerun count. The four timeouts are still failures, not passing coverage.

Build8 was explicitly cancelled before source changes when the argument diagnostic failed; its wrapper's redundant cleanup attempt reported PermissionError after the owned group exited, and read-only process inspection confirmed the group gone. Build9 is compiling the corrections. No Bun source test, assertion, or deadline has changed. #66/#508 still point at the verified published 626346b checkpoint until this tranche is verified and pushed.

Sign in to comment on this issue.