Fix QR-code generation

This commit is contained in:
2026-10-27 21:21:14 +02:00
parent af2d061880
commit 4bb975f122
4 changed files with 669 additions and 66 deletions
+59
View File
@@ -0,0 +1,59 @@
# Milestone 13 acceptance evidence: compact terminal QR disclosure
Validated 2026-10-27T21:13:30+02:00 on the native
`x86_64-unknown-linux-gnu` development host. This is synthetic terminal
rendering evidence, not a manual scan or production integration result.
## Behavior and review
The QR renderer packs two vertical modules into one cell using space, `▀`,
`▄`, and `█`, with explicit black foreground and white background. It preserves
the encoded four-module quiet zone on all four edges and treats the absent
partner of an odd final row as light. The QR is rendered in a separate,
unwrapped region. The fit check accounts for its bordered area and actual
wrapped delivery notice. A deterministic nonsecret 73-module fixture uses
73 columns and 37 QR rows; with a one-row notice, the exact tested terminal
layout is 75×44. Longer notices require more terminal height.
When the complete QR does not fit, a compact fallback shows required and
available dimensions, actual terminal dimensions, saved-file guidance, delivery
status, and Esc. Tests inspect rendered buffers at 74×45, 34×12 and 20×8;
resize redraws the held QR and Esc clears it. The compact notice preserves
uncertain publication and destination-inspection guidance. File delivery,
password authorization, and draft/saved/applied transitions were not modified.
`QrCodeOutput` retains redacted Debug and the fixture matrix is nonsecret.
An independent GPT-6-Luna/high reviewer examined the actual changes and
closed M13-R1–R5 after targeted repairs: short fallback clipping, hidden
saved/applied summary, incomplete quiet-zone edge coverage, inaccurate
available-area dimensions, and misleading uncertain-delivery compaction. No
actionable scoped findings remain.
## Commands and source identity
Pinned rustc/Cargo 1.97.1, rustfmt 1.9.0, and Clippy 0.1.97 were verified.
The following commands ran from the repository root and exited 0:
- `cargo test --locked tui::render::tests::`: 27 passed.
- `cargo test --locked delivery::qr::tests::`: 2 passed.
- `cargo fmt --all -- --check`.
- `cargo clippy --locked --all-targets -- -D warnings`.
- `cargo test --locked`: 352 passed, 3 explicitly ignored, 0 failed,
including 2 documentation tests.
- `cargo build --locked --release`.
- `git diff --check`.
Base commit: `af2d061880a8532314f57d4f1ec6eb5265520091`. Dirty Rust inputs
at validation were `src/tui/render.rs` and `src/delivery/qr.rs`; `PLANS.md`
was also dirty with this milestone's execution record. SHA256 inputs:
- `src/tui/render.rs`: `98ffa4d396194c201cfe20b6c6dcbd80b6689886fc625c8cb83efa6c12564e8a`
- `src/delivery/qr.rs`: `1f2012c6d1583178ca964df1d444c8afeae35607dfafac05bc538911be480748`
Native release artifact `target/release/wireguard-admin` SHA256:
`0c2fc010138c7db27c3126d0eca6bd83da3be600c1c4e0f8c8beeef77d11e43a`.
No physical terminal, phone/decoder scan, Alpine integration rerun, disposable
systemd VM, or production operation was performed. The 80×24 size remains a
dimensioned fallback for a 73-module QR. Previous integration artifacts do not
identify this revision; M9 systemd acceptance remains retired and unverified.