Skip to content

refactor: remove orphaned v1 web layer (routers + services)#597

Merged
frankbria merged 1 commit into
mainfrom
refactor/remove-v1-web-layer
May 27, 2026
Merged

refactor: remove orphaned v1 web layer (routers + services)#597
frankbria merged 1 commit into
mainfrom
refactor/remove-v1-web-layer

Conversation

@frankbria

@frankbria frankbria commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

Removes the legacy v1 web layer — code that ui/server.py never mounts (it mounts only *_v2 routers) and that has zero live importers. Pure dead code.

This is PR 2 of the v1 removal (follows #596, which slimmed the control-plane schema and unblocked codeframe serve).

Deleted

  • codeframe/ui/services/agent_service.py, review_service.py
  • 18 non-_v2 routers: agents, blockers, chat, checkpoints, context, discovery, git, lint, metrics, projects, prs, quality_gates, review, schedule, session, tasks, templates, websocket
  • codeframe/ui/routers/projects_v2.py — defined but never mounted
  • 12 test files that imported the deleted routers/services
  • Stale collect_ignore entries in tests/ui/conftest.py for the deleted tests

(~14.5k lines removed.)

Not touched

Live v2 equivalents and their tests stay: pr_v2, discovery_v2, tasks_v2, blockers_v2, review_v2, schedule_v2, templates_v2, checkpoints_v2, git_v2, plus session_chat_ws, terminal_ws, streaming_v2. No codeframe/server/ exists (already gone; CLAUDE.md's reference is stale and will be corrected in the final docs pass).

Validation

  • No dangling references to deleted modules anywhere in codeframe/ (non-test).
  • App boots: TestClient(app) lifespan → /health 200, 136 routes mounted.
  • CI-equivalent collection (pytest tests/ -m v2 --collect-only) clean — 0 errors.
  • Full uv run pytest -m v22948 passed, 0 failed.

Remaining v1 removal (follow-ups)

  • PR 3 — legacy domain layer: multi-agent agents/ classes (keep dependency_resolver), dead core//lib/ modules, the dead Database methods + their (non-v2) tests, dead top-level dirs.
  • PR 4 — rename codeframe/persistence/platform_store/; refresh CLAUDE.md repo structure.

Kept (live, not v1): E2B cloud exec, worktree sandbox, cf dashboard TUI, slim global control-plane DB.

Summary by CodeRabbit

  • Removals
    • Removed API endpoints for project management, agent operations, chat messaging, discovery workflows, task creation/approval, pull request management, checkpoints, quality gates, metrics tracking, scheduling, and WebSocket connections.
    • Removed agent and review service implementations.

Review Change Stack

These were never mounted by ui/server.py (which mounts only v2 routers)
and had zero live importers — pure dead code.

Deleted:
- codeframe/ui/services/ (agent_service, review_service)
- 18 non-_v2 routers: agents, blockers, chat, checkpoints, context,
  discovery, git, lint, metrics, projects, prs, quality_gates, review,
  schedule, session, tasks, templates, websocket
- codeframe/ui/routers/projects_v2.py (defined but never mounted)
- 12 test files that exercised those deleted routers/services
- stale collect_ignore entries for the deleted tests

Live equivalents (pr_v2, discovery_v2, tasks_v2, etc.) and their tests are
untouched. Verified: app boots (TestClient lifespan, 136 routes), and the
full v2 suite passes (2948 passed, 0 failed). Part of the v1 removal.
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7398079-0dfe-40f4-b7a8-920a3a07b309

📥 Commits

Reviewing files that changed from the base of the PR and between 60cbbba and bf973da.

📒 Files selected for processing (35)
  • codeframe/ui/routers/agents.py
  • codeframe/ui/routers/blockers.py
  • codeframe/ui/routers/chat.py
  • codeframe/ui/routers/checkpoints.py
  • codeframe/ui/routers/context.py
  • codeframe/ui/routers/discovery.py
  • codeframe/ui/routers/git.py
  • codeframe/ui/routers/lint.py
  • codeframe/ui/routers/metrics.py
  • codeframe/ui/routers/projects.py
  • codeframe/ui/routers/projects_v2.py
  • codeframe/ui/routers/prs.py
  • codeframe/ui/routers/quality_gates.py
  • codeframe/ui/routers/review.py
  • codeframe/ui/routers/schedule.py
  • codeframe/ui/routers/session.py
  • codeframe/ui/routers/tasks.py
  • codeframe/ui/routers/templates.py
  • codeframe/ui/routers/websocket.py
  • codeframe/ui/services/__init__.py
  • codeframe/ui/services/agent_service.py
  • codeframe/ui/services/review_service.py
  • tests/agents/test_agent_lifecycle.py
  • tests/api/test_chat_api.py
  • tests/api/test_generate_tasks_endpoint.py
  • tests/api/test_schedule_api.py
  • tests/api/test_templates_api.py
  • tests/ui/conftest.py
  • tests/ui/test_assign_pending_tasks.py
  • tests/ui/test_discovery_automation.py
  • tests/ui/test_task_approval.py
  • tests/ui/test_task_approval_execution.py
  • tests/ui/test_websocket_proactive.py
  • tests/ui/test_websocket_router.py
  • tests/unit/test_pr_router.py
💤 Files with no reviewable changes (35)
  • codeframe/ui/services/init.py
  • codeframe/ui/services/agent_service.py
  • codeframe/ui/routers/session.py
  • codeframe/ui/routers/quality_gates.py
  • codeframe/ui/routers/websocket.py
  • tests/ui/test_websocket_proactive.py
  • tests/agents/test_agent_lifecycle.py
  • codeframe/ui/routers/git.py
  • codeframe/ui/routers/projects.py
  • codeframe/ui/routers/templates.py
  • codeframe/ui/routers/blockers.py
  • codeframe/ui/routers/prs.py
  • tests/ui/test_task_approval_execution.py
  • tests/unit/test_pr_router.py
  • codeframe/ui/routers/schedule.py
  • codeframe/ui/routers/lint.py
  • tests/api/test_generate_tasks_endpoint.py
  • codeframe/ui/routers/review.py
  • tests/api/test_schedule_api.py
  • codeframe/ui/routers/projects_v2.py
  • tests/ui/test_task_approval.py
  • codeframe/ui/routers/agents.py
  • codeframe/ui/routers/checkpoints.py
  • tests/ui/conftest.py
  • codeframe/ui/routers/context.py
  • tests/ui/test_assign_pending_tasks.py
  • codeframe/ui/routers/metrics.py
  • codeframe/ui/services/review_service.py
  • tests/api/test_chat_api.py
  • tests/ui/test_discovery_automation.py
  • codeframe/ui/routers/discovery.py
  • codeframe/ui/routers/tasks.py
  • tests/ui/test_websocket_router.py
  • codeframe/ui/routers/chat.py
  • tests/api/test_templates_api.py

Walkthrough

This PR removes the entire FastAPI router layer (codeframe/ui/routers/) comprising 19 API modules, supporting service classes, and extensive test coverage. Only the test configuration (tests/ui/conftest.py) is updated to reflect the reduced test scope, ignoring three WebSocket test files instead of previous legacy modules.

Changes

API Router and Service Cleanup

Layer / File(s) Summary
FastAPI routers and service modules removed
codeframe/ui/routers/agents.py, codeframe/ui/routers/blockers.py, codeframe/ui/routers/chat.py, codeframe/ui/routers/checkpoints.py, codeframe/ui/routers/context.py, codeframe/ui/routers/discovery.py, codeframe/ui/routers/git.py, codeframe/ui/routers/lint.py, codeframe/ui/routers/metrics.py, codeframe/ui/routers/projects.py, codeframe/ui/routers/projects_v2.py, codeframe/ui/routers/prs.py, codeframe/ui/routers/quality_gates.py, codeframe/ui/routers/review.py, codeframe/ui/routers/schedule.py, codeframe/ui/routers/session.py, codeframe/ui/routers/tasks.py, codeframe/ui/routers/templates.py, codeframe/ui/routers/websocket.py, codeframe/ui/services/agent_service.py, codeframe/ui/services/review_service.py, codeframe/ui/services/__init__.py
Complete removal of the FastAPI router layer, including 19 API endpoint modules (agents, blockers, chat, checkpoints, context, discovery, git, lint, metrics, projects, projects_v2, prs, quality gates, review, schedule, session, tasks, templates, websocket) and two service implementations (AgentService for agent lifecycle management, ReviewService for in-memory review caching).
Test suite cleanup and configuration update
tests/ui/conftest.py, tests/agents/test_agent_lifecycle.py, tests/api/test_chat_api.py, tests/api/test_generate_tasks_endpoint.py, tests/api/test_schedule_api.py, tests/api/test_templates_api.py, tests/ui/test_assign_pending_tasks.py, tests/ui/test_discovery_automation.py, tests/ui/test_task_approval.py, tests/ui/test_task_approval_execution.py, tests/ui/test_websocket_proactive.py, tests/ui/test_websocket_router.py, tests/unit/test_pr_router.py
Removal of extensive test coverage for the deleted routers and services. The test configuration in tests/ui/conftest.py is updated from ignoring a larger set of legacy test modules to only ignoring three WebSocket-related test files: test_websocket_broadcasts.py, test_websocket_integration.py, and test_websocket_subscriptions.py.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Farewell to routers, services, and tests galore,
Eighteen modules exit through the cleanup door!
WebSocket whispers fade to a whispered three,
The API layer sleeps, the config set free. 🗑️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: remove orphaned v1 web layer (routers + services)' accurately and concisely summarizes the primary change—deletion of legacy v1 routers and services—and is clearly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-v1-web-layer

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown

Code Review — PR #597: Remove orphaned v1 web layer

Summary: Pure deletion PR removing ~14.5k lines of dead v1 routers, services, and tests. No new logic introduced.

Verification of Claims

I spot-checked the key claims in the PR description:

  • server.py only mounts v2 routers ✅ — confirmed; the import block and all include_router calls reference only *_v2, *_ws, and auth_router modules
  • No dangling imports ✅ — no live code in codeframe/ imports any of the deleted modules
  • projects_v2.py never mounted ✅ — confirmed absent from both the from codeframe.ui.routers import ( block and the include_router calls
  • conftest.py cleanup ✅ — removed entries correspond exactly to the deleted test files; remaining entries (test_websocket_broadcasts.py, test_deployment_mode.py, test_project_api.py, test_session_router.py) still exist and are correctly kept in collect_ignore

One Observation (non-blocking)

server.py's openapi_tags list still defines tag entries for v1-only concepts that no longer have any active routes: agents, projects, chat, context, lint, quality_gates, session. FastAPI doesn't error on unused tags — the Swagger UI will show them as empty tag groups. The PR description already flags a "PR 4 — docs pass" cleanup, so this is expected and tracked. Just confirming it's on the radar.

Verdict

This is a well-scoped, safe deletion. The staged approach (PR 2 of 4) is the right call — deleting the web layer separately from the domain layer makes each step reviewable and independently verifiable.

LGTM — no issues to resolve before merge.

@frankbria frankbria merged commit 66241c2 into main May 27, 2026
11 checks passed
@frankbria frankbria deleted the refactor/remove-v1-web-layer branch May 27, 2026 15:56
frankbria added a commit that referenced this pull request May 29, 2026
## Summary
Final PR (3 of 3) for #599. Renames the slim control-plane store to its real
role, refreshes CLAUDE.md, and removes the last v1 stragglers.

- git mv codeframe/persistence -> codeframe/platform_store; updated all 31
  imports across codeframe/, tests/, scripts/, plus CI yaml + active docs
  (CONTRIBUTING.md, PRD.md, TESTING.md) and the embedded Python in
  tests/e2e/global-setup.ts (caught by codex).
- CLAUDE.md: dropped stale codeframe/server/ references (Legacy rule + repo-
  structure tree line); refreshed tests/agents/ note now that only
  dependency_resolver remains.
- Stragglers: removed orphan sample_project_config fixture, deleted the 5
  remaining #597-era v1 tests, un-ignored and fixed tests/api/test_health_endpoint.py
  (live /health coverage restored), emptied root collect_ignore.
- Pre-existing PR2 leftovers caught by CodeRabbit: deleted
  tests/blockers/test_blocker_expiration_simple.py and
  tests/lib/test_metrics_tracker.py (both referenced removed Database methods
  / dropped tables; both deselected by -m v2, so prior CI green was misleading).

## Validation
- Tests: pytest -m v2 green (2824 passed); Backend + Frontend CI green
- Lint/Type: ruff + mypy clean (181 files); CI Code Quality green
- Collect: pytest --collect-only clean (3424); zero active references to
  codeframe.persistence remain
- Boot: TestClient /health -> 200
- Cross-family review: codex (1 P2 fixed) + CodeRabbit (2 inline Major fixed)
- claude-bot advisory: 4 minor (3 fixed, 1 partly rebutted -- the
  flagged "dead" Database guard in tests/ui/conftest.py is actually used by
  the running_server fixture; simplified to a direct import)
- Demo: all 12 PR3 + 9 cumulative #599 acceptance criteria verified

## Cumulative -- #599 fully complete across PRs #602 + #603 + #604
- [x] No legacy multi-agent classes remain (PR1)
- [x] core/project.py + dead dirs removed (PR1)
- [x] Database exposes only control-plane methods (PR2)
- [x] persistence -> platform_store rename + CLAUDE.md (PR3)
- [x] codeframe serve boots (every PR)
- [x] pytest --collect-only clean; pytest -m v2 green (every PR)
- [x] cf --help + golden path; ruff + mypy clean (every PR)
- [x] Plan engine kept (verified live via engine_registry -> BuiltinPlanAdapter)

Closes #599.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant