Summary
Complete the remaining Python modularization work by:
- enforcing the existing architecture and error-handling rules through CI; and
- migrating
gpt-rag-ui from flat root modules to a structured src package.
The orchestrator structure, shared audit contracts, existing typed contracts, and ADRs should be reused rather than replaced.
Why will we implement this?
What does it do? (Functional Overview)
-
Core behavior:
-
Add Ruff configuration and required CI checks to:
gpt-rag-orchestrator
gpt-rag-ingestion
gpt-rag-ui
-
Add static type checking using an incremental baseline:
- begin with the currently typed modules;
- prevent new violations;
- gradually expand blocking coverage.
-
Add automated import checks:
- detect circular imports;
- encode the boundaries already documented in
AGENTS.md;
- prevent imports from another package's internal modules.
-
Strengthen error-handling enforcement:
- enable checks for blind exception handlers;
- require explicit handling or documented exceptions;
- add targeted tests for public boundaries that must not return success-shaped fallbacks.
-
Migrate gpt-rag-ui to a structure such as:
src/
gpt_rag_ui/
api/
auth/
clients/
services/
telemetry/
util/
tests/
-
Keep main.py and app.py as thin compatibility or startup entry points while internal imports move to the package.
-
Complete the migration through incremental pull requests so each step remains independently deployable.
-
Data collection / storage needs: None.
-
Data analysis / reporting needs: CI should expose lint, typing, import-boundary, and test results.
-
Nice to have (stretch goals):
- Vendor the existing conversations-panel contract in
gpt-rag-ui and generate typed UI models.
- Apply the same
src layout to ingestion after evaluating compatibility impact.
- Reuse a common CI configuration across the Python repositories.
Out of scope
- Replacing the existing audit and telemetry contracts.
- Reorganizing the orchestrator package structure again.
- Creating a shared cross-repository JWT implementation.
- Creating a new shared Azure client repository.
- Changing the current multi-repository topology.
Components
- Components (check all that apply):
Summary
Complete the remaining Python modularization work by:
gpt-rag-uifrom flat root modules to a structuredsrcpackage.The orchestrator structure, shared audit contracts, existing typed contracts, and ADRs should be reused rather than replaced.
Why will we implement this?
Problem / opportunity:
gpt-rag-uistill contains most runtime modules at the repository root, unlike the structured orchestrator layout.Business value / outcome:
Success metrics (how we know it worked):
gpt-rag-uiruntime code is packaged undersrc/.What does it do? (Functional Overview)
Core behavior:
Add Ruff configuration and required CI checks to:
gpt-rag-orchestratorgpt-rag-ingestiongpt-rag-uiAdd static type checking using an incremental baseline:
Add automated import checks:
AGENTS.md;Strengthen error-handling enforcement:
Migrate
gpt-rag-uito a structure such as:Keep
main.pyandapp.pyas thin compatibility or startup entry points while internal imports move to the package.Complete the migration through incremental pull requests so each step remains independently deployable.
Data collection / storage needs: None.
Data analysis / reporting needs: CI should expose lint, typing, import-boundary, and test results.
Nice to have (stretch goals):
gpt-rag-uiand generate typed UI models.srclayout to ingestion after evaluating compatibility impact.Out of scope
Components