refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/11) #518

Closed
didericis-codex wants to merge 4 commits from refactor/orchestrator-fastapi into chore/misc-quality-cleanup
Collaborator

Stacked on #514. Second quality-cleanup PR tracked by #444.

Replaces the orchestrator HTTP transport and its oversized manual dispatcher:

  • Explicit FastAPI endpoints: typed route functions replace the 244-line conditional dispatcher and repeated JSON parsing/validation branches.
  • Bounded Uvicorn transport: concurrency is capped and request reads use Uvicorn flow control.
  • Pre-body security boundary: outer ASGI middleware authenticates callers, caps declared and streamed bodies at 1 MiB, and applies a total body-read deadline.
  • Deterministic resource errors: oversized streamed bodies return 413 and slow request bodies return 408 before reaching route handlers.
  • Error containment: internal failures return redacted JSON while logs retain method, route, and exception type without request secrets.
  • Image-only dependencies: FastAPI/Uvicorn are exact-versioned and hash-locked in orchestrator images; a dependency-free HTTP contract keeps host CLI/backend imports clean.
  • Direct ASGI tests: route tests exercise the real application through an ASGI transport; the temporary production dispatch() compatibility adapter is removed.

Still to come in this stack

  • #523 — extract the egress Git, route, authorization, and DLP policy pipeline from the mitmproxy lifecycle adapter.
  • #524 — separate supervisor MCP transport from tool dispatch and proposal formatting.

Remaining stack

  • #525 — authoritative backend cleanup and destructive revalidation.
  • #526 — bounded gateway HTTP work and strict policy introspection.
  • #527 — gateway shutdown diagnostics.

Final stack extension

  • #528 — authoritative resource identities and bounded artifact transfers.

Validation: The complete eleven-PR stack passes all 2,520 unit tests; full-repository Pyright reports 0 errors; git diff --check passes.

Refs #444.

Final stack extension

  • #530 — cleanup execution and mandatory authenticated-secret integrity.

Final stack extension

  • #531 — bounded heavy Git and cleanup operations.

Final stack extension

  • #532 — fail-closed shared database and gateway credential permissions.
Stacked on #514. Second quality-cleanup PR tracked by #444. Replaces the orchestrator HTTP transport and its oversized manual dispatcher: - **Explicit FastAPI endpoints:** typed route functions replace the 244-line conditional dispatcher and repeated JSON parsing/validation branches. - **Bounded Uvicorn transport:** concurrency is capped and request reads use Uvicorn flow control. - **Pre-body security boundary:** outer ASGI middleware authenticates callers, caps declared and streamed bodies at 1 MiB, and applies a total body-read deadline. - **Deterministic resource errors:** oversized streamed bodies return 413 and slow request bodies return 408 before reaching route handlers. - **Error containment:** internal failures return redacted JSON while logs retain method, route, and exception type without request secrets. - **Image-only dependencies:** FastAPI/Uvicorn are exact-versioned and hash-locked in orchestrator images; a dependency-free HTTP contract keeps host CLI/backend imports clean. - **Direct ASGI tests:** route tests exercise the real application through an ASGI transport; the temporary production `dispatch()` compatibility adapter is removed. **Still to come in this stack** - #523 — extract the egress Git, route, authorization, and DLP policy pipeline from the mitmproxy lifecycle adapter. - #524 — separate supervisor MCP transport from tool dispatch and proposal formatting. **Remaining stack** - #525 — authoritative backend cleanup and destructive revalidation. - #526 — bounded gateway HTTP work and strict policy introspection. - #527 — gateway shutdown diagnostics. **Final stack extension** - #528 — authoritative resource identities and bounded artifact transfers. **Validation:** The complete eleven-PR stack passes all 2,520 unit tests; full-repository Pyright reports 0 errors; `git diff --check` passes. Refs #444. **Final stack extension** - #530 — cleanup execution and mandatory authenticated-secret integrity. **Final stack extension** - #531 — bounded heavy Git and cleanup operations. **Final stack extension** - #532 — fail-closed shared database and gateway credential permissions.
didericis-codex changed title from refactor(orchestrator): replace manual HTTP dispatch with FastAPI to refactor(orchestrator): migrate control plane to FastAPI and Uvicorn 2026-07-26 19:47:00 -04:00
didericis added the Kind/Enhancement label 2026-07-26 19:47:59 -04:00
didericis-codex changed title from refactor(orchestrator): migrate control plane to FastAPI and Uvicorn to quality cleanup: orchestrator FastAPI transport (chunk 1/3) 2026-07-26 22:16:59 -04:00
didericis-codex changed title from quality cleanup: orchestrator FastAPI transport (chunk 1/3) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 1/3) 2026-07-26 22:17:16 -04:00
didericis force-pushed refactor/orchestrator-fastapi from cf7482b098 to bc716bb5a3 2026-07-26 22:19:39 -04:00 Compare
didericis force-pushed refactor/orchestrator-fastapi from b2965e292f to 2234145ab4 2026-07-26 22:58:25 -04:00 Compare
didericis-codex changed title from refactor: quality cleanup - orchestrator FastAPI transport (chunk 1/3) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/7) 2026-07-26 23:17:11 -04:00
didericis force-pushed refactor/orchestrator-fastapi from 2234145ab4 to a1acdd9665 2026-07-26 23:39:56 -04:00 Compare
didericis-codex changed title from refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/7) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/8) 2026-07-26 23:40:59 -04:00
didericis force-pushed refactor/orchestrator-fastapi from a1acdd9665 to c472deafaf 2026-07-26 23:56:02 -04:00 Compare
didericis-codex changed title from refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/8) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/9) 2026-07-27 00:02:29 -04:00
didericis force-pushed refactor/orchestrator-fastapi from c472deafaf to ca1bcf0ceb 2026-07-27 00:17:47 -04:00 Compare
didericis-codex changed title from refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/9) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/10) 2026-07-27 00:25:53 -04:00
didericis added 4 commits 2026-07-27 00:46:16 -04:00
fix(orchestrator): bound streamed request bodies
test / integration-docker (pull_request) Has been cancelled
test / image-input-builds (pull_request) Successful in 42s
test / unit (pull_request) Failing after 14m6s
test / coverage (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Failing after 13s
ffda40abae
didericis force-pushed refactor/orchestrator-fastapi from ca1bcf0ceb to ffda40abae 2026-07-27 00:46:16 -04:00 Compare
didericis-codex changed title from refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/10) to refactor: quality cleanup - orchestrator FastAPI transport (chunk 2/11) 2026-07-27 00:48:12 -04:00
didericis-codex closed this pull request 2026-07-27 01:35:11 -04:00
Some checks are pending
test / integration-docker (pull_request) Has been cancelled
test / image-input-builds (pull_request) Successful in 42s
test / unit (pull_request) Failing after 14m6s
test / coverage (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Failing after 13s

Pull request closed

Sign in to join this conversation.