feat(audit): blocks_stale drift flag + health-check visibility (GAP-17, FU-7)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,9 @@ async def get_dashboard() -> dict:
|
||||
non_searchable_case_law = await conn.fetchval(
|
||||
"SELECT COUNT(*) FROM case_law WHERE NOT searchable"
|
||||
)
|
||||
cases_with_stale_blocks = await conn.fetchval(
|
||||
"SELECT COUNT(*) FROM cases WHERE blocks_stale"
|
||||
)
|
||||
|
||||
# QA summary
|
||||
qa_total = await conn.fetchval("SELECT COUNT(DISTINCT case_id) FROM qa_results")
|
||||
@@ -158,6 +161,7 @@ async def get_dashboard() -> dict:
|
||||
"style_patterns": total_patterns,
|
||||
"case_law_entries": total_case_law,
|
||||
"non_searchable_case_law": non_searchable_case_law,
|
||||
"cases_with_stale_blocks": cases_with_stale_blocks,
|
||||
},
|
||||
"cases_by_status": cases_by_status,
|
||||
"qa": {
|
||||
|
||||
@@ -427,6 +427,7 @@ async def export_docx(case_number: str, output_path: str = "") -> str:
|
||||
"export_docx", case_id=case_id,
|
||||
details={"path": str(path)},
|
||||
)
|
||||
await db.mark_blocks_stale(case_id, False)
|
||||
case_dir = config.find_case_dir(case_number)
|
||||
if case_dir.exists():
|
||||
git_sync.commit_and_push(case_dir, f"ייצוא DOCX: {Path(path).name}")
|
||||
@@ -601,6 +602,7 @@ async def apply_user_edit(case_number: str, edit_filename: str) -> str:
|
||||
try:
|
||||
retrofit_result = docx_retrofit.retrofit_bookmarks(edit_path)
|
||||
await db.set_active_draft_path(case_id, str(edit_path))
|
||||
await db.mark_blocks_stale(case_id, True)
|
||||
case_dir = config.find_case_dir(case_number)
|
||||
if case_dir.exists():
|
||||
git_sync.commit_and_push(case_dir, f"גרסת עריכה: {edit_path.name}")
|
||||
@@ -714,6 +716,7 @@ async def revise_draft(case_number: str, revisions_json: str,
|
||||
active_path, output_path, revisions, author=author,
|
||||
)
|
||||
await db.set_active_draft_path(case_id, str(output_path))
|
||||
await db.mark_blocks_stale(case_id, True)
|
||||
case_dir = config.find_case_dir(case_number)
|
||||
if case_dir.exists():
|
||||
git_sync.commit_and_push(
|
||||
|
||||
Reference in New Issue
Block a user