From ed624275821e09a717644a411dfc85ee31ec7d0d Mon Sep 17 00:00:00 2001 From: repo-worker-code-k Date: Sun, 8 Nov 2026 18:00:06 -0600 Subject: [PATCH] docs(id): settle board v1 identity and payload contracts (#6164) --- doc/2026-11-01_design_id2054.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/2026-11-01_design_id2054.md b/doc/2026-11-01_design_id2054.md index 3d5ec459ee..a5ec9fda05 100644 --- a/doc/2026-11-01_design_id2054.md +++ b/doc/2026-11-01_design_id2054.md @@ -137,3 +137,25 @@ These do not block recording the design; the recommendations above are the imple 6. **User-visible identity and key rotation:** (a) treat each signing key as its own board identity, (b) define a multi-device account that maps several keys to one person, or (c) make a signed successor-key chain part of boards v1. **Recommend (a)** for v1, with local petnames and optional signed profile claims; defer account aggregation/recovery so boards do not invent a second identity system. The reviewed writer-set design explicitly leaves key-versus-account identity to the broader ID core design. No implementation code or tests were changed for this design. The issue remains open for review and Drew's rulings. + +## 2026-11-08 amendment: v1 identity, payload, and view-pin contracts + +This amendment records the v1 defaults for issue [#6164](https://github.com/developing-today/code/issues/6164). It supersedes earlier recommendations below only where they conflict with these explicit contracts. It is documentation-only: it does not rewrite any board ID or hash in code, change PR #6158, or close issue #2054. + +### Board identity + +- **Keep the creator-chosen validated string for v1; do not derive it from a key and nonce.** `board_id` is 1–128 lower-case ASCII letters, digits, `-`, `_`, or `.`, as enforced by the current board schema. It is scoped by the creator's signing key, so the logical name is `(creator verifying key, board_id)` and is not globally unique. +- The signed Board root object's SHA-256 artifact hash remains the canonical shareable board address. Resolve and authorize a board through that signed root and its signer, not through `board_id` alone. Root versions and successor forks keep their existing signed lineage. No existing ID is regenerated; changing this identity rule later requires a separately versioned protocol/migration decision. +- This choice matches the v1 implementation and avoids inventing a nonce format and compatibility rule after creator-chosen IDs already exist. + +### Board payload hashes and sizes + +- Keep `ArtifactHash` as the canonical 32-byte **SHA-256** value encoded as 64 lower-case hexadecimal characters. Signed board-object references name the signed artifact hash; they are not hashes of attachment, theme, or game-package payload bytes. +- For raw board payload bytes, v1 uses SHA-256 of the exact stored byte sequence for **attachments, theme assets, and game packages**. Every payload reference carries that digest and an unsigned `size_bytes` count. A receiver checks the fetched byte count against `size_bytes` and then checks SHA-256 against the digest before rendering, caching as trusted content, or executing a package. Package identity covers the exact immutable package bytes, not a reserialized or unpacked representation. `Attachment.size_bytes` already carries the length; the current `Theme.assets` hash-only entries do not, so an implementation must add the length to each asset reference before claiming declared-length verification. A game-package reference must include both fields from its introduction. +- These are board-v1 references; they are not interchangeable with `DocumentRef.content`, which remains BLAKE3 under the separate `document.put` contract, or with any other subsystem's content ID. This decision does not authorize changing the current SHA-256 strings or rewriting existing records. Any future algorithm change needs an explicit new schema/version and migration; adding the missing theme-asset size must preserve the digest and be additive/versioned. This amendment changes no code and leaves PR #6158 untouched. + +### Pinned-view provenance + +- **Defer a portable serialized view-receipt format for v1.** The host-availability and personal-filter layers are unsigned local inputs; a shared receipt could expose private filters or misleadingly imply that distinct local views are one board-authoritative result. The current `BoardView` therefore does not claim to be a signed receipt. +- A client that saves or pins a view must still retain, locally, the board-root hash; the complete sorted set of relevant signed board-object hashes in the input snapshot (including objects hidden or superseded); the resolver/version used; the selected rules and theme hashes (or explicit absence); and the resulting visible, hidden, and moderation-log references. It must identify whether host and personal overlays were applied and keep those local inputs separate from signed board provenance. A projection is reproducible only with the same signed input set, resolver version, and overlay inputs. +- Until a later amendment settles privacy, canonical encoding, and export semantics, clients must not advertise a portable receipt, use arrival time as a resolution rule, or claim that another host will reproduce a view without the same inputs. This deferral preserves the pinned-input invariant while avoiding an underspecified or privacy-leaking wire contract.