Title: Design: a signed artifact is validated as strictly as it is built — one receipt contract for pkgs/id artifacts · Issue #3231 · developing-today/code · GitHub
Open Graph Title: Design: a signed artifact is validated as strictly as it is built — one receipt contract for pkgs/id artifacts · Issue #3231 · developing-today/code
X Title: Design: a signed artifact is validated as strictly as it is built — one receipt contract for pkgs/id artifacts · Issue #3231 · developing-today/code
Description: Design-architect pass 28 (2026-10-31), audit at origin/main 357ec7fb. Full design doc: files/designs/code-id-artifact-receipt-validation.md in the keep-the-four-repos-healthy goal workspace. NO user/review — every origin carries explicit...
Open Graph Description: Design-architect pass 28 (2026-10-31), audit at origin/main 357ec7fb. Full design doc: files/designs/code-id-artifact-receipt-validation.md in the keep-the-four-repos-healthy goal workspace. NO use...
X Description: Design-architect pass 28 (2026-10-31), audit at origin/main 357ec7fb. Full design doc: files/designs/code-id-artifact-receipt-validation.md in the keep-the-four-repos-healthy goal workspace. NO use...
Opengraph URL: https://github.com/developing-today/code/issues/3231
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design: a signed artifact is validated as strictly as it is built — one receipt contract for pkgs/id artifacts","articleBody":"Design-architect pass 28 (2026-10-31), audit at origin/main `357ec7fb`. Full design doc: `files/designs/code-id-artifact-receipt-validation.md` in the keep-the-four-repos-healthy goal workspace. NO `user/review` — every origin carries explicit acceptance with verified probe evidence, and the judgment calls below are the architect's recorded decisions.\n\n## Problem\n\n`pkgs/id` has three signed-statement types, and two state the same contract in their docs — `documents.rs`: *\"The builder and the decoder both apply them, so a signed document always passes them on receipt\"*; `chain.rs` (`ChainExt::validate`): the same sentence for signed events. The third type, artifacts (`pkgs/id/src/artifact.rs`), never applied it to itself: its receipt gates `check()` (envelope) and `parsed()` (the four known kinds) each enforce some of the rules the crate's own producers and sibling validators obey and silently omit others — one omission per field, filed one at a time. Four filings in two days (three in the hours after pass 27 assessed #3146 as a single): #3146 (`friend_remove.requests` never inspected), #3187 (`home_declared.world_id` only `is_empty`-checked; duplicate endpoints pass), #3192 (`document`/`tag` text accepts non-NFC every sibling path refuses), #3196 (`check()` accepts a duplicated `after` frontier `chain.rs` refuses as `DuplicateAfter`).\n\n## The rules (recorded decisions)\n\n1. **Receipt is construction.** `parsed()` refuses a known-kind body no in-tree producer could build; `check()` refuses an envelope no legitimate signer could build — `Refusal::Forbidden` naming the rule, existing per-arm style. Unknown kinds untouched (stored, never applied, envelope-only — the module's deliberate forward-compatibility rule).\n2. **A signed list names each thing once.** Duplicates refused, never silently deduped on receipt (the signed bytes are evidence; rewriting falsifies them and breaks the hash). Covers `after`, `friend_remove.requests`, and `home_declared` servers by endpoint. `sign_after` refuses a duplicated `after` at build time — the builder/decoder symmetry the sibling types document.\n3. **Text in a signed body follows the crate's text rules.** `document.media_type`, `tag.name`, `tag.value` must be NFC via the same `unicode_normalization::is_nfc` the three sibling validators import. `world_id` gets `MAX_WORLD_ID_BYTES = 64` (aligned with `MAX_WORLD_NAME_BYTES`): 1–64 bytes, not whitespace-only, no control (Cc) or format (Cf) characters.\n\nField pins: `requests` ≤ `MAX_FRIEND_REQUESTS = 3` (the sole producer `Directory::friendship_requests`, directory.rs:1710–1721, structurally builds at most 3, sorted+deduped), each entry exactly 32 lowercase hex characters (the envelope-ID shape), no duplicates. Junk `requests` entries are not inert — `Directory::apply` extends the permanent `removed_requests` void guard with every string (directory.rs:1698–1705).\n\n## Phases (adopt the origins — no parallels)\n\n- **Phase 1 — List integrity:** #3196 + #3146.\n- **Phase 2 — Text fields:** #3192 + #3187. Independent of Phase 1.\n- **Phase 3 — Closing audit + contract statement:** filed this pass as a sub-issue, gated on Phases 1–2 (`status/blocked`). Field-by-field disposition table for every known-kind and envelope field; must explicitly disposition the `kind` string (unknown kinds), `document.content` internal strings, `prev`'s shape beyond `store()`'s position check, and full builder-side symmetry; writes the contract sentence into the `artifact.rs` module doc, where `documents.rs`/`chain.rs` already carry it.\n\n## Alternatives rejected (in the doc)\n\nFixing the four independently (rules diverge — the drift is how the family arose: the artifact arms already mirror the sibling *caps* while missing the NFC half); validating at application time instead of `parsed()` (the log would still store and serve junk; `parsed()` is the single gate insert/open/pull all pass); normalizing on receipt (breaks hash/signature — refusal is the only honest outcome); folding into #3068 (JS/TS shape contract — different gate, different failure mode; cross-referenced, neither gates the other — this answers #3187's triage note); pinning the full `a-z0-9-_` world-name charset for `world_id` now (`WorldCore::new` accepts any non-blank ID — charset stays an open question, below).\n\n## Risks (in the doc)\n\n`ArtifactLog::open()` replays through the same gates, so tightened rules apply to stored chains — legitimate chains unaffected (no producer emits these shapes), refusal-on-open with the line named is existing behaviour; `MAX_FRIEND_REQUESTS = 3` is a producer invariant (constant and producer change together); Cf refusal in `world_id` is safe for machine-chosen IDs (`\"home\"`/`\"lobby\"` today).\n\n## Open questions (in the doc, never as issues)\n\n`world_id` charset (`validate_world_name`'s `a-z0-9-_`?) — needs evidence of how `declared()` consumers resolve it; `document.content` internal text NFC (chain's all-text rule vs the `documents.rs` media-type-only precedent); unknown-kind `kind`-string bounds vs forward compatibility; full builder symmetry for `sign`. The neighbouring plain-output rendering family (#2839, #3111, #3089, `world/util.rs` sanitizers) governs *printing* untrusted text, not storing it — not adopted; #3187's Cf pin is deliberately aligned with it.\n\n\n\n## Acceptance criteria\n\n- Phase 1 (adopting #3196 + #3146) and Phase 2 (adopting #3192 + #3187) land under the recorded rules: receipt (`check()` / `parsed()`) refuses with `Refusal::Forbidden` any envelope or known-kind body no in-tree producer could build; duplicates are refused, never silently deduped on receipt.\n- The Phase 3 closing audit completes the field-by-field disposition table (including `kind`, `document.content` internal strings, `prev` shape, builder-side symmetry) and writes the receipt contract sentence into the `pkgs/id/src/artifact.rs` module docs, alongside `documents.rs` / `chain.rs`.\n- No legitimate producer output is refused: existing stored artifact chains replay through `ArtifactLog::open()` unchanged.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-31T23:05:37Z","url":"https://github.com/developing-today/code/issues/3231"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:758ef7b3-29af-0fa8-02b9-986f322769c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A846:8007E:952B7C:C54FD7:6B063534 |
| html-safe-nonce | d73067d1f1f8fe9eb649033529aa91d31af1661f45bbadab37b706dd4ec4974b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODQ2OjgwMDdFOjk1MkI3QzpDNTRGRDc6NkIwNjM1MzQiLCJ2aXNpdG9yX2lkIjoiMjgwNjczMTg3NjcwOTMxNTg5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e137ced2d43f60984d6d4bf959dec7e28c15bdb68b503443e4f9f325ad99eabf |
| hovercard-subject-tag | issue:6140795129 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/3231/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b12f070b5da98e96a8de12b32b2d5836ac4f0fea495404ae0c60ff79a49c5fd/developing-today/code/issues/3231 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b12f070b5da98e96a8de12b32b2d5836ac4f0fea495404ae0c60ff79a49c5fd/developing-today/code/issues/3231 |
| og:image:alt | Design-architect pass 28 (2026-10-31), audit at origin/main 357ec7fb. Full design doc: files/designs/code-id-artifact-receipt-validation.md in the keep-the-four-repos-healthy goal workspace. NO use... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width