Repository navigation
fix(update): verify and atomically stage SSH-pushed standalone updates - #256
Conversation
|
Review follow-up implemented in Remote publication now holds a persistent POSIX flock across snapshot, installed verification and conditional rollback. A rollback requires the published device/inode and digest to match. Deterministic interleaving verifies a failed updater cannot overwrite a different cooperating updater's successful version. Contention is bounded at 30 seconds; the lock inode is intentionally retained, never deleted/truncated as stale state. Unmanaged writers and signal-driven termination are not made atomic by this advisory lock. The exact complete LF/CRLF installed receipt is parsed on both normal exit and timeout output, including bytes; exit 255 no longer hides that evidence. Verified: 26 updater plus 27 CLI-runtime tests on actual Python 3.9.6 and 3.13.7. No real SSH/deployment; draft retained. Reconcile generated standalone with #249/#254/#255 on later integration. |
|
Additional review addressed: push and installed-version probe capture raw bytes. Exact complete receipts survive non-UTF8 diagnostic stderr, while protocol stdout decodes strictly. Real local fake subprocess regressions cover exit 0/255 and invalid/partial/mismatched output; successful updates still require the independent fresh probe. The publisher rereads the installed release while holding flock before snapshot/publication. A same/newer/unusable release returns a strict rejection without replacing the target or reporting update success. A deterministic newer-first fixture has both clients observe 1.0.2, lets 1.0.4 finish while 1.0.3 waits, then requires the stale client to reject and preserve 1.0.4. Stable/prerelease comparison parity, no retry, retained lock inode and rollback ownership checks remain covered. Rejection decoding rejects duplicate fields/NaN/Infinity and unsafe conversion errors; malformed data does not establish prepublication certainty. |
Summary
Verify bounded SSH-pushed source bytes, stage on the target filesystem, require exact staged/installed version checks, and atomically publish with rollback for handled in-process failures. Preserve owned launchers and independently probe before reporting
updated: true.Closes #229
Type
Checklist
Verified against
Python 3.13.7, macOS arm64. Independently reran 64 original focused tests, then the combined SSH/updater/output/release contract set (81 passed). Worker follow-up passed 18 updater and 27 CLI runtime tests. Independent read-only review findings addressed: benign first-connect stderr no longer hides an exact absence sentinel; started transfer failures are explicitly unknown and disallow retry.
Notes
These are actual generated remote-script executions on synthetic homes, NOT a live SSH connection. Truncation, digest/base64/artifact/version/publication failures preserve the old copy when rollback executes. SIGTERM after publication may leave the new file installed: signal/transport loss or rollback failure is an unknown commit, not a preservation guarantee. Confirmed commit plus failed later probe retains commit evidence without
updated: true. Symlinked installation directories/custom launchers are refused; hard-link support is required for rollback. Coordinate with #228/#230/#239; draft only, no merge/release/deployment.