docs: passer vision, readcap-and-nuri-model et l'incident en anglais
Le reste du dossier docs/ était déjà en anglais ; ces trois fichiers avaient été rédigés en français par erreur. Traduction fidèle, sans changement de fond : mêmes sections, mêmes tableaux, mêmes blocs de code. Le retour à la ligne dur à 78 colonnes est levé (une ligne par paragraphe, convention du projet). Marqueurs épistémiques préservés et rendus aussi visibles : VERIFIED / INFERRED / CORRECTED / DIRECTION / GAP. Les citations verbatim de commentaires amont restent intactes. Deux incohérences de FOND signalées par la traduction et corrigées ici — elles étaient invisibles tant qu'on lisait chaque section isolément : - readcap-and-nuri-model, section « Caveats / gaps » : elle listait encore le fetch keyless comme hypothèse INFÉRÉE à confirmer, alors que le bloc CORRIGÉ du §4bis la déclare fausse et non constructible. Contradiction interne née de ma correction partielle. Conservée barrée plutôt que supprimée : l'hypothèse est intuitive et se reformera sinon. - incident write-loss : l'intro affirmait en fait établi que « l'écriture n'atteint jamais durablement le broker », alors que la réserve épistémique plus bas dit explicitement que l'alternative (perte d'écriture vs réhydratation à froid) n'est pas tranchée. L'intro ne rapporte plus que le symptôme observé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014GbGgNEHRejVKoREvFuDFg
This commit is contained in:
+84
-205
@@ -1,268 +1,147 @@
|
||||
# Modèle ReadCap & NURI de NextGraph — et l'émulation caps du polyfill
|
||||
# NextGraph's ReadCap & NURI model — and the polyfill's caps emulation
|
||||
|
||||
**Établi 2026-07-20**, VÉRIFIÉ par lecture directe du cœur Rust `nextgraph-rs`
|
||||
(sauf points marqués INFÉRÉ). Les `file:line` sont datés — les numéros de ligne
|
||||
sont volatils, se repérer par symbole/regex.
|
||||
**Established 2026-07-20**, VERIFIED by direct reading of the `nextgraph-rs` Rust core (except for points marked INFERRED). The `file:line` references are dated — line numbers are volatile, navigate by symbol/regex.
|
||||
|
||||
But : donner la vérité-terrain du modèle de droits d'accès NextGraph, pour
|
||||
aligner l'émulation `caps.ts` du polyfill (aujourd'hui une ACL — l'inverse du
|
||||
modèle réel). C'est la base de l'item « aligner ReadCap/WriteCap avec NextGraph ».
|
||||
Purpose: to give the ground truth of NextGraph's access-rights model, in order to align the polyfill's `caps.ts` emulation (today an ACL — the inverse of the real model). This is the basis for the item "align ReadCap/WriteCap with NextGraph".
|
||||
|
||||
---
|
||||
|
||||
## 1. Un ReadCap = possession d'une clé, PAS une ACL par-identité
|
||||
## 1. A ReadCap = possession of a key, NOT a per-identity ACL
|
||||
|
||||
Un **ReadCap est fondamentalement une clé cryptographique que l'on détient**, pas
|
||||
une entrée d'ACL liée à un wallet. « Qui détient la clé peut lire. »
|
||||
A **ReadCap is fundamentally a cryptographic key that one holds**, not an ACL entry tied to a wallet. "Whoever holds the key can read."
|
||||
|
||||
- Structure : `ReadCap = ObjectRef = BlockRef { id: BlockId, key: SymKey }`
|
||||
(`engine/repo/src/types.rs:461, 463-471, 557, 565`).
|
||||
- `id: BlockId` = digest **BLAKE3** (adresse de l'objet chiffré).
|
||||
- `key: SymKey = ChaCha20Key([u8;32])` = la **clé de déchiffrement**.
|
||||
Détenir le couple → le broker sert les blocs chiffrés par `id`, on déchiffre
|
||||
**localement** avec `key`.
|
||||
- Granularité : par commit/objet l'`ObjectRef` **est** le cap ; pour une branche
|
||||
→ commit de définition ; pour un repo → RootBranch ; pour un store → cap du
|
||||
repo racine (`types.rs:559-565`). `ReadCapSecret` = la moitié clé (`:567-570`).
|
||||
- **Il n'y a PAS de read-ACL.** L'appartenance/permissions d'un repo
|
||||
(`RootBranch`, `AddMember`, `AddPermission`) gouvernent l'**écriture/admin**,
|
||||
pas la lecture. La lecture n'est gardée que par la possession de la clé.
|
||||
- Structure: `ReadCap = ObjectRef = BlockRef { id: BlockId, key: SymKey }` (`engine/repo/src/types.rs:461, 463-471, 557, 565`).
|
||||
- `id: BlockId` = **BLAKE3** digest (address of the encrypted object).
|
||||
- `key: SymKey = ChaCha20Key([u8;32])` = the **decryption key**.
|
||||
Holding the pair → the broker serves the encrypted blocks by `id`, and one decrypts **locally** with `key`.
|
||||
- Granularity: per commit/object the `ObjectRef` **is** the cap; for a branch → its defining commit; for a repo → RootBranch; for a store → the root repo's cap (`types.rs:559-565`). `ReadCapSecret` = the key half (`:567-570`).
|
||||
- **There is NO read-ACL.** A repo's membership/permissions (`RootBranch`, `AddMember`, `AddPermission`) govern **writing/admin**, not reading. Reading is guarded only by key possession.
|
||||
|
||||
## 2. Accorder la lecture = sceller la clé au destinataire
|
||||
## 2. Granting read access = sealing the key to the recipient
|
||||
|
||||
« Grant » = livrer le cap **scellé** (`crypto_box seal`, chiffrement à clé
|
||||
publique anonyme) à la **pubkey d'inbox** du destinataire — seul lui l'ouvre avec
|
||||
sa clé privée.
|
||||
"Grant" = delivering the cap **sealed** (`crypto_box seal`, anonymous public-key encryption) to the recipient's **inbox pubkey** — only they can open it with their private key.
|
||||
|
||||
- Message d'inbox scellé : `InboxMsgBody.msg` = `crypto_box::seal(... to_inbox ...)`,
|
||||
ouvert avec la clé secrète d'inbox (`engine/net/src/types.rs:4272, 4299, 4319`).
|
||||
- Le payload peut porter un cap : `ContactDetails.read_cap: Option<ReadCap>`
|
||||
(« if user wants to share the content of profile ») (`net/types.rs:4232-4233`)
|
||||
→ **grant dirigé** (scellé à un destinataire).
|
||||
- Variante **non-dirigée** : `RepoLinkV0.read_cap` = un lien partageable que
|
||||
**quiconque le reçoit** peut ouvrir (`net/types.rs:5061-5078`).
|
||||
- Sealed inbox message: `InboxMsgBody.msg` = `crypto_box::seal(... to_inbox ...)`, opened with the inbox secret key (`engine/net/src/types.rs:4272, 4299, 4319`).
|
||||
- The payload can carry a cap: `ContactDetails.read_cap: Option<ReadCap>` ("if user wants to share the content of profile") (`net/types.rs:4232-4233`) → **directed grant** (sealed to one recipient).
|
||||
- **Undirected** variant: `RepoLinkV0.read_cap` = a shareable link that **whoever receives it** can open (`net/types.rs:5061-5078`).
|
||||
|
||||
Le « ciblage wallet » vit donc dans **l'enveloppe de scellage**, pas dans le cap :
|
||||
le cap reste `{id, clé}`, possession-based.
|
||||
So "wallet targeting" lives in the **sealing envelope**, not in the cap: the cap remains `{id, key}`, possession-based.
|
||||
|
||||
> **État courant (2026-07-27) — le chemin est un MANQUE, pas un désaccord.** Le
|
||||
> champ `ContactDetails.read_cap` existe, mais la construction du message est
|
||||
> `unimplemented!()` (son unique appelant passe « sans read_cap ») et le récepteur
|
||||
> **jette** le cap qu'il recevrait. La *forme* est donc la bonne ; l'implémentation
|
||||
> n'est pas là. Le polyfill l'émule en attendant — fiche dans le bug-inbox.
|
||||
> **Current state (2026-07-27) — the path is a GAP, not a disagreement.** The `ContactDetails.read_cap` field exists, but the construction of the message is `unimplemented!()` (its only caller passes "without read_cap") and the receiver **discards** the cap it would receive. The *shape* is therefore the right one; the implementation is not there. The polyfill emulates it in the meantime — filed in the bug-inbox.
|
||||
|
||||
## 3. Révocation = re-key (grossier, non-rétroactif)
|
||||
## 3. Revocation = re-key (coarse, non-retroactive)
|
||||
|
||||
On ne « reprend » pas une clé livrée. Révoquer = **re-chiffrer** avec une nouvelle
|
||||
clé et ne la re-sceller qu'aux autorisés restants.
|
||||
A delivered key is not "taken back". To revoke = **re-encrypt** with a new key and re-seal it only to the remaining authorized holders.
|
||||
|
||||
- « Capabilities are not durable: they can be refreshed by members and previously
|
||||
shared Caps become obsolete/revoked… if [a member] doesn't subscribe, they lose
|
||||
access after the refresh » (`net/types.rs:5055-5058`).
|
||||
- Mécanisme : `RootCapRefresh` / `BranchCapRefresh` (`repo/src/commit.rs:616,630`;
|
||||
perms `types.rs:1748-1749`).
|
||||
- Conséquences : **grossier** (échelle repo/branche), **non-rétroactif** (ce qui a
|
||||
été lu avant reste connu de l'ex-détenteur ; il ne déchiffre que les versions
|
||||
**antérieures** au refresh).
|
||||
- Livraison **durable** d'un cap = `PermaCap` — encore **TODO** (`repo/types.rs:578`).
|
||||
- "Capabilities are not durable: they can be refreshed by members and previously shared Caps become obsolete/revoked… if [a member] doesn't subscribe, they lose access after the refresh" (`net/types.rs:5055-5058`).
|
||||
- Mechanism: `RootCapRefresh` / `BranchCapRefresh` (`repo/src/commit.rs:616,630`; perms `types.rs:1748-1749`).
|
||||
- Consequences: **coarse** (repo/branch scale), **non-retroactive** (what was read before remains known to the former holder; they only decrypt the versions **prior to** the refresh).
|
||||
- **Durable** delivery of a cap = `PermaCap` — still **TODO** (`repo/types.rs:578`).
|
||||
|
||||
### DIRECTION — la rotation ne fait PAS perdre l'accès (confirmé PO, 2026-07-27)
|
||||
### DIRECTION — rotation does NOT cause access to be lost (confirmed by the PO, 2026-07-27)
|
||||
|
||||
**Ne pas lire le commentaire ci-dessus comme l'intention.** « *if they don't
|
||||
subscribe, they lose access after the refresh* » décrit **l'état courant**, pas la
|
||||
cible. Ce que NextGraph vise :
|
||||
**Do not read the comment above as the intent.** "*if they don't subscribe, they lose access after the refresh*" describes **the current state**, not the target. What NextGraph is aiming for:
|
||||
|
||||
> Quand une clé tourne, la nouvelle est **envoyée dans l'inbox** des utilisateurs
|
||||
> qui conservent le droit d'accès. Cette inbox est **traitée automatiquement** dès
|
||||
> qu'un client de l'utilisateur se connecte.
|
||||
> When a key is rotated, the new one is **sent to the inbox** of the users who retain the access right. That inbox is **processed automatically** as soon as one of the user's clients connects.
|
||||
|
||||
Donc l'accès n'est **pas perdu**, il est **différé** jusqu'à la prochaine connexion
|
||||
— cohérent avec le local-first. Conséquences de forme : **aucune obligation
|
||||
d'abonnement** à exposer au consommateur ; une re-livraison emprunte **le même
|
||||
canal** que la livraison initiale, donc le mécanisme de partage couvre les deux
|
||||
sans cas particulier. La **révocation** reste « cesser de re-livrer », non
|
||||
rétroactive.
|
||||
So access is **not lost**, it is **deferred** until the next connection — consistent with local-first. Shape consequences: **no subscription obligation** to expose to the consumer; a re-delivery takes **the same channel** as the initial delivery, so the sharing mechanism covers both with no special case. **Revocation** remains "stop re-delivering", non-retroactive.
|
||||
|
||||
## 4. Grammaire NURI : cap-less vs cap-porteur (le segment `:k:`)
|
||||
## 4. NURI grammar: cap-less vs cap-bearing (the `:k:` segment)
|
||||
|
||||
**Lever la confusion d'abord** : `did:ng:` n'est **pas** un marqueur de « sans
|
||||
cap », c'est le **préfixe de schéma d'URI** — présent partout (inbox `did:ng:d:…`,
|
||||
branche `did:ng:b:…`, overlay `did:ng:v:…`, document `did:ng:o:…`). Un NURI **est**
|
||||
un `did:ng:…`. Il n'y a donc pas « le did » d'un côté et « le NURI » de l'autre :
|
||||
c'est **un seul objet**, avec ou sans la clé dedans — un seul type en amont,
|
||||
`NuriV0 { target, access }`, où un NURI cap-less a simplement `access` vide.
|
||||
**Clearing up the confusion first**: `did:ng:` is **not** a "cap-less" marker, it is the **URI scheme prefix** — present everywhere (inbox `did:ng:d:…`, branch `did:ng:b:…`, overlay `did:ng:v:…`, document `did:ng:o:…`). A NURI **is** a `did:ng:…`. So there is no "the did" on one side and "the NURI" on the other: it is **a single object**, with or without the key inside it — a single type upstream, `NuriV0 { target, access }`, where a cap-less NURI simply has an empty `access`.
|
||||
|
||||
Le discriminant est le segment **`:k:{clé}`** : présent = cap-porteur ; **absent =
|
||||
cap-less** (nomme/localise **sans** donner le droit de lire). C'est de **première
|
||||
classe** dans le type : `NuriV0.target` (des ids) et `access`/`objects` (le cap)
|
||||
sont des **champs séparés** — un NURI d'id parse avec `access: vec![]`
|
||||
(`engine/net/src/app_protocol.rs:53-62, 99-118, 181-195, 659-677`).
|
||||
The discriminant is the **`:k:{key}`** segment: present = cap-bearing; **absent = cap-less** (names/locates **without** granting the right to read). This is **first-class** in the type: `NuriV0.target` (ids) and `access`/`objects` (the cap) are **separate fields** — an id-only NURI parses with `access: vec![]` (`engine/net/src/app_protocol.rs:53-62, 99-118, 181-195, 659-677`).
|
||||
|
||||
**Cap-less** (id + overlay éventuel, pas de clé) — formatters `app_protocol.rs`,
|
||||
regexes `net/types.rs` :
|
||||
**Cap-less** (id + optional overlay, no key) — formatters in `app_protocol.rs`, regexes in `net/types.rs`:
|
||||
- `did:ng:o:{repo_id}` (`:315`, `RE_REPO_O` types.rs:52)
|
||||
- `did:ng:o:{repo_id}:v:{overlay_id}` (`:263`, `RE_REPO` types.rs:55)
|
||||
- `did:ng:o:{repo_id}:v:{overlay_id}:b:{branch_id}` (`RE_BRANCH` types.rs:58)
|
||||
- `did:ng:o:{repo_id}:c:{commit_id}` (`:355`)
|
||||
- `did:ng:b:{branch}` / `h:{topic}` / `v:{overlay}` / `d:{inbox}` (`:327,323,319,359`)
|
||||
|
||||
**Cap-porteur** (embarque la clé) :
|
||||
- `did:ng:j:{id}:k:{clé}` — read cap d'objet/fichier (`repo/types.rs:511`,
|
||||
`RE_FILE_READ_CAP` types.rs:49)
|
||||
- `did:ng:o:{repo}:c:{commit}:k:{clé}` (`RE_COMMIT` types.rs:73)
|
||||
- liste `RE_OBJECTS` `…:[cj]:{id}:k:{clé}…:l:{locator}` (types.rs:64)
|
||||
**Cap-bearing** (embeds the key):
|
||||
- `did:ng:j:{id}:k:{key}` — object/file read cap (`repo/types.rs:511`, `RE_FILE_READ_CAP` types.rs:49)
|
||||
- `did:ng:o:{repo}:c:{commit}:k:{key}` (`RE_COMMIT` types.rs:73)
|
||||
- list `RE_OBJECTS` `…:[cj]:{id}:k:{key}…:l:{locator}` (types.rs:64)
|
||||
|
||||
Le segment `:v:` est l'**overlay**, qui a sa propre section ci-dessous — c'est le
|
||||
point le plus lourd de conséquences pour les modèles de présence anonyme.
|
||||
The `:v:` segment is the **overlay**, which has its own section below — it is the point with the heaviest consequences for anonymous-presence models.
|
||||
|
||||
## 4bis. L'overlay est l'espace réseau d'un STORE — jamais d'un document
|
||||
## 4bis. The overlay is the network space of a STORE — never of a document
|
||||
|
||||
**L'overlay est l'unité d'adressage réseau d'un store.** Chez le broker, les blocs
|
||||
sont rangés sous une clé `(overlay, block_id)`, et les pairs se synchronisent
|
||||
*dans* un overlay. Deux formes par store :
|
||||
**The overlay is a store's unit of network addressing.** At the broker, blocks are filed under a `(overlay, block_id)` key, and peers synchronize *within* an overlay. Two forms per store:
|
||||
|
||||
| | Dérivation | Qui peut le calculer |
|
||||
| | Derivation | Who can compute it |
|
||||
|---|---|---|
|
||||
| **outer** | `OverlayId::outer(store_id)` = BLAKE3 **public** | tout le monde (le store_id suffit) |
|
||||
| **inner** | `OverlayId::inner(store_id, readcap_secret)` = BLAKE3 **keyed** | seulement qui détient la clé de lecture du store |
|
||||
| **outer** | `OverlayId::outer(store_id)` = **public** BLAKE3 | everyone (the store_id is enough) |
|
||||
| **inner** | `OverlayId::inner(store_id, readcap_secret)` = **keyed** BLAKE3 | only whoever holds the store's read key |
|
||||
|
||||
Cohérent avec le reste du modèle : pas de rôle ni de liste, seulement « détiens-tu
|
||||
la clé qui permet de dériver cet identifiant ». `outer` = le nom public du store,
|
||||
`inner` = son nom privé.
|
||||
Consistent with the rest of the model: no role and no list, only "do you hold the key that lets you derive this identifier". `outer` = the store's public name, `inner` = its private name.
|
||||
|
||||
**Le `:v:` d'un NURI de DOCUMENT porte l'overlay de son STORE** (VÉRIFIÉ, chaîne
|
||||
lue de bout en bout) : `NuriV0::repo_graph_name(repo_id, overlay_id)` formate
|
||||
`o:{repo_id}:v:{overlay_id}` ; dans `doc_create` la valeur injectée est
|
||||
`store.outer_overlay()` — le store **contenant**, jamais le `repo_id`. Un `Repo` ne
|
||||
porte **aucun** champ overlay (seulement `store: Arc<Store>`) ; c'est `Store` qui
|
||||
porte `overlay_id`. **Contre-preuve mécanique** : dans `Store`, `get`/`put`/`del`/`has`
|
||||
passent tous `&self.overlay_id` au block storage — tous les documents d'un store
|
||||
partagent le namespace de blocs, donc un overlay par-document est structurellement
|
||||
impossible.
|
||||
**The `:v:` of a DOCUMENT NURI carries the overlay of its STORE** (VERIFIED, chain read end to end): `NuriV0::repo_graph_name(repo_id, overlay_id)` formats `o:{repo_id}:v:{overlay_id}`; in `doc_create` the value injected is `store.outer_overlay()` — the **containing** store, never the `repo_id`. A `Repo` carries **no** overlay field (only `store: Arc<Store>`); it is `Store` that carries `overlay_id`. **Mechanical counter-proof**: in `Store`, `get`/`put`/`del`/`has` all pass `&self.overlay_id` to the block storage — every document of a store shares the same block namespace, so a per-document overlay is structurally impossible.
|
||||
|
||||
### La conséquence à connaître : le `:v:` est un pseudonyme stable
|
||||
### The consequence to know about: the `:v:` is a stable pseudonym
|
||||
|
||||
**Tous les documents d'une même personne dans son store protected portent le MÊME
|
||||
`:v:`** = `outer(protected_store_id)`. Donc une référence cap-less — précisément
|
||||
celle qu'on utilise pour « nommer sans donner à lire » — **expose l'appartenance
|
||||
au store**, c'est-à-dire un **identifiant pseudonyme stable et permanent de la
|
||||
personne**. Le store_id lui-même ne fuit pas (BLAKE3 non inversible), donc ça ne
|
||||
dit pas *qui* ; mais c'est un **handle constant**, le même partout et pour
|
||||
toujours, corrélable par quiconque collecte des références cap-less.
|
||||
**All of one person's documents in their protected store carry the SAME `:v:`** = `outer(protected_store_id)`. So a cap-less reference — precisely the one used to "name without granting read" — **exposes store membership**, that is to say a **stable and permanent pseudonymous identifier of the person**. The store_id itself does not leak (BLAKE3 is not invertible), so it does not say *who*; but it is a **constant handle**, the same everywhere and forever, correlatable by anyone who collects cap-less references.
|
||||
|
||||
**Le couplage qui en résulte, et qui contraint tout modèle de présence anonyme** :
|
||||
ce même `:v:` est *simultanément* (a) ce qui permet de **dédupliquer** des
|
||||
références sans les lire — deux références de même `:v:` viennent de la même
|
||||
personne — et (b) ce qui permet de **tracer** cette personne d'un contexte à
|
||||
l'autre. **C'est le même bit d'information.** On ne peut pas obtenir la dédup sans
|
||||
concéder le traçage, ni supprimer le traçage sans perdre la dédup — sauf à changer
|
||||
le découpage en stores, ce qui déplace le curseur mais ne supprime pas l'arbitrage.
|
||||
**The coupling that results, and that constrains any anonymous-presence model**: that same `:v:` is *simultaneously* (a) what makes it possible to **deduplicate** references without reading them — two references with the same `:v:` come from the same person — and (b) what makes it possible to **track** that person from one context to another. **It is the same bit of information.** You cannot get the dedup without conceding the tracking, nor remove the tracking without losing the dedup — short of changing how the stores are carved up, which moves the cursor but does not remove the trade-off.
|
||||
|
||||
*Nuances.* Le `:v:` du NURI est l'overlay **outer**, alors que le trafic
|
||||
client↔broker et le stockage local utilisent l'**inner** — valeur différente, mais
|
||||
tirée du store elle aussi, donc la propriété tient dans les deux cas. Un store
|
||||
`Dialog` renvoie un `Inner`, toujours store-scopé.
|
||||
*Nuances.* The NURI's `:v:` is the **outer** overlay, whereas client↔broker traffic and local storage use the **inner** one — a different value, but derived from the store as well, so the property holds in both cases. A `Dialog` store returns an `Inner`, still store-scoped.
|
||||
|
||||
**CORRIGÉ le 2026-07-27 — cette hypothèse était FAUSSE.** On avait inféré, puis
|
||||
cru vérifier, qu'un détenteur **sans clé** pouvait récupérer les blocs chiffrés et
|
||||
donc prouver l'**existence** d'un document. Une revue adverse a montré que le
|
||||
raisonnement s'arrêtait au *contrôle d'accès* sans regarder l'**adressage** :
|
||||
**CORRECTED on 2026-07-27 — this hypothesis was FALSE.** We had inferred, then believed we had verified, that a holder **without a key** could fetch the encrypted blocks and therefore prove a document's **existence**. An adversarial review showed that the reasoning stopped at *access control* without looking at **addressing**:
|
||||
|
||||
- Il n'existe **aucune commande d'existence au niveau SDK**.
|
||||
- La seule sonde (`BlocksExist`) est **interne au crate**, exige des `BlockId`
|
||||
**et** un repo déjà **chargé**, et adresse l'overlay **inner** — lequel est
|
||||
dérivé du **secret de lecture**.
|
||||
- Une référence cap-less porte un RepoId et l'overlay **outer** : aucun `BlockId`
|
||||
à sonder. Et l'outer n'est de toute façon jamais enregistré (`expose_outer`
|
||||
codé en dur à `false`, sans paramètre SDK).
|
||||
- Le seul primitif accessible à un non-membre (`ExtObjectGet`) exige les ObjectIds
|
||||
**et leurs clés**.
|
||||
- There is **no existence command at the SDK level**.
|
||||
- The only probe (`BlocksExist`) is **internal to the crate**, requires `BlockId`s **and** an already **loaded** repo, and addresses the **inner** overlay — which is derived from the **read secret**.
|
||||
- A cap-less reference carries a RepoId and the **outer** overlay: no `BlockId` to probe. And the outer is never registered anyway (`expose_outer` hard-coded to `false`, with no SDK parameter).
|
||||
- The only primitive accessible to a non-member (`ExtObjectGet`) requires the ObjectIds **and their keys**.
|
||||
|
||||
> **L'adressage lui-même présuppose le cap.** Prouver l'existence d'un document
|
||||
> sans détenir sa clé n'est pas constructible aujourd'hui, et rien n'indique que
|
||||
> ce soit prévu.
|
||||
> **Addressing itself presupposes the cap.** Proving a document's existence without holding its key is not constructible today, and nothing indicates that it is planned.
|
||||
|
||||
Leçon transposable : vérifier qu'une garde d'accès **laisse passer** ne prouve pas
|
||||
qu'une opération est atteignable — encore faut-il pouvoir **nommer** ce qu'on
|
||||
demande.
|
||||
Transferable lesson: verifying that an access guard **lets you through** does not prove that an operation is reachable — you still have to be able to **name** what you are asking for.
|
||||
|
||||
## 4ter. Le store public : lisible par l'URL, et NON récursif
|
||||
## 4ter. The public store: readable by URL, and NOT recursive
|
||||
|
||||
Principe cible (confirmé PO, 2026-07-27) :
|
||||
Target principle (confirmed by the PO, 2026-07-27):
|
||||
|
||||
> **Un élément du store public est public : qui a l'URL lit le contenu.**
|
||||
> Mais **pas récursivement** — un contenu public peut *référencer* du contenu
|
||||
> privé, et la référence ne donne **pas** accès au référencé.
|
||||
> **An element of the public store is public: whoever has the URL reads the content.**
|
||||
> But **not recursively** — public content can *reference* private content, and the reference does **not** give access to the referenced.
|
||||
|
||||
C'est un **second mécanisme**, à côté de la possession de clé (§1) — pas une
|
||||
entorse. Et c'est la **non-récursivité** qui porte la valeur : elle autorise un
|
||||
objet public qui **pointe** vers de l'identité privée, sans la divulguer. C'est
|
||||
exactement le motif dont un modèle de présence anonyme a besoin.
|
||||
This is a **second mechanism**, alongside key possession (§1) — not a breach of it. And it is the **non-recursiveness** that carries the value: it allows a public object that **points** to private identity, without divulging it. That is exactly the pattern an anonymous-presence model needs.
|
||||
|
||||
*Détail d'implémentation, à ne PAS faire porter par la forme* : NextGraph s'oriente
|
||||
vers un **non-chiffrement** du contenu du store public (les données restant
|
||||
**signées**). Une surface ne doit pas en dépendre. Et si le store public ne se
|
||||
comporte pas comme ce principe le décrit, c'est **le polyfill** qui s'adapte, pas
|
||||
le consommateur.
|
||||
*Implementation detail, NOT to be carried by the shape*: NextGraph is moving toward **not encrypting** the content of the public store (the data remaining **signed**). A surface must not depend on it. And if the public store does not behave the way this principle describes, it is **the polyfill** that adapts, not the consumer.
|
||||
|
||||
## 4quater. Le trousseau : d'où le propriétaire tire les caps de SES documents
|
||||
## 4quater. The keyring: where the owner gets the caps for THEIR OWN documents
|
||||
|
||||
À chaque création de document, un `AddRepo { read_cap }` est commité sur une
|
||||
**branche du store** — le store étant lui-même un repo, doté de branches **typées**
|
||||
(le mot « branche » n'a rien de git : c'est un compartiment à rôle défini). Cette
|
||||
branche liste **les documents du store, chacun avec sa clé de lecture**.
|
||||
On every document creation, an `AddRepo { read_cap }` is committed to a **store branch** — the store being itself a repo, endowed with **typed** branches (the word "branch" has nothing to do with git: it is a compartment with a defined role). That branch lists **the store's documents, each with its read key**.
|
||||
|
||||
Elle **est** donc le **trousseau du propriétaire** : le mécanisme par lequel il
|
||||
retrouve les caps de ses propres documents. En amont, le trousseau, c'est le
|
||||
**wallet**.
|
||||
So it **is** the **owner's keyring**: the mechanism by which they find the caps of their own documents. Upstream of that, the keyring is the **wallet**.
|
||||
|
||||
**Ce n'est PAS le mécanisme de partage.** Confusion facile et coûteuse : en déduire
|
||||
« on partage au niveau du store » est faux — livrer un cap de store donnerait accès
|
||||
à **tout** son contenu, présent et futur. **L'unité de partage est le document**
|
||||
(§2). Le trousseau est un index privé, pas un geste de partage.
|
||||
**This is NOT the sharing mechanism.** An easy and costly confusion: concluding "we share at the store level" is wrong — delivering a store cap would give access to **all** of its content, present and future. **The unit of sharing is the document** (§2). The keyring is a private index, not an act of sharing.
|
||||
|
||||
*(VÉRIFIÉ pour le mécanisme `AddRepo { read_cap }` ; le **nom exact** des branches
|
||||
et l'énumération de leurs types n'ont pas été re-tracés — à confirmer si ce point
|
||||
devient porteur.)*
|
||||
*(VERIFIED for the `AddRepo { read_cap }` mechanism; the **exact name** of the branches and the enumeration of their types have not been re-traced — to be confirmed if this point becomes load-bearing.)*
|
||||
|
||||
## 5. Ce que le polyfill émule (caps.ts) — et où ça diverge
|
||||
## 5. What the polyfill emulates (caps.ts) — and where it diverges
|
||||
|
||||
`packages/client/src/caps.ts` modélise `readers: Map<Nuri, Set<PrincipalId>>` +
|
||||
`grantRead(doc, grantee)` (`:29-30, 41-42`) — **une ACL de principals par
|
||||
document, soit l'INVERSION exacte du modèle réel** (clé). Divergences :
|
||||
`packages/client/src/caps.ts` models `readers: Map<Nuri, Set<PrincipalId>>` + `grantRead(doc, grantee)` (`:29-30, 41-42`) — **a per-document ACL of principals, that is the exact INVERSION of the real model** (key). Divergences:
|
||||
|
||||
| | Réel NextGraph | Émulation caps.ts |
|
||||
| | Real NextGraph | caps.ts emulation |
|
||||
|---|---|---|
|
||||
| Nature | possession de **clé** | **ACL** (set de principals) |
|
||||
| Grant | sceller la clé (crypto_box) à l'inbox | ajouter un principal au set |
|
||||
| Durabilité | **durable** (clé livrée une fois) | **éphémère** (Map vide à chaque session → re-déclarée) |
|
||||
| Révocation | **re-key** grossier, non-rétroactif | retrait du set : **instantané et total** |
|
||||
| Granularité | repo / branche / commit / objet | **un cap par doc-NURI** |
|
||||
| Réf. sans droit | **NURI cap-less** (sans `:k:`) | pas de notion (l'ACL dit qui peut) |
|
||||
| Nature | possession of a **key** | **ACL** (set of principals) |
|
||||
| Grant | seal the key (crypto_box) to the inbox | add a principal to the set |
|
||||
| Durability | **durable** (key delivered once) | **ephemeral** (Map empty every session → re-declared) |
|
||||
| Revocation | coarse **re-key**, non-retroactive | removal from the set: **instantaneous and total** |
|
||||
| Granularity | repo / branch / commit / object | **one cap per doc-NURI** |
|
||||
| Ref. without rights | **cap-less NURI** (no `:k:`) | no such notion (the ACL says who may) |
|
||||
|
||||
**Face app** : `declareConnections` (côté consommateur) qui re-déclare « mes
|
||||
connexions lisent mes entités protected » **à chaque session** est un **artefact
|
||||
de cette ACL éphémère** — sans objet dans le modèle réel (les scellages y sont
|
||||
durables ; on scelle par-doc au partage, pas par-session).
|
||||
**App-facing**: `declareConnections` (on the consumer side), which re-declares "my connections read my protected entities" **every session**, is an **artifact of this ephemeral ACL** — moot in the real model (there the seals are durable; one seals per-doc at share time, not per-session).
|
||||
|
||||
## 6. Implications pour les consommateurs (ex. Festipod)
|
||||
## 6. Implications for consumers (e.g. Festipod)
|
||||
|
||||
- « **scope protected = mon réseau peut lire** » n'est **pas** une ACL vérifiée
|
||||
par le broker : c'est « j'ai **scellé ma read key** à chacune de mes
|
||||
connexions ». Le modèle mental « scope = ACL » est faux au niveau NextGraph.
|
||||
- **Références anonymes possibles** : mettre un **NURI cap-less** dans une
|
||||
collection tierce laisse le tiers **nommer/compter** sans **lire l'identité** ;
|
||||
sceller le cap-porteur séparément aux seuls autorisés. (Base d'un modèle de
|
||||
présence « participation auto-possédée + Set curé cap-less + cap scellé aux
|
||||
connexions ».)
|
||||
- **Alignement à faire** : quand les vraies opérations de cap seront disponibles,
|
||||
remplacer l'ACL émulée par du scellage de clé durable par-doc, et
|
||||
`declareConnections`-comme-ACL-ré-déclarée disparaît.
|
||||
- "**protected scope = my network can read**" is **not** an ACL checked by the broker: it is "I have **sealed my read key** to each of my connections". The "scope = ACL" mental model is wrong at the NextGraph level.
|
||||
- **Anonymous references are possible**: putting a **cap-less NURI** in a third party's collection lets that third party **name/count** without **reading the identity**; the cap-bearing one is sealed separately to the authorized parties only. (Basis for a presence model of the form "self-owned participation + curated cap-less Set + cap sealed to the connections".)
|
||||
- **Alignment to do**: when the real cap operations become available, replace the emulated ACL with durable per-doc key sealing, and `declareConnections`-as-a-re-declared-ACL disappears.
|
||||
|
||||
## Réserves / lacunes
|
||||
## Caveats / gaps
|
||||
|
||||
- `file:line` datés (2026-07) — re-vérifier par symbole ; le core bouge.
|
||||
- INFÉRÉ : fetch broker keyless (existence sans clé) — non tracé au runtime.
|
||||
- Non tracé : exécution complète de `RootCapRefresh` côté verifier
|
||||
(`verifier/src/commits/mod.rs:616`), stockage wallet de `private_store_read_cap`
|
||||
(`repo/types.rs:945,976`).
|
||||
- `file:line` references are dated (2026-07) — re-verify by symbol; the core moves.
|
||||
- ~~INFERRED: keyless broker fetch (existence without a key)~~ — **RESOLVED and REFUTED, 2026-07-27**: not constructible. See the CORRECTED block in §4bis. Kept struck through because the hypothesis is intuitive and will otherwise be re-formed.
|
||||
- Not traced: the full execution of `RootCapRefresh` on the verifier side (`verifier/src/commits/mod.rs:616`), wallet storage of `private_store_read_cap` (`repo/types.rs:945,976`).
|
||||
|
||||
Reference in New Issue
Block a user