feat(audit): log document_upload/extract_claims/export_docx (GAP-18, FU-7)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 21:31:09 +00:00
parent a121f79d6a
commit 1f483383b9
2 changed files with 14 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ from pathlib import Path
from uuid import UUID
from legal_mcp import config
from legal_mcp.services import db, embeddings, git_sync, research_md
from legal_mcp.services import audit, db, embeddings, git_sync, research_md
from legal_mcp.services.lessons import (
CITATION_GUIDANCE,
DECISION_TEMPLATES,
@@ -423,6 +423,10 @@ async def export_docx(case_number: str, output_path: str = "") -> str:
path = await docx_exporter.export_decision(case_id, output_path or None)
# Register this export as the new source of truth
await db.set_active_draft_path(case_id, path)
await audit.log_action_safe(
"export_docx", case_id=case_id,
details={"path": str(path)},
)
case_dir = config.find_case_dir(case_number)
if case_dir.exists():
git_sync.commit_and_push(case_dir, f"ייצוא DOCX: {Path(path).name}")