Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/proposals/contract-redline-job.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
status: accepted
status: in-progress
tracking: https://github.com/MODSetter/SurfSense/issues/2414
code:
- surfsense_local/backend/modules/jobs/
- surfsense_local/backend/worker/studio/job_run/
Expand Down Expand Up @@ -41,6 +42,13 @@ The runner `word-clauses/1` lives in the app beside `workbook-rows/1` and writes
- A change that fails any check goes to a person.
5. **Pre-flight.** The runner applies every change to a scratch copy with the engine's partial mode, so one bad anchor sends one point to a person instead of failing the run. One internal summary comment always applies, so a contract that already meets the playbook still saves a version.

## The runner's contract

- **Entry point.** One pure function with `fill_workbook`'s keyword arguments (`on_row`, `stop`, `embed`, `checker`, `settings`, `take_turns`), so the Studio worker and the eval harness call the same code. The pieces both runners need already sit outside `workbook_rows` on the work's branch (`modules/jobs/asking/`).
- **Config** (`job.json`, loaded by `word_clauses/config.py`, `BAD_JOB_CONFIG` on anything wrong): prompts (system, point, repair, check), review points (key, title, what a position covers, playbook queries, contract hints), verdicts, retrieval settings, `points_per_call`, and the firm settings the job declares.
- **Report:** `runner`, `model`, `checker`, `settings`, `seconds`, `points`, counts by verdict plus `skipped`, one `answers` entry per point (verdict, paragraphs, whether it changed, codes, playbook quote), and `exceptions` as five-item rows. It has no `sheets` and no confirm entries: tracked changes are already proposals.
- **Ops:** only the Word engine's `replace_text`, `insert_paragraphs`, `delete_paragraphs` and `add_comment`, in document order. When two points change one paragraph, the first keeps the change and the second goes to a person.

## The pack

The pack `surfsense-contract-redline` is private, signed and data only. It holds:
Expand All @@ -54,8 +62,8 @@ v1's review points are those of a non-disclosure agreement: what counts as confi

Every case is a real document. Each file's source, licence, retrieval date and sha256 are recorded in the private eval folder, beside the questionnaire's.

- **Contracts:** real NDAs whose clauses experts labelled against fixed statements of position, put into a `.docx` container without changing their text. Real standard agreements as published `.docx` files test the engine on real Word structure.
- **The firm's playbook:** a real published standard agreement. The firm's stance on each review point is read from its text by hand, recorded with the clause it rests on, and checked by the maintainer before any number is quoted.
- **Contracts:** real NDAs whose clauses experts labelled against fixed statements of position (ContractNLI, CC BY 4.0; CUAD v1, CC BY 4.0, for later contract types), put into a `.docx` container without changing their text. Real standard agreements as published `.docx` files test the engine on real Word structure.
- **The firm's playbook:** a real published standard agreement and playbook: the Bonterms Mutual NDA (CC BY 4.0) with its Playbook of Additional Terms (CC0), the strongest candidate found. The firm's stance on each review point is read from its text by hand, recorded with the clause it rests on, and checked by the maintainer before any number is quoted.
- **Gold:** each (contract, point) pair, from the experts' label and the firm's stance. For example, a point the firm requires that the contract contradicts is a change; one the contract does not mention is a missing term.
- **Scores:**
- verdict accuracy;
Expand Down
2 changes: 1 addition & 1 deletion plans/community-local/file-agent-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ measured on any model yet
place), so the claim is the combination, never "nobody else". Editing stays the free capability every job
writes through; the job is what is sold (item 3).
2. **The security questionnaire ships first, then RFPs from the same library;
the contract redline waits.** This plan's own trigger has fired: "a measured
the contract redline waits.** (**Revised 5 Nov 2026:** the contract redline now ships beside the questionnaire in the Business switch release, as an app runner on the shipped Word engine, without the `docxkit`/`crlib` fix: [ADR 0086](../../docs/adr/0086-the-contract-redline-ships-with-the-business-switch-on-the-word-engine.md).) This plan's own trigger has fired: "a measured
questionnaire engine in less time than the redline's remaining work". The
byte-preserving Excel revise engine shipped in 2.2.0, so the remaining
questionnaire work is roughly 8 to 16 weeks of S and M items (an estimate), while the redline still needs the clean-room
Expand Down
2 changes: 1 addition & 1 deletion plans/community-local/seo/08-b2b-artifact-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ forums and Upwork, and is cited inline. The product facts were checked against
ships: the Excel revise engine edits sheet XML and keeps charts, pivots and
macros byte for byte
([`excel.py`](../../../surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py)).
2. **It ships before the contract redline.** The redline's edge went in
2. **It ships before the contract redline.** (**Revised 5 Nov 2026:** the contract redline now ships beside the questionnaire in the Business switch release, as an app runner on the shipped Word engine, without the `docxkit`/`crlib` fix: [ADR 0086](../../../docs/adr/0086-the-contract-redline-ships-with-the-business-switch-on-the-word-engine.md).) The redline's edge went in
October: Microsoft's Copilot for Legal reviews against a playbook and writes
native tracked changes in Word
([MC1388706](https://mc.merill.net/message/MC1388706), 7 Oct), Clio added
Expand Down
Loading