|
1 | 1 | # P2-6 — Runtime namespace: `src` → `agentflow_runtime` |
2 | 2 |
|
3 | | -> Plan only. **Do not implement** until a breaking release window is |
4 | | -> scheduled. Source of the finding: `audit_gpt_11_07_26.md` §P2-6. |
| 3 | +> Plan + **Phase 0 inventory (done 2026-07-17)**. Do **not** start Phase 1 |
| 4 | +> (tree move / dual import) until a breaking release window is scheduled. |
| 5 | +> Source of the finding: `audit_gpt_11_07_26.md` §P2-6. |
5 | 6 |
|
6 | 7 | ## Problem |
7 | 8 |
|
@@ -92,10 +93,70 @@ Do not block the namespace rename on integrations publish. |
92 | 93 | - [ ] bridge: `python -m agentflow_runtime.processing.bridge_consumer` (or shim module path) |
93 | 94 | - [ ] CI unit + contract green; no accidental `packages = ["src"]` only |
94 | 95 |
|
95 | | -## Decision needed before coding |
| 96 | +## Decisions (defaults for the release window) |
96 | 97 |
|
97 | | -1. **Layout:** `src/agentflow_runtime/` (src-layout) vs rename tree root. |
98 | | -2. **Shim lifetime:** one minor vs one major. |
99 | | -3. **Warning default:** on vs off until phase 2 complete. |
| 98 | +Recorded 2026-07-17 so implementation is not blocked on recap — still **do not |
| 99 | +code Phase 1** until the release branch is opened. |
100 | 100 |
|
101 | | -Until those three are answered in a release ticket, leave code as-is. |
| 101 | +| Decision | Choice | Rationale | |
| 102 | +|----------|--------|-----------| |
| 103 | +| Layout | **`src/agentflow_runtime/`** (src-layout) | Keeps `src/` as the container dir; hatch packages `agentflow_runtime`; matches modern packaging without dumping the whole monorepo root. | |
| 104 | +| Shim lifetime | **One minor line** (e.g. 2.1 ships dual import; 2.2 drops `src` top-level) | Enough for first-party cutover + external consumers; not forever. | |
| 105 | +| DeprecationWarning on `import src` | **Off until Phase 2 complete**, then on by default (env `AGENTFLOW_SRC_SHIM_SILENT=1` to mute) | Avoids CI noise during mass codemod. | |
| 106 | + |
| 107 | +## Phase 0 inventory — done 2026-07-17 (`main` @ `4a5d524`) |
| 108 | + |
| 109 | +### Wheel today |
| 110 | + |
| 111 | +```text |
| 112 | +python -m build --wheel |
| 113 | +→ agentflow_runtime-2.0.0-py3-none-any.whl (~342 KB, 145 files) |
| 114 | +top-level package dir in wheel: src/ (141 files under src/) |
| 115 | +``` |
| 116 | + |
| 117 | +Distribution name is already `agentflow-runtime`; only the **import package** |
| 118 | +is the generic `src`. |
| 119 | + |
| 120 | +### Hatch |
| 121 | + |
| 122 | +```toml |
| 123 | +[tool.hatch.build.targets.wheel] |
| 124 | +packages = ["src"] |
| 125 | +``` |
| 126 | + |
| 127 | +CI mypy: `mypy src/ --ignore-missing-imports` (`.github/workflows/ci.yml`). |
| 128 | + |
| 129 | +### Runtime entrypoints hardcoding `src.` |
| 130 | + |
| 131 | +| Kind | Hits (repo scan, excl. .venv/.git) | Examples | |
| 132 | +|------|-----------------------------------:|----------| |
| 133 | +| `python -m src.…` | 47 | bridge_consumer, local_pipeline, provision docs | |
| 134 | +| `uvicorn src.…` | 12 | `Dockerfile.api`, `docker-compose.prod.yml`, `k8s_staging_up.sh`, load/perf workflows | |
| 135 | +| `src.serving.api.main` | 100 | helm deployment + worker, benchmarks, chaos/e2e | |
| 136 | +| `src.serving.provision` | 27 | helm provision Job, tests, main lifespan notes | |
| 137 | +| `src.processing.bridge_consumer` | 11 | bridge tests, main | |
| 138 | +| `packages = ["src"]` | 6 | pyproject (+ mutants / plan / audit) | |
| 139 | +| `from src.` / `import src.` lines in `src/`+`tests/`+`scripts/` | **~540** | primary codemod surface | |
| 140 | + |
| 141 | +### Helm / image (must change in Phase 1–2 with shim) |
| 142 | + |
| 143 | +- `helm/agentflow/templates/deployment.yaml` → `uvicorn` `src.serving.api.main:app` |
| 144 | +- `helm/agentflow/templates/deployment-worker.yaml` → same |
| 145 | +- `helm/agentflow/templates/provision-job.yaml` → `src.serving.provision` |
| 146 | +- `Dockerfile.api` CMD → `src.serving.api.main:app` |
| 147 | +- `scripts/k8s_staging_up.sh` patch args → same |
| 148 | + |
| 149 | +### Blast radius (honest) |
| 150 | + |
| 151 | +- **~540** first-party import lines + **~100** `main:app` string references + |
| 152 | + helm/docker/compose. |
| 153 | +- Shim Phase 1 is mandatory; big-bang rename without shim will break every |
| 154 | + image and local `python -m` habit the same day. |
| 155 | + |
| 156 | +### Phase 0 exit criteria |
| 157 | + |
| 158 | +- [x] Entrypoint inventory |
| 159 | +- [x] Hatch pin confirmed |
| 160 | +- [x] Baseline wheel tree recorded (`src/` top-level only) |
| 161 | +- [x] Default decisions written (layout / shim / warnings) |
| 162 | +- [ ] Phase 1 on a release branch (not started) |
0 commit comments