# Runtime Boundary Decision Record: Current Xeno CLI Distributions

## Identity

- Component: npm Node-host profile and self-contained external-runtime profiles
- Replacement milestone: PROPRIETARY-RUNTIME-1
- Repository and paths: `xeno-agent-cli/scripts/build-standalone.mjs`, compatibility shell wrapper, `scripts/audit-self-contained-runtime.mjs`, release workflow, install scripts, and runtime-boundary documentation
- Record owner: Xeno engineering, final owner assignment pending
- Decision date (UTC): 2026-07-12
- Status: Phase 6 decision complete; P3 explicitly declined for the current architecture and release series

## Decision

- The supported npm profile requires a separately installed Node.js 20 or newer host.
- The `pkg` self-contained profile embeds Node.js, including the Node V8, libuv, OpenSSL, and zlib runtime boundary.
- The Bun self-contained profile embeds the third-party Bun runtime and its transitive runtime components.
- All three profiles have a maximum ownership claim of P2 after the separate P1/P2 capability and provenance gates pass.
- The `owned-standalone-runtime` P3 capability remains `achieved: false`.
- Current self-contained assets may not be described as P3, fully proprietary, 100% Xeno-owned, native-owned, or free of third-party runtime code.
- Replacing `pkg` with another third-party packager or embedded runtime does not advance P3.

## Installer and Packaging Audit

| Surface | Actual behavior | Runtime boundary | Claim disposition |
| --- | --- | --- | --- |
| `scripts/install.sh` | Resolves npm integrity and runs global npm install | Separately installed Node/npm | External host; maximum P2 |
| `scripts/install.ps1` | Resolves npm integrity and runs global npm install | Separately installed Node/npm | External host; maximum P2 |
| `build-standalone.mjs pkg` | Compiles self-contained platform payloads with pinned `pkg` through an owned cross-platform orchestrator | Embedded Node/V8/libuv/OpenSSL/zlib | External embedded runtime; not P3 |
| `build-standalone.mjs bun` | Compiles self-contained platform payloads with a preinstalled Bun through the same orchestrator | Embedded Bun and transitive runtime | External embedded runtime; not P3 |
| GitHub `cli-v*` release | Publishes payloads, archives, runtime manifest, and checksums | Profile declared by `RUNTIME-BOUNDARY.json` | Release notes must state external runtime and not P3 |

## Enforcement

- `scripts/audit-self-contained-runtime.mjs` hashes every raw self-contained payload and writes a deterministic `RUNTIME-BOUNDARY.json`.
- Verification fails for a missing payload, unknown packaging mode, changed payload hash, changed manifest, or ownership ceiling above P2.
- The build script cleans the release staging directory so Bun and Node profiles cannot be mixed.
- Target validation fails closed unless the corresponding audited PTY manifest and native payload exist.
- Before `pkg` runs, the owned orchestrator invokes the pinned `pkg-fetch` entry point with `--force-fetch`; existing/downloaded bases must match the packager's expected SHA-256, and fetch failures terminate explicitly instead of falling back to an implicit Node.js source build.
- The owned orchestrator writes normalized ZIP/TAR archives and SHA-256 records without Bash, `npx`, or external archive/checksum utilities.
- The release workflow verifies the runtime manifest before uploading assets.
- `SHA256SUMS.txt` is generated after the runtime manifest and therefore covers the claim record as well as payloads and archives.
- Compatibility labels `standalone` and `native` remain in scripts/environment values, but documentation defines them as self-contained distribution labels rather than ownership claims.

## Verification Evidence

- Runtime-boundary self-test creates a synthetic PE payload, writes and verifies the Node profile, mutates the payload, and confirms verification rejects it.
- Focused install-documentation tests assert the profile scripts, workflow gate, manifest name, and not-P3 language.
- A clean Debian Node 24.18.0 run builds the exact SDK and CLI candidates, packages Linux x64 and Windows x64, executes and verifies the Linux payload, and reaches only the required unsigned-native release blocker.
- A clean Debian Linux arm64 run under QEMU builds the exact SDK and CLI candidates, packages and executes `xeno-linux-arm64`, verifies owned PTY/preview plus bubblewrap containment, and reaches only the required unsigned-native release blocker. See `docs/compliance/linux-arm64-package-candidate.md`.
- Focused packaging tests verify Linux arm64 and Windows arm64 base-prefetch arguments plus unsupported-target rejection. A transient GitHub `503` was reproduced as the historical trigger for implicit source compilation; the new preflight converts that condition into a bounded explicit failure.
- The exact clean cross-built Windows payload executes under its real `xeno-win-x64.exe` name with healthy process-tree, ConPTY, owned-preview, and ownership-policy diagnostics.
- Two consecutive same-environment Windows runs produce byte-identical executable, ZIP, runtime manifest, and checksum files. Independent-environment reproducibility remains a P4 gate.
- CLI build, typecheck, release-package smoke, compliance, and artifact inventory must still pass for each release candidate.
- No current release artifact was published by this implementation work.

## P3 Reconsideration Gate

P3 requires either an owned native runtime rewrite or a sustained Xeno-owned JavaScript-compatible runtime, followed by cross-platform conformance, deterministic artifacts, provenance, SBOM, signing, and independent review. It is a separate multi-year program and is not part of the current P2 release target.

## Handoff

- Phase 6 decision complete: yes
- P3 implementation complete: no
- P3 evidence complete: no
- P3 capability gate may be marked achieved: no
- Public not-P3 boundary ready for engineering use: yes
- Counsel/public ownership approval: pending
- Author/date: Codex implementation assistant, 2026-07-12
