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 (a normal Apply reports each field’s write outcome, then reads back and compares every readable field it wrote, refreshing on-screen state; Restore / Safe Import / inline-deadzone writes likewise read back and compare each readable field; step-size and lighting writes additionally verify/retry inline; 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

~3,134 unittest tests (v2.6.2). Services are tested headlessly; screens are tested against a patched DearPyGui that records widget calls (no real rendering — which is why real-DPG behaviors like the modal law are additionally pinned by the manual bench tool in 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 on teardown is a known DPG segfault artifact, not a failure. 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.