Management routes: bulk-extract + reindex + bulk-download BackgroundTasks never run (request.state.background_tasks unset)
rectf3BYRIuDsgOt9
- Project
- LEBBA
- Build Model
- sonnet
- Review Model
- codex-5.5
- Runtime Model
- sonnet
- Rounds
- 2
- Work Item
- Open in Airtable
- Output
- Open PR
Agent Dispatches
Orchestrator3
Code
+366
Lines Added
-49
Lines Removed
5
Files Changed
Source vs Test
Source75(20.5%)Test291(79.5%)
Coverage
Coverage: not reported
Features
Validation Contract
# Validation Contract — recUm3jI5QvvA624n 1. [A] `from fastapi import BackgroundTasks` is at module-top in `lebba_core/api/routes/management.py`, not inside function bodies. 2. [A] All five affected routes (`reindex_source`, `update_segment`, `create_metadata_field`, `bulk_extract_field`, `bulk_download_sources`) declare `background_tasks: BackgroundTasks` in their signatures. 3. [A] grep `request.state.background_tasks` in `lebba_core/api/routes/management.py` returns zero matches. 4. [A] grep `request.state.background_tasks` in test_management_metadata.py + test_management_bulk_download.py returns zero matches. 5. [A] TestClient-driven test per affected metadata route asserting pipeline function is scheduled. 6. [A] TestClient-driven test for bulk_download_sources asserting run_bulk_download is scheduled. 7. [A] `python -m pytest -q` exits 0. 8. [A] `python -m ruff check lebba_core tests scripts tenants` exits 0. 9. [A] `python -m ruff format --check lebba_core tests scripts tenants` exits 0. 10. [A] `python -m mypy lebba_core/ --ignore-missing-imports` exits 0. 11. [A] Response status codes and JSON body shapes for the five routes are unchanged. No [R] assertions — backend signature refactor fully captured by TestClient lifecycle assertions.
Event Timeline (3 events)
| # | Role | Event Type | Summary | Verdict | Time |
|---|---|---|---|---|---|
| 1 | Orchestrator | contract_generated | Validation contract approved (11 [A] / 0 [R] assertions) | 5/30/2026, 8:51:11 PM | |
| 2 | Orchestrator | pr_opened | PR opened against staging with auto-merge | 5/31/2026, 3:30:25 AM | |
| 3 | Orchestrator | completed | Run complete — dev=APPROVE, reviewer round 2=APPROVE, runtime=APPROVE, FF merger, PR #131 opened with auto-merge | 5/31/2026, 3:30:42 AM |