Commit Graph
2 Commits
Author SHA1 Message Date
grabowski a4155548b8 The other side reviews a draft (phase 13, step 1)
CI / secret scan (push) Successful in 5s
CI / fmt, clippy, tests (push) Successful in 49s
CI / release (push) Skipped
A lawyer sends a contract version to one of its parties with a link. On
it the other side marks the text up in an editor that keeps every change
visible, as tracked changes do: deleting our text crosses it out in red,
typing is marked as added in green, and the highlighter marks a passage
in yellow with a comment. Restore and Undo take marks back. They send it
back once a round; each later version comes on the same link.

- Migration 0014: review_links (token kept as a SHA-256, one open link a
  party) and review_rounds (the reply written once: their pieces, text,
  SHA-256, name, message; a trigger refuses any other change and every
  delete). Journal entries "sent for review", "review returned" (with the
  fingerprint of their text) and "review link closed"; audit entity
  "review".
- The reply is a list of pieces (same, ins, del, mark). The server checks
  that the pieces without the added ones are exactly the version sent, so
  nothing changes unseen (reviews::check).
- Our review page: their message, the changes numbered with the words
  around them and a box each, the highlights with comments, a git-style
  diff (line numbers, - and + lines, the changed words marked, three lines
  of context per hunk) and their markup. "Take the ticked changes" opens
  the contract page with the version form filled with our text plus those
  changes.
- static/review-editor.js: edits work on the pieces and redraw, so our
  text cannot vanish; keyboard compositions and edits the browser will not
  cancel are compared with the text and taken as edits.
- Property tests (any markup is accepted and taken back exactly; markup
  that changes our text unseen is refused), the fuzz text target runs
  reviews::check, integration tests, and the demo has the label's review
  of the recording agreement.
- PLAN: phase 13.
2026-11-23 15:31:43 +07:00
grabowski 7b5ec35e7c 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.
2026-11-23 09:34:46 +07:00