ADR-0082: Table-Shaped Risk Authoring over Risk Blocks¶
- Status: accepted (Nicolas 2026-07-19: "I like the table-shaped approach … build this but also create the options document" — chosen as the working basis for a planned risk-expert challenge session; see docs/planning/risk-authoring-options.md).
- Date: 2026-07-19
- Deciders: Nicolas Burri, design by Claude.
- Builds on: ADR-0079 (risk items — the record this surfaces), ADR-0057 (tree-as-record — the invariant this must not bend), ADR-0078 (trace-item substrate).
Context¶
ISO 14971 risk work is table-native (one row per hazard→situation→harm; score, control, residual and verification columns); authoring dozens of risks through a 12-field block dialog does not fit workshop or review reality. Risks must nevertheless remain inside controlled documents — versioning, four-eyes, release, audit and the trace substrate all hang off that (the separate risk-register-module alternative was rejected; see the options note).
Decision¶
Risk-Analysis-capable documents (per the (scope, type) may-define-risk flag) get a table-shaped authoring and reading surface for their risk items:
- Each grid row IS a
:::riskblock in the document tree. The grid is a VIEW/controller over the same ProseMirror document the editor holds — add row = insert a risk block; edit cell = edit that block's attribute; delete row = delete the block. There is NO second record, no new tables, no parallel serialization path (ADR-0057 invariant): frozen trees, content hashes, the:::riskfence and the projection fidelity gate are byte-unaffected. - Columns = the fixed ADR-0079 attribute set (key, hazard, situation, harm, initial
S/P1/P2/level, residual S/P1/P2/level, acceptability) plus derived read-only columns
from the link substrate: mitigating controls (
mitigates⁻¹), implemented-by, verified-by, and the gap flags — the same derivations as the risk-traceability view, scoped to the document. - Read mode renders the same grid read-only on the version detail (the released risk table an auditor reads), alongside the narrative body.
- The block dialog and the prose-embedded rendering remain — single-item edits, and risks embedded in narrative sections, stay first-class. The grid is an additional surface, not a replacement; both mutate the one tree.
- Scoring stays recorded tokens (ADR-0079; presentation-honesty rule — no computed
columns, no
=).
Staging¶
- Stage 1: the grid over the document's risk blocks — render (edit + read mode), cell editing, add/delete row, derived control/verification/gap columns read-only.
- Stage 2 (after the expert session): in-row control creation +
mitigateslinking; sort/filter; bulk entry/import if the expert confirms the need (options note Q1/Q2).
Alternatives considered¶
- Dialog-only authoring (status quo): kept as the fallback surface; inadequate alone for table-native work.
- Separate risk-register module: rejected — forfeits or duplicates document control and the trace-item economy (options note, Option 3).
Consequences¶
- Pure frontend investment; zero schema/endpoint change for Stage 1 (derived columns reuse the existing risk-traceability read model, filtered to the document).
- The expert session (options note) may amend column set/ergonomics — the substrate and this surface decision are expected to survive; per-control re-scoring or overall-residual objects would be separate ADR-0079 amendments (attribute sets are hash-frozen — migration-grade).
- The projection suite and the ADR-0079 tests remain the guard that the grid never forks the record.