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

+5
View File
@@ -0,0 +1,5 @@
{#- A marked-up text: unchanged, added (green), crossed out (red), highlighted
(yellow, its comment on hover and after it); each change numbered. -#}
{% macro marked(shown, id="rv-marked") -%}
<div class="rvtext" id="{{ id }}">{% for p in shown %}{% if p.n %}<sup class="rvn" aria-label="change {{ p.n }}">{{ p.n }}</sup>{% endif %}{% if p.op == "ins" %}<ins>{{ p.text }}</ins>{% elif p.op == "del" %}<del>{{ p.text }}</del>{% elif p.op == "mark" %}<mark{% if p.comment %} title="{{ p.comment }}"{% endif %}>{{ p.text }}</mark>{% if p.comment %}<span class="rvc">{{ p.comment }}</span>{% endif %}{% else %}{{ p.text }}{% endif %}{% endfor %}</div>
{%- endmacro %}