Implement Phase 2 (sandbox), Phase 3 scaffolding, and CI
Phase 2 — Sandbox & Build Isolation:
- Fix sandbox API stubs: sandbox_init, sandbox_init_with_parameters,
sandbox_init_with_extensions, and sandbox_wakeup_daemon now set
*errorbuf = NULL on success instead of strdup("Not implemented"),
and guard against NULL errorbuf pointers.
- Create sandbox-exec stub (src/sandbox-exec/): small C program that
parses and ignores all sandbox flags (-f, -p, -n, -D) then exec's
the remaining command. Installs to libexec/darling/usr/bin/sandbox-exec.
This unblocks Nix builder invocations which wrap everything in
sandbox-exec.
Phase 3 — Nix Installation Support:
- Extend diskutil with info and list verb stubs so the Nix installer's
filesystem-type check (diskutil info /) succeeds.
- Create scripts/install-nix-in-darling.sh: automated installer that
downloads, patches, and runs the Nix Darwin installer inside a
Darling prefix in single-user mode.
- Create scripts/darling-nix: host-side wrapper for running Nix
commands inside Darling without manual darling shell bash -lc
boilerplate.
Phase 6 — CI:
- Create .github/workflows/nix.yml with flake-check, build, devshell,
and smoke-test jobs. Includes Cachix integration and path filtering.
Testing & Docs:
- Create tests/sandbox/ with C-level API tests and shell-level
sandbox-exec integration tests.
- Create plan/syscall-triage.md tracking table for unimplemented
syscalls.
- Update PLAN.md with progress summary and What's Next section.
- Update plan/README.md with new files and key scripts table.
- Fix .gitignore to allow tests/sandbox/ while ignoring other test dirs.