arch: E-series — 3 more route groups, codec_dashboard 2921→2530#163
Merged
Conversation
Continuation of dashboard route extraction (PR #162 follow-up). Pytest: 2172 → 2185 (+13 regression tests, 0 regressions). EXTRACTIONS E1 / SR-47: Sparkle update endpoints → routes/update.py 2 endpoints (/api/update/check, /api/update/download). Both proxy through codec_update which handles Ed25519 signature verification. E2 / SR-48: public health + manifest + metrics + status → routes/health.py 5 endpoints (/api/health, /health, /api/status, /manifest.json, /metrics). HealthResponse Pydantic model moved with them. /api/services/status stays in codec_dashboard.py because it reads _bg_status / _bg_tasks globals owned by the startup hooks. E4 / SR-49: upload + upload_image + save_file → routes/upload.py 3 security-hardened endpoints bundled because they share defensive scaffolding: - _UPLOAD_MAX_BYTES + 3-layer size cap (B1 / SR-15) - _fence_user_document marker helper (B1 / SR-16) - _SAVE_FILE_BLOCKED_* + _save_file_is_safe (A1 / SR-8 mirror of PR-1C file_write blocklist) DEFERRED (next round) - E3 routes/config.py — /api/config GET/PUT with 22-rule validation matrix + sensitive field masking. Medium-risk; standalone PR. - E5 routes/vibe_exec.py — /api/preview, /preview_frame, /api/run_code (Vibe IDE exec surface; touches subprocess + is_dangerous check) - E6 routes/misc.py — /api/tts, /api/response, /api/web_search, /api/command, /api/cdp/status LOC SHIFT codec_dashboard.py: 2,921 → 2,530 LOC (-391, -13.4%) (3,912 → 2,530 cumulative = -1,382, -35.3%) UPDATED TESTS - tests/test_top10_action_list.py: `_save_file_is_safe` import points to routes.upload (was codec_dashboard). - tests/test_a12_invariant.py: routes/upload.py allowlisted for vision POST (A-11 pending, same as routes/media.py). - tests/test_dashboard_llm.py: /chat/completions count assertion bumped from 4 → 3 (upload_image vision POST moved out). - tests/test_dead_code_3g.py: HealthResponse now lives at routes.health.HealthResponse (E2 extraction). - tests/test_route_extractions_e.py NEW: 13 tests parametrized across 3 phases — endpoint-registered + source-side invariants (HealthResponse exported, B1 helpers in routes/upload). NEW INVARIANT FLOOR test_dashboard_loc_below_2700 — codec_dashboard.py < 2700 LOC. Tightens as future extractions land. Full pytest: 2185 passed, 83 skipped (env-dependent), 0 failed (1m20s). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continuation of route extraction. Pytest: 2172 → 2185 (+13 regression tests, 0 regressions).
What landed
/api/update/*routes/update.pyroutes/health.pyroutes/upload.pyDeferred to next round:
/api/configGET/PUT (22-rule validation matrix + sensitive field masking) — medium risk, standalone PR/api/preview+/preview_frame+/api/run_code(Vibe IDE exec surface — touches subprocess + is_dangerous)/api/tts,/api/response,/api/web_search,/api/command,/api/cdp/status(small standalone endpoints)LOC trajectory
codec_dashboard.py: 2,921 → 2,530 LOC (-391, -13.4% this PR)Test plan
pytest tests/test_route_extractions_e.py— 13/13 new tests passpytest tests/test_top10_action_list.py— 25/25 pass (import updated to routes.upload)pytest tests/test_a12_invariant.py + test_dashboard_llm.py + test_dead_code_3g.py— all pass (3 invariant tests updated for moved code locations)pytest tests/(full) — 2185 passed, 83 skipped, 0 failed in 1m20sAfter merge
🤖 Generated with Claude Code