Skip to content

fix(windows): skip qmt key lifecycle for disabled broker provider - #128

Merged
Atlas2005 merged 1 commit into
mainfrom
hotfix-windows-bootstrap-provider-none-v1
Aug 1, 2026
Merged

fix(windows): skip qmt key lifecycle for disabled broker provider#128
Atlas2005 merged 1 commit into
mainfrom
hotfix-windows-bootstrap-provider-none-v1

Conversation

@Atlas2005

Copy link
Copy Markdown
Owner

Summary

Fixes Windows runtime bootstrap so that a disabled QMT provider does not
initialize, validate, read, or modify the retained QMT account-binding key.

When broker_provider=none:

  • QMT key initialization is skipped
  • QMT key validation is skipped
  • QMT key ACLs are not modified
  • Existing QMT configuration and key files are preserved
  • Missing or corrupt retained QMT keys do not block non-QMT runtime startup

When broker_provider=qmt_builtin_bridge, the existing strict key lifecycle
remains unchanged.

Root cause

bootstrap_windows_runtime_v1.ps1 previously called
Assert-QPAccountBindingKeyState and Initialize-QPAccountBindingKey
unconditionally.

On a machine with a retained historical QMT key, this reached Set-Acl,
which required SeSecurityPrivilege and terminated bootstrap even though
the effective provider was none.

Changes

  • Guard QMT key preflight with the resolved provider
  • Guard QMT key provisioning with the persisted provider
  • Add regression coverage for:
    • provider=none with an existing retained key
    • provider=none with a missing key
    • provider=none with a corrupt retained key
    • preservation of QMT configuration, key bytes, and ACL

Validation

macOS

  • Runtime tests: 24 passed, 5 skipped
  • Full suite: 1895 passed, 6 skipped
  • compileall: passed
  • git diff --check: passed

Windows real-machine validation

  • Targeted hotfix tests: 2 passed, 27 deselected
  • Bootstrap with -BrokerProvider none: passed
  • No Set-Acl or SeSecurityPrivilege failure
  • PostgreSQL: reachable and healthy
  • Grafana: reachable
  • Runtime Doctor: passed
  • Persisted broker provider: none
  • Historical QMT key existence: unchanged
  • Historical QMT key SHA256: unchanged

Scope

No changes to:

  • TDX signal bridge
  • trading logic
  • orders
  • account state
  • PaperTrade accounting
  • QMT enabled-provider security behavior
  • Docker Compose definitions

@Atlas2005
Atlas2005 force-pushed the hotfix-windows-bootstrap-provider-none-v1 branch from 9fdae63 to 7e0957d Compare August 1, 2026 03:35
@Atlas2005
Atlas2005 merged commit c0383f3 into main Aug 1, 2026
2 checks passed
@Atlas2005
Atlas2005 deleted the hotfix-windows-bootstrap-provider-none-v1 branch August 1, 2026 03:39
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