Skip to the content.

ZD Ultimate Legend Wrapper — technical architecture

Current as of v2.6.2 (2026-07-19). This is the repo’s technical architecture document.

What the app is

A local Windows configuration and lifecycle tool for the ZD Ultimate Legend controller. It reads and writes the controller’s onboard settings over standard USB HID feature reports, and layers a controller-health/lifecycle surface on top (restore points, health reports, wear ledger, module passports). It is deliberately NOT a remapper, virtual device, overlay, or background service.

Constraint architecture (enforced, not aspirational)

Ten product constraints define the design space: HID-only writes (MI_02 feature reports), no drivers, no virtual devices, no input injection, no game-process hooking, no background service, no automation (no macros/turbo/scripting), no network calls, ​ honest write reporting (every write reports its outcome; profile Apply then reads back and compares every readable field it attempted, refreshing on-screen state; Restore / Safe Import / inline-deadzone writes perform their own read-back checks; individual setting writes have narrower verification, while step-size and lighting writes inside profile Apply use field-specific verify/retry paths; back-paddle bindings are write-only), local-only data (%APPDATA%\ZDUltimateLegend\, plain JSON/JSONL).

Enforcement lives in the test suite, not in promises:

Package map (zd_app/)

Entry point: main_zd.py (wires real stores/services/executor; AppShell accepts injected fakes for tests). Version constants: zd_app/version.py.

Data directories

Test architecture

The public maintenance gate is a unittest suite. Services and most screen behavior are tested headlessly against a patched DearPyGui that records widget calls. The always-on Tier-1 font-pressure matrix is different: every cell launches a fresh subprocess with a real DearPyGui context and viewport; ZD_RENDER_MATRIX=full adds the broader Tier-2 cell set. Other real-DPG behaviors, including the modal law, also have isolated subprocess gates and manual bench tools under tools/. Suite conventions: system Python 3.12 with dearpygui installed (the release CI additionally runs the full suite on Python 3.13 — the runtime the release binaries ship with — before building); exit code 139 (or Windows’ signed/unsigned 0xC0000005 form after a complete OK summary) on teardown is a known DPG artifact, not a failure. Skip totals vary by environment: Tier-2 cells skip unless the full matrix is requested, and registered rendering-stack variants skip only when their exact known-finding signature matches. A timeout, unrelated assertion, changed signature, or unexpected success fails the matrix gate. Drift/parity/forbidden-phrase gates run as ordinary tests so they fail the build on violation.

Build & distribution

tools\build_release.ps1 → PyInstaller portable folder + ZIP + (when Inno Setup 6 is present) an installer EXE, plus SHA256SUMS.txt; tools\install_local.ps1 mirrors the freshest build to local-install\ and refreshes Desktop/Start-Menu shortcuts. Official release assets (v2.5.0+) are CI-built on Python 3.13 from the release tag and carry build-provenance attestations (gh attestation verify); there is no AuthentiCode code signing yet, and every release publishes hashes. No auto-update, no telemetry — matching the constraint architecture.

External tooling

The shipped app imports nothing outside zd_app/, main_zd.py, and the build tools — a boundary enforced by tests.