# Development [Documentation](README.md) · [Architecture](ARCHITECTURE.md) · [Assurance](ASSURANCE.md) ## Toolchain Use Windows x64 and an **x64 Native Tools Command Prompt** with: - Visual Studio Build Tools: `ml64.exe` and `link.exe`. - A Windows 10 SDK: `rc.exe`, headers, and import libraries. - LLVM (`clang.exe` and `llvm-lib.exe`) for building the native ARM64 executable (`build_arm64.cmd`; see [ARM64.md](ARM64.md)). - Python 3 on PATH for static checks and differential/regression tests. - Windows PowerShell, Windows Installer, and `makecab.exe` for MSI checks. The application has no third-party runtime packages. The build still trusts the assembler, linker, SDK, Windows, and hardware; assembly does not eliminate that toolchain trust. The checked-in CI workflow also uses GitHub Actions. The build locates a Windows SDK under the standard Windows Kits directory. Inspect `build.cmd` if your toolchain uses a nonstandard installation. ## Build variants Run these from the repository root: | Command | Output and intended use | |---|---| | `build.cmd` | Normal executable; static checker failures are advisory | | `build.cmd strict` | Normal executable; checker nonzero exits fail the build | | `build.cmd release strict` | Reproducible x64 build (normalised by `tools\pe_normalise.py`, hash merged into `bin\SHA256SUMS.txt`) plus strict checks; use for release preparation | | `build_arm64.cmd release` | Reproducible native ARM64 build (`bin\vordr-arm64.exe`, normalised by `tools\pe_normalise.py`, hash merged into `bin\SHA256SUMS.txt`); see [ARM64.md](ARM64.md) | | `build.cmd probeio strict` | File-writing diagnostic verbs for synthetic tests | | `build.cmd dbg strict` | Debug traces and fault injection; includes probe I/O | | `build.cmd nohw strict` | Omits CET compatibility; keeps software checks | | `build.cmd dbg guishow` | Development-only GUI startup shortcut; never ship | Arguments are combinable. All variants overwrite `bin\vordr.exe` and write intermediates under `obj\`. `release` selects deterministic linker flags; it is not a prohibition on adding diagnostic flags. Never combine shipping builds with `dbg`, `probeio`, or `guishow`. Python 3 on `PATH` is mandatory for `strict` builds: `build.cmd strict` fails closed immediately if Python is absent rather than silently skipping its ten static source, ABI, resource, and documentation analyzers. ## Run diagnostics A normal build exposes `selftest` and `katreport`. Other diagnostic verbs are gated to test/debug builds. No master password or secret is accepted on the command line. ```bat bin\vordr.exe selftest python tests\verify_crypto.py --exe bin\vordr.exe ``` The GUI-subsystem executable may not wait or display output like a console program in every shell. The Python verifier captures its child process output. Use the supplied test driver for the complete suite. A `.vordr` path passed to the normal GUI is an import source, not a command-line unlock or a request to replace the configured vault. ## Tests that live outside the binary | Command | What it checks | Needs | |---|---|---| | `python tests\redteam.py bin\vordr.exe` | 13 deliberate fault-injection and hardening cases (19 assertions): fail-fast `0xFADE*` codes, `System32`-only DLL loading (`dllhijack`), and contained `0xC0000409` crash breadcrumbs | `dbg` build | | `python tests\verify_vault.py bin\vordr.exe` | An independent reader (own RFC 9106 Argon2id) decrypts real vaults from `docs/formats.md` alone; every region is tamper-checked; nonces differ per save | `probeio` or `dbg` | | `python tests\compattest.py bin\vordr.exe` | The frozen v0.2.3 vaults in `tests\fixtures` still open, with the same contents | `probeio` or `dbg` | | `tests\guitest.ps1` | A real Vordr window driven from outside (`tests\lib\gui.psm1`, 128+ checks): input limits, drawn scrollbars, 9 theme palettes, 17 backdrop modes, `WM_COPYDATA` rejection, screen-capture exclusion, lock while a dialog is open, what a lock wipes | `probeio` or `dbg`, an interactive desktop | | `python tests\arm64\test_arm64_e2e.py` *(+ `test_sha.py`, `test_blake2b_argon2.py`, `test_aesgcm.py`)* | Unicorn-emulated ARM64 unit crypto KATs, constant-time SHA traces, release `selftest` (`FEAT_RNG=0/1`), fail-closed `cpu_gate`, x64-identical `katreport`, 22 probeio KATs/fuzzers, and cross-arch `.vordr` vault interop | LLVM (`clang`/`llvm-lib`), Python `unicorn` | | `tools\verify_repro.ps1` | Two clean builds of both `vordr.exe` (x64) and `vordr-arm64.exe` (ARM64) are byte-identical, keep mitigations, and match `bin\SHA256SUMS.txt` | Release preparation | | `tools\compare.ps1 -Ref ` | The test fails on an older commit and passes on the working tree | git, the toolchain | Tests keep away from the user's own Vordr. A `probeio`/`dbg` build remaps HKEY_CURRENT_USER for its whole process onto `HKCU\Software\VordrGuiTest\`: - every probe verb (`seedtest`, `bktest`, `vopen` ...) runs under the name `cli`, so their saves' rollback counters no longer land in the real `HKCU\SOFTWARE\Vordr\Rollback`; - `Start-VordrTest` sets `VORDR_TEST_HKCU=` for a GUI instance, which also skips the single-instance hand-off, the global hotkey, the TPM and the secure desktop, and logs to `%TEMP%\vordr_guitest.log`; - `Start-VordrTest -Anim on|off` sets `VORDR_TEST_ANIM=1|0`, which overrides Windows' "Animation effects" switch for that instance, so a test sees the same motion on every machine. `guitest.ps1` runs its first instance with animation forced on and its second following Windows, and checks the second matches what Windows reports. If the remap cannot be set up, the instance exits `0xE0F7` instead of running against the real HKCU, and the harness checks that isolation is engaged (`g_testmode = 1`) before it types or presses anything. `Start-VordrTest` refuses an executable whose map has no `g_testmode` (a release build has no hooks). The scratch keys are deleted after each test and by `tests\run_all.cmd`. Probe files under `%TEMP%` and any `.lock` they leave are test data, not user data. `python tools\prune_rollback.py` lists rollback-mirror values in the real HKCU that are not the registered vault's (left by probe runs before the isolation above); `--delete` removes them after writing a .reg backup. Frozen fixtures are never regenerated. A new release that changes the format adds new fixtures beside the old ones; `tests\compattest.py` says how the v0.2.3 set was made. ## Full test gate: read before running **Run the full gate on a development machine or disposable VM with no real vault open.** `tests\run_all.cmd` forcibly stops processes named `vordr.exe`, recreates `%TEMP%\vordr_runall`, overwrites build outputs, and replaces matching MSI outputs in `bin\`. Do not run it during an editing or preview session. ```bat tests\run_all.cmd ``` The six stages are fault injection, strict build, self-tests, round-trip probes, crypto differential checks, and MSI build/verification. `--quick` skips fault injection. Because stage 2 runs `build.cmd strict`, Python 3 is required; `makecab`-less machines can skip stage 6, and headless build servers without an interactive desktop skip `layoutkat` (`0xE0F2`) and cursor-movement checks in `guitest.ps1`. Always inspect the stage output alongside the summary table. Logs are under `%TEMP%\vordr_runall`. The script rebuilds a normal executable after the probe stage; release preparation must separately build the exact reproducible artifact intended for publication. For a narrower persistence test with an existing probe build: ```bat python tests\verify_persistence.py --exe bin\vordr.exe ``` That harness uses fresh synthetic temporary files and does not stop a running Vordr instance. It exercises preview cleanup and short/long-path native export/import. It is not a replacement for the full GUI or release tests. ## Change workflow 1. Use a separate checkout when working with release tags or destructive tests. 2. Read the relevant module and its guide; preserve the Win64 calling convention and the shared frame/guard macros. 3. Add a regression for the failure mode, preferably with a negative control. 4. Run the relevant static checkers and a strict build with Python present. 5. Exercise the affected feature using a synthetic vault. 6. For GUI changes, check resize, DPI, focus, keyboard navigation, lock/unlock, and policy-disabled controls. Geometry checks alone do not establish usability. 7. Update documentation and record which tests ran or were skipped. Use [settings design](SETTINGS_DESIGN.md) when adding a setting, and [system items](SYSITEM_DESIGN.md) when adding per-vault metadata. Do not publish test vaults, real screenshots, clipboard contents, or crash dumps that may contain secrets. ## CI and releases [The build workflow](../.github/workflows/build.yml) runs on pushes, pull requests, manual dispatch, and a nightly schedule. It runs the six-stage gate, creates clean reproducible x64 (`vordr.exe`) and ARM64 (`vordr-arm64.exe`) release builds, packages and verifies the universal MSI, and uploads both `vordr-release` (`vordr.exe`, `vordr-arm64.exe`, `vordr-*.msi`, `SHA256SUMS.txt`) and `crypto-proof` artifacts. Stage logs are uploaded on failure. A CI artifact is not automatically a tagged release. Follow the [release checklist](RELEASE_CHECKLIST.md), including testing the exact MSI payload and preserving published hashes. ## Documentation checks Run `python tools\check_docs.py` to check local Markdown/HTML links, Markdown anchors, duplicate headings, code fences, and unexpected control characters. The checker does not fetch external links, execute examples, or validate security claims. Review those against their source separately. Its regression tests run without the application or Windows build tools: ```bat python -m unittest discover -s tests -p test_docs.py ```