Replies: 1 comment
|
🙄 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ADR Precursor: Encrypted / Encoded (Opaque) Message Bodies with Transparent Metadata
Status
Proposed — precursor / undecided. No option is selected. Seed for design input.
Context
Background and Problem Statement
Today a MIF record carries its body as cleartext canonical Markdown in
content. There is no standard way to ship a body that is compressed (large prose / transcripts), encoded (binary-safe transport), or encrypted (confidential payload) while keeping the surrounding metadata —conceptType,namespace,relationships,provenance,temporal— fully transparent and machine-legible.The proposal: a body-envelope where the metadata stays transparent but the body becomes opaque (compressed and/or encrypted), self-described by metadata the record carries —
mimeType+ encoding chain + a cipher/key descriptor (public-key fingerprint, token, or JWT/JWK reference — never the secret itself).Sketch of the envelope (Level 3, all OPTIONAL — default stays today's plaintext)
mimeType/mediaTypetext/markdown,application/json, …)contentEncodingidentity,base64,zlib,gzip,base64+zlibcontentCipherage,jwe,AES-256-GCM) + key reference (pubkey fingerprint, JWK URL, JWT/token claim) — not the secretcontentHashDocumentReference.hash{algorithm, value}shapecontentLength/compressedAtFraming Axis (the crux)
This likely applies solely to the JSON-LD projection — the derived/interchange document — not the canonical Markdown source.
MIF holds Markdown as canonical (SPECIFICATION.md §6, Invariant 2; the JSON-LD form "MUST round-trip losslessly back to markdown" — see ADR-011). An opaque body would break that for cleartext records — no
grep, no OKF*.mdingestion, no embeddings over the prose. Scoping the envelope to the JSON-LD projection sidesteps that: the human-authored Markdown stays plaintext-canonical, and the encoded/encrypted body is a property of the JSON-LD document that gets converted into / regenerated from Markdown on the trusted side. The source-of-truth question for the encrypted case — does JSON-LD become the carrier of record when the Markdown can't be materialized? — is the first thing to nail down.Decision Drivers
Primary Decision Drivers
conceptType/namespace/relationships/provenance/temporaltransparent even when the body is opaque.Secondary Decision Drivers
DocumentReference.hash, an existing cipher standard) to a MIF-native descriptor.DocumentReference.Scope
In scope: the metadata envelope (mimeType + encoding + cipher descriptors), how it rides on the JSON-LD
content, conformance level, and the round-trip / source-of-truth story.Out of scope (for this seed): mandating specific ciphers or a KMS, key distribution/rotation, and any decryption tooling in
mif_convert.Considered Options
Option 1: JSON-LD-projection-scoped body envelope
Description: Add the OPTIONAL sibling fields above to
contentonly in the JSON-LD projection; Markdown stays plaintext-canonical. For the encrypted case, define whether JSON-LD becomes the source-of-truth carrier when Markdown cannot be materialized.Advantages: keeps Invariant 2 intact for cleartext; metadata stays transparent; additive/optional (default unchanged).
Disadvantages: bifurcates the source-of-truth story for the encrypted case; new fields to validate; round-trip semantics for opaque bodies need precise definition.
Risk: Technical: Medium–High (Invariant 2 interplay). Schedule: Medium. Ecosystem: Low.
Option 2: Push opaque/large bodies out via
DocumentReference(reuse, don't add inline)Description: Instead of an inline opaque
content, carry the payload by reference using the existingDocumentReference(pointer + integrity metadata) per ADR-014 ("reference, not embed").Advantages: reuses an accepted primitive and its
hashshape; keeps the record body small; aligns with ADR-014.Disadvantages: indirection for what may be small inline payloads; doesn't cover the "opaque but still inline" use case; resolver/availability concerns.
Risk: Technical: Low–Medium. Schedule: Low. Ecosystem: Low.
Option 3: Adopt an existing cipher/encoding standard wholesale (JWE /
age/ COSE/RFC 9165)Description: Rather than a MIF-native descriptor, the
contentCipheris a JWE/age/COSE structure; MIF only references it.Advantages: battle-tested crypto + key-reference semantics; least invention; interop with existing tooling.
Disadvantages: heavier dependency/conformance surface; couples MIF to an external format's evolution.
Risk: Technical: Medium. Schedule: Medium. Ecosystem: Medium.
Option 4 (exculpatory — do nothing): Keep cleartext-only bodies
Description: Make no schema change. Confidentiality/compression handled out-of-band (encrypted-at-rest storage, encrypted transport, or pre-encrypting and pushing to a
DocumentReferencewithout new fields).Advantages: zero risk to Invariant 2,
grep, OKF*.mdingestion, and embeddings; no new validation surface; no key-durability burden on the record; smallest spec.Disadvantages: no standard way to carry an opaque body with transparent metadata inline — the original gap remains; each consumer reinvents it.
Risk: Technical: Low. Schedule: Low. Ecosystem: Low.
Integration Points
schema/mif.schema.json—contentplus the new sibling fields.DocumentReference.hash(mif.schema.json:152) — reuse pattern for integrity; also clarify body-inline-opaque vs push-to-DocumentReference.summary+compressed_at, content replaced by ≤500-char summary); this is lossless encode/encrypt. Two different primitives that must not be conflated.scripts/validate-memories.py— the frontmatter validation gate.Trade-offs / Risks
DocumentReference— when is an inline opaque body correct vs. pushing the payload out by reference?Decision
PENDING. Deliberately undecided — this seed records the option space and open questions; default behavior stays today's plaintext.
Open Questions
DocumentReference?age, COSE/RFC 9165) for the cipher descriptor, or define a minimal MIF-native descriptor?contentHashcover the plaintext, the ciphertext, or both?Links
schema/mif.schema.json·scripts/validate-memories.pyAll reactions