docs: le nommage de NextGraph l'emporte toujours — y compris sur nos propres règles

La règle que je venais d'écrire bannissait « publish » sans réserve. Or le
moteur emploie `publisher` 126 fois — `as_publisher`, `publisher_advert` — pour
un rôle pub/sub sur un topic. Une règle appliquée à la lettre aurait fait
rejeter du vocabulaire amont, ce qui est exactement l'inverse du but.

Le principe est donc posé au-dessus, et il prime sur tout : là où la cible a un
mot, c'est le mot, point. Ce qui reste banni est NOTRE « publier un document »,
qui n'a aucun référent en amont et recouvre trois actes distincts — placer dans
un store public, rendre trouvable, remettre une clé. Ça n'autorise jamais à
renommer ce que l'amont appelle `publisher`.

`publisher`, `topic` et `advert` rejoignent le vocabulaire déclaré du contrôle
de noms, avec la raison en commentaire.

Le renommage `publishRepoLink` → `recordInPublicStore` reste justifié : cette
méthode n'a pas de pendant amont, elle enregistre un document en store public
(et, artefact d'émulation, lui frappe une clé).
This commit is contained in:
Sylvain Duchesne
2026-08-06 15:50:54 +02:00
parent 7672915bb9
commit 3c981ffadb
8 changed files with 46 additions and 28 deletions
+7 -7
View File
@@ -87,15 +87,15 @@ test("a cap received (learn) reads, exactly like one minted", () => {
expect(bob.caps.capFor(doc)).toBe(cap);
});
test("publishRepoLink returns a cap-bearing link; reading it still means HOLDING it", () => {
test("recordInPublicStore returns a cap-bearing link; reading it still means HOLDING it", () => {
const { caps, become } = registry("alice");
const doc = "did:ng:o:public-doc";
const link = caps.publishRepoLink(doc);
const link = caps.recordInPublicStore(doc);
expect(hasReadCap(link)).toBe(true);
expect(targetOf(link)).toBe(doc);
expect(caps.isPublished(doc)).toBe(true);
expect(caps.isPublished("did:ng:o:other")).toBe(false);
expect(caps.isInPublicStore(doc)).toBe(true);
expect(caps.isInPublicStore("did:ng:o:other")).toBe(false);
// Publication is not a world-wide read grant: whoever HAS the URL reads it.
become("bob");
@@ -110,9 +110,9 @@ test("open(): a public document is published as a link, a private one is not", (
const prot = caps.open("did:ng:o:prot", "protected");
const priv = caps.open("did:ng:o:priv", "private");
expect(caps.isPublished("did:ng:o:pub")).toBe(true);
expect(caps.isPublished("did:ng:o:prot")).toBe(false);
expect(caps.isPublished("did:ng:o:priv")).toBe(false);
expect(caps.isInPublicStore("did:ng:o:pub")).toBe(true);
expect(caps.isInPublicStore("did:ng:o:prot")).toBe(false);
expect(caps.isInPublicStore("did:ng:o:priv")).toBe(false);
// All three are readable BY THEIR OWNER — a creator is never locked out.
for (const [doc, cap] of [["did:ng:o:pub", pub], ["did:ng:o:prot", prot], ["did:ng:o:priv", priv]] as const) {
expect(caps.capFor(doc)).toBe(cap);
@@ -254,7 +254,7 @@ test("(b) a bare reference reads nothing; the repo link of a published document
setCurrentUser("alice");
const pub = await createEntityDoc("alice", "public");
const items = [item(pub, "u1")];
expect(getCaps().isPublished(pub)).toBe(true);
expect(getCaps().isInPublicStore(pub)).toBe(true);
const link = linkTo(pub);
// bob HAS the document's bare NURI (it is right there in `items`) and reads nothing.
+1 -1
View File
@@ -18,7 +18,7 @@ function setup(initial: string | null = "alice") {
const before = holder;
holder = "alice";
caps.mint("did:ng:o:alice");
const link = caps.publishRepoLink("did:ng:o:public");
const link = caps.recordInPublicStore("did:ng:o:public");
holder = before;
return { caps, link, become: (id: string | null) => (holder = id) };
}
+5
View File
@@ -42,6 +42,11 @@ const TARGET_WORDS = new Set([
"fetch", "init", "watch", "sparql", "ng", "orm", "type", "types",
// RDF / SPARQL terms the engine's own query paths use
"subject", "base", "schema", "connected", "identity", "identities",
// `publisher` is upstream's word for a pub/sub role on a topic (`as_publisher`,
// `publisher_advert`, 126 occurrences in the engine). Our own "publish a document" is
// banned as ambiguous, but that ban never reaches upstream's term — see the traps
// block in `docs/readcap-and-nuri-model.md`.
"publisher", "topic", "advert",
// the reactive model the ORM exposes (`OrmSubscription`, `DeepSignalSet`)
"observable", "deep", "signal", "set",
]);