{"openapi":"3.1.0","info":{"title":"העלאת מסמכים משפטיים","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Index","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/upload":{"post":{"summary":"Upload File","description":"Upload a file to the temporary uploads directory.","operationId":"upload_file_api_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/uploads":{"get":{"summary":"List Uploads","description":"List files in the uploads (pending) directory.","operationId":"list_uploads_api_uploads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/uploads/{filename}":{"delete":{"summary":"Delete Upload","description":"Remove a file from the uploads directory.","operationId":"delete_upload_api_uploads__filename__delete","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/classify":{"post":{"summary":"Classify File","description":"Classify a pending file and start processing.","operationId":"classify_file_api_classify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/analyze":{"post":{"summary":"Training Analyze","description":"Proofread an uploaded file and extract metadata for review.\n\nInput: filename in UPLOAD_DIR (from /api/upload).\nOutput: clean text preview + extracted metadata (number, date, categories).","operationId":"training_analyze_api_training_analyze_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_training_analyze_api_training_analyze_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/upload":{"post":{"summary":"Training Upload","description":"Upload a proofread file to the style corpus.\n\nRuns proofreading again to guarantee clean text (not raw file content),\nthen inserts into style_corpus + chunks + embeddings.","operationId":"training_upload_api_training_upload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/patterns":{"get":{"summary":"Training Patterns","description":"List all extracted style patterns, grouped by type.","operationId":"training_patterns_api_training_patterns_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/analyze-style":{"post":{"summary":"Training Analyze Style","description":"Kick off style analysis over the corpus. Returns immediately.","operationId":"training_analyze_style_api_training_analyze_style_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/analyze-style/status":{"get":{"summary":"Training Analyze Style Status","description":"Poll status of the running style analysis.","operationId":"training_analyze_style_status_api_training_analyze_style_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/style-report":{"get":{"summary":"Training Style Report","description":"Visual dashboard data for Dafna's Style Portrait page.","operationId":"training_style_report_api_training_style_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/compare":{"get":{"summary":"Training Compare","description":"Compare two decisions from style_corpus by ID.\n\nReturns side-by-side data: basic metadata, length, section breakdown,\nwhich patterns appear in each, shared/unique patterns.","operationId":"training_compare_api_training_compare_get","parameters":[{"name":"a","in":"query","required":true,"schema":{"type":"string","title":"A"}},{"name":"b","in":"query","required":true,"schema":{"type":"string","title":"B"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/corpus/{corpus_id}":{"delete":{"summary":"Training Corpus Delete","description":"Remove a decision from the style corpus.","operationId":"training_corpus_delete_api_training_corpus__corpus_id__delete","parameters":[{"name":"corpus_id","in":"path","required":true,"schema":{"type":"string","title":"Corpus Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Training Corpus Patch","description":"Update metadata fields on a corpus row. Only provided fields are touched.","operationId":"training_corpus_patch_api_training_corpus__corpus_id__patch","parameters":[{"name":"corpus_id","in":"path","required":true,"schema":{"type":"string","title":"Corpus Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingCorpusPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/corpus":{"get":{"summary":"Training Corpus List","description":"List all decisions currently in the style corpus, with enriched metadata.\n\nJoins to ``documents`` via FK when available, falling back to the\ntitle-token match used in the chunking pipeline so legacy rows with\n``style_corpus.document_id IS NULL`` still resolve to their page_count\nand chunk counts.","operationId":"training_corpus_list_api_training_corpus_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/chat/conversations":{"post":{"summary":"Chat Create Conversation","description":"Create a new style-agent chat conversation.","operationId":"chat_create_conversation_api_training_chat_conversations_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatConversationCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Chat List Conversations","operationId":"chat_list_conversations_api_training_chat_conversations_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/chat/conversations/{conv_id}":{"get":{"summary":"Chat Get Conversation","operationId":"chat_get_conversation_api_training_chat_conversations__conv_id__get","parameters":[{"name":"conv_id","in":"path","required":true,"schema":{"type":"string","title":"Conv Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Chat Delete Conversation","operationId":"chat_delete_conversation_api_training_chat_conversations__conv_id__delete","parameters":[{"name":"conv_id","in":"path","required":true,"schema":{"type":"string","title":"Conv Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/chat/conversations/{conv_id}/messages":{"post":{"summary":"Chat Send Message","description":"Send a user message; stream the assistant response as SSE.\n\nProxies through ``web.chat_proxy.stream_chat_message`` to the\nlegal-chat-service running on the host.","operationId":"chat_send_message_api_training_chat_conversations__conv_id__messages_post","parameters":[{"name":"conv_id","in":"path","required":true,"schema":{"type":"string","title":"Conv Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/chat/health":{"get":{"summary":"Chat Health","description":"Probe legal-chat-service liveness from inside the container.\n\nUseful when the UI wants to gracefully degrade (\"שירות הצ'אט אינו\nזמין\") instead of letting messages fail mid-stream.","operationId":"chat_health_api_training_chat_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/curator/prompt":{"get":{"summary":"Get Curator Prompt","description":"Return the hermes-curator agent's prompt (read-only) + Gitea source URL.\n\nThe file is the canonical source of how the curator analyzes Daphna's\nfinal decisions. Changes go through git/Gitea, not the UI — the UI just\nsurfaces it for transparency.","operationId":"get_curator_prompt_api_training_curator_prompt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/scripts/catalog":{"get":{"summary":"Get Scripts Catalog","description":"Return the maintained ``scripts/SCRIPTS.md`` catalog (read-only).\n\n``scripts/SCRIPTS.md`` is the single source of truth describing every\nscript under ``scripts/`` — its role, type, and schedule (CLAUDE.md\nmandates updating it on any add/remove/change). The UI just surfaces it\nat ``/scripts`` for transparency; edits go through git/Gitea, not here.","operationId":"get_scripts_catalog_api_scripts_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/curator/style-analyzer-prompt":{"get":{"summary":"Get Style Analyzer Prompt","description":"Return the system prompt that style_analyzer.py uses to extract patterns.\n\nSurfaces the *training-time* prompt (Claude Opus 1M context) so the\nchair can compare it against the curator's post-export prompt. Both\nare shown side-by-side in the curator-portrait tab.","operationId":"get_style_analyzer_prompt_api_training_curator_style_analyzer_prompt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/curator/stats":{"get":{"summary":"Get Curator Stats","description":"Aggregate over the THREE learning channels that feed the writer, for the\n/training \"אוצֵר\" tab. Each channel is surfaced honestly with its real\nbacking store and how much of it actually reaches the writer:\n\n  A. distillation — Claude draft↔final diff → methodology overrides\n     (appeal_type_rules['_global']). Folded items flow to the writer now.\n  B. panel — DeepSeek+Gemini 2/2 vote → decision_lessons\n     (source='panel:deepseek+gemini'). Flow to the writer only once the\n     chair approves (review_status='approved', INV-LRN1/G10).\n  C. curator — the agent's Opus-read qualitative findings → decision_lessons\n     (source='curator'). Same chair gate as the panel.\n\nEarlier this endpoint counted ONLY source='curator' and reported it as the\nwhole story, so it read 0 while the panel/methodology channels carried all\nthe real learning. The card was measuring a column nothing wrote (the agent\nposted findings as Paperclip comments, never as decision_lessons — a\nspec↔impl drift since closed). It now reports all three (INV-IA2/IA5).","operationId":"get_curator_stats_api_training_curator_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/training/curator/proposals":{"get":{"summary":"List Curator Proposals","description":"List proposed-change files in data/curator-proposals/, newest first.","operationId":"list_curator_proposals_api_training_curator_proposals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Curator Proposal","description":"Save a proposed change to the curator prompt as a file on disk.\n\nNo automatic commit, no overwrite — the chair (chaim) reviews the\nfile manually and applies it through git. This is intentional: the\nprompt is too load-bearing to mutate from a web UI.","operationId":"create_curator_proposal_api_training_curator_proposals_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CuratorProposal"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/corpus/{corpus_id}/lessons":{"get":{"summary":"List Corpus Lessons","operationId":"list_corpus_lessons_api_training_corpus__corpus_id__lessons_get","parameters":[{"name":"corpus_id","in":"path","required":true,"schema":{"type":"string","title":"Corpus Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Add Corpus Lesson","operationId":"add_corpus_lesson_api_training_corpus__corpus_id__lessons_post","parameters":[{"name":"corpus_id","in":"path","required":true,"schema":{"type":"string","title":"Corpus Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/lessons/{lesson_id}":{"patch":{"summary":"Patch Corpus Lesson","operationId":"patch_corpus_lesson_api_training_lessons__lesson_id__patch","parameters":[{"name":"lesson_id","in":"path","required":true,"schema":{"type":"string","title":"Lesson Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Corpus Lesson","operationId":"delete_corpus_lesson_api_training_lessons__lesson_id__delete","parameters":[{"name":"lesson_id","in":"path","required":true,"schema":{"type":"string","title":"Lesson Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/training/corpus/{corpus_id}/full-text":{"get":{"summary":"Training Corpus Full Text","description":"Return the proofread full_text for a single corpus row.\n\nKept out of the list endpoint because full_text is large (50K-650K chars\nper decision) and the table view only needs counts. The drawer fetches\nit on demand when the chair opens the \"content\" tab.","operationId":"training_corpus_full_text_api_training_corpus__corpus_id__full_text_get","parameters":[{"name":"corpus_id","in":"path","required":true,"schema":{"type":"string","title":"Corpus Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/system/tasks":{"get":{"summary":"System Tasks","description":"List all active background tasks (one-shot).","operationId":"system_tasks_api_system_tasks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/system/tasks/stream":{"get":{"summary":"System Tasks Stream","description":"SSE stream — pushes active-task snapshots when anything changes.\n\nReplaces client-side polling. Clients connect once and receive\nevents whenever the task set changes. A short keepalive runs every\ntick so proxies flush HTTP/2 frames promptly.","operationId":"system_tasks_stream_api_system_tasks_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/progress/{task_id}":{"get":{"summary":"Progress Stream","description":"SSE stream of processing progress for a single upload task.\n\nBehavior:\n  • Late subscribers (task already cleaned up) get a terminal\n    ``{\"status\":\"unknown\"}`` payload and a clean stream close — never\n    a 404. EventSource treats 404 as a transient error and reconnects\n    forever, leaving the UI stuck on the placeholder; we avoid that.\n  • A heartbeat is emitted every iteration so HTTP/2 framing in the\n    proxy chain flushes immediately. The previous 30-second silent\n    tail after completion (and the proxy buffering it caused) was\n    the original cause of stuck-spinner uploads.\n  • Cleanup is delegated to Redis TTL — the store auto-expires\n    entries after PROGRESS_TTL_SECONDS, so we don't hand-roll any\n    post-completion sleep here.","operationId":"progress_stream_api_progress__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/status-model":{"get":{"summary":"Api Status Model","description":"Canonical case-status model — ordered statuses (key/label/description/\nphase/selectable/terminal/on_enter) + the 5 phases. Single source of truth\n(legal_mcp/case_status_model.py); the frontend case-status.ts mirrors it.","operationId":"api_status_model_api_status_model_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/cases":{"get":{"summary":"List Cases","description":"List existing cases. By default excludes archived (use include_archived=true\nor archived_only=true to see them). With detail=true, includes doc counts.","operationId":"list_cases_api_cases_get","parameters":[{"name":"detail","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Detail"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"archived_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Archived Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Api Case Delete","description":"Delete a case, identified by case_number in the query string.\n\nUses a query param (not a path segment) because case numbers may contain\ncharacters like `/` that FastAPI path routing cannot capture even when\nURL-encoded (%2F). Dependent documents/chunks/qa_results cascade via\nFK ON DELETE CASCADE; audit_log rows nullify their case_id.\nPass `remove_files=true` to also rm -rf the on-disk case directory.","operationId":"api_case_delete_api_cases_delete","parameters":[{"name":"case_number","in":"query","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"remove_files","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Remove Files"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/stale":{"get":{"summary":"Api Stale Cases","description":"Return cases that haven't been updated in N days and are not in a terminal/waiting status.","operationId":"api_stale_cases_api_cases_stale_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/archive":{"post":{"summary":"Api Archive Case","description":"Move a case to the archive. Also archives the matching Paperclip project.","operationId":"api_archive_case_api_cases__case_number__archive_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/restore":{"post":{"summary":"Api Restore Case","description":"Restore an archived case. Also restores the matching Paperclip project.","operationId":"api_restore_case_api_cases__case_number__restore_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/create":{"post":{"summary":"Api Case Create","description":"Create a new appeal case.","operationId":"api_case_create_api_cases_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/git-status":{"get":{"summary":"Api Case Git Status","description":"Git sync status for a case repo.","operationId":"api_case_git_status_api_cases__case_number__git_status_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/details":{"get":{"summary":"Api Case Get","description":"Get full case details including documents.","operationId":"api_case_get_api_cases__case_number__details_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}":{"put":{"summary":"Api Case Update","description":"Update case details.","operationId":"api_case_update_api_cases__case_number__put","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/status":{"get":{"summary":"Api Case Status","description":"Get full workflow status for a case.","operationId":"api_case_status_api_cases__case_number__status_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search":{"get":{"summary":"Api Search","description":"Semantic search across decisions and documents.","operationId":"api_search_api_search_get","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"section_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Section Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/search":{"get":{"summary":"Api Case Search","description":"Semantic search within a specific case's documents.","operationId":"api_case_search_api_cases__case_number__search_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/cases":{"get":{"summary":"Api Search Cases","description":"Lightweight SQL search over cases — by case number, address, parties, title.\n\nPowers the global-search dropdown in the header. Returns small projections,\nnot full case objects.","operationId":"api_search_cases_api_search_cases_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/template":{"get":{"summary":"Api Case Template","description":"Get outcome-aware decision template for a case.","operationId":"api_case_template_api_cases__case_number__template_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/processing-status":{"get":{"summary":"Api Processing Status","description":"Get overall processing status.","operationId":"api_processing_status_api_processing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/system/diagnostics":{"get":{"summary":"System Diagnostics","description":"System health snapshot: DB counts, recent failures, task queue.","operationId":"system_diagnostics_api_system_diagnostics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/system/recent-activity":{"get":{"summary":"System Recent Activity","description":"Derive a feed of recent events from cases + style_corpus + style_patterns.\n\nEach event has: type, label, timestamp, target.","operationId":"system_recent_activity_api_system_recent_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":8,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/outcome":{"post":{"summary":"Api Set Outcome","description":"Set the decision outcome (from Dafna) and optional reasoning.","operationId":"api_set_outcome_api_cases__case_number__outcome_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/claims":{"get":{"summary":"Api Get Claims","description":"Get extracted claims for a case, grouped by party.","operationId":"api_get_claims_api_cases__case_number__claims_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/aggregate-arguments":{"post":{"summary":"Api Aggregate Arguments","description":"Queue claim→argument aggregation by waking the legal-analyst agent.\n\nThe aggregation itself calls `claude_session.query_json()`, which shells\nout to the local `claude` CLI — present on the agent host, **absent in\nthis FastAPI container**. Running it inline as a BackgroundTask (the old\nbehaviour) silently produced nothing, and on `force` it destructively\ndeleted the existing arguments *before* the doomed LLM call. So we\ndelegate to the analyst exactly like `extract-appraiser-facts`: create a\nchild Paperclip issue, assign it to the company's analyst, and trigger a\nwakeup. The analyst runs the MCP tool locally and posts results.\n\nCheap in-container pre-checks (DB only, no LLM) short-circuit before any\nagent is spun up:\n  - `no_claims`  — there are no raw claims to aggregate yet.\n  - `exists`     — arguments already computed and `force` is False.\n\nResponse shape:\n    {\"status\": \"queued\", \"sub_issue_id\", \"analyst_id\", \"main_issue_id\"}\n  or {\"status\": \"no_claims\"|\"exists\", \"total\", \"message\"}\n  or {\"status\": \"skipped\", \"reason\": \"no_api_key\"|\"no_analyst\"|\"no_issue\"}","operationId":"api_aggregate_arguments_api_cases__case_number__aggregate_arguments_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/legal-arguments":{"get":{"summary":"Api Get Legal Arguments","description":"Return aggregated legal arguments for a case, grouped by party.","operationId":"api_get_legal_arguments_api_cases__case_number__legal_arguments_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"party","in":"query","required":false,"schema":{"type":"string","default":"","title":"Party"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/protocol-analysis":{"get":{"summary":"Api Get Protocol Analysis","description":"Hearing-protocol comparative analysis for the \"מה קרה בדיון\" panel (#226).\n\nRead-only surface over the case-knowledge produced by ``analyze_protocol``:\nthe hearing header (date + who appeared, from the canonical case columns)\nplus the per-argument verdicts (strengthened / newly_raised / dropped)\ngrouped by party. Container-safe — pure DB reads, no LLM. Returns an empty\nanalysis (not an error) when the analysis has not been run yet.","operationId":"api_get_protocol_analysis_api_cases__case_number__protocol_analysis_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/analyze-protocol":{"post":{"summary":"Api Analyze Protocol","description":"Queue hearing-protocol analysis by waking the legal-analyst agent (#226).\n\nSame delegation rationale as ``aggregate-arguments``: ``analyze_protocol``\ncalls the local ``claude`` CLI, absent in this container, so we route to the\ncompany's analyst rather than running a doomed in-container BackgroundTask.\n\nResponse: {\"status\": \"queued\", ...} or {\"status\": \"skipped\", \"reason\": ...}.","operationId":"api_analyze_protocol_api_cases__case_number__analyze_protocol_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"document_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/direction":{"post":{"summary":"Api Set Direction","description":"Save the approved direction document for the discussion block.","operationId":"api_set_direction_api_cases__case_number__direction_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/qa":{"post":{"summary":"Api Run Qa","description":"Run QA validation on a drafted decision.","operationId":"api_run_qa_api_cases__case_number__qa_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/decision-blocks":{"get":{"summary":"Api Get Decision Blocks","description":"Return all 12 decision blocks as JSON (empty blocks included).\n\nRead path for the interactive block viewer — content lives in\ndecision_blocks but was previously only reachable via DOCX export.","operationId":"api_get_decision_blocks_api_cases__case_number__decision_blocks_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/decision-blocks/{block_id}":{"put":{"summary":"Api Update Decision Block","description":"Save inline-edited content for a single decision block.\n\nWrites to decision_blocks (upsert, status='draft') and rebuilds the\non-disk decision.md. Creates a decision row if none exists yet.","operationId":"api_update_decision_block_api_cases__case_number__decision_blocks__block_id__put","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/learn":{"post":{"summary":"Api Learn","description":"Trigger learning loop — compare draft to final version.","operationId":"api_learn_api_cases__case_number__learn_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/local-files":{"get":{"summary":"Api Local Files","description":"List local files across ALL content subfolders under a case (not just\nresearch) — so the chair can reach any agent-produced file (drafts, OCR text,\noriginals…) from the UI instead of only over SSH. Empty folders are returned\ntoo (with an empty ``files`` list) so the UI can show them as such.","operationId":"api_local_files_api_cases__case_number__local_files_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/local-files/{folder}/{filename}":{"get":{"summary":"Api Read Local File","description":"Serve a single local case file from any content subfolder.\n\n``folder`` is a key from ``/local-files`` (``documents__research``, ``drafts``…);\n``_resolve_case_file`` validates it against the folder allowlist and blocks\npath traversal before the bytes are served.","operationId":"api_read_local_file_api_cases__case_number__local_files__folder___filename__get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"folder","in":"path","required":true,"schema":{"type":"string","title":"Folder"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/analysis":{"get":{"summary":"Api Research Analysis","description":"Return parsed structure of analysis-and-research.md for UI rendering.","operationId":"api_research_analysis_api_cases__case_number__research_analysis_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/analysis/download":{"get":{"summary":"Api Research Analysis Download","description":"Download the raw analysis-and-research.md file.","operationId":"api_research_analysis_download_api_cases__case_number__research_analysis_download_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/analysis/export-docx":{"get":{"summary":"Api Research Analysis Export Docx","description":"Export the legal analysis as a DOCX using דפנה's decision template styles.","operationId":"api_research_analysis_export_docx_api_cases__case_number__research_analysis_export_docx_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/party-claims-summary":{"get":{"summary":"Api Party Claims Summary","description":"Return the raw markdown of the party-claims executive summary.","operationId":"api_party_claims_summary_api_cases__case_number__research_party_claims_summary_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/generate/party-claims-summary":{"post":{"summary":"Api Generate Party Claims Summary","description":"Fire-and-accept: wake the CEO to generate the party-claims executive summary\n(שלב H2 → summarize_party_claims). Runs host-side; poll\nGET /api/cases/{n}/research/party-claims-summary for completion.","operationId":"api_generate_party_claims_summary_api_cases__case_number__generate_party_claims_summary_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/generate/interim-draft":{"post":{"summary":"Api Generate Interim Draft","description":"Fire-and-accept: wake the CEO to generate the partial \"party-claims\" draft\n(שלב H → write_interim_draft + export_interim_draft). Runs host-side; poll the\nexports list for the new טיוטה-טענות_הצדדים_{N}.docx.","operationId":"api_generate_interim_draft_api_cases__case_number__generate_interim_draft_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/generate/{action}/status":{"get":{"summary":"Api Generate Status","description":"Server-derived status of a \"הפקת מסמכים\" background generation (#227 ג).\n\nReconstructs {idle|queued|running|done|failed} from the CEO child issue + its\nlatest heartbeat_run (via the platform port) plus whether the output artifact\nexists — so the UI indicator is correct after navigating away and back; it\nnever depends on the browser staying on the page. ``started_at``/``finished_at``\nare server timestamps (ISO-8601 UTC) so the client renders a correct elapsed\ntime on return.","operationId":"api_generate_status_api_cases__case_number__generate__action__status_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/party-claims-summary/download":{"get":{"summary":"Api Party Claims Summary Download","description":"Download the raw party-claims-summary.md file.","operationId":"api_party_claims_summary_download_api_cases__case_number__research_party_claims_summary_download_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/party-claims-summary/export-docx":{"get":{"summary":"Api Party Claims Summary Export Docx","description":"Export the party-claims summary as a DOCX using דפנה's template styles.","operationId":"api_party_claims_summary_export_docx_api_cases__case_number__research_party_claims_summary_export_docx_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/analysis/upload":{"put":{"summary":"Api Research Analysis Upload","description":"Upload an updated analysis-and-research.md file.\n\nValidates that:\n1. The file is markdown (text)\n2. It can be parsed by the research_md parser\n3. It contains at least one structural section (issues or threshold_claims)\n4. The case number in the file matches the URL\n\nOn success, backs up the existing file and replaces it.","operationId":"api_research_analysis_upload_api_cases__case_number__research_analysis_upload_put","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_research_analysis_upload_api_cases__case_number__research_analysis_upload_put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/research/analysis/chair-position":{"patch":{"summary":"Api Research Chair Position","description":"Update the chair_position field of a specific subsection, writing\ndirectly to analysis-and-research.md (atomic rename).","operationId":"api_research_chair_position_api_cases__case_number__research_analysis_chair_position_patch","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChairPositionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/precedents":{"post":{"summary":"Api Precedent Attach","description":"Attach a legal precedent (quote + citation) to a case, optionally\nscoped to a specific threshold_claim / issue section. Cross-case\nlibrary reuse happens at the search endpoint — this one always\ninserts a new row.","operationId":"api_precedent_attach_api_cases__case_number__precedents_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrecedentCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Api Precedent List","description":"List all precedents attached to a case, grouped client-side by section_id.","operationId":"api_precedent_list_api_cases__case_number__precedents_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/precedents/upload-pdf":{"post":{"summary":"Api Precedent Upload Pdf","description":"One-shot PDF upload for a precedent attachment. Stores the file\non disk alongside other case documents and creates a `documents`\nrow with doc_type='precedent_archive'. Returns {document_id} so the\nfrontend can pass it into POST /precedents. No SSE / background\nprocessing — archive only, no text extraction.","operationId":"api_precedent_upload_pdf_api_cases__case_number__precedents_upload_pdf_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_precedent_upload_pdf_api_cases__case_number__precedents_upload_pdf_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/citation-verification":{"get":{"summary":"Api Citation Verification","description":"Per legal-argument: supporting corpus precedents (with cited_by authority),\ntheir verify state + chair note, and per-issue radar (unlinked digests). Powers\nthe compose 'אימות פסיקה' tab — the chair verifies before the writer cites.","operationId":"api_citation_verification_api_cases__case_number__citation_verification_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/citation-verification/verify":{"post":{"summary":"Api Citation Verify","description":"Verify / un-verify a precedent for a specific argument (the INV-AH gate the\nwriter respects). Upsert: PATCH an existing attachment, else attach a new one\nlinked to the argument + corpus ruling and mark it.","operationId":"api_citation_verify_api_cases__case_number__citation_verification_verify_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CitationVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedents/{precedent_id}":{"delete":{"summary":"Api Precedent Delete","description":"Delete a precedent attachment. The archived PDF (if any) stays\nin the documents table — orphaned references nullify via FK\nON DELETE SET NULL — so we keep the audit trail of the file.","operationId":"api_precedent_delete_api_precedents__precedent_id__delete","parameters":[{"name":"precedent_id","in":"path","required":true,"schema":{"type":"string","title":"Precedent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedents/search":{"get":{"summary":"Api Precedent Search","description":"Cross-case library typeahead. Returns one row per distinct citation.","operationId":"api_precedent_search_api_precedents_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports":{"get":{"summary":"Api List Exports","description":"List all exported drafts and versions for a case.","operationId":"api_list_exports_api_cases__case_number__exports_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/{filename}/download":{"get":{"summary":"Api Download Export","description":"Download an exported file.","operationId":"api_download_export_api_cases__case_number__exports__filename__download_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/{filename}":{"delete":{"summary":"Api Delete Export","description":"Delete an exported draft file.","operationId":"api_delete_export_api_cases__case_number__exports__filename__delete","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/upload":{"post":{"summary":"Api Upload Export","description":"Upload a revised version of a draft.\n\nAfter saving, the file is automatically registered as the case's\nactive_draft (source of truth) and bookmarks are retrofitted so that\nfuture revise_draft calls can anchor Track Changes to the 12 blocks.","operationId":"api_upload_export_api_cases__case_number__exports_upload_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_upload_export_api_cases__case_number__exports_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/revise":{"post":{"summary":"Api Revise Draft","description":"Apply a batch of Track Changes revisions to the active draft.","operationId":"api_revise_draft_api_cases__case_number__exports_revise_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/bookmarks":{"get":{"summary":"Api List Bookmarks","description":"List bookmarks in the case's active draft (anchors for revisions).","operationId":"api_list_bookmarks_api_cases__case_number__exports_bookmarks_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/{filename}/retrofit":{"post":{"summary":"Api Retrofit Bookmarks","description":"Manually trigger retrofit of bookmarks on an existing file.","operationId":"api_retrofit_bookmarks_api_cases__case_number__exports__filename__retrofit_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/active-draft":{"get":{"summary":"Api Get Active Draft","description":"Get the current active_draft_path for a case.","operationId":"api_get_active_draft_api_cases__case_number__active_draft_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/citations":{"get":{"summary":"Api Case Citations","description":"Precedents CITED inside this case's signed decision — split into those linked to\nthe precedent library and those still missing from it (flagged for upload).\n\nPowers the case-page \"פסיקה שצוטטה בהחלטה\" panel. Source: the decision's row in\ncase_law (source_kind='internal_committee') → precedent_internal_citations.","operationId":"api_case_citations_api_cases__case_number__citations_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/exports/{filename}/mark-final":{"post":{"summary":"Api Mark Final","description":"Mark an export as the final version — copies to training corpus.","operationId":"api_mark_final_api_cases__case_number__exports__filename__mark_final_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/final/upload":{"post":{"summary":"Api Upload Final Decision","description":"Clean path: upload the CHAIR's signed final decision (Dafna's version).\n\nDistinct from the two pre-existing flows:\n  • exports/upload  → uploads a *revised version of OUR draft* (retrofits bookmarks,\n    becomes active_draft). NOT for the chair's final.\n  • exports/{f}/mark-final → marks one of *our* exports as final.\n\nThis endpoint takes the EXTERNAL signed final, stores it canonically, and wires it\ninto the full corpus-growth loop (07-learning §1.3):\n  • style corpus (voice learning) + draft↔final pair (INV-LRN4);\n  • the precedent library (case_law, internal_committee) so the decision is CITABLE —\n    chair_name is resolved deterministically (case → committee default), never left\n    empty (DB constraint), so enrollment always succeeds;\n  • its citations are linked to the library and any cited precedent NOT in the library\n    is auto-flagged as a missing_precedent.\nIt does NOT touch active_draft. The LLM-heavy steps (style/halacha panels, halacha\nextraction, corroboration) still run on the local worker via run-learning/run-halacha.","operationId":"api_upload_final_decision_api_cases__case_number__final_upload_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_upload_final_decision_api_cases__case_number__final_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/final/run-learning":{"post":{"summary":"Api Final Run Learning","description":"Staged step 1 — voice learning: wake the local worker to run ingest_final_version\n(Opus distillation) + the 2-judge style panel (DeepSeek+Gemini).","operationId":"api_final_run_learning_api_cases__case_number__final_run_learning_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/final/run-halacha":{"post":{"summary":"Api Final Run Halacha","description":"Staged step 2 — halacha validation: wake the local worker to extract the cited\nhalachot, build corroboration, and run the 3-judge halacha panel (--apply).","operationId":"api_final_run_halacha_api_cases__case_number__final_run_halacha_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/learning-status":{"get":{"summary":"Api Case Learning Status","description":"Derived status of the two post-final pipelines (voice learning + halacha\nextraction) for the case: whether each ran, succeeded, why not, and how many\nhalachot were extracted. Focused/cheap endpoint for the UI to poll + invalidate\nafter the run-learning/run-halacha buttons. Same derivation as case_get's\nlearning_status (single source — db.case_learning_status).","operationId":"api_case_learning_status_api_cases__case_number__learning_status_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/export-docx":{"post":{"summary":"Api Export Docx","description":"Trigger DOCX export for a case.\n\nOn a successful export, fires a fire-and-forget webhook to the\nPaperclip plugin so it can attach a \"final-decision\" document\n(markdown body + download link) to the linked issue.","operationId":"api_export_docx_api_cases__case_number__export_docx_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/text":{"get":{"summary":"Api Document Text","description":"Get the extracted text of a document by its ID.","operationId":"api_document_text_api_documents__doc_id__text_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/gitea/create-repo":{"post":{"summary":"Api Gitea Create Repo","description":"Create a Gitea repo in the 'cases' org and link it to the local case directory.","operationId":"api_gitea_create_repo_api_integrations_gitea_create_repo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiteaRepoRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/paperclip/create-project":{"post":{"summary":"Api Paperclip Create Project","description":"Create a project in Paperclip's embedded DB.","operationId":"api_paperclip_create_project_api_integrations_paperclip_create_project_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaperclipProjectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/start-workflow":{"post":{"summary":"Api Start Workflow","description":"Start the CEO agent workflow for a case.\n\nCreates a workflow issue in Paperclip and wakes the CEO agent.\nOnly works when case status is 'new' or 'documents_ready'.","operationId":"api_start_workflow_api_cases__case_number__start_workflow_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents":{"get":{"summary":"Api Case Agents","description":"Get all Paperclip agent activity for a case: issues, comments, interactions, agent status.","operationId":"api_case_agents_api_cases__case_number__agents_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents/comment":{"post":{"summary":"Api Post Agent Comment","description":"Post a chair instruction to a Paperclip issue linked to a case.\n\nRouting (agents-tab target selector):\n  - ``new_run=True`` → open a fresh CEO-owned run (child issue assigned to the\n    CEO + wakeup), sidestepping the ``issue_assignee_changed`` cancellation on\n    a human-owned parent. Overrides ``issue_id``.\n  - ``issue_id`` given → post to that issue (explicit chair choice).\n  - neither → prefer the live CEO main issue, never a closed one\n    (``pick_default_comment_target``).","operationId":"api_post_agent_comment_api_cases__case_number__agents_comment_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCommentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents/interaction-response":{"post":{"summary":"Api Post Interaction Response","description":"Submit a user's answer to a Paperclip issue-thread interaction.\n\nRoutes to /respond | /accept | /reject based on `action`, then opens a CEO run\ncarrying the answer. Paperclip's own `wake_assignee` cannot deliver it: the\nissue is owned by the chair while it waits for her, so the \"assignee\" it wakes\nis a person and no agent ever runs (TaskMaster #228).","operationId":"api_post_interaction_response_api_cases__case_number__agents_interaction_response_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionResponseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents/interaction-dismiss":{"post":{"summary":"Api Dismiss Interaction","description":"Dismiss a pending interaction WITHOUT waking the issue assignee.\n\nFor stale/duplicate questions (TaskMaster #215). Unlike interaction-response,\nthis does not resolve via Paperclip's wake_assignee path — it cancels the row\nso the chair can clear noise without triggering an agent run.","operationId":"api_dismiss_interaction_api_cases__case_number__agents_interaction_dismiss_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionDismissRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents/reset":{"post":{"summary":"Api Reset Case Agents","description":"Reset stuck agents for a case.\n\nClears writer/QA agents from 'error' status and reassigns any open\nissues back to the chair user, stopping Paperclip recovery loops.","operationId":"api_reset_case_agents_api_cases__case_number__agents_reset_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/agents/escalate":{"post":{"summary":"Api Escalate Issue","description":"Escalate a single stuck issue to the chair (#218).\n\nThe loop-safe alternative to leaving an issue agent-owned+blocked: hands the\nissue to the human in one atomic transition (in_review + assignee_user_id)\nand records a severity note, without re-waking any agent. Emits an\n``agent.escalated`` telemetry event via the Port.","operationId":"api_escalate_issue_api_cases__case_number__agents_escalate_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/mcp/env":{"get":{"summary":"Api Mcp Env","description":"List all catalog env vars with Coolify (authoritative) + container values.","operationId":"api_mcp_env_api_settings_mcp_env_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/mcp/env/{key}":{"patch":{"summary":"Api Mcp Env Update","description":"Update a non-secret env var in Coolify. Requires redeploy to take effect.","operationId":"api_mcp_env_update_api_settings_mcp_env__key__patch","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpEnvUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/mcp/env/redeploy":{"post":{"summary":"Api Mcp Env Redeploy","description":"Trigger Coolify redeploy of the legal-ai app.","operationId":"api_mcp_env_redeploy_api_settings_mcp_env_redeploy_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/mcp/tools":{"get":{"summary":"Api Mcp Tools","description":"List all MCP tools registered in legal_mcp.","operationId":"api_mcp_tools_api_settings_mcp_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/mcp/registrations":{"get":{"summary":"Api Mcp Registrations","description":"List MCP server registrations from host config files.","operationId":"api_mcp_registrations_api_settings_mcp_registrations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/mcp/blocks":{"get":{"summary":"Api Mcp Blocks","description":"List the 12-block decision schema (read-only reference).","operationId":"api_mcp_blocks_api_settings_mcp_blocks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/paperclip-companies":{"get":{"summary":"Api Paperclip Companies","description":"List all companies from Paperclip's DB.","operationId":"api_paperclip_companies_api_settings_paperclip_companies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/settings/tag-mappings":{"get":{"summary":"Api Get Tag Mappings","description":"Get all tag → company mappings.","operationId":"api_get_tag_mappings_api_settings_tag_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Api Add Tag Mapping","description":"Add a tag → company mapping.","operationId":"api_add_tag_mapping_api_settings_tag_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagMappingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/tag-mappings/{mapping_id}":{"delete":{"summary":"Api Delete Tag Mapping","description":"Delete a tag → company mapping.","operationId":"api_delete_tag_mapping_api_settings_tag_mappings__mapping_id__delete","parameters":[{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/methodology/{category}":{"get":{"summary":"Api Get Methodology","description":"Get methodology settings with DB overrides merged over defaults.","operationId":"api_get_methodology_api_methodology__category__get","parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/methodology/{category}/{key}":{"put":{"summary":"Api Update Methodology","description":"Upsert a methodology override. Validates value shape per category.","operationId":"api_update_methodology_api_methodology__category___key__put","parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodologyUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Api Reset Methodology","description":"Delete methodology override, restoring the hardcoded default.","operationId":"api_reset_methodology_api_methodology__category___key__delete","parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/learning/pairs":{"get":{"summary":"Api Learning Pairs","description":"פנקס-ההתאמה (INV-LRN4) — כל ההחלטות וסטטוס ההשוואה מול הסופי.\nstatus אופציונלי: final_received / analyzed / lessons_folded.","operationId":"api_learning_pairs_api_learning_pairs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/learning/style-distance/{case_number}":{"get":{"summary":"Api Learning Style Distance","description":"מדד מרחק-סגנון (T7) לתיק — האם הטיוטה מתכנסת לדפנה.","operationId":"api_learning_style_distance_api_learning_style_distance__case_number__get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/learning/style-distance-history":{"get":{"summary":"Api Learning Style Distance History","description":"Path A — מגמת ה-held-out הפרוספקטיבי: snapshot של מרחק-הסגנון שנלכד בכל\nהעלאת-סופי *לפני* הטמעת-לקחי-התיק, מול גודל-בריכת-הלקחים באותו רגע. ירידה\nב-anti_pattern_total / change_percent ככל שהבריכה גדלה = הלמידה מכלילה.","operationId":"api_learning_style_distance_history_api_learning_style_distance_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/learning/pairs/{pair_id}":{"get":{"summary":"Api Learning Pair Detail","description":"פירוט שורת-פנקס כולל הצעת-הדיסטילציה (analysis) לאישור יו\"ר (T14).","operationId":"api_learning_pair_detail_api_learning_pairs__pair_id__get","parameters":[{"name":"pair_id","in":"path","required":true,"schema":{"type":"string","title":"Pair Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/learning/pairs/{pair_id}/promote":{"post":{"summary":"Api Learning Promote","description":"שער-יו\"ר (INV-G10/LRN1): מאשר לקחי-סגנון + ביטויי-מעבר מהצעת-הדיסטילציה\nומטמיע אותם בערוצים שהכותב צורך (methodology overrides → T15). מקדם status.","operationId":"api_learning_promote_api_learning_pairs__pair_id__promote_post","parameters":[{"name":"pair_id","in":"path","required":true,"schema":{"type":"string","title":"Pair Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteLearningRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/skills":{"get":{"summary":"Api List Skills","description":"List installed Paperclip skills with DB sync status.","operationId":"api_list_skills_api_admin_skills_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/paperclip-agents":{"get":{"summary":"Api List Paperclip Agents","description":"List all Paperclip agents grouped into master+mirror pairs with drift detection.\n\nRead-only. Source of truth: Paperclip ``GET /api/companies/{id}/agents`` API\n(not direct DB) — keeps us decoupled from Paperclip's schema changes.","operationId":"api_list_paperclip_agents_api_admin_paperclip_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/skills/install":{"post":{"summary":"Api Install Skill","description":"Install or update a Paperclip skill from a ZIP file.\n\nThe ZIP should contain a SKILL.md at root (or in a single subdirectory).\nThe skill slug is derived from the directory name or ZIP filename.","operationId":"api_install_skill_api_admin_skills_install_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_install_skill_api_admin_skills_install_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/skills/{slug}/sync":{"post":{"summary":"Api Sync Skill","description":"Sync a skill from disk into the DB (for skills that exist on disk but not in DB).","operationId":"api_sync_skill_api_admin_skills__slug__sync_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/skills/{slug}":{"delete":{"summary":"Api Delete Skill","description":"Delete a skill from the DB. Does NOT delete files from disk.","operationId":"api_delete_skill_api_admin_skills__slug__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/paperclip/restart":{"post":{"summary":"Api Restart Paperclip","description":"Restart the Paperclip PM2 process.\n\nTries pm2 directly (works when running locally on the host).\nIn Docker, writes a restart flag file that the host watcher picks up.","operationId":"api_restart_paperclip_api_admin_paperclip_restart_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/cases/{case_number}/documents/upload-tagged":{"post":{"summary":"Api Upload Tagged Document","description":"Upload a document to a case with tagging and auto-rename.","operationId":"api_upload_tagged_document_api_cases__case_number__documents_upload_tagged_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_upload_tagged_document_api_cases__case_number__documents_upload_tagged_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/documents/{doc_id}/reprocess":{"post":{"summary":"Api Reprocess Document","description":"Reprocess a failed document.","operationId":"api_reprocess_document_api_cases__case_number__documents__doc_id__reprocess_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/documents/{doc_id}":{"patch":{"summary":"Api Patch Document","description":"Update a document's tags. Currently supports doc_type and the\nmetadata.appraiser_side flag (used by extract_appraiser_facts).\n\nReturns the refreshed document row.","operationId":"api_patch_document_api_cases__case_number__documents__doc_id__patch","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Api Delete Document","description":"Delete a single document from a case (including its chunks and file).","operationId":"api_delete_document_api_cases__case_number__documents__doc_id__delete","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/extract-appraiser-facts":{"post":{"summary":"Api Extract Appraiser Facts","description":"Queue appraiser-fact extraction by waking the legal-analyst agent.\n\nThe extraction itself calls `claude_session.query_json()`, which shells\nout to the local `claude` CLI — present on the agent host, **absent in\nthis FastAPI container**. So we cannot run the extractor inline here.\n\nInstead we delegate: create a child Paperclip issue under the case's\nmain issue, assigned to the analyst of the correct company, and trigger\na wakeup with `mutation: extract_appraiser_facts`. The analyst runs the\nMCP tool locally and posts results as a comment.\n\nPre-check: short-circuits with `sides_missing` if any appraisal is\nuntagged, so the chair gets immediate feedback without spinning up an\nagent for nothing. The check uses `_validate_sides_tagged` against the\ndocuments already in the DB — no LLM call, safe to run in-container.\n\nResponse shape:\n    {\"status\": \"queued\", \"sub_issue_id\", \"analyst_id\", \"main_issue_id\"}\n  or {\"status\": \"sides_missing\", \"missing\": [...], \"message\": \"...\"}\n  or {\"status\": \"no_appraisals\", ...}\n  or {\"status\": \"skipped\", \"reason\": \"no_api_key\"|\"no_analyst\"|\"no_issue\"}","operationId":"api_extract_appraiser_facts_api_cases__case_number__extract_appraiser_facts_post","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback":{"get":{"summary":"Api List Feedback","description":"List chair feedback, optionally filtered by case/category.","operationId":"api_list_feedback_api_feedback_get","parameters":[{"name":"case_number","in":"query","required":false,"schema":{"type":"string","default":"","title":"Case Number"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}},{"name":"unresolved_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unresolved Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Api Create Feedback","description":"Record a new chair feedback entry.","operationId":"api_create_feedback_api_feedback_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_api_create_feedback_api_feedback_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback/json":{"post":{"summary":"Api Create Feedback Json","description":"Record a new chair feedback entry (JSON body).","operationId":"api_create_feedback_json_api_feedback_json_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback/{feedback_id}/resolve":{"patch":{"summary":"Api Resolve Feedback","description":"Mark feedback as resolved. When ``fold`` is true (default) and the entry\nhas an extracted lesson, also wake the CEO to fold that lesson into the\nright knowledge file (the feedback→agent-knowledge loop).\n\nThe fold is fire-and-forget (BackgroundTask) and best-effort — resolving\nnever fails because Paperclip is down. Pass ``fold=false`` for pure\nbookkeeping resolves (e.g. from the per-case drafts panel) to avoid\nspawning a CEO run per click.","operationId":"api_resolve_feedback_api_feedback__feedback_id__resolve_patch","parameters":[{"name":"feedback_id","in":"path","required":true,"schema":{"type":"string","title":"Feedback Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chair-feedback/weekly-summary":{"get":{"summary":"Api Chair Feedback Weekly Summary","description":"Return chair feedback from the last N days as a text summary for the CEO agent.","operationId":"api_chair_feedback_weekly_summary_api_chair_feedback_weekly_summary_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chair/pending":{"get":{"summary":"Api Chair Pending","description":"מרכז אישורים — דפנה: מאגד את כל השערים האנושיים (INV-G10) הממתינים להכרעת\nהיו\"ר במקום אחד, כדי שאף פריט לא יישכח. כל קטגוריה מחזירה ספירה + מדגם + קישור\nלמקום הטיפול. כל ספירה היא שאילתת-מקור ישירה (לא נגזרת מטמונה).","operationId":"api_chair_pending_api_chair_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/precedent-library/upload":{"post":{"summary":"Precedent Library Upload","description":"Upload a court ruling / appeals committee decision to the\nauthoritative precedent library. Halachot are extracted in the\nbackground and queued for chair approval.","operationId":"precedent_library_upload_api_precedent_library_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_precedent_library_upload_api_precedent_library_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library":{"get":{"summary":"Precedent Library List","operationId":"precedent_library_list_api_precedent_library_get","parameters":[{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"court","in":"query","required":false,"schema":{"type":"string","default":"","title":"Court"}},{"name":"precedent_level","in":"query","required":false,"schema":{"type":"string","default":"","title":"Precedent Level"}},{"name":"source_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source Type"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"source_kind","in":"query","required":false,"schema":{"type":"string","default":"external_upload","title":"Source Kind"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/stats":{"get":{"summary":"Precedent Library Stats","operationId":"precedent_library_stats_api_precedent_library_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/precedent-library/search":{"get":{"summary":"Precedent Library Search","operationId":"precedent_library_search_api_precedent_library_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"court","in":"query","required":false,"schema":{"type":"string","default":"","title":"Court"}},{"name":"precedent_level","in":"query","required":false,"schema":{"type":"string","default":"","title":"Precedent Level"}},{"name":"appeal_subtype","in":"query","required":false,"schema":{"type":"string","default":"","title":"Appeal Subtype"}},{"name":"subject_tag","in":"query","required":false,"schema":{"type":"string","default":"","title":"Subject Tag"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"include_halachot","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Halachot"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/{case_law_id}":{"get":{"summary":"Precedent Library Get","operationId":"precedent_library_get_api_precedent_library__case_law_id__get","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Precedent Library Update","operationId":"precedent_library_update_api_precedent_library__case_law_id__patch","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrecedentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Precedent Library Delete","operationId":"precedent_library_delete_api_precedent_library__case_law_id__delete","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/{case_law_id}/relations":{"post":{"summary":"Precedent Add Relation","operationId":"precedent_add_relation_api_precedent_library__case_law_id__relations_post","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrecedentRelationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/{case_law_id}/relations/{related_id}":{"delete":{"summary":"Precedent Remove Relation","operationId":"precedent_remove_relation_api_precedent_library__case_law_id__relations__related_id__delete","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}},{"name":"related_id","in":"path","required":true,"schema":{"type":"string","title":"Related Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/graph/corpus":{"get":{"summary":"Graph Corpus","description":"Full corpus graph under the given filters (most-cited nodes survive the cap).","operationId":"graph_corpus_api_graph_corpus_get","parameters":[{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source"}},{"name":"node_types","in":"query","required":false,"schema":{"type":"string","default":"","title":"Node Types"}},{"name":"min_citations","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Min Citations"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":400,"title":"Limit"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"court","in":"query","required":false,"schema":{"type":"string","default":"","title":"Court"}},{"name":"precedent_level","in":"query","required":false,"schema":{"type":"string","default":"","title":"Precedent Level"}},{"name":"chair","in":"query","required":false,"schema":{"type":"string","default":"","title":"Chair"}},{"name":"district","in":"query","required":false,"schema":{"type":"string","default":"","title":"District"}},{"name":"year_from","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Year From"}},{"name":"year_to","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Year To"}},{"name":"metrics","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Metrics"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorpusGraph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/graph/facets":{"get":{"summary":"Graph Facets","description":"Distinct filter values (courts / levels / chairs / districts) for the UI.","operationId":"graph_facets_api_graph_facets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphFacets"}}}}}}},"/api/graph/node/{node_id}/neighborhood":{"get":{"summary":"Graph Node Neighborhood","description":"Local-graph focus: the node + its neighbors out to ``depth`` (1-2).","operationId":"graph_node_neighborhood_api_graph_node__node_id__neighborhood_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Depth"}},{"name":"node_types","in":"query","required":false,"schema":{"type":"string","default":"","title":"Node Types"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorpusGraph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/{case_law_id}/request-metadata":{"post":{"summary":"Precedent Request Metadata","description":"Stamp the case_law row as needing metadata extraction AND wake the\nPaperclip CEO so extraction runs automatically — same flow as upload.","operationId":"precedent_request_metadata_api_precedent_library__case_law_id__request_metadata_post","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/precedent-library/{case_law_id}/request-halachot":{"post":{"summary":"Precedent Request Halachot","description":"Same, for halacha re-extraction.","operationId":"precedent_request_halachot_api_precedent_library__case_law_id__request_halachot_post","parameters":[{"name":"case_law_id","in":"path","required":true,"schema":{"type":"string","title":"Case Law Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cases/{case_number}/digest-radar":{"get":{"summary":"Api Case Digest Radar","description":"Case-contextual digest radar (X12) — UNLINKED digests whose topic is close to\nthis case (rulings we don't hold yet). Powers the case-page \"📡 רדאר יומונים\" lead\nso a relevant ruling known only via a digest doesn't fall through the cracks while\nthe case is decided. INV-DIG1: points at the underlying ruling, never cites the\ndigest.","operationId":"api_case_digest_radar_api_cases__case_number__digest_radar_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}},{"name":"min_score","in":"query","required":false,"schema":{"type":"number","default":0.45,"title":"Min Score"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/upload":{"post":{"summary":"Digest Upload","description":"Upload a \"כל יום\" digest. Container-safe: stages the file and extracts\ntext, creating a row with extraction_status='pending'. LLM enrichment\n(concept/headline/citation + embedding + autolink) is deferred to the local\nMCP drainer ``digest_process_pending`` (claude CLI not in container).","operationId":"digest_upload_api_digests_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_digest_upload_api_digests_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests":{"get":{"summary":"Digest List","operationId":"digest_list_api_digests_get","parameters":[{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"concept_tag","in":"query","required":false,"schema":{"type":"string","default":"","title":"Concept Tag"}},{"name":"linked","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Linked"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"publication","in":"query","required":false,"schema":{"type":"string","default":"","title":"Publication"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/search":{"get":{"summary":"Digest Search","operationId":"digest_search_api_digests_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"subject_tag","in":"query","required":false,"schema":{"type":"string","default":"","title":"Subject Tag"}},{"name":"concept_tag","in":"query","required":false,"schema":{"type":"string","default":"","title":"Concept Tag"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/queue/pending":{"get":{"summary":"Digest Queue Pending","description":"Digests awaiting local LLM enrichment (UI badge 'N ממתינים לעיבוד').","operationId":"digest_queue_pending_api_digests_queue_pending_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations":{"get":{"summary":"Operations Snapshot","description":"Everything running in the background: services + pipelines/queues.","operationId":"operations_snapshot_api_operations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/operations/services/{name}/{action}":{"post":{"summary":"Operations Service Action","description":"Control a background service (restart/stop/start) or run a drain now.\n\n'run-now' maps to pm2 restart — for a one-shot cron drain that fires the\njob immediately. Whitelisted to legal-* (enforced again on the host).","operationId":"operations_service_action_api_operations_services__name___action__post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/drains/{name}/disabled":{"post":{"summary":"Operations Drain Toggle","description":"Switch a cron drain on/off (the 'startup type' in the services panel).\n\nWritten to drain_controls so the drain no-ops at its NEXT startup (pm2\ncron_restart can't be trusted to stay stopped). On disable we ALSO stop any\ncurrently-running process immediately via the host pm2 bridge — the DB flag\nalone wouldn't halt a drain mid-run. Best-effort: a bridge failure doesn't\nfail the toggle (the supervisor stops it on its next tick as a backstop).","operationId":"operations_drain_toggle_api_operations_drains__name__disabled_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/drains/{name}/burst":{"post":{"summary":"Operations Drain Burst","description":"Start/stop a drain's MANUAL burst window (chair-controlled, from /operations).\n\n``action='on'``  → ``burst_until`` = body ``until`` (ISO) or the upcoming\nSaturday 18:00 Israel time. ``action='off'`` → NULL. The host supervisor\n(legal-halacha-supervisor) reads this from the DB and lifts/restores the\ndrain's window accordingly (takes effect within one supervisor tick, ≤15 min).\nNever set automatically — manual only.","operationId":"operations_drain_burst_api_operations_drains__name__burst_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents":{"get":{"summary":"Operations Agents","description":"Queued + running heartbeat runs across all companies (read-only).\n\nTolerates a per-company Paperclip hiccup: returns whatever it could fetch\nplus an ``errors`` list, so one company's outage never blanks the panel.","operationId":"operations_agents_api_operations_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/operations/agents/health":{"get":{"summary":"Operations Agent Health","description":"Per-issue agent health taxonomy (#222): zombie / stalled / working / idle.\n\nRead-only. Surfaces the stranded-child / recovery-loop cases (``zombie``)\nautomatically — the ``gt feed --problems`` idea grounded in our failure\nmodes — so they no longer need hand-querying the Paperclip DB. Consumed by\nthe /operations dashboard (UI is design-gated, follow-up).","operationId":"operations_agent_health_api_operations_agents_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/operations/agents/escalations":{"get":{"summary":"Operations Agent Escalations","description":"Recent chair escalations — watchdog + manual (#218/#222).\n\nRead-only history of what was handed to the chair, for the ops health panel.","operationId":"operations_agent_escalations_api_operations_agents_escalations_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/issues/{issue_id}/predecessor":{"get":{"summary":"Operations Issue Predecessor","description":"Recent finished runs on an issue for session continuation (#220, \"seance\").\n\nRead-only. Lets a fresh heartbeat read what its predecessors on the same\nissue concluded (the run ``summary`` each leaves) instead of rediscovering\ncontext from scratch. Agent-facing wiring (MCP tool + HEARTBEAT) is a\nfollow-up; this is the backend it will call.","operationId":"operations_issue_predecessor_api_operations_issues__issue_id__predecessor_get","parameters":[{"name":"issue_id","in":"path","required":true,"schema":{"type":"string","title":"Issue Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/cases/{case_number}/predecessor":{"get":{"summary":"Operations Case Predecessor","description":"Recent finished runs across a case's issues (#220, agent-facing \"seance\").\n\nCase-scoped sibling of the by-issue endpoint — the plugin tool\n``legal_predecessor_context`` calls this so a resuming agent reads what prior\nsessions on the case concluded (agents key on case_number, not issue UUID).","operationId":"operations_case_predecessor_api_operations_cases__case_number__predecessor_get","parameters":[{"name":"case_number","in":"path","required":true,"schema":{"type":"string","title":"Case Number"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents/runs/{run_id}/log":{"get":{"summary":"Operations Agent Run Log","description":"Full output log (NDJSON stream) of one heartbeat run.","operationId":"operations_agent_run_log_api_operations_agents_runs__run_id__log_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents/runs/{run_id}/events":{"get":{"summary":"Operations Agent Run Events","description":"Lifecycle/event timeline of one heartbeat run.","operationId":"operations_agent_run_events_api_operations_agents_runs__run_id__events_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents/runs/{run_id}/cancel":{"post":{"summary":"Operations Agent Run Cancel","description":"Gracefully cancel a queued/running heartbeat run (not a raw kill).","operationId":"operations_agent_run_cancel_api_operations_agents_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents/{agent_id}/reset-session":{"post":{"summary":"Operations Agent Reset Session","description":"Reset a wedged agent session so its next wakeup starts clean.","operationId":"operations_agent_reset_session_api_operations_agents__agent_id__reset_session_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/agents/migrate-adapter":{"post":{"summary":"Operations Agent Migrate Adapter","description":"Migrate an agent (or 'all') to a target adapter, in both companies.\n\nThe migration is host-side (it needs the host filesystem — generated\ninstruction copies, the gemini settings file — and the embedded board DB),\nso this proxies scripts/migrate_agent_adapter.py through the court-fetch host\nbridge, Bearer-authenticated exactly like the pm2 controls. The script's exit\ncode + stdout/stderr are relayed verbatim so the dashboard can show preflight\nwarnings (a non-zero --check is a refusal to render, not a transport error).","operationId":"operations_agent_migrate_adapter_api_operations_agents_migrate_adapter_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdapterMigrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/scripts/{name}/run":{"post":{"summary":"Scripts Run","description":"Run a read-only allowlisted script via the court-fetch host bridge (#4).\n\nOnly scripts in ``script_runner.SCRIPT_RUN_ALLOWLIST`` are runnable; the host\nbridge is the enforcer (allowlist + fixed read-only argv, no args from here).\nThe script's exit code + stdout/stderr are relayed verbatim for the dashboard.\nWe pre-check the allowlist here too (defense-in-depth, avoids a useless round\ntrip). Audit scripts can take a while, so the timeout is generous.","operationId":"scripts_run_api_scripts__name__run_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/{digest_id}":{"get":{"summary":"Digest Get","operationId":"digest_get_api_digests__digest_id__get","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Digest Update","operationId":"digest_update_api_digests__digest_id__patch","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Digest Delete","operationId":"digest_delete_api_digests__digest_id__delete","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/{digest_id}/link":{"post":{"summary":"Digest Link","description":"Link a digest to its underlying ruling in the precedent library (INV-DIG3).","operationId":"digest_link_api_digests__digest_id__link_post","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Digest Unlink","description":"Clear a digest's link to the underlying ruling.","operationId":"digest_unlink_api_digests__digest_id__link_delete","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/digests/{digest_id}/relink":{"post":{"summary":"Digest Relink","description":"Re-run autolink: link to the underlying ruling if it is now in the library.","operationId":"digest_relink_api_digests__digest_id__relink_post","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","title":"Digest Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bulletins/upload":{"post":{"summary":"Bulletin Upload","description":"Stage a monthly bulletin PDF to data/bulletins/incoming (no DB). Dedup by\ncontent hash so re-running the n8n backfill never duplicates a file.","operationId":"bulletin_upload_api_bulletins_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulletin_upload_api_bulletins_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal-decisions/upload":{"post":{"summary":"Internal Decisions Upload","description":"Upload a planning appeals-committee decision to the internal corpus.\n\n``case_number`` is the canonical identifier (e.g. \"8027-25\"); ``citation``\nis the full מראה-מקום (e.g. \"ערר ... 8027/25 פלוני נ' הוועדה ...\"). They\nare distinct fields — previously the UI sent the citation as case_number,\nleaving the identifier polluted and citation_formatted empty until the\nmetadata extractor ran. citation is stored as citation_formatted up-front\nso it survives even if extraction is delayed.","operationId":"internal_decisions_upload_api_internal_decisions_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_internal_decisions_upload_api_internal_decisions_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal-decisions/migrate":{"post":{"summary":"Internal Decisions Migrate","description":"Migrate existing data to the internal committee corpus.\n\nsource: 'style_corpus' | 'external_corpus' | 'both'\ndry_run: if true, only report what would be done (no writes)","operationId":"internal_decisions_migrate_api_internal_decisions_migrate_post","parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"both","title":"Source"}},{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Dry Run"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal-decisions":{"get":{"summary":"Internal Decisions List","description":"List internal committee decisions with optional filters.","operationId":"internal_decisions_list_api_internal_decisions_get","parameters":[{"name":"district","in":"query","required":false,"schema":{"type":"string","default":"","title":"District"}},{"name":"chair_name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Chair Name"}},{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/halachot":{"get":{"summary":"Halachot List","description":"List halachot. ``exclude_low_quality`` hides flagged items (#84.1),\n``order_by_priority`` switches to the active-learning order (#84.3),\n``cluster`` annotates near-duplicate groups for one-card review (#84.2),\n``include_equivalents`` attaches cross-precedent parallel-authority links, and\n``include_panel_round`` attaches the latest 3-judge panel deliberation so the\nchair sees why the panel split (#133/FU-2). ``search`` locates a pending\nhalacha by case_number / case_name / rule text server-side (so an item below\nthe display window stays reachable); ``with_total`` adds the full filter count\nso the UI can show \"N of TOTAL\". All default off so existing callers are\nunaffected; the review queue opts in.","operationId":"halachot_list_api_halachot_get","parameters":[{"name":"case_law_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Case Law Id"}},{"name":"review_status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Review Status"}},{"name":"practice_area","in":"query","required":false,"schema":{"type":"string","default":"","title":"Practice Area"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"exclude_low_quality","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Exclude Low Quality"}},{"name":"order_by_priority","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Order By Priority"}},{"name":"cluster","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Cluster"}},{"name":"include_equivalents","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Equivalents"}},{"name":"include_panel_round","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Panel Round"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"with_total","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"With Total"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/halachot/{halacha_id}/equivalents":{"get":{"summary":"Halacha Equivalents List","description":"Cross-precedent parallel-authority links for a halacha (#84.2).","operationId":"halacha_equivalents_list_api_halachot__halacha_id__equivalents_get","parameters":[{"name":"halacha_id","in":"path","required":true,"schema":{"type":"string","title":"Halacha Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Halacha Equivalents Link","description":"Chair links two halachot as the same principle across precedents (#84.2).","operationId":"halacha_equivalents_link_api_halachot__halacha_id__equivalents_post","parameters":[{"name":"halacha_id","in":"path","required":true,"schema":{"type":"string","title":"Halacha Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquivalentLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/halachot/{halacha_id}/equivalents/{other_id}":{"delete":{"summary":"Halacha Equivalents Unlink","operationId":"halacha_equivalents_unlink_api_halachot__halacha_id__equivalents__other_id__delete","parameters":[{"name":"halacha_id","in":"path","required":true,"schema":{"type":"string","title":"Halacha Id"}},{"name":"other_id","in":"path","required":true,"schema":{"type":"string","title":"Other Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/canonical-halachot/{canonical_id}/instances":{"get":{"summary":"Canonical Halacha Instances","description":"All halachot instances sharing a canonical_id (V41 — used by the UI accordion).","operationId":"canonical_halacha_instances_api_canonical_halachot__canonical_id__instances_get","parameters":[{"name":"canonical_id","in":"path","required":true,"schema":{"type":"string","title":"Canonical Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goldset":{"get":{"summary":"Goldset List Ep","description":"The gold-set tagging queue (halacha content + machine labels + human tags).","operationId":"goldset_list_ep_api_goldset_get","parameters":[{"name":"batch","in":"query","required":false,"schema":{"type":"string","default":"default","title":"Batch"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goldset/sample":{"post":{"summary":"Goldset Sample Ep","description":"Create/extend a stratified gold-set batch for tagging (#81.7).","operationId":"goldset_sample_ep_api_goldset_sample_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoldsetSampleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goldset/score":{"get":{"summary":"Goldset Score Ep","description":"Measure the extraction validators against the human tags (#81.8).","operationId":"goldset_score_ep_api_goldset_score_get","parameters":[{"name":"batch","in":"query","required":false,"schema":{"type":"string","default":"default","title":"Batch"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goldset/{goldset_id}":{"patch":{"summary":"Goldset Tag Ep","description":"Save one human tag on a gold-set item.","operationId":"goldset_tag_ep_api_goldset__goldset_id__patch","parameters":[{"name":"goldset_id","in":"path","required":true,"schema":{"type":"string","title":"Goldset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoldsetTagRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/halachot/{halacha_id}":{"patch":{"summary":"Halacha Update","description":"Approve / reject / edit a halacha. Used by the chair review queue.","operationId":"halacha_update_api_halachot__halacha_id__patch","parameters":[{"name":"halacha_id","in":"path","required":true,"schema":{"type":"string","title":"Halacha Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HalachaUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/halachot/batch":{"post":{"summary":"Halacha Batch Review","description":"Apply one review status to many halachot at once (#84 group action).","operationId":"halacha_batch_review_api_halachot_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HalachaBatchReviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans":{"get":{"summary":"Plans List","description":"List the plans registry; filter by review_status (queue) or fuzzy q (search).","operationId":"plans_list_api_plans_get","parameters":[{"name":"review_status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Review Status"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Plan Create","description":"Manual chair add/upsert (idempotent on normalized plan_number).","operationId":"plan_create_api_plans_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanUpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/{plan_id}/duplicates":{"get":{"summary":"Plan Duplicates","description":"Near-duplicate candidates for a plan — for the chair to merge (G10, no auto-merge).","operationId":"plan_duplicates_api_plans__plan_id__duplicates_get","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/{plan_id}":{"get":{"summary":"Plan Get","operationId":"plan_get_api_plans__plan_id__get","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Plan Edit","description":"Edit/fix a plan by id (chair). Refuses a number collision (→ merge instead).","operationId":"plan_edit_api_plans__plan_id__patch","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanEditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/{plan_id}/review":{"post":{"summary":"Plan Review","description":"Chair gate (G10): approve / reject / reset.","operationId":"plan_review_api_plans__plan_id__review_post","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanReviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/merge":{"post":{"summary":"Plan Merge","description":"Fold source plan into target (chair-initiated dedup); source is deleted.","operationId":"plan_merge_api_plans_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanMergeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/fetch":{"post":{"summary":"Plan Fetch From Mavat","description":"Pull a plan's identity + validity from mavat (מנהל התכנון) for the chair form.\n\nReturns a candidate dict (display_name/plan_type/purpose/gazette_date/\nyalkut_number/source_url) — does NOT write the registry; the chair saves via\nPOST /api/plans (review_status gate stays, INV-AH source_url carried). The\nbrowser work runs on the host bridge (Camoufox past F5); 503 if it's down,\n404 if the plan wasn't found.","operationId":"plan_fetch_from_mavat_api_plans_fetch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanFetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/missing-precedents":{"post":{"summary":"Missing Precedent Create","description":"Log a new missing precedent (status='open'). Dedupes by\n(citation, cited_in_case_id) — duplicate POST returns the existing row.\n\nOn first insert (non-duplicate) emits a webhook to the Paperclip\nplugin so it can ask Daphna via an ``askUserQuestions`` interaction\nwhether to upload the missing precedent.","operationId":"missing_precedent_create_api_missing_precedents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingPrecedentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Missing Precedents List","description":"List missing precedents, optionally filtered by status / case / text.\n\n``q`` is a free-text term matched across the gap's own מראה-מקום, case name,\nand cited-in appeal number — so the chair can find a gap by the missing\ndecision's number (e.g. 85074), not only by the appeal it was cited in.\n``case_id``/``case_number`` remain exact filters for programmatic callers.","operationId":"missing_precedents_list_api_missing_precedents_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"case_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Case Id"}},{"name":"case_number","in":"query","required":false,"schema":{"type":"string","default":"","title":"Case Number"}},{"name":"legal_topic","in":"query","required":false,"schema":{"type":"string","default":"","title":"Legal Topic"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/missing-precedents/{mp_id}":{"get":{"summary":"Missing Precedent Get","operationId":"missing_precedent_get_api_missing_precedents__mp_id__get","parameters":[{"name":"mp_id","in":"path","required":true,"schema":{"type":"string","title":"Mp Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Missing Precedent Update","operationId":"missing_precedent_update_api_missing_precedents__mp_id__patch","parameters":[{"name":"mp_id","in":"path","required":true,"schema":{"type":"string","title":"Mp Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissingPrecedentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Missing Precedent Delete","operationId":"missing_precedent_delete_api_missing_precedents__mp_id__delete","parameters":[{"name":"mp_id","in":"path","required":true,"schema":{"type":"string","title":"Mp Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/missing-precedents/{mp_id}/upload":{"post":{"summary":"Missing Precedent Upload","description":"Upload the decision file behind a missing-precedent and link it.\n\nRoutes to ingest_internal_decision if the citation looks like a\ncommittee decision (ערר / בל\"מ prefix), otherwise to ingest_precedent.\nOnce the case_law row is created, the missing_precedents row is marked\nstatus='closed' with linked_case_law_id pointing to the new row.","operationId":"missing_precedent_upload_api_missing_precedents__mp_id__upload_post","parameters":[{"name":"mp_id","in":"path","required":true,"schema":{"type":"string","title":"Mp Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_missing_precedent_upload_api_missing_precedents__mp_id__upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/rag-metrics":{"get":{"summary":"Api Rag Metrics","description":"Return nDCG@k aggregates for the RAG retrieval feedback loop.\n\nArgs:\n    weeks: window for \"recent\" metrics (default 12).\n    k: nDCG cutoff (default 10).","operationId":"api_rag_metrics_api_admin_rag_metrics_get","parameters":[{"name":"weeks","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Weeks"}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"K"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/rag-metrics/infer":{"post":{"summary":"Api Rag Metrics Infer","description":"Run auto-inference: for every finalized case, mark its cited\nprecedents as ``relevance_score=3`` against any search_log where\nthey appeared in the top-K. Idempotent.","operationId":"api_rag_metrics_infer_api_admin_rag_metrics_infer_post","parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdapterMigrationRequest":{"properties":{"action":{"type":"string","title":"Action"},"agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"relax_tools":{"type":"boolean","title":"Relax Tools","default":false}},"type":"object","required":["action"],"title":"AdapterMigrationRequest"},"AgentCommentRequest":{"properties":{"body":{"type":"string","title":"Body"},"issue_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue Id"},"new_run":{"type":"boolean","title":"New Run","default":false}},"type":"object","required":["body"],"title":"AgentCommentRequest"},"BlockUpdateRequest":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"BlockUpdateRequest"},"Body_api_create_feedback_api_feedback_post":{"properties":{"case_number":{"type":"string","title":"Case Number","default":""},"block_id":{"type":"string","title":"Block Id","default":"block-yod"},"feedback_text":{"type":"string","title":"Feedback Text"},"category":{"type":"string","title":"Category","default":"missing_content"},"lesson_extracted":{"type":"string","title":"Lesson Extracted","default":""}},"type":"object","required":["feedback_text"],"title":"Body_api_create_feedback_api_feedback_post"},"Body_api_install_skill_api_admin_skills_install_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_install_skill_api_admin_skills_install_post"},"Body_api_precedent_upload_pdf_api_cases__case_number__precedents_upload_pdf_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_precedent_upload_pdf_api_cases__case_number__precedents_upload_pdf_post"},"Body_api_research_analysis_upload_api_cases__case_number__research_analysis_upload_put":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_research_analysis_upload_api_cases__case_number__research_analysis_upload_put"},"Body_api_upload_export_api_cases__case_number__exports_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_upload_export_api_cases__case_number__exports_upload_post"},"Body_api_upload_final_decision_api_cases__case_number__final_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_upload_final_decision_api_cases__case_number__final_upload_post"},"Body_api_upload_tagged_document_api_cases__case_number__documents_upload_tagged_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"doc_type":{"type":"string","title":"Doc Type","default":"auto"},"party_name":{"type":"string","title":"Party Name","default":""},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["file"],"title":"Body_api_upload_tagged_document_api_cases__case_number__documents_upload_tagged_post"},"Body_bulletin_upload_api_bulletins_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_bulletin_upload_api_bulletins_upload_post"},"Body_digest_upload_api_digests_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"yomon_number":{"type":"string","title":"Yomon Number","default":""},"digest_date":{"type":"string","title":"Digest Date","default":""},"practice_area":{"type":"string","title":"Practice Area","default":""},"appeal_subtype":{"type":"string","title":"Appeal Subtype","default":""},"subject_tags":{"type":"string","title":"Subject Tags","default":"[]"}},"type":"object","required":["file"],"title":"Body_digest_upload_api_digests_upload_post"},"Body_internal_decisions_upload_api_internal_decisions_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"case_number":{"type":"string","title":"Case Number"},"case_name":{"type":"string","title":"Case Name","default":""},"citation":{"type":"string","title":"Citation","default":""},"court":{"type":"string","title":"Court","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"chair_name":{"type":"string","title":"Chair Name","default":""},"district":{"type":"string","title":"District","default":""},"practice_area":{"type":"string","title":"Practice Area","default":""},"appeal_subtype":{"type":"string","title":"Appeal Subtype","default":""},"subject_tags":{"type":"string","title":"Subject Tags","default":"[]"},"is_binding":{"type":"boolean","title":"Is Binding","default":false},"summary":{"type":"string","title":"Summary","default":""}},"type":"object","required":["file","case_number"],"title":"Body_internal_decisions_upload_api_internal_decisions_upload_post"},"Body_missing_precedent_upload_api_missing_precedents__mp_id__upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"case_number":{"type":"string","title":"Case Number","default":""},"chair_name":{"type":"string","title":"Chair Name","default":""},"district":{"type":"string","title":"District","default":""},"case_name":{"type":"string","title":"Case Name","default":""},"court":{"type":"string","title":"Court","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"practice_area":{"type":"string","title":"Practice Area","default":""},"appeal_subtype":{"type":"string","title":"Appeal Subtype","default":""},"subject_tags":{"type":"string","title":"Subject Tags","default":"[]"},"is_binding":{"type":"boolean","title":"Is Binding","default":true},"headnote":{"type":"string","title":"Headnote","default":""},"summary":{"type":"string","title":"Summary","default":""},"precedent_level":{"type":"string","title":"Precedent Level","default":""},"source_type":{"type":"string","title":"Source Type","default":""}},"type":"object","required":["file"],"title":"Body_missing_precedent_upload_api_missing_precedents__mp_id__upload_post"},"Body_precedent_library_upload_api_precedent_library_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"citation":{"type":"string","title":"Citation"},"case_name":{"type":"string","title":"Case Name","default":""},"court":{"type":"string","title":"Court","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"source_type":{"type":"string","title":"Source Type","default":""},"precedent_level":{"type":"string","title":"Precedent Level","default":""},"practice_area":{"type":"string","title":"Practice Area","default":""},"appeal_subtype":{"type":"string","title":"Appeal Subtype","default":""},"subject_tags":{"type":"string","title":"Subject Tags","default":"[]"},"is_binding":{"type":"boolean","title":"Is Binding","default":true},"headnote":{"type":"string","title":"Headnote","default":""},"summary":{"type":"string","title":"Summary","default":""}},"type":"object","required":["file","citation"],"title":"Body_precedent_library_upload_api_precedent_library_upload_post"},"Body_training_analyze_api_training_analyze_post":{"properties":{"filename":{"type":"string","title":"Filename"}},"type":"object","required":["filename"],"title":"Body_training_analyze_api_training_analyze_post"},"Body_upload_file_api_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_api_upload_post"},"CaseCreateRequest":{"properties":{"case_number":{"type":"string","title":"Case Number"},"title":{"type":"string","title":"Title"},"appellants":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Appellants"},"respondents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Respondents"},"subject":{"type":"string","title":"Subject","default":""},"property_address":{"type":"string","title":"Property Address","default":""},"permit_number":{"type":"string","title":"Permit Number","default":""},"committee_type":{"type":"string","title":"Committee Type","default":"ועדה מקומית"},"hearing_date":{"type":"string","title":"Hearing Date","default":""},"notes":{"type":"string","title":"Notes","default":""},"expected_outcome":{"type":"string","title":"Expected Outcome","default":""},"practice_area":{"type":"string","title":"Practice Area","default":""},"appeal_subtype":{"type":"string","title":"Appeal Subtype","default":""},"proceeding_type":{"type":"string","title":"Proceeding Type","default":""}},"type":"object","required":["case_number","title"],"title":"CaseCreateRequest"},"CaseUpdateRequest":{"properties":{"status":{"type":"string","title":"Status","default":""},"title":{"type":"string","title":"Title","default":""},"subject":{"type":"string","title":"Subject","default":""},"notes":{"type":"string","title":"Notes","default":""},"hearing_date":{"type":"string","title":"Hearing Date","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"expected_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Outcome"},"appellants":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Appellants"},"respondents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Respondents"},"property_address":{"type":"string","title":"Property Address","default":""},"permit_number":{"type":"string","title":"Permit Number","default":""},"proceeding_type":{"type":"string","title":"Proceeding Type","default":""}},"type":"object","title":"CaseUpdateRequest"},"ChairPositionRequest":{"properties":{"section_id":{"type":"string","title":"Section Id"},"position":{"type":"string","title":"Position","default":""}},"type":"object","required":["section_id"],"title":"ChairPositionRequest"},"ChatConversationCreate":{"properties":{"title":{"type":"string","title":"Title","default":"שיחה חדשה"},"style_corpus_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style Corpus Id"}},"type":"object","title":"ChatConversationCreate"},"ChatMessageRequest":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatMessageRequest"},"CitationVerifyRequest":{"properties":{"argument_id":{"type":"string","title":"Argument Id"},"case_law_id":{"type":"string","title":"Case Law Id","default":""},"quote":{"type":"string","title":"Quote","default":""},"citation":{"type":"string","title":"Citation","default":""},"chair_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chair Note"},"verified":{"type":"boolean","title":"Verified","default":true},"attached_id":{"type":"string","title":"Attached Id","default":""}},"type":"object","required":["argument_id"],"title":"CitationVerifyRequest"},"ClassifyRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"category":{"type":"string","title":"Category"},"case_number":{"type":"string","title":"Case Number","default":""},"doc_type":{"type":"string","title":"Doc Type","default":"appeal"},"title":{"type":"string","title":"Title","default":""},"decision_number":{"type":"string","title":"Decision Number","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"subject_categories":{"items":{"type":"string"},"type":"array","title":"Subject Categories","default":[]}},"type":"object","required":["filename","category"],"title":"ClassifyRequest"},"CorpusGraph":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/GraphNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/GraphEdge"},"type":"array","title":"Edges"},"truncated":{"type":"boolean","title":"Truncated","default":false},"total_available":{"type":"integer","title":"Total Available","default":0}},"type":"object","required":["nodes","edges"],"title":"CorpusGraph"},"CuratorProposal":{"properties":{"title":{"type":"string","title":"Title"},"proposed_change":{"type":"string","title":"Proposed Change"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["title","proposed_change","rationale"],"title":"CuratorProposal"},"DigestLinkRequest":{"properties":{"case_law_id":{"type":"string","title":"Case Law Id"}},"type":"object","required":["case_law_id"],"title":"DigestLinkRequest"},"DigestUpdateRequest":{"properties":{"yomon_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Yomon Number"},"digest_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Digest Date"},"concept_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concept Tag"},"headline_holding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline Holding"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"underlying_citation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Underlying Citation"},"underlying_court":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Underlying Court"},"underlying_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Underlying Date"},"underlying_judge":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Underlying Judge"},"practice_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Area"},"appeal_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appeal Subtype"},"subject_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subject Tags"}},"type":"object","title":"DigestUpdateRequest"},"DirectionRequest":{"properties":{"direction_doc":{"additionalProperties":true,"type":"object","title":"Direction Doc"}},"type":"object","required":["direction_doc"],"title":"DirectionRequest"},"DocumentPatchRequest":{"properties":{"doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Type"},"appraiser_side":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appraiser Side"},"is_post_hearing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Post Hearing"},"protocol_scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Scope"}},"type":"object","title":"DocumentPatchRequest","description":"Patch payload for a single document. All fields are optional; only the\nones present are applied. The metadata.* flags are display/processing hints\nthat never change the stored doc_type."},"EquivalentLinkRequest":{"properties":{"other_id":{"type":"string","title":"Other Id"},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["other_id"],"title":"EquivalentLinkRequest"},"EscalateRequest":{"properties":{"issue_id":{"type":"string","title":"Issue Id"},"severity":{"type":"string","enum":["critical","high","medium"],"title":"Severity"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["issue_id","severity","reason"],"title":"EscalateRequest"},"GiteaRepoRequest":{"properties":{"case_number":{"type":"string","title":"Case Number"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["case_number","title"],"title":"GiteaRepoRequest"},"GoldsetSampleRequest":{"properties":{"n":{"type":"integer","title":"N","default":150},"batch":{"type":"string","title":"Batch","default":"default"},"reset":{"type":"boolean","title":"Reset","default":false}},"type":"object","title":"GoldsetSampleRequest"},"GoldsetTagRequest":{"properties":{"is_holding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Holding"},"correct_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correct Type"},"quote_complete":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Quote Complete"},"tagged_by":{"type":"string","title":"Tagged By","default":"chair"}},"type":"object","title":"GoldsetTagRequest"},"GraphEdge":{"properties":{"source":{"type":"string","title":"Source"},"target":{"type":"string","title":"Target"},"type":{"type":"string","title":"Type"},"treatment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Treatment"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"}},"type":"object","required":["source","target","type"],"title":"GraphEdge"},"GraphFacets":{"properties":{"courts":{"items":{"type":"string"},"type":"array","title":"Courts"},"precedent_levels":{"items":{"type":"string"},"type":"array","title":"Precedent Levels"},"chairs":{"items":{"type":"string"},"type":"array","title":"Chairs"},"districts":{"items":{"type":"string"},"type":"array","title":"Districts"}},"type":"object","required":["courts","precedent_levels","chairs","districts"],"title":"GraphFacets","description":"Distinct filter values so the UI doesn't hardcode Hebrew enum strings."},"GraphNode":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"},"size":{"type":"integer","title":"Size","default":0},"practice_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Area"},"source_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Kind"},"precedent_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Precedent Level"},"court":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Court"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"case_law_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Law Id"},"pagerank":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pagerank"},"betweenness":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Betweenness"},"community":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Community"},"gap_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gap Status"},"missing_precedent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Precedent Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"digest_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Digest Id"}},"type":"object","required":["id","type","label"],"title":"GraphNode"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HalachaBatchReviewRequest":{"properties":{"halacha_ids":{"items":{"type":"string"},"type":"array","title":"Halacha Ids"},"review_status":{"type":"string","title":"Review Status"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer","default":"דפנה"}},"type":"object","required":["halacha_ids","review_status"],"title":"HalachaBatchReviewRequest","description":"#84 — apply one review status to many halachot at once (group action)."},"HalachaUpdateRequest":{"properties":{"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer","default":"דפנה"},"rule_statement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Statement"},"reasoning_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Summary"},"subject_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subject Tags"},"practice_areas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Practice Areas"},"supporting_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supporting Quote"},"canonical_statement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Statement"}},"type":"object","title":"HalachaUpdateRequest"},"InteractionDismissRequest":{"properties":{"issue_id":{"type":"string","title":"Issue Id"},"interaction_id":{"type":"string","title":"Interaction Id"}},"type":"object","required":["issue_id","interaction_id"],"title":"InteractionDismissRequest"},"InteractionResponseRequest":{"properties":{"issue_id":{"type":"string","title":"Issue Id"},"interaction_id":{"type":"string","title":"Interaction Id"},"action":{"type":"string","enum":["respond","accept","reject"],"title":"Action"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"type":"object","required":["issue_id","interaction_id","action","payload"],"title":"InteractionResponseRequest"},"LessonCreate":{"properties":{"lesson_text":{"type":"string","title":"Lesson Text"},"category":{"type":"string","title":"Category","default":"general"},"source":{"type":"string","title":"Source","default":"manual"}},"type":"object","required":["lesson_text"],"title":"LessonCreate"},"LessonPatch":{"properties":{"lesson_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lesson Text"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"}},"type":"object","title":"LessonPatch"},"McpEnvUpdateRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"McpEnvUpdateRequest"},"MethodologyUpdateRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"MethodologyUpdateRequest"},"MissingPrecedentCreate":{"properties":{"citation":{"type":"string","title":"Citation"},"case_number":{"type":"string","title":"Case Number","default":""},"cited_in_document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cited In Document Id"},"cited_by_party":{"type":"string","enum":["appellant","respondent","committee","permit_applicant","unknown"],"title":"Cited By Party","default":"unknown"},"cited_by_party_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cited By Party Name"},"legal_topic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Topic"},"legal_issue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Issue"},"claim_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Quote"},"case_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["citation"],"title":"MissingPrecedentCreate"},"MissingPrecedentPatch":{"properties":{"legal_topic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Topic"},"legal_issue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Issue"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"cited_by_party":{"anyOf":[{"type":"string","enum":["appellant","respondent","committee","permit_applicant","unknown"]},{"type":"null"}],"title":"Cited By Party"},"cited_by_party_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cited By Party Name"},"case_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Name"},"status":{"anyOf":[{"type":"string","enum":["open","uploaded","closed","irrelevant"]},{"type":"null"}],"title":"Status"},"citation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Citation"},"claim_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Quote"}},"type":"object","title":"MissingPrecedentPatch"},"OutcomeRequest":{"properties":{"outcome":{"type":"string","title":"Outcome"},"reasoning":{"type":"string","title":"Reasoning","default":""}},"type":"object","required":["outcome"],"title":"OutcomeRequest"},"PaperclipProjectRequest":{"properties":{"case_number":{"type":"string","title":"Case Number"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description","default":""},"appeal_type":{"type":"string","title":"Appeal Type","default":"רישוי"}},"type":"object","required":["case_number","title"],"title":"PaperclipProjectRequest"},"PlanEditRequest":{"properties":{"plan_number":{"type":"string","title":"Plan Number"},"display_name":{"type":"string","title":"Display Name","default":""},"plan_type":{"type":"string","title":"Plan Type","default":""},"gazette_date":{"type":"string","title":"Gazette Date","default":""},"yalkut_number":{"type":"string","title":"Yalkut Number","default":""},"purpose":{"type":"string","title":"Purpose","default":""},"aliases":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Aliases"}},"type":"object","required":["plan_number"],"title":"PlanEditRequest"},"PlanFetchRequest":{"properties":{"plan_number":{"type":"string","title":"Plan Number"}},"type":"object","required":["plan_number"],"title":"PlanFetchRequest"},"PlanMergeRequest":{"properties":{"source_id":{"type":"string","title":"Source Id"},"target_id":{"type":"string","title":"Target Id"}},"type":"object","required":["source_id","target_id"],"title":"PlanMergeRequest"},"PlanReviewRequest":{"properties":{"review_status":{"type":"string","title":"Review Status"}},"type":"object","required":["review_status"],"title":"PlanReviewRequest"},"PlanUpsertRequest":{"properties":{"plan_number":{"type":"string","title":"Plan Number"},"display_name":{"type":"string","title":"Display Name","default":""},"plan_type":{"type":"string","title":"Plan Type","default":""},"gazette_date":{"type":"string","title":"Gazette Date","default":""},"yalkut_number":{"type":"string","title":"Yalkut Number","default":""},"purpose":{"type":"string","title":"Purpose","default":""},"review_status":{"type":"string","title":"Review Status","default":"approved"},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases","default":[]}},"type":"object","required":["plan_number"],"title":"PlanUpsertRequest"},"PrecedentCreateRequest":{"properties":{"quote":{"type":"string","title":"Quote"},"citation":{"type":"string","title":"Citation"},"section_id":{"type":"string","title":"Section Id","default":""},"chair_note":{"type":"string","title":"Chair Note","default":""},"pdf_document_id":{"type":"string","title":"Pdf Document Id","default":""}},"type":"object","required":["quote","citation"],"title":"PrecedentCreateRequest"},"PrecedentRelationRequest":{"properties":{"related_id":{"type":"string","title":"Related Id"},"relation_type":{"type":"string","title":"Relation Type","default":"same_case_chain"}},"type":"object","required":["related_id"],"title":"PrecedentRelationRequest"},"PrecedentUpdateRequest":{"properties":{"case_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Number"},"case_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Name"},"court":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Court"},"decision_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Date"},"practice_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Area"},"appeal_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appeal Subtype"},"subject_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subject Tags"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"headnote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headnote"},"key_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Quote"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"precedent_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Precedent Level"},"is_binding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Binding"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"chair_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chair Name"},"citation_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Citation Formatted"}},"type":"object","title":"PrecedentUpdateRequest"},"PromoteLearningRequest":{"properties":{"lessons":{"items":{"type":"string"},"type":"array","title":"Lessons","default":[]},"phrases":{"items":{"type":"string"},"type":"array","title":"Phrases","default":[]}},"type":"object","title":"PromoteLearningRequest"},"ReviseRequest":{"properties":{"revisions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Revisions"},"author":{"type":"string","title":"Author","default":"מערכת AI"}},"type":"object","required":["revisions"],"title":"ReviseRequest"},"TagMappingRequest":{"properties":{"tag":{"type":"string","title":"Tag"},"tag_label":{"type":"string","title":"Tag Label","default":""},"company_id":{"type":"string","title":"Company Id"},"company_name":{"type":"string","title":"Company Name","default":""}},"type":"object","required":["tag","company_id"],"title":"TagMappingRequest"},"TrainingCorpusPatch":{"properties":{"decision_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Number"},"decision_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Date"},"subject_categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subject Categories"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"key_principles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Key Principles"},"appeal_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appeal Subtype"},"practice_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Area"}},"type":"object","title":"TrainingCorpusPatch","description":"Editable metadata fields on a style_corpus row.\n\nfull_text is intentionally NOT editable — the corpus is write-once.\nFor corrections, re-upload the decision via /api/training/upload."},"TrainingUploadRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"decision_number":{"type":"string","title":"Decision Number","default":""},"decision_date":{"type":"string","title":"Decision Date","default":""},"subject_categories":{"items":{"type":"string"},"type":"array","title":"Subject Categories","default":[]},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["filename"],"title":"TrainingUploadRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}