11. Risks and Technical Debt¶
| # | Risk / debt | Impact | Mitigation |
|---|---|---|---|
| RISK-003 | Compromised session cookie cannot be revoked mid-lifetime (stateless encrypted token-state cookie, no server-side session store — ADR-0028). | A stolen cookie, or a copied cookie after a user logs out on a shared machine, remains usable until the token expires. | Accepted. Bounded by a short access-token lifetime (target ≤ 5 min, REQ-AUTH-006) with silent refresh; httpOnly+Secure+TLS limit theft; idle/absolute session limits (REQ-AUTH-005); cookie-encryption-key rotation is a global revocation lever. Administrative revocation (deactivation / role removal) is immediate via per-request re-evaluation, so the residual window applies only to credential/cookie theft, not to authorization changes. |
| DEBT-001 | Single-datasource deployment — two-role hardening not yet implemented (ADR-0035 §7; ADR-0002/0009). The reference stack and current app connect with the same BYPASSRLS migration role they migrate with; the design intends a second, NOBYPASSRLS runtime datasource (lqms_runtime) for everything except Flyway. |
The database backstop is not the last line of defense against an application bug that skips the RLS role switch (e.g. forgets SET LOCAL ROLE lqms_app): such a path would run privileged rather than fail closed. Defense-in-depth, not a live separation gap — every content transaction does enter the NOBYPASSRLS lqms_app role, and RISK-002's mitigation is implemented and proven (RlsScopeContextTest, RlsConnectionReuseTest; 241 runAs call sites across 55 main-source files as of 2026-08-18). Mitigation proven ≠ risk closed: formal acceptance of RISK-002 is still open, together with the severity/probability scales and acceptance criteria, in process/risk_management.md (D-2/D-4). This row is the residual that decision has to weigh. |
Accepted, staged. The split is packaging + a code change to route the runtime datasource onto lqms_runtime; documented in deployment.md §4 "Two-role hardening". Until then, the app-tier scope filtering plus the FORCE-RLS SET LOCAL ROLE discipline hold the boundary, and FanoutDeploymentCheck refuses to boot if the DEFINER owner cannot bypass RLS. |
| DEBT-002 | Derived-view export scaffolding was duplicated across the matrix exporters (ADR-0084/-0086) — originally the three private RFC-4180 CSV renderers; the 2026-07-25 review (finding B4) found the same mirroring one layer wider: the seven-step trace-graph preamble ×4, resolveTree ×8, the EXPORTED audit block ×4, and — the part with teeth — the ADR-0069 attachment-hardening header set hand-copied into seven response builders. |
Server side: PAID (2026-07-26). Csv (field rule + <kind>_<scope>_<date>.csv naming + <humanId> — <title> label) + CsvExport, ScopeExportAudit, TraceScopeReader/TraceScope (the preamble, resolveTree and the RLS-degradation rule, each with one home) and api/Downloads.kt (the two hardening header sets) are in place; a stale copy of the header set — a live vulnerability class, not a style blemish — is now structurally impossible. |
REMAINING (frontend, not yet paid): B2/B3 — the three matrix PAGES are still mirrored components (one shell + makeCsvDownloader + expandedKeys would collapse them; .chip.planned has already drifted off the GSPR page), and RiskGrid/GsprGrid are still twins needing one TraceGridController + extractTraceAttrsFromTree. The earlier entry claimed the grid duplication was paid — only the editor HANDLE was. Track under the 2026-07-25 register (B2, B3); this row closes when those land. |
| DEBT-CLOSED | Orphan blobs previously leaked forever — DisposalService's post-commit blob deletion assumed a GC that did not exist (REQ-DOC-013). |
(Resolved 2026-07-22.) | Closed by ADR-0092: the two-phase quarantine→purge orphan-blob GC (§8.4, BlobGcSweepService) now discharges that standing assumption; REQ-DOC-013 flips from GAP to verified. Logged here because §11 is a running record, not only a live list. |
Note: product risk management in the IEC 62304 sense lives in process/risk_management.md; this section tracks architectural risks and accepted technical debt.