Skip to content

[SUPERSEDED / UNMERGED] Crash-recoverable handover source carried by MVP #176 - #174

Closed
mark-e-deyoung wants to merge 13 commits into
mvp/ic1-integration-20261117from
fix/mvp-handover-recovery-reconciliation-20261121
Closed

mark-e-deyoung wants to merge 13 commits into
mvp/ic1-integration-20261117from
fix/mvp-handover-recovery-reconciliation-20261121

Conversation

@mark-e-deyoung

Copy link
Copy Markdown
Collaborator

Authority

Stacked on the qualified MVP #158 (9809519b94b9074ed681b297237f6dec89d43186) rather than public main. Keeps MVP's session cancellation/lease behavior and frozen 62/0/9 external contract source. Reconciling main-based recovery PR #171 without merging its divergent runtime baseline.

Changes

  • Startup checks current active session's session.transition.json, exact peer/operation identity, and expected Wine profile link, then either converges active state and durably removes consistent intent or fails closed.
  • Live handover verifies profile link and rollback, fsyncs marker directory after atomic rename, and retains intent where there is no previous owner to compensate.
  • Ported synthetic malformed/unsafe peer, crash-before/after-pointer, idempotent replay and stale-profile tests.
  • Crucially, added the recovery test file to scripts/ci/test.sh; the original main-based PR [SUPERSEDED / UNMERGED] Crash recovery integrated on MVP PR #174 #171 did not list that file in the explicit unit runner manifest, so its prior green unit job did not independently prove these new scenarios.

Admission

Require exact-head unit tests including recovery file, frozen contract conformance, safety/provenance and smoke CI; then independent review of missing orphan-inactive marker scanning, cross-process fencing, failed-marker cleanup and process/recorder effects. No native Wine or private WinInspect proof is claimed. All checks public free-tier Actions. Do not merge, auto-merge or promote the release until owner acceptance.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:31+0100 R3 integration — independent crash-recovery source admission stacked on MVP

After proving historical MVP #158 conformance PASS 62/0/9 and unchanged main FAIL 55/7/9 at identical external contracts SHA 205666f7f0235cb0fc51ca8a5af84f9f67831a74, recovery also needed source reconciliation; simply merging main-based #171 would fork 108-commit-qualified lifecycle state/cancellation and keep a known unqualified conformance base.

New independent DRAFT stacked PR #174 based on authoritative MVP head 9809519b94b9074ed681b297237f6dec89d43186, new exact head 7b1712481dc6f3120fbab45a6dfbf5c1330bd58f. Ports fail-closed api/core/handover_recovery.py and tests from prior analysis #171, integrates api/server.py startup reconciliation before readiness, and minimally patches the MVP's api/routers/lifecycle.py for verified Wine profile link/compensating rollback and durable fsync after marker rename. Rewrites only two legacy mock seam references to use _link_profile_checked. All synthetic temp-file path/marker/id/rollback tests included. Found and corrected an important qualifier defect: scripts/ci/test.sh is an explicit allowlist and original main-based #171 had NOT included tests/test_handover_restart_recovery.py; earlier #171 green unit job did not actually run its 9 new crash scenarios. #174 adds the file to the mandatory runner. Exact-head CI #44844330166, CI unit isolation #44844330143 are in progress. Public source/provenance, WinInspect RPC redaction, disposable, public-safe evidence guards already successful; do NOT declare new recovery tests passed yet.

Parallel formal authority: stacked PR #173 exact head d254dd9a6912d0a37929710588aff76d08245aaa preserves MVP's existing cancellation and only adds missing absolute STOP_NOW veto ahead of noninteractive/agent-only shortcuts with targeted regressions, bringing over three blue/ two adversarial red TLC models. Formal #44843910305 terminal SUCCESS, BuildKit successful, CI #44843910364 in progress. Both new branches are independently stacked on #158 (not on each other); no automatic merge, product release or native observer promotion. Existing #170/#171 main-based work remains reference/supersession material and must not overwrite the qualified MVP implementations. Diagnostic #172 closed unmerged after proving causal baseline and pin custody.

Remaining proof: run exact-head #173/#174 conformance against same frozen external contract source, TLC and all real unit tests; red-team the recovery behavior if prior old owner session.state remains active after target commit, inactive orphan intent, live process/recorder effects and directory durable markers. Do not conflate the synthetic recovery tests with real cross-process/host/guest atomicity. WinInspect private #468 and real HWND observation #166 still held. Free public GHA only, no private minute spend, source disclosure, local host, or release.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:34+0100 crash-recovery R4 — persisted two-owner invariant corrected, replay ordered

New stacked DRAFT #174 now exact HEAD 0e6b8d16f0ceee422853e77d26d20f26a1eef9b9, base qualified MVP #158 9809519b94b9074ed681b297237f6dec89d43186. Detailed code review confirmed a concrete cross-layer split ACTIVE state defect independent of host crash: resume_session shut down previous session processes via atomic_shutdown but did not write prior session.state = suspended before setting new target ACTIVE. The recovery prototype likewise could accept target ACTIVE while leaving prior session.state ACTIVE. Main-based PR #171 lacked its new crash tests in the mandatory explicit scripts/ci/test.sh manifest. Stacked #174 added that manifest entry.

Implemented:

  • Live MVP lifecycle now marks previous owner SESSION_STATE_SUSPENDED after broker switches and before removing durable intent when prior state was implicitly/explicitly ACTIVE, preserving completed/suspended previous states. Caught-exception rollback restores previous state; interrupted commits remain replayable.
  • api/core/handover_recovery.py validates matching reciprocal phase+operation peer marker before mutating either state. Target-side and outgoing-side recovery both demote a peer marked ACTIVE or with implicit missing active state to SUSPENDED, converge current pointer to ACTIVE, then clean markers. Missing reciprocal intent before state convergence fails closed; after already-converged state, absent peer marker can be safely replayed (crash between peer unlink and active-side cleanup).
  • Durable intent filenames are fsynced after rename; marker unlink now refuses symlink, does directory fsync, and errors are not swallowed. Successful cleanup orders peer marker first and current active marker last so a crash after peer removal leaves current marker for verified idempotent replay.
  • Expanded mandatory tests/test_handover_restart_recovery.py with explicit dual-active states, missing peer before commit denial, post-cleanup replay success, incomplete cleanup quarantine, malformed/out-of-root and stale-profile failure. Native Wine processes not started by synthetic tests. Separate tests verify actual silent-link failure is caught.

Current public cloud: source HEAD 0e6b8d16... generated CI #44844739774 and isolation #44844739725, focused safety runs in progress at checkpoint. No exact-head unit or conformance PASS yet claimed; earlier runs of prior #174 commits may be cancelled by the sequential safety patches. Parallel DRAFT #173 d254dd9a formal TLC SUCCESS, unit SUCCESS, conformance/vNext and integration still in progress on CI #44843910364.

This is single-host crash recovery under a canonical active pointer, not fully linearizable multi-process or distributed host/guest transactions. Explicit remaining: orphan inactive markers, generation CAS across multiple writers, running Wine/process state, recorder finalization and native effect recovery, private WinInspect C++ #468. No auto-merge, release, private source, paid minutes or hardware.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 — DLE lineage reconciliation / source supersession, no merge

This isolated source workcell is fully represented in the canonical MVP cross-layer integration #176 at exact 3cdfdc2299f732d2d2e23139b6a05a919e4106b5. Independent source evidence: all seven source/test blobs are byte-identical in #176 (including the exact corrected lifecycle test). Original independent exact-head public acceptance: CI #44844739774, terminal SUCCESS. Combined #176 at exact target subsequently passed full CI #44872891236 and TLC #44872891144 alongside its focused public guards.

Original head 0e6b8d16f0ceee422853e77d26d20f26a1eef9b9 is preserved in immutable GitHub commits and PR discussion. Close this PR UNMERGED, superseded, retaining source custody and reproducible evidence but eliminating duplicate merge candidates; do not delete branches or rewrite history. The owning MVP #158 is still DRAFT, and combined #176 plus the downstream consumer+reap candidate #181 are not promoted to public main, hardware or production. No release gate waived, no paid/private Actions minutes or private C++ source disclosed.

@mark-e-deyoung mark-e-deyoung changed the title [DRAFT] Crash-recoverable session handover on qualified WineBot MVP [SUPERSEDED / UNMERGED] Crash-recoverable handover source carried by MVP #176 Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant