Context
Bounded full PostgreSQL suite run from diagnostic PR #34 (after composing the verified #22 and #27 isolation fixes) progressed past the previous hang boundaries and exposed a coherent Analysis/Recovery failure cluster before 9% of the suite.
Observed failing tests:
tests/test_analysis_notification_permissions.py::test_analysis_and_notifications_require_login
tests/test_analysis_recovery.py::test_analyze_pending_deduplicates_inflight_background_jobs
tests/test_analysis_recovery.py::test_analysis_job_inflight_ttl_releases_stuck_ids
tests/test_analysis_recovery.py::test_post_sync_drain_processes_backlog_and_stale_analyzing
tests/test_analysis_recovery.py::test_post_sync_drain_uses_configured_default_batch_size
tests/test_analysis_recovery.py::test_post_sync_drain_releases_claims_after_batch_timeout
This issue is the WorkOrder for diagnosis and root-cause decomposition, not permission to patch all six tests together.
Objective
Determine whether these failures share one production contract regression or represent multiple independent defects, then split implementation into the smallest independently verifiable Worker slices.
Required diagnostic pass
Run the six tests against PostgreSQL with:
pytest -vv
- full traceback (
--tb=long)
- bounded execution time
- no public network calls
- no test skipping or xfail conversion
For each failure capture:
- expected vs actual behavior;
- exact assertion/exception and stack;
- production call path involved;
- whether the test is stale or production behavior is incorrect;
- shared-state/background-task/transaction involvement;
- smallest repair boundary.
Decision rules
- Do not make tests pass by weakening assertions unless the current product contract explicitly changed and is independently verified.
- Do not combine unrelated failures just because they live in
test_analysis_recovery.py.
- If a production lifecycle/concurrency defect is reproduced, create a dedicated child Issue before modifying behavior.
- If a test contract is stale, document the authoritative current contract before changing the test.
Acceptance criteria
Parent stabilization: #2
Related backend-suite recovery: #14
Related lifecycle hardening: #6 / #28
Context
Bounded full PostgreSQL suite run from diagnostic PR #34 (after composing the verified #22 and #27 isolation fixes) progressed past the previous hang boundaries and exposed a coherent Analysis/Recovery failure cluster before 9% of the suite.
Observed failing tests:
tests/test_analysis_notification_permissions.py::test_analysis_and_notifications_require_logintests/test_analysis_recovery.py::test_analyze_pending_deduplicates_inflight_background_jobstests/test_analysis_recovery.py::test_analysis_job_inflight_ttl_releases_stuck_idstests/test_analysis_recovery.py::test_post_sync_drain_processes_backlog_and_stale_analyzingtests/test_analysis_recovery.py::test_post_sync_drain_uses_configured_default_batch_sizetests/test_analysis_recovery.py::test_post_sync_drain_releases_claims_after_batch_timeoutThis issue is the WorkOrder for diagnosis and root-cause decomposition, not permission to patch all six tests together.
Objective
Determine whether these failures share one production contract regression or represent multiple independent defects, then split implementation into the smallest independently verifiable Worker slices.
Required diagnostic pass
Run the six tests against PostgreSQL with:
pytest -vv--tb=long)For each failure capture:
Decision rules
test_analysis_recovery.py.Acceptance criteria
Parent stabilization: #2
Related backend-suite recovery: #14
Related lifecycle hardening: #6 / #28