{"slug": "how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2", "title": "How To Build A Harness For Legal Work: Checks From The Task, A Cited Grid, Then Training (z2 v4)", "summary": "A developer rewrote memoforge, an open-source Claude Code plugin for drafting cited legal memos, moving phase control, budgets and state writes out of the orchestrator's prompt and into roughly 18,000 lines of Python backed by about 3,600 offline tests, after the first version consumed 95,000-110,000 tokens of pipeline prose per run and still dropped steps. The rewrite keeps the orchestrator protocol to about 150 lines and derives verification from the task's own artifacts, hashing saved sources and admitting quotes only on exact matches, with four reviewers answering yes/no checklists. The writeup also examines Legora's Tabular Review grid and Hugging Face's multi-harness RL guidance, which found identical weights solved 62 percent of held-out tasks in one harness versus 33 percent in another.", "body_md": "A harness is the program around a model that decides what it reads, which steps it runs and what counts as done. When your agent writes code, its harness borrows checks from tests and the compiler. A legal memo or a contract review has none to borrow. Two legal systems show what to build instead: memoforge, an open-source Claude Code plugin that writes cited memos, and Legora, an agentic platform for legal work.\n\nSo what must a harness supply when nothing can compile the output, and how do you train a model inside it? Take a data room of 100 contracts and one question: which ones let a buyer's takeover end the deal? Get it wrong and the report reads well, cites a clause no contract holds, and nobody knows which step was skipped.\n\nmemoforge's first version made its orchestrator read 95,000 to 110,000 tokens of pipeline prose on a full run, and it still dropped steps. Of 12 recorded incidents, 9 were a missed bookkeeping step. The rewrite moves phases, budgets and every state write into Python, backed by about 3,600 offline tests. Your orchestrator keeps a protocol of about 150 lines: ask for the next step, do it, report back. The price is about 18,000 lines of Python, five times the plan.\n\nBecause nothing compiles, the checks come from the task's own artifacts. Sources are saved and hashed before drafting, and a quote enters only if it matches that saved text exactly. Four reviewers then answer yes-or-no checklists instead of giving one overall score.\n\nThe platform's Tabular Review puts the work on a grid: documents as rows, questions as columns, each cell showing its source. A workflow can create that grid, search the web for case law and verify citations against a legal database. The agent then builds Word or Excel deliverables from its output. Lawyers mark rows reviewed and lock cells. In my reading, the grid is the centre and the contract tools work around its tabs: each cell is a claim someone checks, and the state lives in the grid.\n\nIts evals restore an Eval World, a snapshot of a matter's documents, records and permissions, so every run starts from the same state.\n\nThen train the model inside the harness you deploy, because the harness changes what it learns. Hugging Face's multi-harness guide puts a capture proxy between harness and model that records the token ids and logprobs RL needs. Before any training, the same weights solved 62 percent of held-out tasks in one harness and 33 percent in another. In a contract harness, I'd make the reward the checks it already runs: each cell's quote found in its source.\n\nSo the complete model has four parts. Build the verifier from the task's artifacts: saved sources, exact quotes, one cited cell per question. Let code own what must never be skipped: the steps, the record and the verdict. Give the agent a structured surface, rows and columns, instead of a transcript. Then train it in that harness, rewarded by those checks.\n\n#AgenticAI #AgentHarness\n\nSources:\n[1] Grigorii Moskalev, memoforge 2.0 (MIT), GitHub, 2026: [https://github.com/gregmos/memoforge](https://github.com/gregmos/memoforge)\n[2] Legora, Tabular Review: [https://legora.com/product/tabular-review](https://legora.com/product/tabular-review)\n[3] Legora, Workflows: [https://legora.com/blog/legora-workflows-the-orchestration-layer-for-legal-work](https://legora.com/blog/legora-workflows-the-orchestration-layer-for-legal-work)\n[4] Legora, Agent: [https://legora.com/product/agent](https://legora.com/product/agent)\n[5] Legora Engineering, \"Building scalable evals infrastructure for legal agents\": [https://legora.com/engineering/building-scalable-evals-infrastructure-for-legal-agents](https://legora.com/engineering/building-scalable-evals-infrastructure-for-legal-agents)\n[6] Kolavi, Niklaus et al. (Hugging Face), \"The ultimate guide to multi-harness RL\", 2026: [https://huggingface.co/spaces/FineEnvs/multi-harness-rl](https://huggingface.co/spaces/FineEnvs/multi-harness-rl)\n[7] GC AI, Legora review, 2026: [https://gc.ai/blog/legora-legal-ai-review](https://gc.ai/blog/legora-legal-ai-review)\nAgentic GraphRAG (O'Reilly): [https://www.amazon.com/Agentic-GraphRAG-Integrating-Knowledge-Enterprise/dp/B0GZ7CDCC7](https://www.amazon.com/Agentic-GraphRAG-Integrating-Knowledge-Enterprise/dp/B0GZ7CDCC7)", "url": "https://wpnews.pro/news/how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2", "canonical_source": "https://gist.github.com/AnthonyAlcaraz/41bfb15c75ab2d2ab27010df50c1d332", "published_at": "2026-10-02 16:02:05+00:00", "updated_at": "2026-10-30 15:48:39.552998+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-research", "developer-tools"], "entities": ["memoforge", "Legora", "Hugging Face", "Grigorii Moskalev", "Claude Code", "Kolavi", "Niklaus"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2", "markdown": "https://wpnews.pro/news/how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2.md", "text": "https://wpnews.pro/news/how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2.txt", "jsonld": "https://wpnews.pro/news/how-to-build-a-harness-for-legal-work-checks-from-the-task-a-cited-grid-then-z2.jsonld"}}