Repository navigation
#267: the differential harness gates only the attested musl artifact of its commit; --dev is labelled - #273
Merged
Merged
Conversation
…f its commit, or --dev The differential harness stores cua's candidate itself (cua-engine, mode 0700) and, for a gate, refuses a gnu, dynamic or foreign-architecture build, a checkout not clean, an unattested file, a digest mismatch, a commit mismatch and a --version naming another commit, each with its reason, before anything runs. The run records the candidate's sha256, target, version and what gh attestation verify --format json verified; --dev runs any build and its verdict, summary and stdout say it is not a release gate. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ay musl build is not the attested bytes Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… nothing can start it Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…ing the checks leaves no copy; one execution per run name - A gate checks the file, the checkout and the attestation before it runs the candidate (--version last); a dev run runs it unchecked. - runDiff owns the copy's directory from before the copy and handles a stop (SIGINT/SIGTERM) during the checks: the copy is removed and the command in flight killed. The checks run their commands without blocking the event loop, so the stop is handled at once. - A run name the out directory already has rows of is refused (run refused, exit 2); summary.md does not judge a name whose rows mix a gate and a dev run, and the verdict line takes its label from the end row itself. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… a stop during the checks kills and reaps the command - runDiff's stop handler stays installed until the Desktop's is in place (diffRun calls handoff right after constructing it), so a stop is never the default action that skips the copy's removal at the exit. - A stop during the checks kills the command in flight with SIGKILL (one that ignores SIGTERM included) and waits for it to end before the harness exits; the checks then reject with PreparationStopped, never an ordinary command result, and start no further command. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Nov 2, 2026
…he VM musl build is not the artifact; the literal commit rule) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Nov 2, 2026
…t means a rebuild (the design session, #273 merged) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
SSFSKIM
added a commit
that referenced
this pull request
Nov 2, 2026
main brings T1 (#267, PR #273): a verdict run is a release gate unless --dev is given; candidate.mjs checks and stores the candidate; run.mjs splits into runDiff (the run name's uniqueness, the candidate's preparation, the stop handler until the run's own) and diffRun (the run proper, labelled by the candidate's gate). feat/171-m4 brings T2's application stderr logs (the Desktop's `logs`) and T3's truncation field (normalize.mjs, deviations.mjs, services.mjs, and run.mjs's declared-field handling). One conflict, scripts/linux-engine-diff/run.mjs, at the Desktop's creation in diffRun: main added `handoff()` straight after it, and this branch added `logs: args.out` to its arguments. Both kept: the Desktop takes the run's out directory for the application logs, and the checks' stop handler hands over to the Desktop's as soon as it exists, with no moment between. Every other hunk of run.mjs merged cleanly: T3's truncation handling sits in the sample loop, which main did not touch, and main's candidate preparation sits above it. Checked: node --test test/linux-engine-diff/*.test.mjs 332/332; cargo test --release --locked (native/linux-engine) 205 passed, 32 ignored. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #267
A verdict run of the Linux differential harness is now a release gate by default. For a gate, the harness takes as cua's candidate only the release workflow's attested static musl artifact of the commit the checkout is at, with the checkout clean.
--devruns any build, and its verdict, itssummary.mdand its stdout saydevelopment run, not a release gate. The engine is unchanged (git diff origin/main -- native/is empty).Interface:
--cua <file>still names the candidate, and--devis the only way out of the gate. The harness stores the file ascua-engine, mode 0700, in a directory of its own (a downloaded artifact loses its executable bit). Every check reads that copy, and every cua lane runs it. The copy is removed on a refusal, an error, the run's end, or a stop at any point. A stop handler is installed from before the copy is made until the run's own (the Desktop's) takes over, so there is no gap. A stop during the checks kills the command in flight with SIGKILL and waits for it to end before the harness exits 143 (or 130). A gate runs the candidate (--version) only once it is attested. A--runname the out directory already has rows for is refused (run refused, exit 2), andsummary.mddoes not judge a name whose rows mix a gate and a dev run.A gate refuses each of the following with its reason, as
candidate refused: …and exit 2, before anything runs:gh attestation verify … --signer-workflow SSFSKIM/cua/.github/workflows/linux-engine.yml --deny-self-hosted-runners --format json);--versionnaming another commit.The run records the candidate in its
metarow: sha256, target, linkage, version, commit, clean, and each verified attestation (subjects, source commit and ref, workflow run, runner), all read from gh's JSON. Theendrow recordsgate. The README section "The candidate" documents all of this.Validation Evidence
Review fixes are covered by failing-first tests. Round 1 added five tests to
candidate.test.mjs; against 32a2e29 they gavepass 13, fail 5. They check that:ghbefore--version;--versionblocks exits 143 with no copy left.Round 2 added two more; against 23c2709 they gave
pass 18, fail 2. They check that:--versioncommand that ignores SIGTERM before the harness exits 143. Its pid is gone, and no copy is left.Now
node --test test/linux-engine-diff/candidate.test.mjsgivespass 20, fail 0.The failing-first tests named in the issue pass.
node --test test/linux-engine-diff/candidate.test.mjsreportedpass 13, fail 0. Before the implementation, the same tests run against a stub that behaves like the old harness (it accepts anything and records nothing) reportedpass 0, fail 13. The tests cover:They also cover a non-ELF file, a foreign architecture, a
--versionnaming another commit, a dirty checkout, no copy left after a refusal, an accepted gate'scua-engine0700 copy and full record, a dev run making no gh call, and--devrefused by experiments.The whole harness suite passes.
node --test test/linux-engine-diff/*.test.mjsreportedtests 322, pass 322, fail 0on a5f86ee.The gate accepts the real attested 0.3.0 artifact at its commit. The asset came from
gh release download linux-engine-v0.3.0 --repo SSFSKIM/cua -p cua-engine-0.3.0-linux-x64into a fresh empty directory; it arrived with mode 600 and sha2565f4a1600…7b60. I ran the committedcandidate.mjsin gate mode, with the worktree checked out clean at detached cd4c929, using real git and real gh. Output:accepted: stored as cua-engine, mode 700,x86_64-unknown-linux-musl static-pie,cua-engine 0.3.0 (cd4c929758ca). gh returned two verified attestations, both built from cd4c929 on GitHub-hosted runners: run 41364541329 (release/linux-engine-v0.3.0) and run 41350086196 (feat/171-m3).The CLI refuses live, from this branch at 32a2e29 with a clean checkout. Each case exited 2, created no out directory and left no copy:
candidate refused: commit mismatch: the candidate was built from cd4c929758caf90329fd5cfb0d5028f1ec1c92c2, and the checkout is at 32a2e2963e5817bf0196537c706a3029e588fddf. This case got past gh's verification and the digest check.candidate refused: the candidate is built for x86_64-unknown-linux-gnu (dynamic, interpreter /lib64/ld-linux-x86-64.so.2): the release ships the workflow's x86_64-unknown-linux-musl static-pie.candidate refused: unattested: gh found no attestation of .github/workflows/linux-engine.yml … (Error: HTTP 404: Not Found …).A short live dev verdict run works and is labelled. On the downloaded asset, scene
desktop, oplist_windows, 1 block, the output was:It exited 0, and the summary heading reads
## t28-dev (development run, not a release gate). The window list on:0was identical before and after, and no copy was left.A stopped run cleans up.
:0were unchanged.t3-truncation-dev, pid 598042 and its two engines), not processes this run started. The log now says so.:0, which another task owns.CI is green.
ci-gate --gates engine-linux,teston a5f86ee: PASS engine-linux 3m34s, PASS test 8m02s, GREEN https://github.com/SSFSKIM/cua/actions/runs/41380898798. It was also GREEN on 32a2e29 (run 41376623039) and on 23c2709 (run 41379130368).Residue
CARGO_HOME, the path remaps,CUA_ENGINE_GIT_SHA, and the samestrip. It produced15cee88b…(4 KB smaller), and the gate refused it as unattested. In practice, then, a gate takes the workflow's artifact. The README says so. I didn't look into the cause.--cuaraw. When they join the gate, they should take the candidate throughprepareCandidatetoo.Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)