Property tests for what people paste and type; a one-letter given name
CI / secret scan (push) Successful in 6s
CI / fmt, clippy, tests (push) Successful in 1m21s
CI / release (push) Skipped

src/props.rs (proptest, 256 cases each, about 3 s of cargo test) holds
the rules every input must keep: any text reads as a passport zone
without a panic and two lines of zone characters always parse; a
composed zone reads back field by field; OCR finds the zone among other
lines in either order, in lower case and with spaces, and puts back
digits read as letters in the dates; a Thai number with its check digit
is valid and another check digit is not; same_name is symmetric and
ignores order and case; a kept position and its Google Maps and
OpenStreetMap links read back, a swapped pair is outside Thailand; a
form date is in range and reads back; normalize is idempotent and blocks
are never empty; a diff rebuilds both versions; any change to a journal
entry changes its hash, also text moved between two fields; the PDF's
line wrap keeps every letter and no line starts with a mark.

Their first run found a bug: the photo reader dropped a one-letter given
name, since a lone K, C, E or L in filler counts as a misread <. The
letter right after the << between the names is now kept (unit test
a_one_letter_given_name_is_kept; the shrunk cases are in
proptest-regressions/props.txt). 50,000 cases each pass.

proptest without fork and timeout (rust-version 1.88; the fleet builds
with 1.95). AGENTS.md says when to add one, PLAN has the fuzzing steps.
This commit is contained in:
grabowski committed 2026-11-23 09:34:46 +07:00
1 parent 62a37b677a
commit 7b5ec35e7c
9 files changed
+570 -1

No files matched your search

+25
View File
@@ -722,6 +722,31 @@ outside the server, the mails show later that nobody rebuilt the journal:
page) says whether the entry still has that hash, has another one, or is
gone. A Matrix room can be a second place for it once phase 8 has one.
## Tests that try every input (Nov 23, 2026)
The client link is open to anyone who has it, so the code that reads what
people paste and upload is tried with made-up input as well as with the
cases in the tests.
- [x] Property tests on every push (`src/props.rs`, proptest, about 3
seconds of `cargo test`): the passport zone (any text reads without a
panic, a composed zone reads back, OCR finds it among other lines and
puts back digits read as letters), Thai 13-digit numbers, names in the
conflict check, positions and their links, form dates, agreement texts,
the contract diff, the journal hash, and the PDF's line wrap. Their first
run found that the photo reader dropped a one-letter given name (the K of
SMITH<<K); fixed in `mrz::first_line`.
- [ ] Coverage-guided fuzzing every night (cargo-fuzz on nightly): uploaded
JPEG, PNG and WebP files through the pack's image code, uploaded PDFs
through krilla, the drawn signature's PNG, the passport zone, the
version form's multipart reader. Seed files from the demo data, the
grown corpus in the runner's cache, a crash fails the job with its input
as an artifact, and each crash becomes a case under `tests/fuzz_cases/`
that `cargo test` replays on every push.
- [ ] The nightly job runs only on the runner on hel01 (a label such as
`heavy` in cnx-network-clan), so fuzzing never takes cores from cnx01,
where the app runs.
## Open questions
1. B4L's BOI application: once B4L is promoted, its staff extend their stay