epic(legibility): audit — assess current state of every subsystem #387
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic context
This is Epic 1 of 5 for the Codebase Legibility Refactor. The refactor prepares the codebase for evaluation by two external developers (one Java backend dev "Anja", one PM-with-CS "Tobias") to determine whether it is humanly maintainable rather than an LLM-only artifact. It also reduces bus-factor for any future maintainer.
This epic produces comparable, structured audit reports for every subsystem so we know exactly what state we're starting from. Nothing in the codebase changes during this epic — outputs are read-only Markdown reports under
docs/audits/.Scope
One audit per subsystem, each following the per-subsystem orient template (
TEMPLATE-ORIENT-001):frontend/backend/(Java + Flyway tooling)ocr-service/(Python)infra/+scripts/+ repo root +docs/(rest-of-repo)Plus one rollup:
docs/LEGIBILITY-READINESS.md)Inputs every child issue depends on
These artifacts were produced in the requirements phase and are the audit's source of truth. They live in this issue's first comment so child issues can link to them.
PROJ-LEGIBILITY-001) — vision, measurable goals, non-goalsRUBRIC-LEGIBILITY-001) — 10 categories C1–C10, ~50 checksI will paste the full text of these inputs into the first comment of this epic immediately after creation, so audit agents have one URL to read.
Acceptance criteria
docs/audits/audit-frontend-report.mdexists and follows the orient template (AUDIT-1)docs/audits/audit-backend-report.mdexists and follows the orient template (AUDIT-2)docs/audits/audit-ocr-report.mdexists and follows the orient template (AUDIT-3)docs/audits/audit-db-report.mdexists and follows the orient template (AUDIT-4)docs/audits/audit-rest-report.mdexists and follows the orient template (AUDIT-5)docs/LEGIBILITY-READINESS.mdexists with per-subsystem 🟢/🟡/🔴 verdicts (AUDIT-6)Dependency
Blocks: Epic 4 (Refactor) — restructure cannot start until the audit identifies what's where.
Does NOT block: Epic 2 (Documentation) — docs can be written in parallel against the target structure, not the current one.
Definition of Done
This epic closes when AUDIT-6 (rollup scorecard) is closed AND every Critical finding has a corresponding action item somewhere in the legibility milestone.
Reference inputs for all AUDIT-N child issues
This comment is the source-of-truth reference for every child audit. Audit agents should read this comment before opening their assigned child issue. It contains the full Legibility Rubric and the full Per-Subsystem Orient Template.
1. Project Brief (compact)
Vision. A stranger with a CS background can understand, navigate, and safely extend the Familienarchiv codebase without the original author available.
Measurable target outcomes:
README.mdinstructions in ≤15 min with no questions asked.Non-goals. Rewriting working code, adopting new frameworks, changing user-facing behavior, pursuing 100% test coverage, adding features.
2. Personas
docs/ARCHITECTURE.mdand a domain glossary. Success: can describe the system back accurately in 3 minutes after only reading docs.3. Canonical Domain Set (stack-symmetric across backend and frontend)
Tier 1 — Genuine bounded contexts (own entities + behavior):
document,person,tag,user,geschichte,notification,ocrTier 2 — Derived / read-only domains:
conversation(view layer over Document sender/receiver),activity(view layer over Audit + Notification + Document events)Cross-cutting (
shared/orcommon/):audit,file-storage,import,dashboard,transcription-queue,security,error-handling,config,i18n, plus frontend-onlydiscussion(comment+mention primitives)Sub-packages:
document.transcription,document.annotation,document.commentperson.relationshipBoundary decisions ratified:
document(sub-package)document(sub-package); editor primitives in frontendshared/discussion/document(sub-package)ocr/)notification/)person(sub-package)shared/person/(cross-domain consumption is normal)tag/shared/discussion/shared/dashboard/shared/admission criteria: an item entersshared/only if it (a) has no entity, (b) has no user-facing CRUD, and (c) is consumed by ≥2 domains or is genuinely framework infrastructure.4. Legibility Rubric (
RUBRIC-LEGIBILITY-001)Each rubric item is one legibility check. PASS only if the measurable threshold is met. Anything else is FAIL with severity (Critical / Major / Minor / Cosmetic).
C1 — First Contact
README.mdexists, is human-targeted, explains product purpose in ≤3 sentencesdocs/ARCHITECTURE.mdcontains a high-level diagram of components + data flow.agent/,.old/foldersC2 — Local Bootstrap
C3 — Domain Clarity
document/and finds all Document codelib/is domain-based; names are stack-symmetric with backendshared/(orcommon/) contains only genuinely cross-cutting codeshared/member has a clear cross-cutting justificationC4 — Findability
Helper,Utils,Managerwithout modifier)C5 — Conventions
C6 — Layering & Boundaries
shared/, not duplicated per domainC7 — Documentation Quality
README.md(what it owns, what it does not)C8 — Test Trustworthiness
C9 — Operability
docs/DEPLOYMENT.mdC10 — Code Quality Sanity (AI-smell check)
_old/.backupfiles)if (false)branches, unreachable code)Severity decision rules
5. Per-Subsystem Orient Template (
TEMPLATE-ORIENT-001)Every audit produces a Markdown report with these 10 sections in this order. Do not omit sections. If a section doesn't apply, write "N/A — reason".
Check ID · Result (PASS/FAIL) · Severity · Evidence (file:line) · Recommendation.shared/. Justification per item against the admission criteria (no entity, no CRUD, ≥2 consumers, or framework infra).Health thresholds: 🟢 if 0 Critical AND ≥80% pass; 🟡 if 0 Critical AND ≥50% pass; 🔴 otherwise.
Output format: Markdown, no HTML, tables in pipe syntax, code references as
path/file.ts:42.Quality gate: the report is "good" when Anja or Tobias could read it cold and decide whether to take this subsystem AND every Critical/Major finding maps to at least one Recommendation in §10.
This is the complete reference. Each child audit issue points to this comment for inputs.