docs(#269): backend DDD audit — every route classified#277
Merged
Conversation
Closes #269 — the audit of every backend route mounted under `/api/*` as of 0.6.1. Each route is classified as DDD-correct (single domain op), an atomicity exception (bundled op with a transactional guarantee the client can't get by chaining), or legacy (pre-0.6.0 Studio remnant, gated and scheduled for retirement separately). Findings: **no UX-shaped routes**. The 41 routes are all granular or named atomicity exceptions (split / merge / rechunk / restore of the chunkset). Three legacy /api/analyses chunk-edition endpoints and POST /api/ingestion/{analysisId} are tracked for retirement in follow-up issues (out of scope here). The rule is now encoded in `docs/architecture.md` (tracked) so reviewers have a canonical reference for future PRs. Mirrored in `document-parser/CLAUDE.md` (gitignored, fed to Claude Code on every session) for the same audience. Audit-only PR — no code changes. 622 backend tests still passing.
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
Audit of every route mounted under
/api/*as of 0.6.1. Each route is classified as DDD-correct (single domain operation), atomicity exception (bundled operation with a transactional guarantee the client can't get by chaining), or legacy (pre-0.6.0 Studio remnant, gated and scheduled for retirement separately).Findings: no UX-shaped routes. The 41 current routes are all granular or named atomicity exceptions. The rule is now encoded in
docs/architecture.mdso future reviewers have a canonical reference.What changed
docs/design/269-backend-ddd-audit.md(new, ~210 lines): full classification table, conclusions, follow-ups.docs/architecture.md: new "API design rule — no UX-shaped routes" subsection under the API contract.document-parser/CLAUDE.md: same rule mirrored for Claude Code sessions. Note that this file is gitignored; the source of truth isdocs/architecture.md.Follow-ups (out of scope, tracked separately)
[CHORE] Retire /api/analyses/{id}/{rechunk,chunks/*}onceSTUDIO_MODE_ENABLED=falserolls to prod.[CHORE] Migrate POST /api/ingestion/{analysisId}to the doc-centricPOST /api/documents/{id}/chunks/push.Test plan
pytest tests/— 622 passing (no code change)Closes #269