From 7583a6cc9e98f9fcc4e45dab94acf39bb10f62d4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RTLN3BA\\$punk" Date: Thu, 5 Nov 2026 21:28:51 -0800 Subject: [PATCH] docs(jobs): record where the contract redline work stands The proposal is in progress, tracked in #2414, names its real-data candidates (ContractNLI, CUAD, the Bonterms Mutual NDA and its playbook) and gains the runner's contract. Plans 08 and the file-agent strategy note that ADR 0086 moved the redline to the Business switch release. --- docs/proposals/contract-redline-job.md | 14 +++++++++++--- plans/community-local/file-agent-strategy.md | 2 +- plans/community-local/seo/08-b2b-artifact-jobs.md | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/proposals/contract-redline-job.md b/docs/proposals/contract-redline-job.md index d77e8ae833..b417eec5cb 100644 --- a/docs/proposals/contract-redline-job.md +++ b/docs/proposals/contract-redline-job.md @@ -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/ @@ -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: @@ -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; diff --git a/plans/community-local/file-agent-strategy.md b/plans/community-local/file-agent-strategy.md index 88b7f5beb6..43f1407ac6 100644 --- a/plans/community-local/file-agent-strategy.md +++ b/plans/community-local/file-agent-strategy.md @@ -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 diff --git a/plans/community-local/seo/08-b2b-artifact-jobs.md b/plans/community-local/seo/08-b2b-artifact-jobs.md index ef2cf380c6..0f60578011 100644 --- a/plans/community-local/seo/08-b2b-artifact-jobs.md +++ b/plans/community-local/seo/08-b2b-artifact-jobs.md @@ -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