fix: harden Windows updater restart handoff - #8
Draft
eWOOD29 wants to merge 7 commits into
Draft
Conversation
Use creation-time-bound Toolhelp snapshots to prove candidate and restored-old listener ownership across Windows launcher descendants. Capture the candidate tree again at the real stop boundary and explicitly terminate and reap every test-owned Popen.
Use PID plus creation time as the stable identity key across reparenting, listener membership, and survivor checks. Add deterministic stale-PID and native Toolhelp/query failure controls.
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.
Status
Independent exact-snapshot technical and canonical-record review complete — RESULT: PASS; Gate 1 merge approval ready.
PR #8 remains open, draft, and unmerged. No merge, beta.2 preparation/publication, release-asset change, or live updater operation is authorized.
Exact snapshot
6148ecd84cccfbad69e4ac94899311c87745a1e778e70a24f2869a9719607f26da039745482bf745c54be2a629deef3dbd79a2d55a0df140acd17a5bf38a56e2c897eb3094eb37180ae4862a8607f7a09265cc0ad407f27755d6abcf248168b9291689f403d4c63b9c03ab86532aa40893557cc3ad68c8f9Review history and remediation
The original implementation at
6aa3779d…had two production P0 defects: retained exited Windows process objects could be accepted as live startup owners, and failed recovery could relaunch an installation not re-established as trusted. Both were fixed at production remediation head3e2d60adb12e14c482f1ab270e1b3c4f287565cfand independently closed.The later evidence head
c54be2a…failed because normal Windows/Hermespythoncan expose a launcher asPopen.pidwhile a descendant owns the listening socket, and because test-ownedPopenobjects were not reliably reaped.Head
f38a56e2…corrected launcher-tree attribution and reaping, but a fresh independent review found that fullProcessIdentityequality still treated mutableparent_pidand executable observations as identity. A reparented process with unchanged PID and creation time could therefore be falsely classified as absent. The same review required durable native-boundary controls.The current append-only remediation at
9265cc0a…:(pid, creation_time);Process32FirstW,Process32NextW,OpenProcess, andGetProcessTimesfailures;A fresh final independent technical re-review of
9265cc0a…explicitly closed both prior P1/P2 technical findings. Its only blocking result was that this PR body and the Project Hub had not yet been reconciled to the new snapshot; this update addresses that record-only gate without changing code.Exact changed-file scope
Exactly eight files differ from required
develop:appdock.pyscripts/update_helper.pytests/test_generation9_remediation.pytests/test_update_real_finalize_rollback_process.pytests/test_update_real_rollback_process.pytests/test_update_restart_handoff_regression.pytests/test_windows_process_tree_deterministic.pytests/windows_process_tree.pyThe current remediation commit changes only the four test/evidence files numbered 4, 5, 7, and 8.
Production code is unchanged after
3e2d60adb12e14c482f1ab270e1b3c4f287565cf:appdock.py:b9aa89cbf4c3d0317ddd54905186536b0522521bscripts/update_helper.py:aa85150b10427f65ac74930eba265887fe8a48e9Local Windows validation
All process runs used
ResourceWarningas an error.ResourceWarningorsubprocess is still runningwarningThe normal Hermes launcher topology was independently reproduced: the
Popen.pidlauncher had a different descendant PID owning the disposable listener; stable identity correctly attributed it to the owned tree and cleanup removed it.Exact-head CI
Run 31898113799 is bound to
9265cc0ad407f27755d6abcf248168b9291689f4and completed SUCCESS, with all 10 jobs passing:ResourceWarning; zerosubprocess is still runningInformational only: GitHub forced older Node 20 artifact actions onto Node 24; no gate was affected.
Safety and approval gates
The live machine remains healthy on managed v0.2.1 / Stable. Startup, Tailscale, channel, private state, and retained beta.1 failure evidence remain preserved.
A final different record-aware independent verifier directly read the current PR body and authenticated Google Docs Project Hub, confirmed no branch drift or remaining technical/record blocker, and returned RESULT: PASS.
Recommended next action: Ethan may explicitly authorize Gate 1: merge PR #8. Gate 1 authorization must not be treated as authorization to prepare/publish beta.2 or run the live updater. After merge, beta.2 preparation/release readiness is a separate bounded phase and Gate 2; any live updater run is Gate 3.