ADR-0017: Multi-Part Version Content¶
- Status: accepted
- Date: 2026-06-18
- Deciders: Nicolas Burri
- Refines: ADR-0001; relates to ADR-0014; GAP-14
- Refined by: ADR-0029 (content_part materialized at content-freeze; draft content is separate mutable working state), ADR-0045 (first second part kind: IMAGE attachments)
Context¶
ADR-0001 framed a version's content as a single canonical blob. Real records are often inherently multi-file (a test report plus raw data plus photos), and forcing them into a zip or into separate documents is unnatural and harms searchability and review. Authored documents (SOPs, WIs) remain single-content.
Decision¶
A document version's content is an ordered set of one or more named content parts:
- Each part is stored as an immutable, SHA-256-addressed blob (ADR-0001) — the per-part storage, integrity, and S3-readiness are unchanged.
- The version's content hash is a manifest hash: the SHA-256 of a canonical serialization of the ordered parts (part name, part blob hash, content type, size). This single hash binds the whole multi-part version.
- Single-content documents are the one-part case — no special handling.
- Reproducibility and signing bind to the manifest hash: byte-exact reproduction (REQ-DOC-007) reproduces every part; electronic-signature content binding (REQ-SIG-005) is to the manifest hash, so adding/removing/reordering/altering any part is detectable.
Consequences¶
- The domain model gains a
CONTENT_PARTper version;DOCUMENT_VERSIONreferences its parts and stores the manifest hash. - Content-freezing transitions (REQ-DOC-006) freeze all parts and compute the manifest hash.
- Blob storage layout (ADR-0001, partitioned per scope) holds parts; deduplication is still avoided across scopes.
- Backup/integrity verification (REQ-BAK-004, REQ-DOC-007) re-hash each part and the manifest.
- Search indexing (ADR-0006) extracts text per part.
- The retention/erasure model (ADR-0016) operates at version granularity as before; a part is never independently mutable (immutability preserved).
Requirements¶
Refines REQ-DOC-005; introduces REQ-DOC-014, REQ-DOC-015 (pending requirements baseline v1.2).