Code hygiene after the module splits
Goal: after the recent module splits, every prose pointer resolves to the code that owns it, one name carries one contract, and retired code is gone. Consolidates drafts 7692, 7670, 7668, 7654, 7653, 7652, 7631 and 7660 item 6.
1. Repoint route docstrings that still say `app/models.py::X` (7 hits in `apps/api/app/routes`) to `app/models/<domain>.py::X`. Do the same for `routes/agent.py::X` / bare `agent.py::X` pointers (about 31 hits across apps and tools) to the owning submodule. These feed OpenAPI, so this is a deliberate description-only change.
2. Move the project-memory ingest/report routes and `Memory*In` models out of `routes/agent/task_secrets.py` into their own module (keep include order before the `/tasks/{task_id}` catch-alls). Give `_project_label` a home other than `routes/agent/auth.py`.
3. `apps/api/app/seed_dev_profile.py` comment: `tests/conftest.py::FIXTURE_ORG_ID` → `tests/seed.py::FIXTURE_ORG_ID`. In `infra/host/gha-runners/install.py`, point both `test_install.py` mentions at the split `test_install_*.py` suites.
4. jaahd: two functions named `wt_branch` with different failure contracts (`reconcile/context.py`, async, None on failure; `worktree_mechanics/core.py`, sync, "DETACHED"). Rename one, keeping R1's None-on-failure.
5. **Bug:** `reconcile/accounts_probe.py::_account_roster_ever_named_any` is never set True, so "roster used to name accounts, now []" reads as known coverage and can mark every task-held runner DEAD. Set the latch on a successful non-empty read, and add a test that fails today.
6. Drop the retired `live_viewer_tokens` table, `LiveViewerToken` model, tenancy manifest entry and entity-shape test entry, once the release without the token is the oldest one serving (migrations stay additive until then; say in the PR which release that is).
7. Delete the unused `badge` option of Components/Tabs.
Out of scope: any HTTP path, method or schema change beyond descriptions; behaviour changes other than item 5.
Done means:
- `git grep -nE "models\.py::|routes/agent\.py|[^/_]agent\.py::|conftest.py::FIXTURE_ORG_ID" -- apps tools` and `git grep -nF test_install.py -- infra/host/gha-runners/install.py` return only test-data strings.
- The OpenAPI diff vs develop is description-only.
- The item 5 test fails on develop and passes with the fix.
Required checks: ./dc check full
Outcome
All 7 hygiene items in PR #6183, queued in the merge lane. Includes the roster-latch fix (test red on develop, green with fix) and the live_viewer_tokens drop (v1.2.2344 was the first release without it). Quick gate and changed-area tests green; OpenAPI diff is description-only; review lane passed. Follow-up draft 7808 filed.
Artifacts
Activity
- Created
- Run
- Runner started
- Runner ended (done)