Repository navigation
docs(ssh): propose Python-free remote deployment and compatibility contract - #83
Merged
Merged
Conversation
8 of 11 tasks
…ntract Add an ADR selecting operator-invoked isolated artifact provisioning over per-destination npm installs and a portable bundle. It defines an identity- scoped, immutable install layout with a self-locating wrapper, integrity pinned to the release commit, a no-replace activation under a cooperative operator-side lock, completion receipts and marker-guarded recovery, cleanup and rollback. It also proposes a wire and capability contract separate from package SemVer while keeping exact-version refusal, plus actionable remote runtime, Node, platform and native-lock error codes. Record the live Linux cell of the validation in VALIDATION.md with its deviations; the Windows cell remains open. Link the ADR from the four guides and PARITY, ship it with the package docs and link-check it.
abruption
force-pushed
the
docs/23-remote-deployment
branch
from
October 3, 2026 03:07
31ad151 to
8efc77b
Compare
8 of 11 tasks
4 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Current status (latest)
linux-x64-sandbox, user-provided host, dedicated test directory removed afterwards): the selected states recorded inVALIDATION.mdmatched the ADR rules in force at the time (fifth commit). These include steps 1–9, same-identity, foreign and empty targets, lock contention, break-lock with and without a receipt, an unowned lock, failed-activation rollback, the undetected same-path Node swap, rollback to a previous directory, and retention.doctorand dry-run before its receipt and lock release. B and S did so afterwards, and S had no dry-run, so their step 8 evidence is partial. This is recorded from the chronological private log, which was not rearranged.runId(the recovery run is recorded only in its journal);.receiptstrust checks;ab30762(after fix(windows): give the creation-time probe a cold-start deadline #79, feat(ssh): support ordered multi-host commands and constrained connection options #84, feat(replies): add verified sender context and optional return-route diagnostics #86, feat(updates): add npm-aware update check and opt-in cached notices #85 and feat(cli): add explicit shell-scoped sp shorthand #75), as a single squashed commit. Conflicts were resolved as unions:docs/design/remote-deployment.md;--ssh-opt,--ssh-jumpand IPv6 support from feat(ssh): support ordered multi-host commands and constrained connection options #20, with the exact-version preflight per destination unchanged;update --checkdoes not update remote hosts;npm --versionchecks on the host ran with the account's realHOME, so npm's user configuration was readable to that process. No external writes were observed, but this was not independently verified, and the account's npm directories were not inspected.The sections below are history from earlier checkpoints.
Part of #23. Adds a design-only ADR,
docs/design/remote-deployment.md(Status: Proposed), for Python-free remote deployment and version compatibility. Nothing is implemented and SSH behavior is unchanged.[email protected]ships darwin/linux/win32 x64/arm64 for Node 20–25 inside its tarball; glibc 2.28+, no musl), the npm launcher's PATH Node problem, offline use, integrity and ownership.--capabilitiespreflight.--versionstill runs first and an exact match is still accepted. Exact-version refusal stays the only acceptance rule until the follow-ups are implemented and live mismatched-version evidence is recorded.remote_runtime_missing,remote_node_unsupported,remote_platform_unsupported,remote_implementation_mismatch,remote_protocol_incompatible,remote_capability_missingandremote_native_lock_unavailable. Each has an operator message.packageFiles, the package smoke list and the repository link check were updated.Review fixes (second commit)
$0withpwd -P, Windows%~dp0). Step 6 probes the staging install directly, including the native lock resolved from staging. Step 8 adds a mandatory post-activation check: wrapper banner, native probe, marker hash, and a real directory with no symlink. Callers switch only in step 9.fs.renameSync(rename(2)) on POSIX, afterlstat(target)returns ENOENT, and[System.IO.Directory]::Moveon Windows.mv,mv -nandMove-Itemare explicitly excluded because they nest into an existing directory (reproduced locally with BSDmv).rename(2)replacing an empty directory is documented and guarded. A table defines the outcome per target state: absent, same identity and verified, same identity but failing verification, mismatched hash, different identity, foreign, empty directory, and leftover staging. Rollback of a failed activation is defined.<version>-<id16>, a hash over package SHA-256, the release lockfile's dependency integrity, platform, arch, libc, Node major, ABI and the Node realpath. Installs are immutable; any identity change creates a new directory beside the old one.lstat, owner and mode; Windows reparse points, owner and DACL;a9c42334…, verified locally);PARITY.mdadded to the repository link check (passes).Review fixes (third commit)
launch.mjswould compare the realpath, major, ABI, platform and arch with the marker and refuse with the proposedinstall_runtime_mismatch(mapped by the client toremote_install_runtime_mismatch, F6).<node>is defined asidentity.node, the realpath.<node> <npm-cli.js realpath> install …withdirname(<node>)first on PATH. The npm path and version are recorded in step 2, and the run refuses if that npm is absent. The validation notes now say the "no Node on PATH" checks covered only the wrapper.mkdiractivation lock is held fromlstatthrough verification. A stale lock is broken only by an explicit operator command, which first rolls back the stale run's unverified target. The guarantee scope is stated: on POSIX, a same-user process that ignores the lock can still have an empty directory replaced (closing that window needsrenameat2/renamex_np, out of scope). The marker check is no longer called tamper detection. A per-file SHA-256 manifest now detects corruption and partial installs, but it is not a boundary against a same-user attacker.Also validated locally: npm run via the recorded Node with a minimal PATH; a prototype identity launcher that passes when the identity matches and returns
install_runtime_mismatchwith exit 2 after the marker was edited; activation lock exclusivity (EEXIST).Review fixes (fourth commit, documentation only)
owner.jsonholds therunId, an opaque operator label and the creation time; the operator keeps a local run journal. A lock withoutowner.json, with an unreadable one, or whose owning operator run cannot be confirmed is never judged stale. Only the owning run or an explicit operator break-lock releases it.<root>/.receipts/<install-name>.jsonis written only after every step 8 check passes, and before the lock is released. Break-lock with a matching receipt removes only the lock. Without a receipt it conservatively rolls the target back. An owned target without a receipt is refused rather than reported as "already provisioned".markerVersion,runId,manifestSha256andprovenance(source commit, registry integrity, npm-cli path and version), plusstagedAt. These fields are separate from the identity hash.No runtime work was done, and F5 (live isolated POSIX and Windows destinations) remains unmet.
Live Linux cell of F5 (fifth commit)
VALIDATION.md("Remote deployment workflow, POSIX cell").a9c42334. Installs ran offline as<node> <npm-cli.js>. Staging and post-activation checks passed. Operatordoctor --hostreturnedok:true, andsend --dry-runreturnedno_reachable_targetwithsubmitted:false.rename(2)semantics, a Python-style stub (byte-identical before and after), lock contention, a failed-activation rollback, break-lock with and without a receipt, an unowned lock, the same-path Node 24→22 swap (undetected, as documented), rollback to a previous directory, and receipt-guarded retention. The test root was deleted afterwards.SHASUMS256.txtGPG signature was not checked; a test-only isolation shim kept CLI discovery inside the test root; a test harness, not the F6 helper, drove the steps.Review fixes (sixth and seventh commits, documentation only)
.receiptstrust: the directory and each receipt are checked withlstat(no symlink or reparse point, owner, mode or DACL) before any write or delete.runId,identityHashandmanifestSha256all equal the install's values. Corrupt, mismatched or orphan receipts are refused, and cleaned up only explicitly after ownership is confirmed. "Already provisioned" reuses the existing receipt.Type
Validation
npm ci --ignore-scriptsandnpm run buildSESSION_PEER_PYTHON_ROOT=/path/to/pinned/reference npm test(77 tests: 73 pass, 0 fail, the rest skipped by platform)npm run test:packageandnpm audit(0 vulnerabilities);node scripts/check-repository.mjs;node scripts/release.mjs pack && node scripts/release.mjs artifactrelease gatepasses with an up-to-date baseTested environments / limitations
These local checks ran on macOS arm64 with Node 24.16.0 and npm 11.15.0. No network destination was contacted; the only network use was registry reads.
[email protected]published tarball's SHA-256 and integrity match the 0.2.1 release record. Thefs-ext-extra-prebuiltandnantarballs matchpackage-lock.json.npm install --prefix ... --offline --ignore-scriptswith an empty cache succeeded. A wrapper with an absolute Node path printed--versionwith no Node on PATH.listanddoctorpassed with an empty HOME, and the nativeflockload passed.sshstand-in:remote_version_mismatch;remote_cli_missing;remote_cli_missing(this is the gap);ssh_preflight_failed(this is the gap);--versionpasses but the native import fails (this is the gap).Also validated locally after the review fixes:
renameSyncactivation, then post-activation banner, native and marker checks;doctor --hostthrough thesshstand-in;ENOTEMPTYon a second activation;mvsemantics matrix.These local stubs on one macOS host are not a substitute for the isolated POSIX and Windows destinations that #23 requires.
Not validated:
.cmdwrapper;Directory.Move, the%~dp0wrapper, and the reparse-point and DACL checks;The contract and the new error codes are unimplemented. Existing CI package-smoke runs (macOS, Ubuntu and Windows x64 on Node 22/24) and earlier manual live SSH records are cited as evidence; they were not re-run as new live tests. Because of this, issue #23's isolated POSIX/Windows validation criterion remains open. The doc carries it as follow-up F5, which is why this PR uses "Part of" rather than "Closes".
Release impact
There is no runtime, schema or native dependency change, and no automatic release or deployment. The next package tarball gains one documentation file,
docs/design/remote-deployment.md.