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.
This commit is contained in:
grabowski committed 2026-11-23 15:31:43 +07:00
1 parent ff716eb9d3
commit a4155548b8
24 files changed
+3004 -6

No files matched your search

+39
View File
@@ -248,6 +248,7 @@ dark at desktop and phone width, a commit and a push.
| 10 | One client list: a visa record becomes part of a client; People becomes the visa clients | planned Nov 21, 2026 |
| 11 | The conflict check and the other parties of a contract; the journal's last hash sent outside the server each day | built Nov 22, 2026 |
| 12 | Originals in our care (passports, signed contracts, deeds: where each one is) and the inbox that files a pile of scans | step 1 built Nov 23, 2026 |
| 13 | The other side reviews a draft through a link: crosses out, adds, highlights; we take their changes one by one | step 1 built Nov 23, 2026 |
| later | Thai user interface, agency cases and fees, other visa categories' packs | |
### Phase 1: app, login, people
@@ -843,6 +844,44 @@ and record, with a suggestion to confirm.
reminders once phase 8 sends them.
- Phase 10 (one client list) turns an original's person into a client.
## Phase 13: the other side reviews a draft (planned Nov 23, 2026)
Alex: when our lawyers draft a version, they send it to the other party
with a link; there the other party edits it and sends it back. It should
have an editor that crosses out words and highlights passages, and in the
end read like a git diff.
### Step 1: the review link and the marking editor (built)
- A lawyer sends a version with a text to one of the contract's parties
(Contract, Review by the other side). This makes a link for that party
(`/r/<token>`, shown once, as the client links; 30 days) or, when the
party has an open one, a new round on the same link, so the other side
keeps one address for the whole negotiation.
- The other side's page shows our version in an editor that keeps every
change visible, as tracked changes do: what they delete stays in place,
crossed out in red; what they type is marked in green; the highlighter
marks a passage in yellow with an optional comment. Restore takes a mark
back. They send it back with their name and a covering message, once per
round; the page then shows what they sent until our next version.
- What they send is a list of pieces (same, added, crossed out,
highlighted). The server checks that the pieces without the added ones
give exactly the version we sent: nothing can change unseen. Their text
and its SHA-256 are kept unchanged (migration 0014, a trigger), and the
journal records each send and each reply with the fingerprints.
- Our review page shows their markup and a git-style diff (lines taken out
and added, the changed words marked), with each change numbered. The
lawyer ticks the changes to take; the contract page then opens with the
version form filled with our text plus those changes, to finish and add
as the next version, which can go back to them in the next round.
### Step 2: later
- Comments both ways on a highlighted passage (a thread per mark).
- Mail the link and each new round from reminders@ (phase 8 mail).
- Signing the agreed text on the link (with the agreements' drawing pad).
- Versions kept only as a file (a PDF draft): the editor works on text.
## Open questions
1. B4L's BOI application: once B4L is promoted, its staff extend their stay