Expose persistent collection gaps and public Congress links
Development CI / check-and-build (push) Successful in 2m56s
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / deploy-development (push) Successful in 2m31s

Retain bill and attachment failure reasons and derive retry counts from saved cursors. Show gap details and retry exhaustion in the collection console while preserving historical records and retry limits.

Convert Congress API bill links to public pages and cover diagnostics, mixed dated versions, persistent counts and legacy records with regression tests.
This commit is contained in:
eezd committed 2026-11-05 12:44:42 +08:00
1 parent dcad5b76a8
commit d5d350b7ec
8 files changed
+182 -14

No files matched your search

+5
View File
@@ -194,6 +194,8 @@ async def list_sources(session: Annotated[AsyncSession, Depends(get_session)]) -
pending = sum(value['attempts'] < 3 for value in retries.values())
documents = (source.history_cursor or {}).get('document_retries', {})
document_pending = sum(value['attempts'] < 3 for value in documents.values())
bills = (source.history_cursor or {}).get('bill_retries', {})
bill_pending = sum(value['attempts'] < 3 for value in bills.values())
attachment_stats[source.code] = {
'attachment_gaps': len(retries),
'attachment_retry_pending': pending,
@@ -201,6 +203,9 @@ async def list_sources(session: Annotated[AsyncSession, Depends(get_session)]) -
'document_gaps': len(documents),
'document_retry_pending': document_pending,
'document_retry_exhausted': len(documents) - document_pending,
'unresolved_bills': len(bills),
'bill_retry_pending': bill_pending,
'bill_retry_exhausted': len(bills) - bill_pending,
}
return success(SourcesOut(
manager_alive=bool(statuses),