feat: run a Saved Legal Task from a Review Table row
Make the "Suggested Saved Legal Task" column actionable. When Gary suggests a recognized task for a document, a lawyer can launch that task in the assistant prefilled with the row's context. - suggestedTask.ts: maps the eight recognized task names to built-in Saved Legal Task ids. Matching tolerates whitespace, case, tag brackets, and trailing punctuation but is never fuzzy - an unrecognized value resolves to null rather than guessing. Also builds the row-context prompt (task name, matter, document name, extracted fields, and attorney-review safety language). - RunSuggestedTaskModal.tsx: a simple "Run Saved Legal Task?" confirmation with a prompt preview and Open in Assistant / Cancel. - TRSidePanel: shows a "Run Suggested Task" action - only on the Suggested Saved Legal Task column's cell, and only when the value resolves to a recognized task and the cell has finished generating. - TabularReviewView: resolves the row's suggested task, builds the row-context prompt from the row's other cells, and on confirm creates a chat, prefills an assistant draft, and opens it. - Prefill, not auto-run: a new newChatDraft channel on ChatHistoryContext carries a draft (content + workflow + attached document) that ChatInput seeds its initial state from. The lawyer reviews and sends manually - nothing is auto-submitted. ChatView renders an empty-with-draft chat instead of the loading skeleton. - The row's document is attached via the existing chat file mechanism; the document_id rides in the attachment, never in the visible prompt text. No raw internal ids appear in the prompt. - Safety: the prompt instructs Gary to treat the row as draft and unverified, use the uploaded document, not invent facts / dates / legal authorities / deadlines / parties, and flag uncertainty. - Docs: add "Running a Saved Legal Task from a Review Table" to the U.S. lawyer guide; add a terminology-map entry. - Tests: suggestedTask.test.ts covers the eight-task mapping (and that each id is a real assistant built-in), match tolerance, the no-fuzzy-match guarantee, blank/Unknown/None handling, the prompt's attorney-review language, Unknown fallbacks, and the absence of raw internal ids and legacy terminology.
| Repository | zgbrenner/gary |
|---|---|
| Author | Claude <noreply@anthropic.com> |
| Authored | |
| Parents | 0b6ee888 |
| Stats | 13 files changed , +799 , -9 |
| Part of | Review Table (Matter Document Review) and running tasks from rows |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-b01092b7.md
from inside the repo you want the change in.