Skip to content

[SUPERSEDED / UNMERGED] Formal broker source migrated to MVP PR #173 - #170

Closed
mark-e-deyoung wants to merge 29 commits into
mainfrom
formal/cross-layer-atomicity-mvp-20261120
Closed

mark-e-deyoung wants to merge 29 commits into
mainfrom
formal/cross-layer-atomicity-mvp-20261120

Conversation

@mark-e-deyoung

Copy link
Copy Markdown
Collaborator

Source-owned formal verification slice

Adds three bounded TLA+ state machines and TLC configurations for control leasing/STOP_NOW, session crash-recovery, and exact-generation release admission, plus a stdlib fault/negative-control harness, documentation mapping to actual WineBot code, and a dedicated $0 public-hosted GitHub Actions workflow. This is deliberately separate from MVP #158 and from blocked private WinInspect #468 source qualification.

Acceptance

  • Exact-head real TLC parse/model-check of all three safety invariants on public GHA; pin/check release-published TLC SHA-1 (not production signed artifact provenance).
  • Stdlib negative-control tests and full public CI green.
  • Independent review of model/code refinement gaps before any merge; no claim that a green abstract model proves actual Python, Wine or Windows effects.
  • Backlink into owning DLE [DRAFT MVP-IC1] Integrate Wine11 disposable runtime with frozen API conformance #158; preserve private source custody, no private GHA minutes, no physical host.

Explicit non-goals

No runtime/permission changes, no WinInspect source export, no release promotion, no claims of cross-layer atomicity in the current implementation. The effect-fencing and startup reconciliation implementation work remains a follow-on based on counterexamples.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 FORMAL R1 qualification — native TLC + negative-control PASS

Public source-owned draft PR #170, exact head 3f10971cba94fa73d357752e783aa694a0487d98, has actual free GitHub-hosted Formal Cross-Layer Safety run #44776151279, job 136426538474, terminal SUCCESS. Native per-step readback: Install pinned public TLC v1.7.4 SUCCESS, Exhaustive finite-state invariant checking SUCCESS across ControlLease, SessionHandover, ReleaseAdmission, Run dependency-free model contract tests SUCCESS, post-checkout cleanup SUCCESS. No private source/secrets, no paid/private runner, no local hardware, no new controller.

First failure/response: previous draft head f994565302d7222d582bceff899e33412eaa073f had TLC step PASS but Python independent explorer looped indefinitely because effects counter was unbounded despite intended finite state space. Fixed at exact new head by recording saturated effects=1 (effect observed) instead of effects+1. New exact-head real run passes all steps. Retain first failure in history, do not call unbounded predecessor qualified. BuildKit public guard #44776151246 SUCCESS; repo-wide CI #44776151263 still IN_PROGRESS at this readback.

Scope and risk ledger: TLC is model-only abstract bounded-safety PASS. It does NOT imply that existing production api/core/broker.py uses generation-bound input execution or that api/routers/lifecycle.py is crash-atomic across session pointer, Wine profile symlink, state files and broker. Next independent code-to-model refinement batch must implement synthetic fault injection at each concrete boundary with process restart simulation, then propose minimal durable transaction and fencing changes based on an observed counterexample. No runtime safety grant, source declassification, merge, release, or private C++ qualification. Owning #158 baseline 14/14 unchanged; #166 native WinInspect fixed-binary gate unchanged.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 FORMAL R1 red/blue acceptance — three TLC safety models AND adversarial counterexample verified

New draft formal PR #170, exact source HEAD 951640c02eacc2e7e7a91ff51c16269ea77ead49, real public free-tier GitHub Actions formal run #44776716999, job 136428356566: terminal SUCCESS. Independently reread completed native stages: pinned released TLC v1.7.4 installed/checksummed PASS; all ControlLease, SessionHandover, ReleaseAdmission finite TLC safety invariants PASS; deliberately UNSAFE ControlLeaseUnsafe checked separately and generated the expected NoUnauthorizedEffect invariant counterexample (workflow explicitly rejects parser-error/timeout/success false positives) PASS; all six stdlib deterministic negative/fault scenarios PASS; post checkout cleanup PASS. BuildKit guard #44776716909 SUCCESS; repository-wide CI #44776716960 still IN_PROGRESS at observation. The test harness's previous unbounded effect-counter failure was corrected on earlier commit and now verified.

Source-grounded actual implementation risk (not a proven live exploit): on main@f5ba0256, api/routers/input.py mouse click_at lines ~352-438 performs await broker.check_access() followed by multiple await run_async_command lookups and eventual xdotool click, while key_press lines ~502-559 performs one check before async target resolution and eventual _send_keys. api/core/broker.py uses local threading.RLock and correct immediate STOP_NOW state changes, but no generation/fence token accompanies the later physical effect. This is a check-to-effect race hypothesis; independent concurrency test with controlled mocked effects is needed to prove and then close it. The deliberately unsafe TLA+ negative control models that stale queued input effect and TLC REJECTS it as expected. An abstract formal model PASS does not yet certify actual brokered native inputs are fenced.

Next code-to-model phase: add real route-level deterministic interleaving tests; design and implement minimal atomic authorization-at-effect boundary with broker generation/revocation tokens and pre-execution postcondition validation. For persistent session handover inject crash between write_session_dir, profile link, session state, broker update; recover from durable intent with compare-and-swap and fencing; treat restart reconciliation independently from runtime readiness. Source-to-binary release admission remains separately blocked by private WinInspect #468 exact C++ test and approved projection. Do not merge #170 until full CI and independent review, nor merge #166 or promote MVP. No private Actions minutes, source leak, user-owned hardware, paid APIs, or additional scheduler.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 FORMAL R2 — concrete code interleaving witness and handover recovery review

Authoritative public formal draft PR #170 now includes actual route-level deterministic synthetic interleaving at source HEAD a3a3a6bd6dc8c15c2444a8be780fe352461fcc2f, in addition to three TLC model blue checks and deliberately unsafe TLC counterexample (already terminal formal run 44776716999 SUCCESS at earlier exact source). Concrete tests/test_input_revocation_interleaving.py runs real api.routers.input.click_at with actual InputBroker, but intercepts all external X11 command executions: a controlled async barrier delays synthetic window lookup after initial broker access PASS; next actual STOP_NOW revokes and broker.check_access() becomes FALSE; releasing the barrier shows whether route nevertheless dispatches synthetic click. Test intentionally records the currently unsafe witness (one queued click after STOP_NOW) and is expressly not a safety fix or successful product invariant. Subsequent production mitigation must reverse this expected result, not normalize it. No real input or hardware.

Source review of api/routers/lifecycle.py further found _write_transition_marker writes session.transition.json during handover and _clear_transition_marker deletes it, but no evident marker reader and startup reconciliation in that file; caught-exception rollback does not execute after process death between active pointer, profile link, active session state and broker changes. Documented the missing durable-recovery contract in formal/README.md. This is a plausible failure seam, not a demonstrated crash loss.

Latest source a3a3a6bd... has triggered formal run #44778202967 and full CI #44778202962, not terminal at checkpoint. Prior code-head 4254bc4f... CI #44777915668 in progress, its formal #44777915669 terminal SUCCESS. Do not claim concrete test passed until exact-head unit CI result. Keep PR #170 DRAFT and no runtime/merge/release changes.

Next code-to-model work: guarded generation-bound broker dispatch on a separately reviewed patch with cancel/revalidate at actual effect boundary (not only API route), plus startup replay/compensating transaction for session marker. WinInspect private C++ #468 source executor admission and original WineBot #166 hardware/native release gates remain unrelated/held. Public free GHA only, no private source/files, private Actions or user hardware.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 FORMAL R2 execution — real route witness and second red-team TLC gate

Draft PR #170 currently exact HEAD 1790ced4696a460e58a7f1efd72cb337f89a2d77 (public formal branch only; no runtime changes or merge). Independent real formal workflow #44778948422, job 136436233049, terminal SUCCESS: all three abstract TLA+/TLC blue models, original unsafe input model expected counterexample, newly added SessionHandoverUnsafe.tla expected ConvergedAtRest counterexample for crash after pointer write without profile/broker reconciliation, and six stdlib negative scenario tests. TLC negative-control gates accept only exact invariant-violation marker, reject parser/runner error, timeout or unexpected full pass. Public BuildKit guard 44778948489 terminal SUCCESS. Full repo CI #44778948657 still IN_PROGRESS at current source, not a full PASS claim.

Concrete route-level code-to-model evidence in tests/test_input_revocation_interleaving.py: actual api.routers.input.click_at and InputBroker run under deterministic asyncio barrier and synthetic xdotool mock. The test grants input, waits between initial permission check and window discovery return, revokes by STOP_NOW, confirms access check now rejects, then observes that the current route nevertheless requests an effect and claims clicked. Containerized lint and runtime-independent unit test stages on earlier code head a3a3a6bd... had both SUCCESS in CI #44778202962 before cancellation by subsequent PR update; current latest full CI still running. This is a red witness of current unsafe behavior, not a green production safety invariant. No real mouse movement/application effects.

Second concrete seam: api/routers/lifecycle.py writes/deletes session.transition.json but does not visibly consume it in a restart reconciliation path, so caught-exception rollback cannot be assumed crash-safe. New SessionHandoverUnsafe TLC counterexample proves the abstract fail state is caught, not actual crash. Next source patch should implement durable startup reconciliation and bounded failure-injection on file+profile+broker seams. Do not hold an in-process lock through an unbounded OS input call to solve STOP_NOW; prefer epoch-fenced effect-admission with clear in-flight cancellation semantics, then port synthetic witness to deny post-revoke effect.

DLE status: exact source/workflow/negative evidence preserved; no private WinInspect source, external credentials, owner-owned hardware, private Actions spending, paid cloud, merge or release. #158 owner baseline 14/14 passed, #166 real HWND release gate and private #468 qualification remain held; #170 DRAFT until entire CI/real-code remediation reviewed.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 19:27+0100 FORMAL R3 — executable admission-epoch mitigation, source-test matrix, outstanding in-flight boundary

Current public draft PR #170 head 542f7bc8771a15912253ebe987145370598f38aa, source branch formal/cross-layer-atomicity-mvp-20261120, implements a bounded runtime corrective patch atop previous TLC and red-team findings:

  • api/core/broker.py now stores _authority_epoch and invalidates the generation on instance/session policy changes, update_session, grant, renewal and revoke_agent; the latter now locks its own RLock (safe reentrancy). New issue_input_ticket() captures a generation only when check_access() currently allows; validate_input_ticket() confirms same generation and current authority, including lease expiry, under broker lock.
  • api/routers/input.py click/key routes capture ticket before asynchronous search and recheck immediately before run_async_command or _send_keys. Stale session/revoke/expiry now produces HTTP 423 before backend admission.
  • tests/test_input_revocation_interleaving.py converted known-bad synthetic STOP_NOW mid-search witness from post-revoke "clicked" acceptance into required no synthetic mouse effect, HTTP 423. Added equivalent keyboard case and direct tests that session handover and lease expiry invalidate tickets. These are real Python router + real InputBroker interleavings with no external X11/Wine/desktop process.
  • formal/README.md now explicitly distinguishes closed reproduced predispatch window from unclosed in-flight native effect boundary: the client-side revalidation cannot cancel a subprocess already admitted, nor make external Wine/host input atomic. Do not describe as full STOP_NOW linearizability; consumer-side per-effect fencing/cancellation still remains future work.

Exact-head public free-tier cloud evidence: TLC/negative-control run #44793837457 terminal SUCCESS; BuildKit guard #44793837430 terminal SUCCESS; full CI #44793837531 still IN PROGRESS at "Containerized Linting" at readback. Do not falsely claim new code's unit suite full PASS before terminal confirmation. Earlier full CI #44778948657 failed in Conformance (Contracts) after preflight succeeded; existing PR #167 had similar 7 sanitized contract failures. Independently confirm baseline before attributing these to formal source. No forced reruns or broad expensive Wine builds.

Next: exact-head unit/CI first failure and correction; deterministic tests for lease renewal and user input override; commit-time consumer/source generation fencing for actual external processes; source-level fault injection for unfinished session-handover marker recovery. All docs/source/tests live in PR #170 DRAFT, no merge/release. Private WinInspect #468 C++/projection/executor admission, WineBot #166 native HWND and #158 MVP release gates remain unaffected. No private Actions minutes, secrets/source leak, paid service, user-owned hardware, or dispatch of actual input.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 19:27+0100 execution: two independent, source-owned corrective PRs for cross-layer atomicity

P0 broker input fencing, draft #170 current exact source 542f7bc8771a15912253ebe987145370598f38aa. Actual changes to api/core/broker.py introduce authority-generation tickets; all policy/session control changes, grant/renew/revoke invalidate generation; real api/routers/input.py mouse and key routes capture a ticket before asynchronous window lookup and verify it immediately before backend submission; all forged/stale/expired tickets are denied with 423. tests/test_input_revocation_interleaving.py now requires STOP_NOW-before-dispatch to produce no synthetic click or key action, and tests session turnover/lease expiry invalidation. Earlier red witness was intentionally converted to a green safety assertion. The design does NOT prevent already-spawned Wine/X11/AHK subprocess effects, and a later native consumer-side fence/cancel test remains mandatory. Formal/TLC #44793837457 SUCCESS; BuildKit guard #44793837430 SUCCESS; CI #44793837531 finished FAILURE solely at Conformance (Contracts), while Pre-flight (Lint & Unit) SUCCESS, Integration Smoke SUCCESS. CI output is sanitized and does not disclose failed IDs; same independent conformance failure previously occurred in #167 and is NOT proven caused by this patch. No merge or production effect claims.

P0 crash/restart handover, new independently-scoped draft PR #171 from current public main. Adds api/core/handover_recovery.py and api/server.py lifespan hook: on startup, after relinking profile and initializing broker, read only current active-session marker, verify exact in-root peer/op identity, active Wine user symlink, converge active state to current pointer, delete matched peer/active markers with directory fsync, quarantine mismatch/unsafe paths/malformed markers. Does not execute native Wine or attach private source. Eight synthetic tests/test_handover_restart_recovery.py scenarios cover crash before/after pointer, marker orphan, mismatch, external path, malformed data and replay. api/routers/lifecycle.py now verifies profile link during live resume and compensation, fsyncs marker directory after rename, retains marker after failed no-prior-owner activation for restart recovery. First CI #44795118460 FAILED solely lint Ruff F841 unused variable; fixed at exact current #171 head 4ff5ecd991158f2b46ac997b840776e07647bf3a. New exact-head CI #44795406130 IN_PROGRESS. No unit PASS claim until completed.

Safety / known limitations: link verifier is local symlink consensus, not an atomic transaction against arbitrary host process death. Unobserved incomplete intent in an inactive target still requires future namespace scanning/garbage collection. Current-pointer-forward recovery is a deliberate bounded policy; shutdown/recorder processes remain out of scope. Both drafts stay unmerged pending exact-head tests, independent code review and full product qualification. Formal TLA+ checked earlier covers abstract states only. Existing WinInspect private #468 source cloud admission and WineBot #166 actual native observer release gate unchanged. All compute public free GHA; no private Actions minutes, user hardware, paid service, private source projection, or production input.

Copy link
Copy Markdown
Collaborator Author

2026-11-20 19:27+0100 continued — R3 broker correction and R4 independent crash-recovery implementation

Broker, draft #170 exact head 542f7bc8771a15912253ebe987145370598f38aa: production InputBroker issues generation tickets bound to current grant/policy/session; revocation, STOP_NOW, session change, renewal invalidate them; mouse/key routes re-check generation and access directly before backend admission; real route-level mocked interleaving tests require HTTP 423 and NO synthetic click/key after STOP_NOW; tests cover lease expiration and session turnover. Exact TLC + adversarial counterexamples #44793837457 SUCCESS, BuildKit guard #44793837430 SUCCESS. Full CI #44793837531 terminal FAILURE: Pre-flight Lint+Unit SUCCESS, Integration smoke SUCCESS, Conformance Contracts FAILURE with intentionally sanitized failure evidence; similar failures were seen in #167, but attribution/baseline not proven. Do not merge until diagnosed; cannot claim in-flight external command cancellation or full distributed atomicity.

Crash/restart, independently scoped draft #171 current exact head 720f1dbe73b51f3bad5b85caddf62f168f359e2a. Added api/core/handover_recovery.py startup reconciliation: current active-session pointer remains sole authority; verify active Wine profile symlink and exact matching peer operation marker within same session root; commit active state, durably remove matched markers or fail closed/quarantine invalid/malicious peer. api/server.py lifespan invokes after relinking profile and syncing broker, before API ready. Live api/routers/lifecycle.py resume now verifies symlink instead of trusting silent helper errors, compensates previous profile link on rollback, fsyncs marker directory on rename, retains target intent if first-activation failure leaves current pointer with no previous owner. Tests use only synthetic temp files/symlinks, not real Wine. First CI 44795118460 failed Ruff F841 unused synthetic variable; fixed. Next 44795406130 lint PASS but unit suite exposed 2 legacy resume tests mocking old link_wine_user_dir seam; they bypassed new verifier and triggered controlled failure. Updated those test mocks to _link_profile_checked, preserving the production check, and added new real synthetic profile-link test that succeeds on correct symlink and detects silent stale-link failure. Current exact-head CI #44795909932 IN PROGRESS; do not claim new head green prematurely.

Boundaries and residuals: startup reconciliation only covers the marker reachable from current active pointer, does not scan orphan markers in inactive sessions, restart Wine/services, or finalize crashed recorder; it does NOT solve multi-process concurrency or in-flight remote input. Formal checking proves abstract model properties, not automatically runtime correctness. Both #170/#171 remain DRAFT and unmerged; #158 exact MVP baseline 14/14 previously green and native #166 with unqualified old WinInspect ZIP remain held. Private WinInspect #468 needs approved private source cloud admission/CTest/projection. All execution via existing free public GHA; no private Actions minutes, user-owned hardware, paid compute or unauthorized source publication.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:46+0100 — shared conformance provenance diagnostic and exact-head qualification

Confirmed: both unrelated independent correction PR heads reached Pre-flight (Lint & Unit) SUCCESS and Integration (Smoke Test) SUCCESS but terminal Conformance (Contracts) FAILURE: broker #170 542f7bc8771a15912253ebe987145370598f38aa CI 44793837531, recovery #171 720f1dbe73b51f3bad5b85caddf62f168f359e2a CI 44795909932. In both, conformance job checks out a separate moving default branch of mark-e-deyoung/winebot-contracts in .github/workflows/ci.yml without a recorded exact contract SHA. Current contracts main 205666f7f0235cb0fc51ca8a5af84f9f67831a74 has recent vNext assertion classification changes (fe3efd1f, 34d1c87a, etc.). Historical MVP #158 at 9809519b had CI 44666519926 SUCCESS, but its actual external contracts SHA was not pinned in source. This is a confirmed reproducibility deficiency and possible common cause of changed conformance verdict, NOT proof that the new contract revision caused the failures. Conformance log deliberately redirects full private/sensitive test details to local only and publishes sanitized summary artifact; do not expose raw failed test IDs or edit conformance to hide failure. Next method: explicitly qualify an exact contract ref on a separate diagnostic branch, compare exact contract SHA from successful vs failing run if available, and use a controlled same-SHA run to isolate source vs contract drift. Keep failed gating visible.

The unit/fixture defects in #171 have been addressed at exact head 720f1dbe73b51f3bad5b85caddf62f168f359e2a CI 44795909932 terminal aforementioned conformance FAIL (unit/smoke SUCCESS). No merge or release. Preserve PR #170/#171 independent authority and product gates, no private GHA spend.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:46+0100 independent diagnosis: exact external conformance source admission

Both independent cross-layer patches remain DRAFT and not merged: formal/broker #170 exact 542f7bc8 and crash-handover #171 exact 720f1dbe. Each has Pre-flight Lint+Unit SUCCESS, Integration Smoke SUCCESS, but Conformance (Contracts) FAILURE on full CI. The conformance job currently checks out mark-e-deyoung/winebot-contracts without ref, thus its evolving default-branch contents are not bound to the WineBot commit, compromising reproducibility. Historical owning #158 9809519b full CI 44666519926 SUCCESS does not establish the same external contract revision. Recent external contracts commits changed vNext test classification, but causal responsibility is not yet established.

Created separate public DRAFT diagnostic PR #172 based on otherwise unchanged main f5ba0256f330958dcf35710a822508cdb31fc40b, source exact HEAD 541f9765f4e6ba2469671646b66277b1d9a1d7a8. It only pins the external conformance checkout ref: 205666f7f0235cb0fc51ca8a5af84f9f67831a74 and disables persisted credentials. No contract assertions modified, no test skipped, no raw failure details published. New free public CI #44839445266 queued; source-independent public-safety workflows also queued. Compare exact SHA baseline verdict with same exact external contract SHA on #170/#171 before deciding contract authority and remedial code. Existing sensitive logs remain local/sanitized.

Release status unchanged: #158 baseline qualified but draft, #166 native WinInspect repaired executable not yet admitted; private #468 cloud-source C++ test/projection still blocked. Do not merge #170/#171/#172 or treat pinned ref as final authority without qualification. No paid/private runner, sovereign hardware, credentials, or private code used.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 ~00:50+0100 — second broker authorization bypass fixed, exact conformance baseline isolated

At prior formal/broker PR #170 542f7bc8, source inspection of api/core/broker.py::check_access revealed new tickets could still be issued after STOP_NOW in headless or agent-only sessions: after a human emergency stop the function returned through the implicit not interactive / policy shortcut before STOP_NOW veto. This is independent of the earlier stale-queued-ticket race; generation invalidation alone was insufficient to prevent a fresh post-revoke ticket.

Actual corrective changes on the same DRAFT #170 branch current exact head d00d2110c5d40d7f8862063a3d7901f215da96bd: check_access now checks STOP_NOW first, prior to any human-only/agent-only/headless shortcuts, revoking lingering agent state and returning false. tests/test_input_revocation_interleaving.py adds synthetic direct broker regression asserting headless/HYBRID and headless/AGENT_ONLY access permitted before STOP_NOW, then new ticket denied and old ticket invalid after STOP_NOW. Documentation updated. This is the bounded in-process input admission fix; not a claim of native in-flight cancellation/OS effect linearizability. Exact-head CI #44839600357, formal #44839600564 and BuildKit #44839600398 newly queued/in progress, no new exact-head PASS claim.

To diagnose common conformance failure without suppressing tests, created independently scoped DRAFT PR #172 from unchanged main@f5ba0256, exact head 541f9765f4e6ba2469671646b66277b1d9a1d7a8; only change to CI checkout is ref:205666f7f0235cb0fc51ca8a5af84f9f67831a74 for external mark-e-deyoung/winebot-contracts, plus no persisted credentials. This is diagnostic pin, NOT frozen contract authority or proposed test relaxation. Baseline CI #44839445266 in progress; record exact comparison when terminal before attributing #170/#171 conformance failures. Both prior PRs passed full pre-flight unit+lint and integration smoke but failed conformance on moving default contract source. Historical #158 baseline prior green but no external contract SHA attested. No private Actions, paid compute, local hardware, private source declassification, merges or releases.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:46+0100 — independent exact-contract baseline reproduced failure; custody admission implemented

Actual terminal baseline evidence: the source-only diagnostic draft PR #172, original candidate 541f9765f4e6ba2469671646b66277b1d9a1d7a8 based on otherwise unchanged main f5ba0256f330958dcf35710a822508cdb31fc40b, tested fixed external mark-e-deyoung/winebot-contracts@205666f7f0235cb0fc51ca8a5af84f9f67831a74. Real public CI #44839445266 terminal FAILURE with Pre-flight Lint/Unit SUCCESS, Integration Smoke SUCCESS, Conformance Contracts FAILURE. Its other independent public safety gates passed. Thus the baseline conformance failure is reproducible without any broker #170 or handover #171 runtime changes. This falsifies the hypothesis that either of those diffs is a necessary cause of the current common conformance failure. Exact underlying conformance assertion failure remains unclassified; do not presume contract source drift is the sole cause, or suppress any failures.

New exact-source custody improvement on PR #172 HEAD 7e6597eb8e31b677ae60e6c04f3ab9e838eeba1c: after checkout, CI explicitly compares git -C contracts rev-parse HEAD with authoritative diagnostic exact 205666f7f0235cb0fc51ca8a5af84f9f67831a74, checks a clean contracts checkout, fails closed on mismatch, and emits public-safe CONTRACTS_SOURCE=EXACT_COMMIT_VERIFIED / exact SHA plus a GitHub job summary. The test verdict remains separate and can still fail. New CI #44841649732 in progress at checkpoint; no claim of passed custody step yet. Do not treat chosen pin as approved permanent contractual authority. Pinning is a reproducibility diagnostic, not a workaround.

Broker PR #170 HEAD d00d2110c5d40d7f8862063a3d7901f215da96bd: fixed newly found STOP_NOW bypass for fresh tickets via non-interactive / agent-only mode early returns; check_access() now checks STOP_NOW before shortcuts. Added direct synthetic ticket issuance and invalidation tests for both headless HYBRID and AGENT_ONLY modes. Formal/TLC #44839600564 terminal SUCCESS. CI #44839600357 terminal FAILURE at Conformance Contracts with Pre-flight Unit/Lint and Integration Smoke both SUCCESS; independent unchanged baseline fails similarly. This still does not guarantee cancellation of an already-running external native input.

Handover PR #171 HEAD 720f1dbe73b51f3bad5b85caddf62f168f359e2a: independent fail-closed startup marker reconciliation and filesystem crash-point tests; exact CI #44795909932 unit/lint + smoke SUCCESS, conformance FAIL. All drafts unmerged; no private source/runner, hardware, paid compute, release, or bypass of WinInspect #468 C++/projection native admission gate.

Copy link
Copy Markdown
Collaborator Author

2026-11-21 00:27+0100 — authoritative conformance root cause and stacked formal integration

Important correction to earlier causal hypothesis: archived sanitized results and full GHA checkout traces now establish the SAME exact external contracts source mark-e-deyoung/winebot-contracts@205666f7f0235cb0fc51ca8a5af84f9f67831a74 for historical MVP #158 CI 44666519926 62 passed, 0 failed, 9 skipped, and for unmodified main + diagnostic #172 CI 44841649732 55 passed, 7 failed, 9 skipped, broker #170 CI 44839600357 55/7/9, and recovery #171 CI 44795909932 55/7/9. The prior narrative that contract-branch drift could explain these exact verdicts was not supported: #158's workflow already pins the same SHA and its logs prove checkout. #172 exact-source attestation also PASSED. The common seven failures reproduce on main in both unrelated branches and disappear in MVP's 108-commit integration diff. This does not identify exact failed assertions because the approved public summary deliberately redacts them. Never bypass sanitization or weaken contract assertions.

Architectural implication: PR #158 9809519b94b9074ed681b297237f6dec89d43186 already implements separate broker fixes: grants refuse stale challenges and duplicate active leases, session handover revokes ownership, and track_async_input() cancels registered asynchronous mouse and xdotool key operations on revocation. Main-based PR #170 had independently reimplemented some of this logic via epoch tickets and omitted the MVP's existing in-flight cancellation implementation, creating an integration fork rather than a safe replacement. Must integrate on canonical qualified #158 instead of attributing conformance failures to both PRs.

Actual integration executed: NEW stacked DRAFT PR #173, base mvp/ic1-integration-20261117@9809519b94b9074ed681b297237f6dec89d43186, head d254dd9a6912d0a37929710588aff76d08245aaa. Includes source-provenance copy of three blue TLA+ models (ControlLease, SessionHandover, ReleaseAdmission), two unsafe red-team TLC counterexample models, finite Python model contracts, pinned TLC public-GHA workflow, and a rewritten refinement/authority README. Minimal production api/core/broker.py correction puts STOP_NOW above headless/AGENT_ONLY shortcuts; synthetic regression additions in existing MVP tests/test_mvp_control_safety.py prove no fresh post-stop headless agent admission even if session policy toggles and an already-tracked async input task is cancelled. Preserves original MVP broker/native cancellation and 62/0/9 contract source; avoids duplicate main-based route rewrite.

First exact-head public GHA receipts: formal run #44843910305 terminal SUCCESS including all blue TLC models, both expected counterexample gates, and independent Python contracts; BuildKit #44843910200 SUCCESS. full CI #44843910364 IN_PROGRESS, no unit/conformance verdict yet. Other MVP native workflows may require separate qualified exact-head trigger; do not claim 14/14 on new head.

Disposition: #173 remains draft, unmerged; #170 becomes analysis/supersession source and should not merge into main, #171 needs independent crash-recovery source reconciliation against canonical MVP lifecycle (not blindly merged), #172 baseline diagnostic completed and may close after confirmed DLE/PR disposition. #166 live native WinInspect still requires private #468 C++ admission, authorized projection, pinned rebuilt ZIP and real HWND observation. No private GHA minutes, private source publishing, paid compute, physical input, merge or release.

Copy link
Copy Markdown
Collaborator Author

Supersession DLE — close duplicate main-based broker integration unmerged

The appropriate product base for formal/control admission is the already-qualified MVP PR #158 (9809519b..., frozen contract source 205666f..., historical 62/0/9), not main. Main-based #170 gave the correct formal models and exposed STOP_NOW ordering defects, but its independent epoch-ticket broker implementation would overwrite/compete with MVP's separately qualified single-active-lease, session handover and in-flight track_async_input cancellation semantics. The exact-source 7 conformance failures are present on unchanged main and not caused by #170 alone. The red/blue TLA+ files, mandatory counterexamples and relevant absolute STOP_NOW fix have been carried to stacked draft #173 with code-to-model refinement mapped to the MVP broker. Its formal #44843910305 and exact-head CI #44843910364 unit and Run conformance tests steps have passed; overall CI still in progress (vNext and integration). Close this superseded main-based PR without merge, preserving its full code and red-team receipts as historical DLE. Do not close or promote #173 until all required exact-head gates and review finish.

@mark-e-deyoung mark-e-deyoung changed the title [DRAFT FORMAL] TLC models for broker fencing, crash-safe handover, and release admission [SUPERSEDED / UNMERGED] Formal broker source migrated to MVP PR #173 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