Skip to content

fix: run the full checks on Linux, macOS and Windows hosts - #161

Merged
oakimov merged 7 commits into
mainfrom
fix/test-harness-platforms
Nov 7, 2026
Merged

oakimov merged 7 commits into
mainfrom
fix/test-harness-platforms

Conversation

@oakimov

@oakimov oakimov commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Fix portable local checks, nested Linux isolation, process cleanup and manual review reporting.

  • Add a Git-less working-tree snapshot runner for native Linux/macOS checks and local Linux containers on Windows or when native prerequisites are unavailable. Cursor agent is optional.
  • Correct macOS sandbox paths and null-device writes; retain nested Linux bind mounts while making them read-only. Give live smoke tests their own temporary directory.
  • Run Linux sandbox commands as a mapped non-root UID after dropping all capability sets. Keep setup capabilities confined to initialization and include system setup tools in the restricted PATH, so nested self-tests can run without granting the command privileges in its parent namespace.
  • Stop a native check's entire process group after success, failure, SIGINT or SIGTERM. Repeated signals cannot interrupt cleanup. Retain the snapshot and fail if cleanup cannot be confirmed.
  • Extend the review procedure and private ledger with ownership postconditions. Add process and writer evaluation cases with defective variants, settling controls, and an explicit ownership-transfer control.
  • Record command exit codes and reject contradictory statuses. Keep failed checks visible with evidence of baseline or environment causes, separate from the code verdict. Identify each command's revision, distinguishing the launcher from archived subject scripts. Required analysis and the live credential gate still apply.
  • Read paginated review and comment receipts without requiring gh --slurp. Reject partial or malformed lookups and preserve duplicate prevention. Describe bind accurately as a read-only GitHub lookup. Keep manual launch, exact-preview approval, App COMMENT reviews and artifact retention.

Validation at c27822c048ff1bf24c11c91e95b810a38b784efd:

scripts/test-harness.py runs install, typecheck, build, the suite, the
built-output architecture checks, Node HTTP/2 and pricing checks from a
Git-less snapshot of the working tree. It runs natively on Linux and macOS
and through a local Linux-container engine on Windows, as root, or when
native prerequisites are missing. The container runs as an unprivileged
user with every capability dropped and sees only a read-only snapshot.

Fixes found while making the suites pass on macOS:

- isolate-run.sh's macOS profile named logical paths. Seatbelt matches
  resolved ones, and the default TMPDIR is a link into /private, so every
  write to the source, home and temp directory failed while the run still
  exited 0. Name resolved paths and allow writes to /dev/null.
- On Linux, bind /usr, /etc and --ro-bind sources recursively and make
  each submount read-only, so locked container submounts do not fail it.
- live-test.sh owns one temp directory per run and removes it on exit.
- review-eval.py reports unknown Git provenance for an archived check.
- Tests: observe the queued publisher at flock instead of /proc/locks,
  give the review suites one 30 s default instead of per-case overrides,
  and read .cursor/environment.json from the index when a checkout keeps
  it out of the working tree.

CI runs the harness unit tests on Ubuntu, macOS and Windows.
The fixture linked /usr/bin and /bin into a private PATH and skipped a
name only when fs.existsSync saw it. existsSync follows links, so a broken
link in /usr/bin (the current ubuntu-latest image ships one) read as
missing and the /bin pass linked the same name again: EEXIST. The setup
also ran outside try, so the failure left its temp directory behind.

Dedupe by name and set up inside try.
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caeliq-reviewer caeliq-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings.

Checks:

  • diff: passed. Read the full 16-file diff against main 605a620. No src, package metadata, lockfile, or protocol changes. The description matches the harness, seatbelt, live-temp, provenance, lock-observation, and CI behavior. The new line-ending attribute is not named in the summary and does not contradict it.
  • adversarial: passed. Contract, omission, and failed-work retry passes are recorded. Refuted hypotheses: a fail-open remount, a host root left read-only, a seatbelt profile that keeps the logical temp path, a stale image accepted after a failed rebuild, a secret visible inside the sandbox, an enclosing repository supplying archive provenance, and the nine nested user-namespace failures being a regression. No actionable candidate remained.
  • install: passed. isolated-check ran bun install --frozen-lockfile --ignore-scripts in the sandbox and reported INSTALL=passed. A separate install of the pull-request worktree also completed. Reviewer secrets were unset for both.
  • build: passed. isolated-check reported BUILD=passed.
  • typecheck: passed. isolated-check reported TYPECHECK=passed.
  • unit: passed. Host runs of the changed tests passed: review-scripts, review-eval, and harness-platform (61), review-publish (47), and the Python harness (17). Inside isolated-check, bun test passed 3254, skipped 10, and failed 9, so that process exited 1. Those nine are nested user-namespace uid_map refusals after the outer sandbox drops capabilities. The same refusal reproduces on main. The nine tests pass on the host, which is how CI runs them.
  • image-stamp: passed. Two-invocation fake-engine sequence: a forced rebuild exited 9 and left the image label unchanged; the ordinary entrypoint then exited 2, refused the old label, and did not start a container or a snapshot.
  • sandbox-probe: passed. On this Linux host, read-only binds of usr and etc rejected writes with errno 30, a nested read-only bind stayed read-only, the source tree stayed writable, and the host mount stayed read-write. A secret outside the sandbox was not visible. The seatbelt profile for a symlinked temp root names the resolved path and a null-device write rule; the main profile names the logical path and has no null-device write rule. sandbox-exec itself was not executed.
  • description: passed. The description matches host detection, container hardening, snapshot semantics, macOS resolved paths, live-test temp ownership, unknown Git provenance, flock observation, the 30 second timeout, and the harness-platform job. GitHub reports Typecheck, test, build, Coverage, codecov/patch, CodeQL, and the three harness-platform jobs passed at this head.
  • prior-threads: passed. The review-thread inventory is empty. There are no pull-request review comments and no Greptile review. The only issue comment is a coverage report that every modified coverable line is covered. Nothing to reclassify or resolve.
  • live: skipped. No provider, protocol, transport, session, entrypoint, tool, or auth change. Live-test temp ownership and isolate-run behavior are covered by unit tests that passed on the host. A generic pong would not exercise the macOS seatbelt profile or the container harness. OpenCode CLI 2.2.5 is the installed and current unpinned release and was not started. The Cursor API key was not passed to pull-request code.

Limitations:

  • macOS sandbox-exec was not executed. The comparison is the generated profile text for a symlinked temp root.
  • Docker is not installed, so the test image was not built and no container booted. Image selection was exercised with a fake engine.
  • isolated-check exited 1 because nine nested user-namespace tests were refused after capability drop. That refusal reproduces on main. Host execution of those tests passed.
  • The Ubuntu, macOS, and Windows harness-platform jobs were read from GitHub status and were not re-run on those operating systems here.
  • No live OpenCode process was started. The installed CLI is 2.2.5, which matches the current unpinned release.

Runtime: linux.
Reviewed #161 at 4f1843d.

@caeliq-reviewer caeliq-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings.

Checks:

  • diff: passed. Read the 16-file diff against main 605a620. No src, package metadata, lockfile, or protocol changes. The description matches the harness, seatbelt, live-temp, provenance, lock-observation, and CI behavior. The new line-ending attribute is not named in the summary and does not contradict it.
  • adversarial: passed. Contract, omission, and failed-work retry passes used this run's observations. The publication scripts are unchanged from main. Refuted hypotheses: a seatbelt profile that keeps the logical temp path, a stale image accepted after a failed rebuild, the nine nested user-namespace failures being a regression, and an enclosing repository supplying archive provenance. No actionable candidate remained.
  • install: passed. The pull-request isolated-check ran bun install --frozen-lockfile --ignore-scripts in the sandbox and reported INSTALL=passed. Reviewer secrets were unset.
  • build: passed. The pull-request isolated-check reported BUILD=passed. The pull-request native runner also completed bun run build.
  • typecheck: passed. The pull-request isolated-check reported TYPECHECK=passed. The pull-request native runner also completed bun run typecheck.
  • unit: passed. Host runs of review-scripts, review-eval, harness-platform, and review-publish passed: 108 tests, 0 failures. Inside the pull-request isolated-check, bun test passed 3254, skipped 10, and failed 9, so that process exited 1. Those nine are nested user-namespace uid_map refusals after the outer sandbox drops capabilities. Main's isolate-run reproduces that refusal. The native runner's host suite passed 3273 and failed 0.
  • native-harness: passed. From the pull-request root, scripts/test-harness.py with Node on PATH selected the native backend and exited 0. The check list completed install, typecheck, build, bun test (3273 pass, 0 fail), architecture (10 pass), Node HTTP/2, and pricing (55 covered, 0 missing).
  • image-stamp: passed. Two-invocation fake-engine sequence from the pull-request script: a forced rebuild exited 9 and left the image label unchanged; the ordinary entrypoint then exited 2, refused the old label, and did not start a container.
  • sandbox-probe: passed. The pull-request isolate-run rejected writes to usr, etc, and a nested read-only bind with errno 30, kept the source writable, and left the host mount read-write. A secret outside the sandbox was not visible. With a symlinked temp root, the pull-request seatbelt profile names the resolved path and a null-device write rule; the main profile names the logical path and has no null-device write rule. sandbox-exec was not executed.
  • description: passed. The description matches host detection, container hardening, snapshot semantics, macOS resolved paths, live-test temp ownership, unknown Git provenance, flock observation, the 30 second timeout, and the harness-platform job. GitHub reports Typecheck, test, build, Coverage, codecov/patch, CodeQL, and the three harness-platform jobs passed at this head.
  • prior-threads: passed. A fresh thread inventory from the pull-request publisher is empty. There are no new review threads to classify. The existing formal comment review is the previously published clean review and is left unchanged.
  • live: skipped. No provider, protocol, transport, session, entrypoint, tool, or auth change. Live-test temp ownership and isolate-run behavior are covered by unit tests that passed on the host. A generic pong would not exercise the macOS seatbelt profile or the container harness. OpenCode CLI 2.2.5 is the installed and current unpinned release and was not started. The Cursor API key was not passed to pull-request code.

Limitations:

  • macOS sandbox-exec was not executed. The comparison is the generated profile text for a symlinked temp root.
  • Docker is not installed, so the test image was not built and no container booted. Image selection was exercised with a fake engine. The native backend did run the full check list on this Linux host.
  • isolated-check exited 1 because nine nested user-namespace tests were refused after capability drop. Main's isolate-run reproduces that refusal. Host execution and the native runner passed.
  • The Ubuntu, macOS, and Windows harness-platform jobs were read from GitHub status and were not re-run on those operating systems here.
  • No live OpenCode process was started. The installed CLI is 2.2.5, which matches the current unpinned release.

Runtime: linux.
Reviewed #161 at 4f1843d.

A clean review passed this PR's process runner while it waited only for a
check's leader, sent KILL only when that leader overran, and had no
SIGTERM handler. Its contract said processes are awaited before snapshot
cleanup, and its mocked tests could not show otherwise.

The review skill now states ownership postconditions for anything a change
starts, delegates or cleans up: the owner, what it owns, its cancellation
entrypoints and the condition that permits release. It challenges
completion, nonzero exit, catchable termination and an early-exiting
leader with acknowledged ordering, and inspects liveness, existence and a
write attempt after the owner returns. An explicit transfer under a stated
contract is not a leak, and nothing is demanded after SIGKILL.

- review-ledger.py: an optional ownership record. check requires one
  scenario per lifecycle path and requires a path supported only by
  source, mocked or unverified evidence to be named in uncovered. The
  absolute-path check no longer matches " / 200".
- review-rules.md: the leak blocker covers processes, workers and writers
  that outlive their owner, and files released while still in use.
- eval: check-runner (two defective variants, a settling control and an
  explicit-transfer control) and the held-out spool-export. Fixture tests
  drive each variant's real orchestration and show the defective variants
  leave owned work behind while the controls settle.

Blind reviewers on the same model found every planted defect with both
the previous and the revised instructions, so a detection improvement is
not shown. Their findings against the controls were real and are fixed.
Handle SIGINT and SIGTERM at safe checkpoints and stop owned process groups after every check, including early leader exits. Preserve snapshots when cleanup cannot be confirmed. Add real lifecycle regressions and document the ownership behavior.
Record command exit codes and reject contradictory check statuses. Keep evidenced baseline and environment failures visible without conflating the code verdict with command success. Parse every pagination page locally without requiring slurp, and reject incomplete lookups before sending a review.
Describe bind as a read-only GitHub lookup and check its diagnostics against the actual GET. Require review reports to identify each command revision so archived subject self-test failures are not attributed to the current launcher.
Map sandbox commands to a non-root namespace identity while retaining capabilities for setup only, then clear all capability sets before execution. Include system setup tools in the restricted PATH. Add nested-entry, credential and read-only ancestor regressions without weakening the live trust gate.
@oakimov
oakimov merged commit 9dbaf37 into main Nov 7, 2026
10 checks passed
@oakimov
oakimov deleted the fix/test-harness-platforms branch November 9, 2026 18:15
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