Skip to content

Qualify native Windows saves with observed faults and complete record checks - #2301

Draft
abrichr wants to merge 6 commits into
mainfrom
feat/flow-windows-qualify
Draft

abrichr wants to merge 6 commits into
mainfrom
feat/flow-windows-qualify

Conversation

@abrichr

@abrichr abrichr commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Draft qualification support for native Windows saves. Refs #1701 and depends on #2313 (issue #2309). This change is not ready to merge or release.

qualify currently refuses Windows targets. This change adds the native environment observer, an authenticated opt-in fault agent, the normal case and five fault cases, and complete-record read-back for declared inserts or field updates. The native driver uses only the save's recorded locator and identity region. Its temporary overlays have no save handlers and require ordinary UIA and frame observations before producing mutation evidence.

The campaign preserves the observed executable and machine/OS boundary. An admission is not portable to arbitrary fresh workers. A script-hosted application's declared version still needs requalification when its code changes; hashing its interpreter does not hash its script. Production enablement and cloud resources are outside this PR.

Real Windows result

Run 44647393243 executed 18 trials on GitHub-hosted Windows:

  • Three normal trials were VERIFIED and independently read back as the exact SQLite update.
  • Fifteen fault trials halted and their independent snapshots showed no record changes.
  • Two ambiguity trials reached the intended native refusal with three matching UIA candidates. Other trials include premature stale-frame stops and a wrong-identity mutation that did not produce its required detector refusal.
  • Certification correctly refused incomplete exact fault evidence. No admission was issued.

The unanchored key's missing closed delivery evidence and native keyboard temporal binding are tracked in prerequisite #2313. The follow-up now changes the marked identity region, refuses missing regions and uses a v2 driver contract; it still needs the next real campaign. Native qualification now requires the real keyboard-lease capability. The next real campaign must pass all exact fault checks, three trials per case, and verify the resulting local admission's signature. The production verifier must continue to reject that local-dev signer.

Record oracle

The independent oracle checks complete before/after row multisets. Inserts may add only the selected rows. Updates may change only declared fields on uniquely selected existing rows. Changed siblings, missing/added/duplicate rows, undeclared fields and unavailable reads refuse. Unknown effects do not gain a successful qualification.

Validation

  • Focused qualifier, result and business-rule tests pass (92 in the initial group).
  • Generated update-state and planted record-fault controls pass (13 tests).
  • Native fault controller, transport and lab setup tests pass; the initial marked-region follow-up has 195 targeted passes, and its v2/lease-readiness follow-up has 52 focused passes.
  • Focused Ruff and mypy, engine generality, source boundary, file-size ratchet and workflow parsing pass.
  • The separate laptop attempt could not capture a frame and demonstrated no native fault. Its ordinary agent was restored with fault routes disabled and probe state removed.
  • Hosted AWS qualification, a staging VERIFIED receipt and a Flow release have not run.

Generality and durability

  1. No per-app engine code: native fault staging uses recorded locators, identity geometry, real UIA and physical frames. Application setup stays in fixtures/session hooks.
  2. Fix the class: one insert/update model covers the complete snapshot and row multiplicity. Native keyboard intent, observation and delivery use the separate unified model in Bind native keyboard input to one-shot focus leases #2313.
  3. Held-out evidence: generated numeric/null update transitions and collateral faults are covered. A held-out real application has not been demonstrated.

This advances independent effect verification and qualification of generated programs. Merge remains blocked on the prerequisite, exact real Windows fault proof, cross-vendor review and green CI.

# Conflicts:
#	.github/workflows/desktop-replay.yml
#	CAPABILITIES.md
#	packages/flow/CHANGELOG.md
#	packages/flow/openadapt_flow/backends/win_agent/server.py
#	packages/flow/scripts/desktop/winrm_lab.py
@abrichr
abrichr marked this pull request as ready for review November 23, 2026 22:34
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Gemini
Reviewed-Head: a6bc28e

What looks good

  • Generality & Durability: Generic Windows qualification observer/fault driver (qualify/windows.py, qualify/surfaces.py, qualify/record_oracle.py) with no per-app engine logic.
  • Security: AgentConfig.allow_qualification_faults defaults False and fails closed unless a bearer token is configured (server.py:2527-2528); _OVERLAY_PS passes parameters over stdin JSON rather than interpolating PowerShell; mutation receipts validate exact 32-hex IDs (windows_backend.py:1328-1334).

Blocking findings

  1. CAPABILITIES.md:268 (direct edit to generated file): This PR edits CAPABILITIES.md directly (+1/-0) instead of adding an entry under capabilities/ and letting scripts/build_capabilities.py manage the generated file (smoke / build_capabilities.py --check-pr fails on direct CAPABILITIES.md edits).
  2. Not ready for merge / missing live Windows CI proof: The PR body itself states "This change is not ready to merge or release" and depends on #2313, and CAPABILITIES.md:268 notes "real Windows campaign evidence required before release". Please either convert back to Draft until #2313 and desktop-replay.yml (test_windows_qualification_campaign.py) are green, or supply the live Windows campaign CI run and move the capability entry into capabilities/.

@abrichr
abrichr marked this pull request as draft November 24, 2026 09:52
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Moving to Draft during PR triage: the PR body notes it is not ready to merge until live Windows campaign evidence passes, and CAPABILITIES.md needs to be edited under capabilities/ instead of directly. Dependency #2313 is now merged; ready to undraft once those two items are completed.

This branch has not been deployed

No deployments
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