Skip to content

docs(#269): backend DDD audit — every route classified#277

Merged
pjmalandrino merged 1 commit into
release/0.6.1from
chore/269-backend-ddd-audit
May 13, 2026
Merged

docs(#269): backend DDD audit — every route classified#277
pjmalandrino merged 1 commit into
release/0.6.1from
chore/269-backend-ddd-audit

Conversation

@pjmalandrino

Copy link
Copy Markdown
Member

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.md so 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 is docs/architecture.md.

Follow-ups (out of scope, tracked separately)

  • [CHORE] Retire /api/analyses/{id}/{rechunk,chunks/*} once STUDIO_MODE_ENABLED=false rolls to prod.
  • [CHORE] Migrate POST /api/ingestion/{analysisId} to the doc-centric POST /api/documents/{id}/chunks/push.

Test plan

  • Backend: pytest tests/622 passing (no code change)
  • Backend: ruff + format clean
  • No frontend changes

Closes #269

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.
@pjmalandrino pjmalandrino merged commit ec7a495 into release/0.6.1 May 13, 2026
4 checks passed
@pjmalandrino pjmalandrino deleted the chore/269-backend-ddd-audit branch June 11, 2026 13:46
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