- Publish assets before consuming them, then progress through opt-in RC, internal
- canary, default-on RC, and stable. Enable only tuples with complete live evidence;
- keep the fallback through at least two stable cycles.
+ Publish assets before consuming them, then ship the per-target Beta through RC and
+ stable while every target remains on legacy unless explicitly opted in. Any
+ default-on RC or stable promotion requires a separate reviewed decision. Enable
+ only tuples with complete live evidence; keep the fallback through at least two
+ stable cycles.
@@ -1147,8 +1149,10 @@
Build for the runtime, architecture, and libc together.
Runtime metadata, dependency licenses, and a file-level SHA-256 manifest.
- No development dependencies, package manager, compiler, source maps, or PDBs
- unless explicitly needed for diagnostics.
+ No development dependencies, package manager, compiler, source maps, PDBs, or
+ Orca-built debug symbols unless explicitly needed for diagnostics. Preserve the
+ verified official Node executable byte-for-byte even when upstream metadata is
+ present; never strip or rewrite those authenticated bytes.
diff --git a/package.json b/package.json
index ef3d4534b01..12c0fe1b542 100644
--- a/package.json
+++ b/package.json
@@ -43,11 +43,13 @@
"dev-stable-name": "pnpm run ensure:electron-runtime && node config/scripts/run-electron-vite-dev.mjs --stable-name",
"dev:web": "vite --config vite.web.config.ts --host 127.0.0.1",
"build:relay": "node config/scripts/build-relay.mjs",
+ "build:ssh-relay-runtime": "node config/scripts/build-ssh-relay-runtime.mjs",
"build:computer-macos": "node config/scripts/build-computer-macos.mjs",
"build:notification-status-macos": "node config/scripts/build-notification-status-macos.mjs",
"build:native": "node config/scripts/build-native-for-platform.mjs",
"smoke:computer": "node config/scripts/computer-use-smoke.mjs",
"verify:computer-native": "node config/scripts/verify-computer-native.mjs",
+ "verify:ssh-relay-runtime": "node config/scripts/verify-ssh-relay-runtime.mjs",
"verify:cli-bin": "node config/scripts/verify-cli-bin.mjs",
"verify:localization-catalog": "node config/scripts/verify-localization-catalog.mjs",
"sync:localization-catalog": "node config/scripts/verify-localization-catalog.mjs --fix",
@@ -211,6 +213,7 @@
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.4",
+ "tar": "7.5.16",
"tw-animate-css": "^1.4.0",
"typescript": "^7.0.2",
"typescript-api": "npm:typescript@6.0.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0a3136394d1..d879a29059f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -347,6 +347,9 @@ importers:
tailwindcss:
specifier: ^4.2.4
version: 4.2.4
+ tar:
+ specifier: 7.5.16
+ version: 7.5.16
tw-animate-css:
specifier: ^1.4.0
version: 1.4.0
From f8a230ef301fc6f2bb76082f549e3b3ae725c142 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 09:04:47 -0400
Subject: [PATCH 002/267] docs(ssh): record runtime artifact draft PR
Co-authored-by: Orca
---
...-github-release-implementation-checklist.md | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index a0f6a45c359..d2d5d41c22f 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -58,8 +58,9 @@ same change as the work it records.
[#8728](https://github.com/stablyai/orca/pull/8728) at implementation commit `b9d80a4cb`; no
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
- smoke, SBOM, and provenance only. It may produce test artifacts but must not publish, resolve,
- transfer, install, launch, or enable them.
+ smoke, SBOM, and provenance only at implementation commit `f2b387b21` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741). It may produce test artifacts but must not
+ publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -1135,7 +1136,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | In progress; one local POSIX tuple green | E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native CI pending | `f2b387b21`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -2217,7 +2218,8 @@ fragmentLinks=9`.
### E-M3-NODE-PROVENANCE-001 — Pinned Node metadata and archive verification
- Date: 2026-07-14
-- Commit SHA / PR: `0c299fe189310b6dbd539f0f0f506b240524ba6a` plus uncommitted Work Package 2 implementation; no Work Package 2 PR yet
+- Commit SHA / PR: implementation commit `f2b387b21bbe6a3863ff1a492a1a03b65e0a0477` in stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741); native PR CI pending
- Runner: focused tests on macOS 26.2 arm64 with Node v26.0.0/pnpm 10.24.0; real proof in
Docker Engine 29.2.1 on Linux/arm64 using `node:24-bookworm` resolved to
`node@sha256:032e78d7e54e352129831743737e3a83171d9cc5b5896f411649c597ce0b11ea`,
@@ -2269,8 +2271,8 @@ fragmentLinks=9`.
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
-- Commit SHA / PR: `0c299fe189310b6dbd539f0f0f506b240524ba6a` plus uncommitted Work
- Package 2 implementation; no Work Package 2 PR yet
+- Commit SHA / PR: implementation commit `f2b387b21bbe6a3863ff1a492a1a03b65e0a0477` in stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741); native PR CI pending
- Runner: macOS 26.2 arm64 host with Docker Engine 29.2.1; native Linux/arm64 container
`node@sha256:032e78d7e54e352129831743737e3a83171d9cc5b5896f411649c597ce0b11ea`
(Debian bookworm, build Node v24.17.0), bundled Node v24.18.0 ABI 137, Python 3.11.2, GNU
@@ -2357,8 +2359,8 @@ fragmentLinks=9`.
### E-M3-STATIC-001 — Work Package 2 focused and repository static gates
- Date: 2026-07-14
-- Commit SHA / PR: `0c299fe189310b6dbd539f0f0f506b240524ba6a` plus uncommitted Work
- Package 2 implementation; no Work Package 2 PR yet
+- Commit SHA / PR: implementation commit `f2b387b21bbe6a3863ff1a492a1a03b65e0a0477` in stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741); native PR CI pending
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
- Remote and transport: not applicable; local source/static verification only
- Exact commands:
From 151628992f8d05d11902604650b3ed884992da5c Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 09:10:28 -0400
Subject: [PATCH 003/267] fix(ssh): canonicalize runtime watcher smoke paths
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-smoke-child.cjs | 8 ++-
...github-release-implementation-checklist.md | 62 +++++++++++++++++--
2 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-smoke-child.cjs b/config/scripts/ssh-relay-runtime-smoke-child.cjs
index 7ac0b483df4..f4432a6d236 100644
--- a/config/scripts/ssh-relay-runtime-smoke-child.cjs
+++ b/config/scripts/ssh-relay-runtime-smoke-child.cjs
@@ -1,6 +1,6 @@
'use strict'
-const { appendFile, mkdtemp, rename, rm, unlink, writeFile } = require('node:fs/promises')
+const { appendFile, mkdtemp, realpath, rename, rm, unlink, writeFile } = require('node:fs/promises')
const { tmpdir } = require('node:os')
const { join } = require('node:path')
const { createRequire } = require('node:module')
@@ -90,13 +90,17 @@ async function waitFor(events, predicate, label) {
while (!predicate(events)) {
await Promise.race([new Promise((resolve) => setTimeout(resolve, 25)), timer.promise])
}
+ } catch (error) {
+ throw new Error(`${error.message}; observed=${JSON.stringify(events.slice(-20))}`)
} finally {
timer.cancel()
}
}
async function watcherSmoke() {
- const directory = await mkdtemp(join(tmpdir(), 'orca-runtime-watcher-'))
+ const createdDirectory = await mkdtemp(join(tmpdir(), 'orca-runtime-watcher-'))
+ // Why: macOS FSEvents reports `/private/var` even when tmpdir returned the `/var` symlink.
+ const directory = await realpath(createdDirectory)
const first = join(directory, 'first.txt')
const second = join(directory, 'renamed.txt')
const events = []
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index d2d5d41c22f..1ccbf0806b1 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -66,7 +66,9 @@ same change as the work it records.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
archive inspection, deterministic repack, bundled Node 24.18.0 execution, real patched PTY, and
watcher events. E-M3-STATIC-001 records the current focused, type, lint, format, line-budget, and
- diff gates. Oldest-baseline, native-trust, SSH, and every other tuple cell remain open.
+ diff gates. The first exact-head native run exposed a macOS `/var` versus `/private/var` watcher
+ oracle mismatch under E-M3-CI-RED-001; the canonical-path fix is pending rerun. Oldest-baseline,
+ native-trust, SSH, and every other tuple cell remain open.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -79,8 +81,9 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: run the isolated four-tuple POSIX artifact workflow on the exact draft-PR
- head and record each native GitHub runner result. Keep Windows runtime/zip implementation,
+- Next required action: push the macOS watcher-path oracle correction, rerun the isolated four-tuple
+ POSIX artifact workflow on the exact draft-PR head, and record each native GitHub runner result.
+ Keep Windows runtime/zip implementation,
cross-family remote infrastructure, signing/trust, and measured legacy baseline gates open; do not
introduce publication, resolver, transfer, rollout, tuple enablement, or default behavior.
@@ -1136,7 +1139,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native CI pending | `f2b387b21`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; macOS oracle fix pending | `f2b387b21`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-RED-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -2396,6 +2399,57 @@ fragmentLinks=9`.
- Follow-up: create the isolated stacked draft PR, run the four target-native POSIX jobs, and replace
uncommitted/local evidence with exact commit, run, job, image, artifact, and duration identifiers.
+### E-M3-CI-RED-001 — Native macOS watcher path-oracle failure
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact draft-PR head `f8a230ef301fc6f2bb76082f549e3b3ae725c142` in
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner and jobs: GitHub Actions run
+ [29335018198](https://github.com/stablyai/orca/actions/runs/29335018198); macOS arm64 job
+ [87092056703](https://github.com/stablyai/orca/actions/runs/29335018198/job/87092056703) used
+ `macos-15-arm64` image `20260706.0213.1`, macOS 15.7.7, runner arm64, and Node v24.18.0;
+ macOS x64 job
+ [87092056769](https://github.com/stablyai/orca/actions/runs/29335018198/job/87092056769) used
+ `macos-15` image `20260629.0276.1`, runner x64, and Node v24.18.0
+- Remote and transport: no SSH remote; target-native artifact build and local execution on each
+ hosted runner; Node inputs downloaded from the exact pinned nodejs.org URLs
+- Exact workflow/log commands:
+
+ ```sh
+ gh run watch 29335018198 --repo stablyai/orca --exit-status --interval 10
+ gh api -H 'Accept: application/vnd.github+json' \
+ repos/stablyai/orca/actions/jobs/87092056703/logs
+ gh api -H 'Accept: application/vnd.github+json' \
+ repos/stablyai/orca/actions/jobs/87092056769/logs
+ ```
+
+- Result: expected discriminating FAIL. Both macOS jobs passed exact-head checkout, Node 24 setup,
+ frozen dependency install, 15/15 contract tests, authenticated Node input download, target-native
+ Node/`node-pty`/watcher assembly, deterministic archive inspection, and full tree hashing. Native
+ smoke then timed out after 15 seconds waiting for watcher `create`; evidence upload correctly did
+ not run. Both Linux jobs completed build, verification, smoke, and unpublished upload, but their
+ cells remain provisional until the corrected exact-head matrix reruns.
+- Duration and resource metrics: macOS arm64 job failed in 1m51s after a 54,699.324 ms artifact
+ build; macOS x64 failed in 3m44s after a 105,665.482 ms artifact build. Each watcher wait settled
+ at its declared 15-second bound. Peak memory and open-file counts were not recorded in the failed
+ macOS smoke because no success payload was emitted.
+- Artifact/log/trace link: run and job links above. The arm64 pre-smoke artifact had content ID
+ `sha256:cc205af32168718f9662e8513338ad844ba4c1210c247623d84f92778afa1610` and archive hash
+ `sha256:cd9cca6f56c9645a73b6b022515668ef7392c2eeb8f01d63b8a46b046cf337a3`;
+ the x64 pre-smoke artifact had content ID
+ `sha256:82a7017f6c1f703258a9d6b9f3d5ad4d5c57320f1b667fd87902cb1f4cd21cd3` and archive hash
+ `sha256:88670165fcdf55236fb2a81d70566b913b39824362b5cf5f0136e646bf9c9b2c`.
+- Oracle proved: the native matrix and exact-head provenance gates discriminate after successful
+ builds; macOS FSEvents can report canonical `/private/var/...` paths while `tmpdir()` supplied the
+ `/var/...` symlink spelling, so the equality oracle could reject the same filesystem object.
+- Does not prove: a passing macOS watcher, upload, native trust/signing, oldest baseline, SSH,
+ relay RPCs, Windows, or any enabled tuple. Successful Linux results from this failed aggregate do
+ not satisfy the final corrected-head evidence requirement.
+- Checklist items satisfied: red half of the macOS target-native watcher-smoke gate only; no tuple
+ checkbox was changed.
+- Follow-up: canonicalize the watched temporary directory before constructing expected event paths,
+ retain bounded observed-event diagnostics, rerun all four jobs, and require every upload to pass.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
From c308107a96d90c57155b6684ee5f657c6e077ef2 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 09:23:40 -0400
Subject: [PATCH 004/267] docs(ssh): record native runtime artifact CI
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 136 ++++++++++++------
1 file changed, 95 insertions(+), 41 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 1ccbf0806b1..e913d49f7f4 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — Work Package 1 contracts are CI-green; cross-family remote infrastructure and measured baselines remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows runtime/ZIP, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -58,7 +58,7 @@ same change as the work it records.
[#8728](https://github.com/stablyai/orca/pull/8728) at implementation commit `b9d80a4cb`; no
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
- smoke, SBOM, and provenance only at implementation commit `f2b387b21` in stacked draft PR
+ smoke, SBOM, and provenance only at exact implementation head `151628992` in stacked draft PR
[#8741](https://github.com/stablyai/orca/pull/8741). It may produce test artifacts but must not
publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
@@ -67,8 +67,10 @@ same change as the work it records.
archive inspection, deterministic repack, bundled Node 24.18.0 execution, real patched PTY, and
watcher events. E-M3-STATIC-001 records the current focused, type, lint, format, line-budget, and
diff gates. The first exact-head native run exposed a macOS `/var` versus `/private/var` watcher
- oracle mismatch under E-M3-CI-RED-001; the canonical-path fix is pending rerun. Oldest-baseline,
- native-trust, SSH, and every other tuple cell remain open.
+ oracle mismatch under E-M3-CI-RED-001. The corrected exact-head run passed target-native build,
+ archive/tree verification, bundled Node, patched PTY, and watcher smoke for Linux x64/arm64 and
+ macOS x64/arm64 under E-M3-CI-001. Same-runner clean-rebuild identity, oldest-baseline,
+ native-trust, SSH, Windows, and musl cells remain open.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -81,9 +83,9 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: push the macOS watcher-path oracle correction, rerun the isolated four-tuple
- POSIX artifact workflow on the exact draft-PR head, and record each native GitHub runner result.
- Keep Windows runtime/zip implementation,
+- Next required action: implement the bounded deterministic Windows runtime/ZIP builder and verifier
+ as the next artifact-only slice, add native Windows x64/arm64 runner jobs, and separately add a
+ same-head/same-runner clean-rebuild identity oracle for native build reproducibility. Keep
cross-family remote infrastructure, signing/trust, and measured legacy baseline gates open; do not
introduce publication, resolver, transfer, rollout, tuple enablement, or default behavior.
@@ -577,16 +579,16 @@ Each runtime must contain only the executable closure required by the relay.
### Per-tuple build and executable proof
-| Runtime tuple | Build/provenance | Bundled Node | `node-pty` load + real PTY | Watcher events | Oldest baseline | Native trust | Evidence |
-| ----------------- | ---------------- | ------------ | -------------------------- | -------------- | --------------- | ------------ | ---------------------- |
-| linux-x64-glibc | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| linux-arm64-glibc | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-RUNTIME-LOCAL-001 |
-| linux-x64-musl | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| linux-arm64-musl | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| darwin-x64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| darwin-arm64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| win32-x64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| win32-arm64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
+| Runtime tuple | Build/provenance | Bundled Node | `node-pty` load + real PTY | Watcher events | Oldest baseline | Native trust | Evidence |
+| ----------------- | ---------------- | ------------ | -------------------------- | -------------- | --------------- | ------------ | ----------------------------------- |
+| linux-x64-glibc | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-CI-001 |
+| linux-arm64-glibc | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-RUNTIME-LOCAL-001; E-M3-CI-001 |
+| linux-x64-musl | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
+| linux-arm64-musl | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
+| darwin-x64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-CI-001 |
+| darwin-arm64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-CI-001 |
+| win32-x64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
+| win32-arm64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
Rules:
@@ -1135,16 +1137,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; macOS oracle fix pending | `f2b387b21`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-RED-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; four POSIX jobs green; Windows active | `151628992`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-RED-001, E-M3-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -2450,22 +2452,74 @@ fragmentLinks=9`.
- Follow-up: canonicalize the watched temporary directory before constructing expected event paths,
retain bounded observed-event diagnostics, rerun all four jobs, and require every upload to pass.
+### E-M3-CI-001 — Corrected four-tuple POSIX native artifact run
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact draft-PR head `151628992f8d05d11902604650b3ed884992da5c` in
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Workflow: GitHub Actions run
+ [29335399279](https://github.com/stablyai/orca/actions/runs/29335399279), conclusion `success`;
+ no release asset was published
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29335399279 --repo stablyai/orca --json databaseId,headSha,status,conclusion,url,jobs
+ gh run view 29335399279 --repo stablyai/orca --job --log
+ gh api --paginate repos/stablyai/orca/actions/runs/29335399279/artifacts
+ gh api repos/stablyai/orca/actions/artifacts//zip
+ unzip -p '*.identity.json' | jq
+ ```
+
+- Native runner, artifact, identity, and resource results:
+
+ | Tuple | Job / requested runner / resolved image | Artifact ID / Actions ZIP bytes | Runtime archive bytes / expanded bytes / files | Content ID / archive SHA-256 | Build / full verify / smoke / RSS |
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
+ | `darwin-arm64` | [87093265074](https://github.com/stablyai/orca/actions/runs/29335399279/job/87093265074); `macos-15`; `macos15` `20260706.0213.1`; native ARM64 | `8311761833`; 24,755,748 | 24,742,840 / 122,027,869 / 35 | `16a9814a2af4adfbcce55ead3ab53f3982d8043d4b18d85762586212a481bdca` / `a7e31f92c1a0793b656f79ceff5fe63b7a1cf56a70394336a92c2ab207d30ea7` | 52,648.921 ms / 2,090.791 ms / 556.324 ms / 51,068,928 bytes |
+ | `darwin-x64` | [87093265143](https://github.com/stablyai/orca/actions/runs/29335399279/job/87093265143); `macos-15-intel`; `macos15` `20260629.0276.1`; native X64 | `8311834044`; 26,420,360 | 26,405,780 / 124,316,655 / 35 | `ad3a4cdaf25cd8f2657e348fca5c68df69923f9f50295afa2227a8c195e2014b` / `9b6c492b4fda250c6b6688e343499e79afc7ca53be355b1e687e61ed8430a759` | 108,328.464 ms / 1,956.297 ms / 325.008 ms / 40,546,304 bytes |
+ | `linux-x64-glibc` | [87093265139](https://github.com/stablyai/orca/actions/runs/29335399279/job/87093265139); `ubuntu-24.04`; `ubuntu24` `20260705.232.1`; native X64 | `8311766570`; 29,276,673 | 29,260,688 / 124,846,502 / 34 | `960546cd96c67fcf9bb0a61e96ecdbecbffd9104d3a495578f8bb19dd810649a` / `b28fc4837d17399246926ab4d565e30f21b6adc6c22401910627e820aca7c52b` | 61,805.875 ms / 2,288.790 ms / 159.950 ms / 56,315,904 bytes |
+ | `linux-arm64-glibc` | [87093265142](https://github.com/stablyai/orca/actions/runs/29335399279/job/87093265142); `ubuntu-24.04-arm`; `ubuntu24` `20260706.52.2`; native ARM64 | `8311785832`; 28,215,447 | 28,200,600 / 122,865,172 / 34 | `aa3aa8ae8b42334ba7b0dbe5c43fd1184e36b3f4f4a9bec0e990e9b78f090756` / `d73d03c0507408e538b93549d449359e78c986c45f1bd5811c15197720fc5da8` | 69,030.100 ms / 1,618.140 ms / 159.037 ms / 52,219,904 bytes |
+
+- Result: PASS. All four jobs checked out the exact source head, used Node v24.18.0, authenticated
+ the pinned Node release metadata and tuple archive, used a frozen source install, passed 15/15
+ focused contracts, assembled on the target-native architecture, verified the complete archive and
+ unpacked tree before native execution, loaded the Orca-patched PTY addon, exercised a real PTY
+ input/101×37 resize/exit-23 lifecycle, observed bounded create/update/rename/delete watcher events,
+ and uploaded only an unpublished seven-day Actions artifact.
+- Oracle proved: target-native build/provenance, bundled Node execution, patched native PTY load and
+ lifecycle, watcher lifecycle, exact archive/tree equality, size bounds, and artifact-only workflow
+ behavior for the four named POSIX tuples on the exact runner images above.
+- Does not prove: deterministic native rebuilding. The local versus CI Linux arm64 runtime differed
+ in the Orca-built `pty.node`, and the red versus corrected macOS runs produced different content
+ identities despite no intended runtime-tree source change. The current jobs record image and
+ toolchain versions but do not pin all apt/Homebrew/compiler inputs or compare two clean native
+ builds on the same runner. This evidence also does not prove oldest OS/libc/kernel baselines,
+ native signing/trust, Windows/ZIP, musl, SSH/SFTP/system-SSH transfer, relay RPC conformance,
+ cancellation/file/channel peaks, release publication/read-back, cache, fallback, UI, or any
+ enabled tuple.
+- Checklist items satisfied: build/provenance, bundled Node, real patched PTY, and watcher cells for
+ `linux-x64-glibc`, `linux-arm64-glibc`, `darwin-x64`, and `darwin-arm64` only. Oldest-baseline and
+ native-trust cells remain unchecked.
+- Follow-up: add a same-head/same-runner two-clean-build identity comparison, implement bounded
+ deterministic Windows ZIP assembly and native Windows jobs, and leave all tuples disabled until
+ the remaining trust, baseline, and two-layer live SSH gates pass.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | One unpublished Linux arm64 artifact proof; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime/zip builder absent | Windows targets remain entirely on the legacy path | POSIX proof cannot establish Windows behavior | Codex implementation owner | Bounded deterministic zip, Node/native build, signing, smoke, and live gates | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime/zip builder absent | Windows targets remain entirely on the legacy path | POSIX proof cannot establish Windows behavior | Codex implementation owner | Bounded deterministic zip, Node/native build, signing, smoke, and live gates | Open |
+| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -2506,9 +2560,9 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Run `.github/workflows/ssh-relay-runtime-artifacts.yml` on the exact stacked draft-PR head and record
-the four native POSIX runner results without publishing assets. Then implement Windows zip/native
-assembly as its own evidence-gated slice. The cross-family Layer B target pool, protected
+Implement bounded deterministic Windows ZIP/native assembly as its own evidence-gated slice, add
+native Windows x64/arm64 jobs without publishing assets, and add a same-head/same-runner clean-build
+identity comparison for native reproducibility. The cross-family Layer B target pool, protected
manifest-signing environment, and paired legacy performance baseline remain release/default-path
blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta, fallback, tuple
enablement, or default behavior may be connected by this package.
From 922edb6ff28199b394f508731fd18a635bec49a0 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 09:58:21 -0400
Subject: [PATCH 005/267] build(ssh): add Windows relay runtime artifacts
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 163 +++++++++++++
config/scripts/build-ssh-relay-runtime.mjs | 73 ++++--
.../ssh-relay-node-headers-extraction.mjs | 176 ++++++++++++++
config/scripts/ssh-relay-node-pty-build.mjs | 53 ++++-
.../ssh-relay-node-release-contract.mjs | 63 ++++-
...h-relay-node-release-file-verification.mjs | 22 ++
.../ssh-relay-node-release-verification.mjs | 5 +-
...h-relay-node-release-verification.test.mjs | 93 ++++++--
.../ssh-relay-node-tar-inspection.test.mjs | 9 +-
.../scripts/ssh-relay-node-zip-inspection.mjs | 141 ++++++++++++
.../ssh-relay-node-zip-inspection.test.mjs | 195 ++++++++++++++++
config/scripts/ssh-relay-runtime-archive.mjs | 17 +-
.../scripts/ssh-relay-runtime-provenance.mjs | 33 ++-
.../scripts/ssh-relay-runtime-smoke-child.cjs | 64 ++++--
config/scripts/ssh-relay-runtime-tree.mjs | 78 +++++--
.../ssh-relay-runtime-windows-tree.test.mjs | 92 ++++++++
.../ssh-relay-runtime-workflow.test.mjs | 27 ++-
config/scripts/ssh-relay-runtime-zip.mjs | 138 +++++++++++
config/scripts/ssh-relay-runtime-zip.test.mjs | 134 +++++++++++
config/scripts/ssh-relay-zip-reader.mjs | 217 ++++++++++++++++++
.../verify-ssh-relay-node-release-inputs.mjs | 29 ++-
config/scripts/verify-ssh-relay-runtime.mjs | 9 +-
config/ssh-relay-node-release-v24.18.0.json | 16 ++
...github-release-implementation-checklist.md | 209 ++++++++++++++++-
...6-07-14-ssh-relay-github-release-plan.html | 24 +-
package.json | 2 +
pnpm-lock.yaml | 32 +++
27 files changed, 1994 insertions(+), 120 deletions(-)
create mode 100644 config/scripts/ssh-relay-node-headers-extraction.mjs
create mode 100644 config/scripts/ssh-relay-node-zip-inspection.mjs
create mode 100644 config/scripts/ssh-relay-node-zip-inspection.test.mjs
create mode 100644 config/scripts/ssh-relay-runtime-windows-tree.test.mjs
create mode 100644 config/scripts/ssh-relay-runtime-zip.mjs
create mode 100644 config/scripts/ssh-relay-runtime-zip.test.mjs
create mode 100644 config/scripts/ssh-relay-zip-reader.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 63a7b9b1b5a..1c0b2b51349 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -106,7 +106,10 @@ jobs:
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
config/scripts/ssh-relay-runtime-workflow.test.mjs
- name: Download exact Node release inputs
@@ -160,3 +163,163 @@ jobs:
path: runtime-evidence/${{ matrix.tuple }}/
if-no-files-found: error
retention-days: 7
+
+ build-windows-runtime:
+ name: Build ${{ matrix.tuple }} runtime
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - runner: windows-2022
+ tuple: win32-x64
+ node_archive: node-v24.18.0-win-x64.zip
+ node_library: win-x64/node.lib
+ msvc_arch: x64
+ - runner: windows-11-arm
+ tuple: win32-arm64
+ node_archive: node-v24.18.0-win-arm64.zip
+ node_library: win-arm64/node.lib
+ msvc_arch: arm64
+ runs-on: ${{ matrix.runner }}
+ timeout-minutes: 30
+
+ steps:
+ - name: Checkout exact source revision
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
+ with:
+ # Why: artifact evidence must name the exact reviewed source, not GitHub's synthetic merge.
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
+
+ - name: Configure target-native MSVC
+ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
+ with:
+ arch: ${{ matrix.msvc_arch }}
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6
+ with:
+ run_install: false
+
+ - name: Setup Node 24.18.0
+ uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
+ with:
+ node-version: 24.18.0
+ cache: pnpm
+
+ - name: Record native runner identity
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ "requested_runner=${{ matrix.runner }}"
+ "resolved_image_os=$env:ImageOS"
+ "resolved_image_version=$env:ImageVersion"
+ "runner_arch=$env:RUNNER_ARCH"
+ "runner_environment=$env:RUNNER_ENVIRONMENT"
+ Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsBuildNumber
+ node --version
+ "source_commit=$(git rev-parse HEAD)"
+
+ - name: Select bundled Git signature tools
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ $gitUsrBin = Join-Path $env:ProgramFiles 'Git/usr/bin'
+ foreach ($tool in @('gpg.exe', 'gpgv.exe')) {
+ if (-not (Test-Path -LiteralPath (Join-Path $gitUsrBin $tool) -PathType Leaf)) {
+ throw "Git for Windows does not provide required signature tool: $tool"
+ }
+ }
+ $gitUsrBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Install source dependencies without native postinstall
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ pnpm install --frozen-lockfile --ignore-scripts
+ if ($LASTEXITCODE -ne 0) { throw 'pnpm install failed' }
+ git diff --exit-code package.json pnpm-lock.yaml
+ if ($LASTEXITCODE -ne 0) { throw 'frozen install changed dependency files' }
+
+ - name: Run runtime artifact contract tests
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ pnpm exec vitest run --config config/vitest.config.ts `
+ config/scripts/ssh-relay-node-release-verification.test.mjs `
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs `
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs `
+ config/scripts/ssh-relay-runtime-artifact.test.mjs `
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
+ config/scripts/ssh-relay-runtime-zip.test.mjs `
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime artifact contract tests failed' }
+
+ - name: Download exact Node release inputs
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ $inputs = Join-Path $env:RUNNER_TEMP 'node-release-inputs'
+ New-Item -ItemType Directory -Path $inputs | Out-Null
+ $base = 'https://nodejs.org/dist/v24.18.0'
+ $assets = @(
+ 'SHASUMS256.txt',
+ 'SHASUMS256.txt.sig',
+ '${{ matrix.node_archive }}',
+ 'node-v24.18.0-headers.tar.gz',
+ '${{ matrix.node_library }}'
+ )
+ foreach ($asset in $assets) {
+ $destination = Join-Path $inputs $asset
+ New-Item -ItemType Directory -Path (Split-Path -Parent $destination) -Force | Out-Null
+ & curl.exe --fail --silent --show-error --location --proto '=https' --tlsv1.2 `
+ --connect-timeout 20 --max-time 300 --retry 2 --retry-delay 2 --retry-all-errors `
+ "$base/$asset" --output $destination
+ if ($LASTEXITCODE -ne 0) { throw "Node input download failed: $asset" }
+ }
+ "NODE_INPUTS=$inputs" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
+
+ - name: Build, inspect, and smoke exact runtime
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ $output = Join-Path $env:RUNNER_TEMP 'ssh-relay-runtime/${{ matrix.tuple }}'
+ New-Item -ItemType Directory -Path (Split-Path -Parent $output) -Force | Out-Null
+ $sourceCommit = git rev-parse HEAD
+ $sourceDateEpoch = git show -s --format=%ct $sourceCommit
+ node config/scripts/build-ssh-relay-runtime.mjs `
+ --tuple '${{ matrix.tuple }}' `
+ --inputs-directory $env:NODE_INPUTS `
+ --output-directory $output `
+ --source-date-epoch $sourceDateEpoch `
+ --git-commit $sourceCommit
+ if ($LASTEXITCODE -ne 0) { throw 'runtime build failed' }
+ $identity = Join-Path $output 'orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json'
+ $archive = Get-ChildItem -LiteralPath $output -Filter '*.zip' -File | Select-Object -First 1
+ if (-not $archive) { throw 'runtime ZIP is missing' }
+ node config/scripts/verify-ssh-relay-runtime.mjs `
+ --runtime-directory (Join-Path $output 'runtime') `
+ --identity $identity `
+ --archive $archive.FullName
+ if ($LASTEXITCODE -ne 0) { throw 'runtime verification failed' }
+ $prohibited = Get-ChildItem -LiteralPath (Join-Path $output 'runtime') -Recurse -File |
+ Where-Object { $_.Name -in @('npm', 'npm.cmd', 'npx', 'npx.cmd', 'corepack', 'corepack.cmd') -or $_.Name.EndsWith('.map') } |
+ Select-Object -First 1
+ if ($prohibited) { throw "Runtime contains a prohibited file: $($prohibited.FullName)" }
+ $parcelRoot = Join-Path $output 'runtime/node_modules/@parcel'
+ if (@(Get-ChildItem -LiteralPath $parcelRoot -Directory).Count -ne 2) {
+ throw 'Runtime must contain exactly the watcher wrapper and one native package'
+ }
+ $evidence = Join-Path $env:GITHUB_WORKSPACE 'runtime-evidence/${{ matrix.tuple }}'
+ New-Item -ItemType Directory -Path $evidence -Force | Out-Null
+ Copy-Item -LiteralPath $archive.FullName -Destination $evidence
+ Get-ChildItem -LiteralPath $output -File |
+ Where-Object { $_.Name -match '\.(?:spdx|provenance|identity)\.json$' } |
+ Copy-Item -Destination $evidence
+
+ - name: Upload unpublished artifact evidence
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
+ with:
+ name: ssh-relay-runtime-${{ matrix.tuple }}
+ path: runtime-evidence/${{ matrix.tuple }}/
+ if-no-files-found: error
+ retention-days: 7
diff --git a/config/scripts/build-ssh-relay-runtime.mjs b/config/scripts/build-ssh-relay-runtime.mjs
index 00ac12a2808..346481f5c06 100644
--- a/config/scripts/build-ssh-relay-runtime.mjs
+++ b/config/scripts/build-ssh-relay-runtime.mjs
@@ -8,6 +8,7 @@ import { promisify } from 'node:util'
import { buildPatchedSshRelayNodePty } from './ssh-relay-node-pty-build.mjs'
import { extractVerifiedSshRelayNodeBuildInputs } from './ssh-relay-node-tar-inspection.mjs'
+import { extractVerifiedSshRelayNodeZipBuildInputs } from './ssh-relay-node-zip-inspection.mjs'
import {
createSshRelayRuntimeArchive,
inspectSshRelayRuntimeArchive
@@ -25,7 +26,9 @@ const SUPPORTED_TUPLES = new Set([
'linux-x64-glibc',
'linux-arm64-glibc',
'darwin-x64',
- 'darwin-arm64'
+ 'darwin-arm64',
+ 'win32-x64',
+ 'win32-arm64'
])
const BUILD_COMMAND_TIMEOUT_MS = 10 * 60 * 1000
@@ -83,7 +86,7 @@ export function parseBuildArguments(argv) {
}
function assertTargetNative(tuple) {
- const os = tuple.startsWith('linux-') ? 'linux' : 'darwin'
+ const os = tuple.startsWith('linux-') ? 'linux' : tuple.startsWith('darwin-') ? 'darwin' : 'win32'
const architecture = tuple.includes('arm64') ? 'arm64' : 'x64'
if (process.platform !== os || process.arch !== architecture) {
throw new Error(`Runtime ${tuple} must be assembled on target-native ${os}/${architecture}`)
@@ -114,25 +117,31 @@ async function run(command, args, options = {}) {
}
async function toolchainDetails(nodePath) {
- const commands = [
- ['bundledNode', nodePath, ['--version']],
- ['xz', 'xz', ['--version']],
- ['compiler', process.platform === 'win32' ? 'cl.exe' : 'c++', ['--version']],
- [
- 'strip',
- process.platform === 'darwin'
- ? 'xcrun'
- : process.platform === 'win32'
- ? 'llvm-strip.exe'
- : 'strip',
- process.platform === 'darwin' ? ['--find', 'strip'] : ['--version']
- ],
- ['python', process.platform === 'win32' ? 'python.exe' : 'python3', ['--version']]
- ]
+ const commands =
+ process.platform === 'win32'
+ ? [
+ ['bundledNode', nodePath, ['--version']],
+ ['compiler', 'cl.exe', []],
+ ['python', 'python.exe', ['--version']]
+ ]
+ : [
+ ['bundledNode', nodePath, ['--version']],
+ ['xz', 'xz', ['--version']],
+ ['compiler', 'c++', ['--version']],
+ [
+ 'strip',
+ process.platform === 'darwin' ? 'xcrun' : 'strip',
+ process.platform === 'darwin' ? ['--find', 'strip'] : ['--version']
+ ],
+ ['python', 'python3', ['--version']]
+ ]
const details = {}
for (const [name, command, args] of commands) {
details[name] = (await run(command, args)).split(/\r?\n/)[0]
}
+ if (process.platform === 'win32') {
+ details.zip = 'yazl 3.3.1'
+ }
details.buildNode = process.version
return details
}
@@ -159,12 +168,30 @@ export async function buildSshRelayRuntime(options) {
try {
await run(process.execPath, [resolve(scriptDirectory, 'build-relay.mjs')], { cwd: projectRoot })
const extractedDirectory = join(workDirectory, 'node-inputs')
- const extracted = await extractVerifiedSshRelayNodeBuildInputs(
- release,
- options.tuple,
- join(options.inputsDirectory, release.archives[options.tuple].name),
- extractedDirectory
- )
+ const nodeArchivePath = join(options.inputsDirectory, release.archives[options.tuple].name)
+ const extracted = options.tuple.startsWith('win32-')
+ ? await extractVerifiedSshRelayNodeZipBuildInputs(
+ release,
+ options.tuple,
+ nodeArchivePath,
+ extractedDirectory,
+ {
+ headersArchivePath: join(
+ options.inputsDirectory,
+ release.windowsBuildInputs.headersArchive.name
+ ),
+ importLibraryPath: join(
+ options.inputsDirectory,
+ ...release.windowsBuildInputs.importLibraries[options.tuple].name.split('/')
+ )
+ }
+ )
+ : await extractVerifiedSshRelayNodeBuildInputs(
+ release,
+ options.tuple,
+ nodeArchivePath,
+ extractedDirectory
+ )
const bundledVersion = await run(extracted.nodePath, ['--version'])
if (bundledVersion !== `v${release.nodeVersion}`) {
throw new Error(`Bundled Node version mismatch: ${bundledVersion}`)
diff --git a/config/scripts/ssh-relay-node-headers-extraction.mjs b/config/scripts/ssh-relay-node-headers-extraction.mjs
new file mode 100644
index 00000000000..0d771240c26
--- /dev/null
+++ b/config/scripts/ssh-relay-node-headers-extraction.mjs
@@ -0,0 +1,176 @@
+import { constants } from 'node:fs'
+import { createReadStream } from 'node:fs'
+import { copyFile, mkdtemp, rm, stat } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { pipeline } from 'node:stream/promises'
+import { createGunzip } from 'node:zlib'
+
+import { Parser, Unpack } from 'tar'
+
+import { verifySshRelayNodeWindowsBuildInput } from './ssh-relay-node-release-file-verification.mjs'
+import { validateSshRelayNodeReleaseContract } from './ssh-relay-node-release-contract.mjs'
+
+const MAX_ENTRIES = 100_000
+const MAX_EXPANDED_BYTES = 1024 * 1024 * 1024
+const MAX_FILE_BYTES = 256 * 1024 * 1024
+const MAX_PATH_BYTES = 512
+const MAX_DEPTH = 32
+const GZIP_TIMEOUT_MS = 5 * 60 * 1000
+const WINDOWS_DEVICE_NAME = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i
+
+export function assertPortableSshRelayNodeHeaderPath(value) {
+ if (
+ typeof value !== 'string' ||
+ value.length === 0 ||
+ Buffer.byteLength(value) > MAX_PATH_BYTES ||
+ value.startsWith('/') ||
+ value.includes('\\') ||
+ /^[A-Za-z]:/.test(value)
+ ) {
+ throw new Error('Node headers entry is not a bounded portable relative path')
+ }
+ for (const character of value) {
+ const code = character.charCodeAt(0)
+ if (code <= 0x1f || code === 0x7f) {
+ throw new Error('Node headers entry contains a control character')
+ }
+ }
+ const path = value.endsWith('/') ? value.slice(0, -1) : value
+ const segments = path.split('/')
+ if (
+ segments.length > MAX_DEPTH ||
+ segments.some(
+ (segment) =>
+ segment === '' ||
+ segment === '.' ||
+ segment === '..' ||
+ segment.includes(':') ||
+ segment.endsWith('.') ||
+ segment.endsWith(' ') ||
+ WINDOWS_DEVICE_NAME.test(segment)
+ )
+ ) {
+ throw new Error('Node headers entry contains an unsafe path segment')
+ }
+ return path
+}
+
+function createState(root) {
+ return {
+ root,
+ seen: new Set(),
+ foldedPaths: new Set(),
+ entries: 0,
+ files: 0,
+ expandedBytes: 0,
+ hasNodeHeader: false,
+ hasCommonGypi: false,
+ hasConfigGypi: false
+ }
+}
+
+function inspectEntry(entry, state) {
+ const path = assertPortableSshRelayNodeHeaderPath(entry.path)
+ if (path !== state.root && !path.startsWith(`${state.root}/`)) {
+ throw new Error('Node headers entry is outside its exact versioned root')
+ }
+ if (state.seen.has(path)) {
+ throw new Error(`Node headers archive contains a duplicate entry: ${path}`)
+ }
+ const foldedPath = path.toLowerCase()
+ if (state.foldedPaths.has(foldedPath)) {
+ throw new Error(`Node headers archive contains a case-fold collision: ${path}`)
+ }
+ state.seen.add(path)
+ state.foldedPaths.add(foldedPath)
+ state.entries += 1
+ if (state.entries > MAX_ENTRIES) {
+ throw new Error('Node headers archive exceeds the entry-count limit')
+ }
+ if (entry.type !== 'File' && entry.type !== 'Directory') {
+ throw new Error(`Node headers archive contains a prohibited entry type: ${entry.type}`)
+ }
+ if (entry.type === 'File') {
+ if (!Number.isSafeInteger(entry.size) || entry.size < 0 || entry.size > MAX_FILE_BYTES) {
+ throw new Error('Node headers archive file exceeds the per-file size limit')
+ }
+ state.files += 1
+ state.expandedBytes += entry.size
+ if (state.expandedBytes > MAX_EXPANDED_BYTES) {
+ throw new Error('Node headers archive exceeds the expanded-size limit')
+ }
+ }
+ state.hasNodeHeader ||= path === `${state.root}/include/node/node.h` && entry.type === 'File'
+ state.hasCommonGypi ||= path === `${state.root}/include/node/common.gypi` && entry.type === 'File'
+ state.hasConfigGypi ||= path === `${state.root}/include/node/config.gypi` && entry.type === 'File'
+}
+
+function result(state) {
+ if (!state.hasNodeHeader || !state.hasCommonGypi || !state.hasConfigGypi) {
+ throw new Error('Node headers archive is missing required node-gyp inputs')
+ }
+ return {
+ root: state.root,
+ entries: state.entries,
+ files: state.files,
+ expandedBytes: state.expandedBytes
+ }
+}
+
+async function pipeGzip(archivePath, destination, signal) {
+ await pipeline(createReadStream(archivePath), createGunzip(), destination, { signal })
+}
+
+async function inspectArchive(archivePath, root, signal) {
+ const state = createState(root)
+ const parser = new Parser({ strict: true })
+ parser.on('entry', (entry) => {
+ try {
+ inspectEntry(entry, state)
+ entry.resume()
+ } catch (error) {
+ parser.abort(error)
+ }
+ })
+ await pipeGzip(archivePath, parser, signal)
+ return result(state)
+}
+
+export async function extractVerifiedSshRelayNodeHeaders(
+ releaseInput,
+ archivePath,
+ nodeRoot,
+ { signal } = {}
+) {
+ const release = validateSshRelayNodeReleaseContract(releaseInput)
+ const effectiveSignal = signal ?? AbortSignal.timeout(GZIP_TIMEOUT_MS)
+ await verifySshRelayNodeWindowsBuildInput(release, 'headers', undefined, archivePath)
+ const stagingDirectory = await mkdtemp(join(tmpdir(), 'orca-node-verified-headers-'))
+ const stagedArchivePath = join(stagingDirectory, release.windowsBuildInputs.headersArchive.name)
+ const root = `node-v${release.nodeVersion}`
+ try {
+ await copyFile(archivePath, stagedArchivePath, constants.COPYFILE_EXCL)
+ await verifySshRelayNodeWindowsBuildInput(release, 'headers', undefined, stagedArchivePath)
+ const inspection = await inspectArchive(stagedArchivePath, root, effectiveSignal)
+ const unpack = new Unpack({
+ cwd: nodeRoot,
+ strict: true,
+ preservePaths: false,
+ strip: 1,
+ filter: (path, entry) =>
+ (entry.type === 'File' || entry.type === 'Directory') &&
+ (path === `${root}/include` || path.startsWith(`${root}/include/`))
+ })
+ await pipeGzip(stagedArchivePath, unpack, effectiveSignal)
+ if (!(await stat(join(nodeRoot, 'include', 'node', 'node.h'))).isFile()) {
+ throw new Error('Extracted Node headers do not contain include/node/node.h')
+ }
+ return inspection
+ } catch (error) {
+ await rm(join(nodeRoot, 'include'), { recursive: true, force: true })
+ throw error
+ } finally {
+ await rm(stagingDirectory, { recursive: true, force: true })
+ }
+}
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 64dd7c93ca1..a405d0618dd 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -1,5 +1,5 @@
import { execFile } from 'node:child_process'
-import { cp, mkdir, readFile, stat } from 'node:fs/promises'
+import { copyFile, cp, mkdir, readFile, readdir, stat } from 'node:fs/promises'
import { createRequire } from 'node:module'
import { dirname, join, resolve } from 'node:path'
import { promisify } from 'node:util'
@@ -52,9 +52,19 @@ async function assertPatchedSource(nodePtyDirectory) {
async function assertBuiltArtifacts(buildDirectory, tuple) {
const releaseDirectory = join(buildDirectory, 'build', 'Release')
- const ptyPath = join(releaseDirectory, 'pty.node')
- if (!(await stat(ptyPath)).isFile()) {
- throw new Error('node-pty did not produce build/Release/pty.node')
+ const nativePaths = tuple.startsWith('win32-')
+ ? [
+ 'conpty.node',
+ 'conpty_console_list.node',
+ 'pty.node',
+ 'conpty/conpty.dll',
+ 'conpty/OpenConsole.exe'
+ ]
+ : ['pty.node']
+ for (const path of nativePaths) {
+ if (!(await stat(join(releaseDirectory, ...path.split('/')))).isFile()) {
+ throw new Error(`node-pty did not produce build/Release/${path}`)
+ }
}
if (tuple.startsWith('darwin-')) {
const helperPath = join(releaseDirectory, 'spawn-helper')
@@ -65,6 +75,31 @@ async function assertBuiltArtifacts(buildDirectory, tuple) {
}
}
+async function stageWindowsConptyRuntime(buildDirectory, tuple) {
+ if (!tuple.startsWith('win32-')) {
+ return
+ }
+ const conptyRoot = join(buildDirectory, 'third_party', 'conpty')
+ const versions = (await readdir(conptyRoot, { withFileTypes: true })).filter((entry) =>
+ entry.isDirectory()
+ )
+ if (versions.length !== 1) {
+ throw new Error('node-pty must contain exactly one pinned ConPTY runtime version')
+ }
+ const architecture = tuple.endsWith('-arm64') ? 'arm64' : 'x64'
+ const sourceDirectory = join(conptyRoot, versions[0].name, `win10-${architecture}`)
+ const destinationDirectory = join(buildDirectory, 'build', 'Release', 'conpty')
+ await mkdir(destinationDirectory)
+ // Why: direct node-gyp bypasses node-pty's postinstall, while Orca explicitly uses this DLL path.
+ for (const name of ['conpty.dll', 'OpenConsole.exe']) {
+ const sourcePath = join(sourceDirectory, name)
+ if (!(await stat(sourcePath)).isFile()) {
+ throw new Error(`node-pty is missing pinned ${architecture} ConPTY runtime file: ${name}`)
+ }
+ await copyFile(sourcePath, join(destinationDirectory, name))
+ }
+}
+
async function stripBuiltArtifacts(buildDirectory, tuple) {
const releaseDirectory = join(buildDirectory, 'build', 'Release')
const ptyPath = join(releaseDirectory, 'pty.node')
@@ -117,23 +152,29 @@ export async function buildPatchedSshRelayNodePty({
npm_config_arch: tuple.includes('arm64') ? 'arm64' : 'x64',
npm_config_build_from_source: 'true',
npm_config_nodedir: nodeRoot,
+ // Why: a successful build must prove all Node inputs were staged, never fetched implicitly.
+ npm_config_offline: 'true',
+ npm_config_disturl: 'http://127.0.0.1:9',
npm_config_target: nodeVersion
}
})
} finally {
clearTimeout(timeout)
}
+ await stageWindowsConptyRuntime(buildDirectory, tuple)
await assertBuiltArtifacts(buildDirectory, tuple)
await stripBuiltArtifacts(buildDirectory, tuple)
// Why: loading with the bundled executable catches an accidental host-ABI build immediately.
+ const nativeNames = tuple.startsWith('win32-') ? ['conpty', 'conpty_console_list'] : ['pty']
await runCommand(
nodePath,
[
'-e',
`const {loadNativeModule}=require(${JSON.stringify(join(buildDirectory, 'lib', 'utils.js'))});` +
- `const loaded=loadNativeModule('pty');` +
- `if(!loaded.dir.replace(/\\\\/g,'/').includes('build/Release/'))process.exit(2);`
+ `for(const name of ${JSON.stringify(nativeNames)}){` +
+ `const loaded=loadNativeModule(name);` +
+ `if(!loaded.dir.replace(/\\\\/g,'/').includes('build/Release/'))process.exit(2);}`
],
{ cwd: buildDirectory, windowsHide: true, env: process.env }
)
diff --git a/config/scripts/ssh-relay-node-release-contract.mjs b/config/scripts/ssh-relay-node-release-contract.mjs
index 4170f9f34bf..bcf24f3fcfc 100644
--- a/config/scripts/ssh-relay-node-release-contract.mjs
+++ b/config/scripts/ssh-relay-node-release-contract.mjs
@@ -17,6 +17,10 @@ const ARCHIVE_SUFFIXES = Object.freeze({
'win32-arm64': 'win-arm64.zip',
'win32-x64': 'win-x64.zip'
})
+const WINDOWS_LIBRARY_NAMES = Object.freeze({
+ 'win32-arm64': 'win-arm64/node.lib',
+ 'win32-x64': 'win-x64/node.lib'
+})
const HEX_SHA256 = /^[0-9a-f]{64}$/
const OPENPGP_FINGERPRINT = /^[0-9A-F]{40}$/
@@ -126,6 +130,35 @@ function validateArchives(release) {
}
}
+function validateWindowsBuildInputs(release) {
+ assertRecord(release.windowsBuildInputs, 'Windows build inputs')
+ assertExactKeys(
+ release.windowsBuildInputs,
+ ['headersArchive', 'importLibraries'],
+ 'Windows build inputs'
+ )
+ const headers = release.windowsBuildInputs.headersArchive
+ assertRecord(headers, 'Windows headers archive')
+ assertExactKeys(headers, ['name', 'sha256'], 'Windows headers archive')
+ if (headers.name !== `node-v${release.nodeVersion}-headers.tar.gz`) {
+ throw new Error('Windows headers archive name does not match the pinned Node version')
+ }
+ assertSha256(headers.sha256, 'Windows headers archive SHA-256')
+
+ const libraries = release.windowsBuildInputs.importLibraries
+ assertRecord(libraries, 'Windows import libraries')
+ assertExactKeys(libraries, Object.keys(WINDOWS_LIBRARY_NAMES), 'Windows import libraries')
+ for (const [tuple, expectedName] of Object.entries(WINDOWS_LIBRARY_NAMES)) {
+ const library = libraries[tuple]
+ assertRecord(library, `Windows import library ${tuple}`)
+ assertExactKeys(library, ['name', 'sha256'], `Windows import library ${tuple}`)
+ if (library.name !== expectedName) {
+ throw new Error(`Windows import library name does not match ${tuple}`)
+ }
+ assertSha256(library.sha256, `Windows import library ${tuple} SHA-256`)
+ }
+}
+
export function sha256(bytes) {
return createHash('sha256').update(bytes).digest('hex')
}
@@ -141,7 +174,8 @@ export function validateSshRelayNodeReleaseContract(release) {
'checksumDocument',
'signature',
'maximumArchiveBytes',
- 'archives'
+ 'archives',
+ 'windowsBuildInputs'
],
'Node release contract'
)
@@ -157,6 +191,7 @@ export function validateSshRelayNodeReleaseContract(release) {
validateMetadataContract(release)
validateArchives(release)
+ validateWindowsBuildInputs(release)
return release
}
@@ -199,16 +234,28 @@ export function verifySshRelayNodeChecksumDocument(releaseInput, bytesInput) {
throw new Error('Node checksum document SHA-256 does not match the pinned contract')
}
- return EXPECTED_TUPLES.map((tuple) => {
- const archive = release.archives[tuple]
- const documentDigest = entries.get(archive.name)
+ const expectedFiles = [
+ ...EXPECTED_TUPLES.map((tuple) => ({
+ kind: 'runtime-archive',
+ tuple,
+ ...release.archives[tuple]
+ })),
+ { kind: 'windows-headers', ...release.windowsBuildInputs.headersArchive },
+ ...Object.entries(release.windowsBuildInputs.importLibraries).map(([tuple, file]) => ({
+ kind: 'windows-import-library',
+ tuple,
+ ...file
+ }))
+ ]
+ return expectedFiles.map((file) => {
+ const documentDigest = entries.get(file.name)
if (documentDigest === undefined) {
- throw new Error(`Node checksum document is missing pinned archive: ${archive.name}`)
+ throw new Error(`Node checksum document is missing pinned input: ${file.name}`)
}
- if (documentDigest !== archive.sha256) {
- throw new Error(`Node checksum document digest mismatch for pinned archive: ${archive.name}`)
+ if (documentDigest !== file.sha256) {
+ throw new Error(`Node checksum document digest mismatch for pinned input: ${file.name}`)
}
- return { tuple, name: archive.name, sha256: archive.sha256 }
+ return file
})
}
diff --git a/config/scripts/ssh-relay-node-release-file-verification.mjs b/config/scripts/ssh-relay-node-release-file-verification.mjs
index 1c9b2834d1e..fc9d4920d07 100644
--- a/config/scripts/ssh-relay-node-release-file-verification.mjs
+++ b/config/scripts/ssh-relay-node-release-file-verification.mjs
@@ -74,3 +74,25 @@ export async function verifySshRelayNodeArchive(releaseInput, tuple, archivePath
}
return { tuple, name: archive.name, ...result }
}
+
+export async function verifySshRelayNodeWindowsBuildInput(releaseInput, kind, tuple, inputPath) {
+ const release = validateSshRelayNodeReleaseContract(releaseInput)
+ const input =
+ kind === 'headers'
+ ? release.windowsBuildInputs.headersArchive
+ : kind === 'import-library'
+ ? release.windowsBuildInputs.importLibraries[tuple]
+ : undefined
+ if (!input) {
+ throw new Error(`Unknown Node Windows build input: ${kind}/${String(tuple)}`)
+ }
+ const result = await hashBoundedFile(
+ inputPath,
+ release.maximumArchiveBytes,
+ `Node Windows ${kind}`
+ )
+ if (result.sha256 !== input.sha256) {
+ throw new Error(`Node Windows ${kind} SHA-256 mismatch for ${String(tuple)}`)
+ }
+ return { kind, tuple: kind === 'headers' ? undefined : tuple, name: input.name, ...result }
+}
diff --git a/config/scripts/ssh-relay-node-release-verification.mjs b/config/scripts/ssh-relay-node-release-verification.mjs
index 11d7bd1abfd..53444810010 100644
--- a/config/scripts/ssh-relay-node-release-verification.mjs
+++ b/config/scripts/ssh-relay-node-release-verification.mjs
@@ -2,5 +2,8 @@ export {
validateSshRelayNodeReleaseContract,
verifySshRelayNodeChecksumDocument
} from './ssh-relay-node-release-contract.mjs'
-export { verifySshRelayNodeArchive } from './ssh-relay-node-release-file-verification.mjs'
+export {
+ verifySshRelayNodeArchive,
+ verifySshRelayNodeWindowsBuildInput
+} from './ssh-relay-node-release-file-verification.mjs'
export { verifySshRelayNodeSignature } from './ssh-relay-node-release-signature.mjs'
diff --git a/config/scripts/ssh-relay-node-release-verification.test.mjs b/config/scripts/ssh-relay-node-release-verification.test.mjs
index 62bd04b109f..fbf2d1b8e4b 100644
--- a/config/scripts/ssh-relay-node-release-verification.test.mjs
+++ b/config/scripts/ssh-relay-node-release-verification.test.mjs
@@ -40,6 +40,24 @@ const archives = {
sha256: '6'.repeat(64)
}
}
+const windowsBuildInputs = {
+ headersArchive: {
+ name: 'node-v24.18.0-headers.tar.gz',
+ sha256: '7'.repeat(64)
+ },
+ importLibraries: {
+ 'win32-arm64': { name: 'win-arm64/node.lib', sha256: '8'.repeat(64) },
+ 'win32-x64': { name: 'win-x64/node.lib', sha256: '9'.repeat(64) }
+ }
+}
+
+function pinnedFiles() {
+ return [
+ ...Object.values(archives),
+ windowsBuildInputs.headersArchive,
+ ...Object.values(windowsBuildInputs.importLibraries)
+ ]
+}
function contract(overrides = {}) {
return {
@@ -67,6 +85,7 @@ function contract(overrides = {}) {
},
maximumArchiveBytes: 100 * 1024 * 1024,
archives,
+ windowsBuildInputs,
...overrides
}
}
@@ -92,9 +111,12 @@ describe('SSH relay Node release verification', () => {
expect(release.archives['win32-x64'].sha256).toBe(
'0ae68406b42d7725661da979b1403ec9926da205c6770827f33aac9d8f26e821'
)
+ expect(release.windowsBuildInputs.headersArchive.sha256).toBe(
+ '6c7d41d83c3481d2301115b8ce4a44b7d4fbfa52859b1aac14f445d460137887'
+ )
})
- it('accepts only the exact immutable six-archive contract', () => {
+ it('accepts only the exact immutable runtime and Windows-build input contract', () => {
expect(validateSshRelayNodeReleaseContract(contract()).nodeVersion).toBe('24.18.0')
expect(() =>
@@ -112,17 +134,26 @@ describe('SSH relay Node release verification', () => {
archives: { ...archives, 'win32-arm64': { ...archives['win32-arm64'], sha256: 'ABC' } }
})
).toThrow(/SHA-256/i)
+ expect(() =>
+ validateSshRelayNodeReleaseContract({
+ ...contract(),
+ windowsBuildInputs: {
+ ...windowsBuildInputs,
+ headersArchive: { ...windowsBuildInputs.headersArchive, name: 'latest-headers.tar.gz' }
+ }
+ })
+ ).toThrow(/headers archive name/i)
})
it('cross-checks every pinned archive against the authenticated checksum document', () => {
- const body = Object.values(archives)
- .map((archive) => `${archive.sha256} ${archive.name}`)
+ const body = pinnedFiles()
+ .map((file) => `${file.sha256} ${file.name}`)
.join('\n')
const release = contract({
checksumDocument: { ...contract().checksumDocument, sha256: digest(body) }
})
- expect(verifySshRelayNodeChecksumDocument(release, Buffer.from(body))).toHaveLength(6)
+ expect(verifySshRelayNodeChecksumDocument(release, Buffer.from(body))).toHaveLength(9)
expect(() =>
verifySshRelayNodeChecksumDocument(release, Buffer.from(`${body}\n${body.split('\n')[0]}`))
).toThrow(/duplicate/i)
@@ -211,17 +242,26 @@ describe('SSH relay Node release verification', () => {
).rejects.toThrow(/pinned Node release signer fingerprint/i)
})
- it('verifies an explicitly scoped archive through the purpose-named CLI API', async () => {
+ it('verifies a Windows archive, headers, and import library through the CLI API', async () => {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-cli-test-'))
temporaryDirectories.push(directory)
const inputsDirectory = join(directory, 'inputs')
await mkdir(inputsDirectory)
const keyPath = join(directory, 'release-key.asc')
const archiveBytes = Buffer.from('archive bytes')
- const checksumBody = Object.entries(archives)
- .map(([tuple, archive]) => {
- const sha256 = tuple === 'linux-x64-glibc' ? digest(archiveBytes) : archive.sha256
- return `${sha256} ${archive.name}`
+ const headersBytes = Buffer.from('headers archive bytes')
+ const libraryBytes = Buffer.from('import library bytes')
+ const checksumBody = pinnedFiles()
+ .map((file) => {
+ const sha256 =
+ file.name === archives['win32-x64'].name
+ ? digest(archiveBytes)
+ : file.name === windowsBuildInputs.headersArchive.name
+ ? digest(headersBytes)
+ : file.name === windowsBuildInputs.importLibraries['win32-x64'].name
+ ? digest(libraryBytes)
+ : file.sha256
+ return `${sha256} ${file.name}`
})
.join('\n')
const signatureBytes = Buffer.from('signature bytes')
@@ -234,19 +274,38 @@ describe('SSH relay Node release verification', () => {
},
archives: {
...archives,
- 'linux-x64-glibc': {
- ...archives['linux-x64-glibc'],
+ 'win32-x64': {
+ ...archives['win32-x64'],
sha256: digest(archiveBytes)
}
+ },
+ windowsBuildInputs: {
+ headersArchive: {
+ ...windowsBuildInputs.headersArchive,
+ sha256: digest(headersBytes)
+ },
+ importLibraries: {
+ ...windowsBuildInputs.importLibraries,
+ 'win32-x64': {
+ ...windowsBuildInputs.importLibraries['win32-x64'],
+ sha256: digest(libraryBytes)
+ }
+ }
}
})
const contractPath = join(directory, 'release.json')
+ await mkdir(join(inputsDirectory, 'win-x64'))
await Promise.all([
writeFile(contractPath, JSON.stringify(release)),
writeFile(keyPath, 'release key'),
writeFile(join(inputsDirectory, release.checksumDocument.name), checksumBody),
writeFile(join(inputsDirectory, release.signature.name), signatureBytes),
- writeFile(join(inputsDirectory, release.archives['linux-x64-glibc'].name), archiveBytes)
+ writeFile(join(inputsDirectory, release.archives['win32-x64'].name), archiveBytes),
+ writeFile(
+ join(inputsDirectory, release.windowsBuildInputs.headersArchive.name),
+ headersBytes
+ ),
+ writeFile(join(inputsDirectory, 'win-x64', 'node.lib'), libraryBytes)
])
const commandRunner = vi.fn(async () => ({
exitCode: 0,
@@ -255,15 +314,19 @@ describe('SSH relay Node release verification', () => {
}))
const result = await verifyNodeReleaseInputs(
- { contractPath, inputsDirectory, archiveTuples: ['linux-x64-glibc'] },
+ { contractPath, inputsDirectory, archiveTuples: ['win32-x64'] },
{ commandRunner }
)
expect(result).toMatchObject({
nodeVersion: release.nodeVersion,
signerFingerprint: release.signature.signerFingerprint,
- checksumEntriesVerified: 6,
- archives: [{ tuple: 'linux-x64-glibc', bytes: archiveBytes.length }]
+ checksumEntriesVerified: 9,
+ archives: [{ tuple: 'win32-x64', bytes: archiveBytes.length }],
+ windowsBuildInputs: [
+ { kind: 'headers', bytes: headersBytes.length },
+ { kind: 'import-library', tuple: 'win32-x64', bytes: libraryBytes.length }
+ ]
})
expect(commandRunner).toHaveBeenCalledTimes(2)
})
diff --git a/config/scripts/ssh-relay-node-tar-inspection.test.mjs b/config/scripts/ssh-relay-node-tar-inspection.test.mjs
index 9c31f757a02..389bcfb9a53 100644
--- a/config/scripts/ssh-relay-node-tar-inspection.test.mjs
+++ b/config/scripts/ssh-relay-node-tar-inspection.test.mjs
@@ -60,7 +60,14 @@ const release = {
}
},
maximumArchiveBytes: 1024 * 1024,
- archives
+ archives,
+ windowsBuildInputs: {
+ headersArchive: { name: 'node-v24.18.0-headers.tar.gz', sha256: '7'.repeat(64) },
+ importLibraries: {
+ 'win32-arm64': { name: 'win-arm64/node.lib', sha256: '8'.repeat(64) },
+ 'win32-x64': { name: 'win-x64/node.lib', sha256: '9'.repeat(64) }
+ }
+ }
}
const temporaryDirectories = []
diff --git a/config/scripts/ssh-relay-node-zip-inspection.mjs b/config/scripts/ssh-relay-node-zip-inspection.mjs
new file mode 100644
index 00000000000..71857b800de
--- /dev/null
+++ b/config/scripts/ssh-relay-node-zip-inspection.mjs
@@ -0,0 +1,141 @@
+import { constants } from 'node:fs'
+import { copyFile, mkdir, mkdtemp, rm, stat } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+
+import { verifySshRelayNodeArchive } from './ssh-relay-node-release-file-verification.mjs'
+import { extractVerifiedSshRelayNodeHeaders } from './ssh-relay-node-headers-extraction.mjs'
+import { verifySshRelayNodeWindowsBuildInput } from './ssh-relay-node-release-file-verification.mjs'
+import { validateSshRelayNodeReleaseContract } from './ssh-relay-node-release-contract.mjs'
+import { visitSshRelayZip } from './ssh-relay-zip-reader.mjs'
+
+const DEFAULT_LIMITS = Object.freeze({
+ maximumArchiveBytes: 200 * 1024 * 1024,
+ maximumEntries: 100_000,
+ maximumExpandedBytes: 1024 * 1024 * 1024,
+ maximumFileBytes: 256 * 1024 * 1024,
+ maximumDepth: 32,
+ maximumPathBytes: 512
+})
+const ZIP_TIMEOUT_MS = 5 * 60 * 1000
+
+function archiveRoot(release, tuple) {
+ const name = release.archives[tuple]?.name
+ if (typeof name !== 'string' || !name.endsWith('.zip')) {
+ throw new Error(`Node tuple ${String(tuple)} does not use a ZIP archive`)
+ }
+ return name.slice(0, -'.zip'.length)
+}
+
+function selectedBuildInput(root, path) {
+ return path === `${root}/node.exe` || path === `${root}/LICENSE`
+}
+
+async function scanNodeZip(archivePath, release, tuple, limits, { destination, signal } = {}) {
+ const root = archiveRoot(release, tuple)
+ const state = {
+ root,
+ hasNodeExecutable: false,
+ hasLicense: false,
+ largestFileBytes: 0
+ }
+ const result = await visitSshRelayZip(
+ archivePath,
+ limits,
+ async (entry, consume) => {
+ if (entry.path !== root && !entry.path.startsWith(`${root}/`)) {
+ throw new Error('Node ZIP entry is outside its exact versioned root')
+ }
+ if (entry.type === 'file') {
+ state.largestFileBytes = Math.max(state.largestFileBytes, entry.size)
+ state.hasNodeExecutable ||= entry.path === `${root}/node.exe`
+ state.hasLicense ||= entry.path === `${root}/LICENSE`
+ const relativePath = entry.path.slice(root.length + 1)
+ const outputPath =
+ destination && selectedBuildInput(root, entry.path)
+ ? join(destination, root, ...relativePath.split('/'))
+ : undefined
+ await consume({ outputPath, mode: entry.path === `${root}/node.exe` ? 0o755 : 0o644 })
+ }
+ },
+ { signal }
+ )
+ if (!state.hasNodeExecutable || !state.hasLicense) {
+ throw new Error('Node ZIP is missing node.exe or its license')
+ }
+ return { ...result, ...state }
+}
+
+export async function inspectSshRelayNodeZip(
+ archivePath,
+ releaseInput,
+ tuple,
+ overrides = {},
+ { signal } = {}
+) {
+ const release = validateSshRelayNodeReleaseContract(releaseInput)
+ const limits = {
+ ...DEFAULT_LIMITS,
+ maximumArchiveBytes: Math.min(DEFAULT_LIMITS.maximumArchiveBytes, release.maximumArchiveBytes),
+ ...overrides
+ }
+ return scanNodeZip(archivePath, release, tuple, limits, { signal })
+}
+
+export async function extractVerifiedSshRelayNodeZipBuildInputs(
+ releaseInput,
+ tuple,
+ sourceArchivePath,
+ destination,
+ { headersArchivePath, importLibraryPath, signal } = {}
+) {
+ const release = validateSshRelayNodeReleaseContract(releaseInput)
+ const effectiveSignal = signal ?? AbortSignal.timeout(ZIP_TIMEOUT_MS)
+ await verifySshRelayNodeArchive(release, tuple, sourceArchivePath)
+ const stagingDirectory = await mkdtemp(join(tmpdir(), 'orca-node-verified-zip-'))
+ const stagedArchivePath = join(stagingDirectory, release.archives[tuple].name)
+ try {
+ if (!headersArchivePath || !importLibraryPath) {
+ throw new Error('Windows Node extraction requires explicit headers and import-library inputs')
+ }
+ await copyFile(sourceArchivePath, stagedArchivePath, constants.COPYFILE_EXCL)
+ await verifySshRelayNodeArchive(release, tuple, stagedArchivePath)
+ await mkdir(destination)
+ const inspection = await scanNodeZip(stagedArchivePath, release, tuple, DEFAULT_LIMITS, {
+ destination,
+ signal: effectiveSignal
+ })
+ const extractedRoot = join(destination, inspection.root)
+ const nodePath = join(extractedRoot, 'node.exe')
+ const headers = await extractVerifiedSshRelayNodeHeaders(
+ release,
+ headersArchivePath,
+ extractedRoot,
+ {
+ signal: effectiveSignal
+ }
+ )
+ await verifySshRelayNodeWindowsBuildInput(release, 'import-library', tuple, importLibraryPath)
+ const releaseDirectory = join(extractedRoot, 'Release')
+ await mkdir(releaseDirectory)
+ const stagedLibraryPath = join(releaseDirectory, 'node.lib')
+ await copyFile(importLibraryPath, stagedLibraryPath, constants.COPYFILE_EXCL)
+ await verifySshRelayNodeWindowsBuildInput(release, 'import-library', tuple, stagedLibraryPath)
+ const [nodeMetadata, licenseMetadata, headerMetadata] = await Promise.all([
+ stat(nodePath),
+ stat(join(extractedRoot, 'LICENSE')),
+ stat(join(extractedRoot, 'include', 'node', 'node.h'))
+ ])
+ if (!nodeMetadata.isFile() || !licenseMetadata.isFile() || !headerMetadata.isFile()) {
+ throw new Error('Extracted Node ZIP build inputs do not match the inspected archive contract')
+ }
+ return { ...inspection, headers, extractedRoot, nodePath }
+ } catch (error) {
+ await rm(destination, { recursive: true, force: true })
+ throw error
+ } finally {
+ await rm(stagingDirectory, { recursive: true, force: true })
+ }
+}
+
+export { DEFAULT_LIMITS }
diff --git a/config/scripts/ssh-relay-node-zip-inspection.test.mjs b/config/scripts/ssh-relay-node-zip-inspection.test.mjs
new file mode 100644
index 00000000000..e907fe83710
--- /dev/null
+++ b/config/scripts/ssh-relay-node-zip-inspection.test.mjs
@@ -0,0 +1,195 @@
+import { createWriteStream } from 'node:fs'
+import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { pipeline } from 'node:stream/promises'
+
+import { afterEach, describe, expect, it } from 'vitest'
+import { create } from 'tar'
+import yazl from 'yazl'
+
+import {
+ extractVerifiedSshRelayNodeZipBuildInputs,
+ inspectSshRelayNodeZip
+} from './ssh-relay-node-zip-inspection.mjs'
+import { assertPortableSshRelayNodeHeaderPath } from './ssh-relay-node-headers-extraction.mjs'
+import { sha256 } from './ssh-relay-node-release-contract.mjs'
+
+const tuple = 'win32-x64'
+const root = 'node-v24.18.0-win-x64'
+const temporaryDirectories = []
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+function release(archiveSha256, headersSha256 = '7'.repeat(64), librarySha256 = '9'.repeat(64)) {
+ return {
+ schemaVersion: 1,
+ nodeVersion: '24.18.0',
+ baseUrl: 'https://nodejs.org/dist/v24.18.0',
+ checksumDocument: {
+ name: 'SHASUMS256.txt',
+ sha256: 'a'.repeat(64),
+ maximumBytes: 1024
+ },
+ signature: {
+ name: 'SHASUMS256.txt.sig',
+ sha256: 'b'.repeat(64),
+ maximumBytes: 1024,
+ signerFingerprint: 'C'.repeat(40),
+ key: {
+ path: 'release-key.asc',
+ sha256: 'c'.repeat(64),
+ sourceCommit: 'd'.repeat(40),
+ sourceUrl:
+ `https://raw.githubusercontent.com/nodejs/release-keys/${'d'.repeat(40)}` +
+ `/keys/${'C'.repeat(40)}.asc`
+ }
+ },
+ maximumArchiveBytes: 1024 * 1024,
+ archives: {
+ 'darwin-arm64': { name: 'node-v24.18.0-darwin-arm64.tar.xz', sha256: '1'.repeat(64) },
+ 'darwin-x64': { name: 'node-v24.18.0-darwin-x64.tar.xz', sha256: '2'.repeat(64) },
+ 'linux-arm64-glibc': {
+ name: 'node-v24.18.0-linux-arm64.tar.xz',
+ sha256: '3'.repeat(64)
+ },
+ 'linux-x64-glibc': {
+ name: 'node-v24.18.0-linux-x64.tar.xz',
+ sha256: '4'.repeat(64)
+ },
+ 'win32-arm64': { name: 'node-v24.18.0-win-arm64.zip', sha256: '5'.repeat(64) },
+ 'win32-x64': { name: `${root}.zip`, sha256: archiveSha256 }
+ },
+ windowsBuildInputs: {
+ headersArchive: { name: 'node-v24.18.0-headers.tar.gz', sha256: headersSha256 },
+ importLibraries: {
+ 'win32-arm64': { name: 'win-arm64/node.lib', sha256: '8'.repeat(64) },
+ 'win32-x64': { name: 'win-x64/node.lib', sha256: librarySha256 }
+ }
+ }
+ }
+}
+
+async function createZip(entries) {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-zip-test-'))
+ temporaryDirectories.push(directory)
+ const archivePath = join(directory, `${root}.zip`)
+ const zip = new yazl.ZipFile()
+ for (const entry of entries) {
+ zip.addBuffer(Buffer.from(entry.bytes), entry.path, {
+ mtime: new Date('2025-07-17T00:00:00.000Z'),
+ mode: 0o644
+ })
+ }
+ zip.end()
+ await pipeline(zip.outputStream, createWriteStream(archivePath))
+ return { archivePath, directory }
+}
+
+async function validZip(extraEntries = []) {
+ return createZip([
+ { path: `${root}/node.exe`, bytes: 'node executable' },
+ { path: `${root}/LICENSE`, bytes: 'Node license' },
+ ...extraEntries
+ ])
+}
+
+async function windowsBuildInputs(directory) {
+ const source = join(directory, 'headers-source')
+ const headersRoot = join(source, 'node-v24.18.0', 'include', 'node')
+ await mkdir(headersRoot, { recursive: true })
+ await Promise.all([
+ writeFile(join(headersRoot, 'node.h'), 'Node header'),
+ writeFile(join(headersRoot, 'common.gypi'), 'common gyp'),
+ writeFile(join(headersRoot, 'config.gypi'), 'config gyp')
+ ])
+ const headersArchivePath = join(directory, 'node-v24.18.0-headers.tar.gz')
+ await create({ cwd: source, file: headersArchivePath, gzip: true, portable: true }, [
+ 'node-v24.18.0'
+ ])
+ const importLibraryPath = join(directory, 'node.lib')
+ await writeFile(importLibraryPath, 'node import library')
+ return { headersArchivePath, importLibraryPath }
+}
+
+describe('SSH relay Node Windows ZIP inspection', () => {
+ it('rejects Windows-unsafe header paths before extraction', () => {
+ expect(() => assertPortableSshRelayNodeHeaderPath('node-v24.18.0/include/node/CON')).toThrow(
+ /unsafe path segment/i
+ )
+ expect(() =>
+ assertPortableSshRelayNodeHeaderPath('node-v24.18.0/include/node/header.h:stream')
+ ).toThrow(/unsafe path segment/i)
+ expect(() =>
+ assertPortableSshRelayNodeHeaderPath('node-v24.18.0/include/node/header.h ')
+ ).toThrow(/unsafe path segment/i)
+ })
+
+ it('inspects and selectively extracts only executable, license, and build headers', async () => {
+ const value = await validZip([{ path: `${root}/npm.cmd`, bytes: 'excluded' }])
+ const bytes = await readFile(value.archivePath)
+ const inputs = await windowsBuildInputs(value.directory)
+ const contract = release(
+ sha256(bytes),
+ sha256(await readFile(inputs.headersArchivePath)),
+ sha256(await readFile(inputs.importLibraryPath))
+ )
+ await expect(inspectSshRelayNodeZip(value.archivePath, contract, tuple)).resolves.toMatchObject(
+ {
+ root,
+ files: 3,
+ hasNodeExecutable: true,
+ hasLicense: true
+ }
+ )
+
+ const destination = join(value.directory, 'extracted')
+ const extracted = await extractVerifiedSshRelayNodeZipBuildInputs(
+ contract,
+ tuple,
+ value.archivePath,
+ destination,
+ inputs
+ )
+ expect(await readFile(extracted.nodePath, 'utf8')).toBe('node executable')
+ expect(await readFile(join(extracted.extractedRoot, 'include', 'node', 'node.h'), 'utf8')).toBe(
+ 'Node header'
+ )
+ expect(await readFile(join(extracted.extractedRoot, 'Release', 'node.lib'), 'utf8')).toBe(
+ 'node import library'
+ )
+ await expect(readFile(join(extracted.extractedRoot, 'npm.cmd'))).rejects.toThrow()
+ })
+
+ it('rejects traversal, case-fold collisions, and bounded-size violations', async () => {
+ const traversal = await validZip([{ path: `${root}/aa/outside`, bytes: 'bad' }])
+ const safeName = Buffer.from(`${root}/aa/outside`)
+ const unsafeName = Buffer.from(`${root}/../outside`)
+ const traversalBytes = await readFile(traversal.archivePath)
+ for (let offset = traversalBytes.indexOf(safeName); offset !== -1; ) {
+ unsafeName.copy(traversalBytes, offset)
+ offset = traversalBytes.indexOf(safeName, offset + unsafeName.length)
+ }
+ await writeFile(traversal.archivePath, traversalBytes)
+ const traversalContract = release(sha256(await readFile(traversal.archivePath)))
+ await expect(
+ inspectSshRelayNodeZip(traversal.archivePath, traversalContract, tuple)
+ ).rejects.toThrow(/unsafe path segment|invalid relative path/i)
+
+ const collision = await validZip([{ path: `${root}/license`, bytes: 'duplicate spelling' }])
+ const collisionContract = release(sha256(await readFile(collision.archivePath)))
+ await expect(
+ inspectSshRelayNodeZip(collision.archivePath, collisionContract, tuple)
+ ).rejects.toThrow(/case-fold collision/i)
+
+ const oversized = await validZip()
+ const oversizedContract = release(sha256(await readFile(oversized.archivePath)))
+ await expect(
+ inspectSshRelayNodeZip(oversized.archivePath, oversizedContract, tuple, {
+ maximumExpandedBytes: 8
+ })
+ ).rejects.toThrow(/expanded-size limit/i)
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-archive.mjs b/config/scripts/ssh-relay-runtime-archive.mjs
index 526b5768f1f..67a0bd4f9d1 100644
--- a/config/scripts/ssh-relay-runtime-archive.mjs
+++ b/config/scripts/ssh-relay-runtime-archive.mjs
@@ -8,6 +8,8 @@ import { pipeline } from 'node:stream/promises'
import { create, Parser } from 'tar'
+import { createSshRelayRuntimeZip, inspectSshRelayRuntimeZip } from './ssh-relay-runtime-zip.mjs'
+
const MAX_ARCHIVE_BYTES = 100 * 1024 * 1024
const MAX_DIAGNOSTIC_BYTES = 64 * 1024
const XZ_TIMEOUT_MS = 5 * 60 * 1000
@@ -17,7 +19,8 @@ function archiveName(tuple, contentId) {
if (!match) {
throw new Error('Runtime content identity is not a SHA-256 digest')
}
- return `orca-ssh-relay-runtime-v1-${tuple}-${match[1]}.tar.xz`
+ const suffix = tuple.startsWith('win32-') ? 'zip' : 'tar.xz'
+ return `orca-ssh-relay-runtime-v1-${tuple}-${match[1]}.${suffix}`
}
async function compressTar(tarPath, archivePath, signal) {
@@ -96,6 +99,15 @@ export async function createSshRelayRuntimeArchive({
sourceDateEpoch,
signal
}) {
+ if (identity.tupleId.startsWith('win32-')) {
+ return createSshRelayRuntimeZip({
+ runtimeRoot,
+ outputDirectory,
+ identity,
+ sourceDateEpoch,
+ signal
+ })
+ }
if (!Number.isSafeInteger(sourceDateEpoch) || sourceDateEpoch < 0) {
throw new Error('Runtime archive SOURCE_DATE_EPOCH must be a non-negative safe integer')
}
@@ -141,6 +153,9 @@ export async function createSshRelayRuntimeArchive({
}
export async function inspectSshRelayRuntimeArchive(archivePath, identity, { signal } = {}) {
+ if (identity.tupleId.startsWith('win32-')) {
+ return inspectSshRelayRuntimeZip(archivePath, identity, { signal })
+ }
const metadata = await stat(archivePath)
if (!metadata.isFile() || metadata.size === 0 || metadata.size > MAX_ARCHIVE_BYTES) {
throw new Error('Runtime archive exceeds the release-manifest compressed-size limit')
diff --git a/config/scripts/ssh-relay-runtime-provenance.mjs b/config/scripts/ssh-relay-runtime-provenance.mjs
index 9c017ab02b3..9582dd2256c 100644
--- a/config/scripts/ssh-relay-runtime-provenance.mjs
+++ b/config/scripts/ssh-relay-runtime-provenance.mjs
@@ -101,6 +101,27 @@ export async function writeSshRelayRuntimeMetadata({
['node', 'node-pty-native', 'parcel-watcher-native', 'native-runtime'].includes(entry.role)
)
.map((entry) => ({ path: entry.path, sha256: entry.sha256 }))
+ const resolvedDependencies = [
+ {
+ uri: `${nodeRelease.baseUrl}/${nodeRelease.archives[identity.tupleId].name}`,
+ digest: { sha256: nodeRelease.archives[identity.tupleId].sha256 }
+ },
+ {
+ uri: nodeRelease.signature.key.sourceUrl,
+ digest: { sha256: nodeRelease.signature.key.sha256 }
+ },
+ { uri: `git+https://github.com/stablyai/orca@${gitCommit}`, digest: { gitCommit } }
+ ]
+ if (identity.tupleId.startsWith('win32-')) {
+ const headers = nodeRelease.windowsBuildInputs.headersArchive
+ const library = nodeRelease.windowsBuildInputs.importLibraries[identity.tupleId]
+ resolvedDependencies.splice(
+ 1,
+ 0,
+ { uri: `${nodeRelease.baseUrl}/${headers.name}`, digest: { sha256: headers.sha256 } },
+ { uri: `${nodeRelease.baseUrl}/${library.name}`, digest: { sha256: library.sha256 } }
+ )
+ }
const provenance = {
_type: 'https://in-toto.io/Statement/v1',
subject: [{ name: archive.name, digest: { sha256: archive.sha256.slice('sha256:'.length) } }],
@@ -114,17 +135,7 @@ export async function writeSshRelayRuntimeMetadata({
sourceDateEpoch
},
internalParameters: { toolchain },
- resolvedDependencies: [
- {
- uri: nodeRelease.baseUrl,
- digest: { sha256: nodeRelease.archives[identity.tupleId].sha256 }
- },
- {
- uri: nodeRelease.signature.key.sourceUrl,
- digest: { sha256: nodeRelease.signature.key.sha256 }
- },
- { uri: `git+https://github.com/stablyai/orca@${gitCommit}`, digest: { gitCommit } }
- ]
+ resolvedDependencies
},
runDetails: {
builder: { id: builder },
diff --git a/config/scripts/ssh-relay-runtime-smoke-child.cjs b/config/scripts/ssh-relay-runtime-smoke-child.cjs
index f4432a6d236..75e20e61415 100644
--- a/config/scripts/ssh-relay-runtime-smoke-child.cjs
+++ b/config/scripts/ssh-relay-runtime-smoke-child.cjs
@@ -23,19 +23,40 @@ function deadline(label) {
}
async function ptySmoke() {
- if (process.platform === 'win32') {
- throw new Error('Windows PTY smoke is not implemented yet')
- }
- const shell =
- process.env.SHELL && process.env.SHELL.startsWith('/') ? process.env.SHELL : '/bin/sh'
- const terminal = nodePty.spawn(
- shell,
- [
- '-c',
- 'printf "ORCA_PTY_READY\\n"; IFS= read -r line; stty size; printf "ORCA_PTY_INPUT:%s\\n" "$line"; exit 23'
- ],
- { name: 'xterm-256color', cols: 80, rows: 24, cwd: runtimeRoot, env: process.env }
- )
+ const windows = process.platform === 'win32'
+ const executable = windows
+ ? 'powershell.exe'
+ : process.env.SHELL && process.env.SHELL.startsWith('/')
+ ? process.env.SHELL
+ : '/bin/sh'
+ const arguments_ = windows
+ ? [
+ '-NoLogo',
+ '-NoProfile',
+ '-Command',
+ "$ErrorActionPreference='Stop';" +
+ '[Console]::OutputEncoding=[Text.UTF8Encoding]::new($false);' +
+ "Write-Output 'ORCA_PTY_READY';" +
+ '$line=[Console]::ReadLine();' +
+ '$size=$Host.UI.RawUI.WindowSize;' +
+ 'Write-Output ("ORCA_PTY_SIZE:{0}x{1}" -f $size.Width,$size.Height);' +
+ 'Write-Output ("ORCA_PTY_INPUT:{0}" -f $line);' +
+ 'exit 23'
+ ]
+ : [
+ '-c',
+ 'printf "ORCA_PTY_READY\\n"; IFS= read -r line; stty size; printf "ORCA_PTY_INPUT:%s\\n" "$line"; exit 23'
+ ]
+ const terminal = nodePty.spawn(executable, arguments_, {
+ name: 'xterm-256color',
+ cols: 80,
+ rows: 24,
+ cwd: runtimeRoot,
+ env: process.env,
+ useConpty: windows,
+ // Why: the relay uses the bundled ConPTY runtime to preserve terminal rendering behavior.
+ useConptyDll: windows
+ })
let output = ''
let wroteInput = false
terminal.onData((data) => {
@@ -67,20 +88,27 @@ async function ptySmoke() {
if (
result.exitCode !== 23 ||
!output.includes('ORCA_PTY_INPUT:bounded-marker') ||
- !output.includes('37 101')
+ !output.includes(windows ? 'ORCA_PTY_SIZE:101x37' : '37 101')
) {
throw new Error(`PTY smoke mismatch: exit=${result.exitCode} output=${JSON.stringify(output)}`)
}
const { loadNativeModule } = runtimeRequire('node-pty/lib/utils')
- const native = loadNativeModule('pty')
- if (!native.dir.replaceAll('\\', '/').includes('build/Release/')) {
- throw new Error(`node-pty did not load the patched build/Release artifact: ${native.dir}`)
+ const nativeNames = windows ? ['conpty', 'conpty_console_list'] : ['pty']
+ const nativeDirectories = nativeNames.map((name) => loadNativeModule(name).dir)
+ if (
+ nativeDirectories.some(
+ (directory) => !directory.replaceAll('\\', '/').includes('build/Release/')
+ )
+ ) {
+ throw new Error(
+ `node-pty did not load patched build/Release artifacts: ${nativeDirectories.join(', ')}`
+ )
}
return {
exitCode: result.exitCode,
resizedRows: 37,
resizedColumns: 101,
- nativeDirectory: native.dir
+ nativeDirectory: nativeDirectories.join(', ')
}
}
diff --git a/config/scripts/ssh-relay-runtime-tree.mjs b/config/scripts/ssh-relay-runtime-tree.mjs
index 33785f8d933..e524e3ea199 100644
--- a/config/scripts/ssh-relay-runtime-tree.mjs
+++ b/config/scripts/ssh-relay-runtime-tree.mjs
@@ -36,14 +36,30 @@ const COMPATIBILITY = Object.freeze({
}
},
'darwin-x64': { kind: 'darwin', minimumVersion: '13.5' },
- 'darwin-arm64': { kind: 'darwin', minimumVersion: '13.5' }
+ 'darwin-arm64': { kind: 'darwin', minimumVersion: '13.5' },
+ 'win32-x64': {
+ kind: 'win32',
+ minimumBuild: 20348,
+ minimumOpenSshVersion: '8.1p1',
+ minimumPowerShellVersion: '5.1',
+ minimumDotNetFrameworkRelease: 528040
+ },
+ 'win32-arm64': {
+ kind: 'win32',
+ minimumBuild: 20348,
+ minimumOpenSshVersion: '8.1p1',
+ minimumPowerShellVersion: '5.1',
+ minimumDotNetFrameworkRelease: 528040
+ }
})
const WATCHER_PACKAGES = Object.freeze({
'linux-x64-glibc': '@parcel/watcher-linux-x64-glibc',
'linux-arm64-glibc': '@parcel/watcher-linux-arm64-glibc',
'darwin-x64': '@parcel/watcher-darwin-x64',
- 'darwin-arm64': '@parcel/watcher-darwin-arm64'
+ 'darwin-arm64': '@parcel/watcher-darwin-arm64',
+ 'win32-x64': '@parcel/watcher-win32-x64',
+ 'win32-arm64': '@parcel/watcher-win32-arm64'
})
function packageDirectory(name) {
@@ -116,11 +132,25 @@ async function copyNodePty(buildDirectory, runtimeRoot, tuple) {
await copyNormalized(join(buildDirectory, 'lib', path), join(destination, 'lib', path))
}
await writeJson(join(destination, 'package.json'), await minimalPackage('node-pty'))
- await copyNormalized(
- join(buildDirectory, 'build', 'Release', 'pty.node'),
- join(destination, 'build', 'Release', 'pty.node'),
- 0o755
- )
+ const nativeNames = tuple.startsWith('win32-')
+ ? ['conpty.node', 'conpty_console_list.node']
+ : ['pty.node']
+ for (const name of nativeNames) {
+ await copyNormalized(
+ join(buildDirectory, 'build', 'Release', name),
+ join(destination, 'build', 'Release', name),
+ 0o755
+ )
+ }
+ if (tuple.startsWith('win32-')) {
+ for (const name of ['conpty.dll', 'OpenConsole.exe']) {
+ await copyNormalized(
+ join(buildDirectory, 'build', 'Release', 'conpty', name),
+ join(destination, 'build', 'Release', 'conpty', name),
+ 0o755
+ )
+ }
+ }
if (tuple.startsWith('darwin-')) {
await copyNormalized(
join(buildDirectory, 'build', 'Release', 'spawn-helper'),
@@ -192,7 +222,7 @@ async function writeLicenses(runtimeRoot, nodeRoot, packages) {
}
function runtimeRole(path) {
- if (path === 'bin/node') {
+ if (path === 'bin/node' || path === 'bin/node.exe') {
return 'node'
}
if (path === 'relay.js') {
@@ -201,13 +231,21 @@ function runtimeRole(path) {
if (path === 'relay-watcher.js') {
return 'relay-watcher'
}
- if (path.endsWith('/pty.node')) {
+ if (
+ path.endsWith('/pty.node') ||
+ path.endsWith('/conpty.node') ||
+ path.endsWith('/conpty_console_list.node')
+ ) {
return 'node-pty-native'
}
if (path.endsWith('/watcher.node')) {
return 'parcel-watcher-native'
}
- if (path.endsWith('/spawn-helper')) {
+ if (
+ path.endsWith('/spawn-helper') ||
+ path.endsWith('/conpty/conpty.dll') ||
+ path.endsWith('/conpty/OpenConsole.exe')
+ ) {
return 'native-runtime'
}
if (path === 'THIRD_PARTY_LICENSES.txt') {
@@ -263,7 +301,15 @@ async function collectEntries(runtimeRoot) {
if (metadata.size > MAX_FILE_BYTES) {
throw new Error(`Runtime file exceeds size limit: ${path}`)
}
- const mode = metadata.mode & 0o777
+ const role = runtimeRole(path)
+ // Why: NTFS has no POSIX execute bits; ZIP metadata carries the canonical runtime mode.
+ const mode =
+ process.platform === 'win32' &&
+ ['node', 'node-pty-native', 'parcel-watcher-native', 'native-runtime'].includes(role)
+ ? 0o755
+ : process.platform === 'win32'
+ ? 0o644
+ : metadata.mode & 0o777
if (mode !== 0o644 && mode !== 0o755) {
throw new Error(`Runtime file has a non-canonical mode: ${path}`)
}
@@ -271,7 +317,7 @@ async function collectEntries(runtimeRoot) {
entries.push({
path,
type: 'file',
- role: runtimeRole(path),
+ role,
size: bytes.length,
mode,
sha256: `sha256:${createHash('sha256').update(bytes).digest('hex')}`
@@ -303,7 +349,11 @@ export async function assembleSshRelayRuntimeTree({
throw new Error(`Runtime tree assembly is not implemented for ${tuple}`)
}
await mkdir(runtimeRoot)
- await copyNormalized(join(nodeRoot, 'bin', 'node'), join(runtimeRoot, 'bin', 'node'), 0o755)
+ const nodeName = tuple.startsWith('win32-') ? 'node.exe' : 'node'
+ const nodeSource = tuple.startsWith('win32-')
+ ? join(nodeRoot, nodeName)
+ : join(nodeRoot, 'bin', nodeName)
+ await copyNormalized(join(nodeSource), join(runtimeRoot, 'bin', nodeName), 0o755)
const version = await relayBuildVersion(relayDirectory)
await Promise.all([
copyNormalized(join(relayDirectory, 'relay.js'), join(runtimeRoot, 'relay.js')),
@@ -331,7 +381,7 @@ export async function assembleSshRelayRuntimeTree({
})
const tree = await collectEntries(runtimeRoot)
- const os = tuple.startsWith('linux-') ? 'linux' : 'darwin'
+ const os = tuple.startsWith('linux-') ? 'linux' : tuple.startsWith('darwin-') ? 'darwin' : 'win32'
const architecture = tuple.includes('arm64') ? 'arm64' : 'x64'
const identity = {
tupleId: tuple,
diff --git a/config/scripts/ssh-relay-runtime-windows-tree.test.mjs b/config/scripts/ssh-relay-runtime-windows-tree.test.mjs
new file mode 100644
index 00000000000..0575696ef56
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-windows-tree.test.mjs
@@ -0,0 +1,92 @@
+import { createHash } from 'node:crypto'
+import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { dirname, join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { assembleSshRelayRuntimeTree } from './ssh-relay-runtime-tree.mjs'
+
+const temporaryDirectories = []
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+async function writeFixture(path, bytes = path) {
+ await mkdir(dirname(path), { recursive: true })
+ await writeFile(path, bytes)
+}
+
+async function createWindowsNodePtyBuild(root) {
+ const platformFiles = [
+ 'conpty_console_list_agent.js',
+ 'eventEmitter2.js',
+ 'index.js',
+ 'terminal.js',
+ 'utils.js',
+ 'windowsConoutConnection.js',
+ 'windowsPtyAgent.js',
+ 'windowsTerminal.js',
+ 'shared/conout.js',
+ 'worker/conoutSocketWorker.js'
+ ]
+ await Promise.all(
+ platformFiles.map((path) =>
+ writeFixture(join(root, 'lib', ...path.split('/')), `'use strict'\n`)
+ )
+ )
+ await Promise.all(
+ ['conpty.node', 'conpty_console_list.node', 'pty.node'].map((name) =>
+ writeFixture(join(root, 'build', 'Release', name), name)
+ )
+ )
+ await Promise.all(
+ ['conpty.dll', 'OpenConsole.exe'].map((name) =>
+ writeFixture(join(root, 'build', 'Release', 'conpty', name), name)
+ )
+ )
+}
+
+describe('SSH relay Windows runtime tree', () => {
+ it('carries the production ConPTY runtime closure in the hashed identity', async () => {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-runtime-windows-tree-'))
+ temporaryDirectories.push(directory)
+ const nodeRoot = join(directory, 'node')
+ const nodePtyBuildDirectory = join(directory, 'node-pty')
+ const relayDirectory = join(directory, 'relay')
+ const runtimeRoot = join(directory, 'runtime')
+ const relayBytes = 'relay bytes'
+ const watcherBytes = 'watcher bytes'
+ const relayHash = createHash('sha256')
+ .update(relayBytes)
+ .update(watcherBytes)
+ .digest('hex')
+ .slice(0, 12)
+ await Promise.all([
+ writeFixture(join(nodeRoot, 'node.exe'), 'node executable'),
+ writeFixture(join(nodeRoot, 'LICENSE'), 'Node license'),
+ writeFixture(join(relayDirectory, 'relay.js'), relayBytes),
+ writeFixture(join(relayDirectory, 'relay-watcher.js'), watcherBytes),
+ writeFixture(join(relayDirectory, '.version'), `fixture+${relayHash}\n`),
+ createWindowsNodePtyBuild(nodePtyBuildDirectory)
+ ])
+
+ const identity = await assembleSshRelayRuntimeTree({
+ tuple: 'win32-x64',
+ nodeRoot,
+ nodePtyBuildDirectory,
+ relayDirectory,
+ runtimeRoot,
+ nodeVersion: '24.18.0'
+ })
+
+ for (const name of ['conpty.dll', 'OpenConsole.exe']) {
+ const path = `node_modules/node-pty/build/Release/conpty/${name}`
+ expect(identity.entries).toContainEqual(
+ expect.objectContaining({ path, type: 'file', role: 'native-runtime', mode: 0o755 })
+ )
+ expect(await readFile(join(runtimeRoot, ...path.split('/')), 'utf8')).toBe(name)
+ }
+ expect(identity.entries.some((entry) => entry.path.endsWith('/pty.node'))).toBe(false)
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 8200dfe73c8..4ef61105223 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -11,20 +11,27 @@ const workflowUrl = new URL(
describe('SSH relay runtime artifact workflow', () => {
it('uses exact native runner labels and SHA-pinned actions without publication authority', async () => {
const workflow = parse(await readFile(workflowUrl, 'utf8'))
- const job = workflow.jobs['build-posix-runtime']
- const matrix = job.strategy.matrix.include
+ const posixJob = workflow.jobs['build-posix-runtime']
+ const windowsJob = workflow.jobs['build-windows-runtime']
- expect(matrix.map((entry) => [entry.runner, entry.tuple])).toEqual([
+ expect(posixJob.strategy.matrix.include.map((entry) => [entry.runner, entry.tuple])).toEqual([
['ubuntu-24.04', 'linux-x64-glibc'],
['ubuntu-24.04-arm', 'linux-arm64-glibc'],
['macos-15-intel', 'darwin-x64'],
['macos-15', 'darwin-arm64']
])
+ expect(windowsJob.strategy.matrix.include.map((entry) => [entry.runner, entry.tuple])).toEqual([
+ ['windows-2022', 'win32-x64'],
+ ['windows-11-arm', 'win32-arm64']
+ ])
expect(workflow.permissions).toEqual({ contents: 'read' })
- expect(job['timeout-minutes']).toBe(20)
- expect(job.steps[0].with.ref).toBe('${{ github.event.pull_request.head.sha || github.sha }}')
- for (const step of job.steps.filter((candidate) => candidate.uses)) {
- expect(step.uses).toMatch(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}$/)
+ expect(posixJob['timeout-minutes']).toBe(20)
+ expect(windowsJob['timeout-minutes']).toBe(30)
+ for (const job of [posixJob, windowsJob]) {
+ expect(job.steps[0].with.ref).toBe('${{ github.event.pull_request.head.sha || github.sha }}')
+ for (const step of job.steps.filter((candidate) => candidate.uses)) {
+ expect(step.uses).toMatch(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}$/)
+ }
}
})
@@ -50,6 +57,12 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('--git-commit "$source_commit"')
expect(source).not.toContain('--git-commit "$GITHUB_SHA"')
expect(source).toContain('cp "$output"/*.tar.xz')
+ expect(source).toContain("Get-ChildItem -LiteralPath $output -Filter '*.zip'")
+ expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
+ expect(source).toContain('ssh-relay-runtime-zip.test.mjs')
+ expect(source).toContain('node-v24.18.0-headers.tar.gz')
+ expect(source).toContain('node_library: win-x64/node.lib')
+ expect(source).toContain("@('gpg.exe', 'gpgv.exe')")
expect(steps[uploadIndex].with.path).toBe('runtime-evidence/${{ matrix.tuple }}/')
expect(source).not.toMatch(/releases\/|gh release|contents:\s*write/i)
})
diff --git a/config/scripts/ssh-relay-runtime-zip.mjs b/config/scripts/ssh-relay-runtime-zip.mjs
new file mode 100644
index 00000000000..cb23bdeda18
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-zip.mjs
@@ -0,0 +1,138 @@
+import { createHash } from 'node:crypto'
+import { createReadStream, createWriteStream } from 'node:fs'
+import { rm, stat } from 'node:fs/promises'
+import { join } from 'node:path'
+import { pipeline } from 'node:stream/promises'
+
+import yazl from 'yazl'
+
+import { visitSshRelayZip } from './ssh-relay-zip-reader.mjs'
+
+const MAX_ARCHIVE_BYTES = 100 * 1024 * 1024
+const ZIP_LIMITS = Object.freeze({
+ maximumArchiveBytes: MAX_ARCHIVE_BYTES,
+ maximumEntries: 5_000,
+ maximumExpandedBytes: 350 * 1024 * 1024,
+ maximumFileBytes: 250 * 1024 * 1024,
+ maximumDepth: 32,
+ maximumPathBytes: 240
+})
+
+function archiveName(tuple, contentId) {
+ const match = /^sha256:([0-9a-f]{64})$/.exec(contentId)
+ if (!match) {
+ throw new Error('Runtime content identity is not a SHA-256 digest')
+ }
+ if (!tuple.startsWith('win32-')) {
+ throw new Error(`Runtime ZIP is only valid for a Windows tuple: ${tuple}`)
+ }
+ return `orca-ssh-relay-runtime-v1-${tuple}-${match[1]}.zip`
+}
+
+function zipTimestamp(sourceDateEpoch) {
+ if (!Number.isSafeInteger(sourceDateEpoch) || sourceDateEpoch < 315_532_800) {
+ throw new Error('Runtime ZIP SOURCE_DATE_EPOCH must fit the ZIP timestamp range')
+ }
+ const value = new Date(sourceDateEpoch * 1000)
+ if (Number.isNaN(value.getTime()) || value.getUTCFullYear() > 2107) {
+ throw new Error('Runtime ZIP SOURCE_DATE_EPOCH must fit the ZIP timestamp range')
+ }
+ return value
+}
+
+async function sha256File(path) {
+ const digest = createHash('sha256')
+ for await (const chunk of createReadStream(path)) {
+ digest.update(chunk)
+ }
+ return `sha256:${digest.digest('hex')}`
+}
+
+export async function createSshRelayRuntimeZip({
+ runtimeRoot,
+ outputDirectory,
+ identity,
+ sourceDateEpoch,
+ signal
+}) {
+ const name = archiveName(identity.tupleId, identity.contentId)
+ const archivePath = join(outputDirectory, name)
+ const mtime = zipTimestamp(sourceDateEpoch)
+ const zip = new yazl.ZipFile()
+ const output = createWriteStream(archivePath, { flags: 'wx', mode: 0o600 })
+ try {
+ for (const entry of [...identity.entries].sort((left, right) =>
+ left.path < right.path ? -1 : left.path > right.path ? 1 : 0
+ )) {
+ signal?.throwIfAborted()
+ const options = { mtime, mode: entry.mode, forceDosTimestamp: true }
+ if (entry.type === 'directory') {
+ zip.addEmptyDirectory(entry.path, options)
+ } else {
+ zip.addFile(join(runtimeRoot, ...entry.path.split('/')), entry.path, {
+ ...options,
+ compress: true,
+ compressionLevel: 9
+ })
+ }
+ }
+ zip.end({ forceZip64Format: false })
+ await pipeline(zip.outputStream, output, { signal })
+ const metadata = await stat(archivePath)
+ if (!metadata.isFile() || metadata.size === 0 || metadata.size > MAX_ARCHIVE_BYTES) {
+ throw new Error('Runtime ZIP exceeds the release-manifest compressed-size limit')
+ }
+ return {
+ name,
+ path: archivePath,
+ size: metadata.size,
+ sha256: await sha256File(archivePath)
+ }
+ } catch (error) {
+ zip.outputStream.destroy()
+ output.destroy()
+ await rm(archivePath, { force: true })
+ throw error
+ }
+}
+
+export async function inspectSshRelayRuntimeZip(archivePath, identity, { signal } = {}) {
+ const expected = new Map(identity.entries.map((entry) => [entry.path, entry]))
+ const seen = new Set()
+ const result = await visitSshRelayZip(
+ archivePath,
+ ZIP_LIMITS,
+ async (actual, consume) => {
+ const declared = expected.get(actual.path)
+ if (!declared || seen.has(actual.path)) {
+ throw new Error(`Runtime ZIP has extra or duplicate entry: ${actual.path}`)
+ }
+ seen.add(actual.path)
+ if (
+ actual.type !== declared.type ||
+ actual.unixMode === null ||
+ (actual.unixMode & 0o777) !== declared.mode
+ ) {
+ throw new Error(`Runtime ZIP type or mode mismatch: ${actual.path}`)
+ }
+ if (declared.type === 'file') {
+ if (actual.size !== declared.size) {
+ throw new Error(`Runtime ZIP size mismatch: ${actual.path}`)
+ }
+ const verified = await consume()
+ if (verified.sha256 !== declared.sha256) {
+ throw new Error(`Runtime ZIP file integrity mismatch: ${actual.path}`)
+ }
+ }
+ },
+ { signal }
+ )
+ const missing = [...expected.keys()].find((path) => !seen.has(path))
+ if (missing) {
+ throw new Error(`Runtime ZIP is missing declared entry: ${missing}`)
+ }
+ if (result.files !== identity.fileCount || result.expandedBytes !== identity.expandedSize) {
+ throw new Error('Runtime ZIP aggregate size or file-count mismatch')
+ }
+ return result
+}
diff --git a/config/scripts/ssh-relay-runtime-zip.test.mjs b/config/scripts/ssh-relay-runtime-zip.test.mjs
new file mode 100644
index 00000000000..5aa3669bc49
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-zip.test.mjs
@@ -0,0 +1,134 @@
+import { createHash } from 'node:crypto'
+import { createWriteStream } from 'node:fs'
+import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { pipeline } from 'node:stream/promises'
+
+import { afterEach, describe, expect, it } from 'vitest'
+import yazl from 'yazl'
+
+import { computeSshRelayRuntimeContentId } from './ssh-relay-runtime-identity.mjs'
+import { createSshRelayRuntimeZip, inspectSshRelayRuntimeZip } from './ssh-relay-runtime-zip.mjs'
+
+const temporaryDirectories = []
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+const digest = (value) => `sha256:${createHash('sha256').update(value).digest('hex')}`
+
+async function fixture() {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-runtime-zip-test-'))
+ temporaryDirectories.push(directory)
+ const runtimeRoot = join(directory, 'runtime')
+ await mkdir(join(runtimeRoot, 'bin'), { recursive: true })
+ await Promise.all([
+ writeFile(join(runtimeRoot, 'bin', 'node.exe'), 'node executable'),
+ writeFile(join(runtimeRoot, 'relay.js'), 'relay')
+ ])
+ await chmod(join(runtimeRoot, 'bin', 'node.exe'), 0o755)
+ const base = {
+ tupleId: 'win32-x64',
+ os: 'win32',
+ architecture: 'x64',
+ compatibility: {
+ kind: 'win32',
+ minimumBuild: 20348,
+ minimumOpenSshVersion: '8.1p1',
+ minimumPowerShellVersion: '5.1',
+ minimumDotNetFrameworkRelease: 528040
+ },
+ nodeVersion: '24.18.0',
+ dependencies: { nodePtyVersion: '1.1.0', parcelWatcherVersion: '2.5.6' },
+ entries: [
+ { path: 'bin', type: 'directory', mode: 0o755 },
+ {
+ path: 'bin/node.exe',
+ type: 'file',
+ role: 'node',
+ size: 15,
+ mode: 0o755,
+ sha256: digest('node executable')
+ },
+ {
+ path: 'relay.js',
+ type: 'file',
+ role: 'relay',
+ size: 5,
+ mode: 0o644,
+ sha256: digest('relay')
+ }
+ ],
+ fileCount: 2,
+ expandedSize: 20
+ }
+ return {
+ directory,
+ runtimeRoot,
+ identity: { ...base, contentId: computeSshRelayRuntimeContentId(base) }
+ }
+}
+
+async function writeZip(path, entries) {
+ const zip = new yazl.ZipFile()
+ for (const entry of entries) {
+ zip.addBuffer(Buffer.from(entry.bytes ?? ''), entry.path, {
+ mtime: new Date('2025-07-17T00:00:00.000Z'),
+ mode: entry.mode ?? 0o644
+ })
+ }
+ zip.end()
+ await pipeline(zip.outputStream, createWriteStream(path))
+}
+
+describe('SSH relay runtime Windows ZIP', () => {
+ it('creates deterministic ZIP bytes and rehashes the complete declared tree', async () => {
+ const value = await fixture()
+ const firstDirectory = join(value.directory, 'first')
+ const secondDirectory = join(value.directory, 'second')
+ await Promise.all([mkdir(firstDirectory), mkdir(secondDirectory)])
+ const first = await createSshRelayRuntimeZip({
+ runtimeRoot: value.runtimeRoot,
+ outputDirectory: firstDirectory,
+ identity: value.identity,
+ sourceDateEpoch: 1_752_710_400
+ })
+ const second = await createSshRelayRuntimeZip({
+ runtimeRoot: value.runtimeRoot,
+ outputDirectory: secondDirectory,
+ identity: value.identity,
+ sourceDateEpoch: 1_752_710_400
+ })
+
+ expect(first.name).toMatch(/\.zip$/)
+ expect(await readFile(first.path)).toEqual(await readFile(second.path))
+ await expect(inspectSshRelayRuntimeZip(first.path, value.identity)).resolves.toEqual({
+ entries: 3,
+ files: 2,
+ expandedBytes: 20
+ })
+ })
+
+ it('rejects undeclared entries and declared-file integrity mismatches', async () => {
+ const value = await fixture()
+ const extra = join(value.directory, 'extra.zip')
+ const tampered = join(value.directory, 'tampered.zip')
+ await writeZip(extra, [
+ { path: 'bin/node.exe', bytes: 'node executable', mode: 0o755 },
+ { path: 'relay.js', bytes: 'relay' },
+ { path: 'extra.js', bytes: 'extra' }
+ ])
+ await writeZip(tampered, [
+ { path: 'bin/node.exe', bytes: 'node executable', mode: 0o755 },
+ { path: 'relay.js', bytes: 'wrong' }
+ ])
+
+ await expect(inspectSshRelayRuntimeZip(extra, value.identity)).rejects.toThrow(
+ /extra or duplicate/i
+ )
+ await expect(inspectSshRelayRuntimeZip(tampered, value.identity)).rejects.toThrow(
+ /integrity mismatch/i
+ )
+ })
+})
diff --git a/config/scripts/ssh-relay-zip-reader.mjs b/config/scripts/ssh-relay-zip-reader.mjs
new file mode 100644
index 00000000000..7a406a958d9
--- /dev/null
+++ b/config/scripts/ssh-relay-zip-reader.mjs
@@ -0,0 +1,217 @@
+import { createHash } from 'node:crypto'
+import { createWriteStream } from 'node:fs'
+import { mkdir, stat } from 'node:fs/promises'
+import { dirname } from 'node:path'
+import { Transform, Writable } from 'node:stream'
+import { pipeline } from 'node:stream/promises'
+import { crc32 } from 'node:zlib'
+
+import yauzl from 'yauzl'
+
+const UTF8_DECODER = new TextDecoder('utf-8', { fatal: true })
+const ENCRYPTION_FLAGS = 0x0001 | 0x0040 | 0x2000
+const WINDOWS_DEVICE_NAME = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i
+
+function openZip(path) {
+ return new Promise((resolve, reject) => {
+ yauzl.open(
+ path,
+ {
+ autoClose: false,
+ lazyEntries: true,
+ decodeStrings: false,
+ strictFileNames: true,
+ validateEntrySizes: true
+ },
+ (error, zip) => (error ? reject(error) : resolve(zip))
+ )
+ })
+}
+
+function nextEntry(zip) {
+ return new Promise((resolve, reject) => {
+ const cleanup = () => {
+ zip.off('entry', onEntry)
+ zip.off('end', onEnd)
+ zip.off('error', onError)
+ }
+ const onEntry = (entry) => {
+ cleanup()
+ resolve(entry)
+ }
+ const onEnd = () => {
+ cleanup()
+ resolve(null)
+ }
+ const onError = (error) => {
+ cleanup()
+ reject(error)
+ }
+ zip.once('entry', onEntry)
+ zip.once('end', onEnd)
+ zip.once('error', onError)
+ zip.readEntry()
+ })
+}
+
+function openEntryStream(zip, entry) {
+ return new Promise((resolve, reject) => {
+ zip.openReadStream(entry, (error, stream) => (error ? reject(error) : resolve(stream)))
+ })
+}
+
+function decodeEntryName(entry) {
+ if (!Buffer.isBuffer(entry.fileName)) {
+ throw new Error('ZIP reader did not return raw entry-name bytes')
+ }
+ try {
+ return UTF8_DECODER.decode(entry.fileName)
+ } catch {
+ throw new Error('ZIP entry name must be valid UTF-8')
+ }
+}
+
+function portableEntryPath(name, limits) {
+ if (
+ name.length === 0 ||
+ Buffer.byteLength(name) > limits.maximumPathBytes ||
+ name.startsWith('/') ||
+ name.startsWith('\\') ||
+ /^[A-Za-z]:/.test(name)
+ ) {
+ throw new Error('ZIP entry path is not a bounded portable relative path')
+ }
+ for (const character of name) {
+ const code = character.charCodeAt(0)
+ if (code <= 0x1f || code === 0x7f || character === '\\') {
+ throw new Error('ZIP entry path contains a control character or backslash')
+ }
+ }
+ const path = name.endsWith('/') ? name.slice(0, -1) : name
+ const segments = path.split('/')
+ if (
+ segments.length > limits.maximumDepth ||
+ segments.some(
+ (segment) =>
+ segment.length === 0 ||
+ segment === '.' ||
+ segment === '..' ||
+ segment.includes(':') ||
+ segment.endsWith('.') ||
+ segment.endsWith(' ') ||
+ WINDOWS_DEVICE_NAME.test(segment)
+ )
+ ) {
+ throw new Error('ZIP entry path contains an unsafe path segment')
+ }
+ return path
+}
+
+function entryInfo(entry, path) {
+ const hostSystem = entry.versionMadeBy >>> 8
+ const unixMode = hostSystem === 3 ? (entry.externalFileAttributes >>> 16) & 0xffff : null
+ if (unixMode !== null && (unixMode & 0o170000) === 0o120000) {
+ throw new Error(`ZIP archive contains a prohibited symbolic link: ${path}`)
+ }
+ if ((entry.generalPurposeBitFlag & ENCRYPTION_FLAGS) !== 0) {
+ throw new Error(`ZIP archive contains an encrypted entry: ${path}`)
+ }
+ if (entry.compressionMethod !== 0 && entry.compressionMethod !== 8) {
+ throw new Error(`ZIP archive uses an unsupported compression method: ${path}`)
+ }
+ const directory = entry.fileName.at(-1) === 0x2f
+ if (directory && (entry.uncompressedSize !== 0 || entry.compressedSize !== 0)) {
+ throw new Error(`ZIP directory entry contains file data: ${path}`)
+ }
+ return {
+ path,
+ type: directory ? 'directory' : 'file',
+ compressedSize: entry.compressedSize,
+ size: entry.uncompressedSize,
+ crc32: entry.crc32 >>> 0,
+ hostSystem,
+ unixMode,
+ compressionMethod: entry.compressionMethod
+ }
+}
+
+async function consumeEntry(zip, entry, info, { outputPath, mode, signal } = {}) {
+ const input = await openEntryStream(zip, entry)
+ let bytes = 0
+ let checksum = 0
+ const digest = createHash('sha256')
+ const verifier = new Transform({
+ transform(chunk, _encoding, callback) {
+ bytes += chunk.length
+ if (bytes > info.size) {
+ callback(new Error(`ZIP entry expanded beyond its declared size: ${info.path}`))
+ return
+ }
+ checksum = crc32(chunk, checksum)
+ digest.update(chunk)
+ callback(null, chunk)
+ }
+ })
+ const sink = outputPath
+ ? (await mkdir(dirname(outputPath), { recursive: true }),
+ createWriteStream(outputPath, { flags: 'wx', mode: mode ?? 0o600 }))
+ : new Writable({ write: (_chunk, _encoding, callback) => callback() })
+ await pipeline(input, verifier, sink, { signal })
+ if (bytes !== info.size || checksum >>> 0 !== info.crc32) {
+ throw new Error(`ZIP entry size or CRC-32 mismatch: ${info.path}`)
+ }
+ return { bytes, sha256: `sha256:${digest.digest('hex')}` }
+}
+
+export async function visitSshRelayZip(archivePath, limits, visitor, { signal } = {}) {
+ const metadata = await stat(archivePath)
+ if (!metadata.isFile() || metadata.size === 0 || metadata.size > limits.maximumArchiveBytes) {
+ throw new Error('ZIP archive exceeds its compressed-size limit')
+ }
+ const zip = await openZip(archivePath)
+ const foldedPaths = new Set()
+ let entries = 0
+ let files = 0
+ let expandedBytes = 0
+ try {
+ for (let entry = await nextEntry(zip); entry; entry = await nextEntry(zip)) {
+ signal?.throwIfAborted()
+ const path = portableEntryPath(decodeEntryName(entry), limits)
+ const folded = path.toLowerCase()
+ if (foldedPaths.has(folded)) {
+ throw new Error(`ZIP archive contains a duplicate or case-fold collision: ${path}`)
+ }
+ foldedPaths.add(folded)
+ const info = entryInfo(entry, path)
+ entries += 1
+ if (entries > limits.maximumEntries) {
+ throw new Error('ZIP archive exceeds the entry-count limit')
+ }
+ if (info.type === 'file') {
+ files += 1
+ if (!Number.isSafeInteger(info.size) || info.size > limits.maximumFileBytes) {
+ throw new Error(`ZIP archive file exceeds the per-file size limit: ${path}`)
+ }
+ expandedBytes += info.size
+ if (!Number.isSafeInteger(expandedBytes) || expandedBytes > limits.maximumExpandedBytes) {
+ throw new Error('ZIP archive exceeds the expanded-size limit')
+ }
+ }
+ let consumed = info.type === 'directory'
+ const consume = async (options) => {
+ if (consumed) {
+ throw new Error(`ZIP entry was consumed more than once: ${path}`)
+ }
+ consumed = true
+ return consumeEntry(zip, entry, info, { ...options, signal: options?.signal ?? signal })
+ }
+ await visitor(info, consume)
+ if (!consumed) {
+ throw new Error(`ZIP visitor did not verify file bytes: ${path}`)
+ }
+ }
+ return { entries, files, expandedBytes }
+ } finally {
+ zip.close()
+ }
+}
diff --git a/config/scripts/verify-ssh-relay-node-release-inputs.mjs b/config/scripts/verify-ssh-relay-node-release-inputs.mjs
index 120ab51c8fe..2ee689aae8e 100644
--- a/config/scripts/verify-ssh-relay-node-release-inputs.mjs
+++ b/config/scripts/verify-ssh-relay-node-release-inputs.mjs
@@ -10,7 +10,8 @@ import {
validateSshRelayNodeReleaseContract,
verifySshRelayNodeArchive,
verifySshRelayNodeChecksumDocument,
- verifySshRelayNodeSignature
+ verifySshRelayNodeSignature,
+ verifySshRelayNodeWindowsBuildInput
} from './ssh-relay-node-release-verification.mjs'
const scriptDirectory = import.meta.dirname
@@ -104,11 +105,34 @@ export async function verifyNodeReleaseInputs(
)
const checksums = verifySshRelayNodeChecksumDocument(release, checksumBytes)
const archives = []
+ const windowsBuildInputs = []
for (const tuple of archiveTuples) {
const archive = release.archives[tuple]
archives.push(
await verifySshRelayNodeArchive(release, tuple, join(inputsDirectory, archive.name))
)
+ if (tuple.startsWith('win32-')) {
+ const headers = release.windowsBuildInputs.headersArchive
+ const library = release.windowsBuildInputs.importLibraries[tuple]
+ if (!windowsBuildInputs.some((input) => input.kind === 'headers')) {
+ windowsBuildInputs.push(
+ await verifySshRelayNodeWindowsBuildInput(
+ release,
+ 'headers',
+ tuple,
+ join(inputsDirectory, headers.name)
+ )
+ )
+ }
+ windowsBuildInputs.push(
+ await verifySshRelayNodeWindowsBuildInput(
+ release,
+ 'import-library',
+ tuple,
+ join(inputsDirectory, ...library.name.split('/'))
+ )
+ )
+ }
}
return {
@@ -118,7 +142,8 @@ export async function verifyNodeReleaseInputs(
signerFingerprint: signature.signerFingerprint,
checksumSha256: signature.checksumSha256,
checksumEntriesVerified: checksums.length,
- archives
+ archives,
+ windowsBuildInputs
}
}
diff --git a/config/scripts/verify-ssh-relay-runtime.mjs b/config/scripts/verify-ssh-relay-runtime.mjs
index 3b0cdc99f23..e1ee06d076c 100644
--- a/config/scripts/verify-ssh-relay-runtime.mjs
+++ b/config/scripts/verify-ssh-relay-runtime.mjs
@@ -52,7 +52,7 @@ async function actualTree(runtimeDirectory) {
results.set(path.toLowerCase(), {
path,
type: 'directory',
- mode: metadata.mode & 0o777
+ mode: process.platform === 'win32' ? null : metadata.mode & 0o777
})
await visit(absolutePath)
} else if (child.isFile()) {
@@ -61,7 +61,7 @@ async function actualTree(runtimeDirectory) {
path,
type: 'file',
size: bytes.length,
- mode: metadata.mode & 0o777,
+ mode: process.platform === 'win32' ? null : metadata.mode & 0o777,
sha256: `sha256:${createHash('sha256').update(bytes).digest('hex')}`
})
} else {
@@ -81,7 +81,8 @@ export async function verifyRuntimeTree(runtimeDirectory, identity) {
!entry ||
entry.path !== expected.path ||
entry.type !== expected.type ||
- entry.mode !== expected.mode
+ // Why: NTFS has no execute bit; the verified ZIP carries canonical mode metadata instead.
+ (process.platform !== 'win32' && entry.mode !== expected.mode)
) {
throw new Error(`Runtime tree entry mismatch: ${expected.path}`)
}
@@ -109,7 +110,7 @@ export async function verifyRuntimeTree(runtimeDirectory, identity) {
}
async function runBundledSmoke(runtimeDirectory, identity) {
- const nodePath = join(runtimeDirectory, 'bin', 'node')
+ const nodePath = join(runtimeDirectory, 'bin', identity.os === 'win32' ? 'node.exe' : 'node')
const childPath = resolve(scriptDirectory, 'ssh-relay-runtime-smoke-child.cjs')
const result = await execFileAsync(nodePath, [childPath, runtimeDirectory], {
cwd: runtimeDirectory,
diff --git a/config/ssh-relay-node-release-v24.18.0.json b/config/ssh-relay-node-release-v24.18.0.json
index 392205060b9..af985af30da 100644
--- a/config/ssh-relay-node-release-v24.18.0.json
+++ b/config/ssh-relay-node-release-v24.18.0.json
@@ -45,5 +45,21 @@
"name": "node-v24.18.0-win-x64.zip",
"sha256": "0ae68406b42d7725661da979b1403ec9926da205c6770827f33aac9d8f26e821"
}
+ },
+ "windowsBuildInputs": {
+ "headersArchive": {
+ "name": "node-v24.18.0-headers.tar.gz",
+ "sha256": "6c7d41d83c3481d2301115b8ce4a44b7d4fbfa52859b1aac14f445d460137887"
+ },
+ "importLibraries": {
+ "win32-arm64": {
+ "name": "win-arm64/node.lib",
+ "sha256": "7da03c5111815b69bbe63ffd2e51b28cd69eec9f545b7ccb8756efffdbb88dc2"
+ },
+ "win32-x64": {
+ "name": "win-x64/node.lib",
+ "sha256": "589684168a73547ca47cd22d76a4e465ef561abe89fb1b2b23fe35bbe857d505"
+ }
+ }
}
}
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index e913d49f7f4..c4bf9ff99f4 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -58,9 +58,10 @@ same change as the work it records.
[#8728](https://github.com/stablyai/orca/pull/8728) at implementation commit `b9d80a4cb`; no
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
- smoke, SBOM, and provenance only at exact implementation head `151628992` in stacked draft PR
- [#8741](https://github.com/stablyai/orca/pull/8741). It may produce test artifacts but must not
- publish, resolve, transfer, install, launch, or enable them.
+ smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate is uncommitted on top
+ of `c308107a9` in stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741) while its
+ final diff and local gates are re-audited before native CI. It may produce test artifacts but must
+ not publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -71,6 +72,15 @@ same change as the work it records.
archive/tree verification, bundled Node, patched PTY, and watcher smoke for Linux x64/arm64 and
macOS x64/arm64 under E-M3-CI-001. Same-runner clean-rebuild identity, oldest-baseline,
native-trust, SSH, Windows, and musl cells remain open.
+- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
+ and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
+ library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
+ and import-library staging are locally green under E-M3-WINDOWS-INPUT-001; native Windows build
+ proof remains active and no implicit `node-gyp` download is allowed.
+- Windows PTY-closure correction: E-M3-WINDOWS-CONPTY-GAP-001 proved the candidate omitted the
+ `conpty.dll` and `OpenConsole.exe` files required by Orca's production `useConptyDll: true` path
+ and therefore exercised a weaker system-ConPTY smoke. The artifact and smoke correction is active;
+ no Windows executable cell is complete.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -83,11 +93,12 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: implement the bounded deterministic Windows runtime/ZIP builder and verifier
- as the next artifact-only slice, add native Windows x64/arm64 runner jobs, and separately add a
- same-head/same-runner clean-rebuild identity oracle for native build reproducibility. Keep
- cross-family remote infrastructure, signing/trust, and measured legacy baseline gates open; do not
- introduce publication, resolver, transfer, rollout, tuple enablement, or default behavior.
+- Next required action: finish the final local audit of the bounded Windows runtime/ZIP builder and
+ verifier, commit the artifact-only implementation, and collect exact Windows x64/arm64 plus POSIX
+ regression evidence from draft-PR CI. A same-head/same-runner clean-rebuild identity oracle for
+ native build reproducibility remains a separate open gate. Keep cross-family remote
+ infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
+ publication, resolver, transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -350,6 +361,10 @@ cancellation; cleanup settlement is part of the timeout oracle.
provenance, and preserve official executable bytes/signatures. Orca-built native executables
and libraries still require the target-native signing policy decided below.
(E-M1-NODE-PROVENANCE-001)
+- [x] For Windows native-module builds, authenticate the exact-version `headers.tar.gz` and
+ architecture-specific `win-*/node.lib` through that same signed checksum document in addition
+ to the tuple ZIP. The official Windows ZIP does not contain either build input; implicit
+ `node-gyp` downloads are prohibited. (E-M3-WINDOWS-INPUT-GAP-001)
### Trust and signing
@@ -558,9 +573,17 @@ Each runtime must contain only the executable closure required by the relay.
(E-M3-RUNTIME-LOCAL-001)
- [x] Pin Node and verify downloaded source/binary checksums and upstream signatures.
(E-M3-NODE-PROVENANCE-001; real archive execution remains a separate per-tuple gate)
+- [x] Extend the immutable Node input contract for Windows to include the signed exact-version
+ headers archive and tuple-specific `node.lib`; verify/copy them into an exclusive local build
+ root and configure `node-gyp` to fail rather than fetch an unstaged input.
+ (E-M3-WINDOWS-INPUT-001; successful target-native offline build remains a per-tuple gate)
- [ ] Build Orca’s patched `node-pty@1.1.0` against the exact bundled Node runtime.
- [ ] Assert Orca-required patched exports/diagnostics exist; do not silently use an upstream
prebuild that omits the patch.
+- [ ] For Windows, copy the tuple-architecture `conpty.dll` and `OpenConsole.exe` from the pinned
+ node-pty source into `build/Release/conpty`, hash them into the runtime identity as native
+ runtime files, and prove PTY spawn/resize/exit with `useConptyDll: true`. Do not substitute a
+ system-ConPTY smoke for the production path. (E-M3-WINDOWS-CONPTY-GAP-001)
- [ ] Include exactly one compatible `@parcel/watcher@2.5.6` native optional package.
- [ ] Include relay JavaScript, watcher child, required runtime JavaScript closure, licenses, SBOM,
provenance, and runtime metadata.
@@ -1192,6 +1215,8 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-release-verification.test.mjs` (E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive linux-x64-glibc` (E-M3-NODE-PROVENANCE-001; metadata and archive verification only)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-zip-inspection.test.mjs config/scripts/ssh-relay-runtime-zip.test.mjs` (E-M3-WINDOWS-ZIP-RED-001, E-M3-WINDOWS-INPUT-001; synthetic ZIP/input contracts only)
+- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -2273,6 +2298,174 @@ fragmentLinks=9`.
- Follow-up: assemble the first runtime on a target-native runner, inspect its archive, execute its
bundled Node and native dependencies, then fill only the evidence cells actually proved.
+### E-M3-WINDOWS-CONPTY-GAP-001 — Candidate omitted the production ConPTY runtime closure
+
+- Date: 2026-07-14
+- Commit SHA / PR: source audit of the uncommitted Windows artifact-only candidate on top of
+ `c308107a9`; draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; source and installed-package inspection only
+- Remote and transport: none
+- Exact commands:
+
+ ```sh
+ rg -n "useConpty|nodePty\\.spawn|pty\\.spawn" src/main src/shared
+ sed -n '470,515p' src/main/daemon/pty-subprocess.ts
+ sed -n '1,130p' node_modules/node-pty/scripts/post-install.js
+ find node_modules/node-pty/third_party/conpty -maxdepth 3 -type f -print | sort
+ rg -n "conpty\\.dll|OpenConsole|useConptyDll" \
+ config/scripts/ssh-relay-runtime-tree.mjs \
+ config/scripts/ssh-relay-runtime-smoke-child.cjs
+ ```
+
+- Result: discriminating discovery. Orca's daemon PTY spawn passes `useConptyDll: true` on Windows.
+ Pinned `node-pty@1.1.0` supplies architecture-specific `conpty.dll` and `OpenConsole.exe` under
+ `third_party/conpty/1.23.251008001/win10-{x64,arm64}` and its postinstall copies those files to
+ `build/Release/conpty`. The candidate directly invoked `node-gyp`, copied only `conpty.node` and
+ `conpty_console_list.node`, and smoked with `useConpty: true` but not `useConptyDll: true`.
+- Oracle proved: the candidate artifact could pass its proposed smoke while omitting files required
+ by the production relay PTY configuration. Both plan artifacts now require the exact ConPTY
+ runtime closure and production-mode smoke before a Windows executable cell can pass.
+- Does not prove: corrected staging, artifact-tree identity, ConPTY execution, Authenticode/native
+ trust, Windows build, SSH, transfer, install, or any enabled tuple.
+- Checklist items satisfied: none; this is a red gap record and its implementation item remains open.
+- Follow-up: stage the tuple-specific files without running an implicit downloader, copy and hash
+ them into the runtime, use `useConptyDll: true` in native smoke, and obtain Windows x64/arm64 CI
+ evidence before checking the implementation item.
+
+### E-M3-WINDOWS-INPUT-GAP-001 — Windows ZIP lacks native build inputs
+
+- Date: 2026-07-14
+- Commit SHA / PR: investigation while implementing the Windows artifact-only slice in draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741); no Windows artifact was produced or enabled
+- Runner: macOS 26.2 arm64; `curl` plus system `unzip`; inspection only
+- Remote and transport: exact HTTPS download from
+ `https://nodejs.org/dist/v24.18.0/node-v24.18.0-win-x64.zip`; no SSH or release upload
+- Exact commands:
+
+ ```sh
+ curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 \
+ --connect-timeout 20 --max-time 300 --retry 2 --retry-delay 2 --retry-all-errors \
+ https://nodejs.org/dist/v24.18.0/node-v24.18.0-win-x64.zip \
+ --output /tmp/orca-node-win-input-check/node-v24.18.0-win-x64.zip
+ unzip -l /tmp/orca-node-win-input-check/node-v24.18.0-win-x64.zip | \
+ rg 'node\\.exe$|include/node/node\\.h$|node\\.lib$|LICENSE$'
+ curl --fail --silent --show-error --location --proto '=https' --tlsv1.2 \
+ https://nodejs.org/dist/v24.18.0/SHASUMS256.txt | \
+ rg 'headers|win-(x64|arm64)/node\\.lib|win-(x64|arm64)\\.zip'
+ ```
+
+- Result: discriminating discovery. The authenticated x64 ZIP contains 2,449 files and 105,728,964
+ expanded bytes, including the 92,534,088-byte `node.exe` and root `LICENSE`, but no
+ `include/node/node.h` and no `node.lib`. The same signed checksum document authenticates
+ `node-v24.18.0-headers.tar.gz` as
+ `6c7d41d83c3481d2301115b8ce4a44b7d4fbfa52859b1aac14f445d460137887`,
+ `win-x64/node.lib` as
+ `589684168a73547ca47cd22d76a4e465ef561abe89fb1b2b23fe35bbe857d505`, and
+ `win-arm64/node.lib` as
+ `7da03c5111815b69bbe63ffd2e51b28cd69eec9f545b7ccb8756efffdbb88dc2`.
+- Oracle proved: the original six-binary-archive contract is insufficient to build `node-pty` on
+ Windows without an unrecorded `node-gyp` download. Both plan artifacts now require the signed
+ headers archive and per-architecture import library as explicit immutable build inputs.
+- Does not prove: headers/import-library download or extraction, Windows build, ZIP determinism,
+ bundled Node/ConPTY/watcher execution, signing/trust, SSH, or any enabled tuple.
+- Checklist items satisfied: Windows build-input policy correction only; implementation remains
+ unchecked.
+- Follow-up: extend the signed input schema/verifier and hostile-input tests, stage only the required
+ headers and `node.lib`, then run the native Windows build with implicit downloads disabled.
+
+### E-M3-WINDOWS-ZIP-RED-001 — Windows ZIP/input contract red gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted Windows artifact-only tests on top of `c308107a9`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
+- Remote and transport: none; synthetic local test discovery only
+- Exact command:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs
+ ```
+
+- Result: expected FAIL before implementation. Both suites failed at import because the deliberately
+ missing `ssh-relay-runtime-zip.mjs` and `ssh-relay-node-zip-inspection.mjs` modules did not exist;
+ zero tests were collected.
+- Duration and resource metrics: 196 ms Vitest duration; archive/runtime resources do not apply.
+- Oracle proved: both Windows ZIP boundaries were discriminating before their implementations.
+- Does not prove: any ZIP validation, real Node input, Windows build/execution, SSH, or tuple support.
+- Checklist items satisfied: red half of the Windows ZIP/input contract gate only.
+- Follow-up: E-M3-WINDOWS-INPUT-001 records the first green implementation and real signed inputs.
+
+### E-M3-WINDOWS-INPUT-001 — Signed Windows Node inputs and bounded selective extraction
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted Windows artifact-only implementation on top of `c308107a9`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741); native Windows CI pending
+- Runners: focused tests and real selective extraction on macOS 26.2 arm64 with Node v26.0.0/pnpm
+ 10.24.0; signature/checksum/file verification in native Linux arm64 container
+ `node@sha256:032e78d7e54e352129831743737e3a83171d9cc5b5896f411649c597ce0b11ea`
+ with GnuPG/gpgv 2.2.40
+- Remote and transport: exact HTTPS inputs from `nodejs.org/dist/v24.18.0`; no SSH, release upload,
+ Windows execution, or remote-host egress
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+
+ docker run --rm \
+ -v "$PWD:/workspace:ro" -v /tmp/orca-node-win-input-check:/inputs:ro \
+ -w /workspace \
+ node@sha256:032e78d7e54e352129831743737e3a83171d9cc5b5896f411649c597ce0b11ea \
+ bash -lc 'set -euo pipefail
+ apt-get update -qq
+ DEBIAN_FRONTEND=noninteractive apt-get install -y -qq gnupg gpgv >/dev/null
+ node config/scripts/verify-ssh-relay-node-release-inputs.mjs \
+ --inputs-directory /inputs --archive win32-x64'
+
+ node --input-type=module -e \
+ "import {readFile} from 'node:fs/promises';
+ import {extractVerifiedSshRelayNodeZipBuildInputs} from
+ './config/scripts/ssh-relay-node-zip-inspection.mjs';
+ const release=JSON.parse(await readFile(
+ './config/ssh-relay-node-release-v24.18.0.json','utf8'));
+ console.log(await extractVerifiedSshRelayNodeZipBuildInputs(
+ release,'win32-x64','','',
+ {headersArchivePath:'',importLibraryPath:''}));"
+ ```
+
+- Result: PASS. Six focused suites passed 19/19 tests. The real verifier authenticated signer
+ `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C`, the exact signed checksum document, all nine pinned
+ release inputs, the 37,176,245-byte x64 ZIP, 9,951,449-byte headers archive, and 2,986,260-byte x64
+ import library. Bounded ZIP inspection consumed 2,449 entries/1,984 files/105,728,964 expanded
+ bytes and selectively staged only `node.exe` plus `LICENSE`. Bounded headers inspection consumed
+ 3,326 entries/2,726 files/58,969,198 expanded bytes and staged only `include`; `node.lib` was
+ rehashed before and after exclusive copy to `Release/node.lib`.
+- Resource and integrity details: all input hashing and archive entry verification streamed; each
+ file was bounded by 256 MiB, aggregate input expansion by 1 GiB, path depth by 32, path bytes by
+ 512, and entries by 100,000. Synthetic runtime ZIP creation was byte-identical for the same tree
+ and epoch and rejected extra entries and content mismatch. Peak RSS, open files, and cancellation
+ settlement were not instrumented in this local slice.
+- Oracle proved: exact schema and signed-checksum coverage for the Windows ZIP, common headers, and
+ tuple import library; missing/malformed input rejection; safe portable ZIP paths, traversal and
+ case-fold collision rejection; CRC-32 plus SHA-256 streaming; bounded selective extraction; exact
+ post-copy hashes; and deterministic synthetic runtime ZIP packing/inspection.
+- Does not prove: native Windows `node-pty` build, that `node-gyp` succeeds offline, bundled
+ `node.exe`/ConPTY/watcher execution, full-runtime ZIP identity on Windows, Windows x64/arm64
+ signing/trust, oldest baseline, SSH/SFTP/system-SSH, release publication, cache/fallback/UI, or any
+ enabled tuple. Local `gpg`/`gpgv` were unavailable on macOS, so the signature proof is the pinned
+ Linux container command above; Windows jobs explicitly select Git for Windows' bundled tools.
+- Checklist items satisfied: explicit signed Windows build-input contract and bounded local staging
+ only; no Windows per-tuple build/executable cell is checked.
+- Follow-up: run the exact builder on native `windows-2022` and `windows-11-arm`, require the
+ loopback-only `node-gyp` fallback URL to remain unused, and record only the cells actually passed.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html b/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
index b3198b31b8b..09adbb1be72 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
@@ -1135,15 +1135,37 @@
Build for the runtime, architecture, and libc together.
Rosetta SSH cell. These are selector eligibility constraints, not tuple enablement;
every candidate still needs the complete two-layer evidence.
+
+ Windows target-native native-module builds use three immutable inputs authenticated by
+ that same signed checksum document: the tuple's official Node ZIP, the exact-version
+ headers.tar.gz, and the tuple's win-*/node.lib. The Windows
+ ZIP does not contain build headers or the import library. Stage only the required
+ executable, license, headers, and import library into the local build root; disable
+ implicit node-gyp downloads so no unrecorded build input can enter.
+
Archive contents
-
Unmodified official Node v24.18.0 executable pinned by source archive hash.
+
+ Unmodified official Node v24.18.0 executable pinned by its signed binary-archive
+ hash. Windows native builds additionally authenticate the signed headers archive
+ and architecture-specific node.lib, neither of which is shipped in
+ the Windows runtime ZIP.
+
relay.js and crash-isolated relay-watcher.js.
Orca-patched node-pty@1.1.0 built for the bundled runtime.
+
+ Windows also carries the pinned node-pty ConPTY runtime closure (conpty.dll
+ and OpenConsole.exe) for the tuple architecture. Hash both files into
+ the tree identity, classify them as native runtime inputs for signing/trust, and
+ run PTY smoke with the production useConptyDll: true behavior rather
+ than silently exercising system ConPTY.
+
@parcel/watcher@2.5.6 with exactly one native optional package.
diff --git a/package.json b/package.json
index 12c0fe1b542..52c183391be 100644
--- a/package.json
+++ b/package.json
@@ -222,6 +222,8 @@
"vitest": "^4.1.5",
"vscode-oniguruma": "^2.0.1",
"vscode-textmate": "^9.3.2",
+ "yauzl": "3.4.0",
+ "yazl": "3.3.1",
"zustand": "^5.0.13"
},
"optionalDependencies": {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d879a29059f..db785a10da3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -374,6 +374,12 @@ importers:
vscode-textmate:
specifier: ^9.3.2
version: 9.3.2
+ yauzl:
+ specifier: 3.4.0
+ version: 3.4.0
+ yazl:
+ specifier: 3.3.1
+ version: 3.3.1
zustand:
specifier: ^5.0.13
version: 5.0.13(@types/react@19.2.17)(react@19.2.7)(use-sync-external-store@1.6.0(react@19.2.7))
@@ -3604,6 +3610,10 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
+ buffer-crc32@1.0.0:
+ resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==}
+ engines: {node: '>=8.0.0'}
+
buffer-from@1.1.2:
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
@@ -5664,6 +5674,9 @@ packages:
resolution: {integrity: sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==}
engines: {node: '>=12', npm: '>=6'}
+ pend@1.2.0:
+ resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
+
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -6808,6 +6821,13 @@ packages:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
+ yauzl@3.4.0:
+ resolution: {integrity: sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw==}
+ engines: {node: '>=12'}
+
+ yazl@3.3.1:
+ resolution: {integrity: sha512-BbETDVWG+VcMUle37k5Fqp//7SDOK2/1+T7X8TD96M3D9G8jK5VLUdQVdVjGi8im7FGkazX7kk5hkU8X4L5Bng==}
+
yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
@@ -9795,6 +9815,8 @@ snapshots:
node-releases: 2.0.38
update-browserslist-db: 1.2.3(browserslist@4.28.2)
+ buffer-crc32@1.0.0: {}
+
buffer-from@1.1.2: {}
buffer@5.7.1:
@@ -12242,6 +12264,8 @@ snapshots:
pe-library@0.4.1: {}
+ pend@1.2.0: {}
+
picocolors@1.1.1: {}
picomatch@2.3.2: {}
@@ -13525,6 +13549,14 @@ snapshots:
y18n: 5.0.8
yargs-parser: 21.1.1
+ yauzl@3.4.0:
+ dependencies:
+ pend: 1.2.0
+
+ yazl@3.3.1:
+ dependencies:
+ buffer-crc32: 1.0.0
+
yocto-queue@0.1.0: {}
yocto-spinner@1.2.0:
From 539cd060e74386ba33bf1291c940b68fba9af13b Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 09:59:58 -0400
Subject: [PATCH 006/267] docs(ssh): record Windows runtime artifact gates
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 74 ++++++++++++++++---
1 file changed, 64 insertions(+), 10 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index c4bf9ff99f4..b2cd77b26af 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -58,10 +58,10 @@ same change as the work it records.
[#8728](https://github.com/stablyai/orca/pull/8728) at implementation commit `b9d80a4cb`; no
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
- smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate is uncommitted on top
- of `c308107a9` in stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741) while its
- final diff and local gates are re-audited before native CI. It may produce test artifacts but must
- not publish, resolve, transfer, install, launch, or enable them.
+ smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate is implemented at exact
+ head `922edb6ff28199b394f508731fd18a635bec49a0` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741) and awaits exact-head native CI. It may produce
+ test artifacts but must not publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -79,8 +79,9 @@ same change as the work it records.
proof remains active and no implicit `node-gyp` download is allowed.
- Windows PTY-closure correction: E-M3-WINDOWS-CONPTY-GAP-001 proved the candidate omitted the
`conpty.dll` and `OpenConsole.exe` files required by Orca's production `useConptyDll: true` path
- and therefore exercised a weaker system-ConPTY smoke. The artifact and smoke correction is active;
- no Windows executable cell is complete.
+ and therefore exercised a weaker system-ConPTY smoke. E-M3-WINDOWS-LOCAL-002 proves the corrected
+ local tree-closure and smoke configuration contracts; native execution remains open and no
+ Windows executable cell is complete.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -1216,6 +1217,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-release-verification.test.mjs` (E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive linux-x64-glibc` (E-M3-NODE-PROVENANCE-001; metadata and archive verification only)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-zip-inspection.test.mjs config/scripts/ssh-relay-runtime-zip.test.mjs` (E-M3-WINDOWS-ZIP-RED-001, E-M3-WINDOWS-INPUT-001; synthetic ZIP/input contracts only)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-windows-tree.test.mjs` (E-M3-WINDOWS-LOCAL-002; structural Windows ConPTY closure only, no execution)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -2301,8 +2303,9 @@ fragmentLinks=9`.
### E-M3-WINDOWS-CONPTY-GAP-001 — Candidate omitted the production ConPTY runtime closure
- Date: 2026-07-14
-- Commit SHA / PR: source audit of the uncommitted Windows artifact-only candidate on top of
- `c308107a9`; draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Commit SHA / PR: source audit while preparing implementation commit
+ `922edb6ff28199b394f508731fd18a635bec49a0`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; source and installed-package inspection only
- Remote and transport: none
- Exact commands:
@@ -2400,8 +2403,8 @@ fragmentLinks=9`.
### E-M3-WINDOWS-INPUT-001 — Signed Windows Node inputs and bounded selective extraction
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted Windows artifact-only implementation on top of `c308107a9`; draft PR
- [#8741](https://github.com/stablyai/orca/pull/8741); native Windows CI pending
+- Commit SHA / PR: implementation commit `922edb6ff28199b394f508731fd18a635bec49a0`;
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741); native Windows CI pending
- Runners: focused tests and real selective extraction on macOS 26.2 arm64 with Node v26.0.0/pnpm
10.24.0; signature/checksum/file verification in native Linux arm64 container
`node@sha256:032e78d7e54e352129831743737e3a83171d9cc5b5896f411649c597ce0b11ea`
@@ -2466,6 +2469,57 @@ fragmentLinks=9`.
- Follow-up: run the exact builder on native `windows-2022` and `windows-11-arm`, require the
loopback-only `node-gyp` fallback URL to remain unused, and record only the cells actually passed.
+### E-M3-WINDOWS-LOCAL-002 — Corrected Windows artifact contracts and local static gates
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation commit `922edb6ff28199b394f508731fd18a635bec49a0`;
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. The repository requires Node 24, so
+ exact-head draft-PR CI is the authoritative supported-Node result.
+- Remote and transport: none; synthetic contracts and repository static checks only
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
+ git diff --check
+ ```
+
+- Result: PASS. Seven focused suites passed 21/21 tests in 290 ms. Typecheck, oxlint, max-lines,
+ full lint/reliability/localization gates, plan formatting, and diff whitespace passed. Oxlint
+ reported only pre-existing warnings outside this package. Full lint used `GOMAXPROCS=2` because
+ the external Go type-aware linter had previously segfaulted on an existing dependency declaration
+ at unconstrained concurrency.
+- Oracle proved: deterministic synthetic Windows ZIP packing and complete ZIP reinspection;
+ signed-input schema and bounded ZIP/header staging contracts; Windows-unsafe header path
+ rejection; the Windows runtime-tree identity contains `conpty.dll` and `OpenConsole.exe` as
+ native runtime files; the smoke configuration selects `useConptyDll: true`; the workflow declares
+ exact x64/arm64 native runners and has read-only, unpublished artifact authority.
+- Resource metrics: focused Vitest duration 290 ms. Runtime RSS, open files/channels, cancellation
+ settlement, artifact size, and native build/smoke duration do not apply to these synthetic checks
+ and remain open for target-native evidence.
+- Does not prove: Windows native compilation, offline `node-gyp`, staged ConPTY execution,
+ bundled-Node/PTY/watcher smoke, full artifact bytes or reproducibility, native trust/signing,
+ oldest baseline, SSH transfer/install, publication, resolver/cache/fallback/UI, or any enabled
+ tuple.
+- Checklist items satisfied: the added purpose-named local Windows-tree command only. Windows
+ per-tuple build/executable and ConPTY implementation boxes remain unchecked pending native CI.
+- Follow-up: push this exact implementation head and record exact Windows x64/arm64 jobs, images,
+ artifact IDs/hashes/sizes, build/verify/smoke durations, RSS, and any discriminating failure.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
From 55f7137c6e065481d2f58fed1353df9a75914fc8 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:07:55 -0400
Subject: [PATCH 007/267] test(ssh): make relay tar fixture portable
Co-authored-by: Orca
---
.../ssh-relay-node-tar-inspection.test.mjs | 17 +++++-
...github-release-implementation-checklist.md | 61 +++++++++++++++++--
2 files changed, 70 insertions(+), 8 deletions(-)
diff --git a/config/scripts/ssh-relay-node-tar-inspection.test.mjs b/config/scripts/ssh-relay-node-tar-inspection.test.mjs
index 389bcfb9a53..1a8aaca240d 100644
--- a/config/scripts/ssh-relay-node-tar-inspection.test.mjs
+++ b/config/scripts/ssh-relay-node-tar-inspection.test.mjs
@@ -1,4 +1,4 @@
-import { chmod, mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'
+import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { Readable } from 'node:stream'
@@ -87,8 +87,19 @@ async function validTarStream() {
writeFile(join(directory, root, 'LICENSE'), 'Node license'),
writeFile(join(directory, root, 'include', 'node', 'node.h'), 'Node header')
])
- await chmod(join(directory, root, 'bin', 'node'), 0o755)
- return create({ cwd: directory, portable: true }, [root])
+ return create(
+ {
+ cwd: directory,
+ portable: true,
+ // Why: NTFS cannot express POSIX execute bits, so the archive fixture must declare its mode.
+ onWriteEntry: (entry) => {
+ if (entry.path.replaceAll('\\', '/') === `${root}/bin/node` && entry.stat) {
+ entry.stat.mode = (entry.stat.mode & ~0o777) | 0o755
+ }
+ }
+ },
+ [root]
+ )
}
function rawTar(entries) {
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index b2cd77b26af..21993023e25 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -82,6 +82,10 @@ same change as the work it records.
and therefore exercised a weaker system-ConPTY smoke. E-M3-WINDOWS-LOCAL-002 proves the corrected
local tree-closure and smoke configuration contracts; native execution remains open and no
Windows executable cell is complete.
+- First Windows native run: E-M3-WINDOWS-CI-RED-002 failed before download/build on both Windows
+ architectures. One failure is a confirmed NTFS fixture-mode assumption; two import-time
+ `SyntaxError` failures remain unexplained until the corrected exact-head rerun. No Windows
+ executable evidence is claimed from the run.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -95,11 +99,12 @@ same change as the work it records.
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
- Next required action: finish the final local audit of the bounded Windows runtime/ZIP builder and
- verifier, commit the artifact-only implementation, and collect exact Windows x64/arm64 plus POSIX
- regression evidence from draft-PR CI. A same-head/same-runner clean-rebuild identity oracle for
- native build reproducibility remains a separate open gate. Keep cross-family remote
- infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
- publication, resolver, transfer, rollout, tuple enablement, or default behavior.
+ verifier, correct the Windows-only test failures from E-M3-WINDOWS-CI-RED-002, and collect exact
+ Windows x64/arm64 plus POSIX regression evidence from the corrected draft-PR head. A
+ same-head/same-runner clean-rebuild identity oracle for native build reproducibility remains a
+ separate open gate. Keep cross-family remote infrastructure, signing/trust, and measured legacy
+ baseline gates open; do not introduce publication, resolver, transfer, rollout, tuple enablement,
+ or default behavior.
## Non-Negotiable Invariants
@@ -2520,6 +2525,52 @@ fragmentLinks=9`.
- Follow-up: push this exact implementation head and record exact Windows x64/arm64 jobs, images,
artifact IDs/hashes/sizes, build/verify/smoke durations, RSS, and any discriminating failure.
+### E-M3-WINDOWS-CI-RED-002 — First Windows native jobs stopped at contract tests
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `539cd060e74386ba33bf1291c940b68fba9af13b` containing
+ implementation commit `922edb6ff28199b394f508731fd18a635bec49a0`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run: [SSH Relay Runtime Artifacts 29338911990](https://github.com/stablyai/orca/actions/runs/29338911990)
+- Native jobs:
+ - x64 job `87105197603`: requested `windows-2022`; resolved `win22` image
+ `20260706.237.1`, GitHub-hosted X64, Windows Server 2022 Datacenter build 20348, Node v24.18.0;
+ failed after 1m17s.
+ - arm64 job `87105197605`: requested `windows-11-arm`; resolved `win11-arm64` image
+ `20260706.102.1`, GitHub-hosted ARM64, Windows 10 Enterprise build 26200, Node v24.18.0; failed
+ after 3m37s.
+- Remote and transport: none. Both jobs stopped before Node input download, native build, runtime
+ smoke, or artifact upload.
+- Exact commands:
+
+ ```sh
+ gh api repos/stablyai/orca/actions/jobs/87105197603/logs > /tmp/orca-win-x64-red.log
+ gh api repos/stablyai/orca/actions/jobs/87105197605/logs > /tmp/orca-win-arm64-red.log
+ rg -n "requested_runner=|resolved_image_os=|resolved_image_version=|runner_arch=|WindowsProductName|WindowsVersion|OsBuildNumber|source_commit=|FAIL|SyntaxError|Node archive is missing" \
+ /tmp/orca-win-x64-red.log /tmp/orca-win-arm64-red.log
+ ```
+
+- Result: FAIL as a discriminating pre-build gate on both architectures. Each run reported three
+ failed and four passed suites, with one failed and ten passed collected tests. The x64 test phase
+ took 1.26s; arm64 took 1.33s. `ssh-relay-node-tar-inspection.test.mjs` created its POSIX tar
+ fixture from an NTFS file and therefore lost the declared `bin/node` execute bit; the production
+ inspector correctly rejected it. `ssh-relay-node-release-verification.test.mjs` and
+ `ssh-relay-runtime-artifact.test.mjs` separately failed at import with only `SyntaxError: Invalid
+or unexpected token`; the first logs did not identify a source location.
+- Oracle proved: both requested hosted runner labels resolve to native Node 24 environments, MSVC
+ setup succeeds, Git for Windows supplies both required GPG tools, frozen source installation
+ succeeds, and the test command stops the artifact build before any download or upload. It also
+ discriminated one cross-platform fixture assumption.
+- Does not prove: that the explicit-mode fixture correction is green on Windows; the cause of the
+ two import-time syntax errors; Node input download/signature verification; native compilation;
+ offline `node-gyp`; bundled Node/ConPTY/watcher execution; ZIP output; native trust; SSH; or any
+ enabled tuple.
+- Checklist items satisfied: exact Windows runner-label resolution only. No Windows build,
+ executable, archive, or artifact cell is checked.
+- Follow-up: declare `0o755` in the tar fixture's archive metadata instead of relying on NTFS,
+ rerun the same seven suites on both native architectures, and diagnose the two import failures if
+ they recur before allowing either job to download inputs.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
From ef94c90663740c657d44e93f758c99016e66b61a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:11:21 -0400
Subject: [PATCH 008/267] test(ssh): keep relay CLI modules importable
Co-authored-by: Orca
---
.../verify-ssh-relay-node-release-inputs.mjs | 2 --
config/scripts/verify-ssh-relay-runtime.mjs | 2 --
...relay-github-release-implementation-checklist.md | 13 ++++++++++---
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/config/scripts/verify-ssh-relay-node-release-inputs.mjs b/config/scripts/verify-ssh-relay-node-release-inputs.mjs
index 2ee689aae8e..da2e8ef254e 100644
--- a/config/scripts/verify-ssh-relay-node-release-inputs.mjs
+++ b/config/scripts/verify-ssh-relay-node-release-inputs.mjs
@@ -1,5 +1,3 @@
-#!/usr/bin/env node
-
import { readFile } from 'node:fs/promises'
import { dirname, isAbsolute, join, resolve } from 'node:path'
import { pathToFileURL } from 'node:url'
diff --git a/config/scripts/verify-ssh-relay-runtime.mjs b/config/scripts/verify-ssh-relay-runtime.mjs
index e1ee06d076c..5179d0fc034 100644
--- a/config/scripts/verify-ssh-relay-runtime.mjs
+++ b/config/scripts/verify-ssh-relay-runtime.mjs
@@ -1,5 +1,3 @@
-#!/usr/bin/env node
-
import { execFile } from 'node:child_process'
import { createHash } from 'node:crypto'
import { readFile, readdir, stat } from 'node:fs/promises'
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 21993023e25..148424cf679 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2557,6 +2557,13 @@ fragmentLinks=9`.
inspector correctly rejected it. `ssh-relay-node-release-verification.test.mjs` and
`ssh-relay-runtime-artifact.test.mjs` separately failed at import with only `SyntaxError: Invalid
or unexpected token`; the first logs did not identify a source location.
+- Discriminating follow-up: exact head `55f7137c6e065481d2f58fed1353df9a75914fc8` reran in
+ [run 29339487426](https://github.com/stablyai/orca/actions/runs/29339487426). X64 job
+ `87107170544` proved the explicit tar-mode correction: five suites and all 11 collected tests
+ passed in 1.24s. Only the same two import-time syntax errors remained. Both failing suites import
+ a command-line `.mjs` file with a Unix shebang, while every supported call site already invokes
+ those files through `node`; the next correction removes only those unused shebangs and preserves
+ the CLI main guards.
- Oracle proved: both requested hosted runner labels resolve to native Node 24 environments, MSVC
setup succeeds, Git for Windows supplies both required GPG tools, frozen source installation
succeeds, and the test command stops the artifact build before any download or upload. It also
@@ -2567,9 +2574,9 @@ or unexpected token`; the first logs did not identify a source location.
enabled tuple.
- Checklist items satisfied: exact Windows runner-label resolution only. No Windows build,
executable, archive, or artifact cell is checked.
-- Follow-up: declare `0o755` in the tar fixture's archive metadata instead of relying on NTFS,
- rerun the same seven suites on both native architectures, and diagnose the two import failures if
- they recur before allowing either job to download inputs.
+- Follow-up: rerun the same seven suites on both native architectures without the two unused
+ shebangs. Treat a recurrence as evidence against the transform-boundary diagnosis and continue to
+ block input download/build.
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
From b387ac48cda70b60a5a148c03ce740f9afedf9cb Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:14:48 -0400
Subject: [PATCH 009/267] test(ssh): preserve Windows verification fixtures
Co-authored-by: Orca
---
.gitattributes | 1 +
.../scripts/ssh-relay-runtime-artifact.test.mjs | 11 +++++++----
...ay-github-release-implementation-checklist.md | 16 +++++++++++++---
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/.gitattributes b/.gitattributes
index 399e8099114..42637cf496d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -6,6 +6,7 @@
/config/scripts/run-internal-dev-setup.mjs text eol=lf
/config/scripts/verify-cli-bin.mjs text eol=lf
/config/scripts/verify-release-required-assets.mjs text eol=lf
+/config/ssh-relay-node-release-keys/*.asc -text
/skill-guides/*.md text eol=lf
/skills/*/SKILL.md text eol=lf
/src/cli/bundled-skill-guides.ts text eol=lf
diff --git a/config/scripts/ssh-relay-runtime-artifact.test.mjs b/config/scripts/ssh-relay-runtime-artifact.test.mjs
index ed8c1e96d11..d09198ed799 100644
--- a/config/scripts/ssh-relay-runtime-artifact.test.mjs
+++ b/config/scripts/ssh-relay-runtime-artifact.test.mjs
@@ -170,10 +170,13 @@ describe('SSH relay runtime artifact', () => {
)
await writeFile(join(fixture.runtimeRoot, 'relay.js'), 'relay')
- await chmod(join(fixture.runtimeRoot, 'relay.js'), 0o600)
- await expect(verifyRuntimeTree(fixture.runtimeRoot, fixture.identity)).rejects.toThrow(
- /entry mismatch/i
- )
+ if (process.platform !== 'win32') {
+ // Why: NTFS cannot represent the POSIX mode that the verified ZIP carries for remote install.
+ await chmod(join(fixture.runtimeRoot, 'relay.js'), 0o600)
+ await expect(verifyRuntimeTree(fixture.runtimeRoot, fixture.identity)).rejects.toThrow(
+ /entry mismatch/i
+ )
+ }
})
it.skipIf(process.platform === 'win32')(
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 148424cf679..ea2d57297e4 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2564,6 +2564,16 @@ or unexpected token`; the first logs did not identify a source location.
a command-line `.mjs` file with a Unix shebang, while every supported call site already invokes
those files through `node`; the next correction removes only those unused shebangs and preserves
the CLI main guards.
+- Second follow-up: exact head `ef94c90663740c657d44e93f758c99016e66b61a` reran in
+ [run 29339742904](https://github.com/stablyai/orca/actions/runs/29339742904). X64 job
+ `87108126824` collected all seven suites and 21 tests, proving the shebang correction. Eighteen
+ tests passed, one POSIX archive test skipped as designed, and two Windows-specific assertions
+ failed in 1.17s: Git checkout converted the pinned armored key from LF to CRLF, and a POSIX
+ `chmod(0o600)` rejection assertion ran even though the Windows verifier intentionally takes modes
+ from verified ZIP metadata. The received key hash
+ `25cc2da386fe54cfc6a3d683f1df2a5f636014a31be8efadd73a9ecc2208dbec` exactly matches
+ `sed 's/$/\r/' | shasum -a 256`; the committed LF bytes remain
+ `84b1ca614406f341cb86e72920f5a64687a13ab67ab84038bcf2abba97898a84`.
- Oracle proved: both requested hosted runner labels resolve to native Node 24 environments, MSVC
setup succeeds, Git for Windows supplies both required GPG tools, frozen source installation
succeeds, and the test command stops the artifact build before any download or upload. It also
@@ -2574,9 +2584,9 @@ or unexpected token`; the first logs did not identify a source location.
enabled tuple.
- Checklist items satisfied: exact Windows runner-label resolution only. No Windows build,
executable, archive, or artifact cell is checked.
-- Follow-up: rerun the same seven suites on both native architectures without the two unused
- shebangs. Treat a recurrence as evidence against the transform-boundary diagnosis and continue to
- block input download/build.
+- Follow-up: mark the pinned armored key `-text` so checkout preserves its authenticated bytes,
+ keep the filesystem-mode mutation assertion POSIX-only, and rerun both native architectures.
+ Continue to block input download/build until all seven suites pass.
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
From b6903b2205b52472e64f241fd0f2117196602deb Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:23:38 -0400
Subject: [PATCH 010/267] fix(ssh): keep GPG verification paths portable
Co-authored-by: Orca
---
.../ssh-relay-node-release-signature.mjs | 40 ++---
...h-relay-node-release-verification.test.mjs | 60 ++++++++
...github-release-implementation-checklist.md | 143 ++++++++++++++++--
3 files changed, 213 insertions(+), 30 deletions(-)
diff --git a/config/scripts/ssh-relay-node-release-signature.mjs b/config/scripts/ssh-relay-node-release-signature.mjs
index 173d5288666..04b96ed45e1 100644
--- a/config/scripts/ssh-relay-node-release-signature.mjs
+++ b/config/scripts/ssh-relay-node-release-signature.mjs
@@ -42,9 +42,10 @@ async function readVerifiedFile(filePath, maximumBytes, expectedSha256, label) {
return Buffer.concat(chunks, bytes)
}
-async function defaultCommandRunner(command, args) {
+async function defaultCommandRunner(command, args, { cwd } = {}) {
try {
const result = await execFileAsync(command, args, {
+ cwd,
encoding: 'utf8',
maxBuffer: MAX_COMMAND_OUTPUT_BYTES,
timeout: COMMAND_TIMEOUT_MS,
@@ -104,7 +105,6 @@ export async function verifySshRelayNodeSignature(
const directory = await mkdtemp(join(tmpdir(), 'orca-node-signature-'))
try {
const armoredKeyPath = join(directory, 'release-key.asc')
- const keyringPath = join(directory, 'release-key.gpg')
const verifiedChecksumPath = join(directory, release.checksumDocument.name)
const verifiedSignaturePath = join(directory, release.signature.name)
await Promise.all([
@@ -113,28 +113,32 @@ export async function verifySshRelayNodeSignature(
writeFile(verifiedSignaturePath, signatureBytes, { mode: 0o600 })
])
- const dearmor = await commandRunner('gpg', [
- '--batch',
- '--yes',
- '--dearmor',
- '--output',
- keyringPath,
- armoredKeyPath
- ])
+ // Git for Windows GPG treats drive-letter keyring paths as resource URLs.
+ // Relative names stay inside the exclusive verified-copy directory on every platform.
+ const commandOptions = { cwd: directory }
+ const dearmor = await commandRunner(
+ 'gpg',
+ ['--batch', '--yes', '--dearmor', '--output', './release-key.gpg', './release-key.asc'],
+ commandOptions
+ )
if (dearmor.exitCode !== 0) {
throw new Error(
`gpgv key preparation failed: ${dearmor.stderr || 'gpg exited unsuccessfully'}`
)
}
- const verified = await commandRunner('gpgv', [
- '--status-fd',
- '1',
- '--keyring',
- keyringPath,
- verifiedSignaturePath,
- verifiedChecksumPath
- ])
+ const verified = await commandRunner(
+ 'gpgv',
+ [
+ '--status-fd',
+ '1',
+ '--keyring',
+ './release-key.gpg',
+ `./${release.signature.name}`,
+ `./${release.checksumDocument.name}`
+ ],
+ commandOptions
+ )
if (verified.exitCode !== 0) {
throw new Error(
`gpgv rejected the Node checksum signature: ${verified.stderr || 'unknown error'}`
diff --git a/config/scripts/ssh-relay-node-release-verification.test.mjs b/config/scripts/ssh-relay-node-release-verification.test.mjs
index fbf2d1b8e4b..c9bdecba07d 100644
--- a/config/scripts/ssh-relay-node-release-verification.test.mjs
+++ b/config/scripts/ssh-relay-node-release-verification.test.mjs
@@ -242,6 +242,66 @@ describe('SSH relay Node release verification', () => {
).rejects.toThrow(/pinned Node release signer fingerprint/i)
})
+ it('keeps GPG verified-copy paths relative to the exclusive working directory', async () => {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-signature-path-test-'))
+ temporaryDirectories.push(directory)
+ const keyPath = join(directory, 'release-key.asc')
+ const checksumPath = join(directory, 'SHASUMS256.txt')
+ const signaturePath = join(directory, 'SHASUMS256.txt.sig')
+ await writeFile(keyPath, 'key')
+ await writeFile(checksumPath, 'checksums')
+ await writeFile(signaturePath, 'signature')
+ const release = contract({
+ checksumDocument: { ...contract().checksumDocument, sha256: digest('checksums') },
+ signature: {
+ ...contract().signature,
+ sha256: digest('signature'),
+ key: { ...contract().signature.key, path: keyPath, sha256: digest('key') }
+ }
+ })
+ const calls = []
+ const commandRunner = async (command, args, options) => {
+ calls.push({ command, args, options })
+ return {
+ exitCode: 0,
+ stdout:
+ command === 'gpgv'
+ ? `[GNUPG:] VALIDSIG ${release.signature.signerFingerprint} signed fixture\n`
+ : '',
+ stderr: ''
+ }
+ }
+
+ await verifySshRelayNodeSignature(release, { checksumPath, signaturePath, commandRunner })
+
+ expect(calls.map(({ command, args }) => ({ command, args }))).toEqual([
+ {
+ command: 'gpg',
+ args: [
+ '--batch',
+ '--yes',
+ '--dearmor',
+ '--output',
+ './release-key.gpg',
+ './release-key.asc'
+ ]
+ },
+ {
+ command: 'gpgv',
+ args: [
+ '--status-fd',
+ '1',
+ '--keyring',
+ './release-key.gpg',
+ './SHASUMS256.txt.sig',
+ './SHASUMS256.txt'
+ ]
+ }
+ ])
+ expect(calls[0].options.cwd).toMatch(/orca-node-signature-/)
+ expect(calls[1].options.cwd).toBe(calls[0].options.cwd)
+ })
+
it('verifies a Windows archive, headers, and import library through the CLI API', async () => {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-cli-test-'))
temporaryDirectories.push(directory)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index ea2d57297e4..c892768c251 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows runtime/ZIP, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows contract tests are native-runner green but signature-tool path portability, runtime/ZIP, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -58,10 +58,12 @@ same change as the work it records.
[#8728](https://github.com/stablyai/orca/pull/8728) at implementation commit `b9d80a4cb`; no
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
- smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate is implemented at exact
- head `922edb6ff28199b394f508731fd18a635bec49a0` in stacked draft PR
- [#8741](https://github.com/stablyai/orca/pull/8741) and awaits exact-head native CI. It may produce
- test artifacts but must not publish, resolve, transfer, install, launch, or enable them.
+ smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
+ corrections are at exact head `b387ac48cda70b60a5a148c03ce740f9afedf9cb` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures pass all seven
+ contract suites, then fail closed before extraction/build because Git for Windows `gpgv` rejects
+ an absolute drive-letter keyring path (E-M3-WINDOWS-CI-RED-003). It may produce test artifacts but
+ must not publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -82,10 +84,11 @@ same change as the work it records.
and therefore exercised a weaker system-ConPTY smoke. E-M3-WINDOWS-LOCAL-002 proves the corrected
local tree-closure and smoke configuration contracts; native execution remains open and no
Windows executable cell is complete.
-- First Windows native run: E-M3-WINDOWS-CI-RED-002 failed before download/build on both Windows
- architectures. One failure is a confirmed NTFS fixture-mode assumption; two import-time
- `SyntaxError` failures remain unexplained until the corrected exact-head rerun. No Windows
- executable evidence is claimed from the run.
+- Windows native progression: E-M3-WINDOWS-CI-RED-002 captured and corrected NTFS fixture modes,
+ Windows shebang parsing, authenticated-key checkout bytes, and POSIX-only mode assertions. At the
+ corrected exact head, E-M3-WINDOWS-CI-RED-003 proves 20 passing and one intentionally skipped test
+ on each native architecture, exact input download, and a common fail-closed Git-for-Windows
+ `gpgv` drive-letter keyring incompatibility. No Windows executable evidence is claimed.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -98,9 +101,9 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: finish the final local audit of the bounded Windows runtime/ZIP builder and
- verifier, correct the Windows-only test failures from E-M3-WINDOWS-CI-RED-002, and collect exact
- Windows x64/arm64 plus POSIX regression evidence from the corrected draft-PR head. A
+- Next required action: pass only cwd-relative verified-copy paths to `gpg`/`gpgv`, add a
+ discriminating command-boundary regression test, and collect exact Windows x64/arm64 plus POSIX
+ regression evidence from the corrected draft-PR head. A
same-head/same-runner clean-rebuild identity oracle for native build reproducibility remains a
separate open gate. Keep cross-family remote infrastructure, signing/trust, and measured legacy
baseline gates open; do not introduce publication, resolver, transfer, rollout, tuple enablement,
@@ -2588,6 +2591,122 @@ or unexpected token`; the first logs did not identify a source location.
keep the filesystem-mode mutation assertion POSIX-only, and rerun both native architectures.
Continue to block input download/build until all seven suites pass.
+### E-M3-WINDOWS-CI-RED-003 — Native Windows input verification exposed GPG path incompatibility
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run: [SSH Relay Runtime Artifacts 29339998273](https://github.com/stablyai/orca/actions/runs/29339998273)
+- Native jobs:
+ - x64 job `87109014067`: requested `windows-2022`; resolved `win22` image
+ `20260706.237.1`, GitHub-hosted X64, Windows Server 2022 Datacenter build 20348, Node v24.18.0;
+ failed after 1m21s.
+ - arm64 job `87109014073`: requested `windows-11-arm`; resolved `win11-arm64` image
+ `20260706.102.1`, GitHub-hosted ARM64, Windows 10 Enterprise build 26200, Node v24.18.0; failed
+ after approximately 3m.
+- Remote and transport: none. Each job downloaded exact HTTPS inputs from
+ `nodejs.org/dist/v24.18.0`; neither reached archive extraction, native compilation, smoke, ZIP
+ creation, or artifact upload.
+- Exact commands:
+
+ ```sh
+ gh run view 29339998273 --repo stablyai/orca \
+ --json databaseId,headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87109014067/logs | \
+ rg -n -C 12 "SSH relay runtime build failed|gpgv rejected|invalid key resource|Process completed with exit code"
+ gh api repos/stablyai/orca/actions/jobs/87109014073/logs | \
+ rg -n -C 12 "SSH relay runtime build failed|gpgv rejected|invalid key resource|Process completed with exit code"
+ ```
+
+- Result: FAIL as a discriminating signed-input gate on both architectures. All seven focused suites
+ collected on each runner; 20 tests passed and one POSIX-only test skipped as designed in 1.17s on
+ x64 and 1.47s on arm64. Exact Node inputs downloaded successfully. Git for Windows `gpgv` then
+ rejected the exclusive verified-copy keyring path before signature acceptance:
+ `invalid key resource URL 'C:\\...\\release-key.gpg'`. GnuPG interprets the drive-letter colon
+ as a resource-URL scheme at this option boundary. Both runners failed closed with `No public key`;
+ no unverified archive was extracted or executed.
+- Oracle proved: the preceding fixture, shebang, checkout-byte, and filesystem-mode corrections are
+ green on both native Windows architectures; exact release inputs are downloadable; the production
+ signature gate executes and prevents unverified bytes from progressing. The identical x64/arm64
+ failure isolates command-path representation rather than architecture-specific cryptography.
+- Does not prove: successful Windows signature verification, archive/header/import-library
+ extraction, offline `node-gyp`, native compilation, bundled Node/ConPTY/watcher execution, ZIP
+ output or determinism, native trust/signing, oldest baseline, SSH, or any enabled tuple.
+- Checklist items satisfied: Windows contract-test portability and fail-closed signed-input behavior
+ only. No Windows build, executable, archive, or artifact cell is checked.
+- Follow-up: run both GPG commands in the exclusive verified-copy directory with cwd-relative paths,
+ assert the command boundary never receives an absolute drive-letter path, and rerun both native
+ architectures before any broader Windows correction.
+
+### E-M3-WINDOWS-GPG-PATH-RED-001 — Relative verified-copy command boundary red gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted purpose-named regression test on exact head
+ `b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
+- Remote and transport: none; mocked child-process command boundary only
+- Exact command:
+ `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-release-verification.test.mjs`
+- Result: expected FAIL; one new test failed and seven existing tests passed in 163 ms. The failure
+ diff showed absolute temporary paths passed to both `gpg --output` and `gpgv --keyring`, while the
+ required oracle expected cwd-relative verified-copy names and a common exclusive working directory.
+- Oracle proved: the regression test discriminates the exact command representation rejected by Git
+ for Windows in E-M3-WINDOWS-CI-RED-003 without weakening signature/fingerprint validation.
+- Does not prove: real GPG execution, Windows compatibility, successful signature verification,
+ archive extraction/build/smoke, or any tuple support.
+- Checklist items satisfied: red half of the Windows GPG path-portability correction only.
+- Follow-up: add cwd support to the bounded command runner, pass only explicit relative verified-copy
+ names, rerun this focused suite, and require native x64/arm64 CI before claiming the correction.
+
+### E-M3-WINDOWS-GPG-PATH-LOCAL-001 — Relative verified-copy command boundary correction
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted correction on exact base
+ `b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. The repository requires Node 24, so
+ exact-head draft-PR CI remains authoritative.
+- Remote and transport: none; mocked GPG command-boundary regression plus local contract/static
+ checks
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
+ git diff --check
+ ```
+
+- Result: PASS. The focused signature suite passed 8/8 tests in 151 ms; all seven artifact suites
+ passed 22/22 tests in 313 ms. Typecheck, full oxlint, max-lines ratchet, full
+ lint/reliability/localization gates, plan formatting, and diff whitespace passed. Oxlint reported
+ only existing warnings outside this package; full lint used `GOMAXPROCS=2` for the previously
+ recorded external Go linter stability constraint.
+- Oracle proved: both GPG invocations share the exclusive verified-copy directory as their cwd and
+ receive only explicit `./` paths for the key, keyring, checksum, and signature; existing hash,
+ command-failure, and exact-fingerprint tests remain green.
+- Does not prove: real GPG execution, Git for Windows compatibility, Node 24 support, Windows native
+ build/smoke, archive output, or any tuple support.
+- Checklist items satisfied: local green half of the path-portability correction only. Native CI is
+ still mandatory before the E-M3-WINDOWS-CI-RED-003 failure is considered corrected.
+- Follow-up: run the exact correction on Windows x64/arm64 and all four POSIX artifact jobs, then
+ record any next discriminating native boundary without broadening this work package.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
From 42aa02fa9eccf81e40d80f87461ddd232a1cda1f Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:24:00 -0400
Subject: [PATCH 011/267] docs(ssh): record Windows GPG path gate
Co-authored-by: Orca
---
...-github-release-implementation-checklist.md | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index c892768c251..35c08e48eef 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -59,11 +59,13 @@ same change as the work it records.
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
- corrections are at exact head `b387ac48cda70b60a5a148c03ce740f9afedf9cb` in stacked draft PR
- [#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures pass all seven
- contract suites, then fail closed before extraction/build because Git for Windows `gpgv` rejects
- an absolute drive-letter keyring path (E-M3-WINDOWS-CI-RED-003). It may produce test artifacts but
- must not publish, resolve, transfer, install, launch, or enable them.
+ corrections are implemented through `b6903b220` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures passed all seven
+ contract suites at the preceding head, then failed closed before extraction/build because Git for
+ Windows `gpgv` rejected an absolute drive-letter keyring path (E-M3-WINDOWS-CI-RED-003). The
+ cwd-relative correction is locally green under E-M3-WINDOWS-GPG-PATH-LOCAL-001 and awaits native
+ CI. This package may produce test artifacts but must not publish, resolve, transfer, install,
+ launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -2641,8 +2643,8 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-GPG-PATH-RED-001 — Relative verified-copy command boundary red gate
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted purpose-named regression test on exact head
- `b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
+- Commit SHA / PR: red test introduced before its implementation in correction commit
+ `b6903b220`; exact base `b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
- Remote and transport: none; mocked child-process command boundary only
@@ -2662,7 +2664,7 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-GPG-PATH-LOCAL-001 — Relative verified-copy command boundary correction
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted correction on exact base
+- Commit SHA / PR: implementation commit `b6903b220` on exact base
`b387ac48cda70b60a5a148c03ce740f9afedf9cb`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. The repository requires Node 24, so
From 3aab5aff8cc8fe83788ed9d12755af72ea44d437 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:36:28 -0400
Subject: [PATCH 012/267] test(ssh): preserve runtime smoke failure details
Co-authored-by: Orca
---
.../ssh-relay-runtime-artifact.test.mjs | 24 ++-
config/scripts/verify-ssh-relay-runtime.mjs | 45 ++++-
...github-release-implementation-checklist.md | 184 +++++++++++++++---
3 files changed, 219 insertions(+), 34 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-artifact.test.mjs b/config/scripts/ssh-relay-runtime-artifact.test.mjs
index d09198ed799..e13ae1be529 100644
--- a/config/scripts/ssh-relay-runtime-artifact.test.mjs
+++ b/config/scripts/ssh-relay-runtime-artifact.test.mjs
@@ -10,7 +10,10 @@ import {
inspectSshRelayRuntimeArchive
} from './ssh-relay-runtime-archive.mjs'
import { computeSshRelayRuntimeContentId } from './ssh-relay-runtime-identity.mjs'
-import { verifyRuntimeTree } from './verify-ssh-relay-runtime.mjs'
+import {
+ formatSshRelayRuntimeSmokeFailure,
+ verifyRuntimeTree
+} from './verify-ssh-relay-runtime.mjs'
const temporaryDirectories = []
afterEach(async () => {
@@ -179,6 +182,25 @@ describe('SSH relay runtime artifact', () => {
}
})
+ it('preserves bounded bundled-smoke child failure diagnostics', () => {
+ const message = formatSshRelayRuntimeSmokeFailure({
+ code: 'ETIMEDOUT',
+ killed: true,
+ signal: 'SIGTERM',
+ message: 'Command timed out',
+ stdout: 'partial smoke output',
+ stderr: `${'x'.repeat(70 * 1024)}Bundled runtime smoke failed: watcher create exceeded 15000 ms`
+ })
+
+ expect(message).toContain('timeoutMs=45000')
+ expect(message).toContain('code="ETIMEDOUT"')
+ expect(message).toContain('killed=true')
+ expect(message).toContain('signal="SIGTERM"')
+ expect(message).toContain('partial smoke output')
+ expect(message).toContain('truncated')
+ expect(message).toContain('watcher create exceeded 15000 ms')
+ })
+
it.skipIf(process.platform === 'win32')(
'creates deterministic archives and rehashes every entry',
async () => {
diff --git a/config/scripts/verify-ssh-relay-runtime.mjs b/config/scripts/verify-ssh-relay-runtime.mjs
index 5179d0fc034..f849367cbba 100644
--- a/config/scripts/verify-ssh-relay-runtime.mjs
+++ b/config/scripts/verify-ssh-relay-runtime.mjs
@@ -10,6 +10,31 @@ import { computeSshRelayRuntimeContentId } from './ssh-relay-runtime-identity.mj
const execFileAsync = promisify(execFile)
const scriptDirectory = import.meta.dirname
const MAX_SMOKE_OUTPUT_BYTES = 4 * 1024 * 1024
+const MAX_SMOKE_FAILURE_DETAIL_BYTES = 64 * 1024
+const SMOKE_TIMEOUT_MS = 45_000
+
+function boundedSshRelayRuntimeSmokeDetail(value) {
+ const text = typeof value === 'string' ? value : Buffer.isBuffer(value) ? value.toString() : ''
+ const bytes = Buffer.from(text)
+ if (bytes.length <= MAX_SMOKE_FAILURE_DETAIL_BYTES) {
+ return text
+ }
+ const retained = bytes.subarray(bytes.length - MAX_SMOKE_FAILURE_DETAIL_BYTES).toString()
+ return `[truncated ${bytes.length - MAX_SMOKE_FAILURE_DETAIL_BYTES} bytes]\n${retained}`
+}
+
+export function formatSshRelayRuntimeSmokeFailure(error) {
+ return [
+ 'Bundled runtime smoke command failed:',
+ `timeoutMs=${SMOKE_TIMEOUT_MS}`,
+ `code=${JSON.stringify(error?.code ?? null)}`,
+ `killed=${JSON.stringify(error?.killed ?? false)}`,
+ `signal=${JSON.stringify(error?.signal ?? null)}`,
+ `message=${JSON.stringify(error?.message ?? String(error))}`,
+ `stdout=${JSON.stringify(boundedSshRelayRuntimeSmokeDetail(error?.stdout))}`,
+ `stderr=${JSON.stringify(boundedSshRelayRuntimeSmokeDetail(error?.stderr))}`
+ ].join(' ')
+}
function parseArguments(argv) {
const result = {}
@@ -110,13 +135,19 @@ export async function verifyRuntimeTree(runtimeDirectory, identity) {
async function runBundledSmoke(runtimeDirectory, identity) {
const nodePath = join(runtimeDirectory, 'bin', identity.os === 'win32' ? 'node.exe' : 'node')
const childPath = resolve(scriptDirectory, 'ssh-relay-runtime-smoke-child.cjs')
- const result = await execFileAsync(nodePath, [childPath, runtimeDirectory], {
- cwd: runtimeDirectory,
- encoding: 'utf8',
- maxBuffer: MAX_SMOKE_OUTPUT_BYTES,
- timeout: 45_000,
- windowsHide: true
- })
+ let result
+ try {
+ result = await execFileAsync(nodePath, [childPath, runtimeDirectory], {
+ cwd: runtimeDirectory,
+ encoding: 'utf8',
+ maxBuffer: MAX_SMOKE_OUTPUT_BYTES,
+ timeout: SMOKE_TIMEOUT_MS,
+ windowsHide: true
+ })
+ } catch (error) {
+ // The child classifies PTY/watcher failures; retain its bounded tail to avoid blind CI retries.
+ throw new Error(formatSshRelayRuntimeSmokeFailure(error), { cause: error })
+ }
const smoke = JSON.parse(result.stdout)
if (smoke.nodeVersion !== `v${identity.nodeVersion}`) {
throw new Error(`Bundled smoke used unexpected Node version: ${smoke.nodeVersion}`)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 35c08e48eef..37907dcd5e9 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows contract tests are native-runner green but signature-tool path portability, runtime/ZIP, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows signed-input verification and runtime/ZIP assembly reach native smoke on both architectures, but bounded smoke diagnostics/execution, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -61,11 +61,11 @@ same change as the work it records.
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
corrections are implemented through `b6903b220` in stacked draft PR
[#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures passed all seven
- contract suites at the preceding head, then failed closed before extraction/build because Git for
- Windows `gpgv` rejected an absolute drive-letter keyring path (E-M3-WINDOWS-CI-RED-003). The
- cwd-relative correction is locally green under E-M3-WINDOWS-GPG-PATH-LOCAL-001 and awaits native
- CI. This package may produce test artifacts but must not publish, resolve, transfer, install,
- launch, or enable them.
+ contract suites, exact signed-input verification, native compilation, and bounded runtime/ZIP
+ assembly at exact CI head `42aa02fa9` (E-M3-WINDOWS-CI-RED-004). Both then time out during the
+ bundled smoke, while the parent currently suppresses bounded child stderr needed to classify the
+ failing PTY or watcher substage. This package may produce test artifacts but must not publish,
+ resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -90,7 +90,10 @@ same change as the work it records.
Windows shebang parsing, authenticated-key checkout bytes, and POSIX-only mode assertions. At the
corrected exact head, E-M3-WINDOWS-CI-RED-003 proves 20 passing and one intentionally skipped test
on each native architecture, exact input download, and a common fail-closed Git-for-Windows
- `gpgv` drive-letter keyring incompatibility. No Windows executable evidence is claimed.
+ `gpgv` drive-letter keyring incompatibility. E-M3-WINDOWS-CI-RED-004 proves that correction with
+ 21 passing and one intentionally skipped test, signed input acceptance, native compilation, and
+ runtime/ZIP assembly on each architecture; both 45-second bundled smoke commands then time out
+ without propagating their already bounded child stderr. No Windows executable cell is claimed.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -103,13 +106,12 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: pass only cwd-relative verified-copy paths to `gpg`/`gpgv`, add a
- discriminating command-boundary regression test, and collect exact Windows x64/arm64 plus POSIX
- regression evidence from the corrected draft-PR head. A
- same-head/same-runner clean-rebuild identity oracle for native build reproducibility remains a
- separate open gate. Keep cross-family remote infrastructure, signing/trust, and measured legacy
- baseline gates open; do not introduce publication, resolver, transfer, rollout, tuple enablement,
- or default behavior.
+- Next required action: preserve the smoke command's bounded stdout/stderr and timeout metadata in
+ the parent failure, add a discriminating diagnostic test, and rerun Windows x64 first to classify
+ the PTY/watcher failure before changing smoke behavior. A same-head/same-runner clean-rebuild
+ identity oracle for native build reproducibility remains a separate open gate. Keep cross-family
+ remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
+ publication, resolver, transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -2709,6 +2711,136 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: run the exact correction on Windows x64/arm64 and all four POSIX artifact jobs, then
record any next discriminating native boundary without broadening this work package.
+### E-M3-WINDOWS-CI-RED-004 — Native Windows assembly reached an opaque bounded smoke timeout
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `42aa02fa9eccf81e40d80f87461ddd232a1cda1f`, containing
+ implementation commit `b6903b220`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run: [SSH Relay Runtime Artifacts 29340686444](https://github.com/stablyai/orca/actions/runs/29340686444),
+ conclusion `failure`; all four POSIX regression jobs passed and uploaded only unpublished
+ seven-day Actions artifacts.
+- Native Windows jobs:
+ - x64 job `87111302431`: `windows-2022`, resolved `win22` image `20260706.237.1`, GitHub-hosted
+ X64, Windows Server 2022 Datacenter build 20348, Node v24.18.0; failed after 4m37s.
+ - arm64 job `87111302486`: `windows-11-arm`, resolved `win11-arm64` image `20260706.102.1`,
+ GitHub-hosted ARM64, Windows 10 Enterprise build 26200, Node v24.18.0; failed after 7m9s.
+- Remote and transport: no SSH remote. Exact inputs came from `nodejs.org/dist/v24.18.0`; no release
+ publication or Windows artifact upload occurred.
+- Exact commands:
+
+ ```sh
+ gh run view 29340686444 --repo stablyai/orca \
+ --json databaseId,headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87111302431/logs | \
+ rg -n -C 25 "SSH relay runtime verification failed|durationMs|contentId|Process completed with exit code"
+ gh api repos/stablyai/orca/actions/jobs/87111302486/logs | \
+ rg -n -C 25 "SSH relay runtime verification failed|durationMs|contentId|Process completed with exit code"
+ gh api --paginate repos/stablyai/orca/actions/runs/29340686444/artifacts
+ ```
+
+- Result: FAIL at the native bundled smoke on both architectures. Each runner passed all seven
+ contract suites with 21 passing and one intentionally skipped test, authenticated the exact Node
+ checksum/signature plus ZIP/headers/import library, compiled the patched native modules, assembled
+ and reinspected a 60-entry/42-file deterministic-format ZIP, and entered verification's smoke only
+ after archive/tree integrity checks. X64 produced a 37,212,065-byte ZIP expanding to 97,248,414
+ bytes, content ID `90823b2c6bf7dad748a4399fe74fdfa8be82ef4a00d727e3a6be173f274fd43f`,
+ archive SHA-256 `ee7634dea179026b3ba8232294016d939e32edc34e1fd3697dd9e11722285d6a`,
+ and 146,511.617 ms build duration. Arm64 produced a 33,261,531-byte ZIP expanding to 86,189,740
+ bytes, content ID `09ec2772bb8c47ee240fd226963b7e251a8060e7f84321cb24d2668bf993e2ca`,
+ archive SHA-256 `5cb50521ec88d491f1a4183fc13f0b0f688e242e290038c4d34e0125d8e8b2c2`,
+ and 176,108.728 ms build duration.
+- Failure boundary: each bundled-Node smoke exceeded the parent command's 45-second timeout. The
+ child already bounds PTY and watcher waits at 15 seconds and writes its classified failure to
+ stderr, but `verify-ssh-relay-runtime.mjs` currently reports only the generic `execFile` stack.
+ The logs therefore cannot distinguish PTY, watcher, cleanup-handle, or combined failure. Upload
+ remained skipped. Smoke RSS, channel/file counts, and cancellation settlement were not emitted.
+- Oracle proved: the GPG relative-path correction works through real Git-for-Windows GPG on native
+ x64 and arm64; signed-input gating, offline native build inputs, patched native compilation,
+ bundled Node v24.18.0 staging, ZIP construction/inspection, and pre-execution archive/tree gates
+ all precede the failing smoke. The four POSIX jobs remain green on the exact same source head.
+- Does not prove: successful Windows PTY/ConPTY/watcher execution, which smoke substage failed,
+ prompt child-process settlement, ZIP clean-rebuild identity, durable Windows artifact bytes,
+ native trust/signing, oldest baseline, SSH, or any enabled tuple.
+- Checklist items satisfied: native GPG path portability and pre-smoke Windows assembly progression
+ only. Windows per-tuple cells remain unchecked because executable smoke and artifact retention did
+ not pass.
+- Follow-up: preserve bounded child stdout, stderr, timeout, exit, and signal details in the parent
+ diagnostic; add a failure-path unit test; rerun x64 first and change no PTY/watcher behavior until
+ the classified child failure is visible.
+
+### E-M3-WINDOWS-SMOKE-DIAGNOSTIC-RED-001 — Bounded child-detail propagation red gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted purpose-named regression test on exact head
+ `42aa02fa9eccf81e40d80f87461ddd232a1cda1f`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
+- Remote and transport: none; synthetic child-process error object only
+- Exact command:
+ `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-artifact.test.mjs`
+- Result: expected FAIL; the new diagnostic test failed and three existing tests passed in 239 ms
+ because `formatSshRelayRuntimeSmokeFailure` did not exist. The required oracle supplies timeout,
+ exit/signal state, partial stdout, and a greater-than-limit stderr whose final classified failure
+ must survive explicit truncation.
+- Oracle proved: existing parent diagnostics cannot satisfy the bounded failure-detail contract and
+ the new test discriminates both missing metadata and unbounded/error-tail-losing implementations.
+- Does not prove: child execution, Windows behavior, the actual PTY/watcher failure, cleanup
+ settlement, or any tuple support.
+- Checklist items satisfied: red half of the smoke-diagnostic correction only.
+- Follow-up: implement a 64-KiB tail-preserving formatter around the already 4-MiB-bounded child
+ process, wrap `execFile` failure with it, and rerun focused/static gates before native x64 CI.
+
+### E-M3-WINDOWS-SMOKE-DIAGNOSTIC-LOCAL-001 — Bounded child-detail propagation correction
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted correction on exact base
+ `42aa02fa9eccf81e40d80f87461ddd232a1cda1f`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Exact-head Node 24 CI remains
+ authoritative.
+- Remote and transport: none; synthetic child-process error plus local artifact contracts
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/verify-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs
+ pnpm exec oxlint
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
+ git diff --check
+ ```
+
+- Result: PASS. The focused artifact suite passed 4/4 tests in 194 ms; all seven artifact suites
+ passed 23/23 tests in 293 ms. Typecheck, focused and full oxlint, max-lines ratchet, full
+ lint/reliability/localization gates, plan formatting, and diff whitespace passed. Full lint
+ reported only existing warnings outside this package and used the recorded `GOMAXPROCS=2`
+ stability constraint.
+- Oracle proved: any failed bundled-smoke child now propagates the declared 45-second parent timeout,
+ exit code, kill state, signal, message, stdout, and stderr; each stream retains at most its final
+ 64 KiB with an explicit omitted-byte count. The real command remains capped at 4 MiB and no
+ success-path parsing or smoke behavior changed.
+- Does not prove: real child failure propagation on Windows, which PTY/watcher stage fails,
+ process-tree settlement after timeout, successful native smoke, or any tuple support.
+- Checklist items satisfied: local green half of the bounded smoke-diagnostic correction only.
+- Follow-up: rerun native Windows x64, capture the classified child tail, and make no execution-path
+ change until that evidence identifies the actual failure.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
@@ -2944,18 +3076,18 @@ or unexpected token`; the first logs did not identify a source location.
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime/zip builder absent | Windows targets remain entirely on the legacy path | POSIX proof cannot establish Windows behavior | Codex implementation owner | Bounded deterministic zip, Node/native build, signing, smoke, and live gates | Open |
-| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native candidate ZIPs build, but smoke fails before artifact retention | Pre-smoke proof cannot establish relay behavior | Codex implementation owner | Classified passing PTY/watcher smoke, reproducibility, trust, and live gates | Open |
+| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
From df661e370102b9b66c26f4c708e641abef0aa1ae Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:36:47 -0400
Subject: [PATCH 013/267] docs(ssh): record Windows smoke timeout gate
Co-authored-by: Orca
---
...14-ssh-relay-github-release-implementation-checklist.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 37907dcd5e9..5be5d9a25cc 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -59,7 +59,8 @@ same change as the work it records.
deploy/resolver call site is connected and no tuple is enabled.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
- corrections are implemented through `b6903b220` in stacked draft PR
+ corrections are implemented through `b6903b220`, with bounded smoke diagnostics in `3aab5aff8`,
+ in stacked draft PR
[#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures passed all seven
contract suites, exact signed-input verification, native compilation, and bounded runtime/ZIP
assembly at exact CI head `42aa02fa9` (E-M3-WINDOWS-CI-RED-004). Both then time out during the
@@ -2772,7 +2773,7 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-SMOKE-DIAGNOSTIC-RED-001 — Bounded child-detail propagation red gate
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted purpose-named regression test on exact head
+- Commit SHA / PR: red test introduced before its implementation in `3aab5aff8`; exact base
`42aa02fa9eccf81e40d80f87461ddd232a1cda1f`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
@@ -2794,7 +2795,7 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-SMOKE-DIAGNOSTIC-LOCAL-001 — Bounded child-detail propagation correction
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted correction on exact base
+- Commit SHA / PR: implementation commit `3aab5aff8` on exact base
`42aa02fa9eccf81e40d80f87461ddd232a1cda1f`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Exact-head Node 24 CI remains
From ddf28eb8dba3ade4806082cfc5edd6526389cf94 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:52:54 -0400
Subject: [PATCH 014/267] test(ssh): settle Windows runtime PTY smoke
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 2 +
.../scripts/ssh-relay-runtime-pty-smoke.cjs | 127 +++++++++++++
.../ssh-relay-runtime-pty-smoke.test.mjs | 91 ++++++++++
.../scripts/ssh-relay-runtime-smoke-child.cjs | 97 +---------
.../ssh-relay-runtime-workflow.test.mjs | 1 +
...github-release-implementation-checklist.md | 168 ++++++++++++++++--
6 files changed, 381 insertions(+), 105 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-pty-smoke.cjs
create mode 100644 config/scripts/ssh-relay-runtime-pty-smoke.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 1c0b2b51349..731fe04f550 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -108,6 +108,7 @@ jobs:
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
config/scripts/ssh-relay-runtime-zip.test.mjs \
config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -249,6 +250,7 @@ jobs:
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
config/scripts/ssh-relay-runtime-zip.test.mjs `
config/scripts/ssh-relay-runtime-workflow.test.mjs
diff --git a/config/scripts/ssh-relay-runtime-pty-smoke.cjs b/config/scripts/ssh-relay-runtime-pty-smoke.cjs
new file mode 100644
index 00000000000..411e66242e7
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-pty-smoke.cjs
@@ -0,0 +1,127 @@
+'use strict'
+
+function deadline(label, timeoutMs) {
+ let timeout
+ const promise = new Promise((_, reject) => {
+ timeout = setTimeout(() => reject(new Error(`${label} exceeded ${timeoutMs} ms`)), timeoutMs)
+ })
+ return { promise, cancel: () => clearTimeout(timeout) }
+}
+
+async function runSshRelayRuntimePtySmoke({
+ nodePty,
+ runtimeRequire,
+ runtimeRoot,
+ platform = process.platform,
+ environment = process.env,
+ timeoutMs = 15_000
+}) {
+ const windows = platform === 'win32'
+ const executable = windows
+ ? 'powershell.exe'
+ : environment.SHELL && environment.SHELL.startsWith('/')
+ ? environment.SHELL
+ : '/bin/sh'
+ const arguments_ = windows
+ ? [
+ '-NoLogo',
+ '-NoProfile',
+ '-Command',
+ "$ErrorActionPreference='Stop';" +
+ '[Console]::OutputEncoding=[Text.UTF8Encoding]::new($false);' +
+ "Write-Output 'ORCA_PTY_READY';" +
+ '$line=[Console]::ReadLine();' +
+ '$size=$Host.UI.RawUI.WindowSize;' +
+ 'Write-Output ("ORCA_PTY_SIZE:{0}x{1}" -f $size.Width,$size.Height);' +
+ 'Write-Output ("ORCA_PTY_INPUT:{0}" -f $line);' +
+ 'exit 23'
+ ]
+ : [
+ '-c',
+ 'printf "ORCA_PTY_READY\\n"; IFS= read -r line; stty size; printf "ORCA_PTY_INPUT:%s\\n" "$line"; exit 23'
+ ]
+ const terminal = nodePty.spawn(executable, arguments_, {
+ name: 'xterm-256color',
+ cols: 80,
+ rows: 24,
+ cwd: runtimeRoot,
+ env: environment,
+ useConpty: windows,
+ // Why: the relay uses the bundled ConPTY runtime to preserve terminal rendering behavior.
+ useConptyDll: windows
+ })
+ let output = ''
+ let wroteInput = false
+ const outputSubscription = terminal.onData((data) => {
+ output += data
+ if (!wroteInput && output.includes('ORCA_PTY_READY')) {
+ wroteInput = true
+ terminal.resize(101, 37)
+ terminal.write('bounded-marker\r')
+ }
+ })
+ let exitSubscription
+ let limitSubscription
+ const exited = new Promise((resolve, reject) => {
+ exitSubscription = terminal.onExit(resolve)
+ limitSubscription = terminal.onData(() => {
+ if (output.length > 1024 * 1024) {
+ reject(new Error('PTY smoke output exceeded 1 MiB'))
+ }
+ })
+ })
+ const timer = deadline('PTY smoke', timeoutMs)
+ let result
+ let cleanupStarted = false
+ function settlePtyResources() {
+ if (cleanupStarted) {
+ return
+ }
+ cleanupStarted = true
+ try {
+ outputSubscription.dispose()
+ exitSubscription.dispose()
+ limitSubscription.dispose()
+ } finally {
+ if (!result || windows) {
+ // Why: node-pty retains its Windows ConPTY worker handles after process exit until kill().
+ terminal.kill()
+ }
+ }
+ }
+ try {
+ result = await Promise.race([exited, timer.promise])
+ if (
+ result.exitCode !== 23 ||
+ !output.includes('ORCA_PTY_INPUT:bounded-marker') ||
+ !output.includes(windows ? 'ORCA_PTY_SIZE:101x37' : '37 101')
+ ) {
+ throw new Error(
+ `PTY smoke mismatch: exit=${result.exitCode} output=${JSON.stringify(output)}`
+ )
+ }
+ const { loadNativeModule } = runtimeRequire('node-pty/lib/utils')
+ const nativeNames = windows ? ['conpty', 'conpty_console_list'] : ['pty']
+ const nativeDirectories = nativeNames.map((name) => loadNativeModule(name).dir)
+ if (
+ nativeDirectories.some(
+ (directory) => !directory.replaceAll('\\', '/').includes('build/Release/')
+ )
+ ) {
+ throw new Error(
+ `node-pty did not load patched build/Release artifacts: ${nativeDirectories.join(', ')}`
+ )
+ }
+ return {
+ exitCode: result.exitCode,
+ resizedRows: 37,
+ resizedColumns: 101,
+ nativeDirectory: nativeDirectories.join(', ')
+ }
+ } finally {
+ timer.cancel()
+ settlePtyResources()
+ }
+}
+
+module.exports = { runSshRelayRuntimePtySmoke }
diff --git a/config/scripts/ssh-relay-runtime-pty-smoke.test.mjs b/config/scripts/ssh-relay-runtime-pty-smoke.test.mjs
new file mode 100644
index 00000000000..bd0d375f14f
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-pty-smoke.test.mjs
@@ -0,0 +1,91 @@
+import { createRequire } from 'node:module'
+
+import { describe, expect, it, vi } from 'vitest'
+
+const require = createRequire(import.meta.url)
+const { runSshRelayRuntimePtySmoke } = require('./ssh-relay-runtime-pty-smoke.cjs')
+
+function successfulTerminalFixture({ windows }) {
+ const dataListeners = []
+ const exitListeners = []
+ const subscriptions = []
+ const terminal = {
+ kill: vi.fn(),
+ resize: vi.fn(),
+ write: vi.fn(),
+ onData: vi.fn((listener) => {
+ dataListeners.push(listener)
+ const subscription = { dispose: vi.fn() }
+ subscriptions.push(subscription)
+ return subscription
+ }),
+ onExit: vi.fn((listener) => {
+ exitListeners.push(listener)
+ const subscription = { dispose: vi.fn() }
+ subscriptions.push(subscription)
+ return subscription
+ })
+ }
+ const nodePty = {
+ spawn: vi.fn(() => {
+ queueMicrotask(() => {
+ const output = windows
+ ? 'ORCA_PTY_READY\r\nORCA_PTY_SIZE:101x37\r\nORCA_PTY_INPUT:bounded-marker\r\n'
+ : 'ORCA_PTY_READY\n37 101\nORCA_PTY_INPUT:bounded-marker\n'
+ dataListeners.forEach((listener) => listener(output))
+ exitListeners.forEach((listener) => listener({ exitCode: 23, signal: 0 }))
+ })
+ return terminal
+ })
+ }
+ return { nodePty, subscriptions, terminal }
+}
+
+function runtimeRequire() {
+ return {
+ loadNativeModule: () => ({ dir: '../build/Release/' })
+ }
+}
+
+describe('SSH relay runtime PTY smoke lifecycle', () => {
+ it('releases successful Windows ConPTY resources after validating the exit', async () => {
+ const fixture = successfulTerminalFixture({ windows: true })
+
+ await expect(
+ runSshRelayRuntimePtySmoke({
+ nodePty: fixture.nodePty,
+ runtimeRequire,
+ runtimeRoot: 'C:\\runtime',
+ platform: 'win32',
+ environment: {},
+ timeoutMs: 100
+ })
+ ).resolves.toMatchObject({ exitCode: 23, resizedColumns: 101, resizedRows: 37 })
+
+ expect(fixture.terminal.kill).toHaveBeenCalledOnce()
+ expect(fixture.subscriptions).toHaveLength(3)
+ fixture.subscriptions.forEach((subscription) => {
+ expect(subscription.dispose).toHaveBeenCalledOnce()
+ })
+ })
+
+ it('disposes successful POSIX listeners without killing an exited terminal', async () => {
+ const fixture = successfulTerminalFixture({ windows: false })
+
+ await expect(
+ runSshRelayRuntimePtySmoke({
+ nodePty: fixture.nodePty,
+ runtimeRequire,
+ runtimeRoot: '/runtime',
+ platform: 'linux',
+ environment: { SHELL: '/bin/sh' },
+ timeoutMs: 100
+ })
+ ).resolves.toMatchObject({ exitCode: 23, resizedColumns: 101, resizedRows: 37 })
+
+ expect(fixture.terminal.kill).not.toHaveBeenCalled()
+ fixture.subscriptions.forEach((subscription) => {
+ expect(subscription.dispose).toHaveBeenCalledOnce()
+ })
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-smoke-child.cjs b/config/scripts/ssh-relay-runtime-smoke-child.cjs
index 75e20e61415..b092b793905 100644
--- a/config/scripts/ssh-relay-runtime-smoke-child.cjs
+++ b/config/scripts/ssh-relay-runtime-smoke-child.cjs
@@ -5,6 +5,8 @@ const { tmpdir } = require('node:os')
const { join } = require('node:path')
const { createRequire } = require('node:module')
+const { runSshRelayRuntimePtySmoke } = require('./ssh-relay-runtime-pty-smoke.cjs')
+
const runtimeRoot = process.argv[2]
if (!runtimeRoot) {
throw new Error('runtime root argument is required')
@@ -22,96 +24,6 @@ function deadline(label) {
return { promise, cancel: () => clearTimeout(timeout) }
}
-async function ptySmoke() {
- const windows = process.platform === 'win32'
- const executable = windows
- ? 'powershell.exe'
- : process.env.SHELL && process.env.SHELL.startsWith('/')
- ? process.env.SHELL
- : '/bin/sh'
- const arguments_ = windows
- ? [
- '-NoLogo',
- '-NoProfile',
- '-Command',
- "$ErrorActionPreference='Stop';" +
- '[Console]::OutputEncoding=[Text.UTF8Encoding]::new($false);' +
- "Write-Output 'ORCA_PTY_READY';" +
- '$line=[Console]::ReadLine();' +
- '$size=$Host.UI.RawUI.WindowSize;' +
- 'Write-Output ("ORCA_PTY_SIZE:{0}x{1}" -f $size.Width,$size.Height);' +
- 'Write-Output ("ORCA_PTY_INPUT:{0}" -f $line);' +
- 'exit 23'
- ]
- : [
- '-c',
- 'printf "ORCA_PTY_READY\\n"; IFS= read -r line; stty size; printf "ORCA_PTY_INPUT:%s\\n" "$line"; exit 23'
- ]
- const terminal = nodePty.spawn(executable, arguments_, {
- name: 'xterm-256color',
- cols: 80,
- rows: 24,
- cwd: runtimeRoot,
- env: process.env,
- useConpty: windows,
- // Why: the relay uses the bundled ConPTY runtime to preserve terminal rendering behavior.
- useConptyDll: windows
- })
- let output = ''
- let wroteInput = false
- terminal.onData((data) => {
- output += data
- if (!wroteInput && output.includes('ORCA_PTY_READY')) {
- wroteInput = true
- terminal.resize(101, 37)
- terminal.write('bounded-marker\r')
- }
- })
- const exited = new Promise((resolve, reject) => {
- terminal.onExit(resolve)
- terminal.onData(() => {
- if (output.length > 1024 * 1024) {
- reject(new Error('PTY smoke output exceeded 1 MiB'))
- }
- })
- })
- const timer = deadline('PTY smoke')
- let result
- try {
- result = await Promise.race([exited, timer.promise])
- } finally {
- timer.cancel()
- if (!result) {
- terminal.kill()
- }
- }
- if (
- result.exitCode !== 23 ||
- !output.includes('ORCA_PTY_INPUT:bounded-marker') ||
- !output.includes(windows ? 'ORCA_PTY_SIZE:101x37' : '37 101')
- ) {
- throw new Error(`PTY smoke mismatch: exit=${result.exitCode} output=${JSON.stringify(output)}`)
- }
- const { loadNativeModule } = runtimeRequire('node-pty/lib/utils')
- const nativeNames = windows ? ['conpty', 'conpty_console_list'] : ['pty']
- const nativeDirectories = nativeNames.map((name) => loadNativeModule(name).dir)
- if (
- nativeDirectories.some(
- (directory) => !directory.replaceAll('\\', '/').includes('build/Release/')
- )
- ) {
- throw new Error(
- `node-pty did not load patched build/Release artifacts: ${nativeDirectories.join(', ')}`
- )
- }
- return {
- exitCode: result.exitCode,
- resizedRows: 37,
- resizedColumns: 101,
- nativeDirectory: nativeDirectories.join(', ')
- }
-}
-
async function waitFor(events, predicate, label) {
const timer = deadline(label)
try {
@@ -177,7 +89,10 @@ async function watcherSmoke() {
async function main() {
const started = process.hrtime.bigint()
- const [pty, watched] = await Promise.all([ptySmoke(), watcherSmoke()])
+ const [pty, watched] = await Promise.all([
+ runSshRelayRuntimePtySmoke({ nodePty, runtimeRequire, runtimeRoot }),
+ watcherSmoke()
+ ])
const durationMs = Number(process.hrtime.bigint() - started) / 1e6
process.stdout.write(
`${JSON.stringify({ nodeVersion: process.version, modulesAbi: process.versions.modules, pty, watcher: watched, durationMs, rssBytes: process.memoryUsage().rss })}\n`
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 4ef61105223..53e3362df21 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -59,6 +59,7 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('cp "$output"/*.tar.xz')
expect(source).toContain("Get-ChildItem -LiteralPath $output -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
+ expect(source).toContain('ssh-relay-runtime-pty-smoke.test.mjs')
expect(source).toContain('ssh-relay-runtime-zip.test.mjs')
expect(source).toContain('node-v24.18.0-headers.tar.gz')
expect(source).toContain('node_library: win-x64/node.lib')
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 5be5d9a25cc..d83e11de41e 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — four POSIX native-runner artifact builds are CI-green; Windows signed-input verification and runtime/ZIP assembly reach native smoke on both architectures, but bounded smoke diagnostics/execution, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — correct prompt Windows PTY smoke-process settlement after functionally successful native x64 and arm64 execution; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -61,12 +61,15 @@ same change as the work it records.
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
corrections are implemented through `b6903b220`, with bounded smoke diagnostics in `3aab5aff8`,
in stacked draft PR
- [#8741](https://github.com/stablyai/orca/pull/8741). Both native architectures passed all seven
- contract suites, exact signed-input verification, native compilation, and bounded runtime/ZIP
- assembly at exact CI head `42aa02fa9` (E-M3-WINDOWS-CI-RED-004). Both then time out during the
- bundled smoke, while the parent currently suppresses bounded child stderr needed to classify the
- failing PTY or watcher substage. This package may produce test artifacts but must not publish,
- resolve, transfer, install, launch, or enable them.
+ [#8741](https://github.com/stablyai/orca/pull/8741). Exact-head run
+ [29341643555](https://github.com/stablyai/orca/actions/runs/29341643555) proves the bundled Node,
+ patched PTY input/resize/exit, and watcher lifecycle complete on x64 in 3,357.413 ms with
+ 56,905,728-byte RSS and arm64 in 6,593.663 ms with 54,505,472-byte RSS, but each child retains a
+ Windows handle until the parent kills it at its 45-second bound. The active slice is a
+ discriminating PTY-listener/terminal-cleanup contract followed by explicit prompt ConPTY
+ settlement; the injected lifecycle contract and repository static gates are locally green, while
+ exact-head native execution remains mandatory. This package may produce test artifacts but must
+ not publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -578,6 +581,11 @@ archive inspection, bundled-Node/native-module/PTY/watcher smoke, SBOM, and prov
behind purpose-named scripts and CI artifacts. No release publication, desktop resolver, SSH
transfer, install, fallback, rollout setting, or tuple enablement belongs in this package.
+**Active sub-gate — 2026-07-14, Codex implementation owner:** the discriminating lifecycle test and
+explicit listener/ConPTY cleanup are locally green without `process.exit()` or a weakened 45-second
+bound. Exact-head native x64/arm64 CI must now prove normal child settlement and artifact retention;
+the prior common failure is run 29341643555/jobs 87114639412 and 87114639449.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1231,6 +1239,7 @@ focused commands as their scripts/tests are introduced.
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive linux-x64-glibc` (E-M3-NODE-PROVENANCE-001; metadata and archive verification only)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-zip-inspection.test.mjs config/scripts/ssh-relay-runtime-zip.test.mjs` (E-M3-WINDOWS-ZIP-RED-001, E-M3-WINDOWS-INPUT-001; synthetic ZIP/input contracts only)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-windows-tree.test.mjs` (E-M3-WINDOWS-LOCAL-002; structural Windows ConPTY closure only, no execution)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs` (E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001; native evidence remains pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -2842,6 +2851,136 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: rerun native Windows x64, capture the classified child tail, and make no execution-path
change until that evidence identifies the actual failure.
+### E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-001 — Native Windows smoke succeeds but does not settle
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `df661e370102b9b66c26f4c708e641abef0aa1ae`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runners and jobs: GitHub Actions run
+ [29341643555](https://github.com/stablyai/orca/actions/runs/29341643555); Windows x64 job
+ [87114639412](https://github.com/stablyai/orca/actions/runs/29341643555/job/87114639412),
+ `windows-2022` image `20260706.237.1`, Windows Server 2022 10.0.20348, native x64, Node
+ v24.18.0; Windows arm64 job
+ [87114639449](https://github.com/stablyai/orca/actions/runs/29341643555/job/87114639449),
+ `windows-11-arm64` image `20260706.102.1`, Windows 11 Enterprise 10.0.26200, native arm64,
+ Node v24.18.0
+- Remote and transport: no SSH remote; target-native artifact build and bundled-runtime execution
+ on the hosted runner; exact signed inputs downloaded from pinned nodejs.org URLs
+- Exact command:
+
+ ```sh
+ gh api repos/stablyai/orca/actions/jobs/87114639412/logs | \
+ rg -n -C 16 'Bundled runtime smoke command failed|timeoutMs=|Image:|Version:'
+ gh api repos/stablyai/orca/actions/jobs/87114639449/logs | \
+ rg -n -C 16 'Bundled runtime smoke command failed|timeoutMs=|Image:|Version:'
+ ```
+
+- Result: expected discriminating FAIL. The exact signed inputs, offline native build, archive and
+ complete-tree verification all passed. Bundled Node v24.18.0/ABI 137 then completed the patched
+ ConPTY smoke with exit 23, 101×37 resize, input marker, and both native modules loaded from
+ `build/Release`; watcher create, update, rename-as-delete/create, and delete also completed. The
+ x64 child emitted valid JSON after 3,357.413 ms with 56,905,728-byte RSS; arm64 emitted the same
+ functional result after 6,593.663 ms with 54,505,472-byte RSS. Both remained alive until the
+ parent killed them at 45 seconds (`code=null`, `killed=true`, `signal="SIGTERM"`, empty stderr).
+- Artifact metrics: x64 content ID
+ `sha256:8cf9eb4e04459e25d710a28235a57e777d39f65168841c2408ab658243a21d94`; ZIP
+ 37,212,068 bytes with SHA-256
+ `sha256:11f83971ed20cde7be41aa2f753cfd4350cd4a70a3fe46a27540ebc872c4ca56`; build
+ 151,226.208 ms. Arm64 content ID
+ `sha256:dda60b6237b320c74236f57bece072d0f847479eb322f43f22c829daf2ce9bf6`; ZIP
+ 33,261,533 bytes with SHA-256
+ `sha256:f3fefed7b959fb6c3945170e8f0f7d2766cf26240aef9928b0e25770e5b19a26`; 86,189,740
+ expanded bytes; build 248,307.259 ms. Uploads remained skipped because prompt process settlement
+ is part of executable proof.
+- Oracle proved: Windows x64 and arm64 PTY/ConPTY and watcher functionality succeeds through each
+ exact bundled runtime, and the common remaining failure occurs after successful JSON emission in
+ child-process handle settlement rather than in PTY, watcher, archive, or tree validation.
+- Does not prove: prompt cleanup, durable artifact upload, clean-rebuild identity, native
+ trust/signing, oldest baseline, SSH, or any enabled tuple. Both per-tuple rows remain unchecked
+ until the child exits normally and exact-head CI retains each artifact.
+- Follow-up: retain and dispose the PTY listener subscriptions, call the supported Windows terminal
+ cleanup after a validated successful exit, and prove normal child settlement without
+ `process.exit()` on both native architectures.
+
+### E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001 — PTY lifecycle cleanup contract red gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted contract test and behavior-preserving PTY-smoke module extraction on
+ exact base `df661e370102b9b66c26f4c708e641abef0aa1ae`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0
+- Remote and transport: none; injected terminal/listener lifecycle only
+- Exact command:
+ `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs`
+- Result: expected FAIL in 122 ms. The Windows success case returned a valid exit result but called
+ `terminal.kill()` zero times; the POSIX success case and Windows case both disposed zero of their
+ three `onData`/`onExit` subscriptions. Two tests failed, with no timeout or synthetic forced exit.
+- Oracle proved: the current success path lacks the exact listener and ConPTY cleanup operations
+ required by the native x64 diagnostic, and the purpose-named suite distinguishes Windows-only
+ terminal cleanup from platform-neutral listener disposal.
+- Does not prove: the green implementation, actual Windows handle release, timeout/error cleanup,
+ full child-process settlement, arm64 behavior, or any tuple support.
+- Checklist items satisfied: red half of the Windows PTY smoke-settlement correction only.
+- Follow-up: add idempotent finally cleanup, preserve successful POSIX no-kill behavior, rerun this
+ suite and all artifact/static gates, then require exact-head native Windows CI.
+
+### E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001 — Explicit PTY resource settlement
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted implementation on exact base
+ `df661e370102b9b66c26f4c708e641abef0aa1ae`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Exact-head Node 24 native CI remains
+ authoritative.
+- Remote and transport: none; injected terminal lifecycle plus local source/static verification
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-runtime-smoke-child.cjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.cjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-smoke-child.cjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.cjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. The lifecycle suite passed 2/2 tests in 117 ms; the eight artifact suites passed
+ 25/25 tests in 417 ms. Typecheck, focused oxlint, max-lines ratchet, full
+ lint/reliability/localization checks, formatting, and diff whitespace passed. Full lint reported
+ only pre-existing warnings outside this package.
+- Oracle proved: the success path retains and disposes both data subscriptions and the exit
+ subscription exactly once; a validated Windows exit additionally calls the supported node-pty
+ terminal cleanup exactly once, while a successful POSIX exit does not kill its terminal. Cleanup
+ is in `finally`, the existing timeout/error path still kills the terminal, and no `process.exit()`
+ was introduced. Both native workflow families now run the lifecycle contract.
+- Does not prove: actual Windows ConPTY handle release, prompt bundled child-process exit, exact-head
+ Node 24 behavior, artifact retention, clean-rebuild identity, native trust, oldest baseline, SSH,
+ or any enabled tuple. Both Windows per-tuple cells remain unchecked.
+- Checklist items satisfied: local green half of the PTY smoke-settlement correction and its
+ purpose-named verification-command inventory only.
+- Follow-up: commit and push the isolated correction, run both target-native Windows jobs at the
+ exact head, and require normal smoke completion plus artifact upload before advancing.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
@@ -3081,7 +3220,7 @@ owner and promotion condition.
| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native candidate ZIPs build, but smoke fails before artifact retention | Pre-smoke proof cannot establish relay behavior | Codex implementation owner | Classified passing PTY/watcher smoke, reproducibility, trust, and live gates | Open |
+| Windows runtime smoke incomplete | Both native smokes work but prior children hung; local cleanup awaits CI | No prompt settlement or retained artifact proof | Codex implementation owner | Exact-head clean exit/upload, reproducibility, trust, and live gates | Open |
| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
@@ -3129,9 +3268,10 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Implement bounded deterministic Windows ZIP/native assembly as its own evidence-gated slice, add
-native Windows x64/arm64 jobs without publishing assets, and add a same-head/same-runner clean-build
-identity comparison for native reproducibility. The cross-family Layer B target pool, protected
-manifest-signing environment, and paired legacy performance baseline remain release/default-path
-blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta, fallback, tuple
-enablement, or default behavior may be connected by this package.
+Commit and push the isolated PTY smoke-settlement correction, then require exact-head Windows
+x64/arm64 jobs to exit normally and upload their unpublished evidence artifacts. If both pass, record
+their exact hashes, sizes, smoke/build durations, RSS, runner images, and residual gaps before the
+separate same-head/same-runner clean-build identity gate. The cross-family Layer B target pool,
+protected manifest-signing environment, and paired legacy performance baseline remain
+release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
+Beta, fallback, tuple enablement, or default behavior may be connected by this package.
From b6291e55b1781b4c4e6f46a4965152f4a0d2334f Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 10:53:50 -0400
Subject: [PATCH 015/267] docs(ssh): record Windows smoke settlement gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 48 +++++++++----------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index d83e11de41e..511dc8fa70b 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -60,7 +60,7 @@ same change as the work it records.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
corrections are implemented through `b6903b220`, with bounded smoke diagnostics in `3aab5aff8`,
- in stacked draft PR
+ and explicit PTY smoke settlement in `ddf28eb8d`, in stacked draft PR
[#8741](https://github.com/stablyai/orca/pull/8741). Exact-head run
[29341643555](https://github.com/stablyai/orca/actions/runs/29341643555) proves the bundled Node,
patched PTY input/resize/exit, and watcher lifecycle complete on x64 in 3,357.413 ms with
@@ -1182,16 +1182,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; four POSIX jobs green; Windows active | `151628992`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-RED-001, E-M3-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows settlement CI pending | `ddf28eb8d`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -2927,8 +2927,8 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001 — Explicit PTY resource settlement
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted implementation on exact base
- `df661e370102b9b66c26f4c708e641abef0aa1ae`; draft PR
+- Commit SHA / PR: implementation commit
+ `ddf28eb8dba3ade4806082cfc5edd6526389cf94`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Exact-head Node 24 native CI remains
authoritative.
@@ -3216,18 +3216,18 @@ or unexpected token`; the first logs did not identify a source location.
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ------------------------------------------------------------------------ | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Both native smokes work but prior children hung; local cleanup awaits CI | No prompt settlement or retained artifact proof | Codex implementation owner | Exact-head clean exit/upload, reproducibility, trust, and live gates | Open |
-| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
From 6bba900209543a53b7673ca12173159d40d9fc87 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:05:09 -0400
Subject: [PATCH 016/267] test(ssh): classify lingering Windows smoke resources
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 2 +
...ssh-relay-runtime-resource-diagnostics.cjs | 33 ++++
...elay-runtime-resource-diagnostics.test.mjs | 45 +++++
.../scripts/ssh-relay-runtime-smoke-child.cjs | 4 +-
.../ssh-relay-runtime-workflow.test.mjs | 1 +
...github-release-implementation-checklist.md | 173 ++++++++++++++----
6 files changed, 220 insertions(+), 38 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-resource-diagnostics.cjs
create mode 100644 config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 731fe04f550..f310da29fd5 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -109,6 +109,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
config/scripts/ssh-relay-runtime-zip.test.mjs \
config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -251,6 +252,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
config/scripts/ssh-relay-runtime-zip.test.mjs `
config/scripts/ssh-relay-runtime-workflow.test.mjs
diff --git a/config/scripts/ssh-relay-runtime-resource-diagnostics.cjs b/config/scripts/ssh-relay-runtime-resource-diagnostics.cjs
new file mode 100644
index 00000000000..2b23d03ff5a
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-resource-diagnostics.cjs
@@ -0,0 +1,33 @@
+'use strict'
+
+const DEFAULT_OBSERVATION_MS = 2_000
+const MAX_RESOURCE_TYPES = 256
+
+function boundedActiveResources(getActiveResourcesInfo) {
+ const resources = getActiveResourcesInfo().map((resource) => String(resource).slice(0, 128))
+ return {
+ types: resources.slice(0, MAX_RESOURCE_TYPES),
+ omitted: Math.max(0, resources.length - MAX_RESOURCE_TYPES)
+ }
+}
+
+async function observeWindowsResourceSettlement({
+ platform = process.platform,
+ getActiveResourcesInfo = () => process.getActiveResourcesInfo(),
+ delay = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)),
+ observationMs = DEFAULT_OBSERVATION_MS
+} = {}) {
+ if (platform !== 'win32') {
+ return null
+ }
+ const immediatelyAfterSmoke = boundedActiveResources(getActiveResourcesInfo)
+ // Why: ConPTY cleanup is delayed for output draining; observe only resources that survive it.
+ await delay(observationMs)
+ return {
+ observationMs,
+ immediatelyAfterSmoke,
+ afterObservation: boundedActiveResources(getActiveResourcesInfo)
+ }
+}
+
+module.exports = { observeWindowsResourceSettlement }
diff --git a/config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs b/config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs
new file mode 100644
index 00000000000..cc19e35b508
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs
@@ -0,0 +1,45 @@
+import { createRequire } from 'node:module'
+
+import { describe, expect, it, vi } from 'vitest'
+
+const require = createRequire(import.meta.url)
+const { observeWindowsResourceSettlement } = require('./ssh-relay-runtime-resource-diagnostics.cjs')
+
+describe('SSH relay runtime resource diagnostics', () => {
+ it('observes bounded Windows resources after the cleanup drain interval', async () => {
+ const delay = vi.fn(async () => {})
+ const getActiveResourcesInfo = vi
+ .fn()
+ .mockReturnValueOnce(['PipeWrap', 'Worker', ...Array.from({ length: 300 }, () => 'Timeout')])
+ .mockReturnValueOnce(['PipeWrap', 'Worker'])
+
+ await expect(
+ observeWindowsResourceSettlement({
+ platform: 'win32',
+ getActiveResourcesInfo,
+ delay,
+ observationMs: 2_000
+ })
+ ).resolves.toEqual({
+ observationMs: 2_000,
+ immediatelyAfterSmoke: {
+ types: ['PipeWrap', 'Worker', ...Array.from({ length: 254 }, () => 'Timeout')],
+ omitted: 46
+ },
+ afterObservation: { types: ['PipeWrap', 'Worker'], omitted: 0 }
+ })
+ expect(delay).toHaveBeenCalledOnce()
+ expect(delay).toHaveBeenCalledWith(2_000)
+ })
+
+ it('does not add an observation delay to successful POSIX smoke', async () => {
+ const delay = vi.fn(async () => {})
+ const getActiveResourcesInfo = vi.fn(() => ['PipeWrap'])
+
+ await expect(
+ observeWindowsResourceSettlement({ platform: 'linux', getActiveResourcesInfo, delay })
+ ).resolves.toBeNull()
+ expect(delay).not.toHaveBeenCalled()
+ expect(getActiveResourcesInfo).not.toHaveBeenCalled()
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-smoke-child.cjs b/config/scripts/ssh-relay-runtime-smoke-child.cjs
index b092b793905..77ad0247169 100644
--- a/config/scripts/ssh-relay-runtime-smoke-child.cjs
+++ b/config/scripts/ssh-relay-runtime-smoke-child.cjs
@@ -6,6 +6,7 @@ const { join } = require('node:path')
const { createRequire } = require('node:module')
const { runSshRelayRuntimePtySmoke } = require('./ssh-relay-runtime-pty-smoke.cjs')
+const { observeWindowsResourceSettlement } = require('./ssh-relay-runtime-resource-diagnostics.cjs')
const runtimeRoot = process.argv[2]
if (!runtimeRoot) {
@@ -93,9 +94,10 @@ async function main() {
runSshRelayRuntimePtySmoke({ nodePty, runtimeRequire, runtimeRoot }),
watcherSmoke()
])
+ const resourceSettlement = await observeWindowsResourceSettlement()
const durationMs = Number(process.hrtime.bigint() - started) / 1e6
process.stdout.write(
- `${JSON.stringify({ nodeVersion: process.version, modulesAbi: process.versions.modules, pty, watcher: watched, durationMs, rssBytes: process.memoryUsage().rss })}\n`
+ `${JSON.stringify({ nodeVersion: process.version, modulesAbi: process.versions.modules, pty, watcher: watched, resourceSettlement, durationMs, rssBytes: process.memoryUsage().rss })}\n`
)
}
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 53e3362df21..3fc07e0ff8d 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -60,6 +60,7 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain("Get-ChildItem -LiteralPath $output -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
expect(source).toContain('ssh-relay-runtime-pty-smoke.test.mjs')
+ expect(source).toContain('ssh-relay-runtime-resource-diagnostics.test.mjs')
expect(source).toContain('ssh-relay-runtime-zip.test.mjs')
expect(source).toContain('node-v24.18.0-headers.tar.gz')
expect(source).toContain('node_library: win-x64/node.lib')
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 511dc8fa70b..9bb1c183b94 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — correct prompt Windows PTY smoke-process settlement after functionally successful native x64 and arm64 execution; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — classify the Windows resource retained after explicit PTY listener/terminal cleanup still failed to settle functionally successful native x64 and arm64 children; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -67,9 +67,10 @@ same change as the work it records.
56,905,728-byte RSS and arm64 in 6,593.663 ms with 54,505,472-byte RSS, but each child retains a
Windows handle until the parent kills it at its 45-second bound. The active slice is a
discriminating PTY-listener/terminal-cleanup contract followed by explicit prompt ConPTY
- settlement; the injected lifecycle contract and repository static gates are locally green, while
- exact-head native execution remains mandatory. This package may produce test artifacts but must
- not publish, resolve, transfer, install, launch, or enable them.
+ settlement; the injected lifecycle contract and repository static gates are locally green, but
+ exact-head run 29342918504 proves the native x64 child still retains an unclassified resource
+ after valid JSON. This package may produce test artifacts but must not publish, resolve, transfer,
+ install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -581,10 +582,11 @@ archive inspection, bundled-Node/native-module/PTY/watcher smoke, SBOM, and prov
behind purpose-named scripts and CI artifacts. No release publication, desktop resolver, SSH
transfer, install, fallback, rollout setting, or tuple enablement belongs in this package.
-**Active sub-gate — 2026-07-14, Codex implementation owner:** the discriminating lifecycle test and
-explicit listener/ConPTY cleanup are locally green without `process.exit()` or a weakened 45-second
-bound. Exact-head native x64/arm64 CI must now prove normal child settlement and artifact retention;
-the prior common failure is run 29341643555/jobs 87114639412 and 87114639449.
+**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head x64 run
+29342918504/job 87119092333 still timed out after functional smoke despite explicit PTY cleanup;
+arm64 job 87119092293 reproduced it. Add bounded post-smoke active-resource diagnostics before any
+second behavioral change, preserving the existing 45-second parent bound and avoiding
+`process.exit()`.
Each runtime must contain only the executable closure required by the relay.
@@ -1182,16 +1184,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows settlement CI pending | `ddf28eb8d`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-STATIC-001, E-M3-CI-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; resource diagnostic pending | `ddf28eb8d`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-002 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1240,6 +1242,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-zip-inspection.test.mjs config/scripts/ssh-relay-runtime-zip.test.mjs` (E-M3-WINDOWS-ZIP-RED-001, E-M3-WINDOWS-INPUT-001; synthetic ZIP/input contracts only)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-windows-tree.test.mjs` (E-M3-WINDOWS-LOCAL-002; structural Windows ConPTY closure only, no execution)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs` (E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001; native evidence remains pending)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs` (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001; native classification pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -2981,6 +2984,102 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: commit and push the isolated correction, run both target-native Windows jobs at the
exact head, and require normal smoke completion plus artifact upload before advancing.
+### E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-002 — Explicit PTY cleanup is insufficient on native x64
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `b6291e55b1781b4c4e6f46a4965152f4a0d2334f`, containing
+ PTY settlement implementation `ddf28eb8dba3ade4806082cfc5edd6526389cf94`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runners and jobs: GitHub Actions run
+ [29342918504](https://github.com/stablyai/orca/actions/runs/29342918504); Windows x64 job
+ [87119092333](https://github.com/stablyai/orca/actions/runs/29342918504/job/87119092333),
+ `windows-2022` native x64 with Node v24.18.0; Windows arm64 job
+ [87119092293](https://github.com/stablyai/orca/actions/runs/29342918504/job/87119092293),
+ `windows-11-arm64` native arm64 with Node v24.18.0
+- Remote and transport: no SSH remote; target-native artifact build and bundled-runtime execution
+- Exact commands:
+ `gh api repos/stablyai/orca/actions/jobs/87119092333/logs | rg -n -C 20 'SSH relay runtime verification failed|timeoutMs=|durationMs|rssBytes|contentId'` and the same command for job `87119092293`
+- Result: expected discriminating FAIL. The new 25/25 contract suite passed, followed by signed
+ inputs, offline native compilation, archive/tree inspection, and functional bundled smoke. The
+ child emitted PTY exit 23, 101×37 resize, input, patched native paths, all watcher events, and
+ valid JSON in 3,344.690 ms with 59,699,200-byte RSS, then again remained alive until the parent
+ killed it at 45 seconds with empty stderr. ZIP size was 37,212,067 bytes, content ID
+ `sha256:68a49782761c411494e677be9c2dc5038fb4f85f066316edc7b92ee25a3c3fbd`, archive SHA-256
+ `sha256:11688158da540cdfa1e10e5f632dac7487adf61e600e46d3fb0303fa42fc15b6`, and build duration
+ 139,167.307 ms. Artifact upload remained skipped.
+- Arm64 result: the same valid PTY/watcher JSON arrived in 3,772.018 ms with 54,095,872-byte RSS,
+ followed by the identical 45-second timeout and empty stderr. ZIP size was 33,261,534 bytes,
+ content ID `sha256:cff683eba32500f95d4a1a87d8f8a8eaf06613753b75d8eff55ccce23a0160c6`, archive
+ SHA-256 `sha256:12640e6003547cf94f6ab13c6fdecb6373254b724fb561aa38023a3d33b5fa17`, and build
+ duration 155,781.418 ms. Upload remained skipped.
+- Oracle proved: disposing all public PTY subscriptions and calling public Windows terminal cleanup
+ after validated exit does not by itself settle the bundled child. The failure remains post-smoke
+ and is not a PTY/watcher functional failure, but the retained resource type is still unknown.
+- Does not prove: which PTY worker/socket, watcher, stdio, timer, or other resource remains; safe
+ dependency-level remediation; normal child exit; artifact retention; or any tuple.
+- Checklist items satisfied: none beyond a new native red boundary; Windows rows remain unchecked.
+- Follow-up: emit bounded `process.getActiveResourcesInfo()` data after all smoke cleanup, retain it
+ through the existing parent diagnostic, and make no further cleanup change until the resource
+ class is visible on native Windows.
+
+### E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001 — Bounded post-cleanup resource observation
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted diagnostic implementation on exact base
+ `b6291e55b1781b4c4e6f46a4965152f4a0d2334f`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Native Windows classification remains
+ authoritative.
+- Remote and transport: none; injected public active-resource lists plus local source/static gates
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-resource-diagnostics.cjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-smoke-child.cjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.cjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-smoke-child.cjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. The resource/PTY/workflow slice passed 6/6 tests in 173 ms; all nine artifact
+ suites passed 27/27 tests in 297 ms. Typecheck, focused oxlint, max-lines, full
+ lint/reliability/localization, formatting, and whitespace gates passed with only existing
+ out-of-package lint warnings.
+- Oracle proved: Windows diagnostics use the public `process.getActiveResourcesInfo()` API, retain
+ only at most 256 resource type strings capped at 128 characters, report omitted counts, and take
+ snapshots immediately after all functional cleanup and after a two-second drain window. POSIX
+ smoke receives neither the delay nor a resource probe. Both native workflow families run the
+ contract.
+- Does not prove: the actual retained native Windows resource types, whether the culprit is PTY or
+ watcher state, safe cleanup, normal child exit, artifact retention, or any tuple.
+- Checklist items satisfied: bounded local diagnostic contract and verification-command inventory
+ only; no behavior, matrix, or tuple item.
+- Follow-up: commit and push the diagnostic, capture both native Windows snapshots through the
+ existing 45-second failure formatter, then change only the resource owner identified by evidence.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
@@ -3216,18 +3315,18 @@ or unexpected token`; the first logs did not identify a source location.
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ------------------------------------------------------------------------ | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Both native smokes work but prior children hung; local cleanup awaits CI | No prompt settlement or retained artifact proof | Codex implementation owner | Exact-head clean exit/upload, reproducibility, trust, and live gates | Open |
-| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native smokes work; public PTY cleanup still hangs; diagnostic is local | No prompt settlement or retained artifact proof | Codex implementation owner | Classify resource, then clean exit/upload, reproducibility/trust/live gates | Open |
+| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -3268,10 +3367,10 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit and push the isolated PTY smoke-settlement correction, then require exact-head Windows
-x64/arm64 jobs to exit normally and upload their unpublished evidence artifacts. If both pass, record
-their exact hashes, sizes, smoke/build durations, RSS, runner images, and residual gaps before the
-separate same-head/same-runner clean-build identity gate. The cross-family Layer B target pool,
-protected manifest-signing environment, and paired legacy performance baseline remain
-release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
-Beta, fallback, tuple enablement, or default behavior may be connected by this package.
+Commit and push the bounded post-smoke resource diagnostic, then capture both native Windows
+resource snapshots through the existing parent timeout without making another cleanup change. Use
+that evidence to isolate the owning subsystem before requiring exact-head normal exit and artifact
+upload. The separate clean-build identity gate, cross-family Layer B target pool, protected
+manifest-signing environment, and paired legacy performance baseline remain release/default-path
+blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta, fallback, tuple
+enablement, or default behavior may be connected by this package.
From 2aaea70465dc80ced2ba4662b5bc1475a9c2f8c5 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:05:43 -0400
Subject: [PATCH 017/267] docs(ssh): record Windows resource diagnostic gate
Co-authored-by: Orca
---
...14-ssh-relay-github-release-implementation-checklist.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 9bb1c183b94..43b05c3aeee 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -60,7 +60,8 @@ same change as the work it records.
- Active package: Work Package 2 target-native runtime assembly, archive inspection, executable
smoke, SBOM, and provenance only. The Windows x64/arm64 artifact candidate and portability
corrections are implemented through `b6903b220`, with bounded smoke diagnostics in `3aab5aff8`,
- and explicit PTY smoke settlement in `ddf28eb8d`, in stacked draft PR
+ explicit PTY smoke settlement in `ddf28eb8d`, and bounded active-resource diagnostics in
+ `6bba90020`, in stacked draft PR
[#8741](https://github.com/stablyai/orca/pull/8741). Exact-head run
[29341643555](https://github.com/stablyai/orca/actions/runs/29341643555) proves the bundled Node,
patched PTY input/resize/exit, and watcher lifecycle complete on x64 in 3,357.413 ms with
@@ -3025,8 +3026,8 @@ or unexpected token`; the first logs did not identify a source location.
### E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001 — Bounded post-cleanup resource observation
- Date: 2026-07-14
-- Commit SHA / PR: uncommitted diagnostic implementation on exact base
- `b6291e55b1781b4c4e6f46a4965152f4a0d2334f`; draft PR
+- Commit SHA / PR: diagnostic implementation commit
+ `6bba900209543a53b7673ca12173159d40d9fc87`; draft PR
[#8741](https://github.com/stablyai/orca/pull/8741)
- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Native Windows classification remains
authoritative.
From c04b4f63002a75b969d9d0317f563693cf6ab4f8 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:20:42 -0400
Subject: [PATCH 018/267] fix(ssh): settle copied Windows ConPTY worker
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 2 +
config/scripts/ssh-relay-node-pty-build.mjs | 6 +
.../ssh-relay-node-pty-windows-settlement.mjs | 32 +++++
...relay-node-pty-windows-settlement.test.mjs | 101 +++++++++++++++
...github-release-implementation-checklist.md | 121 +++++++++++++-----
5 files changed, 233 insertions(+), 29 deletions(-)
create mode 100644 config/scripts/ssh-relay-node-pty-windows-settlement.mjs
create mode 100644 config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index f310da29fd5..f0d4dc9aee2 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -106,6 +106,7 @@ jobs:
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
@@ -249,6 +250,7 @@ jobs:
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs `
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index a405d0618dd..2d8bd2b3bfb 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -4,6 +4,8 @@ import { createRequire } from 'node:module'
import { dirname, join, resolve } from 'node:path'
import { promisify } from 'node:util'
+import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-settlement.mjs'
+
const require = createRequire(import.meta.url)
const execFileAsync = promisify(execFile)
const NODE_GYP_PATH = require.resolve('node-gyp/bin/node-gyp.js')
@@ -132,6 +134,10 @@ export async function buildPatchedSshRelayNodePty({
dereference: true,
filter: sourceFilter
})
+ await applyWindowsNodePtySettlement({
+ nodePtyLibraryDirectory: join(buildDirectory, 'lib'),
+ tuple
+ })
await mkdir(join(buildDirectory, 'node_modules'), { recursive: true })
await cp(NODE_ADDON_API_DIRECTORY, join(buildDirectory, 'node_modules', 'node-addon-api'), {
recursive: true,
diff --git a/config/scripts/ssh-relay-node-pty-windows-settlement.mjs b/config/scripts/ssh-relay-node-pty-windows-settlement.mjs
new file mode 100644
index 00000000000..cf3a7751545
--- /dev/null
+++ b/config/scripts/ssh-relay-node-pty-windows-settlement.mjs
@@ -0,0 +1,32 @@
+import { readFile, writeFile } from 'node:fs/promises'
+import { join } from 'node:path'
+
+const conptyDllKillSequence = ` this._ptyNative.kill(this._pty, this._useConptyDll);
+ this._outSocket.on('data', function () {
+ _this._conoutSocketWorker.dispose();
+ });`
+
+const settledConptyDllKillSequence = ` this._ptyNative.kill(this._pty, this._useConptyDll);
+ // Why: quiet ConPTY output cannot retrigger disposal, so start its bounded drain now.
+ this._conoutSocketWorker.dispose();
+ this._outSocket.on('data', function () {
+ _this._conoutSocketWorker.dispose();
+ });`
+
+export async function applyWindowsNodePtySettlement({ nodePtyLibraryDirectory, tuple }) {
+ if (!tuple.startsWith('win32-')) {
+ return { applied: false }
+ }
+
+ const agentPath = join(nodePtyLibraryDirectory, 'windowsPtyAgent.js')
+ const source = await readFile(agentPath, 'utf8')
+ const matchCount = source.split(conptyDllKillSequence).length - 1
+ if (matchCount !== 1) {
+ throw new Error(
+ `expected exactly one DLL-mode ConPTY worker settlement sequence; found ${matchCount}`
+ )
+ }
+
+ await writeFile(agentPath, source.replace(conptyDllKillSequence, settledConptyDllKillSequence))
+ return { applied: true }
+}
diff --git a/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs b/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
new file mode 100644
index 00000000000..5dfb808668f
--- /dev/null
+++ b/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
@@ -0,0 +1,101 @@
+import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { createRequire } from 'node:module'
+import { tmpdir } from 'node:os'
+import { dirname, join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-settlement.mjs'
+
+const require = createRequire(import.meta.url)
+const temporaryDirectories = []
+const conptyDllKillSequence = ` this._ptyNative.kill(this._pty, this._useConptyDll);
+ this._outSocket.on('data', function () {
+ _this._conoutSocketWorker.dispose();
+ });`
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+async function createNodePtyFixture(source = conptyDllKillSequence) {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-settlement-'))
+ temporaryDirectories.push(directory)
+ const agentPath = join(directory, 'windowsPtyAgent.js')
+ await writeFile(agentPath, source)
+ return { agentPath, directory }
+}
+
+describe('SSH relay copied node-pty Windows settlement', () => {
+ it('starts ConPTY worker disposal before waiting for more output', async () => {
+ const nodePtyDirectory = dirname(require.resolve('node-pty/package.json'))
+ const fixture = await createNodePtyFixture(
+ await readFile(join(nodePtyDirectory, 'lib', 'windowsPtyAgent.js'), 'utf8')
+ )
+
+ await applyWindowsNodePtySettlement({
+ nodePtyLibraryDirectory: fixture.directory,
+ tuple: 'win32-x64'
+ })
+
+ expect(await readFile(fixture.agentPath, 'utf8')).toContain(
+ ` this._ptyNative.kill(this._pty, this._useConptyDll);
+ // Why: quiet ConPTY output cannot retrigger disposal, so start its bounded drain now.
+ this._conoutSocketWorker.dispose();
+ this._outSocket.on('data', function () {`
+ )
+ })
+
+ it('does not inspect or modify a POSIX node-pty copy', async () => {
+ const missingDirectory = join(tmpdir(), 'orca-node-pty-posix-does-not-exist')
+
+ await expect(
+ applyWindowsNodePtySettlement({
+ nodePtyLibraryDirectory: missingDirectory,
+ tuple: 'linux-x64-glibc'
+ })
+ ).resolves.toEqual({ applied: false })
+ })
+
+ it('rejects source drift without modifying the copied agent', async () => {
+ const source = conptyDllKillSequence.replace(
+ "this._outSocket.on('data'",
+ "this._outSocket.once('data'"
+ )
+ const fixture = await createNodePtyFixture(source)
+
+ await expect(
+ applyWindowsNodePtySettlement({
+ nodePtyLibraryDirectory: fixture.directory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow('expected exactly one DLL-mode ConPTY worker settlement sequence; found 0')
+ await expect(readFile(fixture.agentPath, 'utf8')).resolves.toBe(source)
+ })
+
+ it('rejects duplicate source matches without modifying the copied agent', async () => {
+ const source = `${conptyDllKillSequence}\n${conptyDllKillSequence}`
+ const fixture = await createNodePtyFixture(source)
+
+ await expect(
+ applyWindowsNodePtySettlement({
+ nodePtyLibraryDirectory: fixture.directory,
+ tuple: 'win32-x64'
+ })
+ ).rejects.toThrow('expected exactly one DLL-mode ConPTY worker settlement sequence; found 2')
+ await expect(readFile(fixture.agentPath, 'utf8')).resolves.toBe(source)
+ })
+
+ it('is wired after node-pty is copied into exclusive artifact staging', async () => {
+ const buildSource = await readFile(
+ new URL('./ssh-relay-node-pty-build.mjs', import.meta.url),
+ 'utf8'
+ )
+ const copyIndex = buildSource.indexOf('await cp(sourceDirectory, buildDirectory')
+ const settlementIndex = buildSource.indexOf('await applyWindowsNodePtySettlement({')
+
+ expect(copyIndex).toBeGreaterThan(-1)
+ expect(settlementIndex).toBeGreaterThan(copyIndex)
+ expect(buildSource.slice(copyIndex, settlementIndex)).not.toContain('node-gyp')
+ })
+})
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 43b05c3aeee..340d44093b0 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — classify the Windows resource retained after explicit PTY listener/terminal cleanup still failed to settle functionally successful native x64 and arm64 children; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — add a fail-closed, runtime-artifact-only correction for the ConPTY worker `MessagePort` retained after functionally successful native Windows x64 and arm64 smoke; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -66,12 +66,15 @@ same change as the work it records.
[29341643555](https://github.com/stablyai/orca/actions/runs/29341643555) proves the bundled Node,
patched PTY input/resize/exit, and watcher lifecycle complete on x64 in 3,357.413 ms with
56,905,728-byte RSS and arm64 in 6,593.663 ms with 54,505,472-byte RSS, but each child retains a
- Windows handle until the parent kills it at its 45-second bound. The active slice is a
- discriminating PTY-listener/terminal-cleanup contract followed by explicit prompt ConPTY
- settlement; the injected lifecycle contract and repository static gates are locally green, but
- exact-head run 29342918504 proves the native x64 child still retains an unclassified resource
- after valid JSON. This package may produce test artifacts but must not publish, resolve, transfer,
- install, launch, or enable them.
+ Windows handle until the parent kills it at its 45-second bound. Exact-head run
+ [29343816558](https://github.com/stablyai/orca/actions/runs/29343816558) now classifies the resource
+ on both native architectures: after all public PTY cleanup and a two-second observation window,
+ one `MessagePort` remains alongside only the expected parent stdio `PipeWrap` resources
+ (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001). The active slice is an exact-source, fail-closed
+ correction applied only to the copied node-pty Windows JavaScript inside runtime artifact
+ staging; the repository-wide node-pty patch and legacy/default desktop path must remain unchanged.
+ This package may produce test artifacts but must not publish, resolve, transfer, install, launch,
+ or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -99,7 +102,11 @@ same change as the work it records.
`gpgv` drive-letter keyring incompatibility. E-M3-WINDOWS-CI-RED-004 proves that correction with
21 passing and one intentionally skipped test, signed input acceptance, native compilation, and
runtime/ZIP assembly on each architecture; both 45-second bundled smoke commands then time out
- without propagating their already bounded child stderr. No Windows executable cell is claimed.
+ without propagating their already bounded child stderr. E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-001
+ and E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-002 then proved functional PTY/watcher smoke still did not
+ settle after public listener and terminal cleanup. E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001
+ identifies the persistent native resource as one `MessagePort` on both x64 and arm64 after a
+ two-second drain window. No Windows executable cell is claimed.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -112,11 +119,13 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: preserve the smoke command's bounded stdout/stderr and timeout metadata in
- the parent failure, add a discriminating diagnostic test, and rerun Windows x64 first to classify
- the PTY/watcher failure before changing smoke behavior. A same-head/same-runner clean-rebuild
- identity oracle for native build reproducibility remains a separate open gate. Keep cross-family
- remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
+- Next required action: prove the copied node-pty Windows runtime closure owns the persistent
+ `MessagePort`, add a discriminating source-drift-rejecting test, and apply the narrow correction
+ only after node-pty is copied into exclusive artifact staging. Rerun both exact-head native
+ Windows jobs and require normal child exit, no persistent `MessagePort` after observation, and
+ unpublished artifact upload before claiming either executable cell. A same-head/same-runner
+ clean-rebuild identity oracle remains a separate next gate. Keep cross-family remote
+ infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
publication, resolver, transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -583,11 +592,12 @@ archive inspection, bundled-Node/native-module/PTY/watcher smoke, SBOM, and prov
behind purpose-named scripts and CI artifacts. No release publication, desktop resolver, SSH
transfer, install, fallback, rollout setting, or tuple enablement belongs in this package.
-**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head x64 run
-29342918504/job 87119092333 still timed out after functional smoke despite explicit PTY cleanup;
-arm64 job 87119092293 reproduced it. Add bounded post-smoke active-resource diagnostics before any
-second behavioral change, preserving the existing 45-second parent bound and avoiding
-`process.exit()`.
+**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head run 29343816558 identifies
+one persistent `MessagePort` on native Windows x64 and arm64 after functional PTY/watcher smoke,
+public PTY cleanup, and a two-second observation window. Prove and correct the copied ConPTY worker
+lifecycle inside artifact staging only, rejecting missing, duplicated, or drifted source; preserve
+the repository-wide node-pty patch, legacy/default desktop path, 45-second parent bound, and the
+prohibition on `process.exit()`.
Each runtime must contain only the executable closure required by the relay.
@@ -1185,16 +1195,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; resource diagnostic pending | `ddf28eb8d`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-002 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; ConPTY settlement active | `2aaea7046`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -3081,6 +3091,59 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: commit and push the diagnostic, capture both native Windows snapshots through the
existing 45-second failure formatter, then change only the resource owner identified by evidence.
+### E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001 — Native Windows retains one `MessagePort`
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `2aaea70465dc80ced2ba4662b5bc1475a9c2f8c5`, containing
+ bounded diagnostic implementation `6bba900209543a53b7673ca12173159d40d9fc87`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runners and jobs: GitHub Actions run
+ [29343816558](https://github.com/stablyai/orca/actions/runs/29343816558); Windows x64 job
+ [87122172498](https://github.com/stablyai/orca/actions/runs/29343816558/job/87122172498),
+ `windows-2022` image `20260706.237.1`, native x64, runner `2.335.1`; Windows arm64 job
+ [87122172553](https://github.com/stablyai/orca/actions/runs/29343816558/job/87122172553),
+ `windows-11-arm64` image `20260706.102.1`, native arm64, runner `2.335.1`
+- Remote and transport: no SSH remote; target-native artifact build and bundled-runtime execution
+- Exact commands:
+
+ ```sh
+ gh api 'repos/stablyai/orca/actions/runs/29343816558/jobs?per_page=100' \
+ --jq '.jobs[] | [.id,.name,.status,.conclusion,.head_sha,.html_url] | @tsv'
+ gh api repos/stablyai/orca/actions/jobs/87122172498/logs | \
+ rg -n -C 10 'resourceSettlement|Bundled runtime smoke command failed|timeoutMs=|contentId|durationMs|rssBytes'
+ gh api repos/stablyai/orca/actions/jobs/87122172553/logs | \
+ rg -n -C 10 'resourceSettlement|Bundled runtime smoke command failed|timeoutMs=|contentId|durationMs|rssBytes'
+ ```
+
+- Result: expected discriminating FAIL on both Windows jobs after 27/27 contract tests, exact signed
+ inputs, offline native compilation, archive/tree inspection, and valid functional smoke output.
+ Immediately after smoke each child reported three `PipeWrap` resources plus one `MessagePort`;
+ after the two-second observation window one `PipeWrap` settled but the `MessagePort` remained.
+ Each child then remained alive until the unchanged 45-second parent timeout sent `SIGTERM`.
+- X64 metrics: functional smoke completed in 5,368.1555 ms with 60,022,784-byte RSS. The ZIP was
+ 37,212,066 bytes with content ID
+ `sha256:4ee246445ad65eec49b70fceab92fbd954de2f7fd8608a0646cc9a79ce53e69a`, archive SHA-256
+ `sha256:20c98e2db2aaa9245fb2c632d37c4963e70f65a0e5257aff4e196dc64fb984dd`, and build
+ duration 143,545.9941 ms.
+- Arm64 metrics: functional smoke completed in 5,873.1038 ms with 54,059,008-byte RSS. The ZIP was
+ 33,261,530 bytes with content ID
+ `sha256:9418590ffa09d21145dd1ff4d8492d1ff8b0328df496e300edec1969365df3a3`, archive SHA-256
+ `sha256:52477f9714e7ac38b9f40ce5642b7f1c9e838f98af48387c7a88ef53b1dcf385`, and build
+ duration 169,800.5025 ms.
+- POSIX control: Linux x64/arm64 and macOS x64/arm64 jobs at the same exact head all completed
+ successfully; the Windows-only observation did not add a POSIX delay or resource probe.
+- Oracle proved: the retained native resource class is one persistent `MessagePort` on both Windows
+ architectures after successful PTY/ConPTY/watcher behavior and public PTY cleanup. The remaining
+ `PipeWrap` resources are the smoke child's parent stdio and are not sufficient to explain the
+ Windows-only non-exit because the same child-process boundary exits on POSIX.
+- Does not prove: which dependency object owns the `MessagePort`, a safe correction, normal Windows
+ child exit, uploaded artifact retention, clean-rebuild identity, native trust, SSH, or any tuple.
+ Both Windows executable cells remain unchecked.
+- Checklist items satisfied: native resource classification only.
+- Follow-up: inspect the copied node-pty ConPTY worker lifecycle, add an exact-source fail-closed
+ transform contract scoped to Windows artifact staging, then require both native jobs to exit and
+ upload unpublished evidence before advancing.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
@@ -3320,7 +3383,7 @@ owner and promotion condition.
| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native smokes work; public PTY cleanup still hangs; diagnostic is local | No prompt settlement or retained artifact proof | Codex implementation owner | Classify resource, then clean exit/upload, reproducibility/trust/live gates | Open |
+| Windows runtime smoke incomplete | Native smokes work; one ConPTY-worker-class `MessagePort` remains | No prompt settlement or retained artifact proof | Codex implementation owner | Artifact-only settlement, then clean exit/upload, reproducibility/trust gates | Open |
| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
From d9a556b9c8b3d3a639d4fc93a8ba25926089d20f Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:23:18 -0400
Subject: [PATCH 019/267] docs(ssh): record ConPTY worker settlement gate
Co-authored-by: Orca
---
...relay-node-pty-windows-settlement.test.mjs | 4 +-
...github-release-implementation-checklist.md | 140 ++++++++++++++----
2 files changed, 116 insertions(+), 28 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs b/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
index 5dfb808668f..b3b4710927f 100644
--- a/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
@@ -42,7 +42,9 @@ describe('SSH relay copied node-pty Windows settlement', () => {
` this._ptyNative.kill(this._pty, this._useConptyDll);
// Why: quiet ConPTY output cannot retrigger disposal, so start its bounded drain now.
this._conoutSocketWorker.dispose();
- this._outSocket.on('data', function () {`
+ this._outSocket.on('data', function () {
+ _this._conoutSocketWorker.dispose();
+ });`
)
})
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 340d44093b0..8995fa8c123 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — add a fail-closed, runtime-artifact-only correction for the ConPTY worker `MessagePort` retained after functionally successful native Windows x64 and arm64 smoke; exact-head green CI, reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — require exact-head native Windows x64 and arm64 proof for the locally green, fail-closed runtime-artifact-only ConPTY worker settlement correction; reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -73,8 +73,9 @@ same change as the work it records.
(E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001). The active slice is an exact-source, fail-closed
correction applied only to the copied node-pty Windows JavaScript inside runtime artifact
staging; the repository-wide node-pty patch and legacy/default desktop path must remain unchanged.
- This package may produce test artifacts but must not publish, resolve, transfer, install, launch,
- or enable them.
+ That local contract is green at `c04b4f630` under E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; exact-head
+ native Windows proof remains mandatory. This package may produce test artifacts but must not
+ publish, resolve, transfer, install, launch, or enable them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -119,14 +120,12 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: prove the copied node-pty Windows runtime closure owns the persistent
- `MessagePort`, add a discriminating source-drift-rejecting test, and apply the narrow correction
- only after node-pty is copied into exclusive artifact staging. Rerun both exact-head native
- Windows jobs and require normal child exit, no persistent `MessagePort` after observation, and
- unpublished artifact upload before claiming either executable cell. A same-head/same-runner
- clean-rebuild identity oracle remains a separate next gate. Keep cross-family remote
- infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
- publication, resolver, transfer, rollout, tuple enablement, or default behavior.
+- Next required action: push the locally green copied-node-pty settlement correction and rerun both
+ exact-head native Windows jobs. Require normal child exit, no persistent `MessagePort` after
+ observation, and unpublished artifact upload before claiming either executable cell. A
+ same-head/same-runner clean-rebuild identity oracle remains a separate next gate. Keep
+ cross-family remote infrastructure, signing/trust, and measured legacy baseline gates open; do
+ not introduce publication, resolver, transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -592,12 +591,12 @@ archive inspection, bundled-Node/native-module/PTY/watcher smoke, SBOM, and prov
behind purpose-named scripts and CI artifacts. No release publication, desktop resolver, SSH
transfer, install, fallback, rollout setting, or tuple enablement belongs in this package.
-**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head run 29343816558 identifies
-one persistent `MessagePort` on native Windows x64 and arm64 after functional PTY/watcher smoke,
-public PTY cleanup, and a two-second observation window. Prove and correct the copied ConPTY worker
-lifecycle inside artifact staging only, rejecting missing, duplicated, or drifted source; preserve
-the repository-wide node-pty patch, legacy/default desktop path, 45-second parent bound, and the
-prohibition on `process.exit()`.
+**Active sub-gate — 2026-07-14, Codex implementation owner:** implementation commit `c04b4f630`
+starts the ConPTY worker's bounded drain only in the copied Windows artifact source and rejects
+missing, duplicated, or drifted source. Local contract and repository gates are green; require
+normal child exit and unpublished artifact upload on exact-head native Windows x64 and arm64 while
+preserving the repository-wide node-pty patch, legacy/default desktop path, 45-second parent bound,
+and prohibition on `process.exit()`.
Each runtime must contain only the executable closure required by the relay.
@@ -1195,16 +1194,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; ConPTY settlement active | `2aaea7046`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native settlement CI pending | `c04b4f630`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1254,6 +1253,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-windows-tree.test.mjs` (E-M3-WINDOWS-LOCAL-002; structural Windows ConPTY closure only, no execution)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs` (E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001; native evidence remains pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs` (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001; native classification pending)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs` (E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; native settlement pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -3144,6 +3144,92 @@ or unexpected token`; the first logs did not identify a source location.
transform contract scoped to Windows artifact staging, then require both native jobs to exit and
upload unpublished evidence before advancing.
+### E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001 — Copied-source settlement contract red gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: uncommitted red-test working tree based on
+ `2aaea70465dc80ced2ba4662b5bc1475a9c2f8c5`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Node 24 and native Windows remain the
+ authoritative artifact environments.
+- Remote and transport: none; synthetic copied-source fixtures only
+- Exact command:
+ `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs`
+- Result: expected discriminating FAIL, 4/4 tests failed in 136 ms. The copied Windows source was
+ unchanged, POSIX returned no explicit no-op result, and missing/duplicate source patterns did not
+ fail closed.
+- Oracle proved: the new contract failed for each missing behavior before the correction existed.
+- Does not prove: the green transform, production wiring, native Windows execution, prompt worker
+ settlement, or any tuple.
+- Checklist items satisfied: red half of the copied ConPTY worker settlement correction only.
+- Follow-up: implement the exact one-match transform against exclusive artifact staging and rerun
+ focused, artifact, and repository gates.
+
+### E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001 — Fail-closed artifact-only worker settlement
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation commit `c04b4f630`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 arm64; Node v26.0.0 and pnpm 10.24.0. Node 24 and native Windows remain the
+ authoritative artifact environments.
+- Remote and transport: none; pinned installed node-pty source, synthetic source-drift fixtures,
+ workflow contract, and repository static gates
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ .github/workflows/ssh-relay-runtime-artifacts.yml
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. The purpose-named suite passed 5/5 tests in 124 ms; the settlement/PTY/resource/tree/
+ workflow slice passed 12/12 tests across five suites in 201 ms; all ten artifact suites passed
+ 32/32 tests in 378 ms. Typecheck, focused oxlint, max-lines, full lint/reliability/localization,
+ formatting, and whitespace gates passed with only existing out-of-package lint warnings.
+- Duration and resource metrics: the combined repository static command completed in approximately
+ 12.4 seconds. Peak memory and open-file counts were not instrumented by these local static tests.
+- Oracle proved: the transform accepts the exact pinned installed node-pty source, starts the
+ ConPTY `Worker` drain even when no later output arrives, preserves later-data timer resets, modifies
+ only the copied Windows artifact source after exclusive staging, and does not inspect a POSIX copy.
+ Missing, drifted, duplicate, or already-transformed source rejects before a write. Both native
+ workflow families run the purpose-named contract. The repository-wide
+ `config/patches/node-pty@1.1.0.patch` and legacy/default desktop node-pty behavior are unchanged.
+- Does not prove: native Windows worker termination, normal smoke child exit, absence of a persistent
+ `MessagePort`, artifact upload, reproducibility, native trust, oldest baseline, SSH, or any tuple.
+- Checklist items satisfied: purpose-named local copied-source settlement contract and verification
+ command inventory only; Windows executable rows remain unchecked.
+- Follow-up: push the exact head and require both target-native Windows jobs to exit normally, show
+ no persistent `MessagePort` after the observation window, and upload unpublished evidence.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
From d35ab55b9f977bdbbb28b460b3a9535bb24c610a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:35:19 -0400
Subject: [PATCH 020/267] docs(ssh): record native Windows runtime proof
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 176 +++++++++++++-----
1 file changed, 129 insertions(+), 47 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 8995fa8c123..776ae307de6 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — require exact-head native Windows x64 and arm64 proof for the locally green, fail-closed runtime-artifact-only ConPTY worker settlement correction; reproducibility, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — add and prove a same-head, same-runner two-clean-build identity oracle now that all six glibc/macOS/Windows target-native artifact and executable cells are green; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -73,9 +73,12 @@ same change as the work it records.
(E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001). The active slice is an exact-source, fail-closed
correction applied only to the copied node-pty Windows JavaScript inside runtime artifact
staging; the repository-wide node-pty patch and legacy/default desktop path must remain unchanged.
- That local contract is green at `c04b4f630` under E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; exact-head
- native Windows proof remains mandatory. This package may produce test artifacts but must not
- publish, resolve, transfer, install, launch, or enable them.
+ That local contract is green at `c04b4f630` under E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001. Exact-head
+ run [29345126283](https://github.com/stablyai/orca/actions/runs/29345126283) then passed all six
+ native jobs; both Windows architectures shed the `MessagePort` within the two-second observation
+ window, exited normally, and uploaded unpublished evidence (E-M3-WINDOWS-CI-001). This package
+ may produce test artifacts but must not publish, resolve, transfer, install, launch, or enable
+ them.
- Active evidence gate: the immutable Node v24.18.0 contract, pinned release key, bounded verifier,
and artifact-only CLI are locally green under E-M3-NODE-RED-001 and E-M3-NODE-PROVENANCE-001.
E-M3-RUNTIME-LOCAL-001 additionally proves one unpublished Linux arm64 glibc assembly, exact-tree
@@ -94,8 +97,8 @@ same change as the work it records.
- Windows PTY-closure correction: E-M3-WINDOWS-CONPTY-GAP-001 proved the candidate omitted the
`conpty.dll` and `OpenConsole.exe` files required by Orca's production `useConptyDll: true` path
and therefore exercised a weaker system-ConPTY smoke. E-M3-WINDOWS-LOCAL-002 proves the corrected
- local tree-closure and smoke configuration contracts; native execution remains open and no
- Windows executable cell is complete.
+ local tree-closure and smoke configuration contracts. E-M3-WINDOWS-CI-001 proves the corrected
+ native x64/arm64 closure executes and settles; oldest-baseline and native-trust cells remain open.
- Windows native progression: E-M3-WINDOWS-CI-RED-002 captured and corrected NTFS fixture modes,
Windows shebang parsing, authenticated-key checkout bytes, and POSIX-only mode assertions. At the
corrected exact head, E-M3-WINDOWS-CI-RED-003 proves 20 passing and one intentionally skipped test
@@ -107,7 +110,9 @@ same change as the work it records.
and E-M3-WINDOWS-SMOKE-SETTLEMENT-CI-RED-002 then proved functional PTY/watcher smoke still did not
settle after public listener and terminal cleanup. E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-CI-RED-001
identifies the persistent native resource as one `MessagePort` on both x64 and arm64 after a
- two-second drain window. No Windows executable cell is claimed.
+ two-second drain window. E-M3-WINDOWS-CI-001 proves the artifact-only correction removes that
+ resource before normal exit on both architectures and retains the uploaded bytes. No oldest-
+ baseline, native-trust, SSH, reproducibility, or enabled-tuple claim is made.
- Production behavior: unchanged; Orca embeds relay JavaScript and installs `node-pty` plus
`@parcel/watcher` with remote npm.
- New runtime assets published: none.
@@ -120,12 +125,11 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: push the locally green copied-node-pty settlement correction and rerun both
- exact-head native Windows jobs. Require normal child exit, no persistent `MessagePort` after
- observation, and unpublished artifact upload before claiming either executable cell. A
- same-head/same-runner clean-rebuild identity oracle remains a separate next gate. Keep
- cross-family remote infrastructure, signing/trust, and measured legacy baseline gates open; do
- not introduce publication, resolver, transfer, rollout, tuple enablement, or default behavior.
+- Next required action: add a same-head/same-runner two-clean-build identity comparison that fails
+ closed on any tree, archive, SBOM, provenance, or identity drift, then run it for every target-
+ native candidate. Keep oldest-baseline, cross-family remote infrastructure, signing/trust, and
+ measured legacy baseline gates open; do not introduce publication, resolver, transfer, rollout,
+ tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -591,12 +595,10 @@ archive inspection, bundled-Node/native-module/PTY/watcher smoke, SBOM, and prov
behind purpose-named scripts and CI artifacts. No release publication, desktop resolver, SSH
transfer, install, fallback, rollout setting, or tuple enablement belongs in this package.
-**Active sub-gate — 2026-07-14, Codex implementation owner:** implementation commit `c04b4f630`
-starts the ConPTY worker's bounded drain only in the copied Windows artifact source and rejects
-missing, duplicated, or drifted source. Local contract and repository gates are green; require
-normal child exit and unpublished artifact upload on exact-head native Windows x64 and arm64 while
-preserving the repository-wide node-pty patch, legacy/default desktop path, 45-second parent bound,
-and prohibition on `process.exit()`.
+**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head run 29345126283 proves all
+six target-native artifact/executable jobs, including normal Windows x64/arm64 settlement and
+unpublished upload. Add a bounded same-head/same-runner two-clean-build comparison without changing
+artifact consumers, publication, the repository-wide node-pty patch, or the legacy/default path.
Each runtime must contain only the executable closure required by the relay.
@@ -614,10 +616,11 @@ Each runtime must contain only the executable closure required by the relay.
- [ ] Build Orca’s patched `node-pty@1.1.0` against the exact bundled Node runtime.
- [ ] Assert Orca-required patched exports/diagnostics exist; do not silently use an upstream
prebuild that omits the patch.
-- [ ] For Windows, copy the tuple-architecture `conpty.dll` and `OpenConsole.exe` from the pinned
+- [x] For Windows, copy the tuple-architecture `conpty.dll` and `OpenConsole.exe` from the pinned
node-pty source into `build/Release/conpty`, hash them into the runtime identity as native
runtime files, and prove PTY spawn/resize/exit with `useConptyDll: true`. Do not substitute a
- system-ConPTY smoke for the production path. (E-M3-WINDOWS-CONPTY-GAP-001)
+ system-ConPTY smoke for the production path. (E-M3-WINDOWS-CONPTY-GAP-001,
+ E-M3-WINDOWS-CI-001)
- [ ] Include exactly one compatible `@parcel/watcher@2.5.6` native optional package.
- [ ] Include relay JavaScript, watcher child, required runtime JavaScript closure, licenses, SBOM,
provenance, and runtime metadata.
@@ -631,8 +634,9 @@ Each runtime must contain only the executable closure required by the relay.
- [ ] Sign native code according to the platform decisions in Milestone 1.
- [ ] Verify platform-native signatures/policy on target-native runners after signing and before
aggregation; attest the exact verified bytes for the signed manifest.
-- [x] Run local POSIX archive inspection and target-runtime smoke before any upload; Windows remains
- open until its separate builder/verifier exists. (E-M3-RUNTIME-LOCAL-001)
+- [x] Run target-native archive inspection and target-runtime smoke before upload for every current
+ glibc/macOS/Windows candidate. (E-M3-RUNTIME-LOCAL-001, E-M3-CI-001,
+ E-M3-WINDOWS-CI-001)
### Per-tuple build and executable proof
@@ -644,8 +648,8 @@ Each runtime must contain only the executable closure required by the relay.
| linux-arm64-musl | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
| darwin-x64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-CI-001 |
| darwin-arm64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-CI-001 |
-| win32-x64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
-| win32-arm64 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | — |
+| win32-x64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-WINDOWS-CI-001 |
+| win32-arm64 | [x] | [x] | [x] | [x] | [ ] | [ ] | E-M3-WINDOWS-CI-001 |
Rules:
@@ -1194,16 +1198,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native settlement CI pending | `c04b4f630`; E-M3-NODE-RED-001, E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; reproducibility active | `d9a556b9c`; E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -3230,6 +3234,84 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact head and require both target-native Windows jobs to exit normally, show
no persistent `MessagePort` after the observation window, and upload unpublished evidence.
+### E-M3-WINDOWS-CI-001 — Native Windows artifacts execute, settle, and upload
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact workflow head `d9a556b9c8b3d3a639d4fc93a8ba25926089d20f`, containing
+ implementation commit `c04b4f630`; draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run: GitHub Actions
+ [29345126283](https://github.com/stablyai/orca/actions/runs/29345126283), completed success with all
+ six target-native jobs green
+- Windows runners and jobs: x64 job
+ [87126693074](https://github.com/stablyai/orca/actions/runs/29345126283/job/87126693074),
+ `windows-2022` image `20260706.237.1`, Windows Server 2022 build 20348, native X64, Node v24.18.0;
+ arm64 job
+ [87126693105](https://github.com/stablyai/orca/actions/runs/29345126283/job/87126693105),
+ `windows-11-arm64` image `20260706.102.1`, Windows build 26200, native ARM64, Node v24.18.0
+- Remote and transport: no SSH remote; target-native artifact build, bundled-runtime execution, and
+ GitHub Actions unpublished artifact upload
+- Exact commands:
+
+ ```sh
+ gh run watch 29345126283 --repo stablyai/orca --interval 10 --exit-status
+ gh api 'repos/stablyai/orca/actions/runs/29345126283/jobs?per_page=100' \
+ --jq '.jobs[] | [.id,.name,.status,.conclusion,.started_at,.completed_at,.head_sha,.html_url] | @tsv'
+ gh api repos/stablyai/orca/actions/jobs/87126693074/logs | \
+ rg -n -C 12 'resourceSettlement|contentId|archive|durationMs|rssBytes|Artifact .* has been successfully uploaded'
+ gh api repos/stablyai/orca/actions/jobs/87126693105/logs | \
+ rg -n -C 12 'resourceSettlement|contentId|archive|durationMs|rssBytes|Artifact .* has been successfully uploaded'
+ gh api 'repos/stablyai/orca/actions/runs/29345126283/artifacts?per_page=100' \
+ --jq '.artifacts[] | [.id,.name,.size_in_bytes,.expired,.created_at,.archive_download_url] | @tsv'
+ gh api repos/stablyai/orca/actions/artifacts/8315822805/zip >
+ gh api repos/stablyai/orca/actions/artifacts/8315904862/zip >
+ shasum -a 256
+ unzip -l
+ unzip -p '*identity.json' | jq
+ unzip -l
+ unzip -p '*identity.json' | jq
+ ```
+
+- Result: PASS. Both Windows jobs passed 32/32 artifact contract tests, exact signed Node input
+ verification, offline target-native compilation, exact archive/tree inspection, bundled Node
+ v24.18.0, production-DLL ConPTY input/101×37 resize/exit 23, watcher lifecycle, normal child exit,
+ and unpublished upload. Immediately after smoke, each child reported three `PipeWrap` resources,
+ one `MessagePort`, and the diagnostic's own `Timeout`; after the two-second observation only the
+ two parent stdio `PipeWrap` resources remained. No `MessagePort` or timer survived, and neither
+ 45-second parent timeout fired.
+- X64 metrics and bytes: build 135,657.3557 ms; full verification 6,495.1387 ms; smoke 5,353.5073 ms
+ with 54,075,392-byte RSS. The 42-file ZIP was 37,212,121 bytes, expanded to 97,248,569 bytes, had
+ content ID `sha256:32efa708b1fbefb05a11b0de6703551e5680d64c8015bb956095db3b50292c92`, and archive
+ SHA-256 `sha256:2ec9db55b5c417ea7ed9ab6cf5a960be4b9c305e68c68f8123a11dab0e3119a4`.
+ Uploaded artifact
+ [8315822805](https://github.com/stablyai/orca/actions/runs/29345126283/artifacts/8315822805) was
+ 37,075,355 bytes and downloaded with SHA-256
+ `d98d1c935514667ea5c48a160ef54b9674a93f995ca24df2c19759735c62eefb`; total job duration was
+ 4m06s.
+- Arm64 metrics and bytes: build 190,135.9561 ms; full verification 7,908.8115 ms; smoke 5,874.805 ms
+ with 51,843,072-byte RSS. The 42-file ZIP was 33,261,582 bytes, expanded to 86,189,895 bytes, had
+ content ID `sha256:e1d5eab84a7b1eb38d55acb9f87d852569995e22c47c02d202f29eb293467944`, and archive
+ SHA-256 `sha256:577285df23333a3de89489dec52027afd76aeb9ef23f74ffb6d5706e06a75ae8`.
+ Uploaded artifact
+ [8315904862](https://github.com/stablyai/orca/actions/runs/29345126283/artifacts/8315904862) was
+ 33,137,908 bytes and downloaded with SHA-256
+ `77b78cb33117c8c8b4f5d639dada063651f7d303a815a097bfa36d9e651a2419`; total job duration was
+ 7m09s.
+- POSIX control: Linux x64/arm64 and macOS x64/arm64 passed the same exact-head contract, build,
+ verification, smoke, and unpublished upload steps. All six run artifacts exist with seven-day
+ retention; no release asset was published.
+- Oracle proved: the copied-source correction terminates the node-pty ConPTY worker on both native
+ Windows architectures without masking the process with `process.exit()`, while preserving full
+ PTY/watcher behavior and the four POSIX controls. The exact uploaded evidence contains the runtime
+ ZIP, identity, SPDX SBOM, and provenance files.
+- Does not prove: same-runner clean-rebuild identity, oldest baselines, Authenticode/native trust,
+ SSH/SFTP/system-SSH transfer, relay RPC behavior, cancellation, publication, or any enabled tuple.
+- Checklist items satisfied: Milestone 3 Windows `conpty.dll`/`OpenConsole.exe` production-path item;
+ Windows x64 and arm64 build/provenance, bundled Node, real PTY, and watcher cells; target-native
+ pre-upload inspection/smoke command.
+- Follow-up: add and execute the separately gated same-head/same-runner two-clean-build identity
+ oracle before oldest-baseline or trust work.
+
### E-M3-RUNTIME-LOCAL-001 — First target-native Linux arm64 runtime artifact
- Date: 2026-07-14
@@ -3465,18 +3547,18 @@ or unexpected token`; the first logs did not identify a source location.
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Four unpublished POSIX native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native smokes work; one ConPTY-worker-class `MessagePort` remains | No prompt settlement or retained artifact proof | Codex implementation owner | Artifact-only settlement, then clean exit/upload, reproducibility/trust gates | Open |
-| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
From c70e96374cafb681c52b3d60e42322ba5a76791c Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:49:48 -0400
Subject: [PATCH 021/267] test(ssh): gate runtime clean-build identity
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 119 ++++----
.../ssh-relay-runtime-reproducibility.mjs | 268 ++++++++++++++++++
...ssh-relay-runtime-reproducibility.test.mjs | 145 ++++++++++
.../ssh-relay-runtime-workflow.test.mjs | 26 +-
...github-release-implementation-checklist.md | 43 +--
5 files changed, 531 insertions(+), 70 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-reproducibility.mjs
create mode 100644 config/scripts/ssh-relay-runtime-reproducibility.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index f0d4dc9aee2..21e36216a16 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -110,6 +110,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
config/scripts/ssh-relay-runtime-zip.test.mjs \
@@ -129,34 +130,44 @@ jobs:
done
printf 'NODE_INPUTS=%s\n' "$inputs" >> "$GITHUB_ENV"
- - name: Build, inspect, and smoke exact runtime
+ - name: Build twice, inspect, smoke, and compare exact runtime
shell: bash
run: |
set -euo pipefail
- output="$RUNNER_TEMP/ssh-relay-runtime/${{ matrix.tuple }}"
- mkdir -p "$(dirname "$output")"
+ output_root="$RUNNER_TEMP/ssh-relay-runtime/${{ matrix.tuple }}"
+ mkdir -p "$output_root"
+ first_output="$output_root/first"
+ second_output="$output_root/second"
source_commit=$(git rev-parse HEAD)
source_date_epoch=$(git show -s --format=%ct "$source_commit")
- /usr/bin/time -p node config/scripts/build-ssh-relay-runtime.mjs \
+ for output in "$first_output" "$second_output"; do
+ printf 'clean_build_output=%s\n' "$output"
+ /usr/bin/time -p node config/scripts/build-ssh-relay-runtime.mjs \
+ --tuple '${{ matrix.tuple }}' \
+ --inputs-directory "$NODE_INPUTS" \
+ --output-directory "$output" \
+ --source-date-epoch "$source_date_epoch" \
+ --git-commit "$source_commit"
+ identity="$output/orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json"
+ archive=$(find "$output" -maxdepth 1 -name '*.tar.xz' -print -quit)
+ test -n "$archive"
+ /usr/bin/time -p node config/scripts/verify-ssh-relay-runtime.mjs \
+ --runtime-directory "$output/runtime" \
+ --identity "$identity" \
+ --archive "$archive"
+ if find "$output/runtime" -type f \( -name npm -o -name npx -o -name corepack -o -name '*.map' \) -print -quit | grep -q .; then
+ echo 'Runtime contains a prohibited package manager or source map.' >&2
+ exit 1
+ fi
+ parcel_packages=$(find "$output/runtime/node_modules/@parcel" -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')
+ test "$parcel_packages" = 2
+ done
+ node config/scripts/ssh-relay-runtime-reproducibility.mjs \
--tuple '${{ matrix.tuple }}' \
- --inputs-directory "$NODE_INPUTS" \
- --output-directory "$output" \
- --source-date-epoch "$source_date_epoch" \
- --git-commit "$source_commit"
- identity="$output/orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json"
- archive=$(find "$output" -maxdepth 1 -name '*.tar.xz' -print -quit)
- /usr/bin/time -p node config/scripts/verify-ssh-relay-runtime.mjs \
- --runtime-directory "$output/runtime" \
- --identity "$identity" \
- --archive "$archive"
- if find "$output/runtime" -type f \( -name npm -o -name npx -o -name corepack -o -name '*.map' \) -print -quit | grep -q .; then
- echo 'Runtime contains a prohibited package manager or source map.' >&2
- exit 1
- fi
- parcel_packages=$(find "$output/runtime/node_modules/@parcel" -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')
- test "$parcel_packages" = 2
+ --first-output-directory "$first_output" \
+ --second-output-directory "$second_output"
mkdir -p "$GITHUB_WORKSPACE/runtime-evidence/${{ matrix.tuple }}"
- cp "$output"/*.tar.xz "$output"/*.spdx.json "$output"/*.provenance.json "$output"/*.identity.json \
+ cp "$first_output"/*.tar.xz "$first_output"/*.spdx.json "$first_output"/*.provenance.json "$first_output"/*.identity.json \
"$GITHUB_WORKSPACE/runtime-evidence/${{ matrix.tuple }}/"
- name: Upload unpublished artifact evidence
@@ -254,6 +265,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs `
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
config/scripts/ssh-relay-runtime-zip.test.mjs `
@@ -284,41 +296,52 @@ jobs:
}
"NODE_INPUTS=$inputs" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- - name: Build, inspect, and smoke exact runtime
+ - name: Build twice, inspect, smoke, and compare exact runtime
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
- $output = Join-Path $env:RUNNER_TEMP 'ssh-relay-runtime/${{ matrix.tuple }}'
- New-Item -ItemType Directory -Path (Split-Path -Parent $output) -Force | Out-Null
+ $outputRoot = Join-Path $env:RUNNER_TEMP 'ssh-relay-runtime/${{ matrix.tuple }}'
+ New-Item -ItemType Directory -Path $outputRoot -Force | Out-Null
+ $firstOutput = Join-Path $outputRoot 'first'
+ $secondOutput = Join-Path $outputRoot 'second'
$sourceCommit = git rev-parse HEAD
$sourceDateEpoch = git show -s --format=%ct $sourceCommit
- node config/scripts/build-ssh-relay-runtime.mjs `
- --tuple '${{ matrix.tuple }}' `
- --inputs-directory $env:NODE_INPUTS `
- --output-directory $output `
- --source-date-epoch $sourceDateEpoch `
- --git-commit $sourceCommit
- if ($LASTEXITCODE -ne 0) { throw 'runtime build failed' }
- $identity = Join-Path $output 'orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json'
- $archive = Get-ChildItem -LiteralPath $output -Filter '*.zip' -File | Select-Object -First 1
- if (-not $archive) { throw 'runtime ZIP is missing' }
- node config/scripts/verify-ssh-relay-runtime.mjs `
- --runtime-directory (Join-Path $output 'runtime') `
- --identity $identity `
- --archive $archive.FullName
- if ($LASTEXITCODE -ne 0) { throw 'runtime verification failed' }
- $prohibited = Get-ChildItem -LiteralPath (Join-Path $output 'runtime') -Recurse -File |
- Where-Object { $_.Name -in @('npm', 'npm.cmd', 'npx', 'npx.cmd', 'corepack', 'corepack.cmd') -or $_.Name.EndsWith('.map') } |
- Select-Object -First 1
- if ($prohibited) { throw "Runtime contains a prohibited file: $($prohibited.FullName)" }
- $parcelRoot = Join-Path $output 'runtime/node_modules/@parcel'
- if (@(Get-ChildItem -LiteralPath $parcelRoot -Directory).Count -ne 2) {
- throw 'Runtime must contain exactly the watcher wrapper and one native package'
+ foreach ($output in @($firstOutput, $secondOutput)) {
+ "clean_build_output=$output"
+ node config/scripts/build-ssh-relay-runtime.mjs `
+ --tuple '${{ matrix.tuple }}' `
+ --inputs-directory $env:NODE_INPUTS `
+ --output-directory $output `
+ --source-date-epoch $sourceDateEpoch `
+ --git-commit $sourceCommit
+ if ($LASTEXITCODE -ne 0) { throw 'runtime build failed' }
+ $identity = Join-Path $output 'orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json'
+ $archive = Get-ChildItem -LiteralPath $output -Filter '*.zip' -File | Select-Object -First 1
+ if (-not $archive) { throw 'runtime ZIP is missing' }
+ node config/scripts/verify-ssh-relay-runtime.mjs `
+ --runtime-directory (Join-Path $output 'runtime') `
+ --identity $identity `
+ --archive $archive.FullName
+ if ($LASTEXITCODE -ne 0) { throw 'runtime verification failed' }
+ $prohibited = Get-ChildItem -LiteralPath (Join-Path $output 'runtime') -Recurse -File |
+ Where-Object { $_.Name -in @('npm', 'npm.cmd', 'npx', 'npx.cmd', 'corepack', 'corepack.cmd') -or $_.Name.EndsWith('.map') } |
+ Select-Object -First 1
+ if ($prohibited) { throw "Runtime contains a prohibited file: $($prohibited.FullName)" }
+ $parcelRoot = Join-Path $output 'runtime/node_modules/@parcel'
+ if (@(Get-ChildItem -LiteralPath $parcelRoot -Directory).Count -ne 2) {
+ throw 'Runtime must contain exactly the watcher wrapper and one native package'
+ }
}
+ node config/scripts/ssh-relay-runtime-reproducibility.mjs `
+ --tuple '${{ matrix.tuple }}' `
+ --first-output-directory $firstOutput `
+ --second-output-directory $secondOutput
+ if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility verification failed' }
$evidence = Join-Path $env:GITHUB_WORKSPACE 'runtime-evidence/${{ matrix.tuple }}'
New-Item -ItemType Directory -Path $evidence -Force | Out-Null
- Copy-Item -LiteralPath $archive.FullName -Destination $evidence
- Get-ChildItem -LiteralPath $output -File |
+ $firstArchive = Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip' -File | Select-Object -First 1
+ Copy-Item -LiteralPath $firstArchive.FullName -Destination $evidence
+ Get-ChildItem -LiteralPath $firstOutput -File |
Where-Object { $_.Name -match '\.(?:spdx|provenance|identity)\.json$' } |
Copy-Item -Destination $evidence
diff --git a/config/scripts/ssh-relay-runtime-reproducibility.mjs b/config/scripts/ssh-relay-runtime-reproducibility.mjs
new file mode 100644
index 00000000000..febadab9db0
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-reproducibility.mjs
@@ -0,0 +1,268 @@
+#!/usr/bin/env node
+
+import { createHash } from 'node:crypto'
+import { createReadStream } from 'node:fs'
+import { lstat, opendir, readFile, realpath } from 'node:fs/promises'
+import { join, resolve } from 'node:path'
+
+// The bounded output adds four release assets around a runtime tree capped at 5,000 entries.
+const MAX_ENTRIES = 6_000
+const MAX_FILE_BYTES = 250 * 1024 * 1024
+const MAX_TOTAL_BYTES = 500 * 1024 * 1024
+const MAX_PATH_BYTES = 512
+const MAX_PATH_DEPTH = 40
+const MAX_IDENTITY_BYTES = 1024 * 1024
+const COMPARISON_TIMEOUT_MS = 5 * 60 * 1000
+const SUPPORTED_TUPLES = new Set([
+ 'linux-x64-glibc',
+ 'linux-arm64-glibc',
+ 'darwin-x64',
+ 'darwin-arm64',
+ 'win32-x64',
+ 'win32-arm64'
+])
+
+async function sha256File(path, signal) {
+ const digest = createHash('sha256')
+ for await (const chunk of createReadStream(path, { signal })) {
+ signal.throwIfAborted()
+ digest.update(chunk)
+ }
+ return `sha256:${digest.digest('hex')}`
+}
+
+function validateRelativePath(path) {
+ if (
+ Buffer.byteLength(path) > MAX_PATH_BYTES ||
+ path.split('/').length > MAX_PATH_DEPTH ||
+ path.includes('\\')
+ ) {
+ throw new Error(`reproducibility output path exceeds limits: ${path}`)
+ }
+}
+
+async function snapshotOutput(directory, label, signal) {
+ const entries = new Map()
+ let files = 0
+ let bytes = 0
+
+ async function visit(absoluteDirectory, relativeDirectory = '') {
+ const children = []
+ const handle = await opendir(absoluteDirectory)
+ for await (const child of handle) {
+ children.push(child.name)
+ }
+ children.sort()
+ for (const name of children) {
+ signal.throwIfAborted()
+ const path = relativeDirectory ? `${relativeDirectory}/${name}` : name
+ validateRelativePath(path)
+ const absolutePath = join(absoluteDirectory, name)
+ const metadata = await lstat(absolutePath)
+ if (metadata.isSymbolicLink() || (!metadata.isDirectory() && !metadata.isFile())) {
+ throw new Error(`${label} contains a prohibited special entry: ${path}`)
+ }
+ if (entries.size >= MAX_ENTRIES) {
+ throw new Error(`${label} exceeds the reproducibility entry-count limit`)
+ }
+ if (metadata.isDirectory()) {
+ entries.set(path, { path, type: 'directory', mode: metadata.mode & 0o777 })
+ await visit(absolutePath, path)
+ continue
+ }
+ if (metadata.size > MAX_FILE_BYTES) {
+ throw new Error(`${label} file exceeds the reproducibility size limit: ${path}`)
+ }
+ files += 1
+ bytes += metadata.size
+ if (bytes > MAX_TOTAL_BYTES) {
+ throw new Error(`${label} exceeds the reproducibility total-size limit`)
+ }
+ entries.set(path, {
+ path,
+ type: 'file',
+ mode: metadata.mode & 0o777,
+ size: metadata.size,
+ sha256: await sha256File(absolutePath, signal)
+ })
+ }
+ }
+
+ const root = await lstat(directory)
+ if (!root.isDirectory() || root.isSymbolicLink()) {
+ throw new Error(`${label} must be a real directory`)
+ }
+ await visit(directory)
+ return { bytes, entries, files }
+}
+
+async function validateCompleteOutput(directory, label, tuple, snapshot) {
+ const identityName = `orca-ssh-relay-runtime-${tuple}.identity.json`
+ const required = [
+ 'runtime',
+ 'runtime/relay.js',
+ 'runtime/relay-watcher.js',
+ 'runtime/runtime-metadata.json',
+ identityName,
+ `orca-ssh-relay-runtime-${tuple}.spdx.json`,
+ `orca-ssh-relay-runtime-${tuple}.provenance.json`
+ ]
+ for (const path of required) {
+ if (!snapshot.entries.has(path)) {
+ throw new Error(`${label} is missing required asset: ${path}`)
+ }
+ }
+ const identityEntry = snapshot.entries.get(identityName)
+ if (identityEntry.type !== 'file' || identityEntry.size > MAX_IDENTITY_BYTES) {
+ throw new Error(`${label} identity exceeds its size or type contract`)
+ }
+ let identity
+ try {
+ identity = JSON.parse(await readFile(join(directory, identityName), 'utf8'))
+ } catch {
+ throw new Error(`${label} identity is not valid JSON`)
+ }
+ if (
+ identity.tupleId !== tuple ||
+ !/^sha256:[0-9a-f]{64}$/.test(identity.contentId) ||
+ typeof identity.archive?.name !== 'string' ||
+ !/^sha256:[0-9a-f]{64}$/.test(identity.archive.sha256)
+ ) {
+ throw new Error(`${label} identity does not match the requested tuple or digest contract`)
+ }
+ if (!snapshot.entries.has(identity.archive.name)) {
+ throw new Error(`${label} is missing required asset: ${identity.archive.name}`)
+ }
+ const archiveEntry = snapshot.entries.get(identity.archive.name)
+ if (archiveEntry.type !== 'file' || archiveEntry.sha256 !== identity.archive.sha256) {
+ throw new Error(`${label} archive digest does not match its identity`)
+ }
+ const expectedTopLevel = new Set([...required.slice(4), identity.archive.name, 'runtime'])
+ const unexpected = [...snapshot.entries.keys()].find(
+ (path) => !path.includes('/') && !expectedTopLevel.has(path)
+ )
+ if (unexpected) {
+ throw new Error(`${label} contains an unexpected top-level asset: ${unexpected}`)
+ }
+ return identity
+}
+
+function compareSnapshots(first, second) {
+ const paths = [...new Set([...first.entries.keys(), ...second.entries.keys()])].sort()
+ for (const path of paths) {
+ const left = first.entries.get(path)
+ const right = second.entries.get(path)
+ if (!left) {
+ throw new Error(`first output is missing reproducibility entry: ${path}`)
+ }
+ if (!right) {
+ throw new Error(`second output is missing reproducibility entry: ${path}`)
+ }
+ for (const field of ['type', 'mode', 'size', 'sha256']) {
+ if (left[field] !== right[field]) {
+ throw new Error(`reproducibility mismatch for ${path}: ${field}`)
+ }
+ }
+ }
+}
+
+export async function verifySshRelayRuntimeReproducibility({
+ firstOutputDirectory,
+ secondOutputDirectory,
+ tuple,
+ signal = AbortSignal.timeout(COMPARISON_TIMEOUT_MS)
+}) {
+ const started = process.hrtime.bigint()
+ if (!SUPPORTED_TUPLES.has(tuple)) {
+ throw new Error(`unsupported runtime reproducibility tuple: ${tuple}`)
+ }
+ const firstDirectory = resolve(firstOutputDirectory)
+ const secondDirectory = resolve(secondOutputDirectory)
+ if (firstDirectory === secondDirectory) {
+ throw new Error('clean-build outputs must be distinct directories')
+ }
+ signal.throwIfAborted()
+ const [firstRealPath, secondRealPath] = await Promise.all([
+ realpath(firstDirectory),
+ realpath(secondDirectory)
+ ])
+ if (firstRealPath === secondRealPath) {
+ throw new Error('clean-build outputs must resolve to distinct directories')
+ }
+
+ // Walk sequentially so the clean-build gate cannot double file and read pressure on CI runners.
+ const first = await snapshotOutput(firstDirectory, 'first output', signal)
+ const second = await snapshotOutput(secondDirectory, 'second output', signal)
+ const firstIdentity = await validateCompleteOutput(firstDirectory, 'first output', tuple, first)
+ const secondIdentity = await validateCompleteOutput(
+ secondDirectory,
+ 'second output',
+ tuple,
+ second
+ )
+ compareSnapshots(first, second)
+ if (
+ firstIdentity.contentId !== secondIdentity.contentId ||
+ firstIdentity.archive.sha256 !== secondIdentity.archive.sha256
+ ) {
+ throw new Error('reproducibility identity or archive digest mismatch')
+ }
+
+ return {
+ tuple,
+ contentId: firstIdentity.contentId,
+ archiveSha256: firstIdentity.archive.sha256,
+ entries: first.entries.size,
+ files: first.files,
+ bytes: first.bytes,
+ durationMs: Number(process.hrtime.bigint() - started) / 1e6
+ }
+}
+
+function valueAfter(argv, index, flag) {
+ const value = argv[index + 1]
+ if (!value || value.startsWith('--')) {
+ throw new Error(`${flag} requires a value`)
+ }
+ return value
+}
+
+export function parseReproducibilityArguments(argv) {
+ const result = {}
+ for (let index = 0; index < argv.length; index += 1) {
+ const flag = argv[index]
+ const value = valueAfter(argv, index, flag)
+ if (flag === '--tuple') {
+ result.tuple = value
+ } else if (flag === '--first-output-directory') {
+ result.firstOutputDirectory = resolve(value)
+ } else if (flag === '--second-output-directory') {
+ result.secondOutputDirectory = resolve(value)
+ } else {
+ throw new Error(`Unknown argument: ${flag}`)
+ }
+ index += 1
+ }
+ for (const field of ['tuple', 'firstOutputDirectory', 'secondOutputDirectory']) {
+ if (!result[field]) {
+ throw new Error(`Missing required reproducibility argument: ${field}`)
+ }
+ }
+ return result
+}
+
+async function main() {
+ const result = await verifySshRelayRuntimeReproducibility(
+ parseReproducibilityArguments(process.argv.slice(2))
+ )
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`)
+}
+
+if (process.argv[1] && resolve(process.argv[1]) === import.meta.filename) {
+ main().catch((error) => {
+ process.stderr.write(
+ `SSH relay runtime reproducibility verification failed: ${error.message}\n`
+ )
+ process.exitCode = 1
+ })
+}
diff --git a/config/scripts/ssh-relay-runtime-reproducibility.test.mjs b/config/scripts/ssh-relay-runtime-reproducibility.test.mjs
new file mode 100644
index 00000000000..0a346a6f6c9
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-reproducibility.test.mjs
@@ -0,0 +1,145 @@
+import { createHash } from 'node:crypto'
+import { chmod, cp, mkdir, mkdtemp, rm, symlink, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { verifySshRelayRuntimeReproducibility } from './ssh-relay-runtime-reproducibility.mjs'
+
+const temporaryDirectories = []
+const tuple = 'linux-x64-glibc'
+const contentId = `sha256:${'a'.repeat(64)}`
+const archiveBytes = 'archive bytes'
+const archiveSha256 = `sha256:${createHash('sha256').update(archiveBytes).digest('hex')}`
+const archiveName = `orca-ssh-relay-runtime-v1-${tuple}-${contentId.slice('sha256:'.length)}.tar.xz`
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+async function writeOutput(directory) {
+ await mkdir(join(directory, 'runtime'), { recursive: true })
+ await Promise.all([
+ writeFile(join(directory, 'runtime', 'relay.js'), 'relay bytes'),
+ writeFile(join(directory, 'runtime', 'relay-watcher.js'), 'watcher bytes'),
+ writeFile(join(directory, 'runtime', 'runtime-metadata.json'), '{"schemaVersion":1}\n'),
+ writeFile(join(directory, archiveName), archiveBytes),
+ writeFile(
+ join(directory, `orca-ssh-relay-runtime-${tuple}.identity.json`),
+ `${JSON.stringify({ tupleId: tuple, contentId, archive: { name: archiveName, sha256: archiveSha256 } })}\n`
+ ),
+ writeFile(
+ join(directory, `orca-ssh-relay-runtime-${tuple}.spdx.json`),
+ '{"spdxVersion":"SPDX-2.3"}\n'
+ ),
+ writeFile(
+ join(directory, `orca-ssh-relay-runtime-${tuple}.provenance.json`),
+ '{"predicateType":"https://slsa.dev/provenance/v1"}\n'
+ )
+ ])
+}
+
+async function createOutputs() {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-runtime-reproducibility-'))
+ temporaryDirectories.push(directory)
+ const firstOutputDirectory = join(directory, 'first')
+ const secondOutputDirectory = join(directory, 'second')
+ await writeOutput(firstOutputDirectory)
+ await cp(firstOutputDirectory, secondOutputDirectory, { recursive: true })
+ return { directory, firstOutputDirectory, secondOutputDirectory }
+}
+
+describe('SSH relay runtime clean-build reproducibility', () => {
+ it('accepts byte-and-mode-identical complete outputs', async () => {
+ const fixture = await createOutputs()
+
+ await expect(
+ verifySshRelayRuntimeReproducibility({
+ ...fixture,
+ tuple
+ })
+ ).resolves.toEqual(expect.objectContaining({ tuple, contentId, archiveSha256, files: 7 }))
+ })
+
+ it('rejects runtime-tree byte drift', async () => {
+ const fixture = await createOutputs()
+ await writeFile(join(fixture.secondOutputDirectory, 'runtime', 'relay.js'), 'other bytes')
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ 'reproducibility mismatch for runtime/relay.js: sha256'
+ )
+ })
+
+ it('rejects SBOM byte drift', async () => {
+ const fixture = await createOutputs()
+ await writeFile(
+ join(fixture.secondOutputDirectory, `orca-ssh-relay-runtime-${tuple}.spdx.json`),
+ '{"spdxVersion":"SPDX-2.2"}\n'
+ )
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ `reproducibility mismatch for orca-ssh-relay-runtime-${tuple}.spdx.json: sha256`
+ )
+ })
+
+ it('rejects an archive that disagrees with its identity', async () => {
+ const fixture = await createOutputs()
+ await writeFile(join(fixture.secondOutputDirectory, archiveName), 'other archive bytes')
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ 'second output archive digest does not match its identity'
+ )
+ })
+
+ it('rejects a missing published metadata asset', async () => {
+ const fixture = await createOutputs()
+ await rm(join(fixture.secondOutputDirectory, `orca-ssh-relay-runtime-${tuple}.spdx.json`))
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ `second output is missing required asset: orca-ssh-relay-runtime-${tuple}.spdx.json`
+ )
+ })
+
+ it.skipIf(process.platform === 'win32')('rejects mode drift', async () => {
+ const fixture = await createOutputs()
+ await chmod(join(fixture.secondOutputDirectory, 'runtime', 'relay.js'), 0o755)
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ 'reproducibility mismatch for runtime/relay.js: mode'
+ )
+ })
+
+ it.skipIf(process.platform === 'win32')(
+ 'rejects links before reading their targets',
+ async () => {
+ const fixture = await createOutputs()
+ await symlink(
+ join(fixture.directory, 'outside'),
+ join(fixture.firstOutputDirectory, 'runtime', 'escape')
+ )
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ 'first output contains a prohibited special entry: runtime/escape'
+ )
+ }
+ )
+
+ it('rejects the same directory and a pre-aborted comparison', async () => {
+ const fixture = await createOutputs()
+ await expect(
+ verifySshRelayRuntimeReproducibility({
+ firstOutputDirectory: fixture.firstOutputDirectory,
+ secondOutputDirectory: fixture.firstOutputDirectory,
+ tuple
+ })
+ ).rejects.toThrow('clean-build outputs must be distinct directories')
+ await expect(
+ verifySshRelayRuntimeReproducibility({
+ ...fixture,
+ tuple,
+ signal: AbortSignal.abort()
+ })
+ ).rejects.toThrow('aborted')
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 3fc07e0ff8d..e505f7887f1 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -35,12 +35,13 @@ describe('SSH relay runtime artifact workflow', () => {
}
})
- it('uploads only archive and metadata evidence after executable verification', async () => {
+ it('uploads only the first output after two clean builds verify and compare', async () => {
const source = await readFile(workflowUrl, 'utf8')
const workflow = parse(source)
const steps = workflow.jobs['build-posix-runtime'].steps
+ const windowsSteps = workflow.jobs['build-windows-runtime'].steps
const buildIndex = steps.findIndex(
- (step) => step.name === 'Build, inspect, and smoke exact runtime'
+ (step) => step.name === 'Build twice, inspect, smoke, and compare exact runtime'
)
const uploadIndex = steps.findIndex(
(step) => step.name === 'Upload unpublished artifact evidence'
@@ -52,12 +53,16 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('ssh-relay-runtime-workflow.test.mjs')
expect(source).toContain('pnpm install --frozen-lockfile --ignore-scripts')
expect(source).toContain('--connect-timeout 20 --max-time 300 --retry 2')
- expect(source).toContain('mkdir -p "$(dirname "$output")"')
+ expect(source).toContain('mkdir -p "$output_root"')
expect(source).toContain('source_commit=$(git rev-parse HEAD)')
expect(source).toContain('--git-commit "$source_commit"')
expect(source).not.toContain('--git-commit "$GITHUB_SHA"')
- expect(source).toContain('cp "$output"/*.tar.xz')
- expect(source).toContain("Get-ChildItem -LiteralPath $output -Filter '*.zip'")
+ expect(source).toContain('for output in "$first_output" "$second_output"')
+ expect(source).toContain('foreach ($output in @($firstOutput, $secondOutput))')
+ expect(source).toContain('ssh-relay-runtime-reproducibility.mjs')
+ expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
+ expect(source).toContain('cp "$first_output"/*.tar.xz')
+ expect(source).toContain("Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
expect(source).toContain('ssh-relay-runtime-pty-smoke.test.mjs')
expect(source).toContain('ssh-relay-runtime-resource-diagnostics.test.mjs')
@@ -65,6 +70,17 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('node-v24.18.0-headers.tar.gz')
expect(source).toContain('node_library: win-x64/node.lib')
expect(source).toContain("@('gpg.exe', 'gpgv.exe')")
+ for (const jobSteps of [steps, windowsSteps]) {
+ const run = jobSteps.find(
+ (step) => step.name === 'Build twice, inspect, smoke, and compare exact runtime'
+ ).run
+ expect(run.indexOf('ssh-relay-runtime-reproducibility.mjs')).toBeGreaterThan(
+ run.indexOf('verify-ssh-relay-runtime.mjs')
+ )
+ expect(run.indexOf('runtime-evidence/${{ matrix.tuple }}')).toBeGreaterThan(
+ run.indexOf('ssh-relay-runtime-reproducibility.mjs')
+ )
+ }
expect(steps[uploadIndex].with.path).toBe('runtime-evidence/${{ matrix.tuple }}/')
expect(source).not.toMatch(/releases\/|gh release|contents:\s*write/i)
})
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 776ae307de6..72dd4cd7ae6 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — add and prove a same-head, same-runner two-clean-build identity oracle now that all six glibc/macOS/Windows target-native artifact and executable cells are green; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — the bounded same-head, same-runner two-clean-build identity oracle is locally green and awaits exact-head execution on all six glibc/macOS/Windows native runners; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -87,8 +87,10 @@ same change as the work it records.
diff gates. The first exact-head native run exposed a macOS `/var` versus `/private/var` watcher
oracle mismatch under E-M3-CI-RED-001. The corrected exact-head run passed target-native build,
archive/tree verification, bundled Node, patched PTY, and watcher smoke for Linux x64/arm64 and
- macOS x64/arm64 under E-M3-CI-001. Same-runner clean-rebuild identity, oldest-baseline,
- native-trust, SSH, Windows, and musl cells remain open.
+ macOS x64/arm64 under E-M3-CI-001. A bounded comparator now rejects incomplete outputs and any
+ runtime-tree, archive, identity, SPDX, provenance, type, mode, size, or digest drift after two
+ independently verified clean builds; its focused contract is locally green, but exact-head native
+ execution remains pending. Oldest-baseline, native-trust, SSH, and musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -125,11 +127,12 @@ same change as the work it records.
- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
- Legacy fallback removal: not authorized.
-- Next required action: add a same-head/same-runner two-clean-build identity comparison that fails
- closed on any tree, archive, SBOM, provenance, or identity drift, then run it for every target-
- native candidate. Keep oldest-baseline, cross-family remote infrastructure, signing/trust, and
- measured legacy baseline gates open; do not introduce publication, resolver, transfer, rollout,
- tuple enablement, or default behavior.
+- Next required action: finish the exact implementation-commit local gates, push the bounded
+ two-clean-build comparator/workflow package to draft PR #8741, and require every target-native job
+ to compare complete runtime-tree, archive, identity, SPDX, and provenance outputs before upload.
+ Record every native drift instead of weakening the oracle. Keep oldest-baseline, cross-family
+ remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
+ publication, resolver, transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -597,8 +600,11 @@ transfer, install, fallback, rollout setting, or tuple enablement belongs in thi
**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head run 29345126283 proves all
six target-native artifact/executable jobs, including normal Windows x64/arm64 settlement and
-unpublished upload. Add a bounded same-head/same-runner two-clean-build comparison without changing
-artifact consumers, publication, the repository-wide node-pty patch, or the legacy/default path.
+unpublished upload. The locally green bounded comparator now requires two independently verified
+clean outputs and exact type/mode/size/SHA-256 equality for the runtime tree, archive, identity,
+SPDX, and provenance before uploading only the first output. Exact-head native execution remains
+open; artifact consumers, publication, the repository-wide node-pty patch, and the legacy/default
+path remain unchanged.
Each runtime must contain only the executable closure required by the relay.
@@ -1258,6 +1264,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs` (E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001; native evidence remains pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs` (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001; native classification pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs` (E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; native settlement pending)
+- [ ] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-reproducibility.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (locally green on the uncommitted implementation tree; rerun on the exact implementation commit before checking)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -3599,10 +3606,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit and push the bounded post-smoke resource diagnostic, then capture both native Windows
-resource snapshots through the existing parent timeout without making another cleanup change. Use
-that evidence to isolate the owning subsystem before requiring exact-head normal exit and artifact
-upload. The separate clean-build identity gate, cross-family Layer B target pool, protected
-manifest-signing environment, and paired legacy performance baseline remain release/default-path
-blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta, fallback, tuple
-enablement, or default behavior may be connected by this package.
+Complete the exact implementation-commit local gates, push the bounded two-clean-build
+reproducibility package to draft PR #8741, and run all six target-native jobs. Each job must build,
+verify, and smoke two exclusive outputs, compare every runtime-tree/archive/identity/SPDX/provenance
+entry, and upload only after equality. Record exact differing paths and fields for every native red
+result and correct the producer without weakening the oracle. Cross-family Layer B targets, the
+protected manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy
+performance baseline remain release/default-path blockers; no publication, desktop resolver, SSH
+transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may be connected
+by this package.
From 09b047f4eee224b45ca337b46b8402016290a1a9 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 11:52:07 -0400
Subject: [PATCH 022/267] docs(ssh): record clean-build oracle gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 107 ++++++++++++++----
1 file changed, 88 insertions(+), 19 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 72dd4cd7ae6..09fd779be96 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -89,8 +89,9 @@ same change as the work it records.
archive/tree verification, bundled Node, patched PTY, and watcher smoke for Linux x64/arm64 and
macOS x64/arm64 under E-M3-CI-001. A bounded comparator now rejects incomplete outputs and any
runtime-tree, archive, identity, SPDX, provenance, type, mode, size, or digest drift after two
- independently verified clean builds; its focused contract is locally green, but exact-head native
- execution remains pending. Oldest-baseline, native-trust, SSH, and musl cells remain open.
+ independently verified clean builds; its exact implementation-commit contract and static gates
+ are locally green under E-M3-REPRODUCIBILITY-LOCAL-001, but exact-head native execution remains
+ pending. Oldest-baseline, native-trust, SSH, and musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -600,11 +601,11 @@ transfer, install, fallback, rollout setting, or tuple enablement belongs in thi
**Active sub-gate — 2026-07-14, Codex implementation owner:** exact-head run 29345126283 proves all
six target-native artifact/executable jobs, including normal Windows x64/arm64 settlement and
-unpublished upload. The locally green bounded comparator now requires two independently verified
-clean outputs and exact type/mode/size/SHA-256 equality for the runtime tree, archive, identity,
-SPDX, and provenance before uploading only the first output. Exact-head native execution remains
-open; artifact consumers, publication, the repository-wide node-pty patch, and the legacy/default
-path remain unchanged.
+unpublished upload. E-M3-REPRODUCIBILITY-LOCAL-001 proves the bounded comparator requires two
+independently verified clean outputs and exact type/mode/size/SHA-256 equality for the runtime tree,
+archive, identity, SPDX, and provenance before uploading only the first output. Exact-head native
+execution remains open; artifact consumers, publication, the repository-wide node-pty patch, and
+the legacy/default path remain unchanged.
Each runtime must contain only the executable closure required by the relay.
@@ -1204,16 +1205,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; reproducibility active | `d9a556b9c`; E-M3-NODE-PROVENANCE-001, E-M3-RUNTIME-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native reproducibility pending | `c70e96374`; E-M3-REPRODUCIBILITY-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1264,7 +1265,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-pty-smoke.test.mjs` (E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-RED-001, E-M3-WINDOWS-SMOKE-SETTLEMENT-LOCAL-001; native evidence remains pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs` (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001; native classification pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs` (E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; native settlement pending)
-- [ ] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-reproducibility.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (locally green on the uncommitted implementation tree; rerun on the exact implementation commit before checking)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-reproducibility.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (E-M3-REPRODUCIBILITY-LOCAL-001; synthetic comparator/workflow contract only, native execution pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -3549,6 +3550,74 @@ or unexpected token`; the first logs did not identify a source location.
deterministic Windows ZIP assembly and native Windows jobs, and leave all tuples disabled until
the remaining trust, baseline, and two-layer live SSH gates pass.
+### E-M3-REPRODUCIBILITY-LOCAL-001 — Bounded two-clean-build identity oracle
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `c70e96374cafb681c52b3d60e42322ba5a76791c` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741); native PR CI pending
+- Runner: macOS 26.2 build 25C56 arm64, native; Node v26.0.0 and pnpm 10.24.0. Node v24.18.0 on
+ each target-native GitHub runner remains the authoritative artifact environment.
+- Remote and transport: none; synthetic output trees and parsed GitHub Actions workflow only
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-reproducibility.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-reproducibility.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff HEAD^ --check
+ ```
+
+- Result: PASS. The purpose-named comparator/workflow command passed 10/10 tests in 200 ms; the
+ complete artifact set passed 40/40 tests across 11 suites in 1.09 seconds. Typecheck, focused
+ oxlint, the 355-entry max-lines ratchet, full repository lint/reliability/localization, formatting,
+ and exact-commit diff checks all exited zero. Full lint emitted only pre-existing warnings outside
+ this package.
+- Duration and resource metrics: purpose suite 0.87 seconds wall; full artifact suite 3.02 seconds;
+ typecheck 8.47 seconds; focused oxlint 1.94 seconds; max-lines 4.95 seconds; full lint 26.34 seconds;
+ formatting 5.56 seconds; diff check 90 ms. Comparator file reads are incremental, bounded to 250
+ MiB per file and 500 MiB per output, with 6,000 entries, 512-byte paths, depth 40, a five-minute
+ AbortSignal, and sequential tree walks. Peak RSS/open files were not instrumented for synthetic
+ fixtures; native CI remains responsible for real artifact duration and size evidence.
+- Artifact/log/trace link: exact source and test files in commit `c70e96374`; durable target-native
+ run and job links pending
+- Oracle proved: distinct real output roots are required; symlinks and special files reject before
+ hashing; complete runtime/archive/identity/SPDX/provenance output is mandatory; archive bytes must
+ match their identity; any path type, mode, size, or SHA-256 drift fails closed. Both POSIX and
+ Windows jobs build and independently verify/smoke two exclusive outputs, compare only afterward,
+ and copy/upload only the first verified equal output. The workflow retains read-only permissions,
+ exact-head checkout, SHA-pinned actions, explicit runner labels, and no release publication path.
+- Does not prove: any real native build is reproducible, Node v24 execution, compiler/linker
+ determinism, Linux/macOS/Windows output equality, oldest baselines, native trust/signing, SSH,
+ publication, transfer, cache, fallback, UI, or an enabled tuple.
+- Checklist items satisfied: purpose-named local reproducibility/workflow command and exact-commit
+ static handoff only; no per-tuple or native-trust checkbox changes.
+- Follow-up: push the exact head, run all six native jobs, and record the exact differing path/field
+ for every red result before correcting producer nondeterminism without weakening this oracle.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -3559,7 +3628,7 @@ owner and promotion condition.
| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | One successful artifact per corrected-head hosted runner | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Native clean-rebuild identity unproved | Bounded local oracle is green; six target-native comparisons pending | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
From e58913d1a571f4c578a7fe1dc51ef5c93e9b3136 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:05:53 -0400
Subject: [PATCH 023/267] test(ssh): improve native reproducibility diagnostics
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 6 ++++++
.../ssh-relay-runtime-reproducibility.mjs | 11 ++++++++---
.../ssh-relay-runtime-reproducibility.test.mjs | 17 +++++++++++++++++
.../scripts/ssh-relay-runtime-workflow.test.mjs | 3 +++
4 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 21e36216a16..48a82e1c950 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -103,6 +103,8 @@ jobs:
shell: bash
run: |
set -euo pipefail
+ node --check config/scripts/ssh-relay-runtime-reproducibility.mjs
+ node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
@@ -258,6 +260,10 @@ jobs:
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
+ node --check config/scripts/ssh-relay-runtime-reproducibility.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility test syntax check failed' }
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
diff --git a/config/scripts/ssh-relay-runtime-reproducibility.mjs b/config/scripts/ssh-relay-runtime-reproducibility.mjs
index febadab9db0..f3217a7650d 100644
--- a/config/scripts/ssh-relay-runtime-reproducibility.mjs
+++ b/config/scripts/ssh-relay-runtime-reproducibility.mjs
@@ -1,5 +1,3 @@
-#!/usr/bin/env node
-
import { createHash } from 'node:crypto'
import { createReadStream } from 'node:fs'
import { lstat, opendir, readFile, realpath } from 'node:fs/promises'
@@ -148,7 +146,14 @@ async function validateCompleteOutput(directory, label, tuple, snapshot) {
}
function compareSnapshots(first, second) {
- const paths = [...new Set([...first.entries.keys(), ...second.entries.keys()])].sort()
+ const paths = [...new Set([...first.entries.keys(), ...second.entries.keys()])].sort(
+ (left, right) => {
+ // Runtime bytes are the producer root cause; metadata and archive names often drift after them.
+ const leftPriority = left === 'runtime' || left.startsWith('runtime/') ? 0 : 1
+ const rightPriority = right === 'runtime' || right.startsWith('runtime/') ? 0 : 1
+ return leftPriority - rightPriority || left.localeCompare(right)
+ }
+ )
for (const path of paths) {
const left = first.entries.get(path)
const right = second.entries.get(path)
diff --git a/config/scripts/ssh-relay-runtime-reproducibility.test.mjs b/config/scripts/ssh-relay-runtime-reproducibility.test.mjs
index 0a346a6f6c9..d14e9a0b752 100644
--- a/config/scripts/ssh-relay-runtime-reproducibility.test.mjs
+++ b/config/scripts/ssh-relay-runtime-reproducibility.test.mjs
@@ -71,6 +71,23 @@ describe('SSH relay runtime clean-build reproducibility', () => {
)
})
+ it('reports runtime drift before derived identity drift', async () => {
+ const fixture = await createOutputs()
+ await writeFile(join(fixture.secondOutputDirectory, 'runtime', 'relay.js'), 'other bytes')
+ const identityPath = join(
+ fixture.secondOutputDirectory,
+ `orca-ssh-relay-runtime-${tuple}.identity.json`
+ )
+ await writeFile(
+ identityPath,
+ `${JSON.stringify({ tupleId: tuple, contentId: `sha256:${'c'.repeat(64)}`, archive: { name: archiveName, sha256: archiveSha256 } })}\n`
+ )
+
+ await expect(verifySshRelayRuntimeReproducibility({ ...fixture, tuple })).rejects.toThrow(
+ 'reproducibility mismatch for runtime/relay.js: sha256'
+ )
+ })
+
it('rejects SBOM byte drift', async () => {
const fixture = await createOutputs()
await writeFile(
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index e505f7887f1..0e370504669 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -61,6 +61,9 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('foreach ($output in @($firstOutput, $secondOutput))')
expect(source).toContain('ssh-relay-runtime-reproducibility.mjs')
expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
+ expect(source).toContain(
+ 'node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs'
+ )
expect(source).toContain('cp "$first_output"/*.tar.xz')
expect(source).toContain("Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
From c62b0d0a9580b132fec5f11c3234a983503a011c Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:08:20 -0400
Subject: [PATCH 024/267] docs(ssh): record native reproducibility red
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 161 ++++++++++++++++--
1 file changed, 148 insertions(+), 13 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 09fd779be96..63f487e6b6f 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — the bounded same-head, same-runner two-clean-build identity oracle is locally green and awaits exact-head execution on all six glibc/macOS/Windows native runners; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — completed exact-head two-clean-build run 29347236627 is an evidence-producing red: both Linux cells passed, both macOS cells exposed reproducibility drift, and both Windows cells exposed a comparator test-collection syntax failure; bounded diagnostic corrections are local only and await a new exact-head run; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -90,8 +90,14 @@ same change as the work it records.
macOS x64/arm64 under E-M3-CI-001. A bounded comparator now rejects incomplete outputs and any
runtime-tree, archive, identity, SPDX, provenance, type, mode, size, or digest drift after two
independently verified clean builds; its exact implementation-commit contract and static gates
- are locally green under E-M3-REPRODUCIBILITY-LOCAL-001, but exact-head native execution remains
- pending. Oldest-baseline, native-trust, SSH, and musl cells remain open.
+ are locally green under E-M3-REPRODUCIBILITY-LOCAL-001. Exact-head run
+ [29347236627](https://github.com/stablyai/orca/actions/runs/29347236627) passed both Linux cells,
+ exposed macOS x64/arm64 runtime identity drift, and failed Windows x64/arm64 while collecting the
+ new comparator suite under E-M3-REPRODUCIBILITY-CI-RED-001.
+ E-M3-REPRODUCIBILITY-DIAGNOSTIC-LOCAL-001 removes the comparator shebang, checks both new files
+ with `node --check` on POSIX and Windows, and reports runtime-tree drift before derived metadata
+ drift; native proof of those corrections remains open. Oldest-baseline, native-trust, SSH, and
+ musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -125,13 +131,16 @@ same change as the work it records.
- Validation orchestration: GitHub Actions is the primary runner and evidence surface under
E-M1-RUNNER-DECISION-001; exact native labels are recorded, while representative cross-family
remote targets remain open.
-- Rollout control: existing per-SSH-target configuration; legacy is the default and the bundled
- runtime is an explicit per-target Beta opt-in under E-M1-ROLLOUT-DECISION-001.
+- Rollout control: the Beta-tagged option lives on SSH target add/edit surfaces and is persisted per
+ target through existing target configuration. It is off by default for existing, new, imported,
+ missing, unknown, and malformed configurations, all of which resolve to legacy. Only an explicit
+ per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
+ authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: finish the exact implementation-commit local gates, push the bounded
- two-clean-build comparator/workflow package to draft PR #8741, and require every target-native job
- to compare complete runtime-tree, archive, identity, SPDX, and provenance outputs before upload.
- Record every native drift instead of weakening the oracle. Keep oldest-baseline, cross-family
+- Next required action: finish the exact implementation-commit local gates for the bounded Windows
+ parser and diagnostic-order correction, then push and rerun all six target-native jobs. Use the
+ runtime-first comparator output to isolate
+ macOS producer nondeterminism without weakening the oracle. Keep oldest-baseline, cross-family
remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
publication, resolver, transfer, rollout, tuple enablement, or default behavior.
@@ -603,9 +612,12 @@ transfer, install, fallback, rollout setting, or tuple enablement belongs in thi
six target-native artifact/executable jobs, including normal Windows x64/arm64 settlement and
unpublished upload. E-M3-REPRODUCIBILITY-LOCAL-001 proves the bounded comparator requires two
independently verified clean outputs and exact type/mode/size/SHA-256 equality for the runtime tree,
-archive, identity, SPDX, and provenance before uploading only the first output. Exact-head native
-execution remains open; artifact consumers, publication, the repository-wide node-pty patch, and
-the legacy/default path remain unchanged.
+archive, identity, SPDX, and provenance before uploading only the first output. Exact-head run
+29347236627 is intentionally red under E-M3-REPRODUCIBILITY-CI-RED-001: Linux x64/arm64 passed,
+macOS x64/arm64 produced unequal clean outputs, and Windows x64/arm64 failed comparator test
+collection. E-M3-REPRODUCIBILITY-DIAGNOSTIC-LOCAL-001 proves the bounded parser/diagnostic
+correction locally; native execution is still open. Artifact consumers, publication, the
+repository-wide node-pty patch, and the legacy/default path remain unchanged.
Each runtime must contain only the executable closure required by the relay.
@@ -3618,6 +3630,129 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact head, run all six native jobs, and record the exact differing path/field
for every red result before correcting producer nondeterminism without weakening this oracle.
+### E-M3-REPRODUCIBILITY-CI-RED-001 — First native clean-build comparison
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `09b047f4eee224b45ca337b46b8402016290a1a9` in stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29347236627](https://github.com/stablyai/orca/actions/runs/29347236627);
+ Linux x64 `87134028593`, Linux arm64 `87134028669`, macOS arm64 `87134028547`, macOS x64
+ `87134028651`, Windows x64 `87134028652`, Windows arm64 `87134028632`
+- Runners: `ubuntu-24.04` x64, `ubuntu-24.04-arm` arm64, `macos-15-intel` x64,
+ `macos-15` arm64, `windows-2022` x64, and `windows-11-arm` arm64; Node v24.18.0. The macOS
+ arm64 failure ran on macOS 15.7.7 image `20260706.0213.1`; the x64 failure ran on macOS 15.7.7
+ image `20260629.0276.1`. Both used Xcode 16.4 build 16F6.
+- Remote and transport: none; GitHub-hosted target-native artifact jobs only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29347236627 --repo stablyai/orca \
+ --json databaseId,headSha,status,conclusion,url,jobs
+ gh api -H 'Accept: application/vnd.github+json' \
+ repos/stablyai/orca/actions/jobs//logs
+ ```
+
+- Result: Linux x64 and arm64 independently built, verified, smoked, compared equal, and uploaded
+ unpublished evidence. macOS arm64 independently verified and smoked both outputs but failed the
+ equality gate: content IDs were
+ `sha256:f1bbc1de26d6e9aae3899754c4ac4aea694ad9f5197fcf1c773e29fc50401129` and
+ `sha256:c26eba0226e73542a0cd7aec0ca5fa7e3809051453e40095e47fe9d154ba944f`; archive
+ digests/sizes were
+ `sha256:9cd56317ff03eb4e89a811e46736dc7558e447b9f0cd2d7e20fdeb5e5c40114a` /
+ 24,714,656 bytes and
+ `sha256:cde8fa92470fdf73ec02e8e6ebbf23417e43d98b465fa9c6bdea4373be8c3e84` /
+ 24,714,700 bytes. macOS x64 likewise failed with content IDs
+ `sha256:b71d7d50bba78b6cf9e6dc24b006d48c709a784c7eb77f500e86ab5fe692690b` and
+ `sha256:ceae81924c97c917855af864239b87a7d2eecc28de7d00c21c32c47c5385354f`;
+ archive digests/sizes were
+ `sha256:01f7d4c6d54241e211c5063b89e92a3511433b18a50cb643bbfbe0384546a50e` /
+ 26,384,540 bytes and
+ `sha256:f98dfdead87f4884382fedc3e3bff0197a3b2aa6981c38107e198cb38e8bdf67` /
+ 26,384,576 bytes. The committed comparator first reported identity SHA-256 drift on both macOS
+ architectures. Windows x64 and arm64 stopped before downloading Node inputs or building artifacts
+ because Vitest collected zero comparator tests with `SyntaxError: Invalid or unexpected token`;
+ the other 10 suites passed with 31 tests passed and one skipped.
+- Duration and resource metrics: Linux build/compare steps completed in 125 seconds (x64) and 131
+ seconds (arm64); macOS arm64 failed after 123 seconds in the build/compare step. Windows contract
+ suites completed in 1.54 seconds on arm64 and before artifact assembly on both architectures.
+ Peak RSS, file/channel counts, and cancellation settlement were not instrumented by this gate.
+- Artifact/log/trace link: run and job links above. The two Linux evidence artifacts are unpublished;
+ failed cells uploaded no runtime artifact.
+- Oracle proved: the equality gate accepts both Linux glibc tuples and detects real macOS
+ clean-build drift; Windows contract collection fails before unverified artifact work can start.
+ No asset was published and no production or default path changed.
+- Does not prove: Windows parser correction, macOS producer determinism, oldest baselines, native
+ trust/signing, SSH, SFTP/system-SSH, release publication, resolver/cache,
+ transfer/install, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: none newly complete; native reproducibility remains open.
+- Follow-up: remove the comparator shebang, add explicit native `node --check` gates, report
+ runtime-tree drift before derived metadata, rerun all six jobs, and correct the macOS producer only
+ after the exact differing runtime file is identified. Never ignore or normalize unequal bytes in
+ the comparator.
+
+### E-M3-REPRODUCIBILITY-DIAGNOSTIC-LOCAL-001 — Windows parser and runtime-first drift diagnostics
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `e58913d1a571f4c578a7fe1dc51ef5c93e9b3136` in stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: macOS 26.2 build 25C56 arm64, native; Node v26.0.0 and pnpm 10.24.0. Node v24.18.0
+ target-native GitHub execution remains pending.
+- Remote and transport: none; local synthetic comparator fixtures and workflow source contract only
+- Exact commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-runtime-reproducibility.mjs
+ node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-reproducibility.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-reproducibility.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. Both new files passed `node --check`; the purpose suite passed 11/11 tests; the
+ complete artifact set passed 41/41 tests across 11 suites. Typecheck, focused oxlint, the
+ 355-entry max-lines ratchet, full repository lint/reliability/localization, formatting, and diff
+ checks exited zero. Full lint emitted only pre-existing warnings outside this package.
+- Duration and resource metrics: syntax checks 60 ms and 50 ms; purpose suite 850 ms wall; complete
+ artifact suite 1.27 seconds wall; typecheck 2.00 seconds; focused oxlint 480 ms; max-lines 780 ms;
+ full lint 11.96 seconds. Synthetic fixture peak RSS/open files were not instrumented.
+- Artifact/log/trace link: exact sources in commit `e58913d1a`; target-native rerun pending
+- Oracle proved: the comparator and its test import parse locally without the shebang; both POSIX
+ and Windows workflow contract stages run explicit syntax checks before Vitest or artifact inputs;
+ a simultaneous runtime/identity drift reports the runtime-tree path first. The comparator still
+ compares every byte and does not normalize or ignore drift.
+- Does not prove: Windows x64/arm64 parsing, any native build, the differing macOS runtime path,
+ macOS determinism, oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or an
+ enabled tuple.
+- Checklist items satisfied: no native or tuple box; this closes only the local diagnostic
+ correction required after E-M3-REPRODUCIBILITY-CI-RED-001.
+- Follow-up: push the exact commit, rerun all six native jobs, require both Windows syntax checks to
+ pass, and use the macOS runtime-first failure path to correct producer nondeterminism.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -3628,7 +3763,7 @@ owner and promotion condition.
| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Bounded local oracle is green; six target-native comparisons pending | Toolchain drift may change native content IDs | Codex implementation owner | Same-head, same-runner clean builds match or a reviewed reproducibility policy | Open |
+| Native clean-rebuild identity unproved | Linux x64/arm64 pass; macOS x64/arm64 and the Windows parser are red | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
From a09b02ec4e623cc8cac8ece089e4ff734014dd5b Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:32:30 -0400
Subject: [PATCH 025/267] build(ssh): stabilize native runtime rebuilds
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 10 ++++
config/scripts/build-ssh-relay-runtime.mjs | 39 +++++++++++---
config/scripts/ssh-relay-node-pty-build.mjs | 54 +++++++++++++------
.../scripts/ssh-relay-node-pty-build.test.mjs | 35 ++++++++++++
...lay-node-pty-windows-build-determinism.mjs | 31 +++++++++++
...ode-pty-windows-build-determinism.test.mjs | 44 +++++++++++++++
.../scripts/ssh-relay-runtime-build.test.mjs | 51 ++++++++++++++++++
.../ssh-relay-runtime-workflow.test.mjs | 4 ++
8 files changed, 244 insertions(+), 24 deletions(-)
create mode 100644 config/scripts/ssh-relay-node-pty-build.test.mjs
create mode 100644 config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
create mode 100644 config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
create mode 100644 config/scripts/ssh-relay-runtime-build.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 48a82e1c950..f233ef39ad9 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -108,9 +108,12 @@ jobs:
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
@@ -140,6 +143,7 @@ jobs:
mkdir -p "$output_root"
first_output="$output_root/first"
second_output="$output_root/second"
+ work_directory="$output_root/build-work"
source_commit=$(git rev-parse HEAD)
source_date_epoch=$(git show -s --format=%ct "$source_commit")
for output in "$first_output" "$second_output"; do
@@ -148,6 +152,7 @@ jobs:
--tuple '${{ matrix.tuple }}' \
--inputs-directory "$NODE_INPUTS" \
--output-directory "$output" \
+ --work-directory "$work_directory" \
--source-date-epoch "$source_date_epoch" \
--git-commit "$source_commit"
identity="$output/orca-ssh-relay-runtime-${{ matrix.tuple }}.identity.json"
@@ -267,9 +272,12 @@ jobs:
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
+ config/scripts/ssh-relay-node-pty-build.test.mjs `
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs `
config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs `
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
+ config/scripts/ssh-relay-runtime-build.test.mjs `
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
config/scripts/ssh-relay-runtime-reproducibility.test.mjs `
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
@@ -310,6 +318,7 @@ jobs:
New-Item -ItemType Directory -Path $outputRoot -Force | Out-Null
$firstOutput = Join-Path $outputRoot 'first'
$secondOutput = Join-Path $outputRoot 'second'
+ $workDirectory = Join-Path $outputRoot 'build-work'
$sourceCommit = git rev-parse HEAD
$sourceDateEpoch = git show -s --format=%ct $sourceCommit
foreach ($output in @($firstOutput, $secondOutput)) {
@@ -318,6 +327,7 @@ jobs:
--tuple '${{ matrix.tuple }}' `
--inputs-directory $env:NODE_INPUTS `
--output-directory $output `
+ --work-directory $workDirectory `
--source-date-epoch $sourceDateEpoch `
--git-commit $sourceCommit
if ($LASTEXITCODE -ne 0) { throw 'runtime build failed' }
diff --git a/config/scripts/build-ssh-relay-runtime.mjs b/config/scripts/build-ssh-relay-runtime.mjs
index 346481f5c06..8bf4725b455 100644
--- a/config/scripts/build-ssh-relay-runtime.mjs
+++ b/config/scripts/build-ssh-relay-runtime.mjs
@@ -1,9 +1,8 @@
#!/usr/bin/env node
import { execFile } from 'node:child_process'
-import { mkdir, mkdtemp, readFile, rm } from 'node:fs/promises'
-import { tmpdir } from 'node:os'
-import { dirname, join, resolve } from 'node:path'
+import { mkdir, readFile, rm } from 'node:fs/promises'
+import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
import { promisify } from 'node:util'
import { buildPatchedSshRelayNodePty } from './ssh-relay-node-pty-build.mjs'
@@ -51,6 +50,8 @@ export function parseBuildArguments(argv) {
result.inputsDirectory = resolve(value)
} else if (flag === '--output-directory') {
result.outputDirectory = resolve(value)
+ } else if (flag === '--work-directory') {
+ result.workDirectory = resolve(value)
} else if (flag === '--contract') {
result.contractPath = resolve(value)
} else if (flag === '--source-date-epoch') {
@@ -66,6 +67,7 @@ export function parseBuildArguments(argv) {
'tuple',
'inputsDirectory',
'outputDirectory',
+ 'workDirectory',
'sourceDateEpoch',
'gitCommit'
]) {
@@ -85,6 +87,20 @@ export function parseBuildArguments(argv) {
return result
}
+function containsPath(parent, candidate) {
+ const path = relative(parent, candidate)
+ return path === '' || (path !== '..' && !path.startsWith(`..${sep}`) && !isAbsolute(path))
+}
+
+export function assertDisjointRuntimeBuildDirectories(outputDirectory, workDirectory) {
+ if (
+ containsPath(outputDirectory, workDirectory) ||
+ containsPath(workDirectory, outputDirectory)
+ ) {
+ throw new Error('Runtime output and work directories must be disjoint')
+ }
+}
+
function assertTargetNative(tuple) {
const os = tuple.startsWith('linux-') ? 'linux' : tuple.startsWith('darwin-') ? 'darwin' : 'win32'
const architecture = tuple.includes('arm64') ? 'arm64' : 'x64'
@@ -153,6 +169,7 @@ function relayPlatform(tuple) {
export async function buildSshRelayRuntime(options) {
const started = process.hrtime.bigint()
assertTargetNative(options.tuple)
+ assertDisjointRuntimeBuildDirectories(options.outputDirectory, options.workDirectory)
const release = validateSshRelayNodeReleaseContract(
JSON.parse(await readFile(options.contractPath, 'utf8'))
)
@@ -161,11 +178,17 @@ export async function buildSshRelayRuntime(options) {
inputsDirectory: options.inputsDirectory,
archiveTuples: [options.tuple]
})
- const workDirectory = await mkdtemp(join(tmpdir(), `orca-runtime-${options.tuple}-`))
- // Why: the final directory is still created exclusively, but callers need not pre-create parents.
- await mkdir(dirname(options.outputDirectory), { recursive: true })
+ const workDirectory = options.workDirectory
+ // Why: both final and clean-build paths are exclusive, but callers need not pre-create parents.
+ await Promise.all([
+ mkdir(dirname(options.outputDirectory), { recursive: true }),
+ mkdir(dirname(workDirectory), { recursive: true })
+ ])
await mkdir(options.outputDirectory)
+ let workDirectoryCreated = false
try {
+ await mkdir(workDirectory)
+ workDirectoryCreated = true
await run(process.execPath, [resolve(scriptDirectory, 'build-relay.mjs')], { cwd: projectRoot })
const extractedDirectory = join(workDirectory, 'node-inputs')
const nodeArchivePath = join(options.inputsDirectory, release.archives[options.tuple].name)
@@ -244,7 +267,9 @@ export async function buildSshRelayRuntime(options) {
await rm(options.outputDirectory, { recursive: true, force: true })
throw error
} finally {
- await rm(workDirectory, { recursive: true, force: true })
+ if (workDirectoryCreated) {
+ await rm(workDirectory, { recursive: true, force: true })
+ }
}
}
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 2d8bd2b3bfb..88024154e27 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -5,6 +5,7 @@ import { dirname, join, resolve } from 'node:path'
import { promisify } from 'node:util'
import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-settlement.mjs'
+import { applyWindowsNodePtyBuildDeterminism } from './ssh-relay-node-pty-windows-build-determinism.mjs'
const require = createRequire(import.meta.url)
const execFileAsync = promisify(execFile)
@@ -14,6 +15,21 @@ const BUILD_TIMEOUT_MS = 10 * 60 * 1000
const COMMAND_TIMEOUT_MS = 60 * 1000
const MAX_COMMAND_OUTPUT_BYTES = 16 * 1024 * 1024
+export function nodePtyNativeBuildCommands({ nodePath, nodeRoot, tuple }) {
+ const nodeGypArguments = ['--release', `--nodedir=${nodeRoot}`]
+ if (!tuple.startsWith('darwin-')) {
+ return [{ command: nodePath, args: [NODE_GYP_PATH, 'rebuild', ...nodeGypArguments] }]
+ }
+ return [
+ { command: nodePath, args: [NODE_GYP_PATH, 'configure', ...nodeGypArguments] },
+ {
+ command: 'make',
+ // Why: ld must retain a loadable UUID while ignoring incidental inputs such as build time.
+ args: ['-C', 'build', 'BUILDTYPE=Release', 'LDFLAGS.target=-Wl,-reproducible']
+ }
+ ]
+}
+
async function runCommand(command, args, options = {}) {
// Why: native build tools can be noisy or hang; both cases must settle within explicit bounds.
const result = await execFileAsync(command, args, {
@@ -134,6 +150,7 @@ export async function buildPatchedSshRelayNodePty({
dereference: true,
filter: sourceFilter
})
+ await applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: buildDirectory, tuple })
await applyWindowsNodePtySettlement({
nodePtyLibraryDirectory: join(buildDirectory, 'lib'),
tuple
@@ -147,23 +164,26 @@ export async function buildPatchedSshRelayNodePty({
const controller = new AbortController()
const timeout = setTimeout(() => controller.abort(), BUILD_TIMEOUT_MS)
try {
- await runCommand(nodePath, [NODE_GYP_PATH, 'rebuild', '--release', `--nodedir=${nodeRoot}`], {
- cwd: buildDirectory,
- signal: controller.signal,
- timeout: BUILD_TIMEOUT_MS,
- windowsHide: true,
- env: {
- ...process.env,
- PATH: `${dirname(nodePath)}${process.platform === 'win32' ? ';' : ':'}${process.env.PATH ?? ''}`,
- npm_config_arch: tuple.includes('arm64') ? 'arm64' : 'x64',
- npm_config_build_from_source: 'true',
- npm_config_nodedir: nodeRoot,
- // Why: a successful build must prove all Node inputs were staged, never fetched implicitly.
- npm_config_offline: 'true',
- npm_config_disturl: 'http://127.0.0.1:9',
- npm_config_target: nodeVersion
- }
- })
+ const buildEnvironment = {
+ ...process.env,
+ PATH: `${dirname(nodePath)}${process.platform === 'win32' ? ';' : ':'}${process.env.PATH ?? ''}`,
+ npm_config_arch: tuple.includes('arm64') ? 'arm64' : 'x64',
+ npm_config_build_from_source: 'true',
+ npm_config_nodedir: nodeRoot,
+ // Why: a successful build must prove all Node inputs were staged, never fetched implicitly.
+ npm_config_offline: 'true',
+ npm_config_disturl: 'http://127.0.0.1:9',
+ npm_config_target: nodeVersion
+ }
+ for (const buildCommand of nodePtyNativeBuildCommands({ nodePath, nodeRoot, tuple })) {
+ await runCommand(buildCommand.command, buildCommand.args, {
+ cwd: buildDirectory,
+ signal: controller.signal,
+ timeout: BUILD_TIMEOUT_MS,
+ windowsHide: true,
+ env: buildEnvironment
+ })
+ }
} finally {
clearTimeout(timeout)
}
diff --git a/config/scripts/ssh-relay-node-pty-build.test.mjs b/config/scripts/ssh-relay-node-pty-build.test.mjs
new file mode 100644
index 00000000000..9a8f567cf58
--- /dev/null
+++ b/config/scripts/ssh-relay-node-pty-build.test.mjs
@@ -0,0 +1,35 @@
+import { describe, expect, it } from 'vitest'
+
+import { nodePtyNativeBuildCommands } from './ssh-relay-node-pty-build.mjs'
+
+const nodePath = '/staged/node'
+const nodeRoot = '/staged/node-root'
+
+describe('SSH relay node-pty native build commands', () => {
+ it('uses the ordinary node-gyp rebuild on Linux and Windows', () => {
+ for (const tuple of ['linux-x64-glibc', 'linux-arm64-glibc', 'win32-x64', 'win32-arm64']) {
+ const commands = nodePtyNativeBuildCommands({ nodePath, nodeRoot, tuple })
+ expect(commands).toHaveLength(1)
+ expect(commands[0]).toMatchObject({ command: nodePath })
+ expect(commands[0].args).toEqual(
+ expect.arrayContaining(['rebuild', '--release', `--nodedir=${nodeRoot}`])
+ )
+ expect(commands[0].args).not.toContain('LDFLAGS.target=-Wl,-reproducible')
+ }
+ })
+
+ it('configures macOS before reproducibly linking a loadable Mach-O UUID', () => {
+ for (const tuple of ['darwin-x64', 'darwin-arm64']) {
+ const commands = nodePtyNativeBuildCommands({ nodePath, nodeRoot, tuple })
+ expect(commands).toHaveLength(2)
+ expect(commands[0]).toMatchObject({ command: nodePath })
+ expect(commands[0].args).toEqual(
+ expect.arrayContaining(['configure', '--release', `--nodedir=${nodeRoot}`])
+ )
+ expect(commands[1]).toEqual({
+ command: 'make',
+ args: ['-C', 'build', 'BUILDTYPE=Release', 'LDFLAGS.target=-Wl,-reproducible']
+ })
+ }
+ })
+})
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
new file mode 100644
index 00000000000..199375674d7
--- /dev/null
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -0,0 +1,31 @@
+import { readFile, writeFile } from 'node:fs/promises'
+import { join } from 'node:path'
+
+const LINKER_OPTIONS = ` 'VCLinkerTool': {
+ 'AdditionalOptions': [
+ '/DYNAMICBASE',
+ '/guard:cf'
+ ]
+ }`
+
+const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
+ 'AdditionalOptions': [
+ '/DYNAMICBASE',
+ '/guard:cf',
+ '/Brepro'
+ ]
+ }`
+
+export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tuple }) {
+ if (!tuple.startsWith('win32-')) {
+ return false
+ }
+ const bindingPath = join(nodePtyDirectory, 'binding.gyp')
+ const source = await readFile(bindingPath, 'utf8')
+ if (source.split(LINKER_OPTIONS).length !== 2 || source.includes("'/Brepro'")) {
+ throw new Error('node-pty Windows linker settings do not match the reviewed source')
+ }
+ // Why: MSVC otherwise embeds per-build timestamps/identities in the copied artifact binaries.
+ await writeFile(bindingPath, source.replace(LINKER_OPTIONS, REPRODUCIBLE_LINKER_OPTIONS), 'utf8')
+ return true
+}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
new file mode 100644
index 00000000000..24985dc889a
--- /dev/null
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -0,0 +1,44 @@
+import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join, resolve } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { applyWindowsNodePtyBuildDeterminism } from './ssh-relay-node-pty-windows-build-determinism.mjs'
+
+const temporaryDirectories = []
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+async function copiedSource() {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-windows-determinism-'))
+ temporaryDirectories.push(directory)
+ await cp(resolve('node_modules/node-pty/binding.gyp'), join(directory, 'binding.gyp'))
+ return directory
+}
+
+describe('SSH relay Windows node-pty build determinism', () => {
+ it('adds deterministic MSVC linking only to the copied Windows source', async () => {
+ const directory = await copiedSource()
+ await expect(
+ applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: directory, tuple: 'win32-arm64' })
+ ).resolves.toBe(true)
+ const source = await readFile(join(directory, 'binding.gyp'), 'utf8')
+ expect(source.match(/'\/Brepro'/g)).toHaveLength(1)
+ })
+
+ it('leaves POSIX source untouched and rejects an unexpected Windows source shape', async () => {
+ const directory = await copiedSource()
+ const original = await readFile(join(directory, 'binding.gyp'), 'utf8')
+ await expect(
+ applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: directory, tuple: 'darwin-arm64' })
+ ).resolves.toBe(false)
+ expect(await readFile(join(directory, 'binding.gyp'), 'utf8')).toBe(original)
+
+ await writeFile(join(directory, 'binding.gyp'), '{}', 'utf8')
+ await expect(
+ applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: directory, tuple: 'win32-x64' })
+ ).rejects.toThrow('do not match the reviewed source')
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-build.test.mjs b/config/scripts/ssh-relay-runtime-build.test.mjs
new file mode 100644
index 00000000000..2e9c8bf8c03
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-build.test.mjs
@@ -0,0 +1,51 @@
+import { resolve } from 'node:path'
+
+import { describe, expect, it } from 'vitest'
+
+import {
+ assertDisjointRuntimeBuildDirectories,
+ parseBuildArguments
+} from './build-ssh-relay-runtime.mjs'
+
+const commit = 'a'.repeat(40)
+const requiredArguments = [
+ '--tuple',
+ 'darwin-arm64',
+ '--inputs-directory',
+ 'inputs',
+ '--output-directory',
+ 'outputs/first',
+ '--work-directory',
+ 'outputs/build-work',
+ '--source-date-epoch',
+ '1752710400',
+ '--git-commit',
+ commit
+]
+
+describe('SSH relay runtime build isolation', () => {
+ it('requires and resolves a caller-owned stable clean-build directory', () => {
+ expect(parseBuildArguments(requiredArguments)).toMatchObject({
+ outputDirectory: resolve('outputs/first'),
+ workDirectory: resolve('outputs/build-work')
+ })
+ expect(() =>
+ parseBuildArguments(requiredArguments.filter((value, index) => ![6, 7].includes(index)))
+ ).toThrow('Missing required build argument: workDirectory')
+ })
+
+ it('rejects work/output overlap before either exclusive directory is created', () => {
+ expect(() => assertDisjointRuntimeBuildDirectories('/tmp/output', '/tmp/output')).toThrow(
+ 'must be disjoint'
+ )
+ expect(() => assertDisjointRuntimeBuildDirectories('/tmp/output', '/tmp/output/work')).toThrow(
+ 'must be disjoint'
+ )
+ expect(() => assertDisjointRuntimeBuildDirectories('/tmp/output/work', '/tmp/output')).toThrow(
+ 'must be disjoint'
+ )
+ expect(() =>
+ assertDisjointRuntimeBuildDirectories('/tmp/output/first', '/tmp/output/build-work')
+ ).not.toThrow()
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 0e370504669..aa05141d367 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -64,6 +64,10 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain(
'node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs'
)
+ expect(source.match(/ssh-relay-node-pty-build\.test\.mjs/g)).toHaveLength(2)
+ expect(source.match(/ssh-relay-node-pty-windows-build-determinism\.test\.mjs/g)).toHaveLength(2)
+ expect(source.match(/ssh-relay-runtime-build\.test\.mjs/g)).toHaveLength(2)
+ expect(source.match(/--work-directory/g)).toHaveLength(2)
expect(source).toContain('cp "$first_output"/*.tar.xz')
expect(source).toContain("Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
From 3e433b3438e8e1aa11d2728e3f2258996b3d37f2 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:36:14 -0400
Subject: [PATCH 026/267] build(ssh): canonicalize native build path
Co-authored-by: Orca
---
.github/workflows/ssh-relay-runtime-artifacts.yml | 4 ++--
config/scripts/ssh-relay-node-pty-build.mjs | 2 +-
config/scripts/ssh-relay-runtime-workflow.test.mjs | 6 ++++++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index f233ef39ad9..605235033af 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -143,7 +143,7 @@ jobs:
mkdir -p "$output_root"
first_output="$output_root/first"
second_output="$output_root/second"
- work_directory="$output_root/build-work"
+ work_directory="$RUNNER_TEMP/orca-ssh-relay-runtime-build-work"
source_commit=$(git rev-parse HEAD)
source_date_epoch=$(git show -s --format=%ct "$source_commit")
for output in "$first_output" "$second_output"; do
@@ -318,7 +318,7 @@ jobs:
New-Item -ItemType Directory -Path $outputRoot -Force | Out-Null
$firstOutput = Join-Path $outputRoot 'first'
$secondOutput = Join-Path $outputRoot 'second'
- $workDirectory = Join-Path $outputRoot 'build-work'
+ $workDirectory = Join-Path $env:RUNNER_TEMP 'orca-ssh-relay-runtime-build-work'
$sourceCommit = git rev-parse HEAD
$sourceDateEpoch = git show -s --format=%ct $sourceCommit
foreach ($output in @($firstOutput, $secondOutput)) {
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 88024154e27..af277f207a7 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -24,7 +24,7 @@ export function nodePtyNativeBuildCommands({ nodePath, nodeRoot, tuple }) {
{ command: nodePath, args: [NODE_GYP_PATH, 'configure', ...nodeGypArguments] },
{
command: 'make',
- // Why: ld must retain a loadable UUID while ignoring incidental inputs such as build time.
+ // Why: a canonical build path plus this flag retains a loadable, reproducible Mach-O UUID.
args: ['-C', 'build', 'BUILDTYPE=Release', 'LDFLAGS.target=-Wl,-reproducible']
}
]
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index aa05141d367..44966859d41 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -68,6 +68,12 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source.match(/ssh-relay-node-pty-windows-build-determinism\.test\.mjs/g)).toHaveLength(2)
expect(source.match(/ssh-relay-runtime-build\.test\.mjs/g)).toHaveLength(2)
expect(source.match(/--work-directory/g)).toHaveLength(2)
+ expect(source).toContain('work_directory="$RUNNER_TEMP/orca-ssh-relay-runtime-build-work"')
+ expect(source).toContain(
+ "$workDirectory = Join-Path $env:RUNNER_TEMP 'orca-ssh-relay-runtime-build-work'"
+ )
+ expect(source).not.toContain('work_directory="$output_root/build-work"')
+ expect(source).not.toContain("Join-Path $outputRoot 'build-work'")
expect(source).toContain('cp "$first_output"/*.tar.xz')
expect(source).toContain("Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip'")
expect(source).toContain('ssh-relay-node-zip-inspection.test.mjs')
From 54df2cb998ae564c1a19cf32a8c93bf28770d07a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:40:31 -0400
Subject: [PATCH 027/267] docs(ssh): record native linker correction
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 258 +++++++++++++++---
1 file changed, 215 insertions(+), 43 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 63f487e6b6f..7cace04205a 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — completed exact-head two-clean-build run 29347236627 is an evidence-producing red: both Linux cells passed, both macOS cells exposed reproducibility drift, and both Windows cells exposed a comparator test-collection syntax failure; bounded diagnostic corrections are local only and await a new exact-head run; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — completed exact-head diagnostic run 29348424235 keeps Linux x64/arm64 green and isolates native drift to macOS `pty.node` and Windows `conpty_console_list.node`; canonical clean-work paths plus platform-native reproducible-link corrections are locally green at `3e433b343` and await a new six-runner exact-head proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -96,8 +96,14 @@ same change as the work it records.
new comparator suite under E-M3-REPRODUCIBILITY-CI-RED-001.
E-M3-REPRODUCIBILITY-DIAGNOSTIC-LOCAL-001 removes the comparator shebang, checks both new files
with `node --check` on POSIX and Windows, and reports runtime-tree drift before derived metadata
- drift; native proof of those corrections remains open. Oldest-baseline, native-trust, SSH, and
- musl cells remain open.
+ drift. E-M3-REPRODUCIBILITY-DIAGNOSTIC-CI-RED-001 proves those diagnostics on all six native
+ runners: Linux x64/arm64 remain equal, both macOS builds first differ at `pty.node`, and both
+ Windows builds first differ at `conpty_console_list.node`. The bounded correction in
+ `a09b02ec4` makes macOS retain a reproducible loadable UUID, applies `/Brepro` only to copied
+ Windows artifact source, and requires exclusive caller-owned work paths; `3e433b343` makes the CI
+ path canonical across runs. E-M3-REPRODUCIBILITY-LINKER-LOCAL-001 is green, but a new exact-head
+ six-runner proof remains mandatory. Oldest-baseline, native-trust, SSH, and musl cells remain
+ open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -137,10 +143,9 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: finish the exact implementation-commit local gates for the bounded Windows
- parser and diagnostic-order correction, then push and rerun all six target-native jobs. Use the
- runtime-first comparator output to isolate
- macOS producer nondeterminism without weakening the oracle. Keep oldest-baseline, cross-family
+- Next required action: push exact correction head `3e433b343` and rerun all six target-native jobs.
+ Require Linux to remain equal, macOS to retain loadable `LC_UUID` values while comparing equal,
+ and Windows `/Brepro` outputs to compare equal before upload. Keep oldest-baseline, cross-family
remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
publication, resolver, transfer, rollout, tuple enablement, or default behavior.
@@ -613,12 +618,22 @@ six target-native artifact/executable jobs, including normal Windows x64/arm64 s
unpublished upload. E-M3-REPRODUCIBILITY-LOCAL-001 proves the bounded comparator requires two
independently verified clean outputs and exact type/mode/size/SHA-256 equality for the runtime tree,
archive, identity, SPDX, and provenance before uploading only the first output. Exact-head run
-29347236627 is intentionally red under E-M3-REPRODUCIBILITY-CI-RED-001: Linux x64/arm64 passed,
-macOS x64/arm64 produced unequal clean outputs, and Windows x64/arm64 failed comparator test
-collection. E-M3-REPRODUCIBILITY-DIAGNOSTIC-LOCAL-001 proves the bounded parser/diagnostic
-correction locally; native execution is still open. Artifact consumers, publication, the
+29347236627 first exposed native reproducibility and Windows parser failures. Diagnostic run
+29348424235 then passed the parser/contracts on all six runners, kept both Linux tuples equal, and
+isolated the first native differences to macOS `pty.node` and Windows `conpty_console_list.node`
+under E-M3-REPRODUCIBILITY-DIAGNOSTIC-CI-RED-001. Artifact consumers, publication, the
repository-wide node-pty patch, and the legacy/default path remain unchanged.
+**Active correction — 2026-07-14, Codex implementation owner:** implementation `a09b02ec4` requires
+disjoint exclusive output/work directories, reuses one caller-owned work path across clean passes,
+links macOS native outputs with `-Wl,-reproducible` while retaining the required `LC_UUID`, and
+adds `/Brepro` only to the copied Windows node-pty source with an exact-source fail-closed guard.
+Follow-up `3e433b343` removes the run ID from the work path so separate CI runs use one canonical
+runner-local location while their outputs remain run-scoped. E-M3-REPRODUCIBILITY-LINKER-LOCAL-001
+proves two clean macOS passes plus a separate repeat session are byte-identical and loadable. Native
+Windows proof and the new six-runner equality gate remain open; no tuple or production consumer is
+enabled.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1217,16 +1232,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native reproducibility pending | `c70e96374`; E-M3-REPRODUCIBILITY-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; corrected native reproducibility rerun pending | `3e433b343`; E-M3-REPRODUCIBILITY-LINKER-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1278,8 +1293,9 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs` (E-M3-WINDOWS-RESOURCE-DIAGNOSTIC-LOCAL-001; native classification pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs` (E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; native settlement pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-reproducibility.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (E-M3-REPRODUCIBILITY-LOCAL-001; synthetic comparator/workflow contract only, native execution pending)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-build.test.mjs config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs config/scripts/ssh-relay-runtime-build.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; command/linker/work-path contracts plus local macOS native proof; Windows native equality pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
-- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
+- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --work-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001, E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; local native Linux arm64 history plus current stable-work contract)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
### Commands/scripts that must be added or formally identified
@@ -3753,23 +3769,179 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact commit, rerun all six native jobs, require both Windows syntax checks to
pass, and use the macOS runtime-first failure path to correct producer nondeterminism.
+### E-M3-REPRODUCIBILITY-DIAGNOSTIC-CI-RED-001 — Native drift paths isolated on all six runners
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `c62b0d0a9580b132fec5f11c3234a983503a011c`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29348424235](https://github.com/stablyai/orca/actions/runs/29348424235),
+ conclusion `failure`; Linux x64 `87138091964`, Linux arm64 `87138091995`, macOS arm64
+ `87138091994`, macOS x64 `87138092013`, Windows x64 `87138091948`, and Windows arm64
+ `87138091977`
+- Runners: `ubuntu-24.04` x64 image `20260705.232.1`, `ubuntu-24.04-arm` arm64 image
+ `20260706.52.2`, `macos-15` arm64 image `20260706.0213.1`, `macos-15-intel` x64 image
+ `20260629.0276.1`, `windows-2022` x64 image `20260706.237.1`, and `windows-11-arm` arm64
+ image `20260706.102.1`; all native and using Node v24.18.0
+- Remote and transport: none; target-native artifact assembly/execution and unpublished Actions
+ artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29348424235 --repo stablyai/orca \
+ --json databaseId,headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api -H 'Accept: application/vnd.github+json' \
+ repos/stablyai/orca/actions/jobs//logs
+ ```
+
+- Result: FAIL as an evidence-producing native gate. Every POSIX runner passed 41/41 contracts;
+ Windows passed 38 and skipped three POSIX-only tests. Linux x64 and arm64 built, verified,
+ smoked, compared exactly, and uploaded unpublished artifacts `8317161547` and `8317164595`.
+ macOS arm64 first differed at
+ `runtime/node_modules/node-pty/build/Release/pty.node`, with content IDs
+ `sha256:206de506d0499ded3c16913e28f76c528f5bead5214e6675ee4a5ee6bb0a642c` and
+ `sha256:68e23c3608b3d3bc95d591e6f99a5126ab6a6b0066c84c8340f4bc4195e64ac8`;
+ macOS x64 differed at the same path with
+ `sha256:eda4590b97d003f9a94fb59595a84273f3660fb920d85ff699c9d7925c52a7a2` and
+ `sha256:701b4310acbeb1f7340d50b554cfe65e2802c5346aca0036aae4ebb3f974becf`.
+ Windows x64 first differed at
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node`, with content IDs
+ `sha256:df55ffd5a5614a61e5fd2ae8cd990f28b84b9a0d557df861989c92b9e66652eb` and
+ `sha256:1bbf496013af3d0172a275ba48dcb1a054aeb1b17261b606ecdd4c2dd3ce95fb`;
+ Windows arm64 differed at the same path with
+ `sha256:4d93459ffefb8f8b8250c6b0267e34f04a9ac5b5f99b60671f484fb34054519a` and
+ `sha256:844c6f07a92ed3602af74bba92c8c98047313b97080b668aeb0b3a51ef7d2db8`.
+- Duration and resource metrics: build/compare steps were 138 seconds for Linux x64, 132 seconds
+ for Linux arm64, 100 seconds for macOS arm64, 301 seconds for macOS x64, 296 seconds for Windows
+ x64, and 285 seconds for Windows arm64. Both builds in every failing cell completed bundled
+ Node/native PTY/watcher smoke before comparison. Smoke RSS ranged from 40,615,936 to 53,633,024
+ bytes in failing cells. Peak build RSS, open files/channels, and cancellation settlement were not
+ instrumented by this gate.
+- Artifact/log/trace link: run/job links above; Linux x64 upload
+ [8317161547](https://github.com/stablyai/orca/actions/runs/29348424235/artifacts/8317161547) and
+ Linux arm64 upload
+ [8317164595](https://github.com/stablyai/orca/actions/runs/29348424235/artifacts/8317164595);
+ failing cells correctly uploaded nothing
+- Oracle proved: the parser and runtime-first diagnostic corrections execute on all native runner
+ families; Linux reproducibility remains green; macOS and Windows drift is inside native node-pty
+ outputs rather than archive/identity derivation; rejected cells cannot upload or publish bytes.
+- Does not prove: either linker correction, macOS/Windows equality, cross-run identity, oldest
+ baselines, native trust/signing, SSH, transfer, publication, resolver/cache, fallback, UI, or an
+ enabled tuple.
+- Checklist items satisfied: no new completion checkbox; this closes only the diagnostic run and
+ identifies the bounded producer corrections required next.
+- Follow-up: retain the complete-output comparator, correct native producers without post-build
+ normalization, and require a new same-head six-runner pass before advancing.
+
+### E-M3-REPRODUCIBILITY-LINKER-LOCAL-001 — Canonical work path and native linker correction
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation `a09b02ec4e623cc8cac8ece089e4ff734014dd5b`; canonical-path
+ follow-up `3e433b3438e8e1aa11d2728e3f2258996b3d37f2`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741), push/native CI pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; local test/static process Node v26.0.0
+ and pnpm 10.24.0; native harness used official bundled Node v24.18.0, node-gyp 12.3.0,
+ Apple Clang/make, and Python 3.13.5
+- Remote and transport: none; exact Node archive downloaded over HTTPS, then local native builds;
+ no SSH, publication, or production consumer
+- Exact commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/build-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/build-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ git diff HEAD --check
+ ```
+
+ The native oracle downloaded `node-v24.18.0-darwin-arm64.tar.xz`, twice extracted it under the
+ fixed exclusive `/tmp/orca-ssh-relay-runtime-build-work/node-inputs` path, called
+ `buildPatchedSshRelayNodePty` twice with the same clean `node-pty` path, compared both outputs,
+ required one `LC_UUID` from `otool -l`, and then repeated the build in a separate process session
+ against the prior hashes.
+
+- Result: PASS locally. The focused command passed 8/8 tests; all 14 artifact suites passed 47/47.
+ Typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, syntax, and diff gates exited zero. Full lint emitted
+ only pre-existing out-of-package warnings. Two clean native passes and the separate repeat session
+ produced byte-identical outputs: `pty.node` was 83,256 bytes with SHA-256
+ `e73f80560b8ecc0ae19421fc82fb612e4f50e66f17dfd491cdf95599bc7b685a`, and
+ `spawn-helper` was 50,192 bytes with SHA-256
+ `3396961b0f8f9cdb0fcd2155eb54035276ee7ee2813d84faa1dfae5ba84dc95d`.
+ Each retained exactly one `LC_UUID`, and every `buildPatchedSshRelayNodePty` call completed its
+ bundled-Node native-load oracle. A separate `-Wl,-no_uuid` diagnostic made bytes equal but caused
+ bundled Node/dlopen to reject `pty.node` with `missing LC_UUID load command`; that approach was
+ discarded and is not present in the implementation.
+- Duration and resource metrics: focused tests 229 ms; exact-head full artifact suite 1.35 seconds;
+ parallel static gate 11.5 seconds; two-pass canonical native harness 11.126 seconds; separate
+ repeat native build 2.511 seconds excluding archive download/extraction. Native harness peak RSS,
+ file counts, and cancellation settlement were not instrumented.
+- Artifact/log/trace link: exact source commits and local command output; no artifact was published
+- Oracle proved: output/work overlap rejects; both paths are exclusive; a caller-provided canonical
+ work path is reused cleanly and safely; macOS configures then links with `-Wl,-reproducible`
+ without deleting `LC_UUID`; copied Windows `binding.gyp` receives exactly one `/Brepro` and source
+ drift fails closed; Linux and legacy/repository-wide node-pty behavior are unchanged; both native
+ workflow families use the same canonical runner-local path while retaining run-scoped outputs.
+- Does not prove: native Windows `/Brepro` behavior, macOS x64, GitHub-hosted equality, different
+ runner-image/toolchain revisions, oldest baselines, native signatures/trust, SSH, transfer,
+ publication, resolver/cache, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: exact-head local linker/work-path contracts and macOS arm64 native
+ correction only; native reproducibility remains open until all six jobs pass together.
+- Follow-up: push `3e433b343`, run all six target-native jobs, and require complete equality plus
+ upload in each cell without weakening the comparator.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Linux x64/arm64 pass; macOS x64/arm64 and the Windows parser are red | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Linux x64/arm64 pass; macOS and Windows native drift is locally corrected but not rerun | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -3810,12 +3982,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Complete the exact implementation-commit local gates, push the bounded two-clean-build
-reproducibility package to draft PR #8741, and run all six target-native jobs. Each job must build,
-verify, and smoke two exclusive outputs, compare every runtime-tree/archive/identity/SPDX/provenance
-entry, and upload only after equality. Record exact differing paths and fields for every native red
-result and correct the producer without weakening the oracle. Cross-family Layer B targets, the
-protected manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy
-performance baseline remain release/default-path blockers; no publication, desktop resolver, SSH
-transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may be connected
-by this package.
+Push exact correction head `3e433b343` to draft PR #8741 and run all six target-native jobs. Each
+job must build, verify, and smoke two exclusive outputs at the canonical work path, compare every
+runtime-tree/archive/identity/SPDX/provenance entry, and upload only after equality. macOS must
+retain loadable `LC_UUID` values; Windows must prove `/Brepro` natively; Linux must remain green.
+Record exact paths and fields for any new red without weakening the oracle. Cross-family Layer B
+targets, the protected manifest-signing environment, oldest-baseline/native-trust cells, and the
+paired legacy performance baseline remain release/default-path blockers; no publication, desktop
+resolver, SSH transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may
+be connected by this package.
From 25ca53910d9901220663f9e4a50d27623f7b5321 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:52:02 -0400
Subject: [PATCH 028/267] docs(ssh): record builder parser boundary
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 154 +++++++++++++-----
1 file changed, 111 insertions(+), 43 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 7cace04205a..f9865edee4b 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — completed exact-head diagnostic run 29348424235 keeps Linux x64/arm64 green and isolates native drift to macOS `pty.node` and Windows `conpty_console_list.node`; canonical clean-work paths plus platform-native reproducible-link corrections are locally green at `3e433b343` and await a new six-runner exact-head proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29350639822 proves the canonical-work/linker correction on Linux x64/arm64 and macOS x64/arm64, while both Windows jobs stop safely before inputs/build/upload because the imported builder retains an unused Unix shebang; the bounded shebang/syntax-gate correction is locally green and awaits exact-head commit plus a new six-runner proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -101,9 +101,12 @@ same change as the work it records.
Windows builds first differ at `conpty_console_list.node`. The bounded correction in
`a09b02ec4` makes macOS retain a reproducible loadable UUID, applies `/Brepro` only to copied
Windows artifact source, and requires exclusive caller-owned work paths; `3e433b343` makes the CI
- path canonical across runs. E-M3-REPRODUCIBILITY-LINKER-LOCAL-001 is green, but a new exact-head
- six-runner proof remains mandatory. Oldest-baseline, native-trust, SSH, and musl cells remain
- open.
+ path canonical across runs. E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 proves both Linux and macOS
+ architectures now build, verify, smoke, compare exactly, and upload, but both Windows jobs fail
+ closed in contract collection because `ssh-relay-runtime-build.test.mjs` imports a builder with an
+ unused Unix shebang. The active correction removes only that shebang and adds explicit POSIX and
+ Windows `node --check` gates before Vitest. Native Windows `/Brepro` equality remains mandatory.
+ Oldest-baseline, native-trust, SSH, and musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -143,11 +146,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact correction head `3e433b343` and rerun all six target-native jobs.
- Require Linux to remain equal, macOS to retain loadable `LC_UUID` values while comparing equal,
- and Windows `/Brepro` outputs to compare equal before upload. Keep oldest-baseline, cross-family
- remote infrastructure, signing/trust, and measured legacy baseline gates open; do not introduce
- publication, resolver, transfer, rollout, tuple enablement, or default behavior.
+- Next required action: finish exact local gates for the bounded builder-shebang/syntax correction,
+ commit it separately from this evidence record, push both commits, and rerun all six target-native
+ jobs. Require Linux and macOS to remain equal and Windows `/Brepro` outputs to build, smoke,
+ compare equal, and upload. Keep oldest-baseline, cross-family remote infrastructure,
+ signing/trust, and measured legacy baseline gates open; do not introduce publication, resolver,
+ transfer, rollout, tuple enablement, or default behavior.
## Non-Negotiable Invariants
@@ -630,9 +634,12 @@ links macOS native outputs with `-Wl,-reproducible` while retaining the required
adds `/Brepro` only to the copied Windows node-pty source with an exact-source fail-closed guard.
Follow-up `3e433b343` removes the run ID from the work path so separate CI runs use one canonical
runner-local location while their outputs remain run-scoped. E-M3-REPRODUCIBILITY-LINKER-LOCAL-001
-proves two clean macOS passes plus a separate repeat session are byte-identical and loadable. Native
-Windows proof and the new six-runner equality gate remain open; no tuple or production consumer is
-enabled.
+proves two clean macOS passes plus a separate repeat session are byte-identical and loadable.
+E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 proves Linux and macOS x64/arm64 equality on exact head
+`54df2cb99`; Windows stopped before artifact inputs because Vitest imported the builder's unused Unix
+shebang. The active bounded correction removes only that shebang and syntax-checks the builder and
+its test on POSIX and Windows before contract collection. Native Windows proof and the six-runner
+equality gate remain open; no tuple or production consumer is enabled.
Each runtime must contain only the executable closure required by the relay.
@@ -1232,16 +1239,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; corrected native reproducibility rerun pending | `3e433b343`; E-M3-REPRODUCIBILITY-LINKER-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows parser correction/rerun pending | `54df2cb99`; E-M3-REPRODUCIBILITY-LINKER-CI-RED-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -3925,23 +3932,83 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push `3e433b343`, run all six target-native jobs, and require complete equality plus
upload in each cell without weakening the comparator.
+### E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 — POSIX equality and Windows builder parser boundary
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `54df2cb998ae564c1a19cf32a8c93bf28770d07a`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29350639822](https://github.com/stablyai/orca/actions/runs/29350639822),
+ conclusion `failure`; Linux x64 `87145674443`, Linux arm64 `87145674440`, macOS arm64
+ `87145674422`, macOS x64 `87145674490`, Windows x64 `87145674413`, and Windows arm64
+ `87145674455`
+- Runners: `ubuntu-24.04` x64 image `20260705.232.1`, `ubuntu-24.04-arm` arm64 image
+ `20260706.52.2`, `macos-15` arm64 image `20260706.0213.1`, `macos-15-intel` x64 image
+ `20260629.0276.1`, `windows-2022` x64 image `20260706.237.1`, and `windows-11-arm` arm64
+ image `20260706.102.1`; all native, runner `2.335.1`, provisioner `20260624.560`, and Node
+ v24.18.0. Windows x64 was Server 2022 build 20348; arm64 was Windows Enterprise build 26200.
+- Remote and transport: none; target-native artifact assembly/execution and unpublished Actions
+ artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29350639822 --repo stablyai/orca \
+ --json databaseId,headSha,headBranch,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs//logs
+ gh api 'repos/stablyai/orca/actions/runs/29350639822/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as an evidence-producing six-runner gate. Linux x64/arm64 and macOS x64/arm64 each
+ passed 47/47 contracts, authenticated exact Node inputs, performed two exclusive native builds,
+ fully inspected and smoked both outputs, compared the runtime tree/archive/identity/SPDX/
+ provenance byte-for-byte, and uploaded only the first equal output. Windows x64/arm64 each passed
+ 42 tests and skipped three POSIX-only tests across 13 suites, then failed while collecting
+ `ssh-relay-runtime-build.test.mjs` with `SyntaxError: Invalid or unexpected token`: that test
+ imports `build-ssh-relay-runtime.mjs`, whose first line was an unused Unix shebang. Input download,
+ native build, verification, comparison, and upload were all skipped on both Windows jobs.
+- Equal-output and upload details:
+
+ | Tuple | Content ID / runtime archive SHA-256 | Archive / expanded / files | Build 1 / build 2 / max smoke RSS | Actions artifact |
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+ | `linux-x64-glibc` | `960546cd96c67fcf9bb0a61e96ecdbecbffd9104d3a495578f8bb19dd810649a` / `1881a082b5c8ab1caf28801e42a8f62601b0275096ec67468498d1a370c4af3b` | 29,266,692 / 124,846,502 / 34 | 67,504 / 65,510 ms / 56,438,784 bytes | [8318063540](https://github.com/stablyai/orca/actions/runs/29350639822/artifacts/8318063540), 29,282,697 bytes |
+ | `linux-arm64-glibc` | `aa3aa8ae8b42334ba7b0dbe5c43fd1184e36b3f4f4a9bec0e990e9b78f090756` / `909a8f69acf9edb294e5d74b4323adc399821e049f0cba933206621f75c3effe` | 28,197,220 / 122,865,172 / 34 | 67,457 / 65,054 ms / 52,596,736 bytes | [8318072302](https://github.com/stablyai/orca/actions/runs/29350639822/artifacts/8318072302), 28,212,074 bytes |
+ | `darwin-arm64` | `40ff5d2036784b794e7b09f78596409f63f3145280c530bece5280d40897f6cb` / `132b0b6b3ecd4386ecf72119a950334f54ec34fe46e51c4f871d8c7878247775` | 24,736,104 / 122,027,869 / 35 | 55,320 / 52,391 ms / 51,658,752 bytes | [8318052438](https://github.com/stablyai/orca/actions/runs/29350639822/artifacts/8318052438), 24,749,047 bytes |
+ | `darwin-x64` | `585ea6034cdd07487d8667059f975a877c795a45dc0d6eeee1617f2e3749faa2` / `b47ed8b464989b1638a2024ac5980a45a494ff33f9a3dbe648c8f7974efb1e33` | 26,373,464 / 124,316,655 / 35 | 88,815 / 78,961 ms / 40,665,088 bytes | [8318098409](https://github.com/stablyai/orca/actions/runs/29350639822/artifacts/8318098409), 26,388,039 bytes |
+
+- Duration and resource metrics: total jobs were 3m12s Linux x64, 3m28s Linux arm64, 2m50s macOS
+ arm64, 4m28s macOS x64, 1m19s Windows x64, and 3m42s Windows arm64. Windows contract collection
+ took 1.97s and 2.76s. POSIX comparison scanned 54/55 entries and 146.8–154.1 MB in 285–895 ms.
+ Build peak RSS, open files/channels, and cancellation settlement were not instrumented.
+- Artifact/log/trace link: run/job links and four unpublished seven-day artifacts above; Windows
+ correctly produced no artifact
+- Oracle proved: the canonical clean-work directory plus `-Wl,-reproducible` makes both native
+ macOS architectures byte-identical while retaining successful bundled-Node/native PTY/watcher
+ execution; both Linux controls remain equal; failed contract collection prevents Windows inputs,
+ execution, and upload. The parser boundary is the imported builder shebang, not `/Brepro` output.
+- Does not prove: Windows builder parsing after correction, native `/Brepro` equality, a six-job
+ pass, cross-run identity, oldest baselines, native trust/signing, SSH, transfer, publication,
+ resolver/cache, fallback, UI, or an enabled tuple.
+- Checklist items satisfied: native macOS linker reproducibility evidence only; native
+ reproducibility remains open until all six same-head jobs pass together.
+- Follow-up: remove only the unused builder shebang, syntax-check the builder and its test on POSIX
+ and Windows before Vitest, rerun local gates, then require a new six-runner exact-head pass.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Linux x64/arm64 pass; macOS and Windows native drift is locally corrected but not rerun | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Linux/macOS x64/arm64 pass; Windows parser correction awaits rerun | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -3982,12 +4049,13 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact correction head `3e433b343` to draft PR #8741 and run all six target-native jobs. Each
-job must build, verify, and smoke two exclusive outputs at the canonical work path, compare every
-runtime-tree/archive/identity/SPDX/provenance entry, and upload only after equality. macOS must
-retain loadable `LC_UUID` values; Windows must prove `/Brepro` natively; Linux must remain green.
-Record exact paths and fields for any new red without weakening the oracle. Cross-family Layer B
-targets, the protected manifest-signing environment, oldest-baseline/native-trust cells, and the
-paired legacy performance baseline remain release/default-path blockers; no publication, desktop
-resolver, SSH transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may
-be connected by this package.
+Run the complete local artifact/static gates for the bounded builder-shebang/syntax correction,
+commit it separately from E-M3-REPRODUCIBILITY-LINKER-CI-RED-001, push both commits to draft PR
+#8741, and run all six target-native jobs. Each job must build, verify, and smoke two exclusive
+outputs at the canonical work path, compare every runtime-tree/archive/identity/SPDX/provenance
+entry, and upload only after equality. macOS must retain loadable `LC_UUID` values; Windows must
+prove `/Brepro` natively; Linux must remain green. Record exact paths and fields for any new red
+without weakening the oracle. Cross-family Layer B targets, the protected manifest-signing
+environment, oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
+release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
+Beta, fallback, tuple enablement, or default behavior may be connected by this package.
From f864d3fa6df7a938e509c7622604e2fd2bd85493 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:52:15 -0400
Subject: [PATCH 029/267] build(ssh): syntax-check runtime builder
Co-authored-by: Orca
---
.github/workflows/ssh-relay-runtime-artifacts.yml | 6 ++++++
config/scripts/build-ssh-relay-runtime.mjs | 2 --
config/scripts/ssh-relay-runtime-workflow.test.mjs | 8 +++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 605235033af..bd2e5713c30 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -105,6 +105,8 @@ jobs:
set -euo pipefail
node --check config/scripts/ssh-relay-runtime-reproducibility.mjs
node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
+ node --check config/scripts/build-ssh-relay-runtime.mjs
+ node --check config/scripts/ssh-relay-runtime-build.test.mjs
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
@@ -269,6 +271,10 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility script syntax check failed' }
node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility test syntax check failed' }
+ node --check config/scripts/build-ssh-relay-runtime.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime build script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-build.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime build test syntax check failed' }
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
diff --git a/config/scripts/build-ssh-relay-runtime.mjs b/config/scripts/build-ssh-relay-runtime.mjs
index 8bf4725b455..2ae076aafc0 100644
--- a/config/scripts/build-ssh-relay-runtime.mjs
+++ b/config/scripts/build-ssh-relay-runtime.mjs
@@ -1,5 +1,3 @@
-#!/usr/bin/env node
-
import { execFile } from 'node:child_process'
import { mkdir, readFile, rm } from 'node:fs/promises'
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 44966859d41..9d701eaa429 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -64,9 +64,15 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain(
'node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs'
)
+ expect(
+ source.match(/node --check config\/scripts\/build-ssh-relay-runtime\.mjs/g)
+ ).toHaveLength(2)
+ expect(
+ source.match(/node --check config\/scripts\/ssh-relay-runtime-build\.test\.mjs/g)
+ ).toHaveLength(2)
expect(source.match(/ssh-relay-node-pty-build\.test\.mjs/g)).toHaveLength(2)
expect(source.match(/ssh-relay-node-pty-windows-build-determinism\.test\.mjs/g)).toHaveLength(2)
- expect(source.match(/ssh-relay-runtime-build\.test\.mjs/g)).toHaveLength(2)
+ expect(source.match(/ssh-relay-runtime-build\.test\.mjs/g)).toHaveLength(4)
expect(source.match(/--work-directory/g)).toHaveLength(2)
expect(source).toContain('work_directory="$RUNNER_TEMP/orca-ssh-relay-runtime-build-work"')
expect(source).toContain(
From de541efd11989d2e6dce0402307912afffae3510 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 12:54:04 -0400
Subject: [PATCH 030/267] docs(ssh): record builder parser correction
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 126 +++++++++++++-----
1 file changed, 96 insertions(+), 30 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index f9865edee4b..04574335845 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29350639822 proves the canonical-work/linker correction on Linux x64/arm64 and macOS x64/arm64, while both Windows jobs stop safely before inputs/build/upload because the imported builder retains an unused Unix shebang; the bounded shebang/syntax-gate correction is locally green and awaits exact-head commit plus a new six-runner proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29350639822 proves the canonical-work/linker correction on Linux x64/arm64 and macOS x64/arm64, while both Windows jobs stop safely before inputs/build/upload because the imported builder retains an unused Unix shebang; the bounded shebang/syntax-gate correction is exact-head locally green at `f864d3fa6` and awaits a new six-runner proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -106,7 +106,8 @@ same change as the work it records.
closed in contract collection because `ssh-relay-runtime-build.test.mjs` imports a builder with an
unused Unix shebang. The active correction removes only that shebang and adds explicit POSIX and
Windows `node --check` gates before Vitest. Native Windows `/Brepro` equality remains mandatory.
- Oldest-baseline, native-trust, SSH, and musl cells remain open.
+ E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001 proves the bounded correction at exact commit
+ `f864d3fa6`. Oldest-baseline, native-trust, SSH, and musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -146,12 +147,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: finish exact local gates for the bounded builder-shebang/syntax correction,
- commit it separately from this evidence record, push both commits, and rerun all six target-native
- jobs. Require Linux and macOS to remain equal and Windows `/Brepro` outputs to build, smoke,
- compare equal, and upload. Keep oldest-baseline, cross-family remote infrastructure,
- signing/trust, and measured legacy baseline gates open; do not introduce publication, resolver,
- transfer, rollout, tuple enablement, or default behavior.
+- Next required action: commit the exact local evidence record for `f864d3fa6`, push the bounded
+ correction and evidence commits, and rerun all six target-native jobs. Require Linux and macOS to
+ remain equal and Windows `/Brepro` outputs to build, smoke, compare equal, and upload. Keep
+ oldest-baseline, cross-family remote infrastructure, signing/trust, and measured legacy baseline
+ gates open; do not introduce publication, resolver, transfer, rollout, tuple enablement, or
+ default behavior.
## Non-Negotiable Invariants
@@ -638,8 +639,9 @@ proves two clean macOS passes plus a separate repeat session are byte-identical
E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 proves Linux and macOS x64/arm64 equality on exact head
`54df2cb99`; Windows stopped before artifact inputs because Vitest imported the builder's unused Unix
shebang. The active bounded correction removes only that shebang and syntax-checks the builder and
-its test on POSIX and Windows before contract collection. Native Windows proof and the six-runner
-equality gate remain open; no tuple or production consumer is enabled.
+its test on POSIX and Windows before contract collection. Its exact implementation commit
+`f864d3fa6` is locally green under E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001. Native Windows
+proof and the six-runner equality gate remain open; no tuple or production consumer is enabled.
Each runtime must contain only the executable closure required by the relay.
@@ -1239,16 +1241,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows parser correction/rerun pending | `54df2cb99`; E-M3-REPRODUCIBILITY-LINKER-CI-RED-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; six-runner parser correction rerun pending | `f864d3fa6`; E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1301,6 +1303,7 @@ focused commands as their scripts/tests are introduced.
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs` (E-M3-WINDOWS-CONPTY-WORKER-LOCAL-RED-001, E-M3-WINDOWS-CONPTY-WORKER-LOCAL-001; native settlement pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-runtime-reproducibility.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (E-M3-REPRODUCIBILITY-LOCAL-001; synthetic comparator/workflow contract only, native execution pending)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-node-pty-build.test.mjs config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs config/scripts/ssh-relay-runtime-build.test.mjs config/scripts/ssh-relay-runtime-workflow.test.mjs` (E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; command/linker/work-path contracts plus local macOS native proof; Windows native equality pending)
+- [x] `node --check config/scripts/build-ssh-relay-runtime.mjs && node --check config/scripts/ssh-relay-runtime-build.test.mjs` (E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001; exact local parser proof; native Windows remains pending)
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --work-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001, E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; local native Linux arm64 history plus current stable-work contract)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
@@ -3992,6 +3995,69 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: remove only the unused builder shebang, syntax-check the builder and its test on POSIX
and Windows before Vitest, rerun local gates, then require a new six-runner exact-head pass.
+### E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001 — Imported builder parser correction
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `f864d3fa6df7a938e509c7622604e2fd2bd85493`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741), push/native CI pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. The
+ repository requires Node 24, so the new target-native run remains authoritative for Windows.
+- Remote and transport: none; local syntax, contract, and repository static gates only
+- Exact commands:
+
+ ```sh
+ node --check config/scripts/build-ssh-relay-runtime.mjs
+ node --check config/scripts/ssh-relay-runtime-build.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/build-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ .github/workflows/ssh-relay-runtime-artifacts.yml
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/build-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ git diff HEAD --check
+ ```
+
+- Result: PASS at the exact implementation commit. Both syntax checks exited zero; all 14 artifact
+ suites passed 47/47 tests. Typecheck, focused oxlint, the 355-entry max-lines ratchet, full
+ repository lint/reliability/localization, formatting, and exact-head diff checks exited zero.
+ Full lint emitted only pre-existing warnings outside this package.
+- Duration and resource metrics: full artifact command 3.08s wall; typecheck 3.30s; focused oxlint
+ 0.49s; max-lines 0.76s; full lint 12.79s. Synthetic test peak RSS, open files/channels, and
+ cancellation settlement were not instrumented.
+- Artifact/log/trace link: exact commit and local command output; no runtime artifact was produced
+- Oracle proved: the builder and importing test parse after removing only the unused shebang; every
+ real builder invocation remains explicitly through `node`; both workflow families syntax-check
+ the builder and test before Vitest or Node input download; workflow source contracts require both
+ POSIX and Windows checks without changing permissions, artifact scope, or production behavior.
+- Does not prove: native Windows parsing, Node 24 behavior, `/Brepro` output equality, any native
+ build, oldest baselines, native trust, SSH, transfer, publication, resolver/cache, fallback, UI,
+ or an enabled tuple.
+- Checklist items satisfied: exact local builder parser/syntax-gate correction only; no native or
+ tuple checkbox.
+- Follow-up: push the exact commit and require all six target-native jobs to pass together before
+ closing native reproducibility.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4049,13 +4115,13 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Run the complete local artifact/static gates for the bounded builder-shebang/syntax correction,
-commit it separately from E-M3-REPRODUCIBILITY-LINKER-CI-RED-001, push both commits to draft PR
-#8741, and run all six target-native jobs. Each job must build, verify, and smoke two exclusive
-outputs at the canonical work path, compare every runtime-tree/archive/identity/SPDX/provenance
-entry, and upload only after equality. macOS must retain loadable `LC_UUID` values; Windows must
-prove `/Brepro` natively; Linux must remain green. Record exact paths and fields for any new red
-without weakening the oracle. Cross-family Layer B targets, the protected manifest-signing
-environment, oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
-release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
-Beta, fallback, tuple enablement, or default behavior may be connected by this package.
+Commit E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001, push it with exact implementation commit
+`f864d3fa6` to draft PR #8741, and run all six target-native jobs. Each job must build, verify, and
+smoke two exclusive outputs at the canonical work path, compare every runtime-tree/archive/
+identity/SPDX/provenance entry, and upload only after equality. macOS must retain loadable `LC_UUID`
+values; Windows must prove `/Brepro` natively; Linux must remain green. Record exact paths and
+fields for any new red without weakening the oracle. Cross-family Layer B targets, the protected
+manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
+baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
+install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
+package.
From a7151f9750fd9bfcdcff8c01c1fd6caff2e6116a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:08:01 -0400
Subject: [PATCH 031/267] docs(ssh): record arm64 reproducibility boundary
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 102 ++++++++++++++----
1 file changed, 80 insertions(+), 22 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 04574335845..53de05f1acd 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29350639822 proves the canonical-work/linker correction on Linux x64/arm64 and macOS x64/arm64, while both Windows jobs stop safely before inputs/build/upload because the imported builder retains an unused Unix shebang; the bounded shebang/syntax-gate correction is exact-head locally green at `f864d3fa6` and awaits a new six-runner proof; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29351557922 proves clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but fails closed because Windows arm64 first differs at `conpty_console_list.node`; the active slice is bounded diagnosis/correction of that copied artifact build only; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -104,10 +104,12 @@ same change as the work it records.
path canonical across runs. E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 proves both Linux and macOS
architectures now build, verify, smoke, compare exactly, and upload, but both Windows jobs fail
closed in contract collection because `ssh-relay-runtime-build.test.mjs` imports a builder with an
- unused Unix shebang. The active correction removes only that shebang and adds explicit POSIX and
- Windows `node --check` gates before Vitest. Native Windows `/Brepro` equality remains mandatory.
- E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001 proves the bounded correction at exact commit
- `f864d3fa6`. Oldest-baseline, native-trust, SSH, and musl cells remain open.
+ unused Unix shebang. E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001 proves the bounded correction at
+ exact commit `f864d3fa6`. Exact-head run 29351557922 then parses and builds on all six native
+ runners: Linux x64/arm64, macOS x64/arm64, and Windows x64 compare exactly and upload, while
+ Windows arm64 fully builds, verifies, and smokes both outputs but fails closed before upload when
+ `conpty_console_list.node` differs (E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001). Native Windows
+ arm64 equality remains mandatory; oldest-baseline, native-trust, SSH, and musl cells remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -1241,16 +1243,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; six-runner parser correction rerun pending | `f864d3fa6`; E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows arm64 equality diagnosis active | `de541efd1`; E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -4058,6 +4060,63 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact commit and require all six target-native jobs to pass together before
closing native reproducibility.
+### E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001 — Native arm64 residual binary drift
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `de541efd11989d2e6dce0402307912afffae3510`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29351557922](https://github.com/stablyai/orca/actions/runs/29351557922),
+ conclusion `failure`; Linux arm64 `87148758201`, Linux x64 `87148758213`, Windows x64
+ `87148758259`, macOS arm64 `87148758282`, macOS x64 `87148758287`, and failing Windows arm64
+ `87148758290`
+- Runners: `ubuntu-24.04-arm` image `20260706.52.2`, `ubuntu-24.04` image `20260705.232.1`,
+ `windows-2022` image `20260706.237.1`, `macos-15-arm64` image `20260706.0213.1`, `macos-15`
+ image `20260629.0276.1`, and `windows-11-arm64` image `20260706.102.1`; all native, runner
+ `2.335.1`, provisioner `20260624.560`, and Node v24.18.0
+- Remote and transport: none; target-native artifact assembly/execution and unpublished Actions
+ artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29351557922 --repo stablyai/orca \
+ --json databaseId,headSha,headBranch,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs//logs
+ gh api 'repos/stablyai/orca/actions/runs/29351557922/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as a six-runner reproducibility gate. All six jobs passed the builder/test syntax
+ checks and artifact contracts, authenticated the exact Node inputs, and completed two native
+ builds. Linux x64/arm64, macOS x64/arm64, and Windows x64 inspected and smoked both outputs,
+ compared every runtime/archive/identity/SPDX/provenance entry exactly, and uploaded only after
+ equality. Windows arm64 also inspected and smoked both complete 60-entry, 42-file, 86,189,895-byte
+ outputs, including PTY input/resize/exit, watcher lifecycle, and resource settlement, but the
+ comparator first found SHA-256 drift at
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node`; no arm64 artifact uploaded.
+- Equal-output artifacts: Linux x64 `8318426445` (29,283,624 bytes), Linux arm64 `8318449064`
+ (28,212,246 bytes), macOS arm64 `8318457230` (24,710,997 bytes), Windows x64 `8318478579`
+ (37,075,312 bytes), and macOS x64 `8318524353` (26,365,330 bytes), all unpublished seven-day
+ Actions artifacts. Their runtime content IDs are respectively `960546cd96c6`, `aa3aa8ae8b42`,
+ `40ff5d203678`, `2a6bfa06b445`, and `585ea6034cdd` (prefixes shown; full values remain in logs).
+- Windows arm64 drift details: build one content ID `58afdfbe6b3e48ee1a46bcb09f20a9c7d4d6fe25bdf346e82038fa0a2211ea86`,
+ archive 33,261,552 bytes with SHA-256 `0277fa35bb1ec644a509e3068bf120294c99484ac3638fdd352ae386f83bdd2f`;
+ build two content ID `6e64071c12f58b0f73a34339c6f1f1dac725d852224537c32d2c87f8e587bdb9`,
+ archive 33,261,545 bytes with SHA-256 `234aa56026009c91abdfa37abae484723a39f027f8afa00760afc784a3ecfd05`.
+- Duration and resource metrics: jobs were 3m43s Linux arm64, 2m57s Linux x64, 4m54s Windows x64,
+ 4m7s macOS arm64, 6m34s macOS x64, and 10m37s Windows arm64. Windows arm64 native builds took
+ 152,711 ms and 132,480 ms; smoke took 5,845 ms and 5,408 ms at 53,018,624 and 51,732,480 bytes
+ RSS. Build peak RSS, open files/channels, and cancellation settlement were not instrumented.
+- Oracle proved: the parser correction works natively on both Windows architectures; `/Brepro`
+ yields complete equality on Windows x64; all four POSIX controls remain equal; a native arm64
+ residual is isolated to the copied node-pty `conpty_console_list.node`; mismatch prevents upload.
+- Does not prove: the differing byte region or PE field, a Windows arm64 correction, all-six
+ equality, cross-run identity, oldest baselines, native trust/signing, SSH, transfer, publication,
+ resolver/cache, fallback, UI, or an enabled tuple.
+- Checklist items satisfied: native parser boundary and five same-head reproducibility cells only;
+ native reproducibility remains open.
+- Follow-up: add a bounded PE-diff diagnostic for the two Windows arm64 binaries, record byte ranges
+ and headers, then correct only the copied artifact build if evidence identifies a safe source.
+ Do not weaken comparison, upload failed outputs, or change repository-wide/legacy node-pty.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4068,7 +4127,7 @@ owner and promotion condition.
| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Linux/macOS x64/arm64 pass; Windows parser correction awaits rerun | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
+| Native clean-rebuild identity unproved | Five native cells pass; Windows arm64 `conpty_console_list.node` drifts | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
@@ -4115,12 +4174,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001, push it with exact implementation commit
-`f864d3fa6` to draft PR #8741, and run all six target-native jobs. Each job must build, verify, and
-smoke two exclusive outputs at the canonical work path, compare every runtime-tree/archive/
-identity/SPDX/provenance entry, and upload only after equality. macOS must retain loadable `LC_UUID`
-values; Windows must prove `/Brepro` natively; Linux must remain green. Record exact paths and
-fields for any new red without weakening the oracle. Cross-family Layer B targets, the protected
+Add a bounded Windows PE diagnostic that compares the two native arm64
+`conpty_console_list.node` outputs before cleanup, reports hashes, differing ranges, and relevant
+headers without uploading failed bytes, and proves x64 stays unchanged. Use that evidence to make
+the narrowest copied-artifact build correction, then rerun local gates and all six target-native
+jobs without weakening the comparator. Cross-family Layer B targets, the protected
manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
From 39ee3451b8cc38b5311a0cb1085ad48a1f302185 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:19:46 -0400
Subject: [PATCH 032/267] build(ssh): diagnose Windows PE reproducibility drift
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 20 +-
...sh-relay-runtime-windows-pe-diagnostic.mjs | 444 ++++++++++++++++++
...lay-runtime-windows-pe-diagnostic.test.mjs | 142 ++++++
.../ssh-relay-runtime-workflow.test.mjs | 14 +
...github-release-implementation-checklist.md | 101 +++-
5 files changed, 698 insertions(+), 23 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
create mode 100644 config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index bd2e5713c30..394651d7686 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -271,6 +271,10 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility script syntax check failed' }
node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility test syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'Windows PE diagnostic script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'Windows PE diagnostic test syntax check failed' }
node --check config/scripts/build-ssh-relay-runtime.mjs
if ($LASTEXITCODE -ne 0) { throw 'runtime build script syntax check failed' }
node --check config/scripts/ssh-relay-runtime-build.test.mjs
@@ -287,6 +291,7 @@ jobs:
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
config/scripts/ssh-relay-runtime-reproducibility.test.mjs `
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs `
config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
config/scripts/ssh-relay-runtime-zip.test.mjs `
config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -358,7 +363,20 @@ jobs:
--tuple '${{ matrix.tuple }}' `
--first-output-directory $firstOutput `
--second-output-directory $secondOutput
- if ($LASTEXITCODE -ne 0) { throw 'runtime reproducibility verification failed' }
+ if ($LASTEXITCODE -ne 0) {
+ $firstPe = Join-Path $firstOutput 'runtime/node_modules/node-pty/build/Release/conpty_console_list.node'
+ $secondPe = Join-Path $secondOutput 'runtime/node_modules/node-pty/build/Release/conpty_console_list.node'
+ if ((Test-Path -LiteralPath $firstPe -PathType Leaf) -and (Test-Path -LiteralPath $secondPe -PathType Leaf)) {
+ # Why: rejected PE bytes remain local, but bounded headers/ranges identify the producer drift.
+ node config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs `
+ --first-pe $firstPe `
+ --second-pe $secondPe
+ if ($LASTEXITCODE -ne 0) { Write-Output 'windows_pe_diagnostic=failed' }
+ } else {
+ Write-Output 'windows_pe_diagnostic=skipped_missing_input'
+ }
+ throw 'runtime reproducibility verification failed'
+ }
$evidence = Join-Path $env:GITHUB_WORKSPACE 'runtime-evidence/${{ matrix.tuple }}'
New-Item -ItemType Directory -Path $evidence -Force | Out-Null
$firstArchive = Get-ChildItem -LiteralPath $firstOutput -Filter '*.zip' -File | Select-Object -First 1
diff --git a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
new file mode 100644
index 00000000000..795ae1dceaf
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
@@ -0,0 +1,444 @@
+import { createHash } from 'node:crypto'
+import { lstat, open } from 'node:fs/promises'
+import { resolve } from 'node:path'
+
+const MAX_PE_BYTES = 64 * 1024 * 1024
+const MAX_HEADER_BYTES = 1024 * 1024
+const MAX_SECTIONS = 96
+const MAX_DEBUG_ENTRIES = 32
+const MAX_DIFF_RANGES = 128
+const MAX_HEADER_DIFFERENCES = 128
+const READ_CHUNK_BYTES = 64 * 1024
+const DIAGNOSTIC_TIMEOUT_MS = 60_000
+
+const DATA_DIRECTORY_NAMES = [
+ 'export',
+ 'import',
+ 'resource',
+ 'exception',
+ 'security',
+ 'baseRelocation',
+ 'debug',
+ 'architecture',
+ 'globalPointer',
+ 'tls',
+ 'loadConfig',
+ 'boundImport',
+ 'iat',
+ 'delayImport',
+ 'clr',
+ 'reserved'
+]
+
+function requireBytes(buffer, offset, length, label) {
+ if (!Number.isSafeInteger(offset) || offset < 0 || offset + length > buffer.length) {
+ throw new Error(`PE ${label} exceeds the bounded header`)
+ }
+}
+
+function hex(value, width = 0) {
+ return `0x${value.toString(16).padStart(width, '0')}`
+}
+
+function readSectionName(buffer, offset) {
+ const bytes = buffer.subarray(offset, offset + 8)
+ const end = bytes.indexOf(0)
+ const name = bytes.subarray(0, end === -1 ? bytes.length : end).toString('ascii')
+ return /^[ -~]*$/.test(name) ? name : bytes.toString('hex')
+}
+
+function parsePeHeader(buffer) {
+ requireBytes(buffer, 0, 0x40, 'DOS header')
+ if (buffer.readUInt16LE(0) !== 0x5a4d) {
+ throw new Error('PE diagnostic input is missing the MZ signature')
+ }
+ const peOffset = buffer.readUInt32LE(0x3c)
+ requireBytes(buffer, peOffset, 24, 'COFF header')
+ if (buffer.readUInt32LE(peOffset) !== 0x00004550) {
+ throw new Error('PE diagnostic input is missing the PE signature')
+ }
+
+ const coffOffset = peOffset + 4
+ const numberOfSections = buffer.readUInt16LE(coffOffset + 2)
+ const optionalHeaderBytes = buffer.readUInt16LE(coffOffset + 16)
+ if (numberOfSections > MAX_SECTIONS) {
+ throw new Error('PE section count exceeds the diagnostic limit')
+ }
+ const optionalOffset = coffOffset + 20
+ requireBytes(buffer, optionalOffset, optionalHeaderBytes, 'optional header')
+ const magic = buffer.readUInt16LE(optionalOffset)
+ if (magic !== 0x10b && magic !== 0x20b) {
+ throw new Error(`unsupported PE optional-header magic: ${hex(magic, 4)}`)
+ }
+ const pe32Plus = magic === 0x20b
+ const directoryCountOffset = optionalOffset + (pe32Plus ? 108 : 92)
+ const directoryOffset = optionalOffset + (pe32Plus ? 112 : 96)
+ requireBytes(buffer, directoryCountOffset, 4, 'data-directory count')
+ const declaredDirectoryCount = buffer.readUInt32LE(directoryCountOffset)
+ const availableDirectoryCount = Math.floor(
+ (optionalOffset + optionalHeaderBytes - directoryOffset) / 8
+ )
+ const directoryCount = Math.min(declaredDirectoryCount, availableDirectoryCount, 16)
+ const dataDirectories = {}
+ for (let index = 0; index < directoryCount; index += 1) {
+ const offset = directoryOffset + index * 8
+ dataDirectories[DATA_DIRECTORY_NAMES[index]] = {
+ virtualAddress: hex(buffer.readUInt32LE(offset), 8),
+ size: buffer.readUInt32LE(offset + 4)
+ }
+ }
+
+ const sectionTableOffset = optionalOffset + optionalHeaderBytes
+ requireBytes(buffer, sectionTableOffset, numberOfSections * 40, 'section table')
+ const sections = []
+ for (let index = 0; index < numberOfSections; index += 1) {
+ const offset = sectionTableOffset + index * 40
+ sections.push({
+ name: readSectionName(buffer, offset),
+ virtualSize: buffer.readUInt32LE(offset + 8),
+ virtualAddress: buffer.readUInt32LE(offset + 12),
+ rawSize: buffer.readUInt32LE(offset + 16),
+ rawPointer: buffer.readUInt32LE(offset + 20),
+ characteristics: hex(buffer.readUInt32LE(offset + 36), 8),
+ headerOffset: offset
+ })
+ }
+
+ const imageBase = pe32Plus
+ ? hex(buffer.readBigUInt64LE(optionalOffset + 24), 16)
+ : hex(buffer.readUInt32LE(optionalOffset + 28), 8)
+ const header = {
+ dos: { peOffset },
+ coff: {
+ machine: hex(buffer.readUInt16LE(coffOffset), 4),
+ numberOfSections,
+ timeDateStamp: hex(buffer.readUInt32LE(coffOffset + 4), 8),
+ pointerToSymbolTable: buffer.readUInt32LE(coffOffset + 8),
+ numberOfSymbols: buffer.readUInt32LE(coffOffset + 12),
+ optionalHeaderBytes,
+ characteristics: hex(buffer.readUInt16LE(coffOffset + 18), 4)
+ },
+ optional: {
+ magic: hex(magic, 4),
+ linkerVersion: `${buffer[optionalOffset + 2]}.${buffer[optionalOffset + 3]}`,
+ sizeOfCode: buffer.readUInt32LE(optionalOffset + 4),
+ sizeOfInitializedData: buffer.readUInt32LE(optionalOffset + 8),
+ sizeOfUninitializedData: buffer.readUInt32LE(optionalOffset + 12),
+ addressOfEntryPoint: hex(buffer.readUInt32LE(optionalOffset + 16), 8),
+ imageBase,
+ sectionAlignment: buffer.readUInt32LE(optionalOffset + 32),
+ fileAlignment: buffer.readUInt32LE(optionalOffset + 36),
+ sizeOfImage: buffer.readUInt32LE(optionalOffset + 56),
+ sizeOfHeaders: buffer.readUInt32LE(optionalOffset + 60),
+ checksum: hex(buffer.readUInt32LE(optionalOffset + 64), 8),
+ subsystem: hex(buffer.readUInt16LE(optionalOffset + 68), 4),
+ dllCharacteristics: hex(buffer.readUInt16LE(optionalOffset + 70), 4),
+ declaredDirectoryCount,
+ dataDirectories
+ },
+ sections: sections.map(({ headerOffset: _headerOffset, ...section }) => section),
+ debugDirectory: []
+ }
+ const regions = [
+ { start: coffOffset, end: coffOffset + 20, label: 'COFF header' },
+ { start: optionalOffset, end: optionalOffset + optionalHeaderBytes, label: 'optional header' },
+ ...sections.map((section) => ({
+ start: section.headerOffset,
+ end: section.headerOffset + 40,
+ label: `section header ${section.name}`
+ }))
+ ]
+ return { header, regions, sections }
+}
+
+function rvaToFileOffset(rva, header, sections) {
+ if (rva < header.optional.sizeOfHeaders) {
+ return rva
+ }
+ const section = sections.find(
+ (candidate) =>
+ rva >= candidate.virtualAddress &&
+ rva < candidate.virtualAddress + Math.max(candidate.virtualSize, candidate.rawSize)
+ )
+ if (!section) {
+ return undefined
+ }
+ const delta = rva - section.virtualAddress
+ return delta < section.rawSize ? section.rawPointer + delta : undefined
+}
+
+async function readAt(handle, offset, length, fileSize, signal) {
+ signal.throwIfAborted()
+ if (offset < 0 || length < 0 || offset + length > fileSize) {
+ throw new Error('PE diagnostic read exceeds the file boundary')
+ }
+ const buffer = Buffer.alloc(length)
+ let read = 0
+ while (read < length) {
+ signal.throwIfAborted()
+ const result = await handle.read(buffer, read, length - read, offset + read)
+ if (result.bytesRead === 0) {
+ throw new Error('PE diagnostic encountered an early EOF')
+ }
+ read += result.bytesRead
+ }
+ return buffer
+}
+
+async function addDebugDirectory(handle, parsed, fileSize, signal) {
+ const debug = parsed.header.optional.dataDirectories.debug
+ if (!debug || debug.size === 0) {
+ return
+ }
+ const debugRva = Number.parseInt(debug.virtualAddress.slice(2), 16)
+ const debugOffset = rvaToFileOffset(debugRva, parsed.header, parsed.sections)
+ if (debugOffset === undefined || debug.size % 28 !== 0) {
+ throw new Error('PE debug directory does not map to complete entries')
+ }
+ const entryCount = debug.size / 28
+ if (entryCount > MAX_DEBUG_ENTRIES) {
+ throw new Error('PE debug directory exceeds the diagnostic entry limit')
+ }
+ const bytes = await readAt(handle, debugOffset, debug.size, fileSize, signal)
+ parsed.regions.push({
+ start: debugOffset,
+ end: debugOffset + debug.size,
+ label: 'debug directory'
+ })
+ for (let index = 0; index < entryCount; index += 1) {
+ const offset = index * 28
+ const entry = {
+ characteristics: hex(bytes.readUInt32LE(offset), 8),
+ timeDateStamp: hex(bytes.readUInt32LE(offset + 4), 8),
+ version: `${bytes.readUInt16LE(offset + 8)}.${bytes.readUInt16LE(offset + 10)}`,
+ type: bytes.readUInt32LE(offset + 12),
+ sizeOfData: bytes.readUInt32LE(offset + 16),
+ addressOfRawData: hex(bytes.readUInt32LE(offset + 20), 8),
+ pointerToRawData: bytes.readUInt32LE(offset + 24)
+ }
+ if (entry.type === 2 && entry.sizeOfData > 0 && entry.sizeOfData <= 4096) {
+ const codeView = await readAt(
+ handle,
+ entry.pointerToRawData,
+ entry.sizeOfData,
+ fileSize,
+ signal
+ )
+ const signature = codeView.subarray(0, Math.min(4, codeView.length)).toString('ascii')
+ const pathStart = signature === 'RSDS' && codeView.length >= 24 ? 24 : 4
+ const pathBytes = codeView.subarray(pathStart)
+ entry.codeView = {
+ signature,
+ identifier: signature === 'RSDS' ? codeView.subarray(4, 20).toString('hex') : undefined,
+ age: signature === 'RSDS' ? codeView.readUInt32LE(20) : undefined,
+ pathBytes: pathBytes.length,
+ pathSha256: `sha256:${createHash('sha256').update(pathBytes).digest('hex')}`
+ }
+ parsed.regions.push({
+ start: entry.pointerToRawData,
+ end: entry.pointerToRawData + entry.sizeOfData,
+ label: `CodeView data ${index}`
+ })
+ }
+ parsed.header.debugDirectory.push(entry)
+ }
+}
+
+async function inspectPe(path, label, signal) {
+ const metadata = await lstat(path)
+ if (!metadata.isFile() || metadata.isSymbolicLink()) {
+ throw new Error(`${label} PE input must be a regular file`)
+ }
+ if (metadata.size > MAX_PE_BYTES) {
+ throw new Error(`${label} PE input exceeds the diagnostic size limit`)
+ }
+ const handle = await open(path, 'r')
+ try {
+ const prefix = await readAt(
+ handle,
+ 0,
+ Math.min(metadata.size, MAX_HEADER_BYTES),
+ metadata.size,
+ signal
+ )
+ const parsed = parsePeHeader(prefix)
+ await addDebugDirectory(handle, parsed, metadata.size, signal)
+ return { handle, metadata, parsed }
+ } catch (error) {
+ await handle.close()
+ throw error
+ }
+}
+
+function finishRange(state, firstRegions, secondRegions) {
+ if (state.start === undefined) {
+ return
+ }
+ state.rangeCount += 1
+ if (state.ranges.length < MAX_DIFF_RANGES) {
+ const regionAt = (regions) =>
+ regions.find((region) => state.start >= region.start && state.start < region.end)?.label ??
+ 'unmapped file data'
+ state.ranges.push({
+ start: state.start,
+ endExclusive: state.end,
+ startHex: hex(state.start),
+ endExclusiveHex: hex(state.end),
+ length: state.end - state.start,
+ firstRegion: regionAt(firstRegions),
+ secondRegion: regionAt(secondRegions)
+ })
+ }
+ state.start = undefined
+}
+
+async function compareBytes(first, second, signal) {
+ const firstHash = createHash('sha256')
+ const secondHash = createHash('sha256')
+ const state = { differingBytes: 0, end: 0, rangeCount: 0, ranges: [], start: undefined }
+ const length = Math.max(first.metadata.size, second.metadata.size)
+ for (let offset = 0; offset < length; offset += READ_CHUNK_BYTES) {
+ signal.throwIfAborted()
+ const firstLength = Math.min(READ_CHUNK_BYTES, Math.max(0, first.metadata.size - offset))
+ const secondLength = Math.min(READ_CHUNK_BYTES, Math.max(0, second.metadata.size - offset))
+ const [firstBytes, secondBytes] = await Promise.all([
+ readAt(first.handle, offset, firstLength, first.metadata.size, signal),
+ readAt(second.handle, offset, secondLength, second.metadata.size, signal)
+ ])
+ firstHash.update(firstBytes)
+ secondHash.update(secondBytes)
+ const chunkLength = Math.max(firstLength, secondLength)
+ for (let index = 0; index < chunkLength; index += 1) {
+ const different =
+ index >= firstLength || index >= secondLength || firstBytes[index] !== secondBytes[index]
+ if (different) {
+ state.differingBytes += 1
+ state.start ??= offset + index
+ state.end = offset + index + 1
+ } else {
+ finishRange(state, first.parsed.regions, second.parsed.regions)
+ }
+ }
+ }
+ finishRange(state, first.parsed.regions, second.parsed.regions)
+ return {
+ firstSha256: `sha256:${firstHash.digest('hex')}`,
+ secondSha256: `sha256:${secondHash.digest('hex')}`,
+ differingBytes: state.differingBytes,
+ rangeCount: state.rangeCount,
+ ranges: state.ranges,
+ rangesTruncated: state.rangeCount > state.ranges.length
+ }
+}
+
+function collectHeaderDifferences(first, second, path, state) {
+ if (state.count >= MAX_HEADER_DIFFERENCES) {
+ state.truncated = true
+ return
+ }
+ if (Object.is(first, second)) {
+ return
+ }
+ if (
+ first === null ||
+ second === null ||
+ typeof first !== 'object' ||
+ typeof second !== 'object'
+ ) {
+ state.differences.push({ field: path, first: first ?? null, second: second ?? null })
+ state.count += 1
+ return
+ }
+ const keys = [...new Set([...Object.keys(first), ...Object.keys(second)])].sort()
+ for (const key of keys) {
+ collectHeaderDifferences(first[key], second[key], path ? `${path}.${key}` : key, state)
+ }
+}
+
+export async function diagnoseWindowsPeMismatch({
+ firstPePath,
+ secondPePath,
+ signal = AbortSignal.timeout(DIAGNOSTIC_TIMEOUT_MS)
+}) {
+ const firstPath = resolve(firstPePath)
+ const secondPath = resolve(secondPePath)
+ if (firstPath === secondPath) {
+ throw new Error('PE diagnostic inputs must be distinct files')
+ }
+ signal.throwIfAborted()
+ const first = await inspectPe(firstPath, 'first', signal)
+ let second
+ try {
+ second = await inspectPe(secondPath, 'second', signal)
+ const comparison = await compareBytes(first, second, signal)
+ const headerState = { count: 0, differences: [], truncated: false }
+ collectHeaderDifferences(first.parsed.header, second.parsed.header, '', headerState)
+ return {
+ schemaVersion: 1,
+ first: {
+ bytes: first.metadata.size,
+ sha256: comparison.firstSha256,
+ pe: first.parsed.header
+ },
+ second: {
+ bytes: second.metadata.size,
+ sha256: comparison.secondSha256,
+ pe: second.parsed.header
+ },
+ difference: {
+ differingBytes: comparison.differingBytes,
+ rangeCount: comparison.rangeCount,
+ ranges: comparison.ranges,
+ rangesTruncated: comparison.rangesTruncated,
+ headerDifferences: headerState.differences,
+ headerDifferencesTruncated: headerState.truncated
+ }
+ }
+ } finally {
+ await Promise.all([first.handle.close(), second?.handle.close()])
+ }
+}
+
+function valueAfter(argv, index, flag) {
+ const value = argv[index + 1]
+ if (!value || value.startsWith('--')) {
+ throw new Error(`${flag} requires a value`)
+ }
+ return value
+}
+
+export function parseWindowsPeDiagnosticArguments(argv) {
+ const result = {}
+ for (let index = 0; index < argv.length; index += 1) {
+ const flag = argv[index]
+ const value = valueAfter(argv, index, flag)
+ if (flag === '--first-pe') {
+ result.firstPePath = value
+ } else if (flag === '--second-pe') {
+ result.secondPePath = value
+ } else {
+ throw new Error(`Unknown argument: ${flag}`)
+ }
+ index += 1
+ }
+ for (const field of ['firstPePath', 'secondPePath']) {
+ if (!result[field]) {
+ throw new Error(`Missing required PE diagnostic argument: ${field}`)
+ }
+ }
+ return result
+}
+
+async function main() {
+ const result = await diagnoseWindowsPeMismatch(
+ parseWindowsPeDiagnosticArguments(process.argv.slice(2))
+ )
+ process.stdout.write(`windows_pe_mismatch=${JSON.stringify(result)}\n`)
+}
+
+if (process.argv[1] && resolve(process.argv[1]) === import.meta.filename) {
+ main().catch((error) => {
+ process.stderr.write(`Windows PE mismatch diagnostic failed: ${error.message}\n`)
+ process.exitCode = 1
+ })
+}
diff --git a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
new file mode 100644
index 00000000000..c11ac8d0b46
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
@@ -0,0 +1,142 @@
+import { mkdtemp, open, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import {
+ diagnoseWindowsPeMismatch,
+ parseWindowsPeDiagnosticArguments
+} from './ssh-relay-runtime-windows-pe-diagnostic.mjs'
+
+const temporaryDirectories = []
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+function peFixture({ identifierByte = 0x11, timestamp = 0x12345678 } = {}) {
+ const bytes = Buffer.alloc(0x400)
+ bytes.writeUInt16LE(0x5a4d, 0)
+ bytes.writeUInt32LE(0x80, 0x3c)
+ bytes.writeUInt32LE(0x00004550, 0x80)
+ const coff = 0x84
+ bytes.writeUInt16LE(0xaa64, coff)
+ bytes.writeUInt16LE(1, coff + 2)
+ bytes.writeUInt32LE(timestamp, coff + 4)
+ bytes.writeUInt16LE(0xf0, coff + 16)
+ bytes.writeUInt16LE(0x2022, coff + 18)
+ const optional = coff + 20
+ bytes.writeUInt16LE(0x20b, optional)
+ bytes[optional + 2] = 14
+ bytes.writeUInt32LE(0x100, optional + 4)
+ bytes.writeUInt32LE(0x100, optional + 8)
+ bytes.writeUInt32LE(0x2000, optional + 16)
+ bytes.writeBigUInt64LE(0x180000000n, optional + 24)
+ bytes.writeUInt32LE(0x1000, optional + 32)
+ bytes.writeUInt32LE(0x200, optional + 36)
+ bytes.writeUInt32LE(0x3000, optional + 56)
+ bytes.writeUInt32LE(0x200, optional + 60)
+ bytes.writeUInt16LE(3, optional + 68)
+ bytes.writeUInt16LE(0x160, optional + 70)
+ bytes.writeUInt32LE(16, optional + 108)
+ const debugDataDirectory = optional + 112 + 6 * 8
+ bytes.writeUInt32LE(0x2000, debugDataDirectory)
+ bytes.writeUInt32LE(28, debugDataDirectory + 4)
+ const section = optional + 0xf0
+ bytes.write('.rdata', section, 'ascii')
+ bytes.writeUInt32LE(0x200, section + 8)
+ bytes.writeUInt32LE(0x2000, section + 12)
+ bytes.writeUInt32LE(0x200, section + 16)
+ bytes.writeUInt32LE(0x200, section + 20)
+ bytes.writeUInt32LE(0x40000040, section + 36)
+ const debug = 0x200
+ bytes.writeUInt32LE(timestamp, debug + 4)
+ bytes.writeUInt32LE(2, debug + 12)
+ bytes.writeUInt32LE(32, debug + 16)
+ bytes.writeUInt32LE(0x2020, debug + 20)
+ bytes.writeUInt32LE(0x220, debug + 24)
+ bytes.write('RSDS', 0x220, 'ascii')
+ bytes.fill(identifierByte, 0x224, 0x234)
+ bytes.writeUInt32LE(1, 0x234)
+ bytes.write('test.pdb\0', 0x238, 'ascii')
+ return bytes
+}
+
+async function fixturePair(firstBytes, secondBytes) {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-windows-pe-diagnostic-'))
+ temporaryDirectories.push(directory)
+ const firstPePath = join(directory, 'first.node')
+ const secondPePath = join(directory, 'second.node')
+ await Promise.all([writeFile(firstPePath, firstBytes), writeFile(secondPePath, secondBytes)])
+ return { firstPePath, secondPePath }
+}
+
+describe('SSH relay Windows PE mismatch diagnostic', () => {
+ it('reports bounded byte ranges and relevant header differences without file paths', async () => {
+ const fixture = await fixturePair(
+ peFixture(),
+ peFixture({ identifierByte: 0x22, timestamp: 0x87654321 })
+ )
+
+ const result = await diagnoseWindowsPeMismatch(fixture)
+
+ expect(result).toEqual(
+ expect.objectContaining({
+ schemaVersion: 1,
+ first: expect.objectContaining({ bytes: 0x400, sha256: expect.stringMatching(/^sha256:/) }),
+ second: expect.objectContaining({
+ bytes: 0x400,
+ sha256: expect.stringMatching(/^sha256:/)
+ }),
+ difference: expect.objectContaining({
+ differingBytes: 24,
+ rangeCount: 3,
+ rangesTruncated: false
+ })
+ })
+ )
+ expect(result.first.pe.coff.machine).toBe('0xaa64')
+ expect(result.first.pe.sections[0].name).toBe('.rdata')
+ expect(result.difference.ranges.map((range) => range.firstRegion)).toEqual([
+ 'COFF header',
+ 'debug directory',
+ 'CodeView data 0'
+ ])
+ expect(result.difference.headerDifferences.map((entry) => entry.field)).toEqual([
+ 'coff.timeDateStamp',
+ 'debugDirectory.0.codeView.identifier',
+ 'debugDirectory.0.timeDateStamp'
+ ])
+ expect(JSON.stringify(result)).not.toContain(fixture.firstPePath)
+ })
+
+ it('rejects oversized, invalid, same-file, and aborted diagnostics', async () => {
+ const fixture = await fixturePair(peFixture(), peFixture())
+ await expect(
+ diagnoseWindowsPeMismatch({
+ firstPePath: fixture.firstPePath,
+ secondPePath: fixture.firstPePath
+ })
+ ).rejects.toThrow('must be distinct')
+ await writeFile(fixture.secondPePath, 'not a PE')
+ await expect(diagnoseWindowsPeMismatch(fixture)).rejects.toThrow('bounded header')
+
+ const handle = await open(fixture.secondPePath, 'w')
+ await handle.truncate(64 * 1024 * 1024 + 1)
+ await handle.close()
+ await expect(diagnoseWindowsPeMismatch(fixture)).rejects.toThrow('size limit')
+ await expect(
+ diagnoseWindowsPeMismatch({ ...fixture, signal: AbortSignal.abort() })
+ ).rejects.toThrow('aborted')
+ })
+
+ it('parses only the two explicit CLI inputs', () => {
+ expect(
+ parseWindowsPeDiagnosticArguments(['--first-pe', 'first.node', '--second-pe', 'second.node'])
+ ).toEqual({ firstPePath: 'first.node', secondPePath: 'second.node' })
+ expect(() => parseWindowsPeDiagnosticArguments(['--other', 'value'])).toThrow(
+ 'Unknown argument'
+ )
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 9d701eaa429..cb6407a90ca 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -61,6 +61,8 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('foreach ($output in @($firstOutput, $secondOutput))')
expect(source).toContain('ssh-relay-runtime-reproducibility.mjs')
expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
+ expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.mjs')
+ expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.test.mjs')
expect(source).toContain(
'node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs'
)
@@ -100,6 +102,18 @@ describe('SSH relay runtime artifact workflow', () => {
run.indexOf('ssh-relay-runtime-reproducibility.mjs')
)
}
+ const windowsRun = windowsSteps.find(
+ (step) => step.name === 'Build twice, inspect, smoke, and compare exact runtime'
+ ).run
+ expect(windowsRun.indexOf('ssh-relay-runtime-windows-pe-diagnostic.mjs')).toBeGreaterThan(
+ windowsRun.indexOf('ssh-relay-runtime-reproducibility.mjs')
+ )
+ expect(
+ windowsRun.indexOf("throw 'runtime reproducibility verification failed'")
+ ).toBeGreaterThan(windowsRun.indexOf('ssh-relay-runtime-windows-pe-diagnostic.mjs'))
+ expect(windowsRun.indexOf('runtime-evidence/${{ matrix.tuple }}')).toBeGreaterThan(
+ windowsRun.indexOf("throw 'runtime reproducibility verification failed'")
+ )
expect(steps[uploadIndex].with.path).toBe('runtime-evidence/${{ matrix.tuple }}/')
expect(source).not.toMatch(/releases\/|gh release|contents:\s*write/i)
})
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 53de05f1acd..f7075873c75 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29351557922 proves clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but fails closed because Windows arm64 first differs at `conpty_console_list.node`; the active slice is bounded diagnosis/correction of that copied artifact build only; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head runs 29351557922 and 29352510414 prove clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but both fail closed because Windows arm64 first differs at `conpty_console_list.node`; the active slice is a bounded PE diagnostic for that copied artifact before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -108,8 +108,11 @@ same change as the work it records.
exact commit `f864d3fa6`. Exact-head run 29351557922 then parses and builds on all six native
runners: Linux x64/arm64, macOS x64/arm64, and Windows x64 compare exactly and upload, while
Windows arm64 fully builds, verifies, and smokes both outputs but fails closed before upload when
- `conpty_console_list.node` differs (E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001). Native Windows
- arm64 equality remains mandatory; oldest-baseline, native-trust, SSH, and musl cells remain open.
+ `conpty_console_list.node` differs (E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001). Documentation-
+ only exact-head repeat run 29352510414 reproduces the same isolated arm64 drift while all five
+ controls compare and upload under E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001. Native
+ Windows arm64 equality remains mandatory; oldest-baseline, native-trust, SSH, and musl cells
+ remain open.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -149,12 +152,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: commit the exact local evidence record for `f864d3fa6`, push the bounded
- correction and evidence commits, and rerun all six target-native jobs. Require Linux and macOS to
- remain equal and Windows `/Brepro` outputs to build, smoke, compare equal, and upload. Keep
- oldest-baseline, cross-family remote infrastructure, signing/trust, and measured legacy baseline
- gates open; do not introduce publication, resolver, transfer, rollout, tuple enablement, or
- default behavior.
+- Next required action: finish the bounded Windows PE diagnostic that compares the two rejected
+ `conpty_console_list.node` outputs before cleanup and
+ reports hashes, sizes, differing byte ranges, and relevant PE headers without uploading either
+ failed binary. Prove the diagnostic contract locally and on both native Windows runners before
+ making any copied-artifact producer correction. Keep the strict comparator, x64 behavior,
+ repository-wide node-pty patch, legacy/default path, and all other release gates unchanged.
## Non-Negotiable Invariants
@@ -631,19 +634,17 @@ isolated the first native differences to macOS `pty.node` and Windows `conpty_co
under E-M3-REPRODUCIBILITY-DIAGNOSTIC-CI-RED-001. Artifact consumers, publication, the
repository-wide node-pty patch, and the legacy/default path remain unchanged.
-**Active correction — 2026-07-14, Codex implementation owner:** implementation `a09b02ec4` requires
-disjoint exclusive output/work directories, reuses one caller-owned work path across clean passes,
-links macOS native outputs with `-Wl,-reproducible` while retaining the required `LC_UUID`, and
-adds `/Brepro` only to the copied Windows node-pty source with an exact-source fail-closed guard.
-Follow-up `3e433b343` removes the run ID from the work path so separate CI runs use one canonical
-runner-local location while their outputs remain run-scoped. E-M3-REPRODUCIBILITY-LINKER-LOCAL-001
-proves two clean macOS passes plus a separate repeat session are byte-identical and loadable.
-E-M3-REPRODUCIBILITY-LINKER-CI-RED-001 proves Linux and macOS x64/arm64 equality on exact head
-`54df2cb99`; Windows stopped before artifact inputs because Vitest imported the builder's unused Unix
-shebang. The active bounded correction removes only that shebang and syntax-checks the builder and
-its test on POSIX and Windows before contract collection. Its exact implementation commit
-`f864d3fa6` is locally green under E-M3-REPRODUCIBILITY-BUILDER-PARSER-LOCAL-001. Native Windows
-proof and the six-runner equality gate remain open; no tuple or production consumer is enabled.
+**Active correction — 2026-07-14, Codex implementation owner:** exact-head run 29351557922 proves
+the parser and `/Brepro` correction on both Windows architectures, with complete equality on x64.
+Windows arm64 builds, verifies, and smokes both complete outputs but first differs at copied-artifact
+`conpty_console_list.node`, so the comparator rejects the cell and uploads neither output under
+E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001. The active bounded package adds a test-covered PE
+mismatch diagnostic before cleanup: hashes, sizes, coalesced differing byte ranges, and relevant PE
+headers only, with bounded reads/output and no failed-binary upload. Exact-head repeat run
+29352510414 reproduces the same arm64-only drift while all five controls compare and upload under
+E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001. No comparator weakening, post-build
+normalization, producer correction, repository-wide node-pty change, tuple enablement, or production
+consumer is authorized without the diagnostic evidence.
Each runtime must contain only the executable closure required by the relay.
@@ -4117,6 +4118,62 @@ or unexpected token`; the first logs did not identify a source location.
and headers, then correct only the copied artifact build if evidence identifies a safe source.
Do not weaken comparison, upload failed outputs, or change repository-wide/legacy node-pty.
+### E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001 — Independent repeat of arm64-only drift
+
+- Date: 2026-07-14
+- Commit SHA / PR: documentation-only exact head `a7151f9750fd9bfcdcff8c01c1fd6caff2e6116a`;
+ implementation bytes remain `de541efd11989d2e6dce0402307912afffae3510`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29352510414](https://github.com/stablyai/orca/actions/runs/29352510414),
+ conclusion `failure`; Linux x64 `87151980265`, Linux arm64 `87151980298`, macOS arm64
+ `87151980396`, macOS x64 `87151980327`, Windows x64 `87151980324`, and failing Windows arm64
+ `87151980264`
+- Runners: the same six native labels/toolchain family recorded in
+ E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001. The failing cell was Windows 11 Enterprise
+ 10.0.26200 arm64, image `windows-11-arm64` `20260706.102.1`, runner `2.335.1`, provisioner
+ `20260624.560`, Node v24.18.0, MSVC 19.44.35228 / tools 14.44.35207, Windows SDK 10.0.26100.0,
+ and Python 3.13.14.
+- Remote and transport: none; independent target-native artifact assembly/execution and unpublished
+ Actions artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29352510414 --repo stablyai/orca \
+ --json databaseId,headSha,status,conclusion,url,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87151980264/logs
+ gh api 'repos/stablyai/orca/actions/runs/29352510414/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as expected at the unchanged native boundary. All 14 contract suites passed on
+ Windows arm64 with 44 tests passed and three POSIX-only skips. Linux x64/arm64, macOS x64/arm64,
+ and Windows x64 independently built twice, inspected, smoked, compared exactly, and uploaded
+ unpublished artifacts `8318818618`, `8318833832`, `8318812505`, `8318846378`, and `8318866333`.
+ Windows arm64 again built, inspected, and smoked two complete 60-entry, 42-file,
+ 86,189,895-byte outputs, then first differed at
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node`; upload was skipped.
+- Windows arm64 rejected outputs: first content ID
+ `e13f39ae96eba36c3ed41054da7429533e2eebbdd7d845a712d802d002906bc8`, ZIP 33,261,548 bytes
+ with SHA-256 `ca1be18b572e353ac2eb3a390d91e5d0acb93100735f387ce74300cb48ba39d1`;
+ second content ID `4989a282c6529df6066aefbb5667ca96777907d54f1d9a48041f8ff98555b9c0`,
+ ZIP 33,261,548 bytes with SHA-256
+ `e91664074aa2f434ea0e2603596410c119b89b2a4a4d7eab453bfb7407ff91d0`.
+- Duration and resource metrics: jobs completed in 3m9s Linux x64, 3m39s Linux arm64, 2m56s macOS
+ arm64, 4m9s macOS x64, 4m53s Windows x64, and 8m48s Windows arm64. Arm64 native builds took
+ 145,700 ms and 124,010 ms; smoke took 6,042 ms and 5,564 ms at 53,075,968 and 52,977,664 bytes
+ RSS. Build peak RSS, open files/channels, and cancellation settlement were not instrumented.
+- Artifact/log/trace link: run/job above and the five unpublished seven-day artifacts; no failed
+ arm64 bytes were uploaded
+- Oracle proved: the Windows arm64 difference repeats across an independent run while the same-head
+ Windows x64 and four POSIX controls remain reproducible; the strict gate consistently prevents a
+ rejected output from upload. The drift is not a transient failure from run 29351557922.
+- Does not prove: differing PE byte ranges/headers, a producer correction, arm64 equality,
+ cross-run equality, oldest baselines, native trust/signing, SSH, publication, transfer, fallback,
+ UI, or any enabled tuple.
+- Checklist items satisfied: no new completion checkbox; this repeat evidence justifies the bounded
+ PE diagnostic before any producer change.
+- Follow-up: run the bounded diagnostic on both native Windows runners, require x64 to remain equal,
+ and use only the rejected arm64 headers/ranges to choose or reject a copied-artifact correction.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
From 27c6a5718c544cd3f559d6adc24cc0beca2ed59e Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:21:13 -0400
Subject: [PATCH 033/267] docs(ssh): record bounded PE diagnostic evidence
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 122 ++++++++++++++----
1 file changed, 99 insertions(+), 23 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index f7075873c75..97ea10ca895 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head runs 29351557922 and 29352510414 prove clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but both fail closed because Windows arm64 first differs at `conpty_console_list.node`; the active slice is a bounded PE diagnostic for that copied artifact before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head runs 29351557922 and 29352510414 prove clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but both fail closed because Windows arm64 first differs at `conpty_console_list.node`; bounded PE diagnostic implementation `39ee3451b` is locally green and awaiting native evidence before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -112,7 +112,9 @@ same change as the work it records.
only exact-head repeat run 29352510414 reproduces the same isolated arm64 drift while all five
controls compare and upload under E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001. Native
Windows arm64 equality remains mandatory; oldest-baseline, native-trust, SSH, and musl cells
- remain open.
+ remain open. E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001 proves the bounded diagnostic and fail-closed
+ workflow ordering locally at exact implementation commit `39ee3451b`; both native Windows cells
+ remain required before interpreting or correcting the producer.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -152,11 +154,10 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: finish the bounded Windows PE diagnostic that compares the two rejected
- `conpty_console_list.node` outputs before cleanup and
- reports hashes, sizes, differing byte ranges, and relevant PE headers without uploading either
- failed binary. Prove the diagnostic contract locally and on both native Windows runners before
- making any copied-artifact producer correction. Keep the strict comparator, x64 behavior,
+- Next required action: push exact implementation commit `39ee3451b` and run both native Windows
+ cells. Require x64 to remain exactly reproducible and arm64 to emit bounded hashes, sizes,
+ differing byte ranges, and relevant PE headers before failing with no upload. Make no
+ copied-artifact producer correction until that evidence is recorded. Keep the strict comparator,
repository-wide node-pty patch, legacy/default path, and all other release gates unchanged.
## Non-Negotiable Invariants
@@ -644,7 +645,8 @@ headers only, with bounded reads/output and no failed-binary upload. Exact-head
29352510414 reproduces the same arm64-only drift while all five controls compare and upload under
E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001. No comparator weakening, post-build
normalization, producer correction, repository-wide node-pty change, tuple enablement, or production
-consumer is authorized without the diagnostic evidence.
+consumer is authorized without the diagnostic evidence. Exact implementation commit `39ee3451b` is
+locally green under E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001; native Windows execution remains open.
Each runtime must contain only the executable closure required by the relay.
@@ -1244,16 +1246,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; Windows arm64 equality diagnosis active | `de541efd1`; E-M3-REPRODUCIBILITY-WINDOWS-ARM64-CI-RED-001, E-M3-CI-001, E-M3-WINDOWS-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; PE diagnostic awaiting native evidence | `39ee3451b`; E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001; arm64 repeat-red evidence |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -4174,6 +4176,80 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: run the bounded diagnostic on both native Windows runners, require x64 to remain equal,
and use only the rejected arm64 headers/ranges to choose or reject a copied-artifact correction.
+### E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001 — Bounded rejected-binary diagnostics
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `39ee3451b8cc38b5311a0cb1085ad48a1f302185`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741), push/native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. The
+ repository requires Node 24, so target-native Windows jobs remain authoritative.
+- Remote and transport: none; synthetic PE32+ arm64 fixtures and workflow source contracts only
+- Exact commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS at the exact implementation commit. Both syntax checks exited zero; the purpose
+ command passed 5/5 tests across two suites; all 15 artifact suites passed 50/50 tests. Typecheck,
+ focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, staged hooks, and diff checks exited zero. Full lint
+ emitted only pre-existing warnings outside this package.
+- Duration and resource metrics: syntax checks 50 ms and 40 ms; purpose suite 142 ms Vitest / 0.76s
+ wall; complete artifact suite 470 ms Vitest / 1.15s wall; typecheck 2.68s; focused oxlint 0.69s;
+ max-lines 1.58s; full lint 11.92s; formatting check 1.82s. The implementation rejects inputs over
+ 64 MiB, reads in 64 KiB chunks, caps the header at 1 MiB, the section/debug tables at 96/32
+ entries, byte/header differences at 128 each, and the whole diagnostic at 60 seconds. Synthetic
+ peak RSS/open files were not instrumented.
+- Artifact/log/trace link: exact source commit; no binary artifact was created or uploaded
+- Oracle proved: valid PE32+ fixtures report whole-file sizes/SHA-256, coalesced file-offset ranges,
+ COFF/optional/data-directory/section/debug headers, and hashed—not printed—CodeView paths;
+ oversized, malformed, same-file, unknown-argument, and pre-aborted inputs fail boundedly. Workflow
+ contracts require diagnostic syntax/tests on Windows, invoke it only after the strict comparator
+ rejects the two retained `conpty_console_list.node` files, throw afterward, and leave evidence
+ copying unreachable, so rejected binaries are not uploaded. No max-lines bypass was added.
+- Does not prove: parsing the real x64/arm64 linker outputs, native Node 24 behavior, the actual
+ differing ranges/headers, x64 equality after the workflow change, a producer correction, arm64
+ equality, oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or an enabled
+ tuple.
+- Checklist items satisfied: local bounded diagnostic and fail-closed workflow ordering only; no
+ native, tuple, or production checkbox.
+- Follow-up: push the exact implementation, require native x64 equality and arm64 diagnostic output
+ with no upload, then record the exact PE evidence before changing the producer.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4231,11 +4307,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Add a bounded Windows PE diagnostic that compares the two native arm64
-`conpty_console_list.node` outputs before cleanup, reports hashes, differing ranges, and relevant
-headers without uploading failed bytes, and proves x64 stays unchanged. Use that evidence to make
-the narrowest copied-artifact build correction, then rerun local gates and all six target-native
-jobs without weakening the comparator. Cross-family Layer B targets, the protected
+Push exact implementation commit `39ee3451b` and require native Windows x64 to remain exactly
+reproducible while arm64 emits bounded hashes, sizes, differing ranges, and relevant PE headers
+before failing with no upload. Use only that evidence to choose or reject the narrowest
+copied-artifact build correction, then rerun local gates and all six target-native jobs without
+weakening the comparator. Cross-family Layer B targets, the protected
manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
From cd7f941365bf6e631cf0f9947f517ecef02afc8e Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:37:48 -0400
Subject: [PATCH 034/267] test(ssh): summarize complete Windows PE drift
Co-authored-by: Orca
---
...sh-relay-runtime-windows-pe-diagnostic.mjs | 111 +++++++++++++++---
...lay-runtime-windows-pe-diagnostic.test.mjs | 56 +++++++--
2 files changed, 144 insertions(+), 23 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
index 795ae1dceaf..df567a823cd 100644
--- a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
+++ b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
@@ -8,6 +8,8 @@ const MAX_SECTIONS = 96
const MAX_DEBUG_ENTRIES = 32
const MAX_DIFF_RANGES = 128
const MAX_HEADER_DIFFERENCES = 128
+const MAX_RANGE_SAMPLE_BYTES = 32
+const MAX_REGION_SAMPLES = 8
const READ_CHUNK_BYTES = 64 * 1024
const DIAGNOSTIC_TIMEOUT_MS = 60_000
@@ -146,11 +148,76 @@ function parsePeHeader(buffer) {
start: section.headerOffset,
end: section.headerOffset + 40,
label: `section header ${section.name}`
- }))
+ })),
+ ...sections
+ .filter((section) => section.rawSize > 0)
+ .map((section) => ({
+ start: section.rawPointer,
+ end: section.rawPointer + section.rawSize,
+ label: `section ${section.name}`
+ }))
]
return { header, regions, sections }
}
+function regionAt(regions, offset) {
+ const matches = regions.filter((region) => offset >= region.start && offset < region.end)
+ matches.sort((left, right) => left.end - left.start - (right.end - right.start))
+ return matches[0]?.label ?? 'unmapped file data'
+}
+
+function bytesHex(bytes) {
+ return bytes
+ .map((byte) => (byte === undefined ? '--' : byte.toString(16).padStart(2, '0')))
+ .join('')
+}
+
+function rangeRecord(state, firstRegions, secondRegions) {
+ const firstRegion = regionAt(firstRegions, state.start)
+ const secondRegion = regionAt(secondRegions, state.start)
+ return {
+ start: state.start,
+ endExclusive: state.end,
+ startHex: hex(state.start),
+ endExclusiveHex: hex(state.end),
+ length: state.end - state.start,
+ firstRegion,
+ secondRegion,
+ firstBytes: bytesHex(state.firstBytes),
+ secondBytes: bytesHex(state.secondBytes),
+ bytesTruncated: state.end - state.start > state.firstBytes.length
+ }
+}
+
+function addRegionSummary(state, range) {
+ const key = `${range.firstRegion}\0${range.secondRegion}`
+ let summary = state.regionSummaries.get(key)
+ if (!summary) {
+ summary = {
+ firstRegion: range.firstRegion,
+ secondRegion: range.secondRegion,
+ differingBytes: 0,
+ rangeCount: 0,
+ firstOffset: range.start,
+ lastEndExclusive: range.endExclusive,
+ samples: []
+ }
+ state.regionSummaries.set(key, summary)
+ }
+ summary.differingBytes += range.length
+ summary.rangeCount += 1
+ summary.lastEndExclusive = range.endExclusive
+ if (summary.samples.length < MAX_REGION_SAMPLES) {
+ summary.samples.push({
+ start: range.start,
+ endExclusive: range.endExclusive,
+ firstBytes: range.firstBytes,
+ secondBytes: range.secondBytes,
+ bytesTruncated: range.bytesTruncated
+ })
+ }
+}
+
function rvaToFileOffset(rva, header, sections) {
if (rva < header.optional.sizeOfHeaders) {
return rva
@@ -275,27 +342,29 @@ function finishRange(state, firstRegions, secondRegions) {
return
}
state.rangeCount += 1
+ const range = rangeRecord(state, firstRegions, secondRegions)
+ addRegionSummary(state, range)
if (state.ranges.length < MAX_DIFF_RANGES) {
- const regionAt = (regions) =>
- regions.find((region) => state.start >= region.start && state.start < region.end)?.label ??
- 'unmapped file data'
- state.ranges.push({
- start: state.start,
- endExclusive: state.end,
- startHex: hex(state.start),
- endExclusiveHex: hex(state.end),
- length: state.end - state.start,
- firstRegion: regionAt(firstRegions),
- secondRegion: regionAt(secondRegions)
- })
+ state.ranges.push(range)
}
state.start = undefined
+ state.firstBytes = []
+ state.secondBytes = []
}
async function compareBytes(first, second, signal) {
const firstHash = createHash('sha256')
const secondHash = createHash('sha256')
- const state = { differingBytes: 0, end: 0, rangeCount: 0, ranges: [], start: undefined }
+ const state = {
+ differingBytes: 0,
+ end: 0,
+ firstBytes: [],
+ rangeCount: 0,
+ ranges: [],
+ regionSummaries: new Map(),
+ secondBytes: [],
+ start: undefined
+ }
const length = Math.max(first.metadata.size, second.metadata.size)
for (let offset = 0; offset < length; offset += READ_CHUNK_BYTES) {
signal.throwIfAborted()
@@ -313,7 +382,15 @@ async function compareBytes(first, second, signal) {
index >= firstLength || index >= secondLength || firstBytes[index] !== secondBytes[index]
if (different) {
state.differingBytes += 1
- state.start ??= offset + index
+ if (state.start === undefined) {
+ state.start = offset + index
+ state.firstBytes = []
+ state.secondBytes = []
+ }
+ if (state.firstBytes.length < MAX_RANGE_SAMPLE_BYTES) {
+ state.firstBytes.push(index < firstLength ? firstBytes[index] : undefined)
+ state.secondBytes.push(index < secondLength ? secondBytes[index] : undefined)
+ }
state.end = offset + index + 1
} else {
finishRange(state, first.parsed.regions, second.parsed.regions)
@@ -327,7 +404,8 @@ async function compareBytes(first, second, signal) {
differingBytes: state.differingBytes,
rangeCount: state.rangeCount,
ranges: state.ranges,
- rangesTruncated: state.rangeCount > state.ranges.length
+ rangesTruncated: state.rangeCount > state.ranges.length,
+ regionSummaries: [...state.regionSummaries.values()]
}
}
@@ -390,6 +468,7 @@ export async function diagnoseWindowsPeMismatch({
rangeCount: comparison.rangeCount,
ranges: comparison.ranges,
rangesTruncated: comparison.rangesTruncated,
+ regionSummaries: comparison.regionSummaries,
headerDifferences: headerState.differences,
headerDifferencesTruncated: headerState.truncated
}
diff --git a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
index c11ac8d0b46..5e2944f7f42 100644
--- a/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
+++ b/config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
@@ -74,10 +74,10 @@ async function fixturePair(firstBytes, secondBytes) {
describe('SSH relay Windows PE mismatch diagnostic', () => {
it('reports bounded byte ranges and relevant header differences without file paths', async () => {
- const fixture = await fixturePair(
- peFixture(),
- peFixture({ identifierByte: 0x22, timestamp: 0x87654321 })
- )
+ const first = peFixture()
+ const second = peFixture({ identifierByte: 0x22, timestamp: 0x87654321 })
+ second[0x300] = 0xff
+ const fixture = await fixturePair(first, second)
const result = await diagnoseWindowsPeMismatch(fixture)
@@ -90,8 +90,8 @@ describe('SSH relay Windows PE mismatch diagnostic', () => {
sha256: expect.stringMatching(/^sha256:/)
}),
difference: expect.objectContaining({
- differingBytes: 24,
- rangeCount: 3,
+ differingBytes: 25,
+ rangeCount: 4,
rangesTruncated: false
})
})
@@ -101,8 +101,22 @@ describe('SSH relay Windows PE mismatch diagnostic', () => {
expect(result.difference.ranges.map((range) => range.firstRegion)).toEqual([
'COFF header',
'debug directory',
- 'CodeView data 0'
+ 'CodeView data 0',
+ 'section .rdata'
+ ])
+ expect(result.difference.regionSummaries).toEqual([
+ expect.objectContaining({ firstRegion: 'COFF header', differingBytes: 4, rangeCount: 1 }),
+ expect.objectContaining({ firstRegion: 'debug directory', differingBytes: 4, rangeCount: 1 }),
+ expect.objectContaining({
+ firstRegion: 'CodeView data 0',
+ differingBytes: 16,
+ rangeCount: 1
+ }),
+ expect.objectContaining({ firstRegion: 'section .rdata', differingBytes: 1, rangeCount: 1 })
])
+ expect(result.difference.regionSummaries[3].samples[0]).toEqual(
+ expect.objectContaining({ firstBytes: '00', secondBytes: 'ff', bytesTruncated: false })
+ )
expect(result.difference.headerDifferences.map((entry) => entry.field)).toEqual([
'coff.timeDateStamp',
'debugDirectory.0.codeView.identifier',
@@ -131,6 +145,34 @@ describe('SSH relay Windows PE mismatch diagnostic', () => {
).rejects.toThrow('aborted')
})
+ it('caps per-region samples and per-range byte excerpts', async () => {
+ const first = peFixture()
+ const second = peFixture()
+ for (let index = 0; index < 10; index += 1) {
+ second[0x280 + index * 2] = 0xff
+ }
+ second.fill(0xff, 0x340, 0x368)
+ const result = await diagnoseWindowsPeMismatch(await fixturePair(first, second))
+
+ expect(result.difference.regionSummaries).toEqual([
+ expect.objectContaining({
+ firstRegion: 'section .rdata',
+ differingBytes: 50,
+ rangeCount: 11,
+ samples: expect.any(Array)
+ })
+ ])
+ expect(result.difference.regionSummaries[0].samples).toHaveLength(8)
+ expect(result.difference.ranges.at(-1)).toEqual(
+ expect.objectContaining({
+ length: 40,
+ bytesTruncated: true,
+ firstBytes: '00'.repeat(32),
+ secondBytes: 'ff'.repeat(32)
+ })
+ )
+ })
+
it('parses only the two explicit CLI inputs', () => {
expect(
parseWindowsPeDiagnosticArguments(['--first-pe', 'first.node', '--second-pe', 'second.node'])
From a51093f009a03a1105e9f0b86be14797a8046414 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:39:07 -0400
Subject: [PATCH 035/267] docs(ssh): record full PE scan gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 185 ++++++++++++++++--
1 file changed, 170 insertions(+), 15 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 97ea10ca895..c85ab900f18 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head runs 29351557922 and 29352510414 prove clean-build equality on Linux x64/arm64, macOS x64/arm64, and Windows x64, but both fail closed because Windows arm64 first differs at `conpty_console_list.node`; bounded PE diagnostic implementation `39ee3451b` is locally green and awaiting native evidence before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29353432240 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and proves the bounded PE diagnostic natively on Windows arm64; the rejected arm64 files have identical 956,928-byte layouts but differ in 2,946 bytes across 2,887 ranges beginning in `.text`, plus `/Brepro` timestamp/CodeView identity fields; bounded full-scan section summaries are locally green at exact implementation commit `cd7f94136` and await the six target-native cells before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -114,7 +114,11 @@ same change as the work it records.
Windows arm64 equality remains mandatory; oldest-baseline, native-trust, SSH, and musl cells
remain open. E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001 proves the bounded diagnostic and fail-closed
workflow ordering locally at exact implementation commit `39ee3451b`; both native Windows cells
- remain required before interpreting or correcting the producer.
+ remained required before interpreting or correcting the producer. Exact-head run 29353432240
+ keeps x64 and all POSIX controls green, then reports the real arm64 PE hashes/layout/ranges and
+ fails without upload under E-M3-WINDOWS-PE-DIAGNOSTIC-CI-RED-001. Because the 128 detailed-range
+ cap is exhausted by `.text`, the active diagnostic-only correction adds raw-section labels and a
+ bounded summary across all 2,887 ranges before any producer change.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -154,11 +158,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `39ee3451b` and run both native Windows
- cells. Require x64 to remain exactly reproducible and arm64 to emit bounded hashes, sizes,
- differing byte ranges, and relevant PE headers before failing with no upload. Make no
- copied-artifact producer correction until that evidence is recorded. Keep the strict comparator,
- repository-wide node-pty patch, legacy/default path, and all other release gates unchanged.
+- Next required action: push exact implementation commit `cd7f94136` plus its evidence-ledger head
+ and run all six target-native cells. Keep every current POSIX and Windows x64 control exactly
+ reproducible; require Windows arm64 to fail without upload after classifying all 2,887 ranges by
+ raw section and known PE metadata. Make no copied-artifact producer correction until that evidence
+ is recorded; keep the strict comparator, repository-wide node-pty patch, legacy/default path, and
+ all other release gates unchanged.
## Non-Negotiable Invariants
@@ -535,8 +540,9 @@ SSH users or making all of a user's hosts depend on one experimental path.
- [x] Keep `legacy` as the persisted and effective default for every existing and newly added SSH
target. An absent or unknown configuration value must deserialize conservatively to `legacy`.
(E-M1-ROLLOUT-DECISION-001)
-- [x] Expose the bundled-preferred path as a Beta-tagged option on SSH target add and edit surfaces,
- stored per target rather than as a global experiment. (E-M1-ROLLOUT-DECISION-001)
+- [x] Expose the bundled-preferred path as an off-by-default option on SSH target add and edit
+ surfaces, using the same Beta-tag treatment as existing Beta features and storing the choice
+ per target rather than as a global experiment. (E-M1-ROLLOUT-DECISION-001)
- [x] Represent the persisted choice as an extensible mode such as `legacy | bundled-auto`, not a
boolean. Keep forced `bundled` as a separate engineering/support diagnostic and do not expose
it as the normal Beta choice. Exact schema naming remains an implementation detail.
@@ -646,7 +652,11 @@ headers only, with bounded reads/output and no failed-binary upload. Exact-head
E-M3-REPRODUCIBILITY-WINDOWS-ARM64-REPEAT-CI-RED-001. No comparator weakening, post-build
normalization, producer correction, repository-wide node-pty change, tuple enablement, or production
consumer is authorized without the diagnostic evidence. Exact implementation commit `39ee3451b` is
-locally green under E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001; native Windows execution remains open.
+locally green under E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001. Exact-head run 29353432240 proves the x64
+control and real arm64 parser, but its 128 detailed ranges are exhausted by `.text`; the active
+diagnostic-only correction adds bounded full-scan section totals/samples before any producer change.
+Exact implementation commit `cd7f94136` is locally green under
+E-M3-WINDOWS-PE-FULL-SCAN-LOCAL-001 and awaits native evidence.
Each runtime must contain only the executable closure required by the relay.
@@ -955,6 +965,11 @@ engineering/support control.
opted in.
- [ ] Add the Beta-tagged option to SSH target add and edit surfaces using the existing design-system
Beta treatment; persist it only for that target.
+- [ ] Prove the add-target control is visibly off, the edit-target control reflects only that
+ target's persisted mode, and saving or reconnecting one target cannot change another target.
+- [ ] Prove an off, absent, unknown, malformed, existing, or imported setting routes directly through
+ the current legacy bootstrap without entering bundled manifest, cache, download, transfer, or
+ install work.
- [ ] Prove toggling the option does not mutate or restart a live relay and takes effect only on the
next connection or explicit reconnect.
- [ ] For fail-closed Beta errors, provide an explicit local “disable Beta and reconnect” recovery
@@ -4250,6 +4265,145 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact implementation, require native x64 equality and arm64 diagnostic output
with no upload, then record the exact PE evidence before changing the producer.
+### E-M3-WINDOWS-PE-DIAGNOSTIC-CI-RED-001 — Real arm64 PE drift with x64 control
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact documentation head `27c6a5718c544cd3f559d6adc24cc0beca2ed59e`,
+ containing diagnostic implementation `39ee3451b8cc38b5311a0cb1085ad48a1f302185`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29353432240](https://github.com/stablyai/orca/actions/runs/29353432240),
+ conclusion `failure`; Windows arm64 `87155072734`, macOS x64 `87155072752`, Linux x64
+ `87155072794`, macOS arm64 `87155072820`, Linux arm64 `87155072837`, and Windows x64
+ `87155072849`
+- Runners: the six target-native labels recorded in prior reproducibility evidence. The diagnostic
+ cell was Windows 11 Enterprise 10.0.26200 arm64, image `windows-11-arm64` `20260706.102.1`,
+ runner `2.335.1`, provisioner `20260624.560`, Node v24.18.0, MSVC 19.44.35228 / tools
+ 14.44.35207, Windows SDK 10.0.26100.0, and Python 3.13.14.
+- Remote and transport: none; target-native artifact assembly/execution, rejected-file diagnostics,
+ and unpublished Actions artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29353432240 --repo stablyai/orca \
+ --json headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87155072734/logs
+ gh api 'repos/stablyai/orca/actions/runs/29353432240/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended evidence-producing gate. Both Windows jobs passed 15 suites with 47
+ tests passed and three POSIX-only skips, including native Node 24 execution of the new diagnostic
+ contracts. Linux x64/arm64, macOS x64/arm64, and Windows x64 built twice, inspected, smoked,
+ compared exactly, and uploaded unpublished artifacts `8319201464`, `8319207054`, `8319191783`,
+ `8319227039`, and `8319248077`. Windows x64 therefore proves the diagnostic package does not
+ disturb the successful comparator/upload path. Windows arm64 again built, inspected, and smoked
+ both complete outputs, then failed at `conpty_console_list.node`; the diagnostic ran before the
+ fatal throw and artifact upload was skipped.
+- Rejected arm64 runtime outputs: first content ID
+ `bb05f852159277dea617679f84304d2bc3b01d446ceffd07fb58c9469038bcf6`, ZIP 33,261,545 bytes
+ with SHA-256 `248a4962141e5b1b1c5b24433993923171c5c1d342b8db4de624b92a1019823c`;
+ second content ID `9d937233f63b142f03e504af2ffeeeb05b2de2b979047a369a79dd1d793b1786`,
+ ZIP 33,261,544 bytes with SHA-256
+ `24f752754890704e991f5cc85663a6bb7a6934fc5d64f81ea2414ea12778c249`.
+- PE diagnostic result: both native modules are exactly 956,928 bytes with identical machine
+ `0xaa64`, 12-section layout, PE32+ image/section/file alignment, 840,192-byte code section,
+ data directories, load config, imports, relocations, and linker version 14.44. Their SHA-256 values
+ are `7ef783c59d73cd6101fbed4ef634ef3d075448726c118b36cca4d17145e35afa` and
+ `196dc3373e52350abdf33c30f80a00e0b9b71c96b53b47ba337b1abe428ac8fc`.
+ Exactly 2,946 bytes differ across 2,887 coalesced ranges. The first code difference is at file
+ offset `0x41c`, followed by one-byte ranges at 16-byte intervals in the retained sample. Header
+ differences are confined to COFF/debug timestamps `dd34d0b3` versus `0211cbf1` and CodeView IDs
+ `383b9420683f05ced18d65c8e95b4a72` versus `459643a06a5ac306094361fd1788cbe5`;
+ CodeView age and the SHA-256 of the unprinted 92-byte PDB path are identical. The detailed-range
+ list correctly reports truncation after 128 of 2,887 ranges.
+- Duration and resource metrics: jobs were 8m48s Windows arm64, 4m12s macOS x64, 3m15s Linux x64,
+ 2m57s macOS arm64, 3m24s Linux arm64, and 5m0s Windows x64. Arm64 native builds took 148,290 ms
+ and 120,068 ms; smoke took 5,871 ms and 5,421 ms at 51,417,088 and 52,633,600 bytes RSS. The PE
+ diagnostic completed between log timestamps 17:30:23.088 and 17:30:23.272 UTC. Build peak RSS,
+ open files/channels, and cancellation settlement were not instrumented.
+- Artifact/log/trace link: run/job above and five unpublished seven-day artifacts; no rejected
+ arm64 bytes were uploaded
+- Oracle proved: native Windows parses and bounds the real PE files, x64 remains fully reproducible,
+ arm64 output layout and PDB path are stable, and drift affects thousands of mostly single-byte
+ code ranges plus `/Brepro`-derived identity fields rather than only a timestamp. The comparator
+ and no-upload boundary remain strict.
+- Does not prove: the full per-section distribution because the first diagnostic version labels raw
+ section data as unmapped and caps detailed ranges at 128; the responsible compiler/linker input,
+ a safe producer correction, arm64 equality, cross-run equality, oldest baselines, native trust,
+ SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native PE diagnostic and Windows x64 control only; no tuple or
+ production checkbox.
+- Follow-up: add raw-section attribution plus bounded per-section totals/samples across the complete
+ scan, rerun both Windows cells, and do not change the producer until that evidence is recorded.
+
+### E-M3-WINDOWS-PE-FULL-SCAN-LOCAL-001 — Bounded complete-region PE summary
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `cd7f941365bf6e631cf0f9947f517ecef02afc8e`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. The
+ repository requires Node 24, so the target-native jobs remain authoritative.
+- Remote and transport: none; synthetic PE32+ fixtures and workflow-source contracts only
+- Exact commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs
+ node --check config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. Both syntax checks exited zero; the purpose command passed 6/6 tests across two
+ suites; all 15 artifact suites passed 51/51 tests. Typecheck, focused oxlint, the 355-entry
+ max-lines ratchet, full repository lint/reliability/localization, formatting, staged hooks, and
+ diff checks exited zero. Full lint emitted only pre-existing warnings outside this package.
+- Duration and resource metrics: purpose suite 246 ms Vitest; complete artifact suite 963 ms Vitest
+ / 2.24s wall; typecheck 2.52s; focused oxlint 0.68s; max-lines 1.54s; full lint 11.09s; formatting
+ and diff check 1.06s. The full scan still reads in 64 KiB chunks; detailed ranges remain capped at
+ 128, each byte excerpt at 32 bytes, each region at eight samples, and the entire diagnostic at 60
+ seconds. Synthetic peak RSS/open files were not instrumented.
+- Artifact/log/trace link: exact source commit; no binary artifact was created or uploaded
+- Oracle proved: every coalesced range contributes to bounded per-region differing-byte and range
+ totals even after the detailed-range cap is exhausted; raw PE section data is attributed by the
+ most specific overlapping region, preserving CodeView/debug labels; excerpts and region samples
+ remain bounded. The comparator, fatal failure, and no-upload ordering are unchanged.
+- Does not prove: the real arm64 section distribution, Windows x64 control, arm64 reproducibility,
+ a producer correction, oldest baselines, native trust, SSH, publication, transfer, fallback, UI,
+ or any enabled tuple.
+- Checklist items satisfied: diagnostic observability only; no artifact, tuple, or production box.
+- Follow-up: push the exact implementation and ledger head, run all six target-native cells, require
+ five reproducible uploads plus a rejected Windows arm64 full-scan summary, and record that evidence
+ before changing any copied-artifact producer input.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4307,11 +4461,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `39ee3451b` and require native Windows x64 to remain exactly
-reproducible while arm64 emits bounded hashes, sizes, differing ranges, and relevant PE headers
-before failing with no upload. Use only that evidence to choose or reject the narrowest
-copied-artifact build correction, then rerun local gates and all six target-native jobs without
-weakening the comparator. Cross-family Layer B targets, the protected
+Push exact implementation commit `cd7f94136` plus its evidence-ledger head and run all six
+target-native cells. Keep every current POSIX and Windows x64 control exactly reproducible; require
+Windows arm64 to fail without upload after classifying all 2,887 ranges by raw section and known PE
+metadata. Use only that evidence to choose or reject the narrowest copied-artifact build correction,
+then rerun local gates and all six target-native jobs without weakening the comparator. Cross-family
+Layer B targets, the protected
manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
From 6546f54d53446015f10681fffff9fe895e460232 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:57:00 -0400
Subject: [PATCH 036/267] build(ssh): make copied MSVC inputs deterministic
Co-authored-by: Orca
---
...lay-node-pty-windows-build-determinism.mjs | 43 ++++++++++++++++---
...ode-pty-windows-build-determinism.test.mjs | 15 ++++++-
2 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index 199375674d7..eefbd726877 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -1,6 +1,30 @@
import { readFile, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
+const COMPILER_OPTIONS = ` 'VCCLCompilerTool': {
+ 'AdditionalOptions': [
+ '/guard:cf',
+ '/sdl',
+ '/W3',
+ '/w34244',
+ '/w34267',
+ '/ZH:SHA_256'
+ ]
+ }`
+
+const REPRODUCIBLE_COMPILER_OPTIONS = ` 'VCCLCompilerTool': {
+ 'AdditionalOptions': [
+ '/guard:cf',
+ '/sdl',
+ '/W3',
+ '/w34244',
+ '/w34267',
+ '/ZH:SHA_256',
+ '/Brepro',
+ '/experimental:deterministic'
+ ]
+ }`
+
const LINKER_OPTIONS = ` 'VCLinkerTool': {
'AdditionalOptions': [
'/DYNAMICBASE',
@@ -12,7 +36,8 @@ const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
'AdditionalOptions': [
'/DYNAMICBASE',
'/guard:cf',
- '/Brepro'
+ '/Brepro',
+ '/experimental:deterministic'
]
}`
@@ -22,10 +47,18 @@ export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tu
}
const bindingPath = join(nodePtyDirectory, 'binding.gyp')
const source = await readFile(bindingPath, 'utf8')
- if (source.split(LINKER_OPTIONS).length !== 2 || source.includes("'/Brepro'")) {
- throw new Error('node-pty Windows linker settings do not match the reviewed source')
+ if (
+ source.split(COMPILER_OPTIONS).length !== 2 ||
+ source.split(LINKER_OPTIONS).length !== 2 ||
+ source.includes("'/Brepro'") ||
+ source.includes("'/experimental:deterministic'")
+ ) {
+ throw new Error('node-pty Windows build settings do not match the reviewed source')
}
- // Why: MSVC otherwise embeds per-build timestamps/identities in the copied artifact binaries.
- await writeFile(bindingPath, source.replace(LINKER_OPTIONS, REPRODUCIBLE_LINKER_OPTIONS), 'utf8')
+ // Why: ARM64 compiler output changes even with a reproducible linker unless both stages opt in.
+ const reproducibleSource = source
+ .replace(COMPILER_OPTIONS, REPRODUCIBLE_COMPILER_OPTIONS)
+ .replace(LINKER_OPTIONS, REPRODUCIBLE_LINKER_OPTIONS)
+ await writeFile(bindingPath, reproducibleSource, 'utf8')
return true
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 24985dc889a..85ea7dff2ad 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -19,13 +19,24 @@ async function copiedSource() {
}
describe('SSH relay Windows node-pty build determinism', () => {
- it('adds deterministic MSVC linking only to the copied Windows source', async () => {
+ it('adds deterministic MSVC compilation and linking only to the copied Windows source', async () => {
const directory = await copiedSource()
+ const repositorySource = await readFile(resolve('node_modules/node-pty/binding.gyp'), 'utf8')
await expect(
applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: directory, tuple: 'win32-arm64' })
).resolves.toBe(true)
const source = await readFile(join(directory, 'binding.gyp'), 'utf8')
- expect(source.match(/'\/Brepro'/g)).toHaveLength(1)
+ const compilerStart = source.indexOf("'VCCLCompilerTool'")
+ const linkerStart = source.indexOf("'VCLinkerTool'")
+ const compilerOptions = source.slice(compilerStart, linkerStart)
+ const linkerOptions = source.slice(linkerStart)
+ expect(compilerOptions).toContain("'/Brepro'")
+ expect(compilerOptions).toContain("'/experimental:deterministic'")
+ expect(linkerOptions).toContain("'/Brepro'")
+ expect(linkerOptions).toContain("'/experimental:deterministic'")
+ expect(await readFile(resolve('node_modules/node-pty/binding.gyp'), 'utf8')).toBe(
+ repositorySource
+ )
})
it('leaves POSIX source untouched and rejects an unexpected Windows source shape', async () => {
From a6b423f33f0f0f7b4e7975ed80d901f168563e61 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 13:58:15 -0400
Subject: [PATCH 037/267] docs(ssh): gate MSVC determinism correction
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 190 ++++++++++++++++--
1 file changed, 176 insertions(+), 14 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index c85ab900f18..cfd3fba0633 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29353432240 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and proves the bounded PE diagnostic natively on Windows arm64; the rejected arm64 files have identical 956,928-byte layouts but differ in 2,946 bytes across 2,887 ranges beginning in `.text`, plus `/Brepro` timestamp/CodeView identity fields; bounded full-scan section summaries are locally green at exact implementation commit `cd7f94136` and await the six target-native cells before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29354676731 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 fails closed with no upload after a complete bounded scan; 2,879 of 2,947 differing bytes are one-byte changes every 16 bytes in the first 46,049 bytes of `.text`, and the remaining 68 bytes are `/Brepro`-derived COFF/debug/CodeView data; exact implementation commit `6546f54d5` now applies `/Brepro` and `/experimental:deterministic` to compiler and linker inputs in the copied node-pty source only, is locally green, and awaits the six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -158,12 +158,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `cd7f94136` plus its evidence-ledger head
- and run all six target-native cells. Keep every current POSIX and Windows x64 control exactly
- reproducible; require Windows arm64 to fail without upload after classifying all 2,887 ranges by
- raw section and known PE metadata. Make no copied-artifact producer correction until that evidence
- is recorded; keep the strict comparator, repository-wide node-pty patch, legacy/default path, and
- all other release gates unchanged.
+- Next required action: push exact implementation commit `6546f54d5` plus its evidence-ledger head
+ and run all six target-native cells. Require both Windows architectures to accept the compiler and
+ linker flags, all six outputs to compare exactly before upload, and no regression in native smoke;
+ keep the strict comparator, failed-binary no-upload boundary, repository-wide node-pty patch,
+ legacy/default path, and all other release gates unchanged.
## Non-Negotiable Invariants
@@ -656,7 +655,12 @@ locally green under E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001. Exact-head run 2935343
control and real arm64 parser, but its 128 detailed ranges are exhausted by `.text`; the active
diagnostic-only correction adds bounded full-scan section totals/samples before any producer change.
Exact implementation commit `cd7f94136` is locally green under
-E-M3-WINDOWS-PE-FULL-SCAN-LOCAL-001 and awaits native evidence.
+E-M3-WINDOWS-PE-FULL-SCAN-LOCAL-001. Exact-head run 29354676731 then classifies the complete
+arm64 drift under E-M3-WINDOWS-PE-FULL-SCAN-CI-RED-001: 2,879 one-byte `.text` differences at
+16-byte intervals plus 68 `/Brepro`-derived metadata bytes, with five controls reproducible and
+uploaded and no rejected arm64 upload. Exact implementation commit `6546f54d5` applies the native
+toolchain's reproducible compiler and linker inputs only to the copied node-pty `binding.gyp`, is
+locally green under E-M3-WINDOWS-COMPILER-DETERMINISM-LOCAL-001, and awaits native proof.
Each runtime must contain only the executable closure required by the relay.
@@ -4404,6 +4408,165 @@ or unexpected token`; the first logs did not identify a source location.
five reproducible uploads plus a rejected Windows arm64 full-scan summary, and record that evidence
before changing any copied-artifact producer input.
+### E-M3-WINDOWS-PE-FULL-SCAN-CI-RED-001 — Complete native arm64 region classification
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `a51093f009a03a1105e9f0b86be14797a8046414`, containing exact
+ diagnostic implementation `cd7f941365bf6e631cf0f9947f517ecef02afc8e`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29354676731](https://github.com/stablyai/orca/actions/runs/29354676731),
+ conclusion `failure`; Windows arm64 `87159223395`, Linux arm64 `87159223407`, macOS x64
+ `87159223419`, macOS arm64 `87159223455`, Windows x64 `87159223488`, and Linux x64
+ `87159223544`
+- Runners: the six target-native labels recorded in prior reproducibility evidence. The diagnostic
+ cell was Windows 11 Enterprise 10.0.26200 arm64, image `windows-11-arm64` `20260706.102.1`,
+ runner `2.335.1`, provisioner `20260624.560`, Node v24.18.0, MSVC 19.44.35228 / tools
+ 14.44.35207, Windows SDK 10.0.26100.0, and Python 3.13.14.
+- Remote and transport: none; target-native artifact assembly/execution, rejected-file diagnostics,
+ and unpublished Actions artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29354676731 --repo stablyai/orca \
+ --json headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87159223395/logs
+ gh api 'repos/stablyai/orca/actions/runs/29354676731/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended evidence-producing gate. All Windows contract suites passed before
+ execution; Linux x64/arm64, macOS x64/arm64, and Windows x64 built twice, inspected, smoked,
+ compared exactly, and uploaded. Windows arm64 built, inspected, and smoked both outputs, then the
+ strict comparator rejected `conpty_console_list.node`; the full-scan diagnostic completed before
+ the fatal throw and the upload step was skipped.
+- Uploaded controls: `ssh-relay-runtime-linux-x64-glibc` artifact `8319697674` (29,282,973 bytes),
+ Linux arm64 `8319710845` (28,211,514), macOS x64 `8319759300` (26,374,729), macOS arm64
+ `8319686475` (24,756,958), and Windows x64 `8319797990` (37,075,313). All are unpublished and
+ expire 2026-07-21; the run contains exactly five artifacts and no Windows arm64 artifact.
+- Rejected arm64 outputs: content IDs
+ `75f048e2216c5a88b5dec886d7ce43f8c54768c42184835cfd0d9a22ea3f1e53` and
+ `dddc49d84bdafd5bef136be5050352555e99943b21f49781f1604bd9e37051bc`; ZIP sizes 33,261,549
+ and 33,261,550 bytes with SHA-256
+ `4c21eaba04e514dee246ee23ea6b4559369fc37eaf90dc0634f11146427bb45a` and
+ `aecde9c9982d972d194417cc2d076353fb808f39ba4f018b8d9e64cfdf5c3411`.
+- PE diagnostic result: both modules are 956,928-byte machine `0xaa64` PE32+ files with identical
+ 12-section layout, data directories, imports, relocations, 840,192-byte code section, and linker
+ version 14.44. Their SHA-256 values are
+ `52d4909f106a4e8f85e7fc4c8cc0ccae93eaa74a83342b569d71f67619f15a1e` and
+ `6926210ec6208caa2a79655e2af544b74d8a0d6d1b8c7637d4ece017c89046de`. Exactly 2,947 bytes
+ differ across 2,886 ranges:
+ - `.text`: 2,879 one-byte ranges from file offsets 1,052 through 47,100, exactly 16 bytes apart;
+ all eight retained samples change `85` to `0e`.
+ - COFF header: one four-byte `/Brepro` timestamp range.
+ - Debug directory: three four-byte ranges carrying that timestamp.
+ - CodeView data: one 16-byte identifier range.
+ - `.rdata`: two ranges totaling 36 bytes, containing the derived CodeView/build identities and
+ timestamp.
+
+ The CodeView path remains 92 bytes with identical SHA-256
+ `401080e65f10d7483583537fc7394ddf416fa36febfd76e6d1c17c64bb36f3ea`; no other section
+ differs. The detailed list remains capped while every range contributes to the five bounded region
+ summaries.
+
+- Duration and resource metrics: jobs were 9m50s Windows arm64, 6m56s Windows x64, 5m33s macOS x64,
+ 3m44s Linux arm64, 3m18s Linux x64, and 2m55s macOS arm64. Arm64 builds took 152,517 ms and
+ 130,926 ms; smoke took 5,963 ms and 5,414 ms at 51,884,032 and 51,789,824 bytes RSS. The complete
+ smoke stages took 7,978 ms and 7,203 ms. Build peak RSS, open files/channels, and cancellation
+ settlement were not instrumented.
+- Artifact/log/trace link: run/jobs and five unpublished seven-day artifacts above; rejected arm64
+ bytes remained runner-local
+- Oracle proved: the arm64 failure is copied-source producer nondeterminism concentrated in a
+ regular `.text` pattern, with only derived `/Brepro` identities elsewhere. It is not ZIP order,
+ tree metadata, comparator normalization, a changing PDB path, or a cross-platform regression. The
+ strict no-upload boundary remains effective.
+- Does not prove: which compiler input causes the repeating `.text` byte, a safe producer
+ correction, arm64 equality, cross-run equality, oldest baselines, native trust, SSH, publication,
+ transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: complete native PE region classification and five control cells only;
+ no tuple or production checkbox.
+- Follow-up: evaluate a test-covered reproducible compiler input only in the copied node-pty source,
+ rerun all local gates and all six target-native cells, and require exact arm64 equality without
+ normalizing binaries or weakening the comparator.
+
+### E-M3-WINDOWS-COMPILER-DETERMINISM-LOCAL-001 — Copied-source MSVC reproducibility inputs
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `6546f54d53446015f10681fffff9fe895e460232`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This
+ runner cannot execute MSVC, so target-native Windows jobs remain authoritative.
+- Remote and transport: none; copied `binding.gyp` source-shape contracts only
+- Exact red command:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ ```
+
+- Red result: FAIL as intended, one failed and one passed test. The copied compiler block lacked
+ `/Brepro`; no implementation change had yet been made.
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Green result: PASS. Both syntax checks exited zero; the purpose command passed 6/6 tests across
+ three suites; all 15 artifact suites passed 51/51 tests. Typecheck, focused oxlint, the 355-entry
+ max-lines ratchet, full repository lint/reliability/localization, formatting, staged hooks, and
+ diff checks exited zero. Full lint emitted only pre-existing warnings outside this package.
+- Duration and resource metrics: purpose suite 183 ms Vitest; complete artifact suite 1.27s Vitest
+ / 2.65s wall; typecheck 2.85s; focused oxlint 0.76s; max-lines 1.81s; full lint 10.91s; formatting
+ and diff check 1.10s. Synthetic peak RSS/open files were not instrumented.
+- Artifact/log/trace link: exact source commit; no binary artifact was created or uploaded
+- Oracle proved: Windows builds receive `/Brepro` and `/experimental:deterministic` in both the
+ compiler and linker option blocks after an exact reviewed-source match. POSIX tuples are untouched,
+ unexpected or already-modified source fails closed, and the installed repository
+ `node_modules/node-pty/binding.gyp` remains byte-identical because only the exclusive copied source
+ is rewritten.
+- Does not prove: that MSVC 19.44 accepts the flags on both architectures, Windows arm64 equality,
+ native execution, cross-run equality, oldest baselines, native trust, SSH, publication, transfer,
+ fallback, UI, or any enabled tuple.
+- Checklist items satisfied: copied-source compiler/linker input contract only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
+ require exact equality and successful unpublished upload on both Windows architectures.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4461,12 +4624,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `cd7f94136` plus its evidence-ledger head and run all six
-target-native cells. Keep every current POSIX and Windows x64 control exactly reproducible; require
-Windows arm64 to fail without upload after classifying all 2,887 ranges by raw section and known PE
-metadata. Use only that evidence to choose or reject the narrowest copied-artifact build correction,
-then rerun local gates and all six target-native jobs without weakening the comparator. Cross-family
-Layer B targets, the protected
+Push exact implementation commit `6546f54d5` plus its evidence-ledger head and run all six
+target-native cells. Require both Windows architectures to accept the compiler and linker flags,
+all six outputs to compare exactly before upload, and no regression in native smoke; keep the strict
+comparator, failed-binary no-upload boundary, repository-wide node-pty patch, legacy/default path,
+and all other release gates unchanged. Cross-family Layer B targets, the protected
manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
From 0d3a0c9d3f0eee78d3106a646369cc3fc5db96b1 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:16:12 -0400
Subject: [PATCH 038/267] test(ssh): diagnose generated arm64 build inputs
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 16 +++
config/scripts/ssh-relay-node-pty-build.mjs | 14 +-
...lay-node-pty-windows-build-determinism.mjs | 59 ++++++++
...ode-pty-windows-build-determinism.test.mjs | 60 +++++++-
.../ssh-relay-runtime-workflow.test.mjs | 7 +-
...github-release-implementation-checklist.md | 131 ++++++++++++++----
6 files changed, 254 insertions(+), 33 deletions(-)
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 394651d7686..6fe78588d0c 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -372,6 +372,22 @@ jobs:
--first-pe $firstPe `
--second-pe $secondPe
if ($LASTEXITCODE -ne 0) { Write-Output 'windows_pe_diagnostic=failed' }
+ if ('${{ matrix.tuple }}' -eq 'win32-arm64') {
+ $llvmObjdump = Get-Command llvm-objdump.exe -ErrorAction SilentlyContinue
+ if ($llvmObjdump) {
+ foreach ($candidate in @(
+ @{ Label = 'first'; Path = $firstPe },
+ @{ Label = 'second'; Path = $secondPe }
+ )) {
+ "windows_arm64_disassembly=$($candidate.Label)"
+ # Why: the first 512 code bytes classify the repeated instruction without retaining rejected files.
+ & $llvmObjdump.Source --disassemble --start-address=0x180001000 --stop-address=0x180001200 $candidate.Path
+ if ($LASTEXITCODE -ne 0) { Write-Output 'windows_arm64_disassembly=failed' }
+ }
+ } else {
+ Write-Output 'windows_arm64_disassembly=tool-unavailable'
+ }
+ }
} else {
Write-Output 'windows_pe_diagnostic=skipped_missing_input'
}
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index af277f207a7..6368b2af7d3 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -5,7 +5,10 @@ import { dirname, join, resolve } from 'node:path'
import { promisify } from 'node:util'
import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-settlement.mjs'
-import { applyWindowsNodePtyBuildDeterminism } from './ssh-relay-node-pty-windows-build-determinism.mjs'
+import {
+ applyWindowsNodePtyBuildDeterminism,
+ assertWindowsNodePtyGeneratedBuildSettings
+} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const require = createRequire(import.meta.url)
const execFileAsync = promisify(execFile)
@@ -184,6 +187,15 @@ export async function buildPatchedSshRelayNodePty({
env: buildEnvironment
})
}
+ const generatedSettings = await assertWindowsNodePtyGeneratedBuildSettings({
+ nodePtyDirectory: buildDirectory,
+ tuple
+ })
+ if (generatedSettings) {
+ process.stdout.write(
+ `windows_node_pty_msbuild_settings=${JSON.stringify(generatedSettings)}\n`
+ )
+ }
} finally {
clearTimeout(timeout)
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index eefbd726877..cf7b0be4d7e 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -41,6 +41,48 @@ const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
]
}`
+const REQUIRED_GENERATED_OPTIONS = ['/Brepro', '/experimental:deterministic']
+
+function decodeXmlText(value) {
+ return value
+ .replaceAll('"', '"')
+ .replaceAll(''', "'")
+ .replaceAll('<', '<')
+ .replaceAll('>', '>')
+ .replaceAll('&', '&')
+}
+
+function releaseDefinitionGroup(source, configuration) {
+ const groups = [
+ ...source.matchAll(/]*)>([\s\S]*?)<\/ItemDefinitionGroup>/g)
+ ].filter((match) => decodeXmlText(match[1]).includes(`'Release|${configuration}'`))
+ if (groups.length !== 1) {
+ throw new Error('generated MSBuild settings lack one exact Release configuration')
+ }
+ return groups[0][2]
+}
+
+function requiredToolOptions(group, tool) {
+ const tools = [...group.matchAll(new RegExp(`<${tool}\\b[^>]*>([\\s\\S]*?)${tool}>`, 'g'))]
+ const options = tools.flatMap((match) => [
+ ...match[1].matchAll(/]*>([\s\S]*?)<\/AdditionalOptions>/g)
+ ])
+ if (tools.length !== 1 || options.length !== 1) {
+ throw new Error(`generated MSBuild settings lack one exact ${tool} option block`)
+ }
+ const tokens = decodeXmlText(options[0][1]).trim().split(/\s+/)
+ if (!tokens.includes('%(AdditionalOptions)')) {
+ throw new Error(`generated MSBuild settings do not inherit ${tool} options`)
+ }
+ for (const required of REQUIRED_GENERATED_OPTIONS) {
+ const count = tokens.filter((token) => token.toLowerCase() === required.toLowerCase()).length
+ if (count !== 1) {
+ throw new Error(`generated MSBuild settings require exactly one ${tool} ${required}`)
+ }
+ }
+ return [...REQUIRED_GENERATED_OPTIONS]
+}
+
export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tuple }) {
if (!tuple.startsWith('win32-')) {
return false
@@ -62,3 +104,20 @@ export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tu
await writeFile(bindingPath, reproducibleSource, 'utf8')
return true
}
+
+export async function assertWindowsNodePtyGeneratedBuildSettings({ nodePtyDirectory, tuple }) {
+ if (!tuple.startsWith('win32-')) {
+ return undefined
+ }
+ const project = 'conpty_console_list.vcxproj'
+ const configuration = `Release|${tuple.endsWith('-arm64') ? 'ARM64' : 'x64'}`
+ const source = await readFile(join(nodePtyDirectory, 'build', project), 'utf8')
+ const group = releaseDefinitionGroup(source, configuration.split('|')[1])
+ // Why: the source rewrite is insufficient proof unless gyp propagates both stages into MSBuild.
+ return {
+ configuration,
+ compilerOptions: requiredToolOptions(group, 'ClCompile'),
+ linkerOptions: requiredToolOptions(group, 'Link'),
+ project
+ }
+}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 85ea7dff2ad..7b14811ce61 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -1,10 +1,13 @@
-import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join, resolve } from 'node:path'
import { afterEach, describe, expect, it } from 'vitest'
-import { applyWindowsNodePtyBuildDeterminism } from './ssh-relay-node-pty-windows-build-determinism.mjs'
+import {
+ applyWindowsNodePtyBuildDeterminism,
+ assertWindowsNodePtyGeneratedBuildSettings
+} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const temporaryDirectories = []
afterEach(async () => {
@@ -18,6 +21,21 @@ async function copiedSource() {
return directory
}
+async function generatedProject({
+ compilerOptions = '/Brepro /experimental:deterministic %(AdditionalOptions)',
+ linkerOptions = '/Brepro /experimental:deterministic %(AdditionalOptions)',
+ platform = 'ARM64'
+} = {}) {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-windows-msbuild-'))
+ temporaryDirectories.push(directory)
+ await mkdir(join(directory, 'build'))
+ await writeFile(
+ join(directory, 'build', 'conpty_console_list.vcxproj'),
+ `${compilerOptions}${linkerOptions}`
+ )
+ return directory
+}
+
describe('SSH relay Windows node-pty build determinism', () => {
it('adds deterministic MSVC compilation and linking only to the copied Windows source', async () => {
const directory = await copiedSource()
@@ -52,4 +70,42 @@ describe('SSH relay Windows node-pty build determinism', () => {
applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory: directory, tuple: 'win32-x64' })
).rejects.toThrow('do not match the reviewed source')
})
+
+ it('proves the generated Release project propagates compile and link settings', async () => {
+ const directory = await generatedProject()
+ await expect(
+ assertWindowsNodePtyGeneratedBuildSettings({
+ nodePtyDirectory: directory,
+ tuple: 'win32-arm64'
+ })
+ ).resolves.toEqual({
+ configuration: 'Release|ARM64',
+ compilerOptions: ['/Brepro', '/experimental:deterministic'],
+ linkerOptions: ['/Brepro', '/experimental:deterministic'],
+ project: 'conpty_console_list.vcxproj'
+ })
+ })
+
+ it('rejects missing, duplicate, non-inherited, or wrong-architecture generated settings', async () => {
+ for (const fixture of [
+ { compilerOptions: '/Brepro %(AdditionalOptions)' },
+ { linkerOptions: '/Brepro /Brepro /experimental:deterministic %(AdditionalOptions)' },
+ { linkerOptions: '/Brepro /experimental:deterministic' },
+ { platform: 'x64' }
+ ]) {
+ const directory = await generatedProject(fixture)
+ await expect(
+ assertWindowsNodePtyGeneratedBuildSettings({
+ nodePtyDirectory: directory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow(/generated MSBuild settings/i)
+ }
+ await expect(
+ assertWindowsNodePtyGeneratedBuildSettings({
+ nodePtyDirectory: '/not-used-on-posix',
+ tuple: 'darwin-arm64'
+ })
+ ).resolves.toBeUndefined()
+ })
})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index cb6407a90ca..553a01217e1 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -63,6 +63,8 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.mjs')
expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.test.mjs')
+ expect(source).toContain('llvm-objdump.exe')
+ expect(source).toContain('--start-address=0x180001000 --stop-address=0x180001200')
expect(source).toContain(
'node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs'
)
@@ -108,9 +110,12 @@ describe('SSH relay runtime artifact workflow', () => {
expect(windowsRun.indexOf('ssh-relay-runtime-windows-pe-diagnostic.mjs')).toBeGreaterThan(
windowsRun.indexOf('ssh-relay-runtime-reproducibility.mjs')
)
+ expect(windowsRun.indexOf('llvm-objdump.exe')).toBeGreaterThan(
+ windowsRun.indexOf('ssh-relay-runtime-windows-pe-diagnostic.mjs')
+ )
expect(
windowsRun.indexOf("throw 'runtime reproducibility verification failed'")
- ).toBeGreaterThan(windowsRun.indexOf('ssh-relay-runtime-windows-pe-diagnostic.mjs'))
+ ).toBeGreaterThan(windowsRun.indexOf('llvm-objdump.exe'))
expect(windowsRun.indexOf('runtime-evidence/${{ matrix.tuple }}')).toBeGreaterThan(
windowsRun.indexOf("throw 'runtime reproducibility verification failed'")
)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index cfd3fba0633..35f136c55d7 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29354676731 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 fails closed with no upload after a complete bounded scan; 2,879 of 2,947 differing bytes are one-byte changes every 16 bytes in the first 46,049 bytes of `.text`, and the remaining 68 bytes are `/Brepro`-derived COFF/debug/CodeView data; exact implementation commit `6546f54d5` now applies `/Brepro` and `/experimental:deterministic` to compiler and linker inputs in the copied node-pty source only, is locally green, and awaits the six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29355973362 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 again fails closed with no upload after both complete runtimes execute successfully; adding `/Brepro` and `/experimental:deterministic` to the copied compiler and linker settings did not change the 2,947-byte drift at all, so the next bounded package must prove the generated MSBuild inputs and classify the repeated ARM64 instructions before another producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -158,11 +158,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `6546f54d5` plus its evidence-ledger head
- and run all six target-native cells. Require both Windows architectures to accept the compiler and
- linker flags, all six outputs to compare exactly before upload, and no regression in native smoke;
- keep the strict comparator, failed-binary no-upload boundary, repository-wide node-pty patch,
- legacy/default path, and all other release gates unchanged.
+- Next required action: add a bounded diagnostic that fail-closed inspects the generated
+ `conpty_console_list.vcxproj` for the expected compiler/linker settings and reports paired ARM64
+ instruction/disassembly context around the first differing ranges. Require both native Windows
+ cells while retaining all four POSIX controls, strict comparison, rejected-binary no-upload,
+ repository-wide node-pty patch, legacy/default path, and all other release gates unchanged.
## Non-Negotiable Invariants
@@ -659,8 +659,12 @@ E-M3-WINDOWS-PE-FULL-SCAN-LOCAL-001. Exact-head run 29354676731 then classifies
arm64 drift under E-M3-WINDOWS-PE-FULL-SCAN-CI-RED-001: 2,879 one-byte `.text` differences at
16-byte intervals plus 68 `/Brepro`-derived metadata bytes, with five controls reproducible and
uploaded and no rejected arm64 upload. Exact implementation commit `6546f54d5` applies the native
-toolchain's reproducible compiler and linker inputs only to the copied node-pty `binding.gyp`, is
-locally green under E-M3-WINDOWS-COMPILER-DETERMINISM-LOCAL-001, and awaits native proof.
+toolchain's reproducible compiler and linker settings only to the copied node-pty `binding.gyp` and
+is locally green under E-M3-WINDOWS-COMPILER-DETERMINISM-LOCAL-001. Exact-head run 29355973362 then
+kept five controls reproducible but reproduced the identical Windows arm64 PE drift under
+E-M3-WINDOWS-COMPILER-DETERMINISM-CI-RED-001. The next diagnostic must prove how those settings
+reach the generated `conpty_console_list.vcxproj` and report bounded ARM64 instruction/disassembly
+context; no second producer correction is justified before that evidence.
Each runtime must contain only the executable closure required by the relay.
@@ -4567,23 +4571,93 @@ or unexpected token`; the first logs did not identify a source location.
- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
require exact equality and successful unpublished upload on both Windows architectures.
+### E-M3-WINDOWS-COMPILER-DETERMINISM-CI-RED-001 — Compiler-setting correction does not remove arm64 drift
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `a6b423f33f0f0f7b4e7975ed80d901f168563e61`, containing exact
+ implementation commit `6546f54d53446015f10681fffff9fe895e460232`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29355973362](https://github.com/stablyai/orca/actions/runs/29355973362),
+ conclusion `failure`; Linux arm64 `87163591039`, Windows x64 `87163591059`, macOS x64
+ `87163591076`, Windows arm64 `87163591141`, macOS arm64 `87163591145`, and Linux x64
+ `87163591207`
+- Runners: the six target-native labels recorded in prior reproducibility evidence. The failing cell
+ was GitHub-hosted `windows-11-arm`, resolved image `win11-arm64` `20260706.102.1`, native
+ `ARM64`, Node v24.18.0, MSVC 19.44.35228 / tools 14.44.35207, Windows SDK 10.0.26100.0, and
+ Python 3.13.14.
+- Remote and transport: none; target-native artifact assembly/execution, rejected-file diagnostics,
+ and unpublished Actions artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29355973362 --repo stablyai/orca \
+ --json headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh run view 29355973362 --repo stablyai/orca --job 87163591141 --log-failed
+ gh api repos/stablyai/orca/actions/runs/29355973362/artifacts --paginate
+ ```
+
+- Result: FAIL as the intended strict evidence gate. All 15 Windows contract suites passed with
+ 48 passing and three intentionally skipped tests. Linux x64/arm64, macOS x64/arm64, and Windows
+ x64 built twice, inspected, executed, compared exactly, and uploaded. Windows arm64 built and
+ executed both complete outputs, then the comparator rejected
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node`; the diagnostic ran, the
+ job failed, and no Windows arm64 artifact was uploaded.
+- Uploaded controls: Linux x64 artifact `8320207112` (29,282,626 bytes), Linux arm64
+ `8320217472` (28,211,075), macOS x64 `8320277866` (26,390,709), macOS arm64 `8320191810`
+ (24,741,051), and Windows x64 `8320261436` (37,075,310). All are unpublished seven-day
+ artifacts; the run contains exactly five artifacts.
+- Rejected arm64 outputs: content IDs
+ `5523ec111f63a53edb3da090cf90bedb0421c2c9862dc0356e106fdf5a6519f2` and
+ `faadd0f5285a449fd0aad0960918edc72d565dc150171e8e292c160931340235`; ZIP sizes
+ 33,261,550 and 33,261,546 bytes with SHA-256
+ `769fc2b8a4761b8d19b9d4b02adc2add6b4232ed73a1ee154e6e073760f52eda` and
+ `217e9f8b500837130e0978a7aa03dba2790a926b42410752c7d804e6d5a38143`.
+- PE diagnostic result: both rejected modules remain 956,928-byte machine `0xaa64` PE32+ files
+ with the identical 12-section layout. Their SHA-256 values are
+ `548ff529facca76eb3a30c79f96e2170336b7cf01a3e55aabc2a5cd615cd1111` and
+ `e0039271e09a898d3edf9eb4506f3d895cd3282a893a1e15acb4abec2f9cb69c`. Exactly the
+ same 2,947 bytes differ across 2,886 ranges: 2,879 one-byte `.text` ranges every 16 bytes from
+ offsets 1,052 through 47,100, plus 68 bytes of derived COFF/debug/CodeView identity. The retained
+ `.text` samples all change `45` to `2d`; the 92-byte PDB path hash remains identical.
+- Duration and resource metrics: jobs were 8m25s Windows arm64, 5m50s macOS x64, 5m15s Windows
+ x64, 3m37s Linux arm64, 3m16s Linux x64, and 2m41s macOS arm64. Arm64 builds took 141,484 ms
+ and 116,582 ms; smoke took 5,784 ms and 5,439 ms at 53,014,528 and 53,047,296 bytes RSS. The
+ complete smoke stages took 7,448 ms and 7,383 ms. Build peak RSS, open files/channels, and
+ cancellation settlement were not instrumented.
+- Artifact/log/trace link: run/jobs and the five unpublished artifacts above; rejected arm64 bytes
+ remained runner-local
+- Oracle proved: adding the reviewed compiler/linker settings did not alter the arm64 failure
+ signature, while all five controls and both arm64 runtime executions remain healthy. The strict
+ comparator and no-upload boundary still work. This falsifies the hypothesis that the copied
+ settings alone are sufficient.
+- Does not prove: whether the generated MSBuild project actually propagates both settings to every
+ `conpty_console_list` compile/link invocation, what the repeated ARM64 instruction represents, a
+ safe producer correction, arm64 or cross-run equality, oldest baselines, native trust, SSH,
+ publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native negative evidence and five reproducible control cells only; no
+ tuple or production checkbox.
+- Follow-up: inspect the generated `conpty_console_list.vcxproj` fail-closed for the expected
+ compiler/linker inputs and emit bounded paired ARM64 instruction/disassembly context around the
+ first differing ranges. Do not change the producer, normalize binaries, weaken comparison, or
+ upload rejected bytes before that evidence.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five native cells pass; Windows arm64 `conpty_console_list.node` drifts | Toolchain drift may change native content IDs | Codex implementation owner | All six same-head, same-runner clean builds match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Five native cells pass; copied MSVC settings do not remove Windows arm64 `conpty_console_list.node` drift | Toolchain drift may change native content IDs | Codex implementation owner | Generated-build-input and ARM64 instruction diagnostics identify a safe producer correction; all six clean builds then match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -4624,12 +4698,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `6546f54d5` plus its evidence-ledger head and run all six
-target-native cells. Require both Windows architectures to accept the compiler and linker flags,
-all six outputs to compare exactly before upload, and no regression in native smoke; keep the strict
-comparator, failed-binary no-upload boundary, repository-wide node-pty patch, legacy/default path,
-and all other release gates unchanged. Cross-family Layer B targets, the protected
-manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy performance
-baseline remain release/default-path blockers; no publication, desktop resolver, SSH transfer/
-install, per-target Beta, fallback, tuple enablement, or default behavior may be connected by this
-package.
+Add a bounded diagnostic that fail-closed inspects generated `conpty_console_list.vcxproj`
+compiler/linker settings and reports paired ARM64 instruction/disassembly context around the first
+differing ranges. Run both native Windows cells with all four POSIX controls, require the x64 and
+POSIX outputs to remain exact, and retain the fatal comparator plus rejected-arm64 no-upload
+boundary. Cross-family Layer B targets, the protected manifest-signing environment,
+oldest-baseline/native-trust cells, and the paired legacy performance baseline remain release/
+default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta,
+fallback, tuple enablement, or default behavior may be connected by this package.
From 65d44d72f7a5da382ffddc194f302b4386b2391c Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:18:47 -0400
Subject: [PATCH 039/267] docs(ssh): gate arm64 build-input diagnostic
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 124 +++++++++++++++---
1 file changed, 107 insertions(+), 17 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 35f136c55d7..c27b482dd08 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29355973362 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 again fails closed with no upload after both complete runtimes execute successfully; adding `/Brepro` and `/experimental:deterministic` to the copied compiler and linker settings did not change the 2,947-byte drift at all, so the next bounded package must prove the generated MSBuild inputs and classify the repeated ARM64 instructions before another producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29355973362 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 again fails closed with no upload after both complete runtimes execute successfully; adding `/Brepro` and `/experimental:deterministic` to the copied compiler and linker settings did not change the 2,947-byte drift at all; exact implementation commit `0d3a0c9d3` now fail-closed verifies the generated Release MSBuild inputs and adds bounded paired ARM64 disassembly after a mismatch, is locally green, and awaits the six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -158,11 +158,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: add a bounded diagnostic that fail-closed inspects the generated
- `conpty_console_list.vcxproj` for the expected compiler/linker settings and reports paired ARM64
- instruction/disassembly context around the first differing ranges. Require both native Windows
- cells while retaining all four POSIX controls, strict comparison, rejected-binary no-upload,
- repository-wide node-pty patch, legacy/default path, and all other release gates unchanged.
+- Next required action: push exact diagnostic implementation commit `0d3a0c9d3` plus its
+ evidence-ledger head and run all six target-native cells. Require both Windows jobs to prove the
+ generated Release compiler/linker settings; if arm64 still differs, record both bounded
+ disassemblies while retaining all four POSIX controls, strict comparison, rejected-binary
+ no-upload, repository-wide node-pty patch, legacy/default path, and all other release gates.
## Non-Negotiable Invariants
@@ -662,9 +662,10 @@ uploaded and no rejected arm64 upload. Exact implementation commit `6546f54d5` a
toolchain's reproducible compiler and linker settings only to the copied node-pty `binding.gyp` and
is locally green under E-M3-WINDOWS-COMPILER-DETERMINISM-LOCAL-001. Exact-head run 29355973362 then
kept five controls reproducible but reproduced the identical Windows arm64 PE drift under
-E-M3-WINDOWS-COMPILER-DETERMINISM-CI-RED-001. The next diagnostic must prove how those settings
-reach the generated `conpty_console_list.vcxproj` and report bounded ARM64 instruction/disassembly
-context; no second producer correction is justified before that evidence.
+E-M3-WINDOWS-COMPILER-DETERMINISM-CI-RED-001. Exact implementation commit `0d3a0c9d3` now
+fail-closed verifies how those settings reach the generated `conpty_console_list.vcxproj` and adds
+bounded paired ARM64 disassembly after a mismatch under E-M3-WINDOWS-MSBUILD-DISASSEMBLY-LOCAL-001;
+no second producer correction is justified before the target-native evidence.
Each runtime must contain only the executable closure required by the relay.
@@ -4641,6 +4642,95 @@ or unexpected token`; the first logs did not identify a source location.
first differing ranges. Do not change the producer, normalize binaries, weaken comparison, or
upload rejected bytes before that evidence.
+### E-M3-WINDOWS-MSBUILD-DISASSEMBLY-LOCAL-001 — Generated-project and bounded disassembly contracts
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `0d3a0c9d3f0eee78d3106a646369cc3fc5db96b1`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This
+ runner cannot generate or execute native MSBuild/ARM64 PE inputs, so the target-native Windows
+ jobs remain authoritative.
+- Remote and transport: none; synthetic generated-project fixtures and workflow-source contracts
+ only
+- Exact red command:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ ```
+
+- Red result: FAIL as intended, two failed and two passed tests because no generated-project
+ verifier existed.
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ node --check config/scripts/ssh-relay-node-pty-build.mjs
+ node --check config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ pnpm exec lint-staged
+ git diff --check
+ ```
+
+- Green result: PASS. All syntax checks exited zero; the purpose command passed 8/8 tests across
+ three suites; all 15 artifact suites passed 53/53 tests. Typecheck, focused oxlint, the
+ 355-entry max-lines ratchet, full repository lint/reliability/localization, formatting, staged
+ hooks, and diff checks exited zero. Full lint emitted only pre-existing warnings outside this
+ package.
+- Duration and resource metrics: purpose suite 156 ms Vitest; complete artifact suite 1.11s
+ Vitest. Static-gate wall time, synthetic peak RSS, open files/channels, and cancellation
+ settlement were not instrumented.
+- Artifact/log/trace link: exact source commit and local command output; no binary artifact was
+ created or uploaded
+- Oracle proved: Windows artifact builds now reject a missing, duplicate, non-inherited, or
+ wrong-architecture Release `ClCompile`/`Link` option in the generated
+ `conpty_console_list.vcxproj` before runtime staging, and log the exact accepted setting summary.
+ On an arm64 mismatch the workflow retains the existing structured PE diagnostic, then requests
+ only absolute image addresses `0x180001000` through `0x180001200` from native
+ `llvm-objdump.exe` before the fatal throw. Rejected bytes still cannot reach artifact staging.
+- Does not prove: the real generated XML shape, native `llvm-objdump` availability/output, which
+ repeated ARM64 instruction differs, a safe producer correction, arm64 equality, oldest
+ baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local generated-project and bounded-disassembly contracts only; no
+ tuple or production checkbox.
+- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
+ require both Windows jobs to prove generated settings. If arm64 still differs, record the two
+ bounded disassemblies and retain strict failure/no-upload before any producer correction.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4698,11 +4788,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Add a bounded diagnostic that fail-closed inspects generated `conpty_console_list.vcxproj`
-compiler/linker settings and reports paired ARM64 instruction/disassembly context around the first
-differing ranges. Run both native Windows cells with all four POSIX controls, require the x64 and
-POSIX outputs to remain exact, and retain the fatal comparator plus rejected-arm64 no-upload
-boundary. Cross-family Layer B targets, the protected manifest-signing environment,
-oldest-baseline/native-trust cells, and the paired legacy performance baseline remain release/
-default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target Beta,
-fallback, tuple enablement, or default behavior may be connected by this package.
+Push exact diagnostic implementation commit `0d3a0c9d3` plus its evidence-ledger head and run all
+six target-native cells. Require both Windows jobs to prove the generated Release compiler/linker
+settings; if arm64 still differs, record both bounded disassemblies while retaining all four POSIX
+controls, strict comparison, and rejected-arm64 no-upload. Cross-family Layer B targets, the
+protected manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy
+performance baseline remain release/default-path blockers; no publication, desktop resolver, SSH
+transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may be connected
+by this package.
From 4207c207ab932ef67522b4f73b98d63fa32d0924 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:30:15 -0400
Subject: [PATCH 040/267] fix(ssh): accept native arm64 MSBuild casing
Co-authored-by: Orca
---
...lay-node-pty-windows-build-determinism.mjs | 6 +-
...ode-pty-windows-build-determinism.test.mjs | 2 +-
...github-release-implementation-checklist.md | 127 ++++++++++++++----
3 files changed, 110 insertions(+), 25 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index cf7b0be4d7e..a92bc3b08a1 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -53,9 +53,13 @@ function decodeXmlText(value) {
}
function releaseDefinitionGroup(source, configuration) {
+ const expectedCondition = `'Release|${configuration}'`.toLowerCase()
const groups = [
...source.matchAll(/]*)>([\s\S]*?)<\/ItemDefinitionGroup>/g)
- ].filter((match) => decodeXmlText(match[1]).includes(`'Release|${configuration}'`))
+ ].filter((match) => {
+ // Why: native arm64 MSBuild uses lowercase `arm64`; platform identities are case-insensitive.
+ return decodeXmlText(match[1]).toLowerCase().includes(expectedCondition)
+ })
if (groups.length !== 1) {
throw new Error('generated MSBuild settings lack one exact Release configuration')
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 7b14811ce61..29444fde8e2 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -72,7 +72,7 @@ describe('SSH relay Windows node-pty build determinism', () => {
})
it('proves the generated Release project propagates compile and link settings', async () => {
- const directory = await generatedProject()
+ const directory = await generatedProject({ platform: 'arm64' })
await expect(
assertWindowsNodePtyGeneratedBuildSettings({
nodePtyDirectory: directory,
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index c27b482dd08..aa48e88f3bf 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29355973362 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, while Windows arm64 again fails closed with no upload after both complete runtimes execute successfully; adding `/Brepro` and `/experimental:deterministic` to the copied compiler and linker settings did not change the 2,947-byte drift at all; exact implementation commit `0d3a0c9d3` now fail-closed verifies the generated Release MSBuild inputs and adds bounded paired ARM64 disassembly after a mismatch, is locally green, and awaits the six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29357355064 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and uploads exactly those five unpublished artifacts; Windows x64 proves the generated compiler/linker flags in both clean builds, while native Windows arm64 fails closed before staging because the generated Release-condition verifier does not accept the runner's lowercase `arm64` platform spelling; no arm64 artifact is uploaded and no disassembly or producer correction is yet justified; the active bounded package makes only that architecture comparison case-insensitive while retaining exact Release/configuration cardinality and option checks; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -118,7 +118,12 @@ same change as the work it records.
keeps x64 and all POSIX controls green, then reports the real arm64 PE hashes/layout/ranges and
fails without upload under E-M3-WINDOWS-PE-DIAGNOSTIC-CI-RED-001. Because the 128 detailed-range
cap is exhausted by `.text`, the active diagnostic-only correction adds raw-section labels and a
- bounded summary across all 2,887 ranges before any producer change.
+ bounded summary across all 2,887 ranges before any producer change. Exact-head run 29357355064
+ keeps all five controls reproducible and proves both generated x64 option blocks, but the native
+ arm64 build fails closed at the new Release-condition verifier before runtime staging under
+ E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-CI-RED-001. The runner exposes `Platform=arm64`; the active
+ correction accepts only a case-insensitive exact match for the expected architecture and retains
+ every option/cardinality check. No producer, comparator, upload, or production behavior changes.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -158,11 +163,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact diagnostic implementation commit `0d3a0c9d3` plus its
- evidence-ledger head and run all six target-native cells. Require both Windows jobs to prove the
- generated Release compiler/linker settings; if arm64 still differs, record both bounded
- disassemblies while retaining all four POSIX controls, strict comparison, rejected-binary
- no-upload, repository-wide node-pty patch, legacy/default path, and all other release gates.
+- Next required action: test and implement the bounded case-insensitive architecture comparison for
+ generated MSBuild Release conditions, retain exact group and option cardinality, then rerun all
+ six target-native cells. Require both Windows jobs to prove their generated compiler/linker
+ settings; only if arm64 reaches the known comparator mismatch may paired bounded disassembly
+ justify a producer correction. Preserve all five controls, rejected-binary no-upload, the
+ repository-wide node-pty patch, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -665,7 +671,16 @@ kept five controls reproducible but reproduced the identical Windows arm64 PE dr
E-M3-WINDOWS-COMPILER-DETERMINISM-CI-RED-001. Exact implementation commit `0d3a0c9d3` now
fail-closed verifies how those settings reach the generated `conpty_console_list.vcxproj` and adds
bounded paired ARM64 disassembly after a mismatch under E-M3-WINDOWS-MSBUILD-DISASSEMBLY-LOCAL-001;
-no second producer correction is justified before the target-native evidence.
+no second producer correction is justified before the target-native evidence. Exact-head run
+29357355064 proves both generated option blocks twice on Windows x64 but fails closed on native
+Windows arm64 before staging because the Release group lookup does not accept the runner's lowercase
+`arm64` platform spelling (E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-CI-RED-001).
+
+**In progress — 2026-07-14, Codex implementation owner:** make only the expected generated Release
+architecture comparison case-insensitive, while retaining one exact Release group, the expected
+tuple architecture, one inherited compiler/linker option block, and exactly one instance of each
+required flag. Add the lowercase-arm64 purpose fixture before rerunning all six native cells. Do not
+change a producer, normalize output, weaken reproducibility, or connect a production consumer.
Each runtime must contain only the executable closure required by the relay.
@@ -4731,23 +4746,88 @@ or unexpected token`; the first logs did not identify a source location.
require both Windows jobs to prove generated settings. If arm64 still differs, record the two
bounded disassemblies and retain strict failure/no-upload before any producer correction.
+### E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-CI-RED-001 — Native arm64 Release-group lookup fails closed
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `65d44d72f7a5da382ffddc194f302b4386b2391c`, containing exact
+ diagnostic implementation commit `0d3a0c9d3f0eee78d3106a646369cc3fc5db96b1`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29357355064](https://github.com/stablyai/orca/actions/runs/29357355064),
+ conclusion `failure`; Linux x64 `87168238852`, Windows x64 `87168238867`, macOS x64
+ `87168238889`, Windows arm64 `87168238935`, macOS arm64 `87168238945`, and Linux arm64
+ `87168238954`
+- Runners: the six target-native labels recorded in prior reproducibility evidence. The failing cell
+ was GitHub-hosted `windows-11-arm`, image `win11-arm64` release `20260706.102`, native `ARM64`,
+ runner 2.335.1, Node v24.18.0, MSVC tools 14.44.35207, Windows SDK 10.0.26100.0, and an arm64
+ developer environment exposing `Platform=arm64`.
+- Remote and transport: none; target-native artifact assembly, generated-project verification, and
+ unpublished Actions artifact upload only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29357355064 --repo stablyai/orca \
+ --json headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh run view 29357355064 --repo stablyai/orca --job 87168238867 --log
+ gh run view 29357355064 --repo stablyai/orca --job 87168238935 --log-failed
+ gh api repos/stablyai/orca/actions/runs/29357355064/artifacts --paginate
+ ```
+
+- Result: FAIL as the intended strict evidence gate. Linux x64/arm64, macOS x64/arm64, and Windows
+ x64 built twice, inspected, executed, compared exactly, and uploaded. Windows x64 logged the
+ required `/Brepro` and `/experimental:deterministic` compiler and linker settings for both clean
+ builds. Native Windows arm64 completed compilation of the first copied node-pty tree, then the
+ generated-project verifier rejected it with `generated MSBuild settings lack one exact Release
+configuration` before runtime staging, verification, smoke, comparison, or diagnostics. Its
+ artifact upload was skipped.
+- Uploaded controls: Linux x64 artifact `8320756625` (29,278,781 bytes,
+ `sha256:50bab609edc8e4eb776f462622c5e1310e926049e5ec0e759692ea4ae74142a4`), Linux arm64
+ `8320758083` (28,215,186,
+ `sha256:0b2770363a95717b0193c58ee066242ab08a9fa80eb0060049e912f6314776a8`), macOS x64
+ `8320845963` (26,407,443,
+ `sha256:70b4217dc54ff2015638e7407714208f7e399acadf0cbcd0d8d5340025235d34`), macOS arm64
+ `8320753136` (24,774,283,
+ `sha256:8f5c1a65e88d79b036cabf24d80656e6b987335c5d0a908d4fff241026d74467`), and Windows x64
+ `8320806874` (37,075,312,
+ `sha256:a325d8e09c0391ee971328da397ac23412024ce2e4bf0dc633f897f8b923add2`). The run contains
+ exactly five unpublished seven-day artifacts and no Windows arm64 artifact.
+- Duration and resource metrics: jobs were 6m43s macOS x64, 6m24s Windows arm64, 5m15s Windows
+ x64, 3m24s Linux x64, 3m23s Linux arm64, and 3m16s macOS arm64. The arm64 verifier failure
+ occurred 2m24s into the build/inspect step before runtime smoke, so no new arm64 smoke RSS,
+ channel/file count, cancellation, or fallback metric exists for this run.
+- Artifact/log/trace link: run/jobs and the five unpublished artifacts above; no rejected arm64
+ runtime or binary was staged or uploaded
+- Oracle proved: the generated-setting verifier executes after native compilation and fails closed
+ before staging when its Release-group architecture spelling does not match. Windows x64 proves
+ both required settings in both generated projects. The native arm64 developer environment uses a
+ lowercase platform spelling, while all five architecture controls and the no-upload boundary
+ remain intact.
+- Does not prove: the exact native arm64 generated XML condition, that a case-insensitive exact
+ architecture match reaches its option blocks, a complete arm64 runtime, paired disassembly, a
+ safe producer correction, arm64 equality, oldest baselines, native trust, SSH, publication,
+ transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native negative verifier evidence and five reproducible control cells
+ only; no tuple or production checkbox.
+- Follow-up: cover lowercase `arm64` with a purpose fixture and compare only the expected Release
+ architecture case-insensitively, retaining exact group and option cardinality. Rerun both Windows
+ cells and all four POSIX controls before interpreting the underlying PE drift.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five native cells pass; copied MSVC settings do not remove Windows arm64 `conpty_console_list.node` drift | Toolchain drift may change native content IDs | Codex implementation owner | Generated-build-input and ARM64 instruction diagnostics identify a safe producer correction; all six clean builds then match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Five native cells pass; arm64 generated-setting verification currently stops before the known PE drift | Toolchain drift may change native content IDs | Codex implementation owner | Generated-build-input and ARM64 instruction diagnostics identify a safe producer correction; all six clean builds then match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -4788,9 +4868,10 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact diagnostic implementation commit `0d3a0c9d3` plus its evidence-ledger head and run all
-six target-native cells. Require both Windows jobs to prove the generated Release compiler/linker
-settings; if arm64 still differs, record both bounded disassemblies while retaining all four POSIX
+Add a purpose fixture for lowercase native arm64 MSBuild platform spelling, implement only an exact
+case-insensitive expected-architecture comparison, and rerun all six target-native cells. Require
+both Windows jobs to prove the generated Release compiler/linker settings; if arm64 then reaches the
+known comparator mismatch, record both bounded disassemblies while retaining all four POSIX
controls, strict comparison, and rejected-arm64 no-upload. Cross-family Layer B targets, the
protected manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy
performance baseline remain release/default-path blockers; no publication, desktop resolver, SSH
From e1a63930b4d350e8677e2be3a35b0bdec95f268c Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:31:32 -0400
Subject: [PATCH 041/267] docs(ssh): record native platform case gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 117 +++++++++++++++---
1 file changed, 99 insertions(+), 18 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index aa48e88f3bf..5928be7905f 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29357355064 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and uploads exactly those five unpublished artifacts; Windows x64 proves the generated compiler/linker flags in both clean builds, while native Windows arm64 fails closed before staging because the generated Release-condition verifier does not accept the runner's lowercase `arm64` platform spelling; no arm64 artifact is uploaded and no disassembly or producer correction is yet justified; the active bounded package makes only that architecture comparison case-insensitive while retaining exact Release/configuration cardinality and option checks; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29357355064 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and uploads exactly those five unpublished artifacts; Windows x64 proves the generated compiler/linker flags in both clean builds, while native Windows arm64 fails closed before staging because the generated Release-condition verifier does not accept the runner's lowercase `arm64` platform spelling; no arm64 artifact is uploaded and no disassembly or producer correction is yet justified; exact implementation commit `4207c207a` makes only that architecture comparison case-insensitive while retaining exact Release/configuration cardinality and option checks, is locally green under E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-LOCAL-001, and awaits all six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -163,12 +163,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: test and implement the bounded case-insensitive architecture comparison for
- generated MSBuild Release conditions, retain exact group and option cardinality, then rerun all
- six target-native cells. Require both Windows jobs to prove their generated compiler/linker
- settings; only if arm64 reaches the known comparator mismatch may paired bounded disassembly
- justify a producer correction. Preserve all five controls, rejected-binary no-upload, the
- repository-wide node-pty patch, legacy/default path, and every other release gate.
+- Next required action: push exact implementation commit `4207c207a` plus its evidence-ledger head
+ and rerun all six target-native cells. Require both Windows jobs to prove their generated
+ compiler/linker settings; only if arm64 reaches the known comparator mismatch may paired bounded
+ disassembly justify a producer correction. Preserve all five controls, rejected-binary no-upload,
+ the repository-wide node-pty patch, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -679,8 +678,9 @@ Windows arm64 before staging because the Release group lookup does not accept th
**In progress — 2026-07-14, Codex implementation owner:** make only the expected generated Release
architecture comparison case-insensitive, while retaining one exact Release group, the expected
tuple architecture, one inherited compiler/linker option block, and exactly one instance of each
-required flag. Add the lowercase-arm64 purpose fixture before rerunning all six native cells. Do not
-change a producer, normalize output, weaken reproducibility, or connect a production consumer.
+required flag. Exact implementation commit `4207c207a` and its lowercase-arm64 fixture are locally
+green under E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-LOCAL-001; all six native cells remain required. Do
+not change a producer, normalize output, weaken reproducibility, or connect a production consumer.
Each runtime must contain only the executable closure required by the relay.
@@ -4811,6 +4811,88 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
architecture case-insensitively, retaining exact group and option cardinality. Rerun both Windows
cells and all four POSIX controls before interpreting the underlying PE drift.
+### E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-LOCAL-001 — Lowercase native platform contract
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `4207c207ab932ef67522b4f73b98d63fa32d0924`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This
+ runner cannot generate or execute native MSBuild/ARM64 PE inputs, so the target-native Windows
+ jobs remain authoritative.
+- Remote and transport: none; synthetic generated-project fixtures and workflow/source contracts
+ only
+- Exact red command:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ ```
+
+- Red result: FAIL as intended, one failed and three passed tests because a generated
+ `Release|arm64` condition was rejected for the `win32-arm64` tuple.
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ pnpm exec lint-staged
+ git diff --check
+ ```
+
+- Green result: PASS. Both syntax checks exited zero; the purpose command passed 8/8 tests across
+ three suites; all 15 artifact suites passed 53/53 tests. Typecheck, focused oxlint, the
+ 355-entry max-lines ratchet, full repository lint/reliability/localization, formatting, staged
+ hooks, and diff checks exited zero. Full lint emitted only pre-existing warnings outside this
+ package.
+- Duration and resource metrics: red suite 382 ms Vitest; purpose suite 181 ms Vitest; complete
+ artifact suite 1.51 s Vitest; typecheck 3.41 s; focused lint/line ratchet 3.28 s; full lint
+ 13.30 s. Synthetic peak RSS, open files/channels, and cancellation settlement were not
+ instrumented.
+- Artifact/log/trace link: exact source commit and local command output; no binary artifact was
+ created or uploaded
+- Oracle proved: `Release|arm64` is accepted for only the expected `win32-arm64` architecture while
+ the quoted Release condition remains exact apart from case. Wrong architecture, missing or
+ duplicate group/option blocks, missing inheritance, and missing or duplicated required flags
+ still fail closed. No source rewrite, producer, comparator, staging, or production path changed.
+- Does not prove: the exact native generated XML, native flag propagation, complete arm64 build,
+ paired disassembly, a safe producer correction, arm64 equality, oldest baselines, native trust,
+ SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local generated-project platform-casing contract only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation and ledger head, then run all six target-native cells and
+ require both Windows architectures to log the accepted generated settings before interpreting any
+ later comparator mismatch.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -4868,12 +4950,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Add a purpose fixture for lowercase native arm64 MSBuild platform spelling, implement only an exact
-case-insensitive expected-architecture comparison, and rerun all six target-native cells. Require
-both Windows jobs to prove the generated Release compiler/linker settings; if arm64 then reaches the
-known comparator mismatch, record both bounded disassemblies while retaining all four POSIX
-controls, strict comparison, and rejected-arm64 no-upload. Cross-family Layer B targets, the
-protected manifest-signing environment, oldest-baseline/native-trust cells, and the paired legacy
-performance baseline remain release/default-path blockers; no publication, desktop resolver, SSH
-transfer/install, per-target Beta, fallback, tuple enablement, or default behavior may be connected
-by this package.
+Push exact implementation commit `4207c207a` plus its evidence-ledger head and rerun all six
+target-native cells. Require both Windows jobs to prove the generated Release compiler/linker
+settings; if arm64 then reaches the known comparator mismatch, record both bounded disassemblies
+while retaining all four POSIX controls, strict comparison, and rejected-arm64 no-upload.
+Cross-family Layer B targets, the protected manifest-signing environment,
+oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
+release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
+Beta, fallback, tuple enablement, or default behavior may be connected by this package.
From 36a19f525cc63e488f49daa5c3a6aafc590acc08 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:55:29 -0400
Subject: [PATCH 042/267] test(ssh): evaluate Windows incremental link state
Co-authored-by: Orca
---
config/scripts/ssh-relay-node-pty-build.mjs | 21 +-
...lay-node-pty-windows-build-determinism.mjs | 26 +++
...ode-pty-windows-build-determinism.test.mjs | 40 +++-
...github-release-implementation-checklist.md | 194 ++++++++++++++----
4 files changed, 239 insertions(+), 42 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 6368b2af7d3..403f4815aea 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -7,7 +7,9 @@ import { promisify } from 'node:util'
import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-settlement.mjs'
import {
applyWindowsNodePtyBuildDeterminism,
- assertWindowsNodePtyGeneratedBuildSettings
+ assertWindowsNodePtyGeneratedBuildSettings,
+ parseWindowsNodePtyLinkIncremental,
+ windowsNodePtyLinkIncrementalCommand
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const require = createRequire(import.meta.url)
@@ -192,8 +194,23 @@ export async function buildPatchedSshRelayNodePty({
tuple
})
if (generatedSettings) {
+ const evaluation = windowsNodePtyLinkIncrementalCommand({
+ nodePtyDirectory: buildDirectory,
+ tuple
+ })
+ // Why: the emitted ARM64 thunks cannot justify a producer change without the effective link state.
+ const evaluated = await runCommand(evaluation.command, evaluation.args, {
+ cwd: buildDirectory,
+ signal: controller.signal,
+ timeout: BUILD_TIMEOUT_MS,
+ windowsHide: true,
+ env: buildEnvironment
+ })
process.stdout.write(
- `windows_node_pty_msbuild_settings=${JSON.stringify(generatedSettings)}\n`
+ `windows_node_pty_msbuild_settings=${JSON.stringify({
+ ...generatedSettings,
+ linkIncremental: parseWindowsNodePtyLinkIncremental(evaluated.stdout)
+ })}\n`
)
}
} finally {
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index a92bc3b08a1..1fc1481ff73 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -125,3 +125,29 @@ export async function assertWindowsNodePtyGeneratedBuildSettings({ nodePtyDirect
project
}
}
+
+export function windowsNodePtyLinkIncrementalCommand({ nodePtyDirectory, tuple }) {
+ if (!tuple.startsWith('win32-')) {
+ return undefined
+ }
+ const platform = tuple.endsWith('-arm64') ? 'ARM64' : 'x64'
+ return {
+ command: 'MSBuild.exe',
+ args: [
+ join(nodePtyDirectory, 'build', 'conpty_console_list.vcxproj'),
+ '-nologo',
+ '-verbosity:quiet',
+ '-property:Configuration=Release',
+ `-property:Platform=${platform}`,
+ '-getProperty:LinkIncremental'
+ ]
+ }
+}
+
+export function parseWindowsNodePtyLinkIncremental(output) {
+ const value = output.trim().toLowerCase()
+ if (value !== 'true' && value !== 'false') {
+ throw new Error('unexpected LinkIncremental evaluation from MSBuild')
+ }
+ return value === 'true'
+}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 29444fde8e2..82a376e563d 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -6,7 +6,9 @@ import { afterEach, describe, expect, it } from 'vitest'
import {
applyWindowsNodePtyBuildDeterminism,
- assertWindowsNodePtyGeneratedBuildSettings
+ assertWindowsNodePtyGeneratedBuildSettings,
+ parseWindowsNodePtyLinkIncremental,
+ windowsNodePtyLinkIncrementalCommand
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const temporaryDirectories = []
@@ -86,6 +88,42 @@ describe('SSH relay Windows node-pty build determinism', () => {
})
})
+ it('evaluates the effective Release incremental-link state with strict output parsing', () => {
+ expect(
+ windowsNodePtyLinkIncrementalCommand({
+ nodePtyDirectory: 'C:\\artifact-node-pty',
+ tuple: 'win32-arm64'
+ })
+ ).toEqual({
+ command: 'MSBuild.exe',
+ args: [
+ join('C:\\artifact-node-pty', 'build', 'conpty_console_list.vcxproj'),
+ '-nologo',
+ '-verbosity:quiet',
+ '-property:Configuration=Release',
+ '-property:Platform=ARM64',
+ '-getProperty:LinkIncremental'
+ ]
+ })
+ expect(parseWindowsNodePtyLinkIncremental('TRUE\r\n')).toBe(true)
+ expect(parseWindowsNodePtyLinkIncremental('false\n')).toBe(false)
+ expect(() => parseWindowsNodePtyLinkIncremental('true\nwarning')).toThrow(
+ 'unexpected LinkIncremental evaluation'
+ )
+ expect(
+ windowsNodePtyLinkIncrementalCommand({
+ nodePtyDirectory: 'C:\\artifact-node-pty',
+ tuple: 'win32-x64'
+ }).args
+ ).toContain('-property:Platform=x64')
+ expect(
+ windowsNodePtyLinkIncrementalCommand({
+ nodePtyDirectory: '/not-used-on-posix',
+ tuple: 'linux-arm64-glibc'
+ })
+ ).toBeUndefined()
+ })
+
it('rejects missing, duplicate, non-inherited, or wrong-architecture generated settings', async () => {
for (const fixture of [
{ compilerOptions: '/Brepro %(AdditionalOptions)' },
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 5928be7905f..36ef97317ba 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29357355064 keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible and uploads exactly those five unpublished artifacts; Windows x64 proves the generated compiler/linker flags in both clean builds, while native Windows arm64 fails closed before staging because the generated Release-condition verifier does not accept the runner's lowercase `arm64` platform spelling; no arm64 artifact is uploaded and no disassembly or producer correction is yet justified; exact implementation commit `4207c207a` makes only that architecture comparison case-insensitive while retaining exact Release/configuration cardinality and option checks, is locally green under E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-LOCAL-001, and awaits all six target-native cells; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 proves the lowercase-arm64 generated-setting correction on the real runner, keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, and uploads exactly those five unpublished artifacts; Windows arm64 builds, verifies, and executes both complete runtimes, then fails closed with no upload because 2,879 linker-emitted 16-byte function thunks differ only in their unreachable fourth `udf` instruction while each thunk's `adrp`/`add`/`br` control flow is byte-identical; the remaining 68 bytes are derived `/Brepro` COFF/debug identities; the active bounded diagnostic must prove the generated incremental-link state that owns the thunks before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -123,7 +123,13 @@ same change as the work it records.
arm64 build fails closed at the new Release-condition verifier before runtime staging under
E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-CI-RED-001. The runner exposes `Platform=arm64`; the active
correction accepts only a case-insensitive exact match for the expected architecture and retains
- every option/cardinality check. No producer, comparator, upload, or production behavior changes.
+ every option/cardinality check. Exact-head run 29358223742 proves that correction on the real
+ arm64 runner, preserves five exact controls, and reaches paired disassembly under
+ E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001. The arm64 outputs have 2,879 linker-emitted
+ 16-byte function thunks whose three control-flow instructions match and whose unreachable fourth
+ `udf` instruction differs, plus 68 derived identity bytes. Strict comparison and rejected-output
+ no-upload remain intact. The active diagnostic must prove the generated incremental-link state
+ before any producer change. No comparator, publication, or production behavior changes.
- Windows input correction: E-M3-WINDOWS-INPUT-GAP-001 proved the official Windows ZIP lacks headers
and `node.lib`. Both artifacts now require the exact signed headers archive and tuple import
library as explicit inputs. The schema, signed-checksum verifier, bounded ZIP/header extraction,
@@ -163,11 +169,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `4207c207a` plus its evidence-ledger head
- and rerun all six target-native cells. Require both Windows jobs to prove their generated
- compiler/linker settings; only if arm64 reaches the known comparator mismatch may paired bounded
- disassembly justify a producer correction. Preserve all five controls, rejected-binary no-upload,
- the repository-wide node-pty patch, legacy/default path, and every other release gate.
+- Next required action: add a bounded generated-project diagnostic for the exact Windows Release
+ `LinkIncremental` state and rerun all six target-native cells. Require both Windows clean builds
+ to report the same state before considering one copied-artifact producer correction. Preserve all
+ five controls, strict comparison, rejected-arm64 no-upload, the repository-wide node-pty patch,
+ legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -675,12 +681,21 @@ no second producer correction is justified before the target-native evidence. Ex
Windows arm64 before staging because the Release group lookup does not accept the runner's lowercase
`arm64` platform spelling (E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-CI-RED-001).
-**In progress — 2026-07-14, Codex implementation owner:** make only the expected generated Release
-architecture comparison case-insensitive, while retaining one exact Release group, the expected
-tuple architecture, one inherited compiler/linker option block, and exactly one instance of each
-required flag. Exact implementation commit `4207c207a` and its lowercase-arm64 fixture are locally
-green under E-M3-WINDOWS-MSBUILD-PLATFORM-CASE-LOCAL-001; all six native cells remain required. Do
-not change a producer, normalize output, weaken reproducibility, or connect a production consumer.
+Exact-head run 29358223742 then proves that correction on native Windows arm64 and retains all five
+reproducible controls. Both arm64 clean builds log the required compiler/linker options, assemble,
+verify, and execute, but strict comparison still rejects `conpty_console_list.node` and uploads no
+arm64 artifact. The complete PE scan reports 5,826 differing bytes: 5,758 bytes across 2,879
+two-byte `.text` ranges exactly 16 bytes apart plus 68 derived COFF/debug/CodeView bytes. Paired
+disassembly proves each 16-byte function thunk has byte-identical `adrp x16`, `add x16`, and
+`br x16` instructions; only the unreachable fourth instruction changes from `udf #0x24d` to
+`udf #0x16d` (E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001).
+
+**In progress — 2026-07-14, Codex implementation owner:** classify the linker-owned thunk producer
+before changing it. Add a bounded generated-project diagnostic for the exact Release
+`LinkIncremental` state while retaining the existing architecture, option, cardinality, strict
+comparison, and no-upload gates. The thunk layout is consistent with an incremental-link table, but
+that setting is not yet proved on the native runner. Do not normalize rejected bytes, weaken the
+comparator, modify repository-wide node-pty, or connect a production consumer.
Each runtime must contain only the executable closure required by the relay.
@@ -1285,16 +1300,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; PE diagnostic awaiting native evidence | `39ee3451b`; E-M3-WINDOWS-PE-DIAGNOSTIC-LOCAL-001; arm64 repeat-red evidence |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; arm64 linker-thunk producer diagnostic active | `e1a63930b`; E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -4893,23 +4908,123 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
require both Windows architectures to log the accepted generated settings before interpreting any
later comparator mismatch.
+### E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001 — Native linker-thunk drift isolated
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `e1a63930b4d350e8677e2be3a35b0bdec95f268c`, containing exact
+ lowercase-platform implementation commit `4207c207ab932ef67522b4f73b98d63fa32d0924`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29358223742](https://github.com/stablyai/orca/actions/runs/29358223742),
+ conclusion `failure`; Linux arm64 `87171219009` success, Windows arm64 `87171219067` expected
+ strict failure, Linux x64 `87171219080` success, Windows x64 `87171219167` success, macOS arm64
+ `87171219192` success, and macOS x64 `87171219210` success
+- Runners: GitHub-hosted `ubuntu-24.04-arm` / `ubuntu24-arm64` `20260706.52.2` native ARM64;
+ `windows-11-arm` / `win11-arm64` `20260706.102.1` native ARM64; `ubuntu-24.04` / `ubuntu24`
+ `20260705.232.1` native X64; `windows-2022` / `win22` `20260706.237.1` native X64; `macos-15` /
+ `macos15` `20260706.0213.1` native ARM64; and `macos-15-intel` / `macos15`
+ `20260629.0276.1` native X64. Every job recorded Node v24.18.0 and the exact source commit.
+- Remote and transport: none; target-native artifact assembly, generated-project verification,
+ bundled-Node/native-module execution, strict comparison, and unpublished Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh pr view 8741 --repo stablyai/orca \
+ --json number,state,isDraft,headRefName,headRefOid,url,statusCheckRollup,updatedAt
+ gh api repos/stablyai/orca/actions/runs/29358223742
+ gh api 'repos/stablyai/orca/actions/runs/29358223742/jobs?per_page=100'
+ gh api 'repos/stablyai/orca/actions/runs/29358223742/artifacts?per_page=100'
+ gh run view 29358223742 --repo stablyai/orca --job 87171219167 --log
+ gh run view 29358223742 --repo stablyai/orca --job 87171219067 --log-failed
+ gh api repos/stablyai/orca/actions/jobs/87171219067/logs | \
+ sed -n '/windows_arm64_disassembly=first/,$p'
+ gh run download 29358223742 --repo stablyai/orca --dir
+ jq -c '{tupleId,contentId,nodeVersion,archive,fileCount}' \
+ /*/*.identity.json
+ ```
+
+- Result: FAIL as the intended strict reproducibility gate. The lowercase `arm64` correction reaches
+ the one expected Release group on both native arm64 clean builds. Both log exactly one inherited
+ compiler and linker option block containing `/Brepro` and `/experimental:deterministic`, then
+ assemble, inspect, verify, and execute the complete runtime. Each bundled Node v24.18.0 smoke
+ proves ABI 137, patched PTY input/resize/exit code 23, watcher create/update/delete, and settled
+ Windows resources. Strict comparison then rejects only
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node`; no arm64 output is staged
+ for upload.
+- Windows arm64 outputs: both PE files are 956,928 bytes. The first content identity is
+ `sha256:a6adc716ec39503f68f4e322624ed9193b9343ca4b5f74d22843c47635e81519`, with
+ 33,261,547-byte ZIP
+ `sha256:5aebde73ef6cad605d13c5c27977f1229729aa28a6959649989d8ecd4a6d2a9e`; the second is
+ `sha256:2aef13722dd084941069d260591c529d1ca5ebf0b1e2defa34da4c43f44c2d24`, with the same
+ ZIP size and digest
+ `sha256:974612580fa7a008bcf3377ddd13ce5f99b78cc31c99c7b9b720066b3f9dc91c`. Both archives
+ contain 42 files and expand to 86,189,895 bytes.
+- PE oracle: the complete scan reports 5,826 differing bytes across 2,886 coalesced ranges. The
+ `.text` contribution is 5,758 bytes across 2,879 two-byte ranges from file offsets 1,052 through
+ 47,102, exactly 16 bytes apart. The remaining 68 bytes are one four-byte COFF timestamp, three
+ four-byte debug timestamps, one 16-byte CodeView identifier, and 36 derived `.rdata` bytes.
+ Section layout, file size, executable control-flow bytes, and all other bytes match.
+- Paired disassembly oracle: the first 512 `.text` bytes contain repeated 16-byte function thunks.
+ For every displayed thunk, `adrp x16, target`, `add x16, x16, offset`, and `br x16` are
+ byte-identical. Only the unreachable fourth instruction differs: first build `0000024d`
+ (`udf #0x24d`), second build `0000016d` (`udf #0x16d`). This classifies the changing bytes as
+ linker-emitted thunk padding; it does not yet prove the generated linker setting responsible.
+- Uploaded controls: exactly five unpublished seven-day artifacts and no Windows arm64 artifact:
+ Linux x64 `8321096098`, 29,281,909 bytes,
+ `sha256:cbe4d1be7664227fa34fb977f568ba0fc9409d5b5f5139fd4937013e46501074`, content ID
+ `sha256:960546cd96c67fcf9bb0a61e96ecdbecbffd9104d3a495578f8bb19dd810649a`, archive
+ `sha256:c87306e069af8c849b7679ccdf0504cc48c51b0ac0586edcdbf698972156bab5`; Linux arm64
+ `8321099340`, 28,212,775 bytes,
+ `sha256:0502a9710a9612c44fc2aa4792ee1f30859158fcac40668b59c35ca670eb83f2`, content ID
+ `sha256:aa3aa8ae8b42334ba7b0dbe5c43fd1184e36b3f4f4a9bec0e990e9b78f090756`, archive
+ `sha256:f017fcd7808cd8ba86175b2fad63103e880d57ccbec70412938e0cc145310eda`; macOS x64
+ `8321127611`, 26,376,349 bytes,
+ `sha256:9297b99e9605c065cbf04d3431edadf8312ee19dd1b60d8790cba95f090bd68e`, content ID
+ `sha256:585ea6034cdd07487d8667059f975a877c795a45dc0d6eeee1617f2e3749faa2`, archive
+ `sha256:5669d69085d268e01fe5ece6e4372832c3f61c89bcefa9acaf732c81eb460775`; macOS arm64
+ `8321085541`, 24,740,934 bytes,
+ `sha256:8ab194c0d0c08ab40aa8f7821738fd5c2e3b1821fb83df6d59992b6106ba46f2`, content ID
+ `sha256:40ff5d2036784b794e7b09f78596409f63f3145280c530bece5280d40897f6cb`, archive
+ `sha256:b51e5a6a53aeff2ae47e4156900981395516c9b246ab1ae3fff5c4c34500ee0a`; and Windows x64
+ `8321159937`, 37,075,308 bytes,
+ `sha256:dcadebbcbb7d3c6f308badeefa7940350022b22bb76fd31baed15bb304af56c1`, content ID
+ `sha256:2a6bfa06b445fb78d6e4a5abba6ec379cbed6f7830c805e82c7145d18a1c3d8b`, archive
+ `sha256:ee1a0cc8bdf55d783ed1c1232dedd788710a1d88edd7e89a2ddfa84e0986d7ca`.
+- Duration and resource metrics: jobs ran 3m07s Linux arm64, 9m15s Windows arm64, 3m02s Linux x64,
+ 5m22s Windows x64, 2m41s macOS arm64, and 4m11s macOS x64. Windows arm64 clean builds took
+ 149,415.066 ms and 130,574.341 ms; verification took 7,688.862 ms and 8,012.846 ms, with smoke
+ taking 5,865.144 ms at 53,235,712-byte RSS and 5,553.779 ms at 53,133,312-byte RSS. Cancellation,
+ SSH channel/file counts, and fallback delay are outside this artifact-only run.
+- Artifact/log/trace link: run/jobs and the five unpublished artifacts above; rejected arm64 bytes
+ exist only in the bounded job workspace and log diagnostics and were not uploaded
+- Oracle proved: real native lowercase platform acceptance, exact generated compiler/linker option
+ propagation, two complete executable arm64 candidates, strict rejection, exact five-control
+ reproducibility, bounded linker-thunk classification, and rejected-output no-upload.
+- Does not prove: whether MSBuild enabled incremental linking, that disabling it is the safe producer
+ correction, arm64 equality, oldest baselines, native trust, SSH, publication, transfer, fallback,
+ UI, or any enabled tuple. No executable byte may be normalized from this evidence.
+- Checklist items satisfied: target-native platform-case gate and bounded ARM64 instruction
+ diagnostic only; no tuple or production checkbox.
+- Follow-up: add a purpose-tested bounded parser for the exact generated Release
+ `LinkIncremental` state, require both Windows clean builds to report it, and rerun all six native
+ controls before considering one copied-artifact producer correction.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five native cells pass; arm64 generated-setting verification currently stops before the known PE drift | Toolchain drift may change native content IDs | Codex implementation owner | Generated-build-input and ARM64 instruction diagnostics identify a safe producer correction; all six clean builds then match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Five native cells pass; arm64 builds and executes twice but strict comparison rejects linker-thunk drift | Toolchain drift may change native content IDs | Codex implementation owner | Prove the generated incremental-link state, apply only an evidenced producer correction, then make all six clean builds match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -4950,10 +5065,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `4207c207a` plus its evidence-ledger head and rerun all six
-target-native cells. Require both Windows jobs to prove the generated Release compiler/linker
-settings; if arm64 then reaches the known comparator mismatch, record both bounded disassemblies
-while retaining all four POSIX controls, strict comparison, and rejected-arm64 no-upload.
+Add a bounded, purpose-tested generated-project diagnostic for the exact Windows Release
+`LinkIncremental` state, then rerun both Windows architectures and all four POSIX controls at the
+exact implementation head. Require both Windows clean builds to report the same setting. Only if
+that target-native evidence classifies the 2,879 function thunks may one copied-artifact producer
+correction be considered; retain strict comparison, all five controls, and rejected-arm64 no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 2d4433bbd0d2481d3f91c56d10155989cd6e7e44 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 14:57:07 -0400
Subject: [PATCH 043/267] docs(ssh): record native linker thunk gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 112 ++++++++++++++++--
1 file changed, 100 insertions(+), 12 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 36ef97317ba..dad31cbdb46 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 proves the lowercase-arm64 generated-setting correction on the real runner, keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, and uploads exactly those five unpublished artifacts; Windows arm64 builds, verifies, and executes both complete runtimes, then fails closed with no upload because 2,879 linker-emitted 16-byte function thunks differ only in their unreachable fourth `udf` instruction while each thunk's `adrp`/`add`/`br` control flow is byte-identical; the remaining 68 bytes are derived `/Brepro` COFF/debug identities; the active bounded diagnostic must prove the generated incremental-link state that owns the thunks before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 proves the lowercase-arm64 generated-setting correction on the real runner, keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, and uploads exactly those five unpublished artifacts; Windows arm64 builds, verifies, and executes both complete runtimes, then fails closed with no upload because 2,879 linker-emitted 16-byte function thunks differ only in their unreachable fourth `udf` instruction while each thunk's `adrp`/`add`/`br` control flow is byte-identical; the remaining 68 bytes are derived `/Brepro` COFF/debug identities; exact implementation commit `36a19f525` adds a bounded pre-staging MSBuild evaluation of the effective Release `LinkIncremental` state and is locally green under E-M3-WINDOWS-LINK-INCREMENTAL-DIAGNOSTIC-LOCAL-001; all six native cells remain required before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -169,11 +169,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: add a bounded generated-project diagnostic for the exact Windows Release
- `LinkIncremental` state and rerun all six target-native cells. Require both Windows clean builds
- to report the same state before considering one copied-artifact producer correction. Preserve all
- five controls, strict comparison, rejected-arm64 no-upload, the repository-wide node-pty patch,
- legacy/default path, and every other release gate.
+- Next required action: push exact implementation commit `36a19f525` plus its evidence-ledger head
+ and rerun all six target-native cells. Require both Windows clean builds to report the same
+ evaluated `LinkIncremental` state before considering one copied-artifact producer correction.
+ Preserve all five controls, strict comparison, rejected-arm64 no-upload, the repository-wide
+ node-pty patch, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -694,7 +694,9 @@ disassembly proves each 16-byte function thunk has byte-identical `adrp x16`, `a
before changing it. Add a bounded generated-project diagnostic for the exact Release
`LinkIncremental` state while retaining the existing architecture, option, cardinality, strict
comparison, and no-upload gates. The thunk layout is consistent with an incremental-link table, but
-that setting is not yet proved on the native runner. Do not normalize rejected bytes, weaken the
+that setting is not yet proved on the native runner. Exact implementation commit `36a19f525` is
+locally red/green and passes the complete artifact/static gate under
+E-M3-WINDOWS-LINK-INCREMENTAL-DIAGNOSTIC-LOCAL-001. Do not normalize rejected bytes, weaken the
comparator, modify repository-wide node-pty, or connect a production consumer.
Each runtime must contain only the executable closure required by the relay.
@@ -5008,6 +5010,92 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
`LinkIncremental` state, require both Windows clean builds to report it, and rerun all six native
controls before considering one copied-artifact producer correction.
+### E-M3-WINDOWS-LINK-INCREMENTAL-DIAGNOSTIC-LOCAL-001 — Effective MSBuild link-state gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `36a19f525cc63e488f49daa5c3a6aafc590acc08`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot evaluate a native MSBuild project, so the two Windows jobs remain authoritative.
+- Remote and transport: none; strict command/output contracts and builder ordering only
+- Exact red command:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ ```
+
+- Red result: FAIL as intended, one failed and four passed tests because
+ `windowsNodePtyLinkIncrementalCommand` was not implemented.
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ node --check config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ pnpm exec lint-staged
+ git diff --check
+ ```
+
+- Green result: PASS. All syntax checks exited zero; the purpose command passed 9/9 tests across
+ three suites; all 15 artifact suites passed 54/54 tests. Typecheck, focused oxlint, the 355-entry
+ max-lines ratchet, full repository lint/reliability/localization, formatting, staged hooks, and
+ diff checks exited zero. Full lint emitted only pre-existing warnings outside this package;
+ `lint-staged` reported no staged files in its standalone run and the commit hook subsequently ran
+ oxlint, React Doctor, and oxfmt successfully over all four staged files.
+- Duration and resource metrics: purpose gate 1.93 s wall / 459 ms Vitest; complete artifact gate
+ 2.87 s wall / 1.35 s Vitest; typecheck 3.10 s; focused lint and line ratchet 3.09 s; full lint
+ 12.91 s. Synthetic peak RSS, open files/channels, cancellation settlement, and fallback delay
+ were not instrumented.
+- Artifact/log/trace link: exact implementation commit and local command output; no binary artifact
+ was created or uploaded
+- Oracle proved: Windows builds form a bounded `MSBuild.exe` query for the exact generated
+ `conpty_console_list.vcxproj`, Release configuration, and tuple architecture; request only the
+ evaluated `LinkIncremental` property; accept exactly one case-insensitive boolean result; and
+ fail before staging on missing, noisy, or non-boolean output. x64 and arm64 commands are covered,
+ POSIX creates no query, and the result is appended to the existing generated-setting record.
+- Does not prove: `MSBuild.exe -getProperty` availability or result on either native Windows image,
+ the actual effective incremental-link state, the thunk owner, a safe producer correction, arm64
+ equality, oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled
+ tuple.
+- Checklist items satisfied: local bounded effective-link-state diagnostic only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
+ require both Windows clean builds to report `linkIncremental` before changing the producer.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -5065,11 +5153,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Add a bounded, purpose-tested generated-project diagnostic for the exact Windows Release
-`LinkIncremental` state, then rerun both Windows architectures and all four POSIX controls at the
-exact implementation head. Require both Windows clean builds to report the same setting. Only if
-that target-native evidence classifies the 2,879 function thunks may one copied-artifact producer
-correction be considered; retain strict comparison, all five controls, and rejected-arm64 no-upload.
+Push exact implementation commit `36a19f525` plus its evidence-ledger head, then rerun both Windows
+architectures and all four POSIX controls. Require both Windows clean builds to report the same
+evaluated `LinkIncremental` setting. Only if that target-native evidence classifies the 2,879
+function thunks may one copied-artifact producer correction be considered; retain strict
+comparison, all five controls, and rejected-arm64 no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 4a66435b71b158624645c614543d139a9ea45d51 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:22:44 -0400
Subject: [PATCH 044/267] build(ssh): inspect native linker command tracking
Co-authored-by: Orca
---
config/scripts/ssh-relay-node-pty-build.mjs | 18 +-
...lay-node-pty-windows-build-determinism.mjs | 118 +++++++--
...ode-pty-windows-build-determinism.test.mjs | 112 ++++++--
...github-release-implementation-checklist.md | 242 +++++++++++++++---
4 files changed, 395 insertions(+), 95 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 403f4815aea..59f0b06f369 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -8,8 +8,8 @@ import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-sett
import {
applyWindowsNodePtyBuildDeterminism,
assertWindowsNodePtyGeneratedBuildSettings,
- parseWindowsNodePtyLinkIncremental,
- windowsNodePtyLinkIncrementalCommand
+ inspectWindowsNodePtyLinkCommandTracking,
+ windowsNodePtyLinkCommandTrackingPath
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const require = createRequire(import.meta.url)
@@ -194,22 +194,16 @@ export async function buildPatchedSshRelayNodePty({
tuple
})
if (generatedSettings) {
- const evaluation = windowsNodePtyLinkIncrementalCommand({
+ const trackingPath = windowsNodePtyLinkCommandTrackingPath({
nodePtyDirectory: buildDirectory,
tuple
})
- // Why: the emitted ARM64 thunks cannot justify a producer change without the effective link state.
- const evaluated = await runCommand(evaluation.command, evaluation.args, {
- cwd: buildDirectory,
- signal: controller.signal,
- timeout: BUILD_TIMEOUT_MS,
- windowsHide: true,
- env: buildEnvironment
- })
+ // Why: an unset property cannot classify ARM64 thunks; the post-build command is authoritative.
+ const linkCommand = await inspectWindowsNodePtyLinkCommandTracking(trackingPath)
process.stdout.write(
`windows_node_pty_msbuild_settings=${JSON.stringify({
...generatedSettings,
- linkIncremental: parseWindowsNodePtyLinkIncremental(evaluated.stdout)
+ linkCommand
})}\n`
)
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index 1fc1481ff73..1df9fca9a5e 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -1,4 +1,4 @@
-import { readFile, writeFile } from 'node:fs/promises'
+import { open, readFile, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
const COMPILER_OPTIONS = ` 'VCCLCompilerTool': {
@@ -42,6 +42,7 @@ const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
}`
const REQUIRED_GENERATED_OPTIONS = ['/Brepro', '/experimental:deterministic']
+const MAX_LINK_COMMAND_TRACKING_BYTES = 256 * 1024
function decodeXmlText(value) {
return value
@@ -126,28 +127,109 @@ export async function assertWindowsNodePtyGeneratedBuildSettings({ nodePtyDirect
}
}
-export function windowsNodePtyLinkIncrementalCommand({ nodePtyDirectory, tuple }) {
+export function windowsNodePtyLinkCommandTrackingPath({ nodePtyDirectory, tuple }) {
if (!tuple.startsWith('win32-')) {
return undefined
}
- const platform = tuple.endsWith('-arm64') ? 'ARM64' : 'x64'
- return {
- command: 'MSBuild.exe',
- args: [
- join(nodePtyDirectory, 'build', 'conpty_console_list.vcxproj'),
- '-nologo',
- '-verbosity:quiet',
- '-property:Configuration=Release',
- `-property:Platform=${platform}`,
- '-getProperty:LinkIncremental'
- ]
+ return join(
+ nodePtyDirectory,
+ 'build',
+ 'Release',
+ 'obj',
+ 'conpty_console_list',
+ 'conpty_console_list.tlog',
+ 'link.command.1.tlog'
+ )
+}
+
+async function readBoundedLinkCommandTracking(path) {
+ const handle = await open(path, 'r')
+ try {
+ // Why: build-tool tracking output must not bypass the diagnostic's explicit memory ceiling.
+ const bytes = Buffer.allocUnsafe(MAX_LINK_COMMAND_TRACKING_BYTES + 1)
+ let length = 0
+ while (length < bytes.length) {
+ const result = await handle.read(bytes, length, bytes.length - length, null)
+ if (result.bytesRead === 0) {
+ break
+ }
+ length += result.bytesRead
+ }
+ return bytes.subarray(0, length)
+ } finally {
+ await handle.close()
+ }
+}
+
+function decodeLinkCommandTracking(bytes) {
+ if (bytes.length < 2 || bytes.length > MAX_LINK_COMMAND_TRACKING_BYTES) {
+ throw new Error('MSBuild linker tracking record is outside the bounded size')
+ }
+ let encoding = 'utf8'
+ let offset = 0
+ if (bytes[0] === 0xff && bytes[1] === 0xfe) {
+ encoding = 'utf16le'
+ offset = 2
+ } else if (bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf) {
+ offset = 3
+ }
+ let text
+ try {
+ const decoderEncoding = encoding === 'utf16le' ? 'utf-16le' : 'utf-8'
+ text = new TextDecoder(decoderEncoding, { fatal: true }).decode(bytes.subarray(offset))
+ } catch {
+ throw new Error('MSBuild linker tracking record has invalid text encoding')
+ }
+ if (text.includes('\u0000') || text.includes('\ufffd')) {
+ throw new Error('MSBuild linker tracking record has invalid text encoding')
}
+ return { encoding, text }
}
-export function parseWindowsNodePtyLinkIncremental(output) {
- const value = output.trim().toLowerCase()
- if (value !== 'true' && value !== 'false') {
- throw new Error('unexpected LinkIncremental evaluation from MSBuild')
+export function parseWindowsNodePtyLinkCommandTracking(bytes) {
+ const { encoding, text } = decodeLinkCommandTracking(bytes)
+ const commandRecords = text.split(/\r?\n/).filter((line) => line.startsWith('^')).length
+ if (commandRecords !== 1) {
+ throw new Error('MSBuild linker tracking record must contain exactly one command record')
}
- return value === 'true'
+ const switches = [
+ ...text.matchAll(
+ /(?:^|\s)(\/(?:brepro|debug(?::[^\s"]+)?|experimental:deterministic|guard:[^\s"]+|incremental(?::(?:no|yes))?|opt:[^\s"]+))(?=\s|$)/gim
+ )
+ ].map((match) => match[1].toLowerCase())
+ const incrementalTokens = [
+ ...text.matchAll(/(?:^|\s)(\/incremental(?::[^\s"]*)?)(?=\s|$)/gim)
+ ].map((match) => match[1].toLowerCase())
+ if (incrementalTokens.some((token) => !switches.includes(token))) {
+ throw new Error('MSBuild linker tracking record has malformed incremental-link switch')
+ }
+ if (new Set(switches).size !== switches.length) {
+ throw new Error('MSBuild linker tracking record has duplicate allowlisted switches')
+ }
+ for (const required of ['/brepro', '/experimental:deterministic', '/guard:cf']) {
+ if (!switches.includes(required)) {
+ throw new Error(`MSBuild linker tracking record is missing ${required}`)
+ }
+ }
+ const incrementalSwitches = switches.filter((value) => value.startsWith('/incremental'))
+ if (incrementalSwitches.length > 1) {
+ throw new Error('MSBuild linker tracking record has ambiguous incremental-link switches')
+ }
+ const incremental =
+ incrementalSwitches.length === 0
+ ? 'unspecified'
+ : incrementalSwitches[0] === '/incremental:no'
+ ? 'disabled'
+ : 'enabled'
+ return {
+ bytes: bytes.length,
+ commandRecords,
+ encoding,
+ incremental,
+ switches: switches.toSorted()
+ }
+}
+
+export async function inspectWindowsNodePtyLinkCommandTracking(path) {
+ return parseWindowsNodePtyLinkCommandTracking(await readBoundedLinkCommandTracking(path))
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 82a376e563d..0d440eec041 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -7,8 +7,9 @@ import { afterEach, describe, expect, it } from 'vitest'
import {
applyWindowsNodePtyBuildDeterminism,
assertWindowsNodePtyGeneratedBuildSettings,
- parseWindowsNodePtyLinkIncremental,
- windowsNodePtyLinkIncrementalCommand
+ inspectWindowsNodePtyLinkCommandTracking,
+ parseWindowsNodePtyLinkCommandTracking,
+ windowsNodePtyLinkCommandTrackingPath
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const temporaryDirectories = []
@@ -88,42 +89,105 @@ describe('SSH relay Windows node-pty build determinism', () => {
})
})
- it('evaluates the effective Release incremental-link state with strict output parsing', () => {
+ it('parses one bounded UTF-16 linker command into an allowlisted switch summary', () => {
expect(
- windowsNodePtyLinkIncrementalCommand({
+ windowsNodePtyLinkCommandTrackingPath({
nodePtyDirectory: 'C:\\artifact-node-pty',
tuple: 'win32-arm64'
})
+ ).toBe(
+ join(
+ 'C:\\artifact-node-pty',
+ 'build',
+ 'Release',
+ 'obj',
+ 'conpty_console_list',
+ 'conpty_console_list.tlog',
+ 'link.command.1.tlog'
+ )
+ )
+ const command = [
+ '^C:\\artifact-node-pty\\build\\Release\\obj\\conpty_console_list.obj',
+ '/OUT:conpty_console_list.node /INCREMENTAL:NO /GUARD:CF /DEBUG:FULL',
+ '/OPT:REF /OPT:ICF /Brepro /experimental:deterministic'
+ ].join('\r\n')
+ expect(
+ parseWindowsNodePtyLinkCommandTracking(Buffer.from(`\ufeff${command}`, 'utf16le'))
).toEqual({
- command: 'MSBuild.exe',
- args: [
- join('C:\\artifact-node-pty', 'build', 'conpty_console_list.vcxproj'),
- '-nologo',
- '-verbosity:quiet',
- '-property:Configuration=Release',
- '-property:Platform=ARM64',
- '-getProperty:LinkIncremental'
+ bytes: Buffer.byteLength(`\ufeff${command}`, 'utf16le'),
+ commandRecords: 1,
+ encoding: 'utf16le',
+ incremental: 'disabled',
+ switches: [
+ '/brepro',
+ '/debug:full',
+ '/experimental:deterministic',
+ '/guard:cf',
+ '/incremental:no',
+ '/opt:icf',
+ '/opt:ref'
]
})
- expect(parseWindowsNodePtyLinkIncremental('TRUE\r\n')).toBe(true)
- expect(parseWindowsNodePtyLinkIncremental('false\n')).toBe(false)
- expect(() => parseWindowsNodePtyLinkIncremental('true\nwarning')).toThrow(
- 'unexpected LinkIncremental evaluation'
- )
expect(
- windowsNodePtyLinkIncrementalCommand({
- nodePtyDirectory: 'C:\\artifact-node-pty',
- tuple: 'win32-x64'
- }).args
- ).toContain('-property:Platform=x64')
- expect(
- windowsNodePtyLinkIncrementalCommand({
+ windowsNodePtyLinkCommandTrackingPath({
nodePtyDirectory: '/not-used-on-posix',
tuple: 'linux-arm64-glibc'
})
).toBeUndefined()
})
+ it('rejects oversized, malformed, duplicate, or ambiguous linker tracking input', () => {
+ expect(() => parseWindowsNodePtyLinkCommandTracking(Buffer.alloc(300_000))).toThrow(
+ 'outside the bounded size'
+ )
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(Buffer.from([0xff, 0xfe, 0x00, 0xd8]))
+ ).toThrow('invalid text encoding')
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(
+ Buffer.from('^first\n/INCREMENTAL\n^second\n/INCREMENTAL', 'utf8')
+ )
+ ).toThrow('exactly one command record')
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(
+ Buffer.from(
+ '^one\n/INCREMENTAL /INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic',
+ 'utf8'
+ )
+ )
+ ).toThrow('ambiguous incremental-link switches')
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(
+ Buffer.from('^one\n/INCREMENTAL:MAYBE /Brepro /GUARD:CF /experimental:deterministic')
+ )
+ ).toThrow('malformed incremental-link switch')
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(
+ Buffer.from('^one\n/Brepro /BREPRO /GUARD:CF /experimental:deterministic')
+ )
+ ).toThrow('duplicate allowlisted switches')
+ expect(() =>
+ parseWindowsNodePtyLinkCommandTracking(Buffer.from('^one\n/Brepro /GUARD:CF', 'utf8'))
+ ).toThrow('missing /experimental:deterministic')
+ })
+
+ it('bounds linker tracking bytes while reading the generated file', async () => {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-tracking-'))
+ temporaryDirectories.push(directory)
+ const trackingPath = join(directory, 'link.command.1.tlog')
+ await writeFile(
+ trackingPath,
+ '^one\n/INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic'
+ )
+ await expect(inspectWindowsNodePtyLinkCommandTracking(trackingPath)).resolves.toMatchObject({
+ incremental: 'disabled'
+ })
+ await writeFile(trackingPath, Buffer.alloc(300_000))
+ await expect(inspectWindowsNodePtyLinkCommandTracking(trackingPath)).rejects.toThrow(
+ 'outside the bounded size'
+ )
+ })
+
it('rejects missing, duplicate, non-inherited, or wrong-architecture generated settings', async () => {
for (const fixture of [
{ compilerOptions: '/Brepro %(AdditionalOptions)' },
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index dad31cbdb46..4aaf408a73b 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 proves the lowercase-arm64 generated-setting correction on the real runner, keeps Linux x64/arm64, macOS x64/arm64, and Windows x64 exactly reproducible, and uploads exactly those five unpublished artifacts; Windows arm64 builds, verifies, and executes both complete runtimes, then fails closed with no upload because 2,879 linker-emitted 16-byte function thunks differ only in their unreachable fourth `udf` instruction while each thunk's `adrp`/`add`/`br` control flow is byte-identical; the remaining 68 bytes are derived `/Brepro` COFF/debug identities; exact implementation commit `36a19f525` adds a bounded pre-staging MSBuild evaluation of the effective Release `LinkIncremental` state and is locally green under E-M3-WINDOWS-LINK-INCREMENTAL-DIAGNOSTIC-LOCAL-001; all six native cells remain required before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 then proves MSBuild evaluates Release `LinkIncremental` as empty on both native Windows architectures, so the diagnostic fails closed before staging while all four POSIX controls remain reproducible and upload; this disproves the assumed boolean property oracle and does not authorize `/INCREMENTAL:NO`; the replacement post-build linker-command tracking gate is locally bounded and green under E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001, and the next exact-head run must prove its native record shape and allowlisted switch summary before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -169,11 +169,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `36a19f525` plus its evidence-ledger head
- and rerun all six target-native cells. Require both Windows clean builds to report the same
- evaluated `LinkIncremental` state before considering one copied-artifact producer correction.
- Preserve all five controls, strict comparison, rejected-arm64 no-upload, the repository-wide
- node-pty patch, legacy/default path, and every other release gate.
+- Next required action: replace the empty-property oracle with a bounded parser for the actual
+ post-build MSBuild linker-command tracking record, then rerun all six target-native cells. Require
+ both Windows clean builds to report the same allowlisted linker-switch summary before considering
+ one copied-artifact producer correction. Preserve strict comparison, no rejected upload, the
+ repository-wide node-pty patch, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -690,14 +690,21 @@ disassembly proves each 16-byte function thunk has byte-identical `adrp x16`, `a
`br x16` instructions; only the unreachable fourth instruction changes from `udf #0x24d` to
`udf #0x16d` (E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001).
-**In progress — 2026-07-14, Codex implementation owner:** classify the linker-owned thunk producer
-before changing it. Add a bounded generated-project diagnostic for the exact Release
-`LinkIncremental` state while retaining the existing architecture, option, cardinality, strict
-comparison, and no-upload gates. The thunk layout is consistent with an incremental-link table, but
-that setting is not yet proved on the native runner. Exact implementation commit `36a19f525` is
-locally red/green and passes the complete artifact/static gate under
-E-M3-WINDOWS-LINK-INCREMENTAL-DIAGNOSTIC-LOCAL-001. Do not normalize rejected bytes, weaken the
-comparator, modify repository-wide node-pty, or connect a production consumer.
+Exact-head run 29359948742 proves `MSBuild.exe -getProperty:LinkIncremental` returns an empty value
+after each native Windows build. The strict parser rejects that value before staging on x64 and
+arm64; all four POSIX controls compare exactly and upload, and neither Windows job uploads. This is
+valid negative evidence under E-M3-WINDOWS-LINK-INCREMENTAL-CI-RED-001, but an unset evaluated
+property does not classify the actual linker command or authorize a producer change.
+
+**In progress — 2026-07-14, Codex implementation owner:** the disproved property oracle is replaced
+locally by a bounded, post-build parser for the target's actual MSBuild linker-command tracking
+record under E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001. The file read is capped at 256 KiB plus
+one rejection byte; logs contain only an allowlisted summary of `/INCREMENTAL`, `/GUARD`, `/DEBUG`,
+`/OPT`, `/Brepro`, and `/experimental:deterministic` switches; missing, duplicate, oversized,
+malformed, or ambiguous inputs fail before staging. The active gate is the exact-head six-cell
+native run. Retain the existing architecture, generated-option, strict comparison, and no-upload
+gates. Do not normalize bytes, change the producer, modify repository-wide node-pty, or connect a
+production consumer.
Each runtime must contain only the executable closure required by the relay.
@@ -1302,16 +1309,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; arm64 linker-thunk producer diagnostic active | `e1a63930b`; E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native linker-command tracking gate pending | `e1a63930b`; E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -5096,23 +5103,176 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
require both Windows clean builds to report `linkIncremental` before changing the producer.
+### E-M3-WINDOWS-LINK-INCREMENTAL-CI-RED-001 — Native property oracle is empty and fails closed
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `2d4433bbd0d2481d3f91c56d10155989cd6e7e44`, containing exact
+ diagnostic implementation commit `36a19f525cc63e488f49daa5c3a6aafc590acc08`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29359948742](https://github.com/stablyai/orca/actions/runs/29359948742),
+ conclusion `failure`; macOS x64 `87177167723` success, Linux x64 `87177167732` success, Windows
+ x64 `87177167740` expected diagnostic failure, Windows arm64 `87177167757` expected diagnostic
+ failure, macOS arm64 `87177167776` success, and Linux arm64 `87177167801` success
+- Runners: GitHub-hosted Windows x64 used `windows-2022` / `win22` `20260706.237.1`, native X64;
+ Windows arm64 used `windows-11-arm` / `win11-arm64` `20260706.102.1`, native ARM64. Both recorded
+ Node v24.18.0 and exact source head `2d4433bbd`. The four POSIX cells used the same target-native
+ labels as E-M3-WINDOWS-ARM64-THUNK-DISASSEMBLY-CI-RED-001.
+- Remote and transport: none; target-native artifact assembly, strict pre-staging diagnostic, and
+ unpublished Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29359948742 --repo stablyai/orca \
+ --json headSha,status,conclusion,url,createdAt,updatedAt,jobs
+ gh api repos/stablyai/orca/actions/jobs/87177167740/logs
+ gh api repos/stablyai/orca/actions/jobs/87177167757/logs
+ gh api 'repos/stablyai/orca/actions/runs/29359948742/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended diagnostic boundary. Each native Windows job completes the first
+ copied node-pty build and validates the generated Release compiler/linker option blocks. The
+ subsequent `MSBuild.exe -getProperty:LinkIncremental` query exits zero but writes only an empty
+ value. The strict parser rejects it with `unexpected LinkIncremental evaluation from MSBuild`
+ before runtime staging, archive creation, verification, smoke, comparison, or upload. This
+ proves the property oracle is not usable and does not prove that incremental linking is enabled
+ or disabled.
+- Uploaded controls: exactly four unpublished seven-day POSIX artifacts and no Windows artifacts:
+ Linux x64 `8321792649`, 29,280,250 bytes,
+ `sha256:81b21c5f0670cd0337a9b8c666a154c474f52780d19d745497e25bbe69adcfe3`; Linux arm64
+ `8321797660`, 28,211,154 bytes,
+ `sha256:deca7d86e20442287878c6d17f6d533ba6be626dd7ff765f7cd841986272ffc8`; macOS x64
+ `8321944562`, 26,386,865 bytes,
+ `sha256:045573de326e8f9532ac31d5449f4aed4a201bbf152c98d971aa761c76e5ec37`; and macOS arm64
+ `8321811571`, 24,727,700 bytes,
+ `sha256:8fc66890341f548671ec15d0875186ca5ea128cb1ea959a2a69cacc14b9c0864`.
+- Duration and resource metrics: jobs ran 9m08s macOS x64, 3m13s Linux x64, 2m50s Windows x64,
+ 6m31s Windows arm64, 3m56s macOS arm64, and 3m21s Linux arm64. Both Windows failures occur after
+ one native build but before runtime smoke, so no new Windows RSS, channel/file count,
+ cancellation, or fallback metric exists.
+- Artifact/log/trace link: run/jobs and the four unpublished POSIX artifacts above; no Windows
+ runtime or binary was staged or uploaded
+- Oracle proved: both native Windows architectures return an empty evaluated Release
+ `LinkIncremental` property and the bounded diagnostic rejects it before staging. All four POSIX
+ controls remain reproducible and upload.
+- Does not prove: the actual linker command, whether `/INCREMENTAL` was passed, the thunk owner, a
+ safe producer correction, Windows runtime equality, oldest baselines, native trust, SSH,
+ publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native negative property-oracle evidence only; no tuple or production
+ checkbox.
+- Follow-up: inspect the actual post-build `link.command.1.tlog` under a byte cap, emit only an
+ allowlisted switch summary, and retain all existing strict comparison/no-upload controls.
+
+### E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 — Bounded native linker-command gate
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
+ the exact implementation SHA in the immediate documentation evidence head after commit; stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot generate the native MSBuild tracking file, so Windows x64/arm64 jobs remain authoritative.
+- Remote and transport: none; bounded local file/parser and builder-ordering contracts only
+- Exact red commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ ```
+
+- Red result: the pre-implementation purpose suite failed two and passed four tests because the
+ tracking-path/parser contracts did not exist. The later bounded-reader audit deliberately added
+ malformed UTF-16 input and failed one of eleven tests because `Buffer.toString('utf16le')`
+ preserved a lone surrogate instead of rejecting it. Fatal `TextDecoder` decoding closed that
+ gap; the audit red run took 0.99 s wall with 131,973,120-byte maximum RSS and
+ 96,196,032-byte peak memory footprint.
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ node --check config/scripts/ssh-relay-node-pty-build.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Green result: PASS. The purpose suites pass 11/11 tests and all 15 artifact suites pass 56/56.
+ Syntax checks, typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, and diff checks exit zero. Full lint emits only
+ pre-existing warnings outside this artifact package.
+- Duration and resource metrics: purpose gate 0.89 s wall / 166 ms Vitest with 132,513,792-byte
+ maximum RSS and 96,720,296-byte peak footprint; complete artifact gate 1.35 s wall / 550 ms Vitest
+ with 137,068,544-byte maximum RSS and 95,819,104-byte peak footprint; typecheck 3.10 s, focused
+ lint 0.34 s, max-lines 2.01 s, full lint 10.89 s, and format 2.24 s. No SSH channels/files,
+ cancellation, fallback, or runtime latency is exercised by this diagnostic-only package.
+- Artifact/log/trace link: current exact source/tests and local command output; no runtime artifact
+ was created, staged, published, or uploaded
+- Oracle proved: the builder locates the target-specific post-build
+ `conpty_console_list.tlog/link.command.1.tlog`, reads at most 256 KiB plus one rejection byte,
+ accepts fatal UTF-16LE-BOM or UTF-8 decoding, requires exactly one command record and one each of
+ `/Brepro`, `/guard:cf`, and `/experimental:deterministic`, classifies incremental linking as
+ enabled/disabled/unspecified, and emits only the allowlisted switch summary. Oversize, malformed
+ encoding/switches, duplicate records/switches, ambiguous incremental states, and missing required
+ switches fail before runtime staging. POSIX paths create no tracking-file lookup.
+- Does not prove: the file path/encoding/record shape on either native Windows runner, the emitted
+ switch summary, the incremental-link state, thunk ownership, a safe producer correction, arm64
+ equality, oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled
+ tuple.
+- Checklist items satisfied: local bounded post-build tracking diagnostic only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
+ require both Windows clean builds to emit the same accepted summary before changing the producer.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five native cells pass; arm64 builds and executes twice but strict comparison rejects linker-thunk drift | Toolchain drift may change native content IDs | Codex implementation owner | Prove the generated incremental-link state, apply only an evidenced producer correction, then make all six clean builds match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ------------------------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Five native cells pass; bounded linker-command gate awaits native output | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual linker-command state, apply only an evidenced producer correction, then make all six clean builds match without weakening the oracle | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -5153,11 +5313,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `36a19f525` plus its evidence-ledger head, then rerun both Windows
-architectures and all four POSIX controls. Require both Windows clean builds to report the same
-evaluated `LinkIncremental` setting. Only if that target-native evidence classifies the 2,879
-function thunks may one copied-artifact producer correction be considered; retain strict
-comparison, all five controls, and rejected-arm64 no-upload.
+Commit and push the bounded, purpose-tested post-build MSBuild linker-command tracking gate, then
+rerun both Windows architectures and all four POSIX controls at the exact head. Require both
+Windows clean builds to report the same allowlisted switch summary. Only if that target-native
+evidence classifies the 2,879 function thunks may one copied-artifact producer correction be
+considered; retain strict comparison and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From dafca2060f2daf4ba27b54a0eb18bb9700136f5b Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:23:58 -0400
Subject: [PATCH 045/267] docs(ssh): record linker tracking gate evidence
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 4aaf408a73b..9511863372f 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 then proves MSBuild evaluates Release `LinkIncremental` as empty on both native Windows architectures, so the diagnostic fails closed before staging while all four POSIX controls remain reproducible and upload; this disproves the assumed boolean property oracle and does not authorize `/INCREMENTAL:NO`; the replacement post-build linker-command tracking gate is locally bounded and green under E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001, and the next exact-head run must prove its native record shape and allowlisted switch summary before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 then proves MSBuild evaluates Release `LinkIncremental` as empty on both native Windows architectures, so the diagnostic fails closed before staging while all four POSIX controls remain reproducible and upload; this disproves the assumed boolean property oracle and does not authorize `/INCREMENTAL:NO`; exact implementation commit `4a66435b7` replaces it with a locally bounded post-build linker-command tracking gate under E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001, and the next exact-head run must prove its native record shape and allowlisted switch summary before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -1313,7 +1313,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native linker-command tracking gate pending | `e1a63930b`; E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native linker-command tracking gate pending | `4a66435b7`; E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -5165,9 +5165,9 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
### E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 — Bounded native linker-command gate
- Date: 2026-07-14
-- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
- the exact implementation SHA in the immediate documentation evidence head after commit; stacked
- draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Commit SHA / PR: exact implementation commit
+ `4a66435b71b158624645c614543d139a9ea45d51`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
cannot generate the native MSBuild tracking file, so Windows x64/arm64 jobs remain authoritative.
- Remote and transport: none; bounded local file/parser and builder-ordering contracts only
@@ -5313,11 +5313,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit and push the bounded, purpose-tested post-build MSBuild linker-command tracking gate, then
-rerun both Windows architectures and all four POSIX controls at the exact head. Require both
-Windows clean builds to report the same allowlisted switch summary. Only if that target-native
-evidence classifies the 2,879 function thunks may one copied-artifact producer correction be
-considered; retain strict comparison and rejected-output no-upload.
+Push exact implementation commit `4a66435b7` plus its evidence-ledger head, then rerun both Windows
+architectures and all four POSIX controls at the exact head. Require both Windows clean builds to
+report the same allowlisted switch summary. Only if that target-native evidence classifies the
+2,879 function thunks may one copied-artifact producer correction be considered; retain strict
+comparison and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 6198f0ddd5b31704ab72902e9a21e78412da870d Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:38:24 -0400
Subject: [PATCH 046/267] build(ssh): discover native linker tracking record
Co-authored-by: Orca
---
config/scripts/ssh-relay-node-pty-build.mjs | 8 +-
...lay-node-pty-windows-build-determinism.mjs | 78 +++++--
...ode-pty-windows-build-determinism.test.mjs | 117 +++++++---
...github-release-implementation-checklist.md | 209 +++++++++++++++---
4 files changed, 330 insertions(+), 82 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-build.mjs b/config/scripts/ssh-relay-node-pty-build.mjs
index 59f0b06f369..f41e1c04b19 100644
--- a/config/scripts/ssh-relay-node-pty-build.mjs
+++ b/config/scripts/ssh-relay-node-pty-build.mjs
@@ -8,8 +8,7 @@ import { applyWindowsNodePtySettlement } from './ssh-relay-node-pty-windows-sett
import {
applyWindowsNodePtyBuildDeterminism,
assertWindowsNodePtyGeneratedBuildSettings,
- inspectWindowsNodePtyLinkCommandTracking,
- windowsNodePtyLinkCommandTrackingPath
+ inspectWindowsNodePtyLinkCommandTracking
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const require = createRequire(import.meta.url)
@@ -194,12 +193,11 @@ export async function buildPatchedSshRelayNodePty({
tuple
})
if (generatedSettings) {
- const trackingPath = windowsNodePtyLinkCommandTrackingPath({
+ // Why: MSBuild tracking layout differs by runner, so selection is bounded by target content.
+ const linkCommand = await inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: buildDirectory,
tuple
})
- // Why: an unset property cannot classify ARM64 thunks; the post-build command is authoritative.
- const linkCommand = await inspectWindowsNodePtyLinkCommandTracking(trackingPath)
process.stdout.write(
`windows_node_pty_msbuild_settings=${JSON.stringify({
...generatedSettings,
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index 1df9fca9a5e..1bb093f59f3 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -1,4 +1,4 @@
-import { open, readFile, writeFile } from 'node:fs/promises'
+import { open, readFile, readdir, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
const COMPILER_OPTIONS = ` 'VCCLCompilerTool': {
@@ -43,6 +43,10 @@ const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
const REQUIRED_GENERATED_OPTIONS = ['/Brepro', '/experimental:deterministic']
const MAX_LINK_COMMAND_TRACKING_BYTES = 256 * 1024
+const MAX_LINK_COMMAND_TRACKING_CANDIDATES = 32
+const MAX_LINK_COMMAND_TRACKING_DEPTH = 8
+const MAX_LINK_COMMAND_TRACKING_ENTRIES = 10_000
+const TARGET_LINK_OUTPUT_PATTERN = /(?:^|[\\/:"'\s])conpty_console_list\.node(?=$|[\\/:"'\s])/i
function decodeXmlText(value) {
return value
@@ -127,21 +131,6 @@ export async function assertWindowsNodePtyGeneratedBuildSettings({ nodePtyDirect
}
}
-export function windowsNodePtyLinkCommandTrackingPath({ nodePtyDirectory, tuple }) {
- if (!tuple.startsWith('win32-')) {
- return undefined
- }
- return join(
- nodePtyDirectory,
- 'build',
- 'Release',
- 'obj',
- 'conpty_console_list',
- 'conpty_console_list.tlog',
- 'link.command.1.tlog'
- )
-}
-
async function readBoundedLinkCommandTracking(path) {
const handle = await open(path, 'r')
try {
@@ -161,6 +150,39 @@ async function readBoundedLinkCommandTracking(path) {
}
}
+async function discoverLinkCommandTracking(nodePtyDirectory) {
+ const queue = [{ depth: 0, path: join(nodePtyDirectory, 'build') }]
+ const candidates = []
+ let entries = 0
+ for (let index = 0; index < queue.length; index += 1) {
+ const current = queue[index]
+ const children = await readdir(current.path, { withFileTypes: true })
+ children.sort((left, right) => left.name.localeCompare(right.name))
+ for (const child of children) {
+ entries += 1
+ if (entries > MAX_LINK_COMMAND_TRACKING_ENTRIES) {
+ throw new Error('MSBuild linker tracking discovery exceeds the bounded entry count')
+ }
+ if (child.isSymbolicLink()) {
+ throw new Error('MSBuild linker tracking discovery rejects symbolic links')
+ }
+ const childPath = join(current.path, child.name)
+ if (child.isDirectory()) {
+ if (current.depth >= MAX_LINK_COMMAND_TRACKING_DEPTH) {
+ throw new Error('MSBuild linker tracking discovery exceeds the bounded depth')
+ }
+ queue.push({ depth: current.depth + 1, path: childPath })
+ } else if (child.isFile() && child.name.toLowerCase() === 'link.command.1.tlog') {
+ candidates.push(childPath)
+ if (candidates.length > MAX_LINK_COMMAND_TRACKING_CANDIDATES) {
+ throw new Error('MSBuild linker tracking discovery has too many candidates')
+ }
+ }
+ }
+ }
+ return { candidates, entries }
+}
+
function decodeLinkCommandTracking(bytes) {
if (bytes.length < 2 || bytes.length > MAX_LINK_COMMAND_TRACKING_BYTES) {
throw new Error('MSBuild linker tracking record is outside the bounded size')
@@ -230,6 +252,26 @@ export function parseWindowsNodePtyLinkCommandTracking(bytes) {
}
}
-export async function inspectWindowsNodePtyLinkCommandTracking(path) {
- return parseWindowsNodePtyLinkCommandTracking(await readBoundedLinkCommandTracking(path))
+export async function inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirectory, tuple }) {
+ if (!tuple.startsWith('win32-')) {
+ return undefined
+ }
+ const discovery = await discoverLinkCommandTracking(nodePtyDirectory)
+ const matching = []
+ for (const path of discovery.candidates) {
+ const bytes = await readBoundedLinkCommandTracking(path)
+ if (TARGET_LINK_OUTPUT_PATTERN.test(decodeLinkCommandTracking(bytes).text)) {
+ matching.push(bytes)
+ }
+ }
+ if (matching.length !== 1) {
+ throw new Error(
+ `MSBuild linker tracking discovery requires exactly one target command file (candidates=${discovery.candidates.length}, matches=${matching.length}, entries=${discovery.entries})`
+ )
+ }
+ return {
+ ...parseWindowsNodePtyLinkCommandTracking(matching[0]),
+ candidateFiles: discovery.candidates.length,
+ searchedEntries: discovery.entries
+ }
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 0d440eec041..6e9cdc48b12 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -8,8 +8,7 @@ import {
applyWindowsNodePtyBuildDeterminism,
assertWindowsNodePtyGeneratedBuildSettings,
inspectWindowsNodePtyLinkCommandTracking,
- parseWindowsNodePtyLinkCommandTracking,
- windowsNodePtyLinkCommandTrackingPath
+ parseWindowsNodePtyLinkCommandTracking
} from './ssh-relay-node-pty-windows-build-determinism.mjs'
const temporaryDirectories = []
@@ -90,22 +89,6 @@ describe('SSH relay Windows node-pty build determinism', () => {
})
it('parses one bounded UTF-16 linker command into an allowlisted switch summary', () => {
- expect(
- windowsNodePtyLinkCommandTrackingPath({
- nodePtyDirectory: 'C:\\artifact-node-pty',
- tuple: 'win32-arm64'
- })
- ).toBe(
- join(
- 'C:\\artifact-node-pty',
- 'build',
- 'Release',
- 'obj',
- 'conpty_console_list',
- 'conpty_console_list.tlog',
- 'link.command.1.tlog'
- )
- )
const command = [
'^C:\\artifact-node-pty\\build\\Release\\obj\\conpty_console_list.obj',
'/OUT:conpty_console_list.node /INCREMENTAL:NO /GUARD:CF /DEBUG:FULL',
@@ -128,12 +111,6 @@ describe('SSH relay Windows node-pty build determinism', () => {
'/opt:ref'
]
})
- expect(
- windowsNodePtyLinkCommandTrackingPath({
- nodePtyDirectory: '/not-used-on-posix',
- tuple: 'linux-arm64-glibc'
- })
- ).toBeUndefined()
})
it('rejects oversized, malformed, duplicate, or ambiguous linker tracking input', () => {
@@ -174,18 +151,96 @@ describe('SSH relay Windows node-pty build determinism', () => {
it('bounds linker tracking bytes while reading the generated file', async () => {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-tracking-'))
temporaryDirectories.push(directory)
- const trackingPath = join(directory, 'link.command.1.tlog')
+ const trackingPath = join(
+ directory,
+ 'build',
+ 'unexpected',
+ 'target.tlog',
+ 'link.command.1.tlog'
+ )
+ const otherPath = join(directory, 'build', 'other', 'link.command.1.tlog')
+ await mkdir(join(directory, 'build', 'unexpected', 'target.tlog'), { recursive: true })
+ await mkdir(join(directory, 'build', 'other'), { recursive: true })
await writeFile(
trackingPath,
- '^one\n/INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic'
+ '^one\n/OUT:conpty_console_list.node /INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic'
)
- await expect(inspectWindowsNodePtyLinkCommandTracking(trackingPath)).resolves.toMatchObject({
- incremental: 'disabled'
- })
+ await writeFile(otherPath, '^other\n/OUT:not_conpty_console_list.node /INCREMENTAL:NO')
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: directory,
+ tuple: 'win32-x64'
+ })
+ ).resolves.toMatchObject({ candidateFiles: 2, incremental: 'disabled' })
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: '/not-used-on-posix',
+ tuple: 'linux-arm64-glibc'
+ })
+ ).resolves.toBeUndefined()
await writeFile(trackingPath, Buffer.alloc(300_000))
- await expect(inspectWindowsNodePtyLinkCommandTracking(trackingPath)).rejects.toThrow(
- 'outside the bounded size'
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: directory,
+ tuple: 'win32-x64'
+ })
+ ).rejects.toThrow('outside the bounded size')
+ })
+
+ it('rejects missing or duplicate target linker tracking candidates', async () => {
+ const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-tracking-'))
+ temporaryDirectories.push(directory)
+ await mkdir(join(directory, 'build', 'first'), { recursive: true })
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: directory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow('exactly one target command file')
+ const command =
+ '^one\n/OUT:conpty_console_list.node /Brepro /GUARD:CF /experimental:deterministic'
+ await writeFile(join(directory, 'build', 'first', 'link.command.1.tlog'), command)
+ await mkdir(join(directory, 'build', 'second'), { recursive: true })
+ await writeFile(join(directory, 'build', 'second', 'link.command.1.tlog'), command)
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: directory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow('exactly one target command file')
+ })
+
+ it('rejects tracking discovery beyond its depth or candidate budgets', async () => {
+ const deepDirectory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-depth-'))
+ temporaryDirectories.push(deepDirectory)
+ await mkdir(
+ join(deepDirectory, 'build', ...Array.from({ length: 10 }, (_, index) => `${index}`)),
+ {
+ recursive: true
+ }
)
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: deepDirectory,
+ tuple: 'win32-x64'
+ })
+ ).rejects.toThrow('exceeds the bounded depth')
+
+ const wideDirectory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-candidates-'))
+ temporaryDirectories.push(wideDirectory)
+ await Promise.all(
+ Array.from({ length: 33 }, async (_, index) => {
+ const candidateDirectory = join(wideDirectory, 'build', `${index}`)
+ await mkdir(candidateDirectory, { recursive: true })
+ await writeFile(join(candidateDirectory, 'link.command.1.tlog'), '^candidate')
+ })
+ )
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: wideDirectory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow('too many candidates')
})
it('rejects missing, duplicate, non-inherited, or wrong-architecture generated settings', async () => {
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 9511863372f..dc58549f152 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 then proves MSBuild evaluates Release `LinkIncremental` as empty on both native Windows architectures, so the diagnostic fails closed before staging while all four POSIX controls remain reproducible and upload; this disproves the assumed boolean property oracle and does not authorize `/INCREMENTAL:NO`; exact implementation commit `4a66435b7` replaces it with a locally bounded post-build linker-command tracking gate under E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001, and the next exact-head run must prove its native record shape and allowlisted switch summary before any producer correction; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 then proves the locally assumed `link.command.1.tlog` path is absent after successful native compilation on both Windows architectures, so each fails closed before staging/upload while all four POSIX controls remain reproducible and upload; the bounded, target-matching tracking-file discovery correction is locally green under E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 and requires a new six-cell exact-head run; no evidence authorizes `/INCREMENTAL:NO` or any producer change; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -706,6 +706,19 @@ native run. Retain the existing architecture, generated-option, strict compariso
gates. Do not normalize bytes, change the producer, modify repository-wide node-pty, or connect a
production consumer.
+Exact-head run 29361673339 proves the assumed fixed tracking path is absent on both native Windows
+architectures after the target compiles successfully. The active correction must discover
+`link.command.1.tlog` candidates under a bounded build-tree entry/depth/cardinality budget, select
+exactly one whose bounded decoded record names `conpty_console_list.node`, and retain the existing
+strict parser and no-upload boundary. It must not log command contents or authorize a producer
+change (E-M3-WINDOWS-LINK-COMMAND-PATH-CI-RED-001).
+
+The bounded discovery correction is locally green under
+E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001: it scans at most 10,000 entries and eight levels,
+rejects symbolic links and more than 32 tracking candidates, reads each candidate under the
+existing 256 KiB cap, and requires exactly one exact target-output match before strict parsing. The
+active gate is now a new exact-head native run; no producer change is authorized locally.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1309,16 +1322,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native linker-command tracking gate pending | `4a66435b7`; E-M3-WINDOWS-LINK-COMMAND-TRACKING-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target-record discovery pending | E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -5256,23 +5269,162 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
- Follow-up: push the exact implementation and ledger head, run all six target-native cells, and
require both Windows clean builds to emit the same accepted summary before changing the producer.
+### E-M3-WINDOWS-LINK-COMMAND-PATH-CI-RED-001 — Native fixed tracking path is absent
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `dafca2060f2daf4ba27b54a0eb18bb9700136f5b`, containing exact
+ tracking implementation commit `4a66435b71b158624645c614543d139a9ea45d51`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29361673339](https://github.com/stablyai/orca/actions/runs/29361673339),
+ conclusion `failure`; macOS arm64 `87183054190` success, Linux arm64 `87183054293` success,
+ Windows arm64 `87183054295` expected diagnostic failure, macOS x64 `87183054306` success, Linux
+ x64 `87183054310` success, and Windows x64 `87183054318` expected diagnostic failure
+- Runners: GitHub-hosted Windows x64 used `windows-2022` / `win22` `20260706.237.1`, native X64;
+ Windows arm64 used `windows-11-arm64` / `win11-arm64` `20260706.102.1`, native ARM64. Both used
+ runner `2.335.1`, Node v24.18.0, MSVC 14.44.35207, and exact source head `dafca2060`. The four
+ POSIX controls used their previously recorded target-native labels.
+- Remote and transport: none; target-native artifact assembly, strict pre-staging diagnostic, and
+ unpublished Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29361673339 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87183054318/logs
+ gh api repos/stablyai/orca/actions/jobs/87183054295/logs
+ gh api 'repos/stablyai/orca/actions/runs/29361673339/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended diagnostic boundary. Each Windows job successfully compiles
+ `conpty_console_list.node` for its native architecture, then the bounded reader receives `ENOENT`
+ for the locally assumed fixed `build/Release/obj/conpty_console_list/conpty_console_list.tlog/`
+ `link.command.1.tlog` location. Both jobs fail before runtime staging, verification, smoke,
+ comparison, or upload. This proves only that the fixed path is wrong; it does not show whether a
+ target-matching tracking file exists elsewhere.
+- Uploaded controls: exactly four unpublished seven-day POSIX artifacts and no Windows artifacts:
+ Linux x64 `8322467354`, 29,282,467 bytes,
+ `sha256:75a29015224b0dd96e479f94d362be7023af0263373192332488ca4cc30647ae`; Linux arm64
+ `8322477826`, 28,215,101 bytes,
+ `sha256:07e9be64b1ab7fd2a9ebf9a30672bd275c670d5f0c95bd624b933d3bc870515e`; macOS x64
+ `8322529916`, 26,372,643 bytes,
+ `sha256:a0c3fdd314b19b0f371b5ea88eb862dfe335a785506b8011f8fde915f1323b1c`; and macOS arm64
+ `8322474835`, 24,749,773 bytes,
+ `sha256:11ddd1291e7b104edae6e54d18ab44a20a90aa28a29ed3d2bd92e2f3202d215c`.
+- Duration and resource metrics: jobs ran 3m25s macOS arm64, 3m27s Linux arm64, 6m40s Windows
+ arm64, 5m37s macOS x64, 3m06s Linux x64, and 3m00s Windows x64. Both Windows failures occur
+ after one native compile but before runtime smoke; no new Windows RSS, channel/file count,
+ cancellation, or fallback metric exists.
+- Artifact/log/trace link: run/jobs and the four unpublished POSIX artifacts above; no Windows
+ runtime or rejected binary was staged or uploaded
+- Oracle proved: both native Windows architectures share the same absent fixed tracking path while
+ the target native build itself completes; all four POSIX controls remain reproducible and upload;
+ rejected Windows output remains unavailable to consumers.
+- Does not prove: the actual tracking-file path, candidate cardinality, command record shape,
+ allowlisted switch summary, incremental-link state, thunk ownership, a safe producer correction,
+ Windows runtime equality, oldest baselines, native trust, SSH, publication, transfer, fallback,
+ UI, or any enabled tuple.
+- Checklist items satisfied: native negative path-shape evidence only; no tuple or production
+ checkbox.
+- Follow-up: replace the false fixed-path assumption with bounded build-tree discovery that requires
+ exactly one target-matching `link.command.1.tlog`, then rerun all six native cells without
+ weakening parsing, comparison, or no-upload controls.
+
+### E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 — Bounded target-matching discovery
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
+ the exact implementation SHA in the immediate documentation evidence head after commit; stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot generate the native MSBuild tree, so Windows x64/arm64 jobs remain authoritative.
+- Remote and transport: none; bounded build-tree discovery, target selection, and builder-ordering
+ contracts only
+- Red evidence: E-M3-WINDOWS-LINK-COMMAND-PATH-CI-RED-001 on both native Windows architectures;
+ no synthetic local failure is substituted for that real path-shape evidence
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ node --check config/scripts/ssh-relay-node-pty-build.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Green result: PASS. The purpose suites pass 13/13 tests and all 15 artifact suites pass 58/58.
+ Syntax checks, typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, and diff checks exit zero. Full lint emits only
+ pre-existing warnings outside this artifact package.
+- Duration and resource metrics: focused purpose gate 1.03 s wall / 227 ms Vitest with
+ 131,825,664-byte maximum RSS and 95,999,352-byte peak footprint; complete artifact gate 2.96 s
+ wall / 1.36 s Vitest; typecheck 3.08 s, focused lint 0.66 s, max-lines 1.47 s, and full lint
+ 13.87 s. The final full artifact run was parallel with static gates, so its process RSS was not
+ isolated. No SSH channels/files, cancellation, fallback, or runtime latency is exercised.
+- Artifact/log/trace link: current exact source/tests and local command output; no runtime artifact
+ was created, staged, published, or uploaded
+- Oracle proved: discovery is deterministic and bounded to 10,000 build-tree entries, depth eight,
+ and 32 exact-name candidates; symbolic links fail closed; each candidate read remains bounded;
+ target selection requires exactly one token-bounded `conpty_console_list.node` output rather than
+ a lookalike or path assumption. Missing/duplicate targets, excessive depth/cardinality, oversized
+ bytes, malformed contents, and all existing strict-parser failures settle before staging. POSIX
+ performs no discovery.
+- Does not prove: that either native Windows tree contains a candidate, candidate cardinality on the
+ runners, the actual record shape, allowlisted switch summary, incremental-link state, thunk
+ ownership, a safe producer correction, arm64 equality, oldest baselines, native trust, SSH,
+ publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local bounded tracking discovery only; no tuple or production checkbox.
+- Follow-up: push the exact implementation and ledger head, rerun all six target-native cells, and
+ require both Windows clean builds to select one target record and emit the same accepted summary
+ before changing the producer.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ------------------------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five native cells pass; bounded linker-command gate awaits native output | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual linker-command state, apply only an evidenced producer correction, then make all six clean builds match without weakening the oracle | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Four POSIX controls pass; bounded target-record discovery is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual target linker command natively, then apply only an evidenced producer correction and make all six clean builds match | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -5313,11 +5465,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `4a66435b7` plus its evidence-ledger head, then rerun both Windows
-architectures and all four POSIX controls at the exact head. Require both Windows clean builds to
-report the same allowlisted switch summary. Only if that target-native evidence classifies the
-2,879 function thunks may one copied-artifact producer correction be considered; retain strict
-comparison and rejected-output no-upload.
+Commit and push the bounded build-tree discovery that requires exactly one `link.command.1.tlog`
+whose bounded decoded record names `conpty_console_list.node`, then rerun both Windows architectures
+and all four POSIX controls at the exact head. Require both Windows clean builds to report the same
+allowlisted switch summary. Only if that target-native evidence classifies the 2,879 function
+thunks may one copied-artifact producer correction be considered; retain strict parsing/comparison
+and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From f9a49d53123b27b19713eadef927de1102ec08de Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:39:37 -0400
Subject: [PATCH 047/267] docs(ssh): record native tracking discovery gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 21 +++++++++----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index dc58549f152..91c4b61cb72 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 then proves the locally assumed `link.command.1.tlog` path is absent after successful native compilation on both Windows architectures, so each fails closed before staging/upload while all four POSIX controls remain reproducible and upload; the bounded, target-matching tracking-file discovery correction is locally green under E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 and requires a new six-cell exact-head run; no evidence authorizes `/INCREMENTAL:NO` or any producer change; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 then proves the locally assumed `link.command.1.tlog` path is absent after successful native compilation on both Windows architectures, so each fails closed before staging/upload while all four POSIX controls remain reproducible and upload; exact implementation commit `6198f0ddd` adds bounded, target-matching tracking-file discovery and is locally green under E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001; the next six-cell exact-head run remains required, and no evidence authorizes `/INCREMENTAL:NO` or any producer change; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -1326,7 +1326,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target-record discovery pending | E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target-record discovery pending | `6198f0ddd`; E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -5332,9 +5332,9 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
### E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 — Bounded target-matching discovery
- Date: 2026-07-14
-- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
- the exact implementation SHA in the immediate documentation evidence head after commit; stacked
- draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Commit SHA / PR: exact implementation commit
+ `6198f0ddd5b31704ab72902e9a21e78412da870d`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
cannot generate the native MSBuild tree, so Windows x64/arm64 jobs remain authoritative.
- Remote and transport: none; bounded build-tree discovery, target selection, and builder-ordering
@@ -5465,12 +5465,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit and push the bounded build-tree discovery that requires exactly one `link.command.1.tlog`
-whose bounded decoded record names `conpty_console_list.node`, then rerun both Windows architectures
-and all four POSIX controls at the exact head. Require both Windows clean builds to report the same
-allowlisted switch summary. Only if that target-native evidence classifies the 2,879 function
-thunks may one copied-artifact producer correction be considered; retain strict parsing/comparison
-and rejected-output no-upload.
+Push exact implementation commit `6198f0ddd` plus its evidence-ledger head, then rerun both Windows
+architectures and all four POSIX controls at the exact head. Require both Windows clean builds to
+select one target record and report the same allowlisted switch summary. Only if that target-native
+evidence classifies the 2,879 function thunks may one copied-artifact producer correction be
+considered; retain strict parsing/comparison and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 6f28a8cbf53d1cfe889ce259476eb4aaaead2d87 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:50:35 -0400
Subject: [PATCH 048/267] build(ssh): scope linker discovery to release output
Co-authored-by: Orca
---
...lay-node-pty-windows-build-determinism.mjs | 3 +-
...ode-pty-windows-build-determinism.test.mjs | 26 ++-
...github-release-implementation-checklist.md | 205 +++++++++++++++---
3 files changed, 196 insertions(+), 38 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index 1bb093f59f3..ff48d46764e 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -151,7 +151,8 @@ async function readBoundedLinkCommandTracking(path) {
}
async function discoverLinkCommandTracking(nodePtyDirectory) {
- const queue = [{ depth: 0, path: join(nodePtyDirectory, 'build') }]
+ // Why: generated dependency projects live elsewhere; only Release contains target link outputs.
+ const queue = [{ depth: 0, path: join(nodePtyDirectory, 'build', 'Release') }]
const candidates = []
let entries = 0
for (let index = 0; index < queue.length; index += 1) {
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 6e9cdc48b12..34505c908db 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -154,13 +154,16 @@ describe('SSH relay Windows node-pty build determinism', () => {
const trackingPath = join(
directory,
'build',
+ 'Release',
'unexpected',
'target.tlog',
'link.command.1.tlog'
)
- const otherPath = join(directory, 'build', 'other', 'link.command.1.tlog')
- await mkdir(join(directory, 'build', 'unexpected', 'target.tlog'), { recursive: true })
- await mkdir(join(directory, 'build', 'other'), { recursive: true })
+ const otherPath = join(directory, 'build', 'Release', 'other', 'link.command.1.tlog')
+ await mkdir(join(directory, 'build', 'Release', 'unexpected', 'target.tlog'), {
+ recursive: true
+ })
+ await mkdir(join(directory, 'build', 'Release', 'other'), { recursive: true })
await writeFile(
trackingPath,
'^one\n/OUT:conpty_console_list.node /INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic'
@@ -190,7 +193,7 @@ describe('SSH relay Windows node-pty build determinism', () => {
it('rejects missing or duplicate target linker tracking candidates', async () => {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-tracking-'))
temporaryDirectories.push(directory)
- await mkdir(join(directory, 'build', 'first'), { recursive: true })
+ await mkdir(join(directory, 'build', 'Release', 'first'), { recursive: true })
await expect(
inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: directory,
@@ -199,9 +202,9 @@ describe('SSH relay Windows node-pty build determinism', () => {
).rejects.toThrow('exactly one target command file')
const command =
'^one\n/OUT:conpty_console_list.node /Brepro /GUARD:CF /experimental:deterministic'
- await writeFile(join(directory, 'build', 'first', 'link.command.1.tlog'), command)
- await mkdir(join(directory, 'build', 'second'), { recursive: true })
- await writeFile(join(directory, 'build', 'second', 'link.command.1.tlog'), command)
+ await writeFile(join(directory, 'build', 'Release', 'first', 'link.command.1.tlog'), command)
+ await mkdir(join(directory, 'build', 'Release', 'second'), { recursive: true })
+ await writeFile(join(directory, 'build', 'Release', 'second', 'link.command.1.tlog'), command)
await expect(
inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: directory,
@@ -214,7 +217,12 @@ describe('SSH relay Windows node-pty build determinism', () => {
const deepDirectory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-depth-'))
temporaryDirectories.push(deepDirectory)
await mkdir(
- join(deepDirectory, 'build', ...Array.from({ length: 10 }, (_, index) => `${index}`)),
+ join(
+ deepDirectory,
+ 'build',
+ 'Release',
+ ...Array.from({ length: 10 }, (_, index) => `${index}`)
+ ),
{
recursive: true
}
@@ -230,7 +238,7 @@ describe('SSH relay Windows node-pty build determinism', () => {
temporaryDirectories.push(wideDirectory)
await Promise.all(
Array.from({ length: 33 }, async (_, index) => {
- const candidateDirectory = join(wideDirectory, 'build', `${index}`)
+ const candidateDirectory = join(wideDirectory, 'build', 'Release', `${index}`)
await mkdir(candidateDirectory, { recursive: true })
await writeFile(join(candidateDirectory, 'link.command.1.tlog'), '^candidate')
})
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 91c4b61cb72..3ee01a6e21b 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 then proves the locally assumed `link.command.1.tlog` path is absent after successful native compilation on both Windows architectures, so each fails closed before staging/upload while all four POSIX controls remain reproducible and upload; exact implementation commit `6198f0ddd` adds bounded, target-matching tracking-file discovery and is locally green under E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001; the next six-cell exact-head run remains required, and no evidence authorizes `/INCREMENTAL:NO` or any producer change; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 proves the locally assumed fixed tracking path is absent; exact-head run 29362672415 then proves both native Windows builds fail closed because bounded discovery from the entire generated `build` tree reaches unrelated dependency depth, while all four POSIX controls remain reproducible and upload; the narrow `build/Release` output-tree correction is locally green under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 and requires a new six-cell exact-head run; no evidence authorizes changing a bound, producer, comparator, or default path; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -719,6 +719,19 @@ rejects symbolic links and more than 32 tracking candidates, reads each candidat
existing 256 KiB cap, and requires exactly one exact target-output match before strict parsing. The
active gate is now a new exact-head native run; no producer change is authorized locally.
+Exact-head run 29362672415 proves both native Windows builds reach the discovery gate after target
+compilation but reject because scanning from the entire generated `build` tree encounters unrelated
+dependency directories beyond depth eight. All four POSIX controls compare and upload. The active
+correction may narrow only the traversal root to `build/Release`, the output tree where both logs
+show MSBuild emitted `conpty_console_list.node`; every existing depth, entry, candidate, byte,
+encoding, target-cardinality, parser, comparator, and no-upload bound remains unchanged
+(E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-CI-RED-001).
+
+The correction now scopes the same bounded discovery to `build/Release` only and is locally green
+under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001. No budget, parser, producer, comparison,
+staging, upload, legacy, or production behavior changed. The active gate is another exact-head
+six-cell native run.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1322,16 +1335,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target-record discovery pending | `6198f0ddd`; E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native Release-tree discovery pending | E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -5408,23 +5421,158 @@ configuration` before runtime staging, verification, smoke, comparison, or diagn
require both Windows clean builds to select one target record and emit the same accepted summary
before changing the producer.
+### E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-CI-RED-001 — Whole build tree exceeds depth bound
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `f9a49d53123b27b19713eadef927de1102ec08de`, containing exact
+ discovery implementation commit `6198f0ddd5b31704ab72902e9a21e78412da870d`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29362672415](https://github.com/stablyai/orca/actions/runs/29362672415),
+ conclusion `failure`; Windows x64 `87186432938` expected diagnostic failure, Windows arm64
+ `87186432948` expected diagnostic failure, macOS arm64 `87186432965` success, Linux arm64
+ `87186432979` success, Linux x64 `87186432980` success, and macOS x64 `87186433013` success
+- Runners: GitHub-hosted Windows x64 and arm64 used the same native labels, images, runner, Node,
+ and MSVC versions recorded by E-M3-WINDOWS-LINK-COMMAND-PATH-CI-RED-001; exact source head was
+ `f9a49d531`. The four POSIX controls used their previously recorded target-native labels.
+- Remote and transport: none; target-native artifact assembly, bounded build-tree discovery, and
+ unpublished Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29362672415 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87186432938/logs
+ gh api repos/stablyai/orca/actions/jobs/87186432948/logs
+ gh api 'repos/stablyai/orca/actions/runs/29362672415/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended discovery boundary. Each Windows job successfully compiles the
+ target and enters bounded discovery, then rejects with `MSBuild linker tracking discovery exceeds
+the bounded depth` before opening or parsing a candidate. Starting at the complete generated
+ `build` tree includes unrelated dependency/project subtrees; the evidence does not justify
+ raising the eight-level limit. Both logs show the target binary is emitted under `build/Release`,
+ which is the narrow output-tree root for the next correction.
+- Uploaded controls: exactly four unpublished seven-day POSIX artifacts and no Windows artifacts:
+ Linux x64 `8322871131`, 29,278,807 bytes,
+ `sha256:b11ceb6bd42d28d379d32b3627a242f60cf62f78e9a7267589220ce7737b9c63`; Linux arm64
+ `8322874205`, 28,209,038 bytes,
+ `sha256:f2195e1f4c03d1fb6507e32b5d5328a65f351c2c22b56a8144aa1c9449c3f733`; macOS x64
+ `8322934998`, 26,370,804 bytes,
+ `sha256:6fea712fd57b06cc93a7e8f0f3ebda4526307258be66ba901cd3fc190f7a03ed`; and macOS arm64
+ `8322879006`, 24,728,020 bytes,
+ `sha256:2407308e60002c5e735cd301f1f30e9754d5c383a18f36009d14f08085f1f577`.
+- Duration and resource metrics: jobs ran 2m58s Windows x64, 6m25s Windows arm64, 3m45s macOS
+ arm64, 3m25s Linux arm64, 3m22s Linux x64, and 5m56s macOS x64. Windows fails after one native
+ compile but before runtime smoke; no new Windows RSS, channel/file count, cancellation, or
+ fallback metric exists.
+- Artifact/log/trace link: run/jobs and four unpublished POSIX artifacts above; no Windows runtime
+ or rejected binary was staged or uploaded
+- Oracle proved: both native Windows architectures reach and enforce the same traversal-depth
+ bound; whole-build-tree discovery is too broad; the target output tree is `build/Release`; all
+ four POSIX controls remain reproducible and upload.
+- Does not prove: whether `build/Release` contains tracking candidates, candidate/target cardinality,
+ record shape, allowlisted switch summary, incremental-link state, thunk ownership, a safe producer
+ correction, Windows equality, oldest baselines, native trust, SSH, publication, transfer,
+ fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native negative discovery-root evidence only; no tuple or production
+ checkbox.
+- Follow-up: narrow the discovery root to `build/Release` without raising or removing any bound,
+ then rerun all six native cells and require exactly one target record on both Windows runners.
+
+### E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 — Release output-tree discovery scope
+
+- Date: 2026-07-14
+- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
+ the exact implementation SHA in the immediate documentation evidence head after commit; stacked
+ draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot generate the native MSBuild tree, so Windows x64/arm64 jobs remain authoritative.
+- Remote and transport: none; bounded discovery-root and builder-ordering contracts only
+- Red evidence: E-M3-WINDOWS-LINK-COMMAND-DISCOVERY-CI-RED-001 on both native Windows
+ architectures; no synthetic local failure substitutes for that real traversal-shape evidence
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ node --check config/scripts/ssh-relay-node-pty-build.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Green result: PASS. The purpose suites pass 13/13 tests and all 15 artifact suites pass 58/58.
+ Syntax checks, typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, and diff checks exit zero. Full lint emits only
+ pre-existing warnings outside this package.
+- Duration and resource metrics: focused purpose gate 1.26 s wall / 263 ms Vitest with
+ 131,710,976-byte maximum RSS and 95,868,256-byte peak footprint; complete artifact gate 4.01 s
+ wall / 1.92 s Vitest; typecheck 4.21 s, focused lint 0.90 s, max-lines 2.37 s, and full lint
+ 13.78 s. The final artifact run was parallel with static gates, so its process RSS was not
+ isolated. No SSH channels/files, cancellation, fallback, or runtime latency is exercised.
+- Artifact/log/trace link: current exact source/tests and local command output; no runtime artifact
+ was created, staged, published, or uploaded
+- Oracle proved: target discovery begins at `build/Release`, matching the exact native output tree
+ evidenced by both Windows logs; tests place valid, irrelevant, duplicate, oversized, deep, and
+ over-cardinality fixtures below that root. The existing entry/depth/candidate/byte, symbolic-link,
+ encoding, target-cardinality, strict-parser, and POSIX no-op contracts remain unchanged.
+- Does not prove: that either native Release tree contains a candidate, candidate/target
+ cardinality, record shape, allowlisted switch summary, incremental-link state, thunk ownership, a
+ safe producer correction, arm64 equality, oldest baselines, native trust, SSH, publication,
+ transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local Release-tree discovery scope only; no tuple or production
+ checkbox.
+- Follow-up: push the exact implementation and ledger head, rerun all six target-native cells, and
+ require both Windows clean builds to select one target record and emit the same accepted summary
+ before changing the producer.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Four POSIX controls pass; bounded target-record discovery is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual target linker command natively, then apply only an evidenced producer correction and make all six clean builds match | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Four POSIX controls pass; bounded Release-tree discovery is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual target linker command natively, then make all six clean builds match | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -5465,11 +5613,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `6198f0ddd` plus its evidence-ledger head, then rerun both Windows
-architectures and all four POSIX controls at the exact head. Require both Windows clean builds to
-select one target record and report the same allowlisted switch summary. Only if that target-native
-evidence classifies the 2,879 function thunks may one copied-artifact producer correction be
-considered; retain strict parsing/comparison and rejected-output no-upload.
+Commit and push the bounded `build/Release` output-tree discovery correction without raising any
+entry/depth/candidate/byte bound, then rerun both Windows architectures and all four POSIX controls.
+Require both Windows clean builds to select one target record and report the same allowlisted
+switch summary. Only if that target-native evidence classifies the 2,879 function thunks may one
+copied-artifact producer correction be considered; retain strict parsing/comparison and
+rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 2db46d91b17789ce70eed5e5e496dec2ff56442a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 15:51:18 -0400
Subject: [PATCH 049/267] docs(ssh): record release-tree discovery gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 21 +++++++++----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 3ee01a6e21b..df6c74d0a19 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 proves the locally assumed fixed tracking path is absent; exact-head run 29362672415 then proves both native Windows builds fail closed because bounded discovery from the entire generated `build` tree reaches unrelated dependency depth, while all four POSIX controls remain reproducible and upload; the narrow `build/Release` output-tree correction is locally green under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 and requires a new six-cell exact-head run; no evidence authorizes changing a bound, producer, comparator, or default path; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 proves the locally assumed fixed tracking path is absent; exact-head run 29362672415 then proves both native Windows builds fail closed because bounded discovery from the entire generated `build` tree reaches unrelated dependency depth, while all four POSIX controls remain reproducible and upload; exact implementation commit `6f28a8cbf` narrows discovery to the `build/Release` output tree and is locally green under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001; the next six-cell exact-head run remains required, and no evidence authorizes changing a bound, producer, comparator, or default path; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -1339,7 +1339,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native Release-tree discovery pending | E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native Release-tree discovery pending | `6f28a8cbf`; E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -5482,9 +5482,9 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
### E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 — Release output-tree discovery scope
- Date: 2026-07-14
-- Commit SHA / PR: implementation and ledger are in the current artifact-only checkpoint; record
- the exact implementation SHA in the immediate documentation evidence head after commit; stacked
- draft PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Commit SHA / PR: exact implementation commit
+ `6f28a8cbf53d1cfe889ce259476eb4aaaead2d87`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
cannot generate the native MSBuild tree, so Windows x64/arm64 jobs remain authoritative.
- Remote and transport: none; bounded discovery-root and builder-ordering contracts only
@@ -5613,12 +5613,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Commit and push the bounded `build/Release` output-tree discovery correction without raising any
-entry/depth/candidate/byte bound, then rerun both Windows architectures and all four POSIX controls.
-Require both Windows clean builds to select one target record and report the same allowlisted
-switch summary. Only if that target-native evidence classifies the 2,879 function thunks may one
-copied-artifact producer correction be considered; retain strict parsing/comparison and
-rejected-output no-upload.
+Push exact implementation commit `6f28a8cbf` plus its evidence-ledger head, then rerun both Windows
+architectures and all four POSIX controls. Require both Windows clean builds to select one target
+record and report the same allowlisted switch summary. Only if that target-native evidence
+classifies the 2,879 function thunks may one copied-artifact producer correction be considered;
+retain strict parsing/comparison and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From e7d9a1c8d3222ff5923679ad69b76b57d963c4f3 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:06:27 -0400
Subject: [PATCH 050/267] build(ssh): inspect Windows incremental database
Co-authored-by: Orca
---
...lay-node-pty-windows-build-determinism.mjs | 21 +++++++++-
...ode-pty-windows-build-determinism.test.mjs | 39 +++++++++++++------
2 files changed, 46 insertions(+), 14 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index ff48d46764e..bb2866a3734 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -1,4 +1,4 @@
-import { open, readFile, readdir, writeFile } from 'node:fs/promises'
+import { open, readFile, readdir, stat, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
const COMPILER_OPTIONS = ` 'VCCLCompilerTool': {
@@ -47,6 +47,7 @@ const MAX_LINK_COMMAND_TRACKING_CANDIDATES = 32
const MAX_LINK_COMMAND_TRACKING_DEPTH = 8
const MAX_LINK_COMMAND_TRACKING_ENTRIES = 10_000
const TARGET_LINK_OUTPUT_PATTERN = /(?:^|[\\/:"'\s])conpty_console_list\.node(?=$|[\\/:"'\s])/i
+const TARGET_INCREMENTAL_DATABASE = 'conpty_console_list.ilk'
function decodeXmlText(value) {
return value
@@ -154,6 +155,7 @@ async function discoverLinkCommandTracking(nodePtyDirectory) {
// Why: generated dependency projects live elsewhere; only Release contains target link outputs.
const queue = [{ depth: 0, path: join(nodePtyDirectory, 'build', 'Release') }]
const candidates = []
+ const incrementalDatabases = []
let entries = 0
for (let index = 0; index < queue.length; index += 1) {
const current = queue[index]
@@ -178,10 +180,15 @@ async function discoverLinkCommandTracking(nodePtyDirectory) {
if (candidates.length > MAX_LINK_COMMAND_TRACKING_CANDIDATES) {
throw new Error('MSBuild linker tracking discovery has too many candidates')
}
+ } else if (child.isFile() && child.name.toLowerCase() === TARGET_INCREMENTAL_DATABASE) {
+ incrementalDatabases.push(childPath)
+ if (incrementalDatabases.length > 1) {
+ throw new Error('MSBuild incremental database discovery has duplicate target files')
+ }
}
}
}
- return { candidates, entries }
+ return { candidates, entries, incrementalDatabases }
}
function decodeLinkCommandTracking(bytes) {
@@ -270,9 +277,19 @@ export async function inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirector
`MSBuild linker tracking discovery requires exactly one target command file (candidates=${discovery.candidates.length}, matches=${matching.length}, entries=${discovery.entries})`
)
}
+ // Why: /DEBUG can imply incremental linking without spelling /INCREMENTAL in the command record.
+ let incrementalDatabase = { state: 'absent' }
+ if (discovery.incrementalDatabases.length === 1) {
+ const bytes = (await stat(discovery.incrementalDatabases[0])).size
+ if (!Number.isSafeInteger(bytes) || bytes < 0) {
+ throw new Error('MSBuild incremental database has an invalid size')
+ }
+ incrementalDatabase = { bytes, state: 'present' }
+ }
return {
...parseWindowsNodePtyLinkCommandTracking(matching[0]),
candidateFiles: discovery.candidates.length,
+ incrementalDatabase,
searchedEntries: discovery.entries
}
}
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 34505c908db..2e48b2f1a38 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -151,30 +151,34 @@ describe('SSH relay Windows node-pty build determinism', () => {
it('bounds linker tracking bytes while reading the generated file', async () => {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-link-tracking-'))
temporaryDirectories.push(directory)
- const trackingPath = join(
- directory,
- 'build',
- 'Release',
- 'unexpected',
- 'target.tlog',
- 'link.command.1.tlog'
- )
- const otherPath = join(directory, 'build', 'Release', 'other', 'link.command.1.tlog')
- await mkdir(join(directory, 'build', 'Release', 'unexpected', 'target.tlog'), {
+ const releaseDirectory = join(directory, 'build', 'Release')
+ const trackingPath = join(releaseDirectory, 'unexpected', 'target.tlog', 'link.command.1.tlog')
+ const otherPath = join(releaseDirectory, 'other', 'link.command.1.tlog')
+ const incrementalPath = join(releaseDirectory, 'unexpected', 'conpty_console_list.ilk')
+ await mkdir(join(releaseDirectory, 'unexpected', 'target.tlog'), {
recursive: true
})
- await mkdir(join(directory, 'build', 'Release', 'other'), { recursive: true })
+ await mkdir(join(releaseDirectory, 'other'), { recursive: true })
await writeFile(
trackingPath,
'^one\n/OUT:conpty_console_list.node /INCREMENTAL:NO /Brepro /GUARD:CF /experimental:deterministic'
)
await writeFile(otherPath, '^other\n/OUT:not_conpty_console_list.node /INCREMENTAL:NO')
+ await writeFile(incrementalPath, Buffer.alloc(4096))
await expect(
inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: directory,
tuple: 'win32-x64'
})
- ).resolves.toMatchObject({ candidateFiles: 2, incremental: 'disabled' })
+ ).resolves.toMatchObject({
+ candidateFiles: 2,
+ incremental: 'disabled',
+ incrementalDatabase: { bytes: 4096, state: 'present' }
+ })
+ await rm(incrementalPath)
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirectory: directory, tuple: 'win32-x64' })
+ ).resolves.toMatchObject({ incrementalDatabase: { state: 'absent' } })
await expect(
inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: '/not-used-on-posix',
@@ -204,6 +208,17 @@ describe('SSH relay Windows node-pty build determinism', () => {
'^one\n/OUT:conpty_console_list.node /Brepro /GUARD:CF /experimental:deterministic'
await writeFile(join(directory, 'build', 'Release', 'first', 'link.command.1.tlog'), command)
await mkdir(join(directory, 'build', 'Release', 'second'), { recursive: true })
+ const firstIlk = join(directory, 'build', 'Release', 'first', 'conpty_console_list.ilk')
+ const secondIlk = join(directory, 'build', 'Release', 'second', 'conpty_console_list.ilk')
+ await writeFile(firstIlk, '')
+ await writeFile(secondIlk, '')
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({
+ nodePtyDirectory: directory,
+ tuple: 'win32-arm64'
+ })
+ ).rejects.toThrow('duplicate target files')
+ await Promise.all([rm(firstIlk), rm(secondIlk)])
await writeFile(join(directory, 'build', 'Release', 'second', 'link.command.1.tlog'), command)
await expect(
inspectWindowsNodePtyLinkCommandTracking({
From d1eca8a55dec3e96f9ecf1600e8e6e169cdfd3fe Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:08:12 -0400
Subject: [PATCH 051/267] docs(ssh): record incremental database gate
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 202 ++++++++++++++++--
1 file changed, 183 insertions(+), 19 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index df6c74d0a19..6dd5979f498 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run 29358223742 isolates 2,879 Windows arm64 linker-emitted 16-byte function thunks whose `adrp`/`add`/`br` control flow is byte-identical and whose unreachable fourth `udf` instruction differs, plus 68 derived `/Brepro` identity bytes; exact-head run 29359948742 disproves the empty `LinkIncremental` property oracle; exact-head run 29361673339 proves the locally assumed fixed tracking path is absent; exact-head run 29362672415 then proves both native Windows builds fail closed because bounded discovery from the entire generated `build` tree reaches unrelated dependency depth, while all four POSIX controls remain reproducible and upload; exact implementation commit `6f28a8cbf` narrows discovery to the `build/Release` output tree and is locally green under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001; the next six-cell exact-head run remains required, and no evidence authorizes changing a bound, producer, comparator, or default path; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run [29363423068](https://github.com/stablyai/orca/actions/runs/29363423068) at commit `2db46d91b` proves bounded `build/Release` discovery on both native Windows architectures: both clean builds select three tracking candidates, search 82 entries, select one target record, and report the same `/brepro`, `/debug`, `/experimental:deterministic`, `/guard:cf` summary with no explicit `/incremental` switch; Linux x64/arm64, macOS x64/arm64, and Windows x64 compare exactly and upload, while Windows arm64 retains the 2,879 linker-thunk mismatch and fails before upload under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-CI-RED-001; exact implementation commit `e7d9a1c8d` adds only a bounded target `.ilk` presence/size diagnostic and is locally green under E-M3-WINDOWS-INCREMENTAL-DATABASE-LOCAL-001; the next exact-head six-cell run is required before any producer change; no evidence authorizes changing a comparator, production/default path, or tuple state; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -732,6 +732,16 @@ under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001. No budget, parser, produ
staging, upload, legacy, or production behavior changed. The active gate is another exact-head
six-cell native run.
+Exact-head run 29363423068 proves the scoped discovery on both native Windows runners. Both clean
+builds on both architectures select three tracking candidates under 82 Release-tree entries and
+report the same allowlisted command summary: `/brepro`, `/debug`, `/experimental:deterministic`,
+and `/guard:cf`, with no explicit `/incremental` switch. Windows x64 and all four POSIX controls
+compare and upload; Windows arm64 still fails strict comparison at the same 2,879 linker thunks and
+uploads nothing (E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-CI-RED-001). Because `/DEBUG` may imply
+incremental linking without an explicit command switch, the next bounded diagnostic records only
+the exact target `.ilk` file's presence and size from the already bounded clean Release tree before
+any copied-artifact producer change.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1339,7 +1349,7 @@ Update status and evidence as work begins. Do not combine these into one large b
| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------- |
| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native Release-tree discovery pending | `6f28a8cbf`; E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-LOCAL-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target `.ilk` evidence pending | `e7d9a1c8d`; E-M3-WINDOWS-INCREMENTAL-DATABASE-LOCAL-001 |
| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
@@ -5556,23 +5566,177 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
require both Windows clean builds to select one target record and emit the same accepted summary
before changing the producer.
+### E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-CI-RED-001 — Native command classified; arm64 drift retained
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact head `2db46d91b17789ce70eed5e5e496dec2ff56442a`, containing exact
+ Release-root implementation commit `6f28a8cbf53d1cfe889ce259476eb4aaaead2d87`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29363423068](https://github.com/stablyai/orca/actions/runs/29363423068),
+ conclusion `failure`; Windows x64 `87188953411` success, Windows arm64 `87188953416` expected
+ strict-comparison failure, Linux arm64 `87188953471` success, Linux x64 `87188953495` success,
+ macOS x64 `87188953507` success, and macOS arm64 `87188953532` success
+- Runners: Windows x64 used `windows-2022` / `win22` `20260706.237.1`, native X64, Windows Server
+ 2022 build 20348; Windows arm64 used `windows-11-arm` / `win11-arm64` `20260706.102.1`, native
+ ARM64, Windows build 26200. Both used Node v24.18.0 and MSVC 14.44.35207 / compiler 19.44.35228.
+ Linux x64 used `ubuntu-24.04` / `ubuntu24` `20260705.232.1`; Linux arm64 used
+ `ubuntu-24.04-arm` / `ubuntu24-arm64` `20260706.52.2`; macOS x64 used `macos-15-intel` /
+ `macos15` `20260629.0276.1`; macOS arm64 used `macos-15` / `macos15` `20260706.0213.1`.
+ Every runner checked out the exact head above.
+- Remote and transport: none; target-native artifact assembly, strict comparison, and unpublished
+ seven-day Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29363423068 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87188953411/logs
+ gh api repos/stablyai/orca/actions/jobs/87188953416/logs
+ gh api 'repos/stablyai/orca/actions/runs/29363423068/artifacts?per_page=100'
+ ```
+
+- Result: FAIL as the intended strict reproducibility boundary. Each clean build on both Windows
+ architectures discovers three `link.command.1.tlog` candidates under 82 `build/Release` entries,
+ selects exactly one record naming `conpty_console_list.node`, and accepts fatal UTF-16LE input.
+ The two x64 records are 2,114 bytes and the two arm64 records are 2,092 bytes. All four report
+ `incremental: unspecified` and the identical allowlisted switches `/brepro`, `/debug`,
+ `/experimental:deterministic`, and `/guard:cf`; no explicit `/incremental` or `/opt` switch is
+ present. Windows x64 and all four POSIX jobs compare exactly. Windows arm64 builds, verifies, and
+ executes both candidates, then strict comparison rejects only
+ `runtime/node_modules/node-pty/build/Release/conpty_console_list.node` and skips upload.
+- Arm64 diagnostic: the two 956,928-byte modules differ at 5,826 bytes across 2,886 ranges: 5,758
+ bytes in 2,879 two-byte `.text` ranges spaced 16 bytes apart, plus 68 derived
+ COFF/debug/CodeView bytes. Their content IDs are
+ `sha256:4c4cc3b9ee0bac3a391a49ebfce230fef1d94984ef0f66eeba59fd2833b2a0d2` and
+ `sha256:26afc17c33337f6f1b8e767504a58207f4fc68cb26e807aca68a9d5e8040aba5`.
+- Uploaded controls: exactly five unpublished artifacts and no Windows arm64 artifact: Windows x64
+ `8323220212`, 37,075,312 bytes,
+ `sha256:10a07ff4863e4a0b4aef3325540660952f03f88cc7b2c2a4013f3081b5c9310c`; Linux x64
+ `8323166437`, 29,285,377 bytes,
+ `sha256:21ee42d19e6a9f15e7afda18f9e27ff5ae280a19da61ef4042ca5b0a3ce608fe`; Linux arm64
+ `8323165493`, 28,220,691 bytes,
+ `sha256:19cb887221810cd9e9df160d6ba6a185fd6282adee90d2dde6c66ad9a83e4fe1`; macOS x64
+ `8323238492`, 26,405,918 bytes,
+ `sha256:af41bae838a26b1e127bc1bd20c3d1f2a6d0d5de1f6aeb9372d2b19561a2351a`; and macOS arm64
+ `8323152771`, 24,729,554 bytes,
+ `sha256:aff001434f0d00db32d92a13ffbb40ed4f0cc0199cf29925109fc7f7bbf84977`.
+- Duration and resource metrics: jobs ran 5m33s Windows x64, 8m15s Windows arm64, 3m25s Linux
+ arm64, 3m30s Linux x64, 6m18s macOS x64, and 2m55s macOS arm64. Windows arm64 clean builds took
+ 135,371.797 ms and 118,713.734 ms; smoke took 5,767.417 ms at 53,186,560-byte RSS and
+ 5,443.331 ms at 51,802,112-byte RSS. SSH channels/files, cancellation, and fallback delay remain
+ outside this artifact-only run.
+- Artifact/log/trace link: run/jobs and the five unpublished artifacts above; rejected arm64 bytes
+ existed only in the bounded job workspace and logs and were not uploaded
+- Oracle proved: the native Release-tree shape, candidate and target cardinality, record encoding,
+ and allowlisted linker summary on both Windows architectures; no explicit incremental-link switch;
+ five exact clean-build controls; unchanged arm64 thunk drift; strict rejection and no-upload.
+- Does not prove: effective incremental linking when `/DEBUG` supplies a default, the target `.ilk`
+ state, a safe producer correction, arm64 equality, oldest baselines, native trust, SSH,
+ publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native Release-root/command diagnostic only; no tuple or production
+ checkbox.
+- Follow-up: inspect only the exact target `.ilk` file's presence and size within the already
+ bounded clean Release tree on both architectures. If it is present, require target-native evidence
+ before considering copied-artifact `/INCREMENTAL:NO`; if absent, investigate the next bounded
+ linker feature. Preserve `/guard:cf`, strict comparison, rejected-output no-upload, and all
+ repository-wide/default behavior.
+
+### E-M3-WINDOWS-INCREMENTAL-DATABASE-LOCAL-001 — Bounded target `.ilk` diagnostic
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `e7d9a1c8d3222ff5923679ad69b76b57d963c4f3`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot produce a native MSVC `.ilk`, so Windows x64/arm64 jobs remain authoritative.
+- Remote and transport: none; bounded local discovery/result-shape contracts only
+- Red evidence: E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-CI-RED-001 proves both native commands carry
+ `/DEBUG` but no explicit `/INCREMENTAL`; no synthetic local result substitutes for the pending
+ target-native file-state evidence
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. The purpose suites pass 13/13 tests and all 15 artifact suites pass 58/58. Syntax,
+ typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, diff, and staged pre-commit hooks exit zero. Full lint
+ emits only pre-existing warnings outside this artifact package.
+- Duration and resource metrics: purpose gate 0.94 s wall / 204 ms Vitest with 131,940,352-byte
+ maximum RSS and 96,081,224-byte peak footprint; complete artifact gate 3.50 s wall / 1.59 s
+ Vitest with 132,235,264-byte maximum RSS and 96,392,544-byte peak footprint. The parallel
+ typecheck/focused-lint/max-lines group completed in 3.8 s; full lint completed in 17.3 s and
+ formatting/diff checks in 0.8 s. No runtime archive, SSH channel/file, cancellation, fallback, or
+ launch-latency metric is exercised by this diagnostic-only package.
+- Artifact/log/trace link: exact implementation commit and local command output; no runtime artifact
+ was created, staged, published, or uploaded
+- Oracle proved: the already bounded and deterministic `build/Release` traversal detects at most one
+ exact case-insensitive `conpty_console_list.ilk`; duplicate target databases fail closed; a present
+ file reports only a safe numeric byte size, absence reports no guessed link state, symbolic links
+ retain the existing rejection, and POSIX remains a no-op. The diagnostic result is appended to
+ the existing allowlisted MSBuild summary before staging.
+- Does not prove: whether either native Windows build emits the target `.ilk`, that `.ilk` presence
+ alone owns the arm64 thunk drift, that `/INCREMENTAL:NO` is a safe correction, arm64 equality,
+ oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local bounded target incremental-database diagnostic only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation plus ledger head, rerun all six native cells, and require
+ both clean builds on both Windows architectures to report the target `.ilk` state before any
+ producer change. Preserve `/guard:cf`, strict comparison, no rejected upload, and every
+ default/legacy boundary.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
owner and promotion condition.
-| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
-| ------------------------------------------ | ------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------ |
-| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
-| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
-| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Four POSIX controls pass; bounded Release-tree discovery is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove the actual target linker command natively, then make all six clean builds match | Open |
-| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
-| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
-| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
-| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
-| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
-| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
+| Gap | Current behavior | Risk | Owner | Promotion/removal condition | Status |
+| ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------ |
+| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
+| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
+| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
+| Native clean-rebuild identity unproved | Five controls pass; arm64 target command has no explicit `/INCREMENTAL` | Toolchain drift may change native content IDs | Codex implementation owner | Classify target `.ilk`, then make all six clean builds match | Open |
+| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
+| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
+| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
+| Legacy performance baseline unmeasured | Numeric budgets exist; paired cold/warm measurements do not | Regression thresholds lack a measured baseline | Codex implementation owner | Purpose-built paired harness with ten samples on pinned runner classes | Open |
+| Manifest signing environment unprovisioned | Ed25519/key-rotation policy exists; no protected runtime signing secret | Runtime assets cannot be safely published | Repository release administrator | Protected environment, reviewers, two test keys, rehearsals, and access audit | BLOCKED |
+| Bootstrap primitives lack full live proof | POSIX/Windows contracts exist; bounded SSH implementations do not | Hidden dependency or transfer corruption | Codex implementation owner | Purpose-named full-size SFTP/POSIX/Windows system-SSH live suites | Open |
## Final Definition of Done
@@ -5613,11 +5777,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `6f28a8cbf` plus its evidence-ledger head, then rerun both Windows
-architectures and all four POSIX controls. Require both Windows clean builds to select one target
-record and report the same allowlisted switch summary. Only if that target-native evidence
-classifies the 2,879 function thunks may one copied-artifact producer correction be considered;
-retain strict parsing/comparison and rejected-output no-upload.
+Add a purpose-tested bounded diagnostic for the exact target `conpty_console_list.ilk` file under
+the already bounded clean `build/Release` traversal, recording only presence and size. Rerun both
+Windows architectures and all four POSIX controls. Only if target-native evidence proves implicit
+incremental linking may a copied-artifact `/INCREMENTAL:NO` producer correction be considered;
+retain `/guard:cf`, strict parsing/comparison, and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 6dfdfa0bd0d812c20981ffb728ddd18273097e6a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:25:48 -0400
Subject: [PATCH 052/267] build(ssh): disable incremental relay linking
Co-authored-by: Orca
---
...lay-node-pty-windows-build-determinism.mjs | 30 +++++++++++--------
...ode-pty-windows-build-determinism.test.mjs | 22 +++++++++-----
2 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
index bb2866a3734..5dd52e29056 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
@@ -36,18 +36,19 @@ const REPRODUCIBLE_LINKER_OPTIONS = ` 'VCLinkerTool': {
'AdditionalOptions': [
'/DYNAMICBASE',
'/guard:cf',
+ '/INCREMENTAL:NO',
'/Brepro',
'/experimental:deterministic'
]
}`
-const REQUIRED_GENERATED_OPTIONS = ['/Brepro', '/experimental:deterministic']
+const REQUIRED_COMPILER_OPTIONS = ['/Brepro', '/experimental:deterministic']
+const REQUIRED_LINKER_OPTIONS = [...REQUIRED_COMPILER_OPTIONS, '/INCREMENTAL:NO']
const MAX_LINK_COMMAND_TRACKING_BYTES = 256 * 1024
const MAX_LINK_COMMAND_TRACKING_CANDIDATES = 32
const MAX_LINK_COMMAND_TRACKING_DEPTH = 8
const MAX_LINK_COMMAND_TRACKING_ENTRIES = 10_000
const TARGET_LINK_OUTPUT_PATTERN = /(?:^|[\\/:"'\s])conpty_console_list\.node(?=$|[\\/:"'\s])/i
-const TARGET_INCREMENTAL_DATABASE = 'conpty_console_list.ilk'
function decodeXmlText(value) {
return value
@@ -72,7 +73,7 @@ function releaseDefinitionGroup(source, configuration) {
return groups[0][2]
}
-function requiredToolOptions(group, tool) {
+function requiredToolOptions(group, tool, requiredOptions) {
const tools = [...group.matchAll(new RegExp(`<${tool}\\b[^>]*>([\\s\\S]*?)${tool}>`, 'g'))]
const options = tools.flatMap((match) => [
...match[1].matchAll(/]*>([\s\S]*?)<\/AdditionalOptions>/g)
@@ -84,13 +85,13 @@ function requiredToolOptions(group, tool) {
if (!tokens.includes('%(AdditionalOptions)')) {
throw new Error(`generated MSBuild settings do not inherit ${tool} options`)
}
- for (const required of REQUIRED_GENERATED_OPTIONS) {
+ for (const required of requiredOptions) {
const count = tokens.filter((token) => token.toLowerCase() === required.toLowerCase()).length
if (count !== 1) {
throw new Error(`generated MSBuild settings require exactly one ${tool} ${required}`)
}
}
- return [...REQUIRED_GENERATED_OPTIONS]
+ return [...requiredOptions]
}
export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tuple }) {
@@ -103,11 +104,13 @@ export async function applyWindowsNodePtyBuildDeterminism({ nodePtyDirectory, tu
source.split(COMPILER_OPTIONS).length !== 2 ||
source.split(LINKER_OPTIONS).length !== 2 ||
source.includes("'/Brepro'") ||
+ source.includes("'/INCREMENTAL:NO'") ||
source.includes("'/experimental:deterministic'")
) {
throw new Error('node-pty Windows build settings do not match the reviewed source')
}
- // Why: ARM64 compiler output changes even with a reproducible linker unless both stages opt in.
+ // Why: ARM64 needs both reproducible stages, while /DEBUG-implied incremental thunks still drift.
+ // Keep this producer correction inside the exclusive copied artifact source.
const reproducibleSource = source
.replace(COMPILER_OPTIONS, REPRODUCIBLE_COMPILER_OPTIONS)
.replace(LINKER_OPTIONS, REPRODUCIBLE_LINKER_OPTIONS)
@@ -126,8 +129,8 @@ export async function assertWindowsNodePtyGeneratedBuildSettings({ nodePtyDirect
// Why: the source rewrite is insufficient proof unless gyp propagates both stages into MSBuild.
return {
configuration,
- compilerOptions: requiredToolOptions(group, 'ClCompile'),
- linkerOptions: requiredToolOptions(group, 'Link'),
+ compilerOptions: requiredToolOptions(group, 'ClCompile', REQUIRED_COMPILER_OPTIONS),
+ linkerOptions: requiredToolOptions(group, 'Link', REQUIRED_LINKER_OPTIONS),
project
}
}
@@ -180,7 +183,7 @@ async function discoverLinkCommandTracking(nodePtyDirectory) {
if (candidates.length > MAX_LINK_COMMAND_TRACKING_CANDIDATES) {
throw new Error('MSBuild linker tracking discovery has too many candidates')
}
- } else if (child.isFile() && child.name.toLowerCase() === TARGET_INCREMENTAL_DATABASE) {
+ } else if (child.isFile() && child.name.toLowerCase() === 'conpty_console_list.ilk') {
incrementalDatabases.push(childPath)
if (incrementalDatabases.length > 1) {
throw new Error('MSBuild incremental database discovery has duplicate target files')
@@ -281,13 +284,14 @@ export async function inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirector
let incrementalDatabase = { state: 'absent' }
if (discovery.incrementalDatabases.length === 1) {
const bytes = (await stat(discovery.incrementalDatabases[0])).size
- if (!Number.isSafeInteger(bytes) || bytes < 0) {
- throw new Error('MSBuild incremental database has an invalid size')
- }
incrementalDatabase = { bytes, state: 'present' }
}
+ const linkCommand = parseWindowsNodePtyLinkCommandTracking(matching[0])
+ if (linkCommand.incremental !== 'disabled' || incrementalDatabase.state !== 'absent') {
+ throw new Error('MSBuild incremental linking must be disabled without a target database')
+ }
return {
- ...parseWindowsNodePtyLinkCommandTracking(matching[0]),
+ ...linkCommand,
candidateFiles: discovery.candidates.length,
incrementalDatabase,
searchedEntries: discovery.entries
diff --git a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
index 2e48b2f1a38..a6c97ac5d8c 100644
--- a/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+++ b/config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
@@ -25,7 +25,7 @@ async function copiedSource() {
async function generatedProject({
compilerOptions = '/Brepro /experimental:deterministic %(AdditionalOptions)',
- linkerOptions = '/Brepro /experimental:deterministic %(AdditionalOptions)',
+ linkerOptions = '/Brepro /experimental:deterministic /INCREMENTAL:NO %(AdditionalOptions)',
platform = 'ARM64'
} = {}) {
const directory = await mkdtemp(join(tmpdir(), 'orca-node-pty-windows-msbuild-'))
@@ -54,6 +54,7 @@ describe('SSH relay Windows node-pty build determinism', () => {
expect(compilerOptions).toContain("'/experimental:deterministic'")
expect(linkerOptions).toContain("'/Brepro'")
expect(linkerOptions).toContain("'/experimental:deterministic'")
+ expect(linkerOptions).toContain("'/INCREMENTAL:NO'")
expect(await readFile(resolve('node_modules/node-pty/binding.gyp'), 'utf8')).toBe(
repositorySource
)
@@ -83,7 +84,7 @@ describe('SSH relay Windows node-pty build determinism', () => {
).resolves.toEqual({
configuration: 'Release|ARM64',
compilerOptions: ['/Brepro', '/experimental:deterministic'],
- linkerOptions: ['/Brepro', '/experimental:deterministic'],
+ linkerOptions: ['/Brepro', '/experimental:deterministic', '/INCREMENTAL:NO'],
project: 'conpty_console_list.vcxproj'
})
})
@@ -170,21 +171,28 @@ describe('SSH relay Windows node-pty build determinism', () => {
nodePtyDirectory: directory,
tuple: 'win32-x64'
})
+ ).rejects.toThrow('must be disabled without a target database')
+ await rm(incrementalPath)
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirectory: directory, tuple: 'win32-x64' })
).resolves.toMatchObject({
candidateFiles: 2,
incremental: 'disabled',
- incrementalDatabase: { bytes: 4096, state: 'present' }
+ incrementalDatabase: { state: 'absent' }
})
- await rm(incrementalPath)
- await expect(
- inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirectory: directory, tuple: 'win32-x64' })
- ).resolves.toMatchObject({ incrementalDatabase: { state: 'absent' } })
await expect(
inspectWindowsNodePtyLinkCommandTracking({
nodePtyDirectory: '/not-used-on-posix',
tuple: 'linux-arm64-glibc'
})
).resolves.toBeUndefined()
+ await writeFile(
+ trackingPath,
+ '^one\n/OUT:conpty_console_list.node /Brepro /GUARD:CF /experimental:deterministic'
+ )
+ await expect(
+ inspectWindowsNodePtyLinkCommandTracking({ nodePtyDirectory: directory, tuple: 'win32-x64' })
+ ).rejects.toThrow('must be disabled without a target database')
await writeFile(trackingPath, Buffer.alloc(300_000))
await expect(
inspectWindowsNodePtyLinkCommandTracking({
From 3ec1a48afde95618fb7e3f6be71303410e6701dd Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:27:55 -0400
Subject: [PATCH 053/267] docs(ssh): record incremental link evidence
Co-authored-by: Orca
---
...github-release-implementation-checklist.md | 197 ++++++++++++++++--
1 file changed, 180 insertions(+), 17 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 6dd5979f498..e736565e8ac 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -2,7 +2,7 @@
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run [29363423068](https://github.com/stablyai/orca/actions/runs/29363423068) at commit `2db46d91b` proves bounded `build/Release` discovery on both native Windows architectures: both clean builds select three tracking candidates, search 82 entries, select one target record, and report the same `/brepro`, `/debug`, `/experimental:deterministic`, `/guard:cf` summary with no explicit `/incremental` switch; Linux x64/arm64, macOS x64/arm64, and Windows x64 compare exactly and upload, while Windows arm64 retains the 2,879 linker-thunk mismatch and fails before upload under E-M3-WINDOWS-LINK-COMMAND-RELEASE-ROOT-CI-RED-001; exact implementation commit `e7d9a1c8d` adds only a bounded target `.ilk` presence/size diagnostic and is locally green under E-M3-WINDOWS-INCREMENTAL-DATABASE-LOCAL-001; the next exact-head six-cell run is required before any producer change; no evidence authorizes changing a comparator, production/default path, or tuple state; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run [29364581781](https://github.com/stablyai/orca/actions/runs/29364581781) at ledger head `d1eca8a55` proves both clean Windows x64 builds create the same 4,238,838-byte target `.ilk` and both clean Windows arm64 builds create the same 4,980,517-byte target `.ilk`; Microsoft documents that `/DEBUG` implies `/INCREMENTAL` and that incremental linking creates this database; Windows x64 and all four POSIX controls compare and upload, while arm64 retains the exact 2,879-thunk drift and no rejected upload under E-M3-WINDOWS-INCREMENTAL-DATABASE-CI-RED-001; exact implementation commit `6dfdfa0bd` adds `/INCREMENTAL:NO` only to the copied node-pty Windows linker options and is locally green under E-M3-WINDOWS-INCREMENTAL-DISABLE-LOCAL-001; the next exact-head six-cell run must prove generated/actual option propagation, target `.ilk` absence, complete strict equality, smoke, and upload before this correction is accepted; `/guard:cf`, the repository-wide node-pty patch, production/default behavior, and every tuple state remain unchanged; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -742,6 +742,15 @@ incremental linking without an explicit command switch, the next bounded diagnos
the exact target `.ilk` file's presence and size from the already bounded clean Release tree before
any copied-artifact producer change.
+Exact-head run 29364581781 proves both Windows architectures create a stable target `.ilk` in each
+clean build: 4,238,838 bytes on x64 and 4,980,517 bytes on arm64. Microsoft documents that
+`/DEBUG` implies `/INCREMENTAL`, incremental linking creates the `.ilk`, and `/INCREMENTAL:NO` is
+the explicit override. Five controls compare and upload; arm64 retains the exact thunk drift and
+fails before upload (E-M3-WINDOWS-INCREMENTAL-DATABASE-CI-RED-001). This authorizes one narrow
+producer correction: add `/INCREMENTAL:NO` only to the copied node-pty Windows linker options,
+retain `/guard:cf`, and fail closed unless the generated project and actual command each contain
+exactly one disable switch and the clean output tree contains no target `.ilk`.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1345,16 +1354,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native target `.ilk` evidence pending | `e7d9a1c8d`; E-M3-WINDOWS-INCREMENTAL-DATABASE-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native `/INCREMENTAL:NO` proof pending | `6dfdfa0bd`; E-M3-WINDOWS-INCREMENTAL-DISABLE-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -5720,6 +5729,161 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
producer change. Preserve `/guard:cf`, strict comparison, no rejected upload, and every
default/legacy boundary.
+### E-M3-WINDOWS-INCREMENTAL-DATABASE-CI-RED-001 — Native `.ilk` proves implicit incremental link
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact ledger head `d1eca8a55dec3e96f9ecf1600e8e6e169cdfd3fe`, containing exact
+ diagnostic implementation commit `e7d9a1c8d3222ff5923679ad69b76b57d963c4f3`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29364581781](https://github.com/stablyai/orca/actions/runs/29364581781),
+ conclusion `failure`; Windows x64 `87192850326` success, Windows arm64 `87192850417` expected
+ strict-comparison failure, Linux arm64 `87192850309` success, Linux x64 `87192850444` success,
+ macOS x64 `87192850303` success, and macOS arm64 `87192850364` success
+- Runners: Windows x64 used `windows-2022` / `win22` `20260706.237.1`, native X64; Windows arm64
+ used `windows-11-arm` / `win11-arm64` `20260706.102.1`, native ARM64. Linux x64 used
+ `ubuntu-24.04` / `ubuntu24` `20260705.232.1`; Linux arm64 used `ubuntu-24.04-arm` /
+ `ubuntu24-arm64` `20260706.52.2`; macOS x64 used `macos-15-intel` / `macos15`
+ `20260629.0276.1`; macOS arm64 used `macos-15` / `macos15` `20260706.0213.1`. Every runner
+ checked out the exact head above; both Windows jobs used Node v24.18.0 and MSVC 14.44.35207 /
+ compiler 19.44.35228.
+- Remote and transport: none; target-native artifact assembly, strict comparison, and unpublished
+ seven-day Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29364581781 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87192850326/logs
+ gh api repos/stablyai/orca/actions/jobs/87192850417/logs
+ gh api 'repos/stablyai/orca/actions/runs/29364581781/artifacts?per_page=100'
+ curl -fsSL --proto '=https' --tlsv1.2 \
+ 'https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170' \
+ | rg -i -C 2 'DEBUG|incremental.*default|\.ilk|INCREMENTAL:NO'
+ ```
+
+- Result: FAIL as the intended strict evidence boundary. Both clean x64 builds report the same
+ 4,238,838-byte `conpty_console_list.ilk`; both clean arm64 builds report the same 4,980,517-byte
+ target database. All four still report `/debug` with `incremental: unspecified` and no explicit
+ `/incremental` or `/opt` switch in the command record. Microsoft documents that `/DEBUG` implies
+ `/INCREMENTAL`, incremental links create/update an `.ilk`, and `/INCREMENTAL:NO` overrides the
+ default. Windows x64 and all four POSIX controls compare exactly. Windows arm64 builds, verifies,
+ and executes both candidates, then rejects only `conpty_console_list.node` and skips upload.
+- Arm64 diagnostic: the two 956,928-byte modules again differ at 5,826 bytes across 2,886 ranges:
+ 5,758 bytes in 2,879 two-byte `.text` ranges spaced 16 bytes apart, plus the same 68 derived
+ COFF/debug/CodeView bytes. Their content IDs are
+ `sha256:b38d3343e96f339eb7197a4fb379b5f636d5f6752d42434b508bb7c67803f57c` and
+ `sha256:9d937233f63b142f03e504af2ffeeeb05b2de2b979047a369a79dd1d793b1786`.
+- Uploaded controls: exactly five unpublished artifacts and no Windows arm64 artifact: Windows x64
+ `8323660213`, 37,075,309 bytes,
+ `sha256:788c43c94db25e995e6d36ab437d841e01a24846f3b8ec519f62fd7bebeb4fbd`; Linux x64
+ `8323618920`, 29,280,401 bytes,
+ `sha256:0b19a0b1dd78793ae0d55f7077eb871a7a8f98d3f7e4c3b8fd5f457f8f008fd6`; Linux arm64
+ `8323624757`, 28,207,487 bytes,
+ `sha256:cf4bb8255b260fc9109b9180b05d561a3b3cb0c3eeb791d111aff649368a5c86`; macOS x64
+ `8323808296`, 26,420,419 bytes,
+ `sha256:4117ae641972cad3936b9733b8461148ab2e4e3280cb3d27d31b479d966e412a`; and macOS arm64
+ `8323599375`, 24,749,802 bytes,
+ `sha256:b29cba1d66f7fedfa89bd4994d0186b5f2e0f89a17b95d709727808e0ccf3590`.
+- Duration and resource metrics: jobs ran 4m56s Windows x64, 10m25s Windows arm64, 3m32s Linux
+ arm64, 3m22s Linux x64, 10m47s macOS x64, and 2m38s macOS arm64. Windows arm64 clean builds took
+ 156,490.445 ms and 135,338.371 ms; smoke took 5,949.372 ms at 53,084,160-byte RSS and
+ 5,425.281 ms at 52,871,168-byte RSS. SSH channels/files, cancellation, and fallback delay remain
+ outside this artifact-only run.
+- Artifact/log/trace link: run/jobs, Microsoft linker reference above, and the five unpublished
+ artifacts; rejected arm64 bytes existed only in the bounded job workspace and logs and were not
+ uploaded
+- Oracle proved: a fresh target incremental-link database on both clean builds and both native
+ architectures; the documented `/DEBUG`-implied incremental state; stable target database sizes;
+ five exact controls; unchanged arm64 thunk drift; strict rejection and no rejected upload.
+- Does not prove: that `/INCREMENTAL:NO` removes the thunk drift, that all six outputs compare,
+ oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: native implicit-incremental-link classification only; no tuple or
+ production checkbox.
+- Follow-up: add exactly one `/INCREMENTAL:NO` to only the copied node-pty Windows linker options.
+ Fail closed unless the generated project and actual command each contain it exactly once and the
+ clean tree contains no target `.ilk`; rerun all six native cells with `/guard:cf`, strict
+ comparison, and rejected-output no-upload unchanged.
+
+### E-M3-WINDOWS-INCREMENTAL-DISABLE-LOCAL-001 — Copied-artifact full-link correction
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `6dfdfa0bd0d812c20981ffb728ddd18273097e6a`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741), target-native execution pending
+- Runner: macOS 26.2 build 25C56, native Apple M4 arm64; Node v26.0.0 and pnpm 10.24.0. This runner
+ cannot execute MSVC, so Windows x64/arm64 jobs remain authoritative.
+- Remote and transport: none; copied-source, generated-project, actual-command/result-shape, and
+ ordering contracts only
+- Red evidence: E-M3-WINDOWS-INCREMENTAL-DATABASE-CI-RED-001 proves both native architectures use
+ `/DEBUG`-implied incremental linking, create stable target `.ilk` files, and retain the arm64 thunk
+ drift; no synthetic local failure substitutes for that target-native evidence
+- Exact green commands:
+
+ ```sh
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs
+ node --check config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ /usr/bin/time -lp pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-node-release-verification.test.mjs \
+ config/scripts/ssh-relay-node-tar-inspection.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-windows-settlement.test.mjs \
+ config/scripts/ssh-relay-node-zip-inspection.test.mjs \
+ config/scripts/ssh-relay-runtime-artifact.test.mjs \
+ config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
+ config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
+ config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs
+ pnpm run typecheck
+ pnpm exec oxlint \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs
+ pnpm run check:max-lines-ratchet
+ GOMAXPROCS=2 pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.mjs \
+ config/scripts/ssh-relay-node-pty-windows-build-determinism.test.mjs \
+ config/scripts/ssh-relay-node-pty-build.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+ git diff --check
+ ```
+
+- Result: PASS. The purpose suites pass 13/13 tests and all 15 artifact suites pass 58/58. Syntax,
+ typecheck, focused oxlint, the 355-entry max-lines ratchet, full repository
+ lint/reliability/localization, formatting, diff, and staged pre-commit hooks exit zero. Full lint
+ emits only pre-existing warnings outside this artifact package.
+- Duration and resource metrics: purpose gate 1.00 s wall / 202 ms Vitest with 132,235,264-byte
+ maximum RSS and 96,408,952-byte peak footprint; complete artifact gate 2.63 s wall / 1.13 s
+ Vitest with 132,251,648-byte maximum RSS and 96,490,944-byte peak footprint. The parallel
+ typecheck/focused-lint/max-lines group completed in 3.1 s; full lint and format/diff gates settled
+ within 10.1 s. No runtime archive, SSH channel/file, cancellation, fallback, or launch-latency
+ metric is exercised by this local package.
+- Artifact/log/trace link: exact implementation commit and local command output; no runtime artifact
+ was created, staged, published, or uploaded
+- Oracle proved: only the copied Windows node-pty linker options gain exactly one
+ `/INCREMENTAL:NO`; compiler options remain separate and `/guard:cf` remains present; source drift
+ or repeat transformation fails closed; generated Release projects must inherit exactly one disable
+ switch; actual target commands must classify it as disabled; any target `.ilk` fails before
+ staging; POSIX and the installed repository source remain unchanged. Both source and test modules
+ remain below 300 lines without a max-lines bypass.
+- Does not prove: MSVC accepts/propagates the option on either native architecture, that target
+ `.ilk` is absent, that the arm64 thunks become stable, that all six outputs compare and upload,
+ oldest baselines, native trust, SSH, publication, transfer, fallback, UI, or any enabled tuple.
+- Checklist items satisfied: local copied-artifact incremental-disable contract only; no tuple or
+ production checkbox.
+- Follow-up: push the exact implementation plus ledger head and rerun all six target-native cells.
+ Require both Windows clean builds to report `/incremental:no`, no target `.ilk`, complete runtime
+ smoke, exact output equality, and upload before accepting the correction.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -5730,7 +5894,7 @@ owner and promotion condition.
| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five controls pass; arm64 target command has no explicit `/INCREMENTAL` | Toolchain drift may change native content IDs | Codex implementation owner | Classify target `.ilk`, then make all six clean builds match | Open |
+| Native clean-rebuild identity unproved | Five controls pass; copied `/INCREMENTAL:NO` is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove flag, no `.ilk`, and all-six equality on native runners | Open |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
@@ -5777,11 +5941,10 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Add a purpose-tested bounded diagnostic for the exact target `conpty_console_list.ilk` file under
-the already bounded clean `build/Release` traversal, recording only presence and size. Rerun both
-Windows architectures and all four POSIX controls. Only if target-native evidence proves implicit
-incremental linking may a copied-artifact `/INCREMENTAL:NO` producer correction be considered;
-retain `/guard:cf`, strict parsing/comparison, and rejected-output no-upload.
+Push exact implementation commit `6dfdfa0bd` plus its evidence-ledger head, then rerun both Windows
+architectures and all four POSIX controls. Require both Windows clean builds to report exactly one
+`/INCREMENTAL:NO`, no target `.ilk`, complete smoke, exact output equality, and upload. Retain
+`/guard:cf`, strict parsing/comparison, and rejected-output no-upload.
Cross-family Layer B targets, the protected manifest-signing environment,
oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
From 6751a65ab356cfdf0bdb386026e1e0fbdc3b8fd7 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:44:50 -0400
Subject: [PATCH 054/267] docs(ssh): add concise implementation tracker
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 162 ++++++++++++++++++
...github-release-implementation-checklist.md | 144 +++++++++++++---
2 files changed, 279 insertions(+), 27 deletions(-)
create mode 100644 docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
new file mode 100644
index 00000000000..b5945925010
--- /dev/null
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -0,0 +1,162 @@
+# SSH Relay Runtime Distribution — Implementation Checklist
+
+Last updated: 2026-07-14
+
+This is the human-readable project tracker. The
+[detailed evidence ledger](./2026-07-14-ssh-relay-github-release-implementation-checklist.md)
+contains exact commands, runner identities, artifact hashes, metrics, and residual gaps.
+
+A checked box here means the implementation or validation has exact evidence in that ledger.
+Approved design decisions are listed separately and are not presented as implemented work.
+
+## Current state
+
+- Existing SSH relay behavior remains the default for every target.
+- The bundled runtime path is not connected to production and no tuple is enabled.
+- The future bundled path is a per-SSH-target Beta option, off by default.
+- No runtime artifact has been published to a GitHub Release.
+- Latest native proof: [GitHub Actions run 29365815434](https://github.com/stablyai/orca/actions/runs/29365815434)
+ passed clean-build equality and runtime smoke on Linux x64/arm64, macOS x64/arm64, and Windows
+ x64/arm64.
+- Active work package: finish the artifact/runtime closure audit, then address archive safety,
+ oldest-baseline execution, and native trust.
+
+## Locked rollout decisions
+
+- Legacy behavior remains the persisted and effective default.
+- The Beta choice is per SSH target, off by default, and shown on target add/edit surfaces.
+- Missing, old, imported, unknown, or malformed settings resolve to legacy.
+- A mode change applies only on the next connection or explicit reconnect.
+- Legacy remains available; removal or narrowing requires a separate review.
+- Only availability/compatibility failures may fall back automatically. Integrity, security, and
+ corruption failures fail closed.
+
+## Rollout implementation remaining
+
+- [ ] Implement the per-target configuration field and migration tests.
+- [ ] Add the off-by-default Beta-tagged option to SSH target add/edit UI.
+- [ ] Implement `bundled-auto` selection for explicitly opted-in targets.
+- [ ] Implement automatic legacy fallback only for classified availability/compatibility failures.
+- [ ] Fail closed for signature, hash, archive, tree, native-trust, bundled-Node, and cache-corruption
+ failures.
+- [ ] Add the explicit “disable Beta and reconnect” recovery action for fail-closed Beta errors.
+- [ ] Collect privacy-safe Beta success, latency, failure-stage, and fallback-reason telemetry.
+- [ ] Require a separate reviewed decision before changing any tuple to default-on.
+
+## Work packages
+
+### 0 — Existing Node/npm resolver correction
+
+- [x] Implement coherent remote Node/npm selection.
+- [x] Add focused unit/static proof.
+- [x] Prove live Linux arm64 SSH behavior.
+- [x] Keep this separate from artifact distribution.
+- [ ] Merge the independently reviewable fix from draft PR
+ [#8724](https://github.com/stablyai/orca/pull/8724).
+
+### 1 — Manifest, identity, and platform contracts
+
+- [x] Define signed immutable manifest and canonical content identity.
+- [x] Define exact release tag/asset URL rules without mutable `latest` lookup.
+- [x] Define conservative OS/architecture/libc selection.
+- [x] Add hostile manifest/path/schema tests.
+- [ ] Finish archive-safety implementation and hostile archive tests.
+- [ ] Update mode-qualified remote directory parsing and GC compatibility.
+- [ ] Merge the contract package from draft PR
+ [#8728](https://github.com/stablyai/orca/pull/8728).
+
+### 2 — Target-native runtime artifacts
+
+- [x] Pin and verify Node v24.18.0 release inputs and signatures.
+- [x] Produce and smoke-test candidate runtimes with patched `node-pty` and the matching
+ `@parcel/watcher` native package on all six runner families.
+- [x] Prove bundled Node, real PTY input/resize/exit, watcher events, and Windows resource settlement.
+- [x] Prove two clean builds compare exactly on all six native GitHub runner families.
+- [x] Keep `/guard:cf`; fix Windows arm64 drift with copied-artifact-only `/INCREMENTAL:NO`.
+- [ ] Complete the runtime closure, license, SBOM, provenance, and prohibited-content allowlist audit.
+- [ ] Prove each candidate on its oldest supported OS/libc/kernel baseline.
+- [ ] Sign macOS and Windows native bytes and verify target-native trust policy.
+- [ ] Record complete compiler/toolchain provenance for release promotion.
+- [ ] Merge draft PR [#8741](https://github.com/stablyai/orca/pull/8741).
+
+### 3 — Release build, signing, and publication
+
+- [ ] Add target-native build jobs as release prerequisites.
+- [ ] Add native signing jobs and return signed bytes before final hashing.
+- [ ] Add the fail-closed aggregate and manifest-signing job.
+- [ ] Embed the exact signed manifest and accepted keys into every desktop build.
+- [ ] Upload the exact prebuilt runtime bytes to the matching draft release.
+- [ ] Verify draft read-back hashes and execute downloaded archives.
+- [ ] Test timeout, retry exhaustion, approval denial/timeout, signing failure, partial output, and
+ recovered-draft behavior.
+- [ ] Block publication whenever any required runtime/signing/manifest gate fails.
+
+### 4 — Desktop resolver, verification, extraction, and cache
+
+- [ ] Implement offline tuple selection from the embedded signed manifest.
+- [ ] Implement exact direct release URL resolution and safe redirect handling.
+- [ ] Stream download with size/time bounds and archive SHA-256 verification.
+- [ ] Extract into exclusive staging with full hostile-archive defenses.
+- [ ] Verify the complete extracted tree before atomic cache publication.
+- [ ] Implement the 2 GiB bounded cache, locking, concurrency, quarantine, and eviction rules.
+- [ ] Prove verified client-cache transfer works with the client offline.
+- [ ] Preserve `ORCA_RELAY_PATH` behind the official-build trust boundary.
+
+### 5 — Bounded SSH transfer and remote installation
+
+- [ ] Implement bounded/cancellable SFTP transfer with executable-mode restoration.
+- [ ] Keep compatible POSIX tar streaming as an optional fast path.
+- [ ] Implement POSIX no-tar transfer using only the declared shell/file primitives.
+- [ ] Implement bounded binary PowerShell/.NET transfer for Windows system SSH.
+- [ ] Transfer only locally verified bytes into exclusive remote staging.
+- [ ] Use bundled Node to hash the complete staged tree before any native probe.
+- [ ] Run native probes, PTY/watcher smoke, structured sentinel, atomic publish, and launch in order.
+- [ ] Trust the initial-install proof on warm launch under the immutable-directory assumption.
+- [ ] Quarantine detected mutation and recover only from freshly verified bundled bytes.
+- [ ] Preserve SSH authentication, connection, and relay RPC transport behavior.
+
+### 6 — Modes, fallback, diagnostics, and concurrency
+
+- [ ] Implement internal `legacy`, `auto`, and forced diagnostic `bundled` modes.
+- [ ] Abort and await all bundled work before eligible legacy fallback starts.
+- [ ] Keep bundled and legacy identities, locks, partials, sentinels, and generations separate.
+- [ ] Add stable stage/failure codes and privacy-safe diagnostics.
+- [ ] Prove fallback races, reconnect/reattach, concurrent clients, GC, upgrade, and downgrade.
+- [ ] Prove every integrity/security/corruption class fails closed in `auto`.
+- [ ] Prove eligible legacy fallback begins within the documented delay budget.
+
+### 7 — Validation and Beta rollout
+
+- [ ] Name and pin representative POSIX and Windows remote snapshots for Layer B.
+- [ ] For every enabled remote tuple, pass built-in SFTP and system SSH.
+- [ ] For every supported client OS/architecture, pass both transfer families against representative
+ POSIX and Windows remotes.
+- [ ] Prove remote GitHub egress is never required.
+- [ ] Prove no-tar/no-Node/no-Python/no-Perl/no-hash-tool bootstrap cases.
+- [ ] Run full-size, slow-link, cancellation, concurrency, and failure-injection tests.
+- [ ] Measure cold/warm latency, memory, channels/files, cancellation settlement, and fallback delay
+ against legacy baselines.
+- [ ] Pass security review, SBOM/provenance, signing, key lifecycle, CVE, and emergency-refresh gates.
+- [ ] Ship the per-target Beta with every target still defaulting to legacy.
+- [ ] Accumulate approved real-host Beta evidence before any default-on proposal.
+- [ ] Require three qualifying RCs plus rollback proof before default-on review.
+
+## External blockers
+
+- [ ] Repository release administrator: approve the representative Layer B remote provider,
+ snapshots, credentials, egress policy, teardown SLA, and cost/capacity owner.
+- [ ] Repository release administrator: provision the protected manifest/native-signing environment,
+ reviewers, test keys/certificates, and access audit.
+
+Safe behavior while either blocker remains: no bundled tuple is enabled or published; legacy remains
+the default, and independent local/native-runner contract work may continue.
+
+## Definition of done
+
+- [ ] Every item above that applies to an enabled tuple has exact evidence in the detailed ledger.
+- [ ] Every enabled tuple has target-native build, oldest-baseline, native-trust, SFTP, system-SSH,
+ RPC, security, and performance proof.
+- [ ] Every packaged desktop embeds the exact signed manifest for the published immutable assets.
+- [ ] The Beta ships off by default per target and rollback to legacy is proven in the same build.
+- [ ] No default-on rollout occurs without a separate reviewed decision and completed soak evidence.
+- [ ] Legacy remains available until a separately reviewed removal decision.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index e736565e8ac..88a07cc83e2 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -1,8 +1,14 @@
# SSH Relay GitHub Release Distribution — Living Implementation Checklist
+Human-readable tracker:
+[SSH Relay Runtime Distribution — Implementation Checklist](./2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md)
+
+This file is the detailed evidence ledger. Use the tracker above for project status and remaining
+work; keep exact commands, runner identities, hashes, metrics, and residual gaps here.
+
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 target-native runtime assembly — exact-head run [29364581781](https://github.com/stablyai/orca/actions/runs/29364581781) at ledger head `d1eca8a55` proves both clean Windows x64 builds create the same 4,238,838-byte target `.ilk` and both clean Windows arm64 builds create the same 4,980,517-byte target `.ilk`; Microsoft documents that `/DEBUG` implies `/INCREMENTAL` and that incremental linking creates this database; Windows x64 and all four POSIX controls compare and upload, while arm64 retains the exact 2,879-thunk drift and no rejected upload under E-M3-WINDOWS-INCREMENTAL-DATABASE-CI-RED-001; exact implementation commit `6dfdfa0bd` adds `/INCREMENTAL:NO` only to the copied node-pty Windows linker options and is locally green under E-M3-WINDOWS-INCREMENTAL-DISABLE-LOCAL-001; the next exact-head six-cell run must prove generated/actual option propagation, target `.ilk` absence, complete strict equality, smoke, and upload before this correction is accepted; `/guard:cf`, the repository-wide node-pty patch, production/default behavior, and every tuple state remain unchanged; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 runtime closure — exact-head run [29365815434](https://github.com/stablyai/orca/actions/runs/29365815434) at ledger head `3ec1a48af` passes all six target-native jobs under E-M3-REPRODUCIBILITY-CI-001; both Windows clean builds propagate exactly one copied-artifact `/INCREMENTAL:NO`, retain `/guard:cf`, emit no target `.ilk`, complete bundled-Node/native/PTy/watcher smoke, compare the full runtime/archive/identity/SBOM/provenance exactly, and upload; the Windows arm64 2,879-thunk drift is closed without normalization or a repository-wide change; the active artifact-only slice is auditing and closing the remaining runtime closure/SBOM/provenance checklist claims before oldest-baseline and native-trust work; production/default behavior and every tuple state remain unchanged; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -169,11 +175,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: replace the empty-property oracle with a bounded parser for the actual
- post-build MSBuild linker-command tracking record, then rerun all six target-native cells. Require
- both Windows clean builds to report the same allowlisted linker-switch summary before considering
- one copied-artifact producer correction. Preserve strict comparison, no rejected upload, the
- repository-wide node-pty patch, legacy/default path, and every other release gate.
+- Next required action: audit the exact staged runtime closure, licenses, SPDX, provenance,
+ compiler/toolchain records, and prohibited-content allowlist against the current candidate bytes.
+ Check only claims supported by exact purpose tests and evidence IDs, then proceed to the
+ oldest-baseline and native-trust gates. Preserve the artifact-only boundary, legacy/default path,
+ and every other release gate.
## Non-Negotiable Invariants
@@ -751,6 +757,12 @@ producer correction: add `/INCREMENTAL:NO` only to the copied node-pty Windows l
retain `/guard:cf`, and fail closed unless the generated project and actual command each contain
exactly one disable switch and the clean output tree contains no target `.ilk`.
+Exact-head run 29365815434 passes all six target-native jobs. Both Windows architectures propagate
+exactly one disable switch in both clean builds, retain `/guard:cf`, report no target `.ilk`, execute
+the full bundled runtime smoke, compare every runtime/archive/identity/SBOM/provenance byte exactly,
+and upload. Windows arm64 now has one stable content ID and archive digest, closing the native
+clean-build reproducibility gap without post-build normalization (E-M3-REPRODUCIBILITY-CI-001).
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -807,8 +819,9 @@ Rules:
- [ ] Real hardware or native virtualized execution is required for release promotion. QEMU or
cross-compilation may add coverage but cannot fill the evidence column alone.
- [ ] A tuple without a trustworthy runtime source or real runner stays disabled.
-- [ ] Every archive executes the exact bundled Node, loads both native dependencies, spawns a real
- PTY, performs input/resize/exit, and observes create/modify/rename/delete watcher events.
+- [x] Every current candidate archive executes the exact bundled Node, loads both native
+ dependencies, spawns a real PTY, performs input/resize/exit, and observes
+ create/modify/rename/delete watcher events. (E-M3-REPRODUCIBILITY-CI-001)
- [ ] Every build records compiler/toolchain/container image digests and runner architecture.
## Milestone 4 — Make Relay Artifacts Prerequisites of Desktop Builds
@@ -1354,16 +1367,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native `/INCREMENTAL:NO` proof pending | `6dfdfa0bd`; E-M3-WINDOWS-INCREMENTAL-DISABLE-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; all-six reproducibility green; closure/trust pending | `3ec1a48af`; E-M3-REPRODUCIBILITY-CI-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -5884,6 +5897,82 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
Require both Windows clean builds to report `/incremental:no`, no target `.ilk`, complete runtime
smoke, exact output equality, and upload before accepting the correction.
+### E-M3-REPRODUCIBILITY-CI-001 — All six target-native clean builds compare and upload
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact ledger head `3ec1a48afde95618fb7e3f6be71303410e6701dd`, containing exact
+ incremental-disable implementation commit `6dfdfa0bd0d812c20981ffb728ddd18273097e6a`; stacked draft
+ PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29365815434](https://github.com/stablyai/orca/actions/runs/29365815434),
+ conclusion `success`; Windows arm64 `87196982746`, Windows x64 `87196982776`, Linux arm64
+ `87196982798`, Linux x64 `87196982795`, macOS x64 `87196982820`, and macOS arm64 `87196982760`
+ all passed
+- Runners: Windows x64 used `windows-2022` / `win22` `20260706.237.1`, native X64; Windows arm64
+ used `windows-11-arm` / `win11-arm64` `20260706.102.1`, native ARM64. Linux x64 used
+ `ubuntu-24.04` / `ubuntu24` `20260705.232.1`; Linux arm64 used `ubuntu-24.04-arm` /
+ `ubuntu24-arm64` `20260706.52.2`; macOS x64 used `macos-15-intel` / `macos15`
+ `20260629.0276.1`; macOS arm64 used `macos-15` / `macos15` `20260706.0213.1`. Every runner
+ checked out the exact head above; both Windows jobs used Node v24.18.0 and MSVC 14.44.35207 /
+ compiler 19.44.35228.
+- Remote and transport: none; target-native runtime assembly, exact clean-build comparison, and
+ unpublished seven-day Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29365815434 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87196982776/logs
+ gh api repos/stablyai/orca/actions/jobs/87196982746/logs
+ gh api 'repos/stablyai/orca/actions/runs/29365815434/artifacts?per_page=100'
+ ```
+
+- Result: PASS. Both clean x64 builds report one generated and actual `/INCREMENTAL:NO`, retain
+ `/guard:cf`, parse a 2,146-byte UTF-16LE command record, search 79 bounded Release-tree entries,
+ and find no target `.ilk`. Both clean arm64 builds report the same contract with a 2,124-byte
+ command record and no target `.ilk`. Each architecture then executes bundled Node v24.18.0,
+ loads the exact ABI-137 native modules, proves PTY input/resize/exit and watcher
+ create/update/delete, settles Windows native resources, verifies the archive, and compares the
+ complete runtime tree, archive, identity, SPDX, and provenance exactly before upload. No PE
+ mismatch diagnostic runs.
+- Stable Windows identities: x64 content ID
+ `sha256:6f7cbeb120e67766037649f6079099346220973e6158e1429b6ebf42729f1564` and archive
+ `sha256:d24ca7ee8734e948c845d792ba0974a2590df7c8b60068a46f3eb1dc24af5f36`; arm64 content ID
+ `sha256:741765a10ddc824cd305b9a50c8efd91477517c05d9cfe1ca46342c002652186` and archive
+ `sha256:3e1e89234cd0d139a2a1376e7cd5e17ab47e31a6c3c2f9dcb8e73317ead5c6aa`.
+- Uploaded evidence: exactly six unpublished artifacts: Windows arm64 `8324239473`, 33,083,333
+ bytes, `sha256:51d590835597969b1261f81487eea433f23e1c04818c96f2f1e5d48b16688b42`;
+ Windows x64 `8324177555`, 37,033,210 bytes,
+ `sha256:3bde38ab4159bea7b420118862db3725ce845084ab515cc3e08de439aceb308a`; Linux arm64
+ `8324115839`, 28,209,475 bytes,
+ `sha256:4f7272d896616326a5231170054a71134122c0263200361cf46431951fe01307`; Linux x64
+ `8324100611`, 29,286,004 bytes,
+ `sha256:346afca964edbe932f868a8ff00e13adba7d3d0c489ef0bdce8ca275134dc27e`; macOS x64
+ `8324167852`, 26,427,328 bytes,
+ `sha256:0d265ebc18798680de250955daf9038fded4a45c596cb6609f847eef328d9668`; and macOS arm64
+ `8324088333`, 24,713,338 bytes,
+ `sha256:aed95365e3cf309f723142eb6638caad2faf46cacde60661c95cffb1703734cf`.
+- Duration and resource metrics: jobs ran 8m39s Windows arm64, 6m07s Windows x64, 3m42s Linux
+ arm64, 3m10s Linux x64, 5m45s macOS x64, and 2m43s macOS arm64. Windows x64 clean builds took
+ 127,019.748 ms and 80,495.086 ms; smoke took 5,383.956 ms at 53,903,360-byte RSS and
+ 5,343.569 ms at 53,874,688-byte RSS. Windows arm64 clean builds took 139,406.185 ms and
+ 123,440.275 ms; smoke took 5,782.042 ms at 51,310,592-byte RSS and 5,463.552 ms at
+ 51,372,032-byte RSS. SSH channels/files, cancellation, fallback delay, and connection latency
+ remain outside this artifact-only run.
+- Artifact/log/trace link: run/jobs and six unpublished artifacts above; no release asset was
+ published and no production consumer exists
+- Oracle proved: target-native generated/actual full-link settings, absence of incremental-link
+ databases, all-six clean-build reproducibility, exact archive/identity/SBOM/provenance equality,
+ complete candidate runtime smoke, strict comparison, and successful evidence upload. The prior
+ Windows arm64 thunk drift is closed at the copied producer without byte normalization.
+- Does not prove: oldest supported OS/kernel/libc execution, native code-signing trust, packaged
+ desktop embedding, SSH/SFTP/system-SSH transfer, remote install/launch, fallback, UI, performance,
+ publication, or any enabled tuple.
+- Checklist items satisfied: current-candidate native clean-build reproducibility and the exact
+ bundled Node/native PTY/watcher archive-execution rule. No tuple or production path is enabled.
+- Follow-up: audit the remaining runtime closure/SBOM/provenance claims against the exact staged
+ allowlist and purpose tests, then address oldest-baseline and native-trust gates. Preserve the
+ artifact-only boundary and all legacy/default behavior.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -5894,7 +5983,7 @@ owner and promotion condition.
| Bundled runtime only partially implemented | Six unpublished native artifact proofs; no production consumer | #8450/#1693 environment failures remain | Codex implementation owner | Complete Work Packages 2–7 plus Milestones 3–14 | Open |
| No bundled tuple enabled | Every target's default and effective mode remains legacy | No bundled support claim can be made | Codex implementation owner | Complete target-native build/trust and both required live-evidence layers | Open |
| Windows runtime smoke incomplete | Native x64/arm64 smoke settles and uploads exact evidence | Historical blocker is closed | Codex implementation owner | Met by E-M3-WINDOWS-CI-001 | CLOSED |
-| Native clean-rebuild identity unproved | Five controls pass; copied `/INCREMENTAL:NO` is locally green | Toolchain drift may change native content IDs | Codex implementation owner | Prove flag, no `.ilk`, and all-six equality on native runners | Open |
+| Native clean-rebuild identity unproved | All six native cells pass exact clean-build equality | Historical blocker is closed | Codex implementation owner | Met by E-M3-REPRODUCIBILITY-CI-001 | CLOSED |
| Cross-family Layer B remotes unavailable | GitHub native runner labels exist; no approved reachable target pool | Client/remote integration gaps may escape | Repository release administrator + implementation owner | Approve provider/snapshots/credentials/egress/teardown/cost owner | BLOCKED |
| Musl has no accepted official Node binary | Musl is deliberately legacy-only | Unofficial binary would break provenance trust | Codex implementation owner | Orca-owned target-native source build, signing, provenance, and live gates | ACCEPTED GAP |
| Native arm64 live matrices incomplete | Hosted Linux/Windows arm64 labels exist; full SSH/runtime cells do not | Cross-build or unit tests may hide native bugs | Codex implementation owner | Full native archive, trust, SFTP/system-SSH, RPC, and baseline evidence | Open |
@@ -5941,11 +6030,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `6dfdfa0bd` plus its evidence-ledger head, then rerun both Windows
-architectures and all four POSIX controls. Require both Windows clean builds to report exactly one
-`/INCREMENTAL:NO`, no target `.ilk`, complete smoke, exact output equality, and upload. Retain
-`/guard:cf`, strict parsing/comparison, and rejected-output no-upload.
-Cross-family Layer B targets, the protected manifest-signing environment,
-oldest-baseline/native-trust cells, and the paired legacy performance baseline remain
-release/default-path blockers; no publication, desktop resolver, SSH transfer/install, per-target
-Beta, fallback, tuple enablement, or default behavior may be connected by this package.
+Audit the exact staged runtime closure, licenses, SPDX, provenance, compiler/toolchain records, and
+prohibited-content allowlist against the current candidate bytes. Add or tighten purpose-named tests
+for every unsupported claim and record exact evidence before checking the remaining Milestone 3
+items. Then proceed to oldest-baseline and native-trust proof.
+
+Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
+trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
+publication, desktop resolver, SSH transfer/install, per-target Beta, fallback, tuple enablement, or
+default behavior may be connected by this package.
From ec5461affb5ad7b9dd94f0312aa80edc29c3cca7 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:52:32 -0400
Subject: [PATCH 055/267] build(ssh): enforce exact relay runtime closure
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 8 +
config/scripts/ssh-relay-runtime-closure.mjs | 252 ++++++++++++++++++
.../ssh-relay-runtime-closure.test.mjs | 179 +++++++++++++
config/scripts/ssh-relay-runtime-tree.mjs | 55 +---
.../ssh-relay-runtime-workflow.test.mjs | 4 +
5 files changed, 451 insertions(+), 47 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-closure.mjs
create mode 100644 config/scripts/ssh-relay-runtime-closure.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 6fe78588d0c..428196d010d 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -107,6 +107,8 @@ jobs:
node --check config/scripts/ssh-relay-runtime-reproducibility.test.mjs
node --check config/scripts/build-ssh-relay-runtime.mjs
node --check config/scripts/ssh-relay-runtime-build.test.mjs
+ node --check config/scripts/ssh-relay-runtime-closure.mjs
+ node --check config/scripts/ssh-relay-runtime-closure.test.mjs
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
@@ -116,6 +118,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs \
config/scripts/ssh-relay-runtime-artifact.test.mjs \
config/scripts/ssh-relay-runtime-build.test.mjs \
+ config/scripts/ssh-relay-runtime-closure.test.mjs \
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
@@ -279,6 +282,10 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw 'runtime build script syntax check failed' }
node --check config/scripts/ssh-relay-runtime-build.test.mjs
if ($LASTEXITCODE -ne 0) { throw 'runtime build test syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-closure.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime closure script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-closure.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime closure test syntax check failed' }
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
@@ -288,6 +295,7 @@ jobs:
config/scripts/ssh-relay-node-zip-inspection.test.mjs `
config/scripts/ssh-relay-runtime-artifact.test.mjs `
config/scripts/ssh-relay-runtime-build.test.mjs `
+ config/scripts/ssh-relay-runtime-closure.test.mjs `
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
config/scripts/ssh-relay-runtime-reproducibility.test.mjs `
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
diff --git a/config/scripts/ssh-relay-runtime-closure.mjs b/config/scripts/ssh-relay-runtime-closure.mjs
new file mode 100644
index 00000000000..b6dfa9aa5a6
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-closure.mjs
@@ -0,0 +1,252 @@
+import { readFile } from 'node:fs/promises'
+import { isDeepStrictEqual } from 'node:util'
+import { join } from 'node:path'
+
+const NODE_VERSION = '24.18.0'
+const NODE_PTY_VERSION = '1.1.0'
+const PARCEL_WATCHER_VERSION = '2.5.6'
+
+const WATCHER_PACKAGES = Object.freeze({
+ 'linux-x64-glibc': '@parcel/watcher-linux-x64-glibc',
+ 'linux-arm64-glibc': '@parcel/watcher-linux-arm64-glibc',
+ 'darwin-x64': '@parcel/watcher-darwin-x64',
+ 'darwin-arm64': '@parcel/watcher-darwin-arm64',
+ 'win32-x64': '@parcel/watcher-win32-x64',
+ 'win32-arm64': '@parcel/watcher-win32-arm64'
+})
+
+const COMMON_FILES = Object.freeze([
+ '.version',
+ 'THIRD_PARTY_LICENSES.txt',
+ 'node_modules/@parcel/watcher/index.js',
+ 'node_modules/@parcel/watcher/package.json',
+ 'node_modules/@parcel/watcher/wrapper.js',
+ 'node_modules/detect-libc/lib/detect-libc.js',
+ 'node_modules/detect-libc/lib/elf.js',
+ 'node_modules/detect-libc/lib/filesystem.js',
+ 'node_modules/detect-libc/lib/process.js',
+ 'node_modules/detect-libc/package.json',
+ 'node_modules/is-extglob/index.js',
+ 'node_modules/is-extglob/package.json',
+ 'node_modules/is-glob/index.js',
+ 'node_modules/is-glob/package.json',
+ 'node_modules/node-pty/lib/eventEmitter2.js',
+ 'node_modules/node-pty/lib/index.js',
+ 'node_modules/node-pty/lib/terminal.js',
+ 'node_modules/node-pty/lib/utils.js',
+ 'node_modules/node-pty/package.json',
+ 'node_modules/picomatch/index.js',
+ 'node_modules/picomatch/lib/constants.js',
+ 'node_modules/picomatch/lib/parse.js',
+ 'node_modules/picomatch/lib/picomatch.js',
+ 'node_modules/picomatch/lib/scan.js',
+ 'node_modules/picomatch/lib/utils.js',
+ 'node_modules/picomatch/package.json',
+ 'relay-watcher.js',
+ 'relay.js',
+ 'runtime-metadata.json'
+])
+
+const POSIX_NODE_PTY_FILES = Object.freeze([
+ 'node_modules/node-pty/build/Release/pty.node',
+ 'node_modules/node-pty/lib/unixTerminal.js'
+])
+
+const WINDOWS_NODE_PTY_FILES = Object.freeze([
+ 'node_modules/node-pty/build/Release/conpty.node',
+ 'node_modules/node-pty/build/Release/conpty/OpenConsole.exe',
+ 'node_modules/node-pty/build/Release/conpty/conpty.dll',
+ 'node_modules/node-pty/build/Release/conpty_console_list.node',
+ 'node_modules/node-pty/lib/conpty_console_list_agent.js',
+ 'node_modules/node-pty/lib/shared/conout.js',
+ 'node_modules/node-pty/lib/windowsConoutConnection.js',
+ 'node_modules/node-pty/lib/windowsPtyAgent.js',
+ 'node_modules/node-pty/lib/windowsTerminal.js',
+ 'node_modules/node-pty/lib/worker/conoutSocketWorker.js'
+])
+
+export function sshRelayRuntimeWatcherPackage(tuple) {
+ const packageName = WATCHER_PACKAGES[tuple]
+ if (!packageName) {
+ throw new Error(`No bundled Parcel watcher package is defined for ${tuple}`)
+ }
+ return packageName
+}
+
+export function sshRelayRuntimeFileRole(path) {
+ if (path === 'bin/node' || path === 'bin/node.exe') {
+ return 'node'
+ }
+ if (path === 'relay.js') {
+ return 'relay'
+ }
+ if (path === 'relay-watcher.js') {
+ return 'relay-watcher'
+ }
+ if (/\/(?:pty|conpty|conpty_console_list)\.node$/.test(path)) {
+ return 'node-pty-native'
+ }
+ if (path.endsWith('/watcher.node')) {
+ return 'parcel-watcher-native'
+ }
+ if (
+ path.endsWith('/spawn-helper') ||
+ path.endsWith('/conpty/conpty.dll') ||
+ path.endsWith('/conpty/OpenConsole.exe')
+ ) {
+ return 'native-runtime'
+ }
+ if (path === 'THIRD_PARTY_LICENSES.txt') {
+ return 'license'
+ }
+ return 'runtime-javascript'
+}
+
+function expectedFiles(tuple) {
+ const watcherPackage = sshRelayRuntimeWatcherPackage(tuple)
+ const paths = [
+ ...COMMON_FILES,
+ tuple.startsWith('win32-') ? 'bin/node.exe' : 'bin/node',
+ `node_modules/${watcherPackage}/package.json`,
+ `node_modules/${watcherPackage}/watcher.node`,
+ ...(tuple.startsWith('win32-') ? WINDOWS_NODE_PTY_FILES : POSIX_NODE_PTY_FILES)
+ ]
+ if (tuple.startsWith('darwin-')) {
+ paths.push('node_modules/node-pty/build/Release/spawn-helper')
+ }
+ return paths.sort().map((path) => {
+ const role = sshRelayRuntimeFileRole(path)
+ const mode = ['node', 'node-pty-native', 'parcel-watcher-native', 'native-runtime'].includes(
+ role
+ )
+ ? 0o755
+ : 0o644
+ return { path, type: 'file', role, mode }
+ })
+}
+
+function expectedDirectories(files) {
+ const paths = new Set()
+ for (const file of files) {
+ const segments = file.path.split('/')
+ for (let depth = 1; depth < segments.length; depth += 1) {
+ paths.add(segments.slice(0, depth).join('/'))
+ }
+ }
+ return [...paths].sort().map((path) => ({ path, type: 'directory', mode: 0o755 }))
+}
+
+export function expectedSshRelayRuntimeClosureEntries(tuple) {
+ const files = expectedFiles(tuple)
+ return [...expectedDirectories(files), ...files]
+}
+
+function indexEntries(entries, type) {
+ const indexed = new Map()
+ for (const entry of entries.filter((candidate) => candidate.type === type)) {
+ if (indexed.has(entry.path)) {
+ throw new Error(`Runtime closure contains a duplicate ${type}: ${entry.path}`)
+ }
+ indexed.set(entry.path, entry)
+ }
+ return indexed
+}
+
+function assertExactEntries(actualEntries, expectedEntries, type) {
+ const actual = indexEntries(actualEntries, type)
+ const expected = indexEntries(expectedEntries, type)
+ for (const [path, contract] of expected) {
+ const entry = actual.get(path)
+ if (!entry) {
+ throw new Error(`Runtime closure is missing required ${type}: ${path}`)
+ }
+ for (const field of type === 'file' ? ['role', 'mode'] : ['mode']) {
+ if (entry[field] !== contract[field]) {
+ throw new Error(`Runtime closure ${type} has unexpected ${field}: ${path}`)
+ }
+ }
+ actual.delete(path)
+ }
+ if (actual.size > 0) {
+ throw new Error(`Runtime closure contains undeclared ${type}: ${actual.keys().next().value}`)
+ }
+}
+
+export function assertSshRelayRuntimeClosureEntries(identity) {
+ if (
+ identity.nodeVersion !== NODE_VERSION ||
+ identity.dependencies?.nodePtyVersion !== NODE_PTY_VERSION ||
+ identity.dependencies?.parcelWatcherVersion !== PARCEL_WATCHER_VERSION
+ ) {
+ // Why: dependency refreshes require a reviewed desktop release and a new immutable manifest.
+ throw new Error('Runtime closure dependency versions do not match the reviewed contract')
+ }
+ const expected = expectedSshRelayRuntimeClosureEntries(identity.tupleId)
+ assertExactEntries(identity.entries, expected, 'directory')
+ assertExactEntries(identity.entries, expected, 'file')
+}
+
+function expectedPackages(tuple) {
+ const watcherPackage = sshRelayRuntimeWatcherPackage(tuple)
+ return [
+ { name: 'node-pty', version: NODE_PTY_VERSION, main: './lib/index.js', license: 'MIT' },
+ { name: '@parcel/watcher', version: PARCEL_WATCHER_VERSION, main: 'index.js', license: 'MIT' },
+ { name: watcherPackage, version: PARCEL_WATCHER_VERSION, main: 'watcher.node', license: 'MIT' },
+ { name: 'detect-libc', version: '2.1.2', main: 'lib/detect-libc.js', license: 'Apache-2.0' },
+ { name: 'is-glob', version: '4.0.3', main: 'index.js', license: 'MIT' },
+ { name: 'is-extglob', version: '2.1.1', main: 'index.js', license: 'MIT' },
+ { name: 'picomatch', version: '4.0.4', main: 'index.js', license: 'MIT' }
+ ]
+}
+
+function assertLicenseSections(text, packageNames) {
+ const matches = [...text.matchAll(/^===== ([^\r\n]+) =====$/gm)]
+ const names = matches.map((match) => match[1])
+ if (!isDeepStrictEqual(names, ['Node.js', ...packageNames])) {
+ throw new Error('Runtime license bundle does not match the exact package closure')
+ }
+ for (let index = 0; index < matches.length; index += 1) {
+ const bodyStart = matches[index].index + matches[index][0].length
+ const bodyEnd = matches[index + 1]?.index ?? text.length
+ if (text.slice(bodyStart, bodyEnd).trim().length === 0) {
+ throw new Error(`Runtime license bundle has an empty section: ${matches[index][1]}`)
+ }
+ }
+}
+
+export async function verifySshRelayRuntimeClosure(runtimeRoot, identity) {
+ assertSshRelayRuntimeClosureEntries(identity)
+ const packages = expectedPackages(identity.tupleId)
+ for (const expected of packages) {
+ const path = join(runtimeRoot, 'node_modules', ...expected.name.split('/'), 'package.json')
+ const actual = JSON.parse(await readFile(path, 'utf8'))
+ if (!isDeepStrictEqual(actual, expected)) {
+ throw new Error(
+ `Runtime package metadata does not match the closure contract: ${expected.name}`
+ )
+ }
+ }
+ const [licenseText, versionText, metadataText] = await Promise.all([
+ readFile(join(runtimeRoot, 'THIRD_PARTY_LICENSES.txt'), 'utf8'),
+ readFile(join(runtimeRoot, '.version'), 'utf8'),
+ readFile(join(runtimeRoot, 'runtime-metadata.json'), 'utf8')
+ ])
+ assertLicenseSections(
+ licenseText,
+ packages.map((entry) => entry.name)
+ )
+ const metadata = JSON.parse(metadataText)
+ if (
+ metadata.schemaVersion !== 1 ||
+ metadata.tuple !== identity.tupleId ||
+ metadata.nodeVersion !== identity.nodeVersion ||
+ metadata.relayBuildVersion !== versionText.trim() ||
+ !isDeepStrictEqual(metadata.dependencies, {
+ nodePtyVersion: NODE_PTY_VERSION,
+ parcelWatcherVersion: PARCEL_WATCHER_VERSION
+ })
+ ) {
+ throw new Error('Runtime metadata does not match the exact package closure')
+ }
+ return { files: identity.entries.filter((entry) => entry.type === 'file').length, packages: 7 }
+}
diff --git a/config/scripts/ssh-relay-runtime-closure.test.mjs b/config/scripts/ssh-relay-runtime-closure.test.mjs
new file mode 100644
index 00000000000..d107a2da4c7
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-closure.test.mjs
@@ -0,0 +1,179 @@
+import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { dirname, join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import {
+ assertSshRelayRuntimeClosureEntries,
+ expectedSshRelayRuntimeClosureEntries,
+ verifySshRelayRuntimeClosure
+} from './ssh-relay-runtime-closure.mjs'
+
+const temporaryDirectories = []
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+const watcherPackages = Object.freeze({
+ 'linux-x64-glibc': '@parcel/watcher-linux-x64-glibc',
+ 'linux-arm64-glibc': '@parcel/watcher-linux-arm64-glibc',
+ 'darwin-x64': '@parcel/watcher-darwin-x64',
+ 'darwin-arm64': '@parcel/watcher-darwin-arm64',
+ 'win32-x64': '@parcel/watcher-win32-x64',
+ 'win32-arm64': '@parcel/watcher-win32-arm64'
+})
+
+function identity(tuple) {
+ return {
+ tupleId: tuple,
+ nodeVersion: '24.18.0',
+ dependencies: { nodePtyVersion: '1.1.0', parcelWatcherVersion: '2.5.6' },
+ entries: expectedSshRelayRuntimeClosureEntries(tuple)
+ }
+}
+
+function packageRecords(tuple) {
+ return [
+ { name: 'node-pty', version: '1.1.0', main: './lib/index.js', license: 'MIT' },
+ { name: '@parcel/watcher', version: '2.5.6', main: 'index.js', license: 'MIT' },
+ { name: watcherPackages[tuple], version: '2.5.6', main: 'watcher.node', license: 'MIT' },
+ { name: 'detect-libc', version: '2.1.2', main: 'lib/detect-libc.js', license: 'Apache-2.0' },
+ { name: 'is-glob', version: '4.0.3', main: 'index.js', license: 'MIT' },
+ { name: 'is-extglob', version: '2.1.1', main: 'index.js', license: 'MIT' },
+ { name: 'picomatch', version: '4.0.4', main: 'index.js', license: 'MIT' }
+ ]
+}
+
+async function writeClosureMetadata(tuple = 'linux-x64-glibc') {
+ const runtimeRoot = await mkdtemp(join(tmpdir(), 'orca-runtime-closure-'))
+ temporaryDirectories.push(runtimeRoot)
+ const packages = packageRecords(tuple)
+ for (const record of packages) {
+ const path = join(runtimeRoot, 'node_modules', ...record.name.split('/'), 'package.json')
+ await mkdir(dirname(path), { recursive: true })
+ await writeFile(path, `${JSON.stringify(record, null, 2)}\n`)
+ }
+ await writeFile(join(runtimeRoot, '.version'), '1.4.140+123456789abc\n')
+ await writeFile(
+ join(runtimeRoot, 'runtime-metadata.json'),
+ `${JSON.stringify(
+ {
+ schemaVersion: 1,
+ tuple,
+ nodeVersion: '24.18.0',
+ relayBuildVersion: '1.4.140+123456789abc',
+ dependencies: { nodePtyVersion: '1.1.0', parcelWatcherVersion: '2.5.6' }
+ },
+ null,
+ 2
+ )}\n`
+ )
+ const licenseNames = ['Node.js', ...packages.map((entry) => entry.name)]
+ await writeFile(
+ join(runtimeRoot, 'THIRD_PARTY_LICENSES.txt'),
+ `${licenseNames.map((name) => `===== ${name} =====\n${name} license text\n`).join('\n')}\n`
+ )
+ return { runtimeRoot, packages }
+}
+
+describe('SSH relay runtime exact closure', () => {
+ it.each([
+ ['linux-x64-glibc', 34],
+ ['linux-arm64-glibc', 34],
+ ['darwin-x64', 35],
+ ['darwin-arm64', 35],
+ ['win32-x64', 42],
+ ['win32-arm64', 42]
+ ])('pins the reviewed %s runtime to %i files and one native watcher', (tuple, fileCount) => {
+ const entries = expectedSshRelayRuntimeClosureEntries(tuple)
+ const files = entries.filter((entry) => entry.type === 'file')
+ expect(files).toHaveLength(fileCount)
+ expect(files.filter((entry) => entry.role === 'parcel-watcher-native')).toEqual([
+ expect.objectContaining({ path: `node_modules/${watcherPackages[tuple]}/watcher.node` })
+ ])
+ expect(files.map((entry) => entry.path)).not.toEqual(
+ expect.arrayContaining([
+ expect.stringMatching(/(?:^|\/)(?:npm|npx|corepack|pnpm|yarn)(?:\.|\/|$)/i),
+ expect.stringMatching(/\.(?:map|pdb|ilk|cc|cpp|c|h|hpp|o|obj)$/i)
+ ])
+ )
+ expect(() => assertSshRelayRuntimeClosureEntries(identity(tuple))).not.toThrow()
+ })
+
+ it('rejects undeclared package managers, source maps, and native build outputs', () => {
+ const fixture = identity('linux-x64-glibc')
+ for (const path of [
+ 'node_modules/npm/bin/npm-cli.js',
+ 'relay.js.map',
+ 'node_modules/node-pty/build/Release/pty.pdb'
+ ]) {
+ expect(() =>
+ assertSshRelayRuntimeClosureEntries({
+ ...fixture,
+ entries: [
+ ...fixture.entries,
+ { path, type: 'file', role: 'runtime-javascript', mode: 0o644 }
+ ]
+ })
+ ).toThrow(/undeclared file/i)
+ }
+ })
+
+ it('rejects a missing native dependency, wrong role, or unreviewed dependency refresh', () => {
+ const fixture = identity('darwin-arm64')
+ expect(() =>
+ assertSshRelayRuntimeClosureEntries({
+ ...fixture,
+ entries: fixture.entries.filter((entry) => !entry.path.endsWith('/watcher.node'))
+ })
+ ).toThrow(/missing required file/i)
+ expect(() =>
+ assertSshRelayRuntimeClosureEntries({
+ ...fixture,
+ entries: fixture.entries.map((entry) =>
+ entry.path === 'bin/node' ? { ...entry, role: 'runtime-javascript' } : entry
+ )
+ })
+ ).toThrow(/unexpected role/i)
+ expect(() =>
+ assertSshRelayRuntimeClosureEntries({ ...fixture, nodeVersion: '24.19.0' })
+ ).toThrow(/dependency versions/i)
+ })
+
+ it('verifies exact package metadata, runtime metadata, and non-empty license sections', async () => {
+ const fixture = await writeClosureMetadata()
+ await expect(
+ verifySshRelayRuntimeClosure(fixture.runtimeRoot, identity('linux-x64-glibc'))
+ ).resolves.toEqual({ files: 34, packages: 7 })
+
+ const packagePath = join(fixture.runtimeRoot, 'node_modules', 'node-pty', 'package.json')
+ const packageJson = JSON.parse(await readFile(packagePath, 'utf8'))
+ await writeFile(packagePath, `${JSON.stringify({ ...packageJson, version: '1.1.1' })}\n`)
+ await expect(
+ verifySshRelayRuntimeClosure(fixture.runtimeRoot, identity('linux-x64-glibc'))
+ ).rejects.toThrow(/node-pty/i)
+ })
+
+ it('rejects omitted and empty dependency license sections', async () => {
+ const fixture = await writeClosureMetadata()
+ const licensePath = join(fixture.runtimeRoot, 'THIRD_PARTY_LICENSES.txt')
+ const licenseText = await readFile(licensePath, 'utf8')
+ await writeFile(licensePath, licenseText.replace(/===== picomatch =====[\s\S]*$/, ''))
+ await expect(
+ verifySshRelayRuntimeClosure(fixture.runtimeRoot, identity('linux-x64-glibc'))
+ ).rejects.toThrow(/license bundle/i)
+
+ const second = await writeClosureMetadata()
+ const secondLicensePath = join(second.runtimeRoot, 'THIRD_PARTY_LICENSES.txt')
+ const secondText = await readFile(secondLicensePath, 'utf8')
+ await writeFile(
+ secondLicensePath,
+ secondText.replace('===== picomatch =====\npicomatch license text', '===== picomatch =====')
+ )
+ await expect(
+ verifySshRelayRuntimeClosure(second.runtimeRoot, identity('linux-x64-glibc'))
+ ).rejects.toThrow(/empty section/i)
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-tree.mjs b/config/scripts/ssh-relay-runtime-tree.mjs
index e524e3ea199..ffe15e33f05 100644
--- a/config/scripts/ssh-relay-runtime-tree.mjs
+++ b/config/scripts/ssh-relay-runtime-tree.mjs
@@ -4,6 +4,11 @@ import { createRequire } from 'node:module'
import { dirname, join, relative, sep } from 'node:path'
import { computeSshRelayRuntimeContentId } from './ssh-relay-runtime-identity.mjs'
+import {
+ sshRelayRuntimeFileRole,
+ sshRelayRuntimeWatcherPackage,
+ verifySshRelayRuntimeClosure
+} from './ssh-relay-runtime-closure.mjs'
const require = createRequire(import.meta.url)
const MAX_FILES = 5_000
@@ -53,15 +58,6 @@ const COMPATIBILITY = Object.freeze({
}
})
-const WATCHER_PACKAGES = Object.freeze({
- 'linux-x64-glibc': '@parcel/watcher-linux-x64-glibc',
- 'linux-arm64-glibc': '@parcel/watcher-linux-arm64-glibc',
- 'darwin-x64': '@parcel/watcher-darwin-x64',
- 'darwin-arm64': '@parcel/watcher-darwin-arm64',
- 'win32-x64': '@parcel/watcher-win32-x64',
- 'win32-arm64': '@parcel/watcher-win32-arm64'
-})
-
function packageDirectory(name) {
return dirname(require.resolve(`${name}/package.json`))
}
@@ -176,10 +172,7 @@ async function copyPackageRuntime(name, runtimeRoot, relativePaths) {
}
async function copyParcelWatcher(runtimeRoot, tuple) {
- const watcherPackage = WATCHER_PACKAGES[tuple]
- if (!watcherPackage) {
- throw new Error(`No bundled Parcel watcher package is defined for ${tuple}`)
- }
+ const watcherPackage = sshRelayRuntimeWatcherPackage(tuple)
await copyPackageRuntime('@parcel/watcher', runtimeRoot, ['index.js', 'wrapper.js'])
await copyPackageRuntime(watcherPackage, runtimeRoot, ['watcher.node'])
await chmod(
@@ -221,39 +214,6 @@ async function writeLicenses(runtimeRoot, nodeRoot, packages) {
await chmod(join(runtimeRoot, 'THIRD_PARTY_LICENSES.txt'), 0o644)
}
-function runtimeRole(path) {
- if (path === 'bin/node' || path === 'bin/node.exe') {
- return 'node'
- }
- if (path === 'relay.js') {
- return 'relay'
- }
- if (path === 'relay-watcher.js') {
- return 'relay-watcher'
- }
- if (
- path.endsWith('/pty.node') ||
- path.endsWith('/conpty.node') ||
- path.endsWith('/conpty_console_list.node')
- ) {
- return 'node-pty-native'
- }
- if (path.endsWith('/watcher.node')) {
- return 'parcel-watcher-native'
- }
- if (
- path.endsWith('/spawn-helper') ||
- path.endsWith('/conpty/conpty.dll') ||
- path.endsWith('/conpty/OpenConsole.exe')
- ) {
- return 'native-runtime'
- }
- if (path === 'THIRD_PARTY_LICENSES.txt') {
- return 'license'
- }
- return 'runtime-javascript'
-}
-
function assertPortableRuntimePath(path) {
const segments = path.split('/')
if (
@@ -301,7 +261,7 @@ async function collectEntries(runtimeRoot) {
if (metadata.size > MAX_FILE_BYTES) {
throw new Error(`Runtime file exceeds size limit: ${path}`)
}
- const role = runtimeRole(path)
+ const role = sshRelayRuntimeFileRole(path)
// Why: NTFS has no POSIX execute bits; ZIP metadata carries the canonical runtime mode.
const mode =
process.platform === 'win32' &&
@@ -392,5 +352,6 @@ export async function assembleSshRelayRuntimeTree({
dependencies: { nodePtyVersion: '1.1.0', parcelWatcherVersion: '2.5.6' },
entries: tree.entries
}
+ await verifySshRelayRuntimeClosure(runtimeRoot, identity)
return { ...identity, contentId: computeSshRelayRuntimeContentId(identity), ...tree }
}
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 553a01217e1..1815d229a8e 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -61,6 +61,10 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('foreach ($output in @($firstOutput, $secondOutput))')
expect(source).toContain('ssh-relay-runtime-reproducibility.mjs')
expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
+ expect(source.match(/ssh-relay-runtime-closure\.test\.mjs/g)).toHaveLength(4)
+ expect(
+ source.match(/node --check config\/scripts\/ssh-relay-runtime-closure\.mjs/g)
+ ).toHaveLength(2)
expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.mjs')
expect(source).toContain('ssh-relay-runtime-windows-pe-diagnostic.test.mjs')
expect(source).toContain('llvm-objdump.exe')
From ace3d4f416b1c710d601aa72c4b45824266b5cad Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 16:54:50 -0400
Subject: [PATCH 056/267] docs(ssh): record exact runtime closure gate
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 7 +-
...github-release-implementation-checklist.md | 130 +++++++++++++++---
2 files changed, 115 insertions(+), 22 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index b5945925010..6f64636b468 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -18,8 +18,9 @@ Approved design decisions are listed separately and are not presented as impleme
- Latest native proof: [GitHub Actions run 29365815434](https://github.com/stablyai/orca/actions/runs/29365815434)
passed clean-build equality and runtime smoke on Linux x64/arm64, macOS x64/arm64, and Windows
x64/arm64.
-- Active work package: finish the artifact/runtime closure audit, then address archive safety,
- oldest-baseline execution, and native trust.
+- Active work package: exact runtime closure enforcement is locally green and awaiting all-six
+ native proof; SBOM/provenance completeness, archive safety, oldest-baseline execution, and native
+ trust remain open.
## Locked rollout decisions
@@ -73,6 +74,8 @@ Approved design decisions are listed separately and are not presented as impleme
- [x] Prove bundled Node, real PTY input/resize/exit, watcher events, and Windows resource settlement.
- [x] Prove two clean builds compare exactly on all six native GitHub runner families.
- [x] Keep `/guard:cf`; fix Windows arm64 drift with copied-artifact-only `/INCREMENTAL:NO`.
+- [x] Define and locally test an exact 34/35/42-file per-tuple closure that rejects undeclared
+ package managers, sources, maps, build outputs, package drift, and missing licenses.
- [ ] Complete the runtime closure, license, SBOM, provenance, and prohibited-content allowlist audit.
- [ ] Prove each candidate on its oldest supported OS/libc/kernel baseline.
- [ ] Sign macOS and Windows native bytes and verify target-native trust policy.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 88a07cc83e2..a5d9228a9db 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 runtime closure — exact-head run [29365815434](https://github.com/stablyai/orca/actions/runs/29365815434) at ledger head `3ec1a48af` passes all six target-native jobs under E-M3-REPRODUCIBILITY-CI-001; both Windows clean builds propagate exactly one copied-artifact `/INCREMENTAL:NO`, retain `/guard:cf`, emit no target `.ilk`, complete bundled-Node/native/PTy/watcher smoke, compare the full runtime/archive/identity/SBOM/provenance exactly, and upload; the Windows arm64 2,879-thunk drift is closed without normalization or a repository-wide change; the active artifact-only slice is auditing and closing the remaining runtime closure/SBOM/provenance checklist claims before oldest-baseline and native-trust work; production/default behavior and every tuple state remain unchanged; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 runtime closure — exact implementation commit `ec5461aff` moves the exact per-tuple closure/prohibited-content/package/license gate into the artifact builder and is locally green under E-M3-RUNTIME-CLOSURE-LOCAL-001; all six prior candidate archives from run [29365815434](https://github.com/stablyai/orca/actions/runs/29365815434) satisfy the new 34/35/42-file closure, but the new builder gate has not yet run target-natively and no Milestone 3 completion box is closed by local/static reuse alone; the next exact-head six-cell run must retain the proven content IDs, enforce the closure before archiving, complete smoke and clean-build equality, and upload before this slice is accepted; SBOM/provenance completeness, compiler/toolchain records, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,11 +175,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: audit the exact staged runtime closure, licenses, SPDX, provenance,
- compiler/toolchain records, and prohibited-content allowlist against the current candidate bytes.
- Check only claims supported by exact purpose tests and evidence IDs, then proceed to the
- oldest-baseline and native-trust gates. Preserve the artifact-only boundary, legacy/default path,
- and every other release gate.
+- Next required action: push exact implementation commit `ec5461aff` plus its evidence-ledger head
+ and rerun all six target-native cells. Require the builder-enforced closure, unchanged runtime
+ content IDs, complete smoke, clean-build equality, and upload before checking the related
+ Milestone 3 claims. Then fix the separately identified SBOM/provenance/toolchain gaps. Preserve the
+ artifact-only boundary, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -763,6 +763,14 @@ the full bundled runtime smoke, compare every runtime/archive/identity/SBOM/prov
and upload. Windows arm64 now has one stable content ID and archive digest, closing the native
clean-build reproducibility gap without post-build normalization (E-M3-REPRODUCIBILITY-CI-001).
+Exact implementation commit `ec5461aff` replaces workflow-only prohibited-file checks as the
+authoritative boundary with an exact builder-enforced per-tuple closure. It pins 34 Linux, 35 macOS,
+and 42 Windows files; exact package metadata and dependency versions; exactly one tuple-native
+watcher; file roles/modes; runtime metadata; and ordered, non-empty license sections. The local
+hostile suite and all six downloaded prior candidate archives pass under
+E-M3-RUNTIME-CLOSURE-LOCAL-001. Target-native execution of the new gate remains required before the
+related implementation claims are checked.
+
Each runtime must contain only the executable closure required by the relay.
- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
@@ -1367,16 +1375,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; all-six reproducibility green; closure/trust pending | `3ec1a48af`; E-M3-REPRODUCIBILITY-CI-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; exact closure locally green; native closure/trust pending | `ec5461aff`; E-M3-RUNTIME-CLOSURE-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1433,6 +1441,7 @@ focused commands as their scripts/tests are introduced.
- [x] `node config/scripts/verify-ssh-relay-node-release-inputs.mjs --inputs-directory --archive win32-x64` (E-M3-WINDOWS-INPUT-001; signed real Node ZIP, headers, and import library; no Windows execution)
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --work-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001, E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; local native Linux arm64 history plus current stable-work contract)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-*.test.mjs` (E-M3-RUNTIME-CLOSURE-LOCAL-001; 68 local artifact-contract tests plus static reuse of six prior candidate archives; new target-native builder execution remains pending)
### Commands/scripts that must be added or formally identified
@@ -5973,6 +5982,86 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
allowlist and purpose tests, then address oldest-baseline and native-trust gates. Preserve the
artifact-only boundary and all legacy/default behavior.
+### E-M3-RUNTIME-CLOSURE-LOCAL-001 — Exact per-tuple closure fails before archiving
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `ec5461aff61d6868c18d4db1ce27f409a43ecf47`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for the pure contract suite. Candidate inputs came from all six target-native jobs in
+ prior run [29365815434](https://github.com/stablyai/orca/actions/runs/29365815434); the new builder
+ gate has not yet executed on those native runners.
+- Remote and transport: none; artifact-only local validation of downloaded unpublished evidence
+- Exact evidence commands:
+
+ ```sh
+ gh run download 29365815434 --repo stablyai/orca \
+ --dir /tmp/orca-ssh-relay-runtime-29365815434
+ for archive in /tmp/orca-ssh-relay-runtime-29365815434/*/*.tar.xz; do
+ tar -tf "$archive"
+ done
+ for archive in /tmp/orca-ssh-relay-runtime-29365815434/*/*.zip; do
+ unzip -Z1 "$archive"
+ done
+ rm -rf /tmp/orca-ssh-relay-runtime-29365815434/extracted
+ mkdir -p /tmp/orca-ssh-relay-runtime-29365815434/extracted
+ for directory in /tmp/orca-ssh-relay-runtime-29365815434/ssh-relay-runtime-*; do
+ tuple=${directory##*/ssh-relay-runtime-}
+ destination=/tmp/orca-ssh-relay-runtime-29365815434/extracted/$tuple
+ mkdir -p "$destination"
+ archive=$(find "$directory" -maxdepth 1 -type f \
+ \( -name '*.tar.xz' -o -name '*.zip' \) -print -quit)
+ case "$archive" in
+ *.tar.xz) tar -xf "$archive" -C "$destination" ;;
+ *.zip) unzip -q "$archive" -d "$destination" ;;
+ esac
+ done
+ node --input-type=module -e 'import {readdir,readFile} from "node:fs/promises"; import {join} from "node:path"; import {verifySshRelayRuntimeClosure} from "./config/scripts/ssh-relay-runtime-closure.mjs"; const root="/tmp/orca-ssh-relay-runtime-29365815434"; for (const dir of (await readdir(root)).filter((name)=>name.startsWith("ssh-relay-runtime-")).sort()) { const tuple=dir.slice("ssh-relay-runtime-".length); const names=await readdir(join(root,dir)); const identity=JSON.parse(await readFile(join(root,dir,names.find((name)=>name.endsWith(".identity.json"))),"utf8")); const result=await verifySshRelayRuntimeClosure(join(root,"extracted",tuple),identity); console.log(JSON.stringify({tuple,...result,contentId:identity.contentId})); }'
+ pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-*.test.mjs
+ pnpm exec oxlint config/scripts/ssh-relay-runtime-closure.mjs \
+ config/scripts/ssh-relay-runtime-closure.test.mjs \
+ config/scripts/ssh-relay-runtime-tree.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs \
+ config/scripts/ssh-relay-runtime-closure.mjs \
+ config/scripts/ssh-relay-runtime-closure.test.mjs \
+ config/scripts/ssh-relay-runtime-tree.mjs
+ pnpm run check:max-lines-ratchet
+ git diff --check
+ ```
+
+- Result: PASS. Sixteen artifact test files passed 68 tests. The new closure suite fixes the exact
+ candidate file counts at 34 for Linux, 35 for macOS, and 42 for Windows; admits exactly one
+ tuple-native `@parcel/watcher@2.5.6` package; pins `node-pty@1.1.0` and all runtime JavaScript
+ dependency metadata; requires canonical roles/modes, runtime metadata, and eight ordered,
+ non-empty license sections; and rejects an undeclared package manager, source map, PDB, missing
+ native dependency, wrong role, version refresh, omitted license, or empty license before archive
+ creation. Focused syntax, lint, formatting, max-lines ratchet, and diff checks passed.
+- Downloaded-candidate audit: all six prior candidate identities and extracted metadata satisfy the
+ new contract without changing their content IDs: Linux x64
+ `sha256:960546cd96c67fcf9bb0a61e96ecdbecbffd9104d3a495578f8bb19dd810649a`, Linux arm64
+ `sha256:aa3aa8ae8b42334ba7b0dbe5c43fd1184e36b3f4f4a9bec0e990e9b78f090756`, macOS x64
+ `sha256:585ea6034cdd07487d8667059f975a877c795a45dc0d6eeee1617f2e3749faa2`, macOS arm64
+ `sha256:40ff5d2036784b794e7b09f78596409f63f3145280c530bece5280d40897f6cb`, Windows x64
+ `sha256:6f7cbeb120e67766037649f6079099346220973e6158e1429b6ebf42729f1564`, and Windows arm64
+ `sha256:741765a10ddc824cd305b9a50c8efd91477517c05d9cfe1ca46342c002652186`.
+- Oracle proved: the artifact builder now has one cross-platform, fail-closed, exact closure boundary
+ rather than depending on incomplete POSIX/PowerShell workflow blocklists; dependency refreshes and
+ new runtime files require an explicit reviewed contract change; the prior six candidate trees
+ conform to that contract.
+- Does not prove: execution of this new gate on any target-native runner, that the current SBOM has
+ complete package/file relationships, complete compiler/toolchain/image provenance, oldest-
+ baseline execution, native trust, SSH transfer/install, publication, fallback, UI, or any enabled
+ tuple.
+- Checklist items satisfied: local exact-closure/prohibited-content implementation and purpose tests
+ only. The broader Milestone 3 closure/SBOM/provenance items remain unchecked until the new gate
+ passes all six native cells and the metadata audit closes its residual gaps.
+- Follow-up: push the implementation plus this exact evidence ledger, rerun all six native jobs, and
+ require unchanged runtime content IDs, builder-enforced closure, complete smoke, clean-build
+ equality, and upload. Then fix and prove SBOM/provenance completeness separately.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6030,10 +6119,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Audit the exact staged runtime closure, licenses, SPDX, provenance, compiler/toolchain records, and
-prohibited-content allowlist against the current candidate bytes. Add or tighten purpose-named tests
-for every unsupported claim and record exact evidence before checking the remaining Milestone 3
-items. Then proceed to oldest-baseline and native-trust proof.
+Push exact implementation commit `ec5461aff` plus its evidence-ledger head and rerun all six target-
+native cells. Require the builder-enforced exact closure, unchanged runtime content IDs, complete
+smoke, clean-build equality, and upload before checking the related Milestone 3 claims. Then correct
+and prove SBOM/provenance/toolchain completeness as a separate artifact-only slice before proceeding
+to oldest-baseline and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From 26bbd7b67a035cdf309ccdbbaab5985f4cc797fe Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:06:44 -0400
Subject: [PATCH 057/267] build(ssh): complete runtime artifact provenance
Co-authored-by: Orca
---
.../workflows/ssh-relay-runtime-artifacts.yml | 25 ++
config/scripts/build-ssh-relay-runtime.mjs | 40 +--
.../scripts/ssh-relay-runtime-provenance.mjs | 78 +-----
.../ssh-relay-runtime-provenance.test.mjs | 158 +++++++++++
config/scripts/ssh-relay-runtime-sbom.mjs | 125 +++++++++
.../scripts/ssh-relay-runtime-sbom.test.mjs | 122 +++++++++
.../scripts/ssh-relay-runtime-toolchain.mjs | 252 ++++++++++++++++++
.../ssh-relay-runtime-toolchain.test.mjs | 112 ++++++++
.../ssh-relay-runtime-workflow.test.mjs | 4 +
9 files changed, 815 insertions(+), 101 deletions(-)
create mode 100644 config/scripts/ssh-relay-runtime-provenance.test.mjs
create mode 100644 config/scripts/ssh-relay-runtime-sbom.mjs
create mode 100644 config/scripts/ssh-relay-runtime-sbom.test.mjs
create mode 100644 config/scripts/ssh-relay-runtime-toolchain.mjs
create mode 100644 config/scripts/ssh-relay-runtime-toolchain.test.mjs
diff --git a/.github/workflows/ssh-relay-runtime-artifacts.yml b/.github/workflows/ssh-relay-runtime-artifacts.yml
index 428196d010d..b811e9c7998 100644
--- a/.github/workflows/ssh-relay-runtime-artifacts.yml
+++ b/.github/workflows/ssh-relay-runtime-artifacts.yml
@@ -43,6 +43,8 @@ jobs:
node_archive: node-v24.18.0-darwin-arm64.tar.xz
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
+ env:
+ ORCA_RUNTIME_REQUESTED_RUNNER: ${{ matrix.runner }}
steps:
- name: Checkout exact source revision
@@ -109,6 +111,11 @@ jobs:
node --check config/scripts/ssh-relay-runtime-build.test.mjs
node --check config/scripts/ssh-relay-runtime-closure.mjs
node --check config/scripts/ssh-relay-runtime-closure.test.mjs
+ node --check config/scripts/ssh-relay-runtime-sbom.mjs
+ node --check config/scripts/ssh-relay-runtime-sbom.test.mjs
+ node --check config/scripts/ssh-relay-runtime-provenance.test.mjs
+ node --check config/scripts/ssh-relay-runtime-toolchain.mjs
+ node --check config/scripts/ssh-relay-runtime-toolchain.test.mjs
pnpm exec vitest run --config config/vitest.config.ts \
config/scripts/ssh-relay-node-release-verification.test.mjs \
config/scripts/ssh-relay-node-tar-inspection.test.mjs \
@@ -122,6 +129,9 @@ jobs:
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs \
config/scripts/ssh-relay-runtime-reproducibility.test.mjs \
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs \
+ config/scripts/ssh-relay-runtime-provenance.test.mjs \
+ config/scripts/ssh-relay-runtime-sbom.test.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs \
config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
config/scripts/ssh-relay-runtime-zip.test.mjs \
config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -208,6 +218,8 @@ jobs:
msvc_arch: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
+ env:
+ ORCA_RUNTIME_REQUESTED_RUNNER: ${{ matrix.runner }}
steps:
- name: Checkout exact source revision
@@ -286,6 +298,16 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw 'runtime closure script syntax check failed' }
node --check config/scripts/ssh-relay-runtime-closure.test.mjs
if ($LASTEXITCODE -ne 0) { throw 'runtime closure test syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-sbom.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime SBOM script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-sbom.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime SBOM test syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-provenance.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime provenance test syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-toolchain.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime toolchain script syntax check failed' }
+ node --check config/scripts/ssh-relay-runtime-toolchain.test.mjs
+ if ($LASTEXITCODE -ne 0) { throw 'runtime toolchain test syntax check failed' }
pnpm exec vitest run --config config/vitest.config.ts `
config/scripts/ssh-relay-node-release-verification.test.mjs `
config/scripts/ssh-relay-node-tar-inspection.test.mjs `
@@ -299,6 +321,9 @@ jobs:
config/scripts/ssh-relay-runtime-pty-smoke.test.mjs `
config/scripts/ssh-relay-runtime-reproducibility.test.mjs `
config/scripts/ssh-relay-runtime-resource-diagnostics.test.mjs `
+ config/scripts/ssh-relay-runtime-provenance.test.mjs `
+ config/scripts/ssh-relay-runtime-sbom.test.mjs `
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs `
config/scripts/ssh-relay-runtime-windows-pe-diagnostic.test.mjs `
config/scripts/ssh-relay-runtime-windows-tree.test.mjs `
config/scripts/ssh-relay-runtime-zip.test.mjs `
diff --git a/config/scripts/build-ssh-relay-runtime.mjs b/config/scripts/build-ssh-relay-runtime.mjs
index 2ae076aafc0..46906f11591 100644
--- a/config/scripts/build-ssh-relay-runtime.mjs
+++ b/config/scripts/build-ssh-relay-runtime.mjs
@@ -11,6 +11,11 @@ import {
inspectSshRelayRuntimeArchive
} from './ssh-relay-runtime-archive.mjs'
import { writeSshRelayRuntimeMetadata } from './ssh-relay-runtime-provenance.mjs'
+import {
+ collectSshRelayRuntimeToolchain,
+ sshRelayRuntimeBuilderIdentity,
+ sshRelayRuntimeRunnerIdentity
+} from './ssh-relay-runtime-toolchain.mjs'
import { assembleSshRelayRuntimeTree } from './ssh-relay-runtime-tree.mjs'
import { validateSshRelayNodeReleaseContract } from './ssh-relay-node-release-verification.mjs'
import { verifyNodeReleaseInputs } from './verify-ssh-relay-node-release-inputs.mjs'
@@ -130,36 +135,6 @@ async function run(command, args, options = {}) {
return result.stdout.trim()
}
-async function toolchainDetails(nodePath) {
- const commands =
- process.platform === 'win32'
- ? [
- ['bundledNode', nodePath, ['--version']],
- ['compiler', 'cl.exe', []],
- ['python', 'python.exe', ['--version']]
- ]
- : [
- ['bundledNode', nodePath, ['--version']],
- ['xz', 'xz', ['--version']],
- ['compiler', 'c++', ['--version']],
- [
- 'strip',
- process.platform === 'darwin' ? 'xcrun' : 'strip',
- process.platform === 'darwin' ? ['--find', 'strip'] : ['--version']
- ],
- ['python', 'python3', ['--version']]
- ]
- const details = {}
- for (const [name, command, args] of commands) {
- details[name] = (await run(command, args)).split(/\r?\n/)[0]
- }
- if (process.platform === 'win32') {
- details.zip = 'yazl 3.3.1'
- }
- details.buildNode = process.version
- return details
-}
-
function relayPlatform(tuple) {
return tuple.replace('-glibc', '')
}
@@ -241,7 +216,7 @@ export async function buildSshRelayRuntime(options) {
sourceDateEpoch: options.sourceDateEpoch
})
const inspection = await inspectSshRelayRuntimeArchive(archive.path, identity)
- const toolchain = await toolchainDetails(extracted.nodePath)
+ const toolchain = await collectSshRelayRuntimeToolchain(extracted.nodePath)
const metadata = await writeSshRelayRuntimeMetadata({
outputDirectory: options.outputDirectory,
identity,
@@ -249,7 +224,8 @@ export async function buildSshRelayRuntime(options) {
nodeRelease: release,
sourceDateEpoch: options.sourceDateEpoch,
gitCommit: options.gitCommit,
- builder: process.env.GITHUB_WORKFLOW_REF ?? `local://${process.platform}/${process.arch}`,
+ builder: sshRelayRuntimeBuilderIdentity({ gitCommit: options.gitCommit }),
+ runner: sshRelayRuntimeRunnerIdentity(),
toolchain
})
return {
diff --git a/config/scripts/ssh-relay-runtime-provenance.mjs b/config/scripts/ssh-relay-runtime-provenance.mjs
index 9582dd2256c..ee460e39fea 100644
--- a/config/scripts/ssh-relay-runtime-provenance.mjs
+++ b/config/scripts/ssh-relay-runtime-provenance.mjs
@@ -1,43 +1,14 @@
import { createHash } from 'node:crypto'
import { readFile, stat, writeFile } from 'node:fs/promises'
-import { createRequire } from 'node:module'
import { join } from 'node:path'
-const require = createRequire(import.meta.url)
+import { createSshRelayRuntimeSbom } from './ssh-relay-runtime-sbom.mjs'
+import { assertSshRelayRuntimeToolchain } from './ssh-relay-runtime-toolchain.mjs'
function sha256(bytes) {
return `sha256:${createHash('sha256').update(bytes).digest('hex')}`
}
-function spdxId(value) {
- return `SPDXRef-${value.replace(/[^A-Za-z0-9.-]/g, '-')}`
-}
-
-function packageRecord(name, version, license) {
- return {
- name,
- SPDXID: spdxId(`Package-${name}`),
- versionInfo: version,
- downloadLocation: 'NOASSERTION',
- filesAnalyzed: false,
- licenseConcluded: license,
- licenseDeclared: license,
- copyrightText: 'NOASSERTION'
- }
-}
-
-function installedPackage(name) {
- const parsed = require(`${name}/package.json`)
- return packageRecord(parsed.name, parsed.version, parsed.license ?? 'NOASSERTION')
-}
-
-function watcherNativePackage(tuple) {
- if (tuple.startsWith('linux-')) {
- return `@parcel/watcher-linux-${tuple.slice('linux-'.length)}`
- }
- return `@parcel/watcher-${tuple}`
-}
-
async function writeJson(path, value) {
const bytes = Buffer.from(`${JSON.stringify(value, null, 2)}\n`, 'utf8')
await writeFile(path, bytes, { flag: 'wx', mode: 0o600 })
@@ -52,48 +23,14 @@ export async function writeSshRelayRuntimeMetadata({
sourceDateEpoch,
gitCommit,
builder,
+ runner,
toolchain
}) {
- const createdAt = new Date(sourceDateEpoch * 1000).toISOString()
+ assertSshRelayRuntimeToolchain(toolchain, identity.tupleId)
const sbomName = `orca-ssh-relay-runtime-${identity.tupleId}.spdx.json`
const provenanceName = `orca-ssh-relay-runtime-${identity.tupleId}.provenance.json`
const identityName = `orca-ssh-relay-runtime-${identity.tupleId}.identity.json`
- const files = identity.entries
- .filter((entry) => entry.type === 'file')
- .map((entry, index) => ({
- fileName: entry.path,
- SPDXID: `SPDXRef-File-${index + 1}`,
- checksums: [{ algorithm: 'SHA256', checksumValue: entry.sha256.slice('sha256:'.length) }],
- licenseConcluded: 'NOASSERTION',
- copyrightText: 'NOASSERTION'
- }))
- const packages = [
- packageRecord('node', identity.nodeVersion, 'NOASSERTION'),
- packageRecord('orca-ssh-relay', '0.1.0', 'NOASSERTION'),
- installedPackage('node-pty'),
- installedPackage('@parcel/watcher'),
- installedPackage(watcherNativePackage(identity.tupleId)),
- installedPackage('detect-libc'),
- installedPackage('is-glob'),
- installedPackage('is-extglob'),
- installedPackage('picomatch')
- ]
- const documentId = identity.contentId.slice('sha256:'.length)
- const sbom = {
- spdxVersion: 'SPDX-2.3',
- dataLicense: 'CC0-1.0',
- SPDXID: 'SPDXRef-DOCUMENT',
- name: `Orca SSH relay runtime ${identity.tupleId}`,
- documentNamespace: `https://github.com/stablyai/orca/ssh-relay-runtime/${documentId}`,
- creationInfo: { created: createdAt, creators: ['Organization: Stably AI'] },
- packages,
- files,
- relationships: packages.map((component) => ({
- spdxElementId: 'SPDXRef-DOCUMENT',
- relationshipType: 'DESCRIBES',
- relatedSpdxElement: component.SPDXID
- }))
- }
+ const sbom = createSshRelayRuntimeSbom({ identity, archive, sourceDateEpoch })
const nativeFiles = identity.entries
.filter(
(entry) =>
@@ -139,7 +76,10 @@ export async function writeSshRelayRuntimeMetadata({
},
runDetails: {
builder: { id: builder },
- metadata: { invocationId: process.env.GITHUB_RUN_ID ?? 'local-unpublished-build' },
+ metadata: {
+ invocationId: process.env.GITHUB_RUN_ID ?? 'local-unpublished-build',
+ runner
+ },
byproducts: [{ name: 'native-files', content: nativeFiles }]
}
}
diff --git a/config/scripts/ssh-relay-runtime-provenance.test.mjs b/config/scripts/ssh-relay-runtime-provenance.test.mjs
new file mode 100644
index 00000000000..ba5340d6704
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-provenance.test.mjs
@@ -0,0 +1,158 @@
+import { mkdtemp, readFile, rm } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { writeSshRelayRuntimeMetadata } from './ssh-relay-runtime-provenance.mjs'
+
+const temporaryDirectories = []
+
+afterEach(async () => {
+ await Promise.all(temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true })))
+})
+
+const sha256 = (character) => `sha256:${character.repeat(64)}`
+
+function file(path, role, character) {
+ return { path, type: 'file', role, size: 1, mode: 0o644, sha256: sha256(character) }
+}
+
+function fixture() {
+ const tuple = 'linux-x64-glibc'
+ const identity = {
+ tupleId: tuple,
+ os: 'linux',
+ architecture: 'x64',
+ nodeVersion: '24.18.0',
+ contentId: sha256('f'),
+ fileCount: 5,
+ expandedSize: 5,
+ entries: [
+ file('bin/node', 'node', '1'),
+ file('relay.js', 'relay', '2'),
+ file('node_modules/node-pty/build/Release/pty.node', 'node-pty-native', '3'),
+ file(
+ 'node_modules/@parcel/watcher-linux-x64-glibc/watcher.node',
+ 'parcel-watcher-native',
+ '4'
+ ),
+ file('THIRD_PARTY_LICENSES.txt', 'license', '5')
+ ]
+ }
+ return {
+ tuple,
+ identity,
+ archive: {
+ name: `orca-ssh-relay-runtime-v1-${tuple}-${'f'.repeat(64)}.tar.xz`,
+ size: 123,
+ sha256: sha256('a')
+ },
+ nodeRelease: {
+ baseUrl: 'https://nodejs.org/dist/v24.18.0',
+ archives: {
+ [tuple]: { name: 'node-v24.18.0-linux-x64.tar.xz', sha256: 'b'.repeat(64) }
+ },
+ signature: {
+ key: {
+ sourceUrl: 'https://github.com/nodejs/release-keys/raw/commit/gpg/key.asc',
+ sha256: 'c'.repeat(64)
+ }
+ }
+ }
+ }
+}
+
+describe('SSH relay runtime published metadata', () => {
+ it('binds SPDX, SLSA provenance, and identity to the exact archive and runner', async () => {
+ const outputDirectory = await mkdtemp(join(tmpdir(), 'orca-runtime-metadata-'))
+ temporaryDirectories.push(outputDirectory)
+ const input = fixture()
+ const runner = {
+ os: 'Linux',
+ architecture: 'X64',
+ environment: 'github-hosted',
+ requestedLabel: 'ubuntu-24.04',
+ image: { os: 'ubuntu24', version: '20260705.232.1' }
+ }
+ const toolchain = Object.fromEntries(
+ [
+ 'buildNode',
+ 'bundledNode',
+ 'compiler',
+ 'buildSystem',
+ 'python',
+ 'archive',
+ 'nodeAddonApi',
+ 'nodeGyp',
+ 'strip'
+ ].map((name, index) => [
+ name,
+ { version: `${name} version`, sha256: sha256((index + 6).toString(16)) }
+ ])
+ )
+ const builder = `https://github.com/stablyai/orca/blob/${'1'.repeat(40)}/.github/workflows/ssh-relay-runtime-artifacts.yml`
+
+ const assets = await writeSshRelayRuntimeMetadata({
+ outputDirectory,
+ identity: input.identity,
+ archive: input.archive,
+ nodeRelease: input.nodeRelease,
+ sourceDateEpoch: 1_752_710_400,
+ gitCommit: '1'.repeat(40),
+ builder,
+ runner,
+ toolchain
+ })
+ const sbom = JSON.parse(await readFile(join(outputDirectory, assets.sbom.name), 'utf8'))
+ const provenance = JSON.parse(
+ await readFile(join(outputDirectory, assets.provenance.name), 'utf8')
+ )
+ const identity = JSON.parse(await readFile(join(outputDirectory, assets.identity.name), 'utf8'))
+
+ expect(sbom.files).toHaveLength(input.identity.fileCount)
+ expect(
+ sbom.relationships.filter((entry) => entry.relationshipType === 'CONTAINS')
+ ).toHaveLength(input.identity.fileCount)
+ expect(provenance.subject).toEqual([
+ { name: input.archive.name, digest: { sha256: 'a'.repeat(64) } }
+ ])
+ expect(provenance.predicate.runDetails).toMatchObject({
+ builder: { id: builder },
+ metadata: { runner }
+ })
+ expect(provenance.predicate.buildDefinition).toMatchObject({
+ internalParameters: { toolchain },
+ resolvedDependencies: expect.arrayContaining([
+ {
+ uri: 'https://nodejs.org/dist/v24.18.0/node-v24.18.0-linux-x64.tar.xz',
+ digest: { sha256: 'b'.repeat(64) }
+ },
+ {
+ uri: `git+https://github.com/stablyai/orca@${'1'.repeat(40)}`,
+ digest: { gitCommit: '1'.repeat(40) }
+ }
+ ])
+ })
+ expect(identity.archive).toEqual({
+ name: input.archive.name,
+ size: 123,
+ expandedSize: 5,
+ fileCount: 5,
+ sha256: sha256('a')
+ })
+ await expect(
+ writeSshRelayRuntimeMetadata({
+ outputDirectory,
+ identity: input.identity,
+ archive: input.archive,
+ nodeRelease: input.nodeRelease,
+ sourceDateEpoch: 1_752_710_400,
+ gitCommit: '1'.repeat(40),
+ builder,
+ runner,
+ toolchain
+ })
+ ).rejects.toThrow()
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-sbom.mjs b/config/scripts/ssh-relay-runtime-sbom.mjs
new file mode 100644
index 00000000000..a3a29cad6e3
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-sbom.mjs
@@ -0,0 +1,125 @@
+import { createRequire } from 'node:module'
+
+import { sshRelayRuntimeWatcherPackage } from './ssh-relay-runtime-closure.mjs'
+
+const require = createRequire(import.meta.url)
+
+function spdxId(value) {
+ return `SPDXRef-${value.replace(/[^A-Za-z0-9.-]/g, '-')}`
+}
+
+function packageRecord(name, version, license) {
+ return {
+ name,
+ SPDXID: spdxId(`Package-${name}`),
+ versionInfo: version,
+ downloadLocation: 'NOASSERTION',
+ filesAnalyzed: false,
+ licenseConcluded: license,
+ licenseDeclared: license,
+ copyrightText: 'NOASSERTION'
+ }
+}
+
+function installedPackage(name) {
+ const parsed = require(`${name}/package.json`)
+ return packageRecord(parsed.name, parsed.version, parsed.license ?? 'NOASSERTION')
+}
+
+function fileType(role) {
+ return ['node', 'node-pty-native', 'parcel-watcher-native', 'native-runtime'].includes(role)
+ ? 'BINARY'
+ : role === 'license'
+ ? 'TEXT'
+ : 'SOURCE'
+}
+
+function ownerPackage(path, packages) {
+ const packagePath = packages.find((entry) => path.startsWith(`node_modules/${entry.name}/`))
+ if (packagePath) {
+ return packagePath
+ }
+ if (path.startsWith('node_modules/')) {
+ return undefined
+ }
+ if (path === 'bin/node' || path === 'bin/node.exe') {
+ return packages.find((entry) => entry.name === 'node')
+ }
+ return packages.find((entry) => entry.name === 'orca-ssh-relay')
+}
+
+export function createSshRelayRuntimeSbom({ identity, archive, sourceDateEpoch }) {
+ if (!/^sha256:[0-9a-f]{64}$/.test(archive?.sha256 ?? '')) {
+ throw new Error('Runtime SBOM requires the exact archive SHA-256')
+ }
+ const watcherPackage = sshRelayRuntimeWatcherPackage(identity.tupleId)
+ const packages = [
+ packageRecord('node', identity.nodeVersion, 'MIT'),
+ packageRecord('orca-ssh-relay', identity.contentId, 'NOASSERTION'),
+ installedPackage('node-pty'),
+ installedPackage('@parcel/watcher'),
+ installedPackage(watcherPackage),
+ installedPackage('detect-libc'),
+ installedPackage('is-glob'),
+ installedPackage('is-extglob'),
+ installedPackage('picomatch')
+ ]
+ const files = identity.entries
+ .filter((entry) => entry.type === 'file')
+ .map((entry) => ({
+ fileName: entry.path,
+ SPDXID: spdxId(`File-${entry.path}`),
+ fileTypes: [fileType(entry.role)],
+ checksums: [{ algorithm: 'SHA256', checksumValue: entry.sha256.slice('sha256:'.length) }],
+ licenseConcluded: 'NOASSERTION',
+ copyrightText: 'NOASSERTION'
+ }))
+ const identifiers = new Set()
+ for (const element of [...packages, ...files]) {
+ if (identifiers.has(element.SPDXID)) {
+ throw new Error(`Runtime SBOM contains a duplicate SPDX identifier: ${element.SPDXID}`)
+ }
+ identifiers.add(element.SPDXID)
+ }
+ const contains = files.map((file) => {
+ const owner = ownerPackage(file.fileName, packages)
+ if (!owner) {
+ throw new Error(`Runtime SBOM cannot assign a package owner: ${file.fileName}`)
+ }
+ return {
+ spdxElementId: owner.SPDXID,
+ relationshipType: 'CONTAINS',
+ relatedSpdxElement: file.SPDXID
+ }
+ })
+ const relay = packages.find((entry) => entry.name === 'orca-ssh-relay')
+ const relationships = [
+ ...packages.map((component) => ({
+ spdxElementId: 'SPDXRef-DOCUMENT',
+ relationshipType: 'DESCRIBES',
+ relatedSpdxElement: component.SPDXID
+ })),
+ ...packages
+ .filter((component) => component !== relay)
+ .map((component) => ({
+ spdxElementId: relay.SPDXID,
+ relationshipType: 'DEPENDS_ON',
+ relatedSpdxElement: component.SPDXID
+ })),
+ ...contains
+ ]
+ return {
+ spdxVersion: 'SPDX-2.3',
+ dataLicense: 'CC0-1.0',
+ SPDXID: 'SPDXRef-DOCUMENT',
+ name: `Orca SSH relay runtime ${identity.tupleId}`,
+ documentNamespace: `https://github.com/stablyai/orca/ssh-relay-runtime/spdx/${archive.sha256.slice('sha256:'.length)}`,
+ creationInfo: {
+ created: new Date(sourceDateEpoch * 1000).toISOString(),
+ creators: ['Organization: Stably AI']
+ },
+ packages,
+ files,
+ relationships
+ }
+}
diff --git a/config/scripts/ssh-relay-runtime-sbom.test.mjs b/config/scripts/ssh-relay-runtime-sbom.test.mjs
new file mode 100644
index 00000000000..c03be12ecc9
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-sbom.test.mjs
@@ -0,0 +1,122 @@
+import { describe, expect, it } from 'vitest'
+
+import { createSshRelayRuntimeSbom } from './ssh-relay-runtime-sbom.mjs'
+
+const sha256 = (character) => `sha256:${character.repeat(64)}`
+
+function file(path, role, character) {
+ return { path, type: 'file', role, size: 1, mode: 0o644, sha256: sha256(character) }
+}
+
+function identity(tuple = 'linux-arm64-glibc') {
+ return {
+ tupleId: tuple,
+ nodeVersion: '24.18.0',
+ contentId: sha256('f'),
+ entries: [
+ file('bin/node', 'node', '1'),
+ file('relay.js', 'relay', '2'),
+ file('THIRD_PARTY_LICENSES.txt', 'license', '3'),
+ file('node_modules/node-pty/lib/index.js', 'runtime-javascript', '4'),
+ file('node_modules/@parcel/watcher/index.js', 'runtime-javascript', '5'),
+ file(`node_modules/@parcel/watcher-${tuple}/watcher.node`, 'parcel-watcher-native', '6'),
+ file('node_modules/detect-libc/lib/detect-libc.js', 'runtime-javascript', '7'),
+ file('node_modules/is-glob/index.js', 'runtime-javascript', '8'),
+ file('node_modules/is-extglob/index.js', 'runtime-javascript', '9'),
+ file('node_modules/picomatch/index.js', 'runtime-javascript', 'a')
+ ]
+ }
+}
+
+const archive = { sha256: sha256('e') }
+
+function ownerName(sbom, fileName) {
+ const fileId = sbom.files.find((entry) => entry.fileName === fileName).SPDXID
+ const owners = sbom.relationships.filter(
+ (entry) => entry.relationshipType === 'CONTAINS' && entry.relatedSpdxElement === fileId
+ )
+ expect(owners).toHaveLength(1)
+ return sbom.packages.find((entry) => entry.SPDXID === owners[0].spdxElementId).name
+}
+
+describe('SSH relay runtime SPDX SBOM', () => {
+ it('inventories every runtime file under exactly one package', () => {
+ const fixture = identity()
+ const sbom = createSshRelayRuntimeSbom({
+ identity: fixture,
+ archive,
+ sourceDateEpoch: 1_752_710_400
+ })
+
+ expect(sbom.spdxVersion).toBe('SPDX-2.3')
+ expect(sbom.documentNamespace).toBe(
+ `https://github.com/stablyai/orca/ssh-relay-runtime/spdx/${'e'.repeat(64)}`
+ )
+ expect(sbom.creationInfo.created).toBe('2025-07-17T00:00:00.000Z')
+ expect(sbom.packages.map((entry) => entry.name)).toEqual([
+ 'node',
+ 'orca-ssh-relay',
+ 'node-pty',
+ '@parcel/watcher',
+ '@parcel/watcher-linux-arm64-glibc',
+ 'detect-libc',
+ 'is-glob',
+ 'is-extglob',
+ 'picomatch'
+ ])
+ expect(sbom.packages.find((entry) => entry.name === 'node')).toMatchObject({
+ versionInfo: '24.18.0',
+ licenseDeclared: 'MIT'
+ })
+ expect(sbom.packages.find((entry) => entry.name === 'orca-ssh-relay')).toMatchObject({
+ versionInfo: fixture.contentId,
+ licenseDeclared: 'NOASSERTION'
+ })
+ expect(sbom.files).toHaveLength(fixture.entries.length)
+ expect(new Set([...sbom.packages, ...sbom.files].map((entry) => entry.SPDXID)).size).toBe(
+ sbom.packages.length + sbom.files.length
+ )
+ expect(ownerName(sbom, 'bin/node')).toBe('node')
+ expect(ownerName(sbom, 'relay.js')).toBe('orca-ssh-relay')
+ expect(ownerName(sbom, 'THIRD_PARTY_LICENSES.txt')).toBe('orca-ssh-relay')
+ expect(ownerName(sbom, 'node_modules/node-pty/lib/index.js')).toBe('node-pty')
+ expect(ownerName(sbom, 'node_modules/@parcel/watcher/index.js')).toBe('@parcel/watcher')
+ expect(ownerName(sbom, 'node_modules/@parcel/watcher-linux-arm64-glibc/watcher.node')).toBe(
+ '@parcel/watcher-linux-arm64-glibc'
+ )
+ expect(ownerName(sbom, 'node_modules/detect-libc/lib/detect-libc.js')).toBe('detect-libc')
+ expect(ownerName(sbom, 'node_modules/is-glob/index.js')).toBe('is-glob')
+ expect(ownerName(sbom, 'node_modules/is-extglob/index.js')).toBe('is-extglob')
+ expect(ownerName(sbom, 'node_modules/picomatch/index.js')).toBe('picomatch')
+ expect(
+ sbom.relationships.filter((entry) => entry.relationshipType === 'DEPENDS_ON')
+ ).toHaveLength(8)
+ })
+
+ it('rejects an unowned node_modules path and colliding SPDX identifiers', () => {
+ const unowned = identity()
+ unowned.entries.push(file('node_modules/unreviewed/index.js', 'runtime-javascript', 'b'))
+ expect(() =>
+ createSshRelayRuntimeSbom({ identity: unowned, archive, sourceDateEpoch: 1_752_710_400 })
+ ).toThrow(/cannot assign a package owner/i)
+
+ const collision = identity()
+ collision.entries.push(
+ file('relay/a+b.js', 'runtime-javascript', 'b'),
+ file('relay/a@b.js', 'runtime-javascript', 'c')
+ )
+ expect(() =>
+ createSshRelayRuntimeSbom({ identity: collision, archive, sourceDateEpoch: 1_752_710_400 })
+ ).toThrow(/duplicate SPDX identifier/i)
+ })
+
+ it('requires the exact archive digest to make the document namespace immutable', () => {
+ expect(() =>
+ createSshRelayRuntimeSbom({
+ identity: identity(),
+ archive: { sha256: 'missing-prefix' },
+ sourceDateEpoch: 1_752_710_400
+ })
+ ).toThrow(/archive SHA-256/i)
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
new file mode 100644
index 00000000000..1583b86c011
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -0,0 +1,252 @@
+import { execFile } from 'node:child_process'
+import { createHash } from 'node:crypto'
+import { createReadStream } from 'node:fs'
+import { readdir, realpath, stat } from 'node:fs/promises'
+import { createRequire } from 'node:module'
+import { dirname, isAbsolute, join, relative } from 'node:path'
+import { isDeepStrictEqual, promisify } from 'node:util'
+
+const require = createRequire(import.meta.url)
+const execFileAsync = promisify(execFile)
+const MAX_TOOL_BYTES = 300 * 1024 * 1024
+const TOOL_TIMEOUT_MS = 60_000
+const TOOL_OUTPUT_BYTES = 1024 * 1024
+const MAX_PACKAGE_FILES = 500
+const MAX_PACKAGE_BYTES = 32 * 1024 * 1024
+
+async function sha256File(path) {
+ const metadata = await stat(path)
+ if (!metadata.isFile() || metadata.size > MAX_TOOL_BYTES) {
+ throw new Error(`Runtime build tool is not a bounded regular file: ${path}`)
+ }
+ const hash = createHash('sha256')
+ for await (const chunk of createReadStream(path)) {
+ hash.update(chunk)
+ }
+ return `sha256:${hash.digest('hex')}`
+}
+
+async function capture(command, args) {
+ try {
+ return await execFileAsync(command, args, {
+ encoding: 'utf8',
+ maxBuffer: TOOL_OUTPUT_BYTES,
+ timeout: TOOL_TIMEOUT_MS,
+ windowsHide: true
+ })
+ } catch (error) {
+ if (typeof error?.stdout === 'string' || typeof error?.stderr === 'string') {
+ return { stdout: error.stdout ?? '', stderr: error.stderr ?? '' }
+ }
+ throw error
+ }
+}
+
+export function selectSshRelayRuntimeToolVersion({ stdout = '', stderr = '' }, pattern) {
+ const lines = `${stderr}\n${stdout}`
+ .split(/\r?\n/)
+ .map((line) => line.trim())
+ .filter(Boolean)
+ const version = pattern ? lines.find((line) => pattern.test(line)) : lines[0]
+ if (!version || Buffer.byteLength(version) > 512) {
+ throw new Error('Runtime build tool did not report a bounded version line')
+ }
+ return version
+}
+
+async function locateExecutable(command, { xcrun = false } = {}) {
+ if (isAbsolute(command)) {
+ return realpath(command)
+ }
+ const locator = xcrun
+ ? ['xcrun', ['--find', command]]
+ : process.platform === 'win32'
+ ? ['where.exe', [command]]
+ : ['which', [command]]
+ const result = await capture(...locator)
+ const path = result.stdout
+ .split(/\r?\n/)
+ .map((line) => line.trim())
+ .find(Boolean)
+ if (!path || !isAbsolute(path)) {
+ throw new Error(`Runtime build tool executable could not be resolved: ${command}`)
+ }
+ return realpath(path)
+}
+
+async function executableRecord({
+ command,
+ args,
+ versionCommand,
+ versionArgs,
+ versionPattern,
+ xcrun = false
+}) {
+ const path = await locateExecutable(command, { xcrun })
+ const result = await capture(versionCommand ?? path, versionArgs ?? args)
+ return {
+ version: selectSshRelayRuntimeToolVersion(result, versionPattern),
+ sha256: await sha256File(path)
+ }
+}
+
+async function packageTreeRecord(name) {
+ const parsed = require(`${name}/package.json`)
+ const root = dirname(require.resolve(`${name}/package.json`))
+ const files = []
+ let totalBytes = 0
+ async function visit(directory) {
+ const entries = await readdir(directory, { withFileTypes: true })
+ entries.sort((left, right) => (left.name < right.name ? -1 : left.name > right.name ? 1 : 0))
+ for (const entry of entries) {
+ const path = join(directory, entry.name)
+ if (entry.isDirectory()) {
+ await visit(path)
+ } else if (entry.isFile()) {
+ files.push(path)
+ totalBytes += (await stat(path)).size
+ } else {
+ throw new Error(`Runtime build package contains a special entry: ${name}`)
+ }
+ if (files.length > MAX_PACKAGE_FILES) {
+ throw new Error(`Runtime build package exceeds the file-count bound: ${name}`)
+ }
+ if (totalBytes > MAX_PACKAGE_BYTES) {
+ throw new Error(`Runtime build package exceeds the byte bound: ${name}`)
+ }
+ }
+ }
+ await visit(root)
+ const hash = createHash('sha256')
+ for (const path of files) {
+ hash.update(relative(root, path).replaceAll('\\', '/'))
+ hash.update('\0')
+ hash.update(await sha256File(path))
+ hash.update('\n')
+ }
+ return { version: parsed.version, sha256: `sha256:${hash.digest('hex')}`, files: files.length }
+}
+
+export function sshRelayRuntimeBuilderIdentity({ gitCommit, env = process.env }) {
+ if (env.GITHUB_ACTIONS !== 'true') {
+ return `local://${process.platform}/${process.arch}`
+ }
+ if (
+ !/^[0-9a-f]{40}$/.test(gitCommit) ||
+ !/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(env.GITHUB_REPOSITORY ?? '')
+ ) {
+ throw new Error('GitHub runtime builder identity is incomplete')
+ }
+ const workflow = (env.GITHUB_WORKFLOW_REF ?? '').split('@')[0]
+ const prefix = `${env.GITHUB_REPOSITORY}/`
+ if (
+ !workflow.startsWith(prefix) ||
+ workflow.slice(prefix.length) !== '.github/workflows/ssh-relay-runtime-artifacts.yml'
+ ) {
+ throw new Error('GitHub runtime builder workflow identity is malformed')
+ }
+ return `https://github.com/${env.GITHUB_REPOSITORY}/blob/${gitCommit}/${workflow.slice(prefix.length)}`
+}
+
+export function sshRelayRuntimeRunnerIdentity({ env = process.env } = {}) {
+ const github = env.GITHUB_ACTIONS === 'true'
+ const identity = {
+ os: env.RUNNER_OS ?? process.platform,
+ architecture: env.RUNNER_ARCH ?? process.arch,
+ environment: env.RUNNER_ENVIRONMENT ?? (github ? undefined : 'local'),
+ requestedLabel: env.ORCA_RUNTIME_REQUESTED_RUNNER ?? (github ? undefined : 'local'),
+ image: {
+ os: env.ImageOS ?? (github ? undefined : process.platform),
+ version: env.ImageVersion ?? (github ? undefined : 'local')
+ }
+ }
+ if (
+ !identity.os ||
+ !identity.architecture ||
+ !identity.environment ||
+ !identity.requestedLabel ||
+ !identity.image.os ||
+ !identity.image.version
+ ) {
+ throw new Error('Runtime runner identity is incomplete')
+ }
+ return identity
+}
+
+export function assertSshRelayRuntimeToolchain(toolchain, tuple) {
+ const common = ['buildNode', 'bundledNode', 'compiler', 'buildSystem', 'python', 'archive']
+ const expected = tuple.startsWith('win32-')
+ ? [...common, 'linker', 'nodeAddonApi', 'nodeGyp']
+ : [...common, 'nodeAddonApi', 'nodeGyp', 'strip']
+ if (!isDeepStrictEqual(Object.keys(toolchain).sort(), expected.sort())) {
+ throw new Error(`Runtime toolchain record is incomplete for ${tuple}`)
+ }
+ for (const [name, record] of Object.entries(toolchain)) {
+ const keys = Object.keys(record).sort()
+ const expectedKeys =
+ record.files === undefined ? ['sha256', 'version'] : ['files', 'sha256', 'version']
+ if (
+ !isDeepStrictEqual(keys, expectedKeys) ||
+ typeof record.version !== 'string' ||
+ record.version.length === 0 ||
+ Buffer.byteLength(record.version) > 512 ||
+ record.version.includes('\n') ||
+ !/^sha256:[0-9a-f]{64}$/.test(record.sha256) ||
+ (record.files !== undefined && (!Number.isSafeInteger(record.files) || record.files <= 0))
+ ) {
+ throw new Error(`Runtime toolchain record is malformed: ${name}`)
+ }
+ }
+}
+
+export async function collectSshRelayRuntimeToolchain(nodePath) {
+ const common = {
+ bundledNode: await executableRecord({ command: nodePath, args: ['--version'] }),
+ buildNode: await executableRecord({ command: process.execPath, args: ['--version'] }),
+ nodeGyp: await packageTreeRecord('node-gyp'),
+ nodeAddonApi: await packageTreeRecord('node-addon-api')
+ }
+ if (process.platform === 'win32') {
+ const toolchain = {
+ ...common,
+ compiler: await executableRecord({
+ command: 'cl.exe',
+ args: [],
+ versionPattern: /Compiler Version/i
+ }),
+ linker: await executableRecord({
+ command: 'link.exe',
+ args: [],
+ versionPattern: /Linker Version/i
+ }),
+ buildSystem: await executableRecord({
+ command: 'msbuild.exe',
+ args: ['-version', '-nologo']
+ }),
+ python: await executableRecord({ command: 'python.exe', args: ['--version'] }),
+ archive: await packageTreeRecord('yazl')
+ }
+ assertSshRelayRuntimeToolchain(toolchain, 'win32-x64')
+ return toolchain
+ }
+ const toolchain = {
+ ...common,
+ compiler: await executableRecord({
+ command: process.platform === 'darwin' ? 'clang++' : 'c++',
+ args: ['--version'],
+ xcrun: process.platform === 'darwin'
+ }),
+ buildSystem: await executableRecord({ command: 'make', args: ['--version'] }),
+ python: await executableRecord({ command: 'python3', args: ['--version'] }),
+ archive: await executableRecord({ command: 'xz', args: ['--version'] }),
+ strip: await executableRecord({
+ command: 'strip',
+ args: [],
+ versionCommand: process.platform === 'darwin' ? 'xcodebuild' : undefined,
+ versionArgs: process.platform === 'darwin' ? ['-version'] : undefined,
+ xcrun: process.platform === 'darwin'
+ })
+ }
+ assertSshRelayRuntimeToolchain(toolchain, `${process.platform}-x64`)
+ return toolchain
+}
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
new file mode 100644
index 00000000000..eb6795eea09
--- /dev/null
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -0,0 +1,112 @@
+import { describe, expect, it } from 'vitest'
+
+import {
+ assertSshRelayRuntimeToolchain,
+ collectSshRelayRuntimeToolchain,
+ selectSshRelayRuntimeToolVersion,
+ sshRelayRuntimeBuilderIdentity,
+ sshRelayRuntimeRunnerIdentity
+} from './ssh-relay-runtime-toolchain.mjs'
+
+const commit = 'a'.repeat(40)
+
+describe('SSH relay runtime build provenance', () => {
+ it('selects the real Windows compiler version instead of its stdout usage line', () => {
+ expect(
+ selectSshRelayRuntimeToolVersion(
+ {
+ stdout: 'usage: cl [ option... ] filename... [ /link linkoption... ]',
+ stderr: [
+ 'Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35228 for ARM64',
+ 'Copyright (C) Microsoft Corporation.'
+ ].join('\r\n')
+ },
+ /Compiler Version/i
+ )
+ ).toBe('Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35228 for ARM64')
+ })
+
+ it('pins GitHub builder identity to the exact source commit', () => {
+ expect(
+ sshRelayRuntimeBuilderIdentity({
+ gitCommit: commit,
+ env: {
+ GITHUB_ACTIONS: 'true',
+ GITHUB_REPOSITORY: 'stablyai/orca',
+ GITHUB_WORKFLOW_REF:
+ 'stablyai/orca/.github/workflows/ssh-relay-runtime-artifacts.yml@refs/pull/8741/merge'
+ }
+ })
+ ).toBe(
+ `https://github.com/stablyai/orca/blob/${commit}/.github/workflows/ssh-relay-runtime-artifacts.yml`
+ )
+ expect(() =>
+ sshRelayRuntimeBuilderIdentity({
+ gitCommit: commit,
+ env: {
+ GITHUB_ACTIONS: 'true',
+ GITHUB_REPOSITORY: 'stablyai/orca',
+ GITHUB_WORKFLOW_REF: 'other/repo/.github/workflows/untrusted.yml@refs/heads/main'
+ }
+ })
+ ).toThrow(/workflow identity/i)
+ })
+
+ it('requires the resolved runner label, architecture, environment, and image identity', () => {
+ expect(
+ sshRelayRuntimeRunnerIdentity({
+ env: {
+ GITHUB_ACTIONS: 'true',
+ RUNNER_OS: 'Windows',
+ RUNNER_ARCH: 'ARM64',
+ RUNNER_ENVIRONMENT: 'github-hosted',
+ ORCA_RUNTIME_REQUESTED_RUNNER: 'windows-11-arm',
+ ImageOS: 'win11-arm64',
+ ImageVersion: '20260706.102.1'
+ }
+ })
+ ).toEqual({
+ os: 'Windows',
+ architecture: 'ARM64',
+ environment: 'github-hosted',
+ requestedLabel: 'windows-11-arm',
+ image: { os: 'win11-arm64', version: '20260706.102.1' }
+ })
+ expect(() =>
+ sshRelayRuntimeRunnerIdentity({
+ env: {
+ GITHUB_ACTIONS: 'true',
+ RUNNER_OS: 'Windows',
+ RUNNER_ARCH: 'ARM64'
+ }
+ })
+ ).toThrow(/runner identity/i)
+ })
+
+ it('records bounded native tool versions and SHA-256 executable or code digests', async () => {
+ const toolchain = await collectSshRelayRuntimeToolchain(process.execPath)
+ const tuple = process.platform === 'win32' ? 'win32-x64' : 'linux-x64-glibc'
+ expect(() => assertSshRelayRuntimeToolchain(toolchain, tuple)).not.toThrow()
+ expect(toolchain).toMatchObject({
+ bundledNode: { version: process.version },
+ buildNode: { version: process.version },
+ nodeGyp: { version: expect.any(String) },
+ nodeAddonApi: { version: expect.any(String) },
+ compiler: { version: expect.any(String) },
+ buildSystem: { version: expect.any(String) },
+ python: { version: expect.any(String) },
+ archive: { version: expect.any(String) }
+ })
+ for (const record of Object.values(toolchain)) {
+ expect(record.sha256).toMatch(/^sha256:[0-9a-f]{64}$/)
+ expect(Buffer.byteLength(record.version)).toBeGreaterThan(0)
+ expect(Buffer.byteLength(record.version)).toBeLessThanOrEqual(512)
+ }
+ expect(() =>
+ assertSshRelayRuntimeToolchain(
+ { ...toolchain, compiler: { version: toolchain.compiler.version } },
+ tuple
+ )
+ ).toThrow(/compiler/i)
+ })
+})
diff --git a/config/scripts/ssh-relay-runtime-workflow.test.mjs b/config/scripts/ssh-relay-runtime-workflow.test.mjs
index 1815d229a8e..91c351c51fb 100644
--- a/config/scripts/ssh-relay-runtime-workflow.test.mjs
+++ b/config/scripts/ssh-relay-runtime-workflow.test.mjs
@@ -28,6 +28,7 @@ describe('SSH relay runtime artifact workflow', () => {
expect(posixJob['timeout-minutes']).toBe(20)
expect(windowsJob['timeout-minutes']).toBe(30)
for (const job of [posixJob, windowsJob]) {
+ expect(job.env.ORCA_RUNTIME_REQUESTED_RUNNER).toBe('${{ matrix.runner }}')
expect(job.steps[0].with.ref).toBe('${{ github.event.pull_request.head.sha || github.sha }}')
for (const step of job.steps.filter((candidate) => candidate.uses)) {
expect(step.uses).toMatch(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}$/)
@@ -62,6 +63,9 @@ describe('SSH relay runtime artifact workflow', () => {
expect(source).toContain('ssh-relay-runtime-reproducibility.mjs')
expect(source).toContain('ssh-relay-runtime-reproducibility.test.mjs')
expect(source.match(/ssh-relay-runtime-closure\.test\.mjs/g)).toHaveLength(4)
+ expect(source.match(/ssh-relay-runtime-sbom\.test\.mjs/g)).toHaveLength(4)
+ expect(source.match(/ssh-relay-runtime-provenance\.test\.mjs/g)).toHaveLength(4)
+ expect(source.match(/ssh-relay-runtime-toolchain\.test\.mjs/g)).toHaveLength(4)
expect(
source.match(/node --check config\/scripts\/ssh-relay-runtime-closure\.mjs/g)
).toHaveLength(2)
From 27e932c8cbc44f09d9b410d3aca519e7d1b8e9fe Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:09:18 -0400
Subject: [PATCH 058/267] docs(ssh): record runtime closure and metadata gates
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 15 +-
...github-release-implementation-checklist.md | 193 +++++++++++++++---
2 files changed, 169 insertions(+), 39 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 6f64636b468..4f53e5377c4 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -15,12 +15,12 @@ Approved design decisions are listed separately and are not presented as impleme
- The bundled runtime path is not connected to production and no tuple is enabled.
- The future bundled path is a per-SSH-target Beta option, off by default.
- No runtime artifact has been published to a GitHub Release.
-- Latest native proof: [GitHub Actions run 29365815434](https://github.com/stablyai/orca/actions/runs/29365815434)
+- Latest native proof: [GitHub Actions run 29367559831](https://github.com/stablyai/orca/actions/runs/29367559831)
passed clean-build equality and runtime smoke on Linux x64/arm64, macOS x64/arm64, and Windows
x64/arm64.
-- Active work package: exact runtime closure enforcement is locally green and awaiting all-six
- native proof; SBOM/provenance completeness, archive safety, oldest-baseline execution, and native
- trust remain open.
+- Active work package: exact runtime closure is green on all six native runner families; the SPDX,
+ builder/runner identity, and hashed-toolchain correction is locally green and awaiting the same
+ native proof. Archive safety, oldest-baseline execution, and native trust remain open.
## Locked rollout decisions
@@ -74,8 +74,11 @@ Approved design decisions are listed separately and are not presented as impleme
- [x] Prove bundled Node, real PTY input/resize/exit, watcher events, and Windows resource settlement.
- [x] Prove two clean builds compare exactly on all six native GitHub runner families.
- [x] Keep `/guard:cf`; fix Windows arm64 drift with copied-artifact-only `/INCREMENTAL:NO`.
-- [x] Define and locally test an exact 34/35/42-file per-tuple closure that rejects undeclared
- package managers, sources, maps, build outputs, package drift, and missing licenses.
+- [x] Enforce and prove an exact 34/35/42-file per-tuple closure that rejects undeclared package
+ managers, sources, maps, build outputs, package drift, and missing licenses on all six native
+ runner families.
+- [x] Define and locally test file-to-package SPDX ownership, immutable archive-scoped SBOM identity,
+ exact-commit builder identity, runner identity, and bounded SHA-256 toolchain records.
- [ ] Complete the runtime closure, license, SBOM, provenance, and prohibited-content allowlist audit.
- [ ] Prove each candidate on its oldest supported OS/libc/kernel baseline.
- [ ] Sign macOS and Windows native bytes and verify target-native trust policy.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index a5d9228a9db..3f621096a53 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 runtime closure — exact implementation commit `ec5461aff` moves the exact per-tuple closure/prohibited-content/package/license gate into the artifact builder and is locally green under E-M3-RUNTIME-CLOSURE-LOCAL-001; all six prior candidate archives from run [29365815434](https://github.com/stablyai/orca/actions/runs/29365815434) satisfy the new 34/35/42-file closure, but the new builder gate has not yet run target-natively and no Milestone 3 completion box is closed by local/static reuse alone; the next exact-head six-cell run must retain the proven content IDs, enforce the closure before archiving, complete smoke and clean-build equality, and upload before this slice is accepted; SBOM/provenance completeness, compiler/toolchain records, oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — exact-head run [29367559831](https://github.com/stablyai/orca/actions/runs/29367559831) at ledger head `ace3d4f41` passes the builder-enforced 34/35/42-file closure, unchanged runtime content IDs, complete smoke, clean-build equality, and upload on all six native runner families under E-M3-RUNTIME-CLOSURE-CI-001; exact metadata implementation commit `26bbd7b67` adds file-to-package SPDX ownership/dependency relationships, archive-scoped document identity, exact-commit builder identity, resolved runner image/architecture, and bounded SHA-256 records for native executables and complete build-package trees, and is locally green under E-M3-METADATA-LOCAL-001; the next exact-head six-cell run must prove those records and metadata equality target-natively before the remaining SBOM/provenance/toolchain boxes are checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,11 +175,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact implementation commit `ec5461aff` plus its evidence-ledger head
- and rerun all six target-native cells. Require the builder-enforced closure, unchanged runtime
- content IDs, complete smoke, clean-build equality, and upload before checking the related
- Milestone 3 claims. Then fix the separately identified SBOM/provenance/toolchain gaps. Preserve the
- artifact-only boundary, legacy/default path, and every other release gate.
+- Next required action: push exact metadata implementation commit `26bbd7b67` plus its evidence-
+ ledger head and rerun all six target-native cells. Require exact SPDX ownership, archive-scoped
+ document identity, commit-pinned builder identity, resolved runner identity, complete bounded tool
+ records with SHA-256, clean-build metadata equality, smoke, and upload before checking the remaining
+ Milestone 3 metadata/toolchain claims. Preserve the artifact-only boundary, legacy/default path,
+ and every other release gate.
## Non-Negotiable Invariants
@@ -773,8 +774,8 @@ related implementation claims are checked.
Each runtime must contain only the executable closure required by the relay.
-- [ ] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
- watcher content-hash guarantees.
+- [x] Replace or extend `config/scripts/build-relay.mjs` without weakening its existing relay and
+ watcher content-hash guarantees. (E-M3-RUNTIME-CLOSURE-CI-001)
- [x] Add a clearly named runtime assembly script, for example
`config/scripts/build-ssh-relay-runtime.mjs`.
(E-M3-RUNTIME-LOCAL-001)
@@ -784,23 +785,27 @@ Each runtime must contain only the executable closure required by the relay.
headers archive and tuple-specific `node.lib`; verify/copy them into an exclusive local build
root and configure `node-gyp` to fail rather than fetch an unstaged input.
(E-M3-WINDOWS-INPUT-001; successful target-native offline build remains a per-tuple gate)
-- [ ] Build Orca’s patched `node-pty@1.1.0` against the exact bundled Node runtime.
-- [ ] Assert Orca-required patched exports/diagnostics exist; do not silently use an upstream
- prebuild that omits the patch.
+- [x] Build Orca’s patched `node-pty@1.1.0` against the exact bundled Node runtime.
+ (E-M3-RUNTIME-CLOSURE-CI-001)
+- [x] Assert Orca-required patched exports/diagnostics exist; do not silently use an upstream
+ prebuild that omits the patch. (E-M3-RUNTIME-CLOSURE-CI-001)
- [x] For Windows, copy the tuple-architecture `conpty.dll` and `OpenConsole.exe` from the pinned
node-pty source into `build/Release/conpty`, hash them into the runtime identity as native
runtime files, and prove PTY spawn/resize/exit with `useConptyDll: true`. Do not substitute a
system-ConPTY smoke for the production path. (E-M3-WINDOWS-CONPTY-GAP-001,
E-M3-WINDOWS-CI-001)
-- [ ] Include exactly one compatible `@parcel/watcher@2.5.6` native optional package.
-- [ ] Include relay JavaScript, watcher child, required runtime JavaScript closure, licenses, SBOM,
- provenance, and runtime metadata.
-- [ ] Exclude package managers, development dependencies, compilers, sources, caches, build
+- [x] Include exactly one compatible `@parcel/watcher@2.5.6` native optional package.
+ (E-M3-RUNTIME-CLOSURE-CI-001)
+- [x] Include relay JavaScript, watcher child, required runtime JavaScript closure, licenses, SBOM,
+ provenance, and runtime metadata. (E-M3-RUNTIME-CLOSURE-CI-001; metadata completeness remains
+ a separate open gate)
+- [x] Exclude package managers, development dependencies, compilers, sources, caches, build
directories, and Orca-built debug symbols unless an approved diagnostics requirement needs
them. Preserve verified official Node executable bytes without stripping or rewriting them,
- even when the upstream binary contains debug metadata.
-- [x] Make POSIX `tar.xz` output deterministic for the same tree, epoch, and pinned compression
- toolchain; keep Windows zip determinism as an open per-tuple gate. (E-M3-RUNTIME-LOCAL-001)
+ even when the upstream binary contains debug metadata. (E-M3-RUNTIME-CLOSURE-CI-001)
+- [x] Make POSIX `tar.xz` and Windows ZIP output deterministic for the same tree, epoch, and pinned
+ compression toolchain. (E-M3-RUNTIME-LOCAL-001, E-M3-REPRODUCIBILITY-CI-001,
+ E-M3-RUNTIME-CLOSURE-CI-001)
- [x] Verify required executable modes before archiving. (E-M3-RUNTIME-LOCAL-001)
- [ ] Sign native code according to the platform decisions in Milestone 1.
- [ ] Verify platform-native signatures/policy on target-native runners after signing and before
@@ -1375,16 +1380,16 @@ Baseline measurements must be captured before product behavior changes.
Update status and evidence as work begins. Do not combine these into one large behavior switch.
-| Work package | Scope | Default behavior change | Status | PR/evidence |
-| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
-| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
-| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
-| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; exact closure locally green; native closure/trust pending | `ec5461aff`; E-M3-RUNTIME-CLOSURE-LOCAL-001 |
-| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
-| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
-| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
-| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
-| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
+| Work package | Scope | Default behavior change | Status | PR/evidence |
+| ------------------------- | ------------------------------------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
+| 0. #8450 legacy fix | Coherent Node/npm selection and live repro | Fixes legacy selection only | Complete and CI-green in draft PR #8724 | E-M0-UNIT-002, E-M0-LIVE-002, E-M0-STATIC-002, E-M0-PR-001, E-M0-CI-001 |
+| 1. Contract and selectors | Manifest schema, identity, platform/libc selection, hostile inputs | None | Complete and CI-green in draft PR #8728 | `b9d80a4cb`; E-M2-RED-001, E-M2-CONTRACT-001, E-M2-CI-001 |
+| 2. Runtime builds | Per-tuple assembly, native smoke, SBOM/provenance/signing | None | Draft PR #8741; native closure green; metadata local; trust pending | `26bbd7b67`; E-M3-RUNTIME-CLOSURE-CI-001, E-M3-METADATA-LOCAL-001 |
+| 3. Release publication | Prerequisite DAG, embedded manifest, draft upload/read-back gates | Asset-only | Not started | — |
+| 4. Desktop resolver/cache | Verified download, extraction, cache, offline behavior | None/forced mode only | Not started | — |
+| 5. Transfer/install | Bounded transports, structured sentinel, bundled launch behind per-target Beta/forced mode | Per-target opt-in only | Not started | — |
+| 6. Fallback/diagnostics | Abort-and-join state machine, mode isolation, reason codes, target-mode configuration/UI | Per-target Beta only | Not started | — |
+| 7. Live gates/rollout | Matrix, security, performance, release promotion | Per-tuple staged | Not started | — |
Every PR must document:
@@ -1442,6 +1447,7 @@ focused commands as their scripts/tests are introduced.
- [x] `node config/scripts/build-ssh-relay-runtime.mjs --tuple linux-arm64-glibc --inputs-directory --output-directory --work-directory --source-date-epoch --git-commit ` (E-M3-RUNTIME-LOCAL-001, E-M3-REPRODUCIBILITY-LINKER-LOCAL-001; local native Linux arm64 history plus current stable-work contract)
- [x] `node config/scripts/verify-ssh-relay-runtime.mjs --runtime-directory --identity --archive ` (E-M3-RUNTIME-LOCAL-001; local native Linux arm64 only)
- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-*.test.mjs` (E-M3-RUNTIME-CLOSURE-LOCAL-001; 68 local artifact-contract tests plus static reuse of six prior candidate archives; new target-native builder execution remains pending)
+- [x] `pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-*.test.mjs && pnpm run typecheck && pnpm run lint && pnpm run check:max-lines-ratchet` (E-M3-METADATA-LOCAL-001; 76 local artifact-contract tests, typecheck, full lint, reliability gates, localization gates, and max-lines ratchet; native metadata/toolchain proof remains pending)
### Commands/scripts that must be added or formally identified
@@ -6062,6 +6068,127 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
require unchanged runtime content IDs, builder-enforced closure, complete smoke, clean-build
equality, and upload. Then fix and prove SBOM/provenance completeness separately.
+### E-M3-RUNTIME-CLOSURE-CI-001 — Exact closure passes all six target-native builds
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact ledger head `ace3d4f416b1c710d601aa72c4b45824266b5cad`, containing exact
+ closure implementation commit `ec5461aff61d6868c18d4db1ce27f409a43ecf47`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Run and jobs: [run 29367559831](https://github.com/stablyai/orca/actions/runs/29367559831),
+ conclusion `success`; Windows arm64 `87202773590`, Windows x64 `87202773643`, macOS arm64
+ `87202773645`, macOS x64 `87202773658`, Linux x64 `87202773669`, and Linux arm64 `87202773674`
+ all passed
+- Runners: `windows-11-arm` / `win11-arm64` `20260706.102.1` native ARM64;
+ `windows-2022` / `win22` `20260706.237.1` native X64; `macos-15` / `macos15`
+ `20260706.0213.1` native ARM64; `macos-15-intel` / `macos15` `20260629.0276.1` native X64;
+ `ubuntu-24.04` / `ubuntu24` `20260705.232.1` native X64; and `ubuntu-24.04-arm` /
+ `ubuntu24-arm64` `20260706.52.2` native ARM64. Every job checked out the exact head above in a
+ GitHub-hosted environment.
+- Remote and transport: none; target-native artifact build/inspection/smoke and unpublished
+ seven-day Actions artifacts only
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29367559831 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh run view 29367559831 --repo stablyai/orca --log | \
+ rg 'requested_runner=|resolved_image_os=|resolved_image_version=|runner_arch=|runner_environment=|source_commit='
+ gh run view 29367559831 --repo stablyai/orca --log | \
+ rg 'Test Files|"contentId"|windows_node_pty_msbuild_settings|clean_build_output=|runtime-evidence/'
+ gh api 'repos/stablyai/orca/actions/runs/29367559831/artifacts?per_page=100'
+ ```
+
+- Result: PASS. All four POSIX jobs passed 15 artifact-contract files and both Windows jobs passed 16. Each clean build then executed the builder-enforced exact closure before archiving, archive
+ inspection, bundled Node/native PTY/watcher smoke, strict clean-output comparison, and upload.
+ Both Windows builds retained exactly one `/INCREMENTAL:NO`, `/guard:cf`, no target `.ilk`, and
+ identical native output. No tuple changed content identity: Linux x64
+ `sha256:960546cd96c67fcf9bb0a61e96ecdbecbffd9104d3a495578f8bb19dd810649a`, Linux arm64
+ `sha256:aa3aa8ae8b42334ba7b0dbe5c43fd1184e36b3f4f4a9bec0e990e9b78f090756`, macOS x64
+ `sha256:585ea6034cdd07487d8667059f975a877c795a45dc0d6eeee1617f2e3749faa2`, macOS arm64
+ `sha256:40ff5d2036784b794e7b09f78596409f63f3145280c530bece5280d40897f6cb`, Windows x64
+ `sha256:6f7cbeb120e67766037649f6079099346220973e6158e1429b6ebf42729f1564`, and Windows arm64
+ `sha256:741765a10ddc824cd305b9a50c8efd91477517c05d9cfe1ca46342c002652186`.
+- Uploaded evidence: exactly six unpublished artifacts: Windows arm64 `8324892474`, 33,083,332
+ bytes, `sha256:1b90d23c5573116cf855926db294dff906407a5703260099d0d0f58bb500eb6a`;
+ Windows x64 `8324831155`, 37,033,206 bytes,
+ `sha256:013fa42e0bf29a36f378dffe6d327090a042be9e5947e55e6e097d3382418c5d`; macOS arm64
+ `8324786647`, 24,734,978 bytes,
+ `sha256:87e2632c542964df47ab4f981da0909532c51be6b2131692e539aaa1c77d409c`; macOS x64
+ `8324870620`, 26,400,500 bytes,
+ `sha256:d9ddf9b00d77aa05785e0813e3a61fcb07cd8f5f06b270e9703d5f2e28c03370`; Linux arm64
+ `8324781748`, 28,205,869 bytes,
+ `sha256:47d40a3eacf149270efabe7688f700dcfca7c1e155bbc2188298c7e78948469b`; and Linux x64
+ `8324772777`, 29,281,599 bytes,
+ `sha256:5b1552f4e2d28db1f552068e3bad6eb174e83ad88800101120a92cf2f0e44121`.
+- Duration and resource metrics: job wall times were 7m51s Windows arm64, 5m26s Windows x64, 3m38s
+ macOS arm64, 6m58s macOS x64, 3m06s Linux x64, and 3m23s Linux arm64. SSH channels/files,
+ cancellation, fallback delay, and connection latency remain outside this artifact-only run.
+- Oracle proved: the exact closure is enforced inside the artifact builder on all six native runner
+ families; the reviewed Node, patched native PTY, one tuple-native watcher, relay/watcher JavaScript,
+ runtime metadata, and license bundle are present; package managers, development/build/source/map/
+ PDB/ILK content and any unreviewed path are absent; complete smoke, reproducibility, and no-upload-
+ before-success ordering remain intact.
+- Does not prove: the subsequent SPDX/toolchain correction at `26bbd7b67`, oldest-baseline execution,
+ native signing/trust, SSH transfer/install, publication, fallback, UI, performance, or any enabled
+ tuple.
+- Checklist items satisfied: build the exact patched `node-pty`; assert patch markers; include one
+ compatible watcher and the complete declared runtime/license/metadata closure; exclude all
+ undeclared content. No tuple or production path is enabled.
+- Follow-up: prove the separately committed metadata correction on all six native cells before
+ checking SBOM/toolchain completeness, then proceed to oldest-baseline and native-trust gates.
+
+### E-M3-METADATA-LOCAL-001 — SPDX ownership and bounded toolchain provenance
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `26bbd7b67a035cdf309ccdbbaab5985f4cc797fe`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure metadata/tool-discovery tests
+- Remote and transport: none; artifact-only local contract tests
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts config/scripts/ssh-relay-*.test.mjs
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/build-ssh-relay-runtime.mjs \
+ config/scripts/ssh-relay-runtime-provenance.mjs \
+ config/scripts/ssh-relay-runtime-provenance.test.mjs \
+ config/scripts/ssh-relay-runtime-sbom.mjs \
+ config/scripts/ssh-relay-runtime-sbom.test.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs \
+ config/scripts/ssh-relay-runtime-workflow.test.mjs
+ git diff --check
+ ```
+
+- Result: PASS. Nineteen artifact test files passed 76 tests; typecheck, full lint and its
+ reliability/localization/line-budget sub-gates, focused formatting, and diff checks passed. The
+ SPDX builder assigns every runtime file to exactly one package with `CONTAINS`, records relay
+ `DEPENDS_ON` relationships, uses the immutable content ID as relay package version, uses the exact
+ archive SHA-256 in the unique document namespace, and rejects unowned paths, identifier collisions,
+ or a missing archive digest. The provenance collector pins the builder URL to the exact Git commit,
+ requires the requested/resolved runner label, OS, architecture, hosted environment, and image
+ version, selects the real Windows compiler/linker version from stderr rather than the usage line,
+ and records bounded SHA-256 plus version for bundled/build Node, compiler, linker where applicable,
+ build system, Python, archive tool, strip tool where applicable, and complete bounded trees for
+ `node-gyp`, `node-addon-api`, and `yazl` where applicable.
+- Oracle proved: the prior placeholder relay SBOM version, unowned file inventory, content-ID-only
+ document namespace, merge-ref builder identity, missing runner identity, un-hashed tool strings,
+ and Windows compiler usage-string record are corrected by one fail-closed metadata boundary; local
+ native discovery produces only bounded version/digest records without absolute host paths.
+- Does not prove: Windows tool discovery/version parsing, all six runner-image records, clean-build
+ equality of the new SBOM/provenance bytes, uploaded metadata, an external SPDX consumer, native
+ signing/trust, oldest baselines, SSH, publication, or any enabled tuple.
+- Checklist items satisfied: local SBOM/provenance/toolchain implementation and purpose tests only;
+ native metadata/toolchain boxes remain unchecked.
+- Follow-up: push the exact implementation plus this ledger head, rerun all six native cells, inspect
+ each uploaded SPDX/provenance document, and require complete bounded records and clean-build
+ equality before closing the remaining Milestone 3 metadata/toolchain claims.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6119,11 +6246,11 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact implementation commit `ec5461aff` plus its evidence-ledger head and rerun all six target-
-native cells. Require the builder-enforced exact closure, unchanged runtime content IDs, complete
-smoke, clean-build equality, and upload before checking the related Milestone 3 claims. Then correct
-and prove SBOM/provenance/toolchain completeness as a separate artifact-only slice before proceeding
-to oldest-baseline and native-trust proof.
+Push exact metadata implementation commit `26bbd7b67` plus its evidence-ledger head and rerun all six
+target-native cells. Require exact SPDX ownership, archive-scoped document identity, commit-pinned
+builder identity, resolved runner identity, complete bounded tool records with SHA-256, clean-build
+metadata equality, smoke, and upload before checking the remaining Milestone 3 metadata/toolchain
+claims. Then proceed to oldest-baseline and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From e3f76d3ba70c860242b5300aa765fbf75ef21317 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:21:26 -0400
Subject: [PATCH 059/267] build(ssh): correct native runtime metadata contracts
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-toolchain.mjs | 15 ++++++--
.../ssh-relay-runtime-toolchain.test.mjs | 25 ++++++++++++-
config/scripts/ssh-relay-runtime-tree.mjs | 4 +-
.../ssh-relay-runtime-windows-tree.test.mjs | 9 ++++-
config/scripts/ssh-relay-runtime-zip.test.mjs | 2 +-
...elease-implementation-checklist-summary.md | 7 ++--
...github-release-implementation-checklist.md | 19 ++++++----
...6-07-14-ssh-relay-github-release-plan.html | 6 ++-
.../ssh/ssh-relay-artifact-selector.test.ts | 37 ++++++++++++++++---
9 files changed, 96 insertions(+), 28 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 1583b86c011..72ee65e002e 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -173,6 +173,14 @@ export function sshRelayRuntimeRunnerIdentity({ env = process.env } = {}) {
return identity
}
+export function sshRelayRuntimeStripVersionProbe(platform) {
+ // Why: GNU strip is silent/versionless without --version, while Apple strip delegates its
+ // version identity to the selected Xcode toolchain.
+ return platform === 'darwin'
+ ? { versionCommand: 'xcodebuild', versionArgs: ['-version'] }
+ : { args: ['--version'] }
+}
+
export function assertSshRelayRuntimeToolchain(toolchain, tuple) {
const common = ['buildNode', 'bundledNode', 'compiler', 'buildSystem', 'python', 'archive']
const expected = tuple.startsWith('win32-')
@@ -216,7 +224,8 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
}),
linker: await executableRecord({
command: 'link.exe',
- args: [],
+ // Why: direct no-argument invocation is silent on current hosted MSVC runners.
+ args: ['/?'],
versionPattern: /Linker Version/i
}),
buildSystem: await executableRecord({
@@ -241,9 +250,7 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
archive: await executableRecord({ command: 'xz', args: ['--version'] }),
strip: await executableRecord({
command: 'strip',
- args: [],
- versionCommand: process.platform === 'darwin' ? 'xcodebuild' : undefined,
- versionArgs: process.platform === 'darwin' ? ['-version'] : undefined,
+ ...sshRelayRuntimeStripVersionProbe(process.platform),
xcrun: process.platform === 'darwin'
})
}
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index eb6795eea09..6fd6d4c3881 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -5,7 +5,8 @@ import {
collectSshRelayRuntimeToolchain,
selectSshRelayRuntimeToolVersion,
sshRelayRuntimeBuilderIdentity,
- sshRelayRuntimeRunnerIdentity
+ sshRelayRuntimeRunnerIdentity,
+ sshRelayRuntimeStripVersionProbe
} from './ssh-relay-runtime-toolchain.mjs'
const commit = 'a'.repeat(40)
@@ -26,6 +27,20 @@ describe('SSH relay runtime build provenance', () => {
).toBe('Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35228 for ARM64')
})
+ it('selects the Windows linker version from bounded help output', () => {
+ expect(
+ selectSshRelayRuntimeToolVersion(
+ {
+ stdout: [
+ 'Microsoft (R) Incremental Linker Version 14.44.35228.0',
+ 'usage: LINK [options] [files]'
+ ].join('\r\n')
+ },
+ /Linker Version/i
+ )
+ ).toBe('Microsoft (R) Incremental Linker Version 14.44.35228.0')
+ })
+
it('pins GitHub builder identity to the exact source commit', () => {
expect(
sshRelayRuntimeBuilderIdentity({
@@ -83,6 +98,14 @@ describe('SSH relay runtime build provenance', () => {
).toThrow(/runner identity/i)
})
+ it('requests an actual GNU strip version and pins Apple strip to Xcode', () => {
+ expect(sshRelayRuntimeStripVersionProbe('linux')).toEqual({ args: ['--version'] })
+ expect(sshRelayRuntimeStripVersionProbe('darwin')).toEqual({
+ versionCommand: 'xcodebuild',
+ versionArgs: ['-version']
+ })
+ })
+
it('records bounded native tool versions and SHA-256 executable or code digests', async () => {
const toolchain = await collectSshRelayRuntimeToolchain(process.execPath)
const tuple = process.platform === 'win32' ? 'win32-x64' : 'linux-x64-glibc'
diff --git a/config/scripts/ssh-relay-runtime-tree.mjs b/config/scripts/ssh-relay-runtime-tree.mjs
index ffe15e33f05..1316f81ef08 100644
--- a/config/scripts/ssh-relay-runtime-tree.mjs
+++ b/config/scripts/ssh-relay-runtime-tree.mjs
@@ -44,14 +44,14 @@ const COMPATIBILITY = Object.freeze({
'darwin-arm64': { kind: 'darwin', minimumVersion: '13.5' },
'win32-x64': {
kind: 'win32',
- minimumBuild: 20348,
+ minimumBuild: 19045,
minimumOpenSshVersion: '8.1p1',
minimumPowerShellVersion: '5.1',
minimumDotNetFrameworkRelease: 528040
},
'win32-arm64': {
kind: 'win32',
- minimumBuild: 20348,
+ minimumBuild: 26100,
minimumOpenSshVersion: '8.1p1',
minimumPowerShellVersion: '5.1',
minimumDotNetFrameworkRelease: 528040
diff --git a/config/scripts/ssh-relay-runtime-windows-tree.test.mjs b/config/scripts/ssh-relay-runtime-windows-tree.test.mjs
index 0575696ef56..ddcf23bab92 100644
--- a/config/scripts/ssh-relay-runtime-windows-tree.test.mjs
+++ b/config/scripts/ssh-relay-runtime-windows-tree.test.mjs
@@ -48,7 +48,10 @@ async function createWindowsNodePtyBuild(root) {
}
describe('SSH relay Windows runtime tree', () => {
- it('carries the production ConPTY runtime closure in the hashed identity', async () => {
+ it.each([
+ ['win32-x64', 19045],
+ ['win32-arm64', 26100]
+ ])('carries the %s ConPTY closure and reviewed build floor', async (tuple, minimumBuild) => {
const directory = await mkdtemp(join(tmpdir(), 'orca-runtime-windows-tree-'))
temporaryDirectories.push(directory)
const nodeRoot = join(directory, 'node')
@@ -72,7 +75,7 @@ describe('SSH relay Windows runtime tree', () => {
])
const identity = await assembleSshRelayRuntimeTree({
- tuple: 'win32-x64',
+ tuple,
nodeRoot,
nodePtyBuildDirectory,
relayDirectory,
@@ -80,6 +83,8 @@ describe('SSH relay Windows runtime tree', () => {
nodeVersion: '24.18.0'
})
+ expect(identity.compatibility.minimumBuild).toBe(minimumBuild)
+
for (const name of ['conpty.dll', 'OpenConsole.exe']) {
const path = `node_modules/node-pty/build/Release/conpty/${name}`
expect(identity.entries).toContainEqual(
diff --git a/config/scripts/ssh-relay-runtime-zip.test.mjs b/config/scripts/ssh-relay-runtime-zip.test.mjs
index 5aa3669bc49..00dcab442c8 100644
--- a/config/scripts/ssh-relay-runtime-zip.test.mjs
+++ b/config/scripts/ssh-relay-runtime-zip.test.mjs
@@ -34,7 +34,7 @@ async function fixture() {
architecture: 'x64',
compatibility: {
kind: 'win32',
- minimumBuild: 20348,
+ minimumBuild: 19045,
minimumOpenSshVersion: '8.1p1',
minimumPowerShellVersion: '5.1',
minimumDotNetFrameworkRelease: 528040
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 4f53e5377c4..9400fd1623b 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -18,9 +18,10 @@ Approved design decisions are listed separately and are not presented as impleme
- Latest native proof: [GitHub Actions run 29367559831](https://github.com/stablyai/orca/actions/runs/29367559831)
passed clean-build equality and runtime smoke on Linux x64/arm64, macOS x64/arm64, and Windows
x64/arm64.
-- Active work package: exact runtime closure is green on all six native runner families; the SPDX,
- builder/runner identity, and hashed-toolchain correction is locally green and awaiting the same
- native proof. Archive safety, oldest-baseline execution, and native trust remain open.
+- Active work package: exact runtime closure is green on all six native runner families. The first
+ metadata run failed closed before Windows build/upload because its linker-version probe was
+ silent; the bounded probe correction and reviewed Windows 19045/26100 build-floor correction are
+ in progress. Archive safety, oldest-baseline execution, and native trust remain open.
## Locked rollout decisions
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 3f621096a53..1fcbcb51144 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — exact-head run [29367559831](https://github.com/stablyai/orca/actions/runs/29367559831) at ledger head `ace3d4f41` passes the builder-enforced 34/35/42-file closure, unchanged runtime content IDs, complete smoke, clean-build equality, and upload on all six native runner families under E-M3-RUNTIME-CLOSURE-CI-001; exact metadata implementation commit `26bbd7b67` adds file-to-package SPDX ownership/dependency relationships, archive-scoped document identity, exact-commit builder identity, resolved runner image/architecture, and bounded SHA-256 records for native executables and complete build-package trees, and is locally green under E-M3-METADATA-LOCAL-001; the next exact-head six-cell run must prove those records and metadata equality target-natively before the remaining SBOM/provenance/toolchain boxes are checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29368482959](https://github.com/stablyai/orca/actions/runs/29368482959) proves the corrected metadata path on the completed POSIX cells but fails closed in both Windows contract-test cells before build or upload because direct no-argument `link.exe` invocation returns no selectable version line; the active correction requests bounded linker help explicitly and must pass both native Windows architectures plus clean-build metadata equality before any remaining SBOM/provenance/toolchain box is checked; the same evidence audit exposed that generated x64/arm64 Windows compatibility floors were both 20348 despite the reviewed 19045/26100 contract, so the plan now makes the single monotonic manifest floors explicit before correcting code and regenerating native identities; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -282,7 +282,9 @@ No production implementation begins until every blocking item has an owner and d
- [x] Define macOS 13.5 as the minimum for both x64 and arm64 candidates. (E-M1-BASELINE-001)
- [x] Define the initial Windows candidates as Windows 10 22H2 build 19045 or Server 2022 build
20348 for x64, and Windows 11 24H2 build 26100 for arm64, with OpenSSH for Windows 8.1p1,
- Windows PowerShell 5.1, and .NET Framework 4.8 as minimum bootstrap primitives.
+ Windows PowerShell 5.1, and .NET Framework 4.8 as minimum bootstrap primitives. Because the
+ manifest has one monotonic `minimumBuild` per tuple, encode 19045 for x64 (which admits Server
+ 2022 build 20348 and newer) and 26100 for arm64.
(E-M1-BASELINE-001)
- [x] Treat a Rosetta-translated shell as x64 process architecture, but keep it on legacy until an
x64 artifact passes a live Rosetta SSH cell. A native arm64 shell selects arm64; detection
@@ -836,6 +838,8 @@ Rules:
dependencies, spawns a real PTY, performs input/resize/exit, and observes
create/modify/rename/delete watcher events. (E-M3-REPRODUCIBILITY-CI-001)
- [ ] Every build records compiler/toolchain/container image digests and runner architecture.
+ **In progress — 2026-07-14, Codex implementation owner:** run 29368482959 failed closed on
+ both Windows architectures at the linker-version probe; no Windows build or upload followed.
## Milestone 4 — Make Relay Artifacts Prerequisites of Desktop Builds
@@ -6246,11 +6250,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact metadata implementation commit `26bbd7b67` plus its evidence-ledger head and rerun all six
-target-native cells. Require exact SPDX ownership, archive-scoped document identity, commit-pinned
-builder identity, resolved runner identity, complete bounded tool records with SHA-256, clean-build
-metadata equality, smoke, and upload before checking the remaining Milestone 3 metadata/toolchain
-claims. Then proceed to oldest-baseline and native-trust proof.
+Finish the bounded Windows linker-version correction and the reviewed 19045/26100 Windows
+compatibility-floor correction, run the focused local gates, and rerun all six target-native cells.
+Require exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity,
+resolved runner identity, complete bounded tool records with SHA-256, clean-build metadata equality,
+smoke, upload, and regenerated Windows content identities before checking the remaining Milestone 3
+metadata/toolchain claims. Then proceed to oldest-baseline and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html b/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
index 09adbb1be72..64eb43b7ab2 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html
@@ -1124,8 +1124,10 @@
Build for the runtime, architecture, and libc together.
candidates require kernel 4.18, glibc 2.28, and libstdc++ 6.0.25 with
GLIBCXX_3.4.25; macOS candidates require 13.5. Initial Windows x64
candidates require Windows 10 22H2 build 19045 or Server 2022 build 20348, and arm64
- requires Windows 11 24H2 build 26100. Windows bootstrap additionally requires OpenSSH
- for Windows 8.1p1, Windows PowerShell 5.1, and .NET Framework 4.8.
+ requires Windows 11 24H2 build 26100. The immutable manifest's single monotonic
+ minimumBuild is therefore 19045 for x64 (which also admits Server 2022
+ build 20348 and newer builds) and 26100 for arm64. Windows bootstrap additionally
+ requires OpenSSH for Windows 8.1p1, Windows PowerShell 5.1, and .NET Framework 4.8.
Node's detached checksum signature is verified against a build-input-pinned official
diff --git a/src/main/ssh/ssh-relay-artifact-selector.test.ts b/src/main/ssh/ssh-relay-artifact-selector.test.ts
index b63a095143f..522a0e791e6 100644
--- a/src/main/ssh/ssh-relay-artifact-selector.test.ts
+++ b/src/main/ssh/ssh-relay-artifact-selector.test.ts
@@ -16,16 +16,22 @@ const compatibleLinuxHost = {
glibcxxVersion: '3.4.33'
}
-function windowsManifest() {
+function windowsManifest({
+ architecture = 'x64',
+ minimumBuild = architecture === 'x64' ? 19045 : 26100
+}: {
+ architecture?: 'x64' | 'arm64'
+ minimumBuild?: number
+} = {}) {
const manifest = createSshRelayArtifactTestManifest()
const tuple = structuredClone(manifest.tuples[0]) as unknown as Record
Object.assign(tuple, {
- tupleId: 'win32-x64',
+ tupleId: `win32-${architecture}`,
os: 'win32',
- architecture: 'x64',
+ architecture,
compatibility: {
kind: 'windows',
- minimumBuild: 20348,
+ minimumBuild,
minimumOpenSshVersion: '8.1p1',
minimumPowerShellVersion: '5.1',
minimumDotNetFrameworkRelease: 528040
@@ -39,7 +45,7 @@ const compatibleWindowsHost = {
os: 'win32' as const,
architecture: 'x64' as const,
processTranslated: false,
- build: 20348,
+ build: 19045,
openSshVersion: '8.1p1',
powerShellVersion: '5.1',
dotNetFrameworkRelease: 528040
@@ -130,7 +136,7 @@ describe('SSH relay artifact selector', () => {
it('checks Windows bootstrap versions before selection', () => {
const manifest = windowsManifest()
expect(selectSshRelayArtifact(manifest, compatibleWindowsHost).kind).toBe('selected')
- expect(selectSshRelayArtifact(manifest, { ...compatibleWindowsHost, build: 20347 })).toEqual({
+ expect(selectSshRelayArtifact(manifest, { ...compatibleWindowsHost, build: 19044 })).toEqual({
kind: 'legacy',
reason: 'os-too-old'
})
@@ -154,6 +160,25 @@ describe('SSH relay artifact selector', () => {
).toEqual({ kind: 'legacy', reason: 'dotnet-too-old' })
})
+ it.each([
+ ['x64', 19044, 19045],
+ ['arm64', 26099, 26100]
+ ] as const)(
+ 'enforces the reviewed Windows %s build boundary',
+ (architecture, rejectedBuild, acceptedBuild) => {
+ const manifest = windowsManifest({ architecture })
+ const host = { ...compatibleWindowsHost, architecture }
+
+ expect(selectSshRelayArtifact(manifest, { ...host, build: rejectedBuild })).toEqual({
+ kind: 'legacy',
+ reason: 'os-too-old'
+ })
+ expect(selectSshRelayArtifact(manifest, { ...host, build: acceptedBuild }).kind).toBe(
+ 'selected'
+ )
+ }
+ )
+
it('selects legacy when Windows bootstrap evidence is absent or malformed', () => {
const manifest = windowsManifest()
expect(
From c906c21ce117021885ec4db68c62ef28c141d7ba Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:23:11 -0400
Subject: [PATCH 060/267] docs(ssh): record native metadata probe failures
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 5 +-
...github-release-implementation-checklist.md | 128 ++++++++++++++++--
2 files changed, 118 insertions(+), 15 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 9400fd1623b..c40bbd3e6c7 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -20,8 +20,9 @@ Approved design decisions are listed separately and are not presented as impleme
x64/arm64.
- Active work package: exact runtime closure is green on all six native runner families. The first
metadata run failed closed before Windows build/upload because its linker-version probe was
- silent; the bounded probe correction and reviewed Windows 19045/26100 build-floor correction are
- in progress. Archive safety, oldest-baseline execution, and native trust remain open.
+ silent and direct inspection found versionless Linux strip records. The bounded probe and reviewed
+ Windows 19045/26100 build-floor corrections are locally green and await a fresh all-six native
+ proof. Archive safety, oldest-baseline execution, and native trust remain open.
## Locked rollout decisions
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 1fcbcb51144..d9b7c2762cb 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29368482959](https://github.com/stablyai/orca/actions/runs/29368482959) proves the corrected metadata path on the completed POSIX cells but fails closed in both Windows contract-test cells before build or upload because direct no-argument `link.exe` invocation returns no selectable version line; the active correction requests bounded linker help explicitly and must pass both native Windows architectures plus clean-build metadata equality before any remaining SBOM/provenance/toolchain box is checked; the same evidence audit exposed that generated x64/arm64 Windows compatibility floors were both 20348 despite the reviewed 19045/26100 contract, so the plan now makes the single monotonic manifest floors explicit before correcting code and regenerating native identities; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29368482959](https://github.com/stablyai/orca/actions/runs/29368482959) proves exact metadata/build equality and upload on all four POSIX cells but fails closed in both Windows contract-test cells before build or upload because direct no-argument `link.exe` invocation returns no selectable version line (E-M3-METADATA-CI-RED-001); artifact inspection also shows both Linux `strip` records contain a usage line rather than a version; exact implementation commit `e3f76d3ba` requests bounded linker help and GNU strip version output, encodes the reviewed single monotonic Windows build floors as x64 19045 and arm64 26100, and passes 20 files / 96 tests plus static gates under E-M3-METADATA-CORRECTION-LOCAL-001; the next exact-head run must pass all six native cells and direct metadata inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,12 +175,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact metadata implementation commit `26bbd7b67` plus its evidence-
- ledger head and rerun all six target-native cells. Require exact SPDX ownership, archive-scoped
- document identity, commit-pinned builder identity, resolved runner identity, complete bounded tool
- records with SHA-256, clean-build metadata equality, smoke, and upload before checking the remaining
- Milestone 3 metadata/toolchain claims. Preserve the artifact-only boundary, legacy/default path,
- and every other release gate.
+- Next required action: push exact correction commit `e3f76d3ba` plus its evidence-ledger head and
+ rerun all six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
+ commit-pinned builder identity, resolved runner identity, complete bounded tool records with
+ SHA-256, clean-build metadata equality, smoke, upload, and regenerated Windows identities before
+ checking the remaining Milestone 3 metadata/toolchain claims. Preserve the artifact-only boundary,
+ legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -6193,6 +6193,108 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
each uploaded SPDX/provenance document, and require complete bounded records and clean-build
equality before closing the remaining Milestone 3 metadata/toolchain claims.
+### E-M3-METADATA-CI-RED-001 — Native metadata probes fail closed on Windows
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `27e932c8cbc44f09d9b410d3aca519e7d1b8e9fe`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29368482959](https://github.com/stablyai/orca/actions/runs/29368482959),
+ final conclusion `failure` after 7m56s. Native job IDs: Linux x64 `87205814073`, Linux arm64
+ `87205814134`, macOS x64 `87205814075`, macOS arm64 `87205814110`, Windows x64 `87205814074`,
+ and Windows arm64 `87205814066`.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29368482959 --repo stablyai/orca --json status,conclusion,headSha,url,jobs
+ gh api repos/stablyai/orca/actions/jobs/87205814074/logs
+ gh api repos/stablyai/orca/actions/jobs/87205814066/logs
+ gh api repos/stablyai/orca/actions/runs/29368482959/artifacts
+ gh run download 29368482959 --repo stablyai/orca --dir /tmp/orca-8450-metadata-red-29368482959
+ # Parse every downloaded identity/SPDX/provenance document and hash every archive locally.
+ ```
+
+- Result: EXPECTED RED. Linux x64 completed in 2m58s, Linux arm64 in 3m24s, macOS arm64 in 4m08s,
+ and macOS x64 in 7m56s; each passed the 19-file/76-test native contract suite, built twice, smoked,
+ compared every runtime/archive/identity/SPDX/provenance byte exactly, and uploaded. Windows x64
+ failed in 1m32s and Windows arm64 in 4m09s at
+ `ssh-relay-runtime-toolchain.test.mjs` before input download, build, smoke, comparison, or upload:
+ line 217 could not select a linker version because direct no-argument `link.exe` invocation was
+ silent on both hosted MSVC environments. The four POSIX artifact IDs are Linux x64 `8325127644`,
+ Linux arm64 `8325138929`, macOS arm64 `8325153830`, and macOS x64 `8325244087`; no Windows
+ artifact exists for this run.
+- Downloaded-artifact audit: all four archive hashes match identity and provenance; every SPDX
+ namespace is scoped to the exact archive SHA-256; all 34 Linux and 35 macOS files have exactly one
+ package `CONTAINS` owner; each document has eight relay dependency relationships; builder URLs pin
+ exact commit `27e932c8c`; and runner labels, OS, architecture, hosted environment, image OS, and
+ image version are present and correct. POSIX content IDs remain `960546cd…` Linux x64,
+ `aa3aa8ae…` Linux arm64, `585ea603…` macOS x64, and `40ff5d20…` macOS arm64.
+- Additional defect exposed by direct payload inspection: both Linux provenance documents record
+ the first no-argument GNU `strip` usage line instead of a version. macOS records Xcode 16.4 and
+ has no equivalent defect. A green job alone would not have caught this semantic provenance gap.
+- Oracle proved: native metadata generation, equality, archive-scoped SPDX identity, package/file
+ ownership, dependency relationships, commit-pinned builder identity, and runner identity work on
+ all four POSIX cells; both Windows cells reject incomplete linker provenance before producing or
+ uploading bytes; direct artifact audit detects semantically wrong tool-version records.
+- Does not prove: any Windows metadata/build output, valid GNU strip version records, complete
+ all-six toolchain provenance, regenerated Windows compatibility identities, oldest baselines,
+ native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: no new completion box; the compiler/toolchain item remains in progress.
+- Follow-up: explicitly request bounded linker help, request GNU `strip --version`, correct the
+ reviewed Windows 19045/26100 compatibility floors, and rerun every native cell from one exact head.
+
+### E-M3-METADATA-CORRECTION-LOCAL-001 — Native version probes and Windows build floors
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `e3f76d3ba70c860242b5300aa765fbf75ef21317`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure contract tests
+- Remote and transport: none; artifact/selector-only local contract tests
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check \
+ .github/workflows/ssh-relay-runtime-artifacts.yml \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs \
+ config/scripts/ssh-relay-runtime-tree.mjs \
+ config/scripts/ssh-relay-runtime-windows-tree.test.mjs \
+ config/scripts/ssh-relay-runtime-zip.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-plan.html \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+ git diff --check
+ ```
+
+- Result: PASS. Twenty test files passed 96 tests; typecheck, full lint and its
+ reliability/localization/line-budget sub-gates, max-lines ratchet, focused formatting, and diff
+ checks passed. The only full-lint diagnostics are pre-existing unrelated warnings. `link.exe` is
+ now invoked with `/?`, GNU strip with `--version`, and Apple strip remains tied to the selected
+ Xcode version. Generated Windows runtime identities now encode the reviewed monotonic build floors:
+ x64 `19045` and arm64 `26100`. Purpose-named selector tests reject x64 `19044` and arm64 `26099`
+ while accepting x64 `19045` and arm64 `26100`; both runtime-tree variants carry the same floors.
+- Oracle proved: the two native probe regressions have bounded explicit invocation contracts; the
+ artifact producer, ZIP fixture, and desktop selector tests agree with the reviewed Windows
+ compatibility decision; unknown/older Windows evidence still takes the classified legacy path.
+- Does not prove: either corrected probe on a native Windows/Linux runner, actual compiler/linker/
+ strip values in uploaded provenance, clean-build equality after Windows identity changes, oldest
+ Windows execution, native trust/signing, SSH, publication, or an enabled tuple. The Windows
+ compatibility change intentionally changes both Windows content IDs and requires fresh native
+ evidence.
+- Checklist items satisfied: local correction only; the compiler/toolchain, oldest-baseline, and
+ native-trust boxes remain unchecked.
+- Follow-up: push the exact implementation and ledger head, then require all six native jobs plus
+ direct inspection of every uploaded metadata document before closing the metadata/toolchain gate.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6250,12 +6352,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Finish the bounded Windows linker-version correction and the reviewed 19045/26100 Windows
-compatibility-floor correction, run the focused local gates, and rerun all six target-native cells.
-Require exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity,
-resolved runner identity, complete bounded tool records with SHA-256, clean-build metadata equality,
-smoke, upload, and regenerated Windows content identities before checking the remaining Milestone 3
-metadata/toolchain claims. Then proceed to oldest-baseline and native-trust proof.
+Push exact correction commit `e3f76d3ba` plus this evidence-ledger head and rerun all six
+target-native cells. Require exact SPDX ownership, archive-scoped document identity, commit-pinned
+builder identity, resolved runner identity, complete bounded tool records with SHA-256, clean-build
+metadata equality, smoke, upload, and regenerated Windows content identities before checking the
+remaining Milestone 3 metadata/toolchain claims. Then proceed to oldest-baseline and native-trust
+proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From e85f0c700c1bd40e76e08ef5063f9b3128acb600 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:27:55 -0400
Subject: [PATCH 061/267] build(ssh): record linker PE file version
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-toolchain.mjs | 27 +++++++++++++---
.../ssh-relay-runtime-toolchain.test.mjs | 32 ++++++++++++-------
2 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 72ee65e002e..04f2976a3ad 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -80,10 +80,14 @@ async function executableRecord({
versionCommand,
versionArgs,
versionPattern,
+ windowsFileVersion = false,
xcrun = false
}) {
const path = await locateExecutable(command, { xcrun })
- const result = await capture(versionCommand ?? path, versionArgs ?? args)
+ const invocation = windowsFileVersion
+ ? sshRelayRuntimeWindowsFileVersionInvocation(path)
+ : { command: versionCommand ?? path, args: versionArgs ?? args }
+ const result = await capture(invocation.command, invocation.args)
return {
version: selectSshRelayRuntimeToolVersion(result, versionPattern),
sha256: await sha256File(path)
@@ -181,6 +185,20 @@ export function sshRelayRuntimeStripVersionProbe(platform) {
: { args: ['--version'] }
}
+export function sshRelayRuntimeWindowsFileVersionInvocation(path) {
+ return {
+ command: 'pwsh.exe',
+ args: [
+ '-NoLogo',
+ '-NoProfile',
+ '-NonInteractive',
+ '-Command',
+ '[System.Diagnostics.FileVersionInfo]::GetVersionInfo($args[0]).FileVersion',
+ path
+ ]
+ }
+}
+
export function assertSshRelayRuntimeToolchain(toolchain, tuple) {
const common = ['buildNode', 'bundledNode', 'compiler', 'buildSystem', 'python', 'archive']
const expected = tuple.startsWith('win32-')
@@ -224,9 +242,10 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
}),
linker: await executableRecord({
command: 'link.exe',
- // Why: direct no-argument invocation is silent on current hosted MSVC runners.
- args: ['/?'],
- versionPattern: /Linker Version/i
+ args: [],
+ // Why: hosted link.exe is silent when piped; authenticated PE metadata gives its real version.
+ windowsFileVersion: true,
+ versionPattern: /^\d+(?:\.\d+){2,3}$/
}),
buildSystem: await executableRecord({
command: 'msbuild.exe',
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index 6fd6d4c3881..4b9ee2c42d6 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -6,7 +6,8 @@ import {
selectSshRelayRuntimeToolVersion,
sshRelayRuntimeBuilderIdentity,
sshRelayRuntimeRunnerIdentity,
- sshRelayRuntimeStripVersionProbe
+ sshRelayRuntimeStripVersionProbe,
+ sshRelayRuntimeWindowsFileVersionInvocation
} from './ssh-relay-runtime-toolchain.mjs'
const commit = 'a'.repeat(40)
@@ -27,18 +28,25 @@ describe('SSH relay runtime build provenance', () => {
).toBe('Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35228 for ARM64')
})
- it('selects the Windows linker version from bounded help output', () => {
+ it('selects a bounded Windows linker file version', () => {
expect(
- selectSshRelayRuntimeToolVersion(
- {
- stdout: [
- 'Microsoft (R) Incremental Linker Version 14.44.35228.0',
- 'usage: LINK [options] [files]'
- ].join('\r\n')
- },
- /Linker Version/i
- )
- ).toBe('Microsoft (R) Incremental Linker Version 14.44.35228.0')
+ selectSshRelayRuntimeToolVersion({ stdout: '14.44.35228.0\r\n' }, /^\d+(?:\.\d+){2,3}$/)
+ ).toBe('14.44.35228.0')
+ })
+
+ it('passes the resolved linker path as a non-interpolated PowerShell argument', () => {
+ const path = String.raw`C:\Program Files\Microsoft Visual Studio\link.exe`
+ expect(sshRelayRuntimeWindowsFileVersionInvocation(path)).toEqual({
+ command: 'pwsh.exe',
+ args: [
+ '-NoLogo',
+ '-NoProfile',
+ '-NonInteractive',
+ '-Command',
+ '[System.Diagnostics.FileVersionInfo]::GetVersionInfo($args[0]).FileVersion',
+ path
+ ]
+ })
})
it('pins GitHub builder identity to the exact source commit', () => {
From 01acba8608e3446bb921cfb812a7026817a53032 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:32:32 -0400
Subject: [PATCH 062/267] docs(ssh): record native linker probe evidence
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 5 +-
...github-release-implementation-checklist.md | 91 ++++++++++++++++++-
2 files changed, 91 insertions(+), 5 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index c40bbd3e6c7..5a40324b38c 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -21,8 +21,9 @@ Approved design decisions are listed separately and are not presented as impleme
- Active work package: exact runtime closure is green on all six native runner families. The first
metadata run failed closed before Windows build/upload because its linker-version probe was
silent and direct inspection found versionless Linux strip records. The bounded probe and reviewed
- Windows 19045/26100 build-floor corrections are locally green and await a fresh all-six native
- proof. Archive safety, oldest-baseline execution, and native trust remain open.
+ Windows 19045/26100 build-floor corrections fixed Linux, but linker help remained silent on both
+ Windows runners. Reading the hashed linker's PE file version is locally green and awaits a fresh
+ all-six native proof. Archive safety, oldest-baseline execution, and native trust remain open.
## Locked rollout decisions
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index d9b7c2762cb..e1acae31a28 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29368482959](https://github.com/stablyai/orca/actions/runs/29368482959) proves exact metadata/build equality and upload on all four POSIX cells but fails closed in both Windows contract-test cells before build or upload because direct no-argument `link.exe` invocation returns no selectable version line (E-M3-METADATA-CI-RED-001); artifact inspection also shows both Linux `strip` records contain a usage line rather than a version; exact implementation commit `e3f76d3ba` requests bounded linker help and GNU strip version output, encodes the reviewed single monotonic Windows build floors as x64 19045 and arm64 26100, and passes 20 files / 96 tests plus static gates under E-M3-METADATA-CORRECTION-LOCAL-001; the next exact-head run must pass all six native cells and direct metadata inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29369350259](https://github.com/stablyai/orca/actions/runs/29369350259) proves corrected GNU strip versions, exact metadata/build equality, and upload on all four POSIX cells but shows `link.exe /?` is also silent when piped on both Windows architectures, which fail closed before build or upload (E-M3-METADATA-CI-RED-002); exact implementation commit `e85f0c700` retains SHA-256 of the resolved linker and reads its authenticated PE `FileVersion` through non-interactive PowerShell with the path passed as a positional argument, and passes 20 files / 97 tests plus static gates under E-M3-WINDOWS-LINKER-FILE-VERSION-LOCAL-001; the next exact-head run must pass all six native cells and direct metadata inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,7 +175,7 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact correction commit `e3f76d3ba` plus its evidence-ledger head and
+- Next required action: push exact correction commit `e85f0c700` plus its evidence-ledger head and
rerun all six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
commit-pinned builder identity, resolved runner identity, complete bounded tool records with
SHA-256, clean-build metadata equality, smoke, upload, and regenerated Windows identities before
@@ -6294,6 +6294,91 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
native-trust boxes remain unchecked.
- Follow-up: push the exact implementation and ledger head, then require all six native jobs plus
direct inspection of every uploaded metadata document before closing the metadata/toolchain gate.
+- Subsequent native evidence: E-M3-METADATA-CI-RED-002 disproves the locally inferred
+ `link.exe /?` behavior;
+ both hosted Windows architectures remain silent when the help output is piped by Node.
+
+### E-M3-METADATA-CI-RED-002 — Linker help remains silent on native Windows
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `c906c21ce117021885ec4db68c62ef28c141d7ba`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29369350259](https://github.com/stablyai/orca/actions/runs/29369350259),
+ final conclusion `failure` after 6m15s. Native job IDs: Linux x64 `87208675566`, Linux arm64
+ `87208675357`, macOS x64 `87208675363`, macOS arm64 `87208675377`, Windows x64 `87208675364`,
+ and Windows arm64 `87208675391`.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29369350259 --repo stablyai/orca --json status,conclusion,headSha,jobs
+ gh api repos/stablyai/orca/actions/jobs/87208675364/logs
+ gh api repos/stablyai/orca/actions/jobs/87208675391/logs
+ gh api repos/stablyai/orca/actions/runs/29369350259/artifacts
+ gh run download 29369350259 --repo stablyai/orca --dir /tmp/orca-8450-metadata-red-29369350259
+ # Parse every downloaded identity/SPDX/provenance document and hash every archive locally.
+ ```
+
+- Result: EXPECTED RED. Linux x64 completed in 2m53s, Linux arm64 in 3m30s, macOS arm64 in 2m52s,
+ and macOS x64 in 6m14s; each passed native contracts, built twice, smoked, compared every
+ runtime/archive/identity/SPDX/provenance byte exactly, and uploaded. Windows x64 failed in 1m24s
+ and Windows arm64 in 3m51s at the same linker-version selector before input download, build,
+ smoke, comparison, or upload. Explicit `link.exe /?` is still silent when invoked through the
+ bounded Node child-process pipe on both hosted MSVC environments. The four POSIX artifact IDs are
+ Linux x64 `8325461679`, Linux arm64 `8325476952`, macOS arm64 `8325460610`, and macOS x64
+ `8325542377`; no Windows artifact exists for this run.
+- Downloaded-artifact audit: all four archive hashes match identity and provenance; every SPDX
+ namespace is scoped to the exact archive SHA-256; all 34 Linux and 35 macOS files have exactly one
+ package owner and eight dependency relationships; builder URLs pin exact commit `c906c21ce`;
+ runner identities are complete; Linux x64/arm64 now record `GNU strip (GNU Binutils for Ubuntu)
+2.42`; and no tool record contains a usage line. POSIX content IDs remain unchanged.
+- Oracle proved: the corrected GNU version probe works and stays reproducible on both Linux
+ architectures; all four POSIX metadata contracts are complete for this head; direct linker banner
+ parsing is not a portable Windows provenance source and fails closed on both native architectures.
+- Does not prove: Windows metadata/build output, regenerated Windows content identities, native
+ linker file versions, oldest baselines, native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: no new completion box; the compiler/toolchain item remains in progress.
+- Follow-up: retain SHA-256 of the resolved linker but obtain its actual PE file version without
+ relying on linker stdout/stderr, then rerun every native cell from one exact head.
+
+### E-M3-WINDOWS-LINKER-FILE-VERSION-LOCAL-001 — Authenticated linker PE version
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `e85f0c700c1bd40e76e08ef5063f9b3128acb600`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure invocation/metadata tests
+- Remote and transport: none; artifact-only local contract tests
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs
+ git diff --check
+ ```
+
+- Result: PASS. Twenty test files passed 97 tests; typecheck, full lint and its
+ reliability/localization/line-budget sub-gates, focused formatting, and diff checks passed. The
+ linker record still hashes the resolved `link.exe` bytes. Its version now comes from
+ `System.Diagnostics.FileVersionInfo` through `pwsh.exe -NoLogo -NoProfile -NonInteractive`; the
+ resolved path is a separate positional argument and is never interpolated into executable script
+ text. Only a bounded numeric three- or four-component file version is accepted.
+- Oracle proved: the native-silent banner is no longer a provenance dependency; exact linker bytes
+ remain authenticated; paths containing spaces cannot alter the PowerShell expression; malformed,
+ missing, or nonnumeric file versions still fail closed.
+- Does not prove: the PE file-version call on either native Windows architecture, the exact returned
+ linker versions, Windows build/equality/upload, regenerated Windows content IDs, oldest baselines,
+ native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: local correction only; the compiler/toolchain item remains unchecked.
+- Follow-up: push this exact implementation plus the ledger head and require all six native jobs and
+ direct inspection of every uploaded metadata document before closing the metadata/toolchain gate.
## Accepted Gaps
@@ -6352,7 +6437,7 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact correction commit `e3f76d3ba` plus this evidence-ledger head and rerun all six
+Push exact correction commit `e85f0c700` plus this evidence-ledger head and rerun all six
target-native cells. Require exact SPDX ownership, archive-scoped document identity, commit-pinned
builder identity, resolved runner identity, complete bounded tool records with SHA-256, clean-build
metadata equality, smoke, upload, and regenerated Windows content identities before checking the
From 714308114dee85a6f241a43b75c6ac9122769c3e Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:36:56 -0400
Subject: [PATCH 063/267] build(ssh): isolate linker version path input
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-toolchain.mjs | 18 +++++++++-------
.../ssh-relay-runtime-toolchain.test.mjs | 21 +++++++++++++------
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 04f2976a3ad..1fbd5162a65 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -26,10 +26,11 @@ async function sha256File(path) {
return `sha256:${hash.digest('hex')}`
}
-async function capture(command, args) {
+async function capture(command, args, { env } = {}) {
try {
return await execFileAsync(command, args, {
encoding: 'utf8',
+ ...(env ? { env: { ...process.env, ...env } } : {}),
maxBuffer: TOOL_OUTPUT_BYTES,
timeout: TOOL_TIMEOUT_MS,
windowsHide: true
@@ -49,7 +50,8 @@ export function selectSshRelayRuntimeToolVersion({ stdout = '', stderr = '' }, p
.filter(Boolean)
const version = pattern ? lines.find((line) => pattern.test(line)) : lines[0]
if (!version || Buffer.byteLength(version) > 512) {
- throw new Error('Runtime build tool did not report a bounded version line')
+ const diagnostic = lines.slice(0, 3).join(' | ').slice(0, 512) || ''
+ throw new Error(`Runtime build tool did not report a bounded version line: ${diagnostic}`)
}
return version
}
@@ -87,7 +89,7 @@ async function executableRecord({
const invocation = windowsFileVersion
? sshRelayRuntimeWindowsFileVersionInvocation(path)
: { command: versionCommand ?? path, args: versionArgs ?? args }
- const result = await capture(invocation.command, invocation.args)
+ const result = await capture(invocation.command, invocation.args, invocation.options)
return {
version: selectSshRelayRuntimeToolVersion(result, versionPattern),
sha256: await sha256File(path)
@@ -193,9 +195,9 @@ export function sshRelayRuntimeWindowsFileVersionInvocation(path) {
'-NoProfile',
'-NonInteractive',
'-Command',
- '[System.Diagnostics.FileVersionInfo]::GetVersionInfo($args[0]).FileVersion',
- path
- ]
+ "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')).FileVersion"
+ ],
+ options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
}
}
@@ -243,9 +245,9 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
linker: await executableRecord({
command: 'link.exe',
args: [],
- // Why: hosted link.exe is silent when piped; authenticated PE metadata gives its real version.
+ // Why: hosted link.exe is pipe-silent; authenticated PE metadata gives its real version.
windowsFileVersion: true,
- versionPattern: /^\d+(?:\.\d+){2,3}$/
+ versionPattern: /^\d+(?:\.\d+){2,3}(?:\s.*)?$/
}),
buildSystem: await executableRecord({
command: 'msbuild.exe',
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index 4b9ee2c42d6..9903908420c 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -30,11 +30,14 @@ describe('SSH relay runtime build provenance', () => {
it('selects a bounded Windows linker file version', () => {
expect(
- selectSshRelayRuntimeToolVersion({ stdout: '14.44.35228.0\r\n' }, /^\d+(?:\.\d+){2,3}$/)
- ).toBe('14.44.35228.0')
+ selectSshRelayRuntimeToolVersion(
+ { stdout: '14.44.35228.0 built by release pipeline\r\n' },
+ /^\d+(?:\.\d+){2,3}(?:\s.*)?$/
+ )
+ ).toBe('14.44.35228.0 built by release pipeline')
})
- it('passes the resolved linker path as a non-interpolated PowerShell argument', () => {
+ it('passes the resolved linker path through a non-interpolated environment value', () => {
const path = String.raw`C:\Program Files\Microsoft Visual Studio\link.exe`
expect(sshRelayRuntimeWindowsFileVersionInvocation(path)).toEqual({
command: 'pwsh.exe',
@@ -43,12 +46,18 @@ describe('SSH relay runtime build provenance', () => {
'-NoProfile',
'-NonInteractive',
'-Command',
- '[System.Diagnostics.FileVersionInfo]::GetVersionInfo($args[0]).FileVersion',
- path
- ]
+ "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')).FileVersion"
+ ],
+ options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
})
})
+ it('bounds failed version diagnostics', () => {
+ expect(() =>
+ selectSshRelayRuntimeToolVersion({ stderr: `unexpected ${'x'.repeat(1_000)}` }, /version/i)
+ ).toThrow(/^Runtime build tool did not report a bounded version line: unexpected x{490}/)
+ })
+
it('pins GitHub builder identity to the exact source commit', () => {
expect(
sshRelayRuntimeBuilderIdentity({
From 756165552d31ee962c99a3a454bce2bebb29092b Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:49:41 -0400
Subject: [PATCH 064/267] docs(ssh): record linker environment evidence
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 246 ++++++++----------
...github-release-implementation-checklist.md | 179 ++++++++++++-
2 files changed, 269 insertions(+), 156 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 5a40324b38c..8fbc377e255 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -1,171 +1,131 @@
-# SSH Relay Runtime Distribution — Implementation Checklist
+# SSH Relay Runtime Distribution — Short Implementation Checklist
Last updated: 2026-07-14
-This is the human-readable project tracker. The
+Use this file to track the project. The
[detailed evidence ledger](./2026-07-14-ssh-relay-github-release-implementation-checklist.md)
-contains exact commands, runner identities, artifact hashes, metrics, and residual gaps.
-
-A checked box here means the implementation or validation has exact evidence in that ledger.
-Approved design decisions are listed separately and are not presented as implemented work.
-
-## Current state
-
-- Existing SSH relay behavior remains the default for every target.
-- The bundled runtime path is not connected to production and no tuple is enabled.
-- The future bundled path is a per-SSH-target Beta option, off by default.
-- No runtime artifact has been published to a GitHub Release.
-- Latest native proof: [GitHub Actions run 29367559831](https://github.com/stablyai/orca/actions/runs/29367559831)
- passed clean-build equality and runtime smoke on Linux x64/arm64, macOS x64/arm64, and Windows
- x64/arm64.
-- Active work package: exact runtime closure is green on all six native runner families. The first
- metadata run failed closed before Windows build/upload because its linker-version probe was
- silent and direct inspection found versionless Linux strip records. The bounded probe and reviewed
- Windows 19045/26100 build-floor corrections fixed Linux, but linker help remained silent on both
- Windows runners. Reading the hashed linker's PE file version is locally green and awaits a fresh
- all-six native proof. Archive safety, oldest-baseline execution, and native trust remain open.
-
-## Locked rollout decisions
-
-- Legacy behavior remains the persisted and effective default.
-- The Beta choice is per SSH target, off by default, and shown on target add/edit surfaces.
-- Missing, old, imported, unknown, or malformed settings resolve to legacy.
-- A mode change applies only on the next connection or explicit reconnect.
-- Legacy remains available; removal or narrowing requires a separate review.
-- Only availability/compatibility failures may fall back automatically. Integrity, security, and
- corruption failures fail closed.
-
-## Rollout implementation remaining
-
-- [ ] Implement the per-target configuration field and migration tests.
-- [ ] Add the off-by-default Beta-tagged option to SSH target add/edit UI.
-- [ ] Implement `bundled-auto` selection for explicitly opted-in targets.
-- [ ] Implement automatic legacy fallback only for classified availability/compatibility failures.
-- [ ] Fail closed for signature, hash, archive, tree, native-trust, bundled-Node, and cache-corruption
- failures.
-- [ ] Add the explicit “disable Beta and reconnect” recovery action for fail-closed Beta errors.
-- [ ] Collect privacy-safe Beta success, latency, failure-stage, and fallback-reason telemetry.
-- [ ] Require a separate reviewed decision before changing any tuple to default-on.
+keeps commands, hashes, runner identities, timings, and failure details.
+
+A checked box means the work has evidence in the detailed ledger. Design approval alone does not
+complete a box.
+
+## Safety status
+
+- [x] Existing SSH relay installation remains the default for every target.
+- [x] The future bundled runtime is a per-target Beta option, off by default.
+- [x] Missing, old, imported, unknown, or malformed settings select legacy behavior.
+- [x] No bundled tuple is enabled and no runtime artifact is published.
+- [x] Integrity, security, and corruption failures are designed to fail closed, not fall back.
+- [x] Legacy removal or a default-on change requires a separate reviewed decision.
+
+## Active work
+
+- [ ] **WP2 — Finish target-native artifact metadata and provenance.**
+ - Four POSIX GitHub runner cells pass build, smoke, equality, and metadata upload.
+ - Windows x64/arm64 currently fail closed while reading the linker PE file version in
+ [run 29369925932](https://github.com/stablyai/orca/actions/runs/29369925932).
+ - Local commit `714308114` isolates the linker path through a child environment variable and is
+ green across 20 test files / 98 tests plus typecheck, lint, formatting, and diff checks.
+ - Next gate: push that exact correction, rerun all six native jobs, then inspect every uploaded
+ artifact before completing the metadata/provenance box.
-## Work packages
+## Work packages, in required order
-### 0 — Existing Node/npm resolver correction
+### WP0 — Existing Node/npm resolver correction
-- [x] Implement coherent remote Node/npm selection.
-- [x] Add focused unit/static proof.
-- [x] Prove live Linux arm64 SSH behavior.
-- [x] Keep this separate from artifact distribution.
-- [ ] Merge the independently reviewable fix from draft PR
- [#8724](https://github.com/stablyai/orca/pull/8724).
+- [x] Implement and unit-test coherent remote Node/npm selection.
+- [x] Prove live Linux arm64 SSH/PTY behavior.
+- [x] Keep the fix independently reviewable from runtime distribution.
+- [ ] Merge draft PR [#8724](https://github.com/stablyai/orca/pull/8724).
-### 1 — Manifest, identity, and platform contracts
+### WP1 — Contracts only
-- [x] Define signed immutable manifest and canonical content identity.
-- [x] Define exact release tag/asset URL rules without mutable `latest` lookup.
-- [x] Define conservative OS/architecture/libc selection.
-- [x] Add hostile manifest/path/schema tests.
+- [x] Define immutable signed manifests, content identity, exact asset URLs, and conservative tuple
+ selection.
+- [x] Add hostile manifest, schema, signature, and path tests.
- [ ] Finish archive-safety implementation and hostile archive tests.
- [ ] Update mode-qualified remote directory parsing and GC compatibility.
-- [ ] Merge the contract package from draft PR
- [#8728](https://github.com/stablyai/orca/pull/8728).
-
-### 2 — Target-native runtime artifacts
-
-- [x] Pin and verify Node v24.18.0 release inputs and signatures.
-- [x] Produce and smoke-test candidate runtimes with patched `node-pty` and the matching
- `@parcel/watcher` native package on all six runner families.
-- [x] Prove bundled Node, real PTY input/resize/exit, watcher events, and Windows resource settlement.
-- [x] Prove two clean builds compare exactly on all six native GitHub runner families.
-- [x] Keep `/guard:cf`; fix Windows arm64 drift with copied-artifact-only `/INCREMENTAL:NO`.
-- [x] Enforce and prove an exact 34/35/42-file per-tuple closure that rejects undeclared package
- managers, sources, maps, build outputs, package drift, and missing licenses on all six native
- runner families.
-- [x] Define and locally test file-to-package SPDX ownership, immutable archive-scoped SBOM identity,
- exact-commit builder identity, runner identity, and bounded SHA-256 toolchain records.
-- [ ] Complete the runtime closure, license, SBOM, provenance, and prohibited-content allowlist audit.
+- [ ] Merge draft PR [#8728](https://github.com/stablyai/orca/pull/8728).
+
+### WP2 — Target-native runtime artifacts
+
+- [x] Pin and verify Node v24.18.0 inputs and signatures.
+- [x] Build and smoke-test Node, patched `node-pty`, and `@parcel/watcher` on GitHub runners for
+ Linux, macOS, and Windows on x64 and arm64.
+- [x] Prove exact clean-build equality and exact runtime-tree closure on all six runner families.
+- [ ] Complete the all-six SBOM, license, provenance, toolchain, and prohibited-content audit.
- [ ] Prove each candidate on its oldest supported OS/libc/kernel baseline.
-- [ ] Sign macOS and Windows native bytes and verify target-native trust policy.
-- [ ] Record complete compiler/toolchain provenance for release promotion.
+- [ ] Sign macOS and Windows bytes and verify native trust on the target OS.
- [ ] Merge draft PR [#8741](https://github.com/stablyai/orca/pull/8741).
-### 3 — Release build, signing, and publication
-
-- [ ] Add target-native build jobs as release prerequisites.
-- [ ] Add native signing jobs and return signed bytes before final hashing.
-- [ ] Add the fail-closed aggregate and manifest-signing job.
-- [ ] Embed the exact signed manifest and accepted keys into every desktop build.
-- [ ] Upload the exact prebuilt runtime bytes to the matching draft release.
-- [ ] Verify draft read-back hashes and execute downloaded archives.
-- [ ] Test timeout, retry exhaustion, approval denial/timeout, signing failure, partial output, and
- recovered-draft behavior.
-- [ ] Block publication whenever any required runtime/signing/manifest gate fails.
-
-### 4 — Desktop resolver, verification, extraction, and cache
-
-- [ ] Implement offline tuple selection from the embedded signed manifest.
-- [ ] Implement exact direct release URL resolution and safe redirect handling.
-- [ ] Stream download with size/time bounds and archive SHA-256 verification.
-- [ ] Extract into exclusive staging with full hostile-archive defenses.
-- [ ] Verify the complete extracted tree before atomic cache publication.
-- [ ] Implement the 2 GiB bounded cache, locking, concurrency, quarantine, and eviction rules.
-- [ ] Prove verified client-cache transfer works with the client offline.
+### WP3 — Release build and signing
+
+- [ ] Add target-native runtime jobs as desktop release prerequisites.
+- [ ] Add native signing jobs; hash only the returned signed bytes.
+- [ ] Add a fail-closed aggregate and immutable manifest-signing job.
+- [ ] Embed the exact signed manifest and accepted keys in each desktop build.
+- [ ] Upload to a draft release, read back, re-hash, and execute the downloaded archives.
+- [ ] Test timeouts, retries, approval denial, signing failure, partial output, and draft recovery.
+
+### WP4 — Desktop resolver and verified cache
+
+- [ ] Select tuples offline from the embedded manifest and resolve immutable direct asset URLs.
+- [ ] Stream bounded downloads; verify signature, size, archive hash, and extracted tree.
+- [ ] Add exclusive staging, atomic publication, quarantine, locking, and the 2 GiB cache policy.
+- [ ] Prove verified cached bytes can be transferred while the client is offline.
- [ ] Preserve `ORCA_RELAY_PATH` behind the official-build trust boundary.
-### 5 — Bounded SSH transfer and remote installation
+### WP5 — SSH transfer and remote install
-- [ ] Implement bounded/cancellable SFTP transfer with executable-mode restoration.
-- [ ] Keep compatible POSIX tar streaming as an optional fast path.
-- [ ] Implement POSIX no-tar transfer using only the declared shell/file primitives.
+- [ ] Implement bounded, cancellable SFTP transfer.
+- [ ] Implement POSIX system-SSH transfer with optional tar and mandatory no-tar support.
- [ ] Implement bounded binary PowerShell/.NET transfer for Windows system SSH.
-- [ ] Transfer only locally verified bytes into exclusive remote staging.
-- [ ] Use bundled Node to hash the complete staged tree before any native probe.
-- [ ] Run native probes, PTY/watcher smoke, structured sentinel, atomic publish, and launch in order.
-- [ ] Trust the initial-install proof on warm launch under the immutable-directory assumption.
-- [ ] Quarantine detected mutation and recover only from freshly verified bundled bytes.
-- [ ] Preserve SSH authentication, connection, and relay RPC transport behavior.
+- [ ] Transfer verified bytes into exclusive staging and hash the complete staged tree with bundled
+ Node before native probes.
+- [ ] Prove probe → PTY/watcher smoke → sentinel → atomic publish → launch ordering.
+- [ ] Trust warm installs under the immutable-directory rule; quarantine detected mutation.
+- [ ] Keep SSH authentication, connection, and relay RPC transport unchanged.
-### 6 — Modes, fallback, diagnostics, and concurrency
+### WP6 — Modes, fallback, diagnostics, and races
- [ ] Implement internal `legacy`, `auto`, and forced diagnostic `bundled` modes.
-- [ ] Abort and await all bundled work before eligible legacy fallback starts.
-- [ ] Keep bundled and legacy identities, locks, partials, sentinels, and generations separate.
-- [ ] Add stable stage/failure codes and privacy-safe diagnostics.
-- [ ] Prove fallback races, reconnect/reattach, concurrent clients, GC, upgrade, and downgrade.
-- [ ] Prove every integrity/security/corruption class fails closed in `auto`.
-- [ ] Prove eligible legacy fallback begins within the documented delay budget.
-
-### 7 — Validation and Beta rollout
-
-- [ ] Name and pin representative POSIX and Windows remote snapshots for Layer B.
-- [ ] For every enabled remote tuple, pass built-in SFTP and system SSH.
-- [ ] For every supported client OS/architecture, pass both transfer families against representative
- POSIX and Windows remotes.
-- [ ] Prove remote GitHub egress is never required.
-- [ ] Prove no-tar/no-Node/no-Python/no-Perl/no-hash-tool bootstrap cases.
-- [ ] Run full-size, slow-link, cancellation, concurrency, and failure-injection tests.
+- [ ] Fall back automatically only for classified availability/compatibility failures.
+- [ ] Fail closed for signature, hash, archive/tree, native-trust, bundled-Node, and cache-corruption
+ failures.
+- [ ] Abort and await bundled work before eligible legacy fallback begins.
+- [ ] Separate bundled/legacy identities, locks, staging, sentinels, and generations.
+- [ ] Test reconnect, reattach, concurrent clients, cancellation, GC, upgrades, and downgrades.
+
+### WP7 — Per-target Beta and validation
+
+- [ ] Add the per-target mode field with safe migration/default tests.
+- [ ] Add the Beta-tagged option to SSH target add/edit UI, off by default.
+- [ ] Apply a mode change only on next connection or explicit reconnect.
+- [ ] Add actionable fail-closed recovery and privacy-safe Beta telemetry.
+- [ ] Run every enabled remote tuple through built-in SFTP and system SSH.
+- [ ] Run every supported client OS/architecture against representative POSIX and Windows remotes.
+- [ ] Prove no remote GitHub egress, no-tar bootstrap, full-size transfer, slow-link cancellation,
+ concurrency, RPC, and failure-injection behavior.
- [ ] Measure cold/warm latency, memory, channels/files, cancellation settlement, and fallback delay
- against legacy baselines.
-- [ ] Pass security review, SBOM/provenance, signing, key lifecycle, CVE, and emergency-refresh gates.
-- [ ] Ship the per-target Beta with every target still defaulting to legacy.
-- [ ] Accumulate approved real-host Beta evidence before any default-on proposal.
-- [ ] Require three qualifying RCs plus rollback proof before default-on review.
+ against legacy.
+- [ ] Ship only as per-target, off-by-default Beta; gather real-host evidence before default-on review.
+- [ ] Require three qualifying RCs and rollback proof before any default-on proposal.
## External blockers
-- [ ] Repository release administrator: approve the representative Layer B remote provider,
- snapshots, credentials, egress policy, teardown SLA, and cost/capacity owner.
-- [ ] Repository release administrator: provision the protected manifest/native-signing environment,
- reviewers, test keys/certificates, and access audit.
+- [ ] Release administrator chooses and provisions representative SSH remote snapshots, credentials,
+ egress rules, teardown SLA, and cost/capacity ownership.
+- [ ] Release administrator provisions protected manifest/native-signing environments, reviewers,
+ test keys/certificates, and access auditing.
-Safe behavior while either blocker remains: no bundled tuple is enabled or published; legacy remains
-the default, and independent local/native-runner contract work may continue.
+While blocked, artifact-only and test work may continue. No tuple may be enabled or published.
-## Definition of done
+## Final go/no-go gates
-- [ ] Every item above that applies to an enabled tuple has exact evidence in the detailed ledger.
-- [ ] Every enabled tuple has target-native build, oldest-baseline, native-trust, SFTP, system-SSH,
- RPC, security, and performance proof.
-- [ ] Every packaged desktop embeds the exact signed manifest for the published immutable assets.
-- [ ] The Beta ships off by default per target and rollback to legacy is proven in the same build.
-- [ ] No default-on rollout occurs without a separate reviewed decision and completed soak evidence.
-- [ ] Legacy remains available until a separately reviewed removal decision.
+- [ ] Every enabled tuple has native build, oldest-baseline, native-trust, SFTP, system-SSH, RPC,
+ security, and performance evidence.
+- [ ] Every desktop build embeds the signed manifest for the exact immutable assets it ships.
+- [ ] Beta rollback to the existing legacy mechanism is proven in the same build.
+- [ ] All required matrix cells have evidence IDs in the detailed ledger.
+- [ ] Default-on receives a separate review after the Beta soak; legacy remains available until a
+ separately reviewed removal decision.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index e1acae31a28..49003dc7734 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29369350259](https://github.com/stablyai/orca/actions/runs/29369350259) proves corrected GNU strip versions, exact metadata/build equality, and upload on all four POSIX cells but shows `link.exe /?` is also silent when piped on both Windows architectures, which fail closed before build or upload (E-M3-METADATA-CI-RED-002); exact implementation commit `e85f0c700` retains SHA-256 of the resolved linker and reads its authenticated PE `FileVersion` through non-interactive PowerShell with the path passed as a positional argument, and passes 20 files / 97 tests plus static gates under E-M3-WINDOWS-LINKER-FILE-VERSION-LOCAL-001; the next exact-head run must pass all six native cells and direct metadata inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29369925932](https://github.com/stablyai/orca/actions/runs/29369925932) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload while selecting the authenticated linker's PE file version (E-M3-METADATA-CI-RED-003); local commit `714308114` passes that linker path through a dedicated child environment variable, accepts only a bounded valid file-version form, preserves bounded failure diagnostics, and passes 20 files / 98 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-ENV-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,12 +175,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact correction commit `e85f0c700` plus its evidence-ledger head and
- rerun all six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
- commit-pinned builder identity, resolved runner identity, complete bounded tool records with
- SHA-256, clean-build metadata equality, smoke, upload, and regenerated Windows identities before
- checking the remaining Milestone 3 metadata/toolchain claims. Preserve the artifact-only boundary,
- legacy/default path, and every other release gate.
+- Next required action: finish the direct audit and ledger entry for run 29369925932, record local
+ proof for commit `714308114`, then push that exact correction plus the ledger head and rerun all
+ six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
+ commit-pinned builder identity, resolved runner identity, complete bounded tool records,
+ regenerated Windows content identities, smoke, exact clean-build equality, and upload. Preserve
+ the artifact-only boundary, legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -6380,6 +6380,158 @@ the bounded depth` before opening or parsing a candidate. Starting at the comple
- Follow-up: push this exact implementation plus the ledger head and require all six native jobs and
direct inspection of every uploaded metadata document before closing the metadata/toolchain gate.
+### E-M3-METADATA-CI-RED-003 — Positional PE-version lookup remains empty on Windows
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `01acba8608e3446bb921cfb812a7026817a53032`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29369925932](https://github.com/stablyai/orca/actions/runs/29369925932),
+ final conclusion `failure` after 7m05s. Native job IDs and wall durations: Linux x64
+ `87210560419` / 3m03s, Linux arm64 `87210560395` / 3m21s, macOS x64 `87210560388` /
+ 6m59s, macOS arm64 `87210560695` / 3m18s, Windows x64 `87210560429` / 1m24s, and
+ Windows arm64 `87210560403` / 4m49s.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29369925932 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/runs/29369925932/artifacts
+ gh api repos/stablyai/orca/actions/jobs/87210560429/logs
+ gh api repos/stablyai/orca/actions/jobs/87210560403/logs
+ gh run download 29369925932 --repo stablyai/orca \
+ --dir /tmp/orca-8450-metadata-red-29369925932
+ find /tmp/orca-8450-metadata-red-29369925932 -maxdepth 3 -type f -print
+ bash -eu -o pipefail <<'SH'
+ evidence=/tmp/orca-8450-metadata-red-29369925932
+ commit=01acba8608e3446bb921cfb812a7026817a53032
+ run_id=29369925932
+ find "$evidence" -type f \( -name '*.tar.xz' -o -name '*.zip' \) \
+ -exec shasum -a 256 {} +
+ for directory in "$evidence"/*; do
+ identity=$(find "$directory" -type f -name '*.identity.json')
+ provenance=$(find "$directory" -type f -name '*.provenance.json')
+ spdx=$(find "$directory" -type f -name '*.spdx.json')
+ archive=$(find "$directory" -type f \( -name '*.tar.xz' -o -name '*.zip' \))
+ archive_sha=$(shasum -a 256 "$archive" | cut -d ' ' -f 1)
+ jq -e --arg sha "$archive_sha" --arg commit "$commit" --arg run "$run_id" \
+ --slurpfile provenance "$provenance" --slurpfile spdx "$spdx" '
+ ($spdx[0].relationships | map(select(.relationshipType == "CONTAINS")) |
+ group_by(.relatedSpdxElement) |
+ map({key: .[0].relatedSpdxElement, value: length}) | from_entries) as $owners |
+ .archive.sha256 == ("sha256:" + $sha) and
+ .fileCount == ($spdx[0].files | length) and
+ ([.entries[] | select(.type == "file")] | length) == ($spdx[0].files | length) and
+ all($spdx[0].files[]; $owners[.SPDXID] == 1) and
+ ($spdx[0].relationships | map(select(.relationshipType == "DEPENDS_ON")) | length) == 8 and
+ $spdx[0].documentNamespace ==
+ ("https://github.com/stablyai/orca/ssh-relay-runtime/spdx/" + $sha) and
+ $provenance[0].subject[0].digest.sha256 == $sha and
+ $provenance[0].predicate.runDetails.metadata.invocationId == $run and
+ $provenance[0].predicate.runDetails.builder.id ==
+ ("https://github.com/stablyai/orca/blob/" + $commit +
+ "/.github/workflows/ssh-relay-runtime-artifacts.yml") and
+ ($provenance[0].predicate.buildDefinition.resolvedDependencies |
+ any(.digest.gitCommit == $commit and (.uri | endswith("@" + $commit)))) and
+ ($provenance[0].predicate.runDetails.metadata.runner |
+ .os != "" and .architecture != "" and .environment == "github-hosted" and
+ .requestedLabel != "" and .image.os != "" and .image.version != "") and
+ ($provenance[0].predicate.buildDefinition.internalParameters.toolchain | to_entries |
+ all(.[]; (.value.version | length) > 0 and
+ (.value.version | test("usage:"; "i") | not) and
+ (.value.sha256 | test("^sha256:[0-9a-f]{64}$")))) and
+ all(.entries[];
+ (.path | test(
+ "(^|/)(npm|npx|corepack)([.](cmd|exe))?$|[.](map|cc|cpp|h|hpp|o|obj|pdb|lib)$";
+ "i"
+ ) | not))
+ ' "$identity" >/dev/null
+ jq -c '{tupleId, contentId, fileCount, archive}' "$identity"
+ done
+ SH
+ ```
+
+- Result: EXPECTED RED. All four POSIX cells passed native contracts, built twice, inspected and
+ smoked both outputs, compared runtime/archive/identity/SPDX/provenance bytes exactly, and uploaded.
+ Windows x64 and arm64 each failed in `ssh-relay-runtime-toolchain.test.mjs` with `Runtime build
+tool did not report a bounded version line`; input download, build, smoke, comparison, and upload
+ were skipped. The two Windows failures occurred after target-native MSVC setup and dependency
+ install, so the x64 `windows-2022` and arm64 `windows-11-arm` environments independently disprove
+ the positional PowerShell path transport. No Windows artifact exists for this run.
+- Downloaded-artifact audit:
+
+ | Tuple | Artifact ID | Archive SHA-256 | Content ID prefix | Files | Runner image |
+ | ----------------- | ------------ | ------------------------------------------------------------------ | ----------------- | ----- | ------------------------------ |
+ | linux-x64-glibc | `8325687973` | `c71778c6ea716eb694b8d961b6bcf0c2a379761a535fa069434a7e755903b06a` | `960546cd…` | 34 | `ubuntu24` 20260705.232.1 |
+ | linux-arm64-glibc | `8325696189` | `6dc95917b828675a4700444378b96c89ff5b538e1848b3a167cc10c4702794d7` | `aa3aa8ae…` | 34 | `ubuntu24-arm64` 20260706.52.2 |
+ | darwin-x64 | `8325779710` | `332510ffba04959fbc16fdce54334fc9cca55f7b87fb19d78f1e4ce570c5b388` | `585ea603…` | 35 | `macos15` 20260629.0276.1 |
+ | darwin-arm64 | `8325693875` | `1474f808f8d1e5668060468284236ba4c81e395931fa1bf5d3dcbfed4b45a994` | `40ff5d20…` | 35 | `macos15` 20260706.0213.1 |
+
+ Every archive hash matches its identity and provenance subject. Every SPDX namespace ends in the
+ exact archive hash; every file has exactly one package owner; each document has nine packages and
+ eight dependency relationships. Builder and source identities pin exact commit `01acba860`; the
+ invocation is `29369925932`; requested runner labels, native architectures, environment, and image
+ versions are present. Linux records GCC 13.3.0, GNU Make 4.3, Python 3.12.3, XZ 5.4.5, and GNU
+ strip 2.42. macOS records Apple clang 17.0.0, GNU Make 3.81, Python 3.14.6, XZ 5.8.3, and Xcode
+ 16.4. Every tool record carries a SHA-256 and no version contains a usage line.
+
+- Oracle proved: all four POSIX metadata payloads remain semantically complete after the PE-version
+ change; direct audit agrees with workflow equality; both target-native Windows architectures
+ reject an empty PE-version result before unverified/incompletely described bytes can be built or
+ uploaded.
+- Does not prove: a working native Windows PE-version lookup, Windows build/metadata/equality/upload,
+ regenerated Windows content IDs for the 19045/26100 floors, oldest baselines, native trust/signing,
+ SSH, publication, or an enabled tuple.
+- Checklist items satisfied: no new completion box; the all-six SBOM/provenance/toolchain item
+ remains in progress.
+- Follow-up: transport the resolved linker path outside PowerShell argument parsing, retain exact
+ linker-byte hashing and bounded output validation, then rerun and directly audit all six cells.
+
+### E-M3-WINDOWS-LINKER-ENV-LOCAL-001 — Environment-isolated linker path transport
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `714308114dee85a6f241a43b75c6ac9122769c3e`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure invocation/metadata tests
+- Remote and transport: none; artifact-only local contracts
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md \
+ docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+ git diff --check
+ ```
+
+- Result: PASS. Twenty focused test files passed 98 tests in 5.90s. Typecheck passed all three
+ TypeScript projects. Full lint passed oxlint, switch exhaustiveness, styled-scrollbar,
+ reliability-gate, max-lines, bundled-skill, localization-catalog, and localization-coverage gates;
+ its diagnostics remain pre-existing unrelated warnings. The independent max-lines ratchet,
+ focused formatting, and diff checks passed.
+- Oracle proved: the PowerShell expression no longer relies on `$args` parsing and never
+ interpolates the linker path into executable script text; the exact resolved path is supplied in
+ a dedicated child-only environment value; the child inherits the required native build
+ environment; three- and four-component PE file versions with bounded release suffixes are
+ accepted; missing, malformed, oversized, or unrelated output remains rejected with at most 512
+ diagnostic bytes; and the resolved linker executable remains SHA-256 authenticated.
+- Does not prove: the environment-value lookup on either native Windows architecture, the actual
+ linker version, regenerated Windows metadata/content IDs, build/smoke/equality/upload, oldest
+ Windows execution, native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: local correction only; the all-six compiler/toolchain item remains
+ unchecked.
+- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
+ direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6437,12 +6589,13 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact correction commit `e85f0c700` plus this evidence-ledger head and rerun all six
-target-native cells. Require exact SPDX ownership, archive-scoped document identity, commit-pinned
-builder identity, resolved runner identity, complete bounded tool records with SHA-256, clean-build
-metadata equality, smoke, upload, and regenerated Windows content identities before checking the
-remaining Milestone 3 metadata/toolchain claims. Then proceed to oldest-baseline and native-trust
-proof.
+Finish the direct artifact audit and evidence entry for exact-head run 29369925932, record local
+proof for correction commit `714308114`, then push that exact correction plus this ledger head and
+rerun all six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
+commit-pinned builder identity, resolved runner identity, complete bounded tool records with
+SHA-256, clean-build metadata equality, smoke, upload, and regenerated Windows content identities
+before checking the remaining Milestone 3 metadata/toolchain claims. Then proceed to oldest-baseline
+and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From 1b775e6afe730c237f49b2d203591e07db11bfd8 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 17:58:42 -0400
Subject: [PATCH 065/267] build(ssh): read numeric linker PE version
Co-authored-by: Orca
---
config/scripts/ssh-relay-runtime-toolchain.mjs | 9 ++++++---
.../ssh-relay-runtime-toolchain.test.mjs | 17 +++++++++++++----
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 1fbd5162a65..3045f7e0446 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -188,6 +188,8 @@ export function sshRelayRuntimeStripVersionProbe(platform) {
}
export function sshRelayRuntimeWindowsFileVersionInvocation(path) {
+ const versionInfo =
+ "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH'))"
return {
command: 'pwsh.exe',
args: [
@@ -195,7 +197,8 @@ export function sshRelayRuntimeWindowsFileVersionInvocation(path) {
'-NoProfile',
'-NonInteractive',
'-Command',
- "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')).FileVersion"
+ // Why: hosted link.exe returns an empty FileVersion string; its numeric PE fields are stable.
+ `$versionInfo = ${versionInfo}; '{0}.{1}.{2}.{3}' -f $versionInfo.FileMajorPart, $versionInfo.FileMinorPart, $versionInfo.FileBuildPart, $versionInfo.FilePrivatePart`
],
options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
}
@@ -245,9 +248,9 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
linker: await executableRecord({
command: 'link.exe',
args: [],
- // Why: hosted link.exe is pipe-silent; authenticated PE metadata gives its real version.
+ // Why: hosted link.exe is pipe-silent; authenticated numeric PE metadata gives its version.
windowsFileVersion: true,
- versionPattern: /^\d+(?:\.\d+){2,3}(?:\s.*)?$/
+ versionPattern: /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
}),
buildSystem: await executableRecord({
command: 'msbuild.exe',
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index 9903908420c..b175b17b453 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -31,10 +31,19 @@ describe('SSH relay runtime build provenance', () => {
it('selects a bounded Windows linker file version', () => {
expect(
selectSshRelayRuntimeToolVersion(
- { stdout: '14.44.35228.0 built by release pipeline\r\n' },
- /^\d+(?:\.\d+){2,3}(?:\s.*)?$/
+ { stdout: '14.44.35228.0\r\n' },
+ /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
)
- ).toBe('14.44.35228.0 built by release pipeline')
+ ).toBe('14.44.35228.0')
+ })
+
+ it('rejects an absent Windows linker numeric file version', () => {
+ expect(() =>
+ selectSshRelayRuntimeToolVersion(
+ { stdout: '0.0.0.0\r\n' },
+ /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
+ )
+ ).toThrow(/0\.0\.0\.0/)
})
it('passes the resolved linker path through a non-interpolated environment value', () => {
@@ -46,7 +55,7 @@ describe('SSH relay runtime build provenance', () => {
'-NoProfile',
'-NonInteractive',
'-Command',
- "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')).FileVersion"
+ "$versionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')); '{0}.{1}.{2}.{3}' -f $versionInfo.FileMajorPart, $versionInfo.FileMinorPart, $versionInfo.FileBuildPart, $versionInfo.FilePrivatePart"
],
options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
})
From 3c3d47fc4bf06610d43dcdb267eadfed46627b0f Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:00:31 -0400
Subject: [PATCH 066/267] docs(ssh): record empty native PE versions
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 11 +-
...github-release-implementation-checklist.md | 130 ++++++++++++++++--
2 files changed, 122 insertions(+), 19 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 8fbc377e255..876247d59a2 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -21,11 +21,12 @@ complete a box.
## Active work
- [ ] **WP2 — Finish target-native artifact metadata and provenance.**
- - Four POSIX GitHub runner cells pass build, smoke, equality, and metadata upload.
- - Windows x64/arm64 currently fail closed while reading the linker PE file version in
- [run 29369925932](https://github.com/stablyai/orca/actions/runs/29369925932).
- - Local commit `714308114` isolates the linker path through a child environment variable and is
- green across 20 test files / 98 tests plus typecheck, lint, formatting, and diff checks.
+ - Four POSIX GitHub runner cells pass build, smoke, equality, metadata upload, and direct payload
+ audit in [run 29370926985](https://github.com/stablyai/orca/actions/runs/29370926985).
+ - Windows x64/arm64 fail closed because hosted `link.exe` returns an empty string-valued PE
+ `FileVersion`; neither cell downloads inputs or produces an artifact.
+ - Local commit `1b775e6af` formats the PE version from bounded numeric fields and rejects an absent
+ all-zero version. It is green across 20 test files / 99 tests plus static gates.
- Next gate: push that exact correction, rerun all six native jobs, then inspect every uploaded
artifact before completing the metadata/provenance box.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 49003dc7734..2c599d53538 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29369925932](https://github.com/stablyai/orca/actions/runs/29369925932) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload while selecting the authenticated linker's PE file version (E-M3-METADATA-CI-RED-003); local commit `714308114` passes that linker path through a dedicated child environment variable, accepts only a bounded valid file-version form, preserves bounded failure diagnostics, and passes 20 files / 98 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-ENV-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29370926985](https://github.com/stablyai/orca/actions/runs/29370926985) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload because the authenticated linker's string-valued PE `FileVersion` is empty on both hosted architectures (E-M3-METADATA-CI-RED-004); exact implementation commit `1b775e6af` formats the four numeric PE version fields, rejects the absent `0.0.0.0` form, preserves exact linker-byte hashing and environment-isolated path transport, and passes 20 files / 99 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-NUMERIC-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,12 +175,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: finish the direct audit and ledger entry for run 29369925932, record local
- proof for commit `714308114`, then push that exact correction plus the ledger head and rerun all
- six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
- commit-pinned builder identity, resolved runner identity, complete bounded tool records,
- regenerated Windows content identities, smoke, exact clean-build equality, and upload. Preserve
- the artifact-only boundary, legacy/default path, and every other release gate.
+- Next required action: push exact numeric PE-version correction commit `1b775e6af` plus its evidence
+ ledger head and rerun all six target-native cells. Require a nonzero four-component linker version,
+ exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity, resolved
+ runner identity, complete bounded tool records, regenerated Windows content identities, smoke,
+ exact clean-build equality, and upload. Preserve the artifact-only boundary, legacy/default path,
+ and every other release gate.
## Non-Negotiable Invariants
@@ -6532,6 +6532,109 @@ tool did not report a bounded version line`; input download, build, smoke, compa
- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+### E-M3-METADATA-CI-RED-004 — Native PE FileVersion strings are empty
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `756165552d31ee962c99a3a454bce2bebb29092b`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29370926985](https://github.com/stablyai/orca/actions/runs/29370926985),
+ final conclusion `failure` after 7m09s. Native job IDs and wall durations: Linux x64
+ `87213791478` / 3m13s, Linux arm64 `87213791425` / 3m34s, macOS x64 `87213791432` /
+ 7m04s, macOS arm64 `87213791418` / 4m32s, Windows x64 `87213791403` / 2m28s, and
+ Windows arm64 `87213791472` / 3m52s.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29370926985 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/runs/29370926985/artifacts
+ gh api repos/stablyai/orca/actions/jobs/87213791403/logs
+ gh api repos/stablyai/orca/actions/jobs/87213791472/logs
+ gh run download 29370926985 --repo stablyai/orca \
+ --dir /tmp/orca-8450-metadata-red-29370926985
+ # Repeat the exact fail-closed jq/shasum audit in E-M3-METADATA-CI-RED-003 with:
+ # evidence=/tmp/orca-8450-metadata-red-29370926985
+ # commit=756165552d31ee962c99a3a454bce2bebb29092b
+ # run_id=29370926985
+ ```
+
+- Result: EXPECTED RED. All four POSIX cells passed contracts, two clean native builds, archive/tree
+ inspection, bundled runtime smoke, byte-for-byte comparison, and upload. Both Windows cells passed
+ MSVC setup, runner-identity collection, dependency install, and 77 contract tests, then the live
+ toolchain contract failed with the now-bounded diagnostic `Runtime build tool did not report a
+bounded version line: `. The PE lookup returned successfully but the `FileVersion` string
+ emitted no stdout on either architecture. Input download, build, smoke, comparison, and upload
+ remained skipped; no Windows artifact exists.
+- Downloaded-artifact audit:
+
+ | Tuple | Artifact ID | Archive SHA-256 | Content ID prefix | Files |
+ | ----------------- | ------------ | ------------------------------------------------------------------ | ----------------- | ----- |
+ | linux-x64-glibc | `8326078824` | `3fbd5895c66a81cef6e97c0fcc1efd210377fee6fdbb5bc56548a36377d373e5` | `960546cd…` | 34 |
+ | linux-arm64-glibc | `8326088493` | `2f1ae08f794d9a8154b0e0714d394e8da447cff7958febc904d3f68cae493a68` | `aa3aa8ae…` | 34 |
+ | darwin-x64 | `8326164493` | `b84c3d8a7c8e0c195d82185d0476f77685d171dde13ea5b5652b1ce12917564a` | `585ea603…` | 35 |
+ | darwin-arm64 | `8326107962` | `d940054bb24d79fe31b5eaad6269fcc6bbaef6ca2c1e4703b398b631dbe85081` | `40ff5d20…` | 35 |
+
+ All archive/subject hashes, archive-scoped SPDX namespaces, one-owner-per-file counts, eight
+ dependency relationships, prohibited-content assertions, exact commit/run identities, runner
+ labels/images/architectures, and bounded tool version/hash records passed. Content IDs and native
+ tool versions remain identical to E-M3-METADATA-CI-RED-003; builder/source identities now pin
+ exact head `756165552` and invocation `29370926985`.
+
+- Oracle proved: environment-isolated path transport does not fix the semantic defect because the
+ string `FileVersion` property itself is empty on both native hosted Windows environments; the
+ bounded diagnostic distinguishes that from command failure or unexpected output; all four POSIX
+ controls remain complete and reproducible at the exact tested head.
+- Does not prove: that numeric PE version fields are populated, any Windows artifact or metadata,
+ regenerated Windows content IDs, oldest baselines, native trust/signing, SSH, publication, or an
+ enabled tuple.
+- Checklist items satisfied: no new completion box; the all-six SBOM/provenance/toolchain item
+ remains in progress.
+- Follow-up: format the four integer PE version fields, reject `0.0.0.0`, retain exact linker-byte
+ hashing and environment-isolated path transport, then rerun and directly audit all six cells.
+
+### E-M3-WINDOWS-LINKER-NUMERIC-LOCAL-001 — Bounded numeric PE file version
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `1b775e6afe730c237f49b2d203591e07db11bfd8`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure invocation/metadata tests
+- Remote and transport: none; artifact-only local contracts
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs
+ git diff --check
+ ```
+
+- Result: PASS. Twenty focused test files passed 99 tests in 1.85s. Typecheck passed all three
+ TypeScript projects. Full lint passed oxlint, switch exhaustiveness, styled-scrollbar,
+ reliability-gate, max-lines, bundled-skill, localization-catalog, and localization-coverage gates;
+ its diagnostics remain pre-existing unrelated warnings. The independent max-lines ratchet,
+ focused formatting, and diff checks passed.
+- Oracle proved: the PowerShell expression formats `FileMajorPart`, `FileMinorPart`, `FileBuildPart`,
+ and `FilePrivatePart` as one exact four-component value; the selector rejects malformed versions,
+ suffixes, missing output, and the version-resource-absent `0.0.0.0` form; the resolved linker path
+ remains a child-only environment value and never enters executable script text; the exact resolved
+ `link.exe` bytes remain SHA-256 authenticated.
+- Does not prove: that either native Windows linker exposes nonzero numeric fields, the actual native
+ version, Windows build/smoke/equality/upload, regenerated Windows content IDs, oldest Windows
+ execution, native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: local correction only; the all-six compiler/toolchain item remains
+ unchecked.
+- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
+ direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6589,13 +6692,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Finish the direct artifact audit and evidence entry for exact-head run 29369925932, record local
-proof for correction commit `714308114`, then push that exact correction plus this ledger head and
-rerun all six target-native cells. Require exact SPDX ownership, archive-scoped document identity,
-commit-pinned builder identity, resolved runner identity, complete bounded tool records with
-SHA-256, clean-build metadata equality, smoke, upload, and regenerated Windows content identities
-before checking the remaining Milestone 3 metadata/toolchain claims. Then proceed to oldest-baseline
-and native-trust proof.
+Push exact numeric PE-version correction commit `1b775e6af` plus this evidence-ledger head and rerun
+all six target-native cells. Require a nonzero four-component linker version, exact SPDX ownership,
+archive-scoped document identity, commit-pinned builder identity, resolved runner identity, complete
+bounded tool records with SHA-256, clean-build metadata equality, smoke, upload, and regenerated
+Windows content identities before checking the remaining Milestone 3 metadata/toolchain claims.
+Then proceed to oldest-baseline and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From 18d10da2750af66ae3486b61382ab90d5c410f8a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:09:32 -0400
Subject: [PATCH 067/267] build(ssh): identify linker by MSVC toolset
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-toolchain.mjs | 51 ++++++++++---------
.../ssh-relay-runtime-toolchain.test.mjs | 45 +++++++---------
2 files changed, 44 insertions(+), 52 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 3045f7e0446..c2f24ca8d30 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -3,7 +3,7 @@ import { createHash } from 'node:crypto'
import { createReadStream } from 'node:fs'
import { readdir, realpath, stat } from 'node:fs/promises'
import { createRequire } from 'node:module'
-import { dirname, isAbsolute, join, relative } from 'node:path'
+import { dirname, isAbsolute, join, relative, win32 } from 'node:path'
import { isDeepStrictEqual, promisify } from 'node:util'
const require = createRequire(import.meta.url)
@@ -26,11 +26,10 @@ async function sha256File(path) {
return `sha256:${hash.digest('hex')}`
}
-async function capture(command, args, { env } = {}) {
+async function capture(command, args) {
try {
return await execFileAsync(command, args, {
encoding: 'utf8',
- ...(env ? { env: { ...process.env, ...env } } : {}),
maxBuffer: TOOL_OUTPUT_BYTES,
timeout: TOOL_TIMEOUT_MS,
windowsHide: true
@@ -82,14 +81,13 @@ async function executableRecord({
versionCommand,
versionArgs,
versionPattern,
- windowsFileVersion = false,
+ windowsMsvcToolsetVersion = false,
xcrun = false
}) {
const path = await locateExecutable(command, { xcrun })
- const invocation = windowsFileVersion
- ? sshRelayRuntimeWindowsFileVersionInvocation(path)
- : { command: versionCommand ?? path, args: versionArgs ?? args }
- const result = await capture(invocation.command, invocation.args, invocation.options)
+ const result = windowsMsvcToolsetVersion
+ ? { stdout: sshRelayRuntimeWindowsMsvcToolsetVersion(path) }
+ : await capture(versionCommand ?? path, versionArgs ?? args)
return {
version: selectSshRelayRuntimeToolVersion(result, versionPattern),
sha256: await sha256File(path)
@@ -187,21 +185,25 @@ export function sshRelayRuntimeStripVersionProbe(platform) {
: { args: ['--version'] }
}
-export function sshRelayRuntimeWindowsFileVersionInvocation(path) {
- const versionInfo =
- "[System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH'))"
- return {
- command: 'pwsh.exe',
- args: [
- '-NoLogo',
- '-NoProfile',
- '-NonInteractive',
- '-Command',
- // Why: hosted link.exe returns an empty FileVersion string; its numeric PE fields are stable.
- `$versionInfo = ${versionInfo}; '{0}.{1}.{2}.{3}' -f $versionInfo.FileMajorPart, $versionInfo.FileMinorPart, $versionInfo.FileBuildPart, $versionInfo.FilePrivatePart`
- ],
- options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
+export function sshRelayRuntimeWindowsMsvcToolsetVersion(path) {
+ const normalized = win32.normalize(path)
+ const segments = normalized.split(win32.sep)
+ const msvcIndexes = segments.flatMap((segment, index) =>
+ segment.toLowerCase() === 'msvc' ? [index] : []
+ )
+ const msvcIndex = msvcIndexes[0]
+ const version = segments[msvcIndex + 1]
+ if (
+ !win32.isAbsolute(normalized) ||
+ msvcIndexes.length !== 1 ||
+ !/^\d+\.\d+\.\d+$/.test(version ?? '') ||
+ segments[msvcIndex + 2]?.toLowerCase() !== 'bin' ||
+ segments.at(-1)?.toLowerCase() !== 'link.exe'
+ ) {
+ throw new Error('Resolved Windows linker is not in a bounded MSVC toolset path')
}
+ // Why: hosted link.exe has no version resource; its resolved toolset path plus byte hash is exact.
+ return `MSVC ${version}`
}
export function assertSshRelayRuntimeToolchain(toolchain, tuple) {
@@ -248,9 +250,8 @@ export async function collectSshRelayRuntimeToolchain(nodePath) {
linker: await executableRecord({
command: 'link.exe',
args: [],
- // Why: hosted link.exe is pipe-silent; authenticated numeric PE metadata gives its version.
- windowsFileVersion: true,
- versionPattern: /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
+ windowsMsvcToolsetVersion: true,
+ versionPattern: /^MSVC \d+\.\d+\.\d+$/
}),
buildSystem: await executableRecord({
command: 'msbuild.exe',
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index b175b17b453..655a75e9615 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -7,7 +7,7 @@ import {
sshRelayRuntimeBuilderIdentity,
sshRelayRuntimeRunnerIdentity,
sshRelayRuntimeStripVersionProbe,
- sshRelayRuntimeWindowsFileVersionInvocation
+ sshRelayRuntimeWindowsMsvcToolsetVersion
} from './ssh-relay-runtime-toolchain.mjs'
const commit = 'a'.repeat(40)
@@ -28,37 +28,28 @@ describe('SSH relay runtime build provenance', () => {
).toBe('Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35228 for ARM64')
})
- it('selects a bounded Windows linker file version', () => {
+ it('selects a bounded Windows linker toolset version', () => {
expect(
- selectSshRelayRuntimeToolVersion(
- { stdout: '14.44.35228.0\r\n' },
- /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
- )
- ).toBe('14.44.35228.0')
+ selectSshRelayRuntimeToolVersion({ stdout: 'MSVC 14.44.35207\r\n' }, /^MSVC \d+\.\d+\.\d+$/)
+ ).toBe('MSVC 14.44.35207')
})
- it('rejects an absent Windows linker numeric file version', () => {
+ it('derives the version only from a canonical resolved MSVC linker path', () => {
+ const path = String.raw`C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe`
+ expect(sshRelayRuntimeWindowsMsvcToolsetVersion(path)).toBe('MSVC 14.44.35207')
+ expect(
+ sshRelayRuntimeWindowsMsvcToolsetVersion(
+ String.raw`C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostARM64\ARM64\link.exe`
+ )
+ ).toBe('MSVC 14.44.35207')
expect(() =>
- selectSshRelayRuntimeToolVersion(
- { stdout: '0.0.0.0\r\n' },
- /^(?!0\.0\.0\.0$)\d+(?:\.\d+){3}$/
+ sshRelayRuntimeWindowsMsvcToolsetVersion(String.raw`C:\tools\14.44.35207\link.exe`)
+ ).toThrow(/MSVC toolset path/)
+ expect(() =>
+ sshRelayRuntimeWindowsMsvcToolsetVersion(
+ String.raw`C:\MSVC\14.44.35207\bin\shadow\MSVC\14.44.1\bin\link.exe`
)
- ).toThrow(/0\.0\.0\.0/)
- })
-
- it('passes the resolved linker path through a non-interpolated environment value', () => {
- const path = String.raw`C:\Program Files\Microsoft Visual Studio\link.exe`
- expect(sshRelayRuntimeWindowsFileVersionInvocation(path)).toEqual({
- command: 'pwsh.exe',
- args: [
- '-NoLogo',
- '-NoProfile',
- '-NonInteractive',
- '-Command',
- "$versionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo([Environment]::GetEnvironmentVariable('ORCA_SSH_RELAY_TOOL_PATH')); '{0}.{1}.{2}.{3}' -f $versionInfo.FileMajorPart, $versionInfo.FileMinorPart, $versionInfo.FileBuildPart, $versionInfo.FilePrivatePart"
- ],
- options: { env: { ORCA_SSH_RELAY_TOOL_PATH: path } }
- })
+ ).toThrow(/MSVC toolset path/)
})
it('bounds failed version diagnostics', () => {
From 2ed6c8e3b3609a9cb4785011996988de915e807a Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:11:01 -0400
Subject: [PATCH 068/267] docs(ssh): record absent linker version resource
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 10 +-
...github-release-implementation-checklist.md | 129 ++++++++++++++++--
2 files changed, 121 insertions(+), 18 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 876247d59a2..3ef82302252 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -22,11 +22,11 @@ complete a box.
- [ ] **WP2 — Finish target-native artifact metadata and provenance.**
- Four POSIX GitHub runner cells pass build, smoke, equality, metadata upload, and direct payload
- audit in [run 29370926985](https://github.com/stablyai/orca/actions/runs/29370926985).
- - Windows x64/arm64 fail closed because hosted `link.exe` returns an empty string-valued PE
- `FileVersion`; neither cell downloads inputs or produces an artifact.
- - Local commit `1b775e6af` formats the PE version from bounded numeric fields and rejects an absent
- all-zero version. It is green across 20 test files / 99 tests plus static gates.
+ audit in [run 29371551072](https://github.com/stablyai/orca/actions/runs/29371551072).
+ - Windows x64/arm64 prove hosted `link.exe` has no usable PE version resource (`0.0.0.0`); neither
+ cell downloads inputs or produces an artifact.
+ - Local commit `18d10da27` records the bounded MSVC toolset directory from the resolved linker path
+ plus the exact linker SHA-256. It is green across 20 test files / 98 tests plus static gates.
- Next gate: push that exact correction, rerun all six native jobs, then inspect every uploaded
artifact before completing the metadata/provenance box.
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 2c599d53538..c509cbe5556 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29370926985](https://github.com/stablyai/orca/actions/runs/29370926985) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload because the authenticated linker's string-valued PE `FileVersion` is empty on both hosted architectures (E-M3-METADATA-CI-RED-004); exact implementation commit `1b775e6af` formats the four numeric PE version fields, rejects the absent `0.0.0.0` form, preserves exact linker-byte hashing and environment-isolated path transport, and passes 20 files / 99 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-NUMERIC-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29371551072](https://github.com/stablyai/orca/actions/runs/29371551072) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload because the authenticated linker has no usable PE version resource and returns `0.0.0.0` on both hosted architectures (E-M3-METADATA-CI-RED-005); exact implementation commit `18d10da27` derives a bounded toolset identity from the canonical resolved `.../MSVC//bin/.../link.exe` path while retaining the exact linker SHA-256, rejects malformed/ambiguous/non-MSVC paths, and passes 20 files / 98 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-TOOLSET-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,12 +175,12 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact numeric PE-version correction commit `1b775e6af` plus its evidence
- ledger head and rerun all six target-native cells. Require a nonzero four-component linker version,
- exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity, resolved
- runner identity, complete bounded tool records, regenerated Windows content identities, smoke,
- exact clean-build equality, and upload. Preserve the artifact-only boundary, legacy/default path,
- and every other release gate.
+- Next required action: push exact MSVC-toolset linker identity commit `18d10da27` plus its evidence
+ ledger head and rerun all six target-native cells. Require the expected bounded toolset identity and
+ exact linker SHA-256, exact SPDX ownership, archive-scoped document identity, commit-pinned builder
+ identity, resolved runner identity, complete bounded tool records, regenerated Windows content
+ identities, smoke, exact clean-build equality, and upload. Preserve the artifact-only boundary,
+ legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -6635,6 +6635,109 @@ bounded version line: `. The PE lookup returned successfully but the `Fil
- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+### E-M3-METADATA-CI-RED-005 — Native linkers have no PE version resource
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `3c3d47fc4bf06610d43dcdb267eadfed46627b0f`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29371551072](https://github.com/stablyai/orca/actions/runs/29371551072),
+ final conclusion `failure` after 7m31s. Native job IDs and wall durations: Linux x64
+ `87215769010` / 3m09s, Linux arm64 `87215769039` / 3m16s, macOS x64 `87215769046` /
+ 7m20s, macOS arm64 `87215769029` / 2m37s, Windows x64 `87215768998` / 1m29s, and
+ Windows arm64 `87215769056` / 3m55s.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29371551072 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/runs/29371551072/artifacts
+ gh api repos/stablyai/orca/actions/jobs/87215768998/logs
+ gh api repos/stablyai/orca/actions/jobs/87215769056/logs
+ gh run download 29371551072 --repo stablyai/orca \
+ --dir /tmp/orca-8450-metadata-red-29371551072
+ # Repeat the exact fail-closed jq/shasum audit in E-M3-METADATA-CI-RED-003 with:
+ # evidence=/tmp/orca-8450-metadata-red-29371551072
+ # commit=3c3d47fc4bf06610d43dcdb267eadfed46627b0f
+ # run_id=29371551072
+ ```
+
+- Result: EXPECTED RED. All four POSIX cells again passed contracts, two clean native builds,
+ archive/tree inspection, bundled runtime smoke, byte-for-byte comparison, and upload. Windows x64
+ and arm64 each passed 78 contract tests after native MSVC setup, then rejected the exact diagnostic
+ `Runtime build tool did not report a bounded version line: 0.0.0.0`. This proves both resolved
+ `link.exe` binaries lack a usable PE version resource rather than merely an empty formatted string.
+ Input download, build, smoke, comparison, and upload remained skipped; no Windows artifact exists.
+- Downloaded-artifact audit:
+
+ | Tuple | Artifact ID | Archive SHA-256 | Content ID prefix | Files |
+ | ----------------- | ------------ | ------------------------------------------------------------------ | ----------------- | ----- |
+ | linux-x64-glibc | `8326313178` | `fb30c981c7d8ef32a57485cad75850058b6bb38988c5fe34a269d6e0bd33eb06` | `960546cd…` | 34 |
+ | linux-arm64-glibc | `8326316547` | `0d70e0646540461676fe4eeb8db38c13d13e4bd747db5609dec90a957c4db79d` | `aa3aa8ae…` | 34 |
+ | darwin-x64 | `8326400647` | `fe4a79d356baf0523822e4524989df4c3b3153e36e777fc44a09b96d2926df68` | `585ea603…` | 35 |
+ | darwin-arm64 | `8326301297` | `891489f352ae978aff91c227af908514df827ee7f4aba0513f5f0891a2b99ccd` | `40ff5d20…` | 35 |
+
+ All archive/subject hashes, archive-scoped SPDX namespaces, one-owner-per-file counts, eight
+ dependency relationships, prohibited-content assertions, exact commit/run identities, runner
+ labels/images/architectures, and bounded tool version/hash records passed. POSIX content IDs and
+ native tool versions remain unchanged; builder/source identities pin exact head `3c3d47fc4` and
+ invocation `29371551072`.
+
+- Oracle proved: neither string nor integer PE version metadata can identify the hosted MSVC linker;
+ both architectures fail closed before producing incomplete provenance; four independent POSIX
+ controls remain complete and reproducible at the exact head.
+- Does not prove: a bounded alternative linker identity on Windows, any Windows artifact/metadata,
+ regenerated Windows content IDs, oldest baselines, native trust/signing, SSH, publication, or an
+ enabled tuple.
+- Checklist items satisfied: no new completion box; the all-six SBOM/provenance/toolchain item
+ remains in progress.
+- Follow-up: derive the vendor toolset version from the canonical resolved MSVC linker directory,
+ reject malformed/ambiguous/non-MSVC layouts, retain the exact linker SHA-256, and rerun all cells.
+
+### E-M3-WINDOWS-LINKER-TOOLSET-LOCAL-001 — Resolved MSVC toolset identity
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `18d10da2750af66ae3486b61382ab90d5c410f8a`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure path/provenance tests
+- Remote and transport: none; artifact-only local contracts
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs
+ git diff --check
+ ```
+
+- Result: PASS. Twenty focused test files passed 98 tests in 1.47s. Typecheck passed all three
+ TypeScript projects. Full lint passed oxlint, switch exhaustiveness, styled-scrollbar,
+ reliability-gate, max-lines, bundled-skill, localization-catalog, and localization-coverage gates;
+ its diagnostics remain pre-existing unrelated warnings. The independent max-lines ratchet,
+ focused formatting, and diff checks passed.
+- Oracle proved: x64 and arm64 canonical Visual Studio paths produce the bounded identity
+ `MSVC 14.44.35207`; path parsing uses Windows semantics on every client OS; it requires one exact
+ case-insensitive `MSVC` segment, a three-component numeric version, the immediate `bin` segment,
+ an absolute path, and terminal `link.exe`; non-MSVC and ambiguous paths fail closed. The resolved
+ linker executable remains SHA-256 authenticated, so the path version is provenance metadata rather
+ than the byte-identity boundary. No PowerShell, PE metadata, stdout, or mutable version lookup is
+ required.
+- Does not prove: the exact native hosted paths, a Windows toolchain record/build/smoke/equality/
+ upload, regenerated Windows content IDs, oldest Windows execution, native trust/signing, SSH,
+ publication, or an enabled tuple.
+- Checklist items satisfied: local correction only; the all-six compiler/toolchain item remains
+ unchecked.
+- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
+ direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6692,12 +6795,12 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact numeric PE-version correction commit `1b775e6af` plus this evidence-ledger head and rerun
-all six target-native cells. Require a nonzero four-component linker version, exact SPDX ownership,
-archive-scoped document identity, commit-pinned builder identity, resolved runner identity, complete
-bounded tool records with SHA-256, clean-build metadata equality, smoke, upload, and regenerated
-Windows content identities before checking the remaining Milestone 3 metadata/toolchain claims.
-Then proceed to oldest-baseline and native-trust proof.
+Push exact MSVC-toolset linker identity commit `18d10da27` plus this evidence-ledger head and rerun
+all six target-native cells. Require the expected bounded toolset identity and exact linker SHA-256,
+exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity, resolved
+runner identity, complete bounded tool records with SHA-256, clean-build metadata equality, smoke,
+upload, and regenerated Windows content identities before checking the remaining Milestone 3
+metadata/toolchain claims. Then proceed to oldest-baseline and native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From d1eb45d613f504d7363230420f14a0c8126fe125 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:18:31 -0400
Subject: [PATCH 069/267] build(ssh): bound linker path diagnostic
Co-authored-by: Orca
---
config/scripts/ssh-relay-runtime-toolchain.mjs | 3 ++-
config/scripts/ssh-relay-runtime-toolchain.test.mjs | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index c2f24ca8d30..4d4cef54ca6 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -200,7 +200,8 @@ export function sshRelayRuntimeWindowsMsvcToolsetVersion(path) {
segments[msvcIndex + 2]?.toLowerCase() !== 'bin' ||
segments.at(-1)?.toLowerCase() !== 'link.exe'
) {
- throw new Error('Resolved Windows linker is not in a bounded MSVC toolset path')
+ const diagnostic = segments.slice(-12).join(win32.sep).slice(-512) || ''
+ throw new Error(`Resolved Windows linker is not in a bounded MSVC toolset path: ${diagnostic}`)
}
// Why: hosted link.exe has no version resource; its resolved toolset path plus byte hash is exact.
return `MSVC ${version}`
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index 655a75e9615..4f172b5dd24 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -58,6 +58,13 @@ describe('SSH relay runtime build provenance', () => {
).toThrow(/^Runtime build tool did not report a bounded version line: unexpected x{490}/)
})
+ it('bounds rejected Windows linker path diagnostics', () => {
+ const path = String.raw`C:\${'unexpected\\'.repeat(100)}link.exe`
+ expect(() => sshRelayRuntimeWindowsMsvcToolsetVersion(path)).toThrow(
+ /^Resolved Windows linker is not in a bounded MSVC toolset path: .{1,512}$/
+ )
+ })
+
it('pins GitHub builder identity to the exact source commit', () => {
expect(
sshRelayRuntimeBuilderIdentity({
From 92f9b76101d4214c07291f6d9befa647fbc0dd86 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:22:59 -0400
Subject: [PATCH 070/267] docs(ssh): record linker path diagnostic gate
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 14 +--
...github-release-implementation-checklist.md | 119 ++++++++++++++++--
2 files changed, 114 insertions(+), 19 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index 3ef82302252..f715ded686a 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -22,13 +22,13 @@ complete a box.
- [ ] **WP2 — Finish target-native artifact metadata and provenance.**
- Four POSIX GitHub runner cells pass build, smoke, equality, metadata upload, and direct payload
- audit in [run 29371551072](https://github.com/stablyai/orca/actions/runs/29371551072).
- - Windows x64/arm64 prove hosted `link.exe` has no usable PE version resource (`0.0.0.0`); neither
- cell downloads inputs or produces an artifact.
- - Local commit `18d10da27` records the bounded MSVC toolset directory from the resolved linker path
- plus the exact linker SHA-256. It is green across 20 test files / 98 tests plus static gates.
- - Next gate: push that exact correction, rerun all six native jobs, then inspect every uploaded
- artifact before completing the metadata/provenance box.
+ audit in [run 29372156145](https://github.com/stablyai/orca/actions/runs/29372156145).
+ - Windows x64/arm64 fail closed because the resolved `link.exe` path differs from the assumed MSVC
+ layout; neither cell downloads inputs or produces an artifact.
+ - Local commit `d1eb45d61` adds a bounded path-tail diagnostic and is green across 20 test files /
+ 99 tests plus static gates.
+ - Next gate: push the diagnostic, inspect both native path shapes, then make only the evidenced
+ parser correction and rerun all six jobs.
## Work packages, in required order
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index c509cbe5556..4d3d5cd9497 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14
Last updated: 2026-07-14
-Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29371551072](https://github.com/stablyai/orca/actions/runs/29371551072) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload because the authenticated linker has no usable PE version resource and returns `0.0.0.0` on both hosted architectures (E-M3-METADATA-CI-RED-005); exact implementation commit `18d10da27` derives a bounded toolset identity from the canonical resolved `.../MSVC//bin/.../link.exe` path while retaining the exact linker SHA-256, rejects malformed/ambiguous/non-MSVC paths, and passes 20 files / 98 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-TOOLSET-LOCAL-001); the correction still requires an exact-head all-six native run and direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
+Current phase: Milestone 3 / Work Package 2 SBOM/provenance closure — **In progress — 2026-07-14, Codex implementation owner**; exact-head run [29372156145](https://github.com/stablyai/orca/actions/runs/29372156145) and direct payload audit keep Linux x64/arm64 and macOS x64/arm64 green but both Windows cells fail closed before build/upload because their resolved linker paths do not match the assumed MSVC toolset layout (E-M3-METADATA-CI-RED-006); exact implementation commit `d1eb45d61` retains that strict parser and exact linker SHA-256 while adding only a 512-byte bounded path-tail diagnostic, and passes 20 files / 99 tests plus typecheck, full lint, formatting, max-lines, and diff gates (E-M3-WINDOWS-LINKER-PATH-DIAGNOSTIC-LOCAL-001); the next native run must expose both real path shapes before any parser correction, and the eventual exact head must pass all six cells plus direct artifact inspection before any remaining SBOM/provenance/toolchain box is checked; oldest-baseline, native-trust, cross-family remote, and measured-baseline gates remain open; production/default behavior and every tuple state remain unchanged; no bundled-runtime path is enabled
Primary design: [SSH relay GitHub Release plan](./2026-07-14-ssh-relay-github-release-plan.html)
Motivating issues: [#8450](https://github.com/stablyai/orca/issues/8450), [#1693](https://github.com/stablyai/orca/issues/1693)
@@ -175,11 +175,11 @@ same change as the work it records.
per-target opt-in selects bundled-preferred behavior, and implementing the setting does not
authorize default-on rollout or legacy removal (E-M1-ROLLOUT-DECISION-001).
- Legacy fallback removal: not authorized.
-- Next required action: push exact MSVC-toolset linker identity commit `18d10da27` plus its evidence
- ledger head and rerun all six target-native cells. Require the expected bounded toolset identity and
- exact linker SHA-256, exact SPDX ownership, archive-scoped document identity, commit-pinned builder
- identity, resolved runner identity, complete bounded tool records, regenerated Windows content
- identities, smoke, exact clean-build equality, and upload. Preserve the artifact-only boundary,
+- Next required action: push bounded linker-path diagnostic commit `d1eb45d61` plus its evidence
+ ledger head and rerun all six target-native cells. Inspect the bounded x64 and arm64 path tails,
+ then make only the parser correction supported by those native paths. The corrected exact head
+ must retain the exact linker SHA-256 and pass all metadata, smoke, equality, upload, and direct
+ payload audits before the all-six provenance item can close. Preserve the artifact-only boundary,
legacy/default path, and every other release gate.
## Non-Negotiable Invariants
@@ -6738,6 +6738,99 @@ bounded version line: `. The PE lookup returned successfully but the `Fil
- Follow-up: push this exact implementation and ledger head, then require all six native jobs and
direct inspection of every uploaded artifact before closing any metadata/provenance claim.
+### E-M3-METADATA-CI-RED-006 — Hosted linker paths reject the assumed MSVC layout
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact tested head `2ed6c8e3b3609a9cb4785011996988de915e807a`;
+ stacked draft PR [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: [GitHub Actions run 29372156145](https://github.com/stablyai/orca/actions/runs/29372156145),
+ final conclusion `failure` after 6m15s. Native job IDs and wall durations: Linux x64
+ `87217674004` / 3m06s, Linux arm64 `87217674003` / 3m34s, macOS x64 `87217674012` /
+ 6m09s, macOS arm64 `87217674005` / 3m44s, Windows x64 `87217674050` / 1m29s, and
+ Windows arm64 `87217674002` / 3m52s.
+- Remote and transport: none; target-native artifact-only build workflow
+- Exact evidence commands:
+
+ ```sh
+ gh run view 29372156145 --repo stablyai/orca \
+ --json status,conclusion,headSha,createdAt,updatedAt,url,jobs
+ gh api repos/stablyai/orca/actions/runs/29372156145/artifacts
+ gh api repos/stablyai/orca/actions/jobs/87217674050/logs
+ gh api repos/stablyai/orca/actions/jobs/87217674002/logs
+ gh run download 29372156145 --repo stablyai/orca \
+ --dir /tmp/orca-8450-metadata-red-29372156145
+ # Repeat the exact fail-closed jq/shasum audit in E-M3-METADATA-CI-RED-003 with:
+ # evidence=/tmp/orca-8450-metadata-red-29372156145
+ # commit=2ed6c8e3b3609a9cb4785011996988de915e807a
+ # run_id=29372156145
+ ```
+
+- Result: EXPECTED RED. All four POSIX cells passed contracts, two clean native builds,
+ archive/tree inspection, bundled runtime smoke, byte-for-byte comparison, and upload. Windows x64
+ and arm64 each rejected `Resolved Windows linker is not in a bounded MSVC toolset path` during
+ contract tests after native MSVC setup. Both stopped before input download, build, smoke,
+ comparison, or upload, so no Windows artifact exists.
+- Downloaded-artifact audit:
+
+ | Tuple | Artifact ID | Archive SHA-256 | Content ID prefix | Files |
+ | ----------------- | ------------ | ------------------------------------------------------------------ | ----------------- | ----- |
+ | linux-x64-glibc | `8326530355` | `ec09bf6a0068b3a5954af0fa17e538c9972a8389ccf420a525546fc7c63dfeb4` | `960546cd…` | 34 |
+ | linux-arm64-glibc | `8326541076` | `c13d1454e3e2592bf667a7c5925d147fd06e0f68eec7fb875dbc3750628f88b7` | `aa3aa8ae…` | 34 |
+ | darwin-x64 | `8326590799` | `5de3e4ae940a47839f8a7a2ec24bc7b63d54954357beccf7916ff7c72fab7ff3` | `585ea603…` | 35 |
+ | darwin-arm64 | `8326543567` | `8ee92c0d45d25b0fa05360c2dada50c21b2ac4ac837089a5c40c64d22ac2b9f5` | `40ff5d20…` | 35 |
+
+ All archive/subject hashes, archive-scoped SPDX namespaces, one-owner-per-file counts, eight
+ dependency relationships, prohibited-content assertions, exact commit/run identities, runner
+ labels/images/architectures, and bounded tool version/hash records passed.
+
+- Oracle proved: the assumed strict MSVC directory layout does not match either hosted Windows
+ architecture; both jobs fail closed before consuming inputs; four independent POSIX controls
+ remain complete at the exact head.
+- Does not prove: either actual resolved Windows path shape, a corrected bounded parser, any Windows
+ artifact/metadata, oldest baselines, native trust/signing, SSH, publication, or an enabled tuple.
+- Checklist items satisfied: no new completion box; the all-six SBOM/provenance/toolchain item
+ remains in progress.
+- Follow-up: expose only a bounded path-tail diagnostic, rerun both native Windows architectures,
+ and correct the parser only after inspecting those exact paths.
+
+### E-M3-WINDOWS-LINKER-PATH-DIAGNOSTIC-LOCAL-001 — Bounded native path evidence
+
+- Date: 2026-07-14
+- Commit SHA / PR: exact implementation commit
+ `d1eb45d613f504d7363230420f14a0c8126fe125`; stacked draft PR
+ [#8741](https://github.com/stablyai/orca/pull/8741)
+- Runner: local macOS 26.2 build 25C56, Darwin 25.2.0 arm64 on Apple Silicon; Node v26.0.0 and
+ pnpm 10.24.0 for pure path/provenance tests
+- Remote and transport: none; artifact-only local contracts
+- Exact evidence commands:
+
+ ```sh
+ pnpm exec vitest run --config config/vitest.config.ts \
+ config/scripts/ssh-relay-*.test.mjs \
+ src/main/ssh/ssh-relay-artifact-selector.test.ts
+ pnpm run typecheck
+ pnpm run lint
+ pnpm run check:max-lines-ratchet
+ pnpm exec oxfmt --check \
+ config/scripts/ssh-relay-runtime-toolchain.mjs \
+ config/scripts/ssh-relay-runtime-toolchain.test.mjs
+ git diff --check
+ ```
+
+- Result: PASS. Twenty focused test files passed 99 tests. Typecheck passed all three TypeScript
+ projects. Full lint passed with only existing unrelated warnings; the independent max-lines,
+ focused formatting, and diff checks passed.
+- Oracle proved: linker-path rejection includes at most the final 12 path segments and at most 512
+ characters; truncation and suffix retention are purpose-tested. The strict identity parser and
+ exact linker SHA-256 requirement remain unchanged.
+- Does not prove: either native path shape, that 12 segments are sufficient to identify the correct
+ bounded grammar, a Windows build/smoke/equality/upload, oldest Windows execution, native trust,
+ SSH, publication, or an enabled tuple.
+- Checklist items satisfied: local diagnostic only; the all-six compiler/toolchain item remains
+ unchecked.
+- Follow-up: push this exact commit and ledger head, inspect both bounded native path tails, and make
+ only the parser correction supported by that evidence.
+
## Accepted Gaps
No product gap is accepted merely because it appears in this list. Each entry requires explicit
@@ -6795,12 +6888,14 @@ The project is not complete until every applicable item below is checked with ev
## Next Required Action
-Push exact MSVC-toolset linker identity commit `18d10da27` plus this evidence-ledger head and rerun
-all six target-native cells. Require the expected bounded toolset identity and exact linker SHA-256,
-exact SPDX ownership, archive-scoped document identity, commit-pinned builder identity, resolved
-runner identity, complete bounded tool records with SHA-256, clean-build metadata equality, smoke,
-upload, and regenerated Windows content identities before checking the remaining Milestone 3
-metadata/toolchain claims. Then proceed to oldest-baseline and native-trust proof.
+Push bounded linker-path diagnostic commit `d1eb45d61` plus this evidence-ledger head and rerun all
+six target-native cells. Inspect the bounded x64 and arm64 path tails, then make only the parser
+correction supported by those native paths. Require the corrected exact head to retain the exact
+linker SHA-256 and pass exact SPDX ownership, archive-scoped document identity, commit-pinned builder
+identity, resolved runner identity, complete bounded tool records, clean-build metadata equality,
+smoke, upload, regenerated Windows content identities, and direct artifact inspection before
+checking the remaining Milestone 3 metadata/toolchain claims. Then proceed to oldest-baseline and
+native-trust proof.
Cross-family Layer B targets, the protected manifest-signing environment, oldest-baseline/native-
trust cells, and the paired legacy performance baseline remain release/default-path blockers. No
From 5f0c1417d5e28a0c01f1914c41d129814237e28e Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:33:47 -0400
Subject: [PATCH 071/267] build(ssh): select canonical MSVC linker
Co-authored-by: Orca
---
.../scripts/ssh-relay-runtime-toolchain.mjs | 39 +++++++++++++++++--
.../ssh-relay-runtime-toolchain.test.mjs | 22 ++++++++++-
2 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/config/scripts/ssh-relay-runtime-toolchain.mjs b/config/scripts/ssh-relay-runtime-toolchain.mjs
index 4d4cef54ca6..afee29e33a7 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.mjs
@@ -55,7 +55,7 @@ export function selectSshRelayRuntimeToolVersion({ stdout = '', stderr = '' }, p
return version
}
-async function locateExecutable(command, { xcrun = false } = {}) {
+async function locateExecutable(command, { windowsMsvcLinker = false, xcrun = false } = {}) {
if (isAbsolute(command)) {
return realpath(command)
}
@@ -65,10 +65,11 @@ async function locateExecutable(command, { xcrun = false } = {}) {
? ['where.exe', [command]]
: ['which', [command]]
const result = await capture(...locator)
- const path = result.stdout
+ const paths = result.stdout
.split(/\r?\n/)
.map((line) => line.trim())
- .find(Boolean)
+ .filter(Boolean)
+ const path = windowsMsvcLinker ? selectSshRelayRuntimeWindowsMsvcLinker(paths) : paths[0]
if (!path || !isAbsolute(path)) {
throw new Error(`Runtime build tool executable could not be resolved: ${command}`)
}
@@ -84,7 +85,10 @@ async function executableRecord({
windowsMsvcToolsetVersion = false,
xcrun = false
}) {
- const path = await locateExecutable(command, { xcrun })
+ const path = await locateExecutable(command, {
+ windowsMsvcLinker: windowsMsvcToolsetVersion,
+ xcrun
+ })
const result = windowsMsvcToolsetVersion
? { stdout: sshRelayRuntimeWindowsMsvcToolsetVersion(path) }
: await capture(versionCommand ?? path, versionArgs ?? args)
@@ -207,6 +211,33 @@ export function sshRelayRuntimeWindowsMsvcToolsetVersion(path) {
return `MSVC ${version}`
}
+export function selectSshRelayRuntimeWindowsMsvcLinker(paths) {
+ const candidates = [
+ ...new Map(paths.map((path) => [win32.normalize(path).toLowerCase(), path])).values()
+ ]
+ const matches = candidates.filter((path) => {
+ try {
+ sshRelayRuntimeWindowsMsvcToolsetVersion(path)
+ return true
+ } catch {
+ return false
+ }
+ })
+ if (matches.length !== 1) {
+ const diagnostic =
+ candidates
+ .slice(-4)
+ .map((path) => win32.normalize(path).split(win32.sep).slice(-8).join(win32.sep))
+ .join(' | ')
+ .slice(-512) || ''
+ throw new Error(
+ `Runtime build did not resolve exactly one canonical MSVC linker: ${diagnostic}`
+ )
+ }
+ // Why: Git for Windows also provides link.exe and is prepended for signature verification in CI.
+ return matches[0]
+}
+
export function assertSshRelayRuntimeToolchain(toolchain, tuple) {
const common = ['buildNode', 'bundledNode', 'compiler', 'buildSystem', 'python', 'archive']
const expected = tuple.startsWith('win32-')
diff --git a/config/scripts/ssh-relay-runtime-toolchain.test.mjs b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
index 4f172b5dd24..a366104408c 100644
--- a/config/scripts/ssh-relay-runtime-toolchain.test.mjs
+++ b/config/scripts/ssh-relay-runtime-toolchain.test.mjs
@@ -4,6 +4,7 @@ import {
assertSshRelayRuntimeToolchain,
collectSshRelayRuntimeToolchain,
selectSshRelayRuntimeToolVersion,
+ selectSshRelayRuntimeWindowsMsvcLinker,
sshRelayRuntimeBuilderIdentity,
sshRelayRuntimeRunnerIdentity,
sshRelayRuntimeStripVersionProbe,
@@ -52,6 +53,20 @@ describe('SSH relay runtime build provenance', () => {
).toThrow(/MSVC toolset path/)
})
+ it('selects exactly one canonical MSVC linker after Git for Windows PATH entries', () => {
+ const x64 = String.raw`C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe`
+ const arm64 = String.raw`C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostARM64\ARM64\link.exe`
+ const git = String.raw`C:\Program Files\Git\usr\bin\link.exe`
+ expect(selectSshRelayRuntimeWindowsMsvcLinker([git, x64])).toBe(x64)
+ expect(selectSshRelayRuntimeWindowsMsvcLinker([git, arm64])).toBe(arm64)
+ expect(() => selectSshRelayRuntimeWindowsMsvcLinker([git])).toThrow(
+ /exactly one canonical MSVC linker/
+ )
+ expect(() => selectSshRelayRuntimeWindowsMsvcLinker([x64, arm64])).toThrow(
+ /exactly one canonical MSVC linker/
+ )
+ })
+
it('bounds failed version diagnostics', () => {
expect(() =>
selectSshRelayRuntimeToolVersion({ stderr: `unexpected ${'x'.repeat(1_000)}` }, /version/i)
@@ -59,10 +74,15 @@ describe('SSH relay runtime build provenance', () => {
})
it('bounds rejected Windows linker path diagnostics', () => {
- const path = String.raw`C:\${'unexpected\\'.repeat(100)}link.exe`
+ const path = `C:\\${'unexpected\\'.repeat(100)}link.exe`
expect(() => sshRelayRuntimeWindowsMsvcToolsetVersion(path)).toThrow(
/^Resolved Windows linker is not in a bounded MSVC toolset path: .{1,512}$/
)
+ expect(() =>
+ selectSshRelayRuntimeWindowsMsvcLinker(
+ Array.from({ length: 20 }, (_, index) => `C:\\${index}\\${'x'.repeat(600)}\\link.exe`)
+ )
+ ).toThrow(/^Runtime build did not resolve exactly one canonical MSVC linker: .{1,512}$/)
})
it('pins GitHub builder identity to the exact source commit', () => {
From ff3ebf37e32e9dad5834e669438efd46a974a708 Mon Sep 17 00:00:00 2001
From: Jinwoo-H
Date: Tue, 14 Jul 2026 18:35:32 -0400
Subject: [PATCH 072/267] docs(ssh): record linker collision evidence
Co-authored-by: Orca
---
...elease-implementation-checklist-summary.md | 15 ++-
...github-release-implementation-checklist.md | 123 +++++++++++++++---
2 files changed, 116 insertions(+), 22 deletions(-)
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
index f715ded686a..1f1caeccecc 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist-summary.md
@@ -22,13 +22,14 @@ complete a box.
- [ ] **WP2 — Finish target-native artifact metadata and provenance.**
- Four POSIX GitHub runner cells pass build, smoke, equality, metadata upload, and direct payload
- audit in [run 29372156145](https://github.com/stablyai/orca/actions/runs/29372156145).
- - Windows x64/arm64 fail closed because the resolved `link.exe` path differs from the assumed MSVC
- layout; neither cell downloads inputs or produces an artifact.
- - Local commit `d1eb45d61` adds a bounded path-tail diagnostic and is green across 20 test files /
- 99 tests plus static gates.
- - Next gate: push the diagnostic, inspect both native path shapes, then make only the evidenced
- parser correction and rerun all six jobs.
+ audit in [run 29372816457](https://github.com/stablyai/orca/actions/runs/29372816457).
+ - Windows x64/arm64 prove Git for Windows' `link.exe` shadows the configured MSVC linker; neither
+ cell downloads inputs or produces an artifact.
+ - Local commit `5f0c1417d` selects exactly one canonical MSVC candidate while keeping the strict
+ path grammar and exact linker hash. It is green across 20 test files / 100 tests plus static
+ gates.
+ - Next gate: push the correction, rerun all six native jobs, then directly inspect all six
+ artifacts before completing the metadata/provenance box.
## Work packages, in required order
diff --git a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
index 4d3d5cd9497..813bf18fd96 100644
--- a/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
+++ b/docs/reference/plans/2026-07-14-ssh-relay-github-release-implementation-checklist.md
@@ -8,7 +8,7 @@ work; keep exact commands, runner identities, hashes, metrics, and residual gaps
Date created: 2026-07-14