๐ README.md
D-OPEN SOVEREIGN
1# `@the_library/canonical-schemas`
2
3The governance artifact and TypeScript type library at the heart of the D-SAFE ecosystem. This package is the single source of truth for all canonical model definitions, international standard definitions, and their multilingual translations. Every D-SAFE application โ from DataPond's own frontend to any third-party institution building on the sovereign library stack โ installs this package as a dependency.
4
5> **No runtime code lives here.** `@the_library/canonical-schemas` ships JSON governance files and TypeScript interfaces only. Executable adapter logic lives in the companion package [`@the_library/standard-adapters`](#dependency-on-the_librarystandard-adapters).
6
7---
8
9## Licence
10
11This package is released under the **D-Open Code Sovereign Licence v1.0**.
12
13Full text: [registry.worldbibliotech.com/licence.html](https://registry.worldbibliotech.com/licence.html)
14
15See the [`LICENSE`](./LICENSE) file in this directory. [Read more about the licence below.](#the-d-open-code-sovereign-licence--source-code)
16
17---
18
19## Package layout
20
21```
22packages/canonical-schemas/
23 standards/ International standard definitions (StandardDefinition JSON)
24 isbn.json ISO 2108:2017 โ International Standard Book Number
25 issn.json ISO 3297:2007 โ International Standard Serial Number
26 isni.json ISO 27729:2012 โ International Standard Name Identifier
27 orcid.json Open Researcher and Contributor ID
28 ddc.json Dewey Decimal Classification (OCLC / Library of Congress)
29 lcc.json Library of Congress Classification
30 udc.json Universal Decimal Classification (UDC Consortium)
31 clc.json Chinese Library Classification (National Library of China)
32 bbk.json Library-Bibliographical Classification (Russian State Library)
33 tlc.json Thai Library Classification (National Library of Thailand)
34 cc.json Colon Classification (S.R. Ranganathan)
35
36 types/ TypeScript interface definitions โ zero runtime code
37 StandardAdapter.ts StandardAdapter<TProps, TApis>, StandardApiAdapter, ValidationResult
38 StandardDefinition.ts StandardDefinition, StandardProp, ExternalApiEntry, FieldMapping
39
40 definitions/
41 canonical/ ModelDefinition files for canonical entity types
42 Book.json multipleInstances: true; instanceUidStrategy drives isbn codegen
43 Person.json uidStrategy: ["isni", "orcid"]
44 Tag.json uidStrategy: ["ddc"]
45 enums/
46 CopyrightStatus.json
47 QualityScore.json
48
49 schemas/
50 StandardDefinition.1.0.json JSON Schema (meta-schema) for all standards/ files
51
52 governance/
53 GOVERNANCE.md Rules for proposing changes to canonical definitions
54 changelog.md Every decision: who approved what and when
55```
56
57---
58
59## Architecture: the two-tier definition hierarchy
60
61Schema definitions in the D-SAFE ecosystem are split into two tiers.
62
63```
64@the_library/canonical-schemas โ governance package (DataPond publishes and controls)
65 definitions/canonical/
66 Book.json โ canonical: true
67 Person.json
68 Tag.json
69
70packages/db_schema_v2 โ compiler + codec (consumes canonical-schemas)
71 definitions/ โ app-level definitions only
72 member.json โ canonical: false (DataPond-specific)
73```
74
75The canonical package is an **npm dependency** that every D-SAFE app installs. Third-party developers never edit it directly; they open a PR against the canonical repo to propose new models or translations. This design solves the **cross-app conflict problem**: without a shared authority, two apps that both define a `Book.title` prop could assign conflicting binary layouts, causing silent data corruption when records from different libraries are merged. With this package, canonical propIds are seeded first (IDs 0โ511) and every app's compiler enforces the no-override invariant: a local definition may extend a canonical model but may never alter its prop names, types, bit widths, or enum references.
76
77---
78
79## Standards
80
81Each file in `standards/` is a `StandardDefinition` โ a machine-readable description of one international identifier standard. It specifies:
82
83- The **props** the standard contributes to implementing models (name, wire type, normalization, display, check digit algorithm, regex pattern)
84- The **Mode S URI scheme** used for standards-first entity addressing (`sfcuid()`)
85- The **Linked Data URI template** for RDF/LOD output
86- **Discovery metadata** for external APIs, including field mappings and rate limits
87
88### Initial release: identifier standards
89
90| Standard | ID | Governing body | ISO ref | Check digit |
91|---|---|---|---|---|
92| ISBN-13 | `isbn` | International ISBN Agency | ISO 2108:2017 | isbn-13-luhn |
93| ISSN | `issn` | ISSN International Centre | ISO 3297:2007 | iso7064-mod11-2 |
94| ISNI | `isni` | ISNI International Agency | ISO 27729:2012 | iso7064-mod11-2 |
95| ORCID iD | `orcid` | ORCID Inc. | โ | iso7064-mod11-2 |
96
97### Classification standards
98
99| Standard | ID | Governing body |
100|---|---|---|
101| Dewey Decimal Classification | `ddc` | OCLC (licensed from Library of Congress) |
102| Library of Congress Classification | `lcc` | Library of Congress |
103| Universal Decimal Classification | `udc` | UDC Consortium |
104| Chinese Library Classification | `clc` | National Library of China |
105| Library-Bibliographical Classification (ะะะ) | `bbk` | Russian State Library |
106| Thai Library Classification | `tlc` | National Library of Thailand |
107| Colon Classification | `cc` | S.R. Ranganathan (historical) |
108
109Classification standards (ddc and friends) have `externalApis: []` โ the classifier assigns notations based on content; no external lookup is needed.
110
111### Normalization and display algorithms
112
113Each `props[]` entry declares `normalize` and `display` algorithm IDs. The `db_schema_v2` compiler and `@the_library/standard-adapters` both implement these:
114
115| Algorithm | Used by | Normalized form |
116|---|---|---|
117| `compact-13` | ISBN | 13 compact digits; ISBN-10 converted to ISBN-13 |
118| `hyphenated-8` | ISSN | `NNNN-NNNX` |
119| `compact-16` | ISNI | 16 compact digits |
120| `hyphenated-4x4` | ORCID | `NNNN-NNNN-NNNN-NNNX` |
121| `ddc-notation` | DDC | Trim trailing zeros; normalize dots |
122
123The normalized form is always the standard's own authoritative storage format, not a universal compactness rule. ORCID retains hyphens because the ORCID spec mandates `NNNN-NNNN-NNNN-NNNX`; ISBN strips them because library convention does.
124
125---
126
127## ModelDefinition and `uidStrategy`
128
129`ModelDefinition` files in `definitions/canonical/` may declare a `uidStrategy` field that references standard IDs. This is what links a canonical model to its external identifiers.
130
131```json
132// definitions/canonical/Book.json (excerpt)
133{
134 "name": "Book",
135 "canonical": true,
136 "uidStrategy": "native-only",
137 "multipleInstances": true,
138 "instanceUidStrategy": ["isbn"]
139}
140```
141
142```json
143// definitions/canonical/Person.json (excerpt)
144{
145 "name": "Person",
146 "canonical": true,
147 "uidStrategy": ["isni", "orcid"]
148}
149```
150
151| `uidStrategy` value | Meaning |
152|---|---|
153| `"native-only"` | No universal external standard. Generated class uses Mode N UIDs only. |
154| `["isni", "orcid"]` | Implements two standards in priority order. `sfcuid()` returns Mode S from the first whose prop is non-null; falls back to Mode N. |
155| `["ddc"]` | Implements one classification standard. `sfcuid()` returns `ddc:{notation}` when non-null. |
156
157`instanceUidStrategy` applies the same logic to instance sub-objects of a `multipleInstances: true` model. `Book.instanceUidStrategy: ["isbn"]` injects the `isbn` prop onto `InstanceData`, generates `Book.LoadInstance("isbn:...")`, and registers an `isbnToInstance` crosswalk map in the Worker.
158
159The `db_schema_v2` compiler enforces at build time that every standard ID in a `uidStrategy` array exists in this package's `standards/` directory, has a non-null `uriScheme`, and declares a `pk` prop.
160
161---
162
163## Multilingual ORM (`i18N`)
164
165Translations live inside the canonical definition files โ not in app code. The French name for `Book.title` is `titre` as a canonical, governance-controlled fact, subject to the same review process as the prop itself. This ensures that any two French-locale apps built on D-SAFE use identical API surfaces, making cross-app interop structurally guaranteed rather than a coordination agreement.
166
167```json
168// definitions/canonical/Book.json (translations excerpt)
169{
170 "translations": {
171 "fr": {
172 "className": "Livre",
173 "staticMethods": { "Load": "Construit", "Query": "Chercher" },
174 "props": { "title": "titre", "description": "description" }
175 },
176 "de": { "className": "Buch", "props": { "title": "Titel" } }
177 }
178}
179```
180
181The `models_v2` schema generator's `--locale <lang>` flag emits thin TypeScript facade classes from these entries:
182
183```typescript
184// AUTO-GENERATED: Livre.ts (fr locale facade for Book)
185import { Book } from "./Book.ts";
186
187export class Livre extends Book {
188 get titre() { return this.title; }
189 set titre(v) { this.title = v; }
190 static Construit(id: number) { return Book.Load(id); }
191}
192```
193
194The canonical English class is always the structural base. The wire format, `binary.json` propIds, and all on-chain patches are untouched by locale. A French app's `Livre` is 100% binary-compatible with an English app's `Book` โ they patch the same propIds.
195
196Standard-contributed props also carry translation entries. See the `translations` field in each `standards/*.json` file.
197
198---
199
200## EVM-compatible TypeScript classes
201
202The definitions governed by this package are the foundation of a full ORM whose generated output is **natively compatible with EVM smart contract storage**. The `models_v2` schema generator reads `ModelDefinition` files from `definitions/canonical/` and emits TypeScript classes whose state is binary-encoded into on-chain patches โ not stored in a traditional database.
203
204### How the stack connects
205
206```
207@the_library/canonical-schemas โ defines props, types, propIds
208 โ
209 โผ (consumed at build time)
210packages/db_schema_v2 โ compiler: assigns binary propIds, builds binary.json
211 โ
212 โผ (code generation)
213packages/models_v2 โ generated-src/ โ TypeScript classes with toPatch() / fromPatch()
214 โ
215 โผ (EVM calldata)
216contracts/ โ Factory, BouncerStorage, โ smart contracts receive binary-encoded patches
217 ScientistStorage, BackupStorage, on CORE mainnet (chain 1116) and
218 AddressRegistry tCORE2 testnet (chain 1114)
219```
220
221### Binary encoding
222
223Every prop in `definitions/canonical/` maps to a globally stable numeric `propId` in `packages/db_schema_v2/dist/binary.json`. Canonical props occupy IDs **0โ511**; app-level props start at **512**. This range split is what makes cross-institutional interoperability a structural property: any two apps built on the same canonical version agree on canonical propIds without any coordination โ their on-chain patches are binary-compatible by construction.
224
225The generated class encodes its state into a compact binary patch:
226
227```typescript
228// AUTO-GENERATED (models_v2 output)
229import { Book } from '@my-app/models';
230
231const book = new Book();
232book.title = "Thinking, Fast and Slow";
233book.copyrightStatus = CopyrightStatus.InCopyright;
234
235// Serialize to binary-encoded EVM calldata:
236const patch = book.toPatch(); // Uint8Array โ propId + value pairs, packed per binary.json
237
238// Submit via the Factory contract (web3-evm adapter):
239await factory.write.submitPatch([patch]);
240```
241
242The patch codec (`db_schema_v2/src/codec.ts`), `binary.json`, `versions.json`, and the EVM contracts are entirely unaffected by locale, translations, or which external APIs are configured. The ORM's i18N layer and the standard-adapter field-mapping layer both live **above** the wire format โ the chain sees only propIds and values.
243
244### What the smart contracts store
245
246The four core contracts handle different write concerns:
247
248| Contract | Role |
249|---|---|
250| `BouncerStorage` | Access control โ enforces member permissions before any write reaches storage |
251| `ScientistStorage` | Content metadata โ stores canonical model patches (Book, Person, Tag records) |
252| `BackupStorage` | Arweave sidecar links โ permanent-web content addresses anchored on-chain |
253| `Factory` | Write orchestration โ routes patches to the correct storage contract |
254| `AddressRegistry` | Canonical address book โ resolves contract addresses dynamically to survive hard-forks |
255
256Every model write goes through this pipeline: TypeScript ORM class โ binary patch โ `Factory.submitPatch()` โ `BouncerStorage` (access check) โ `ScientistStorage` (write). The canonical `propId` values from this package are what the contracts index and the crosswalk Worker queries.
257
258---
259
260## Dependency on `@the_library/standard-adapters`
261
262`@the_library/canonical-schemas` ships **only interfaces and JSON**. The companion package `@the_library/standard-adapters` ships the runtime implementations.
263
264```
265@the_library/canonical-schemas โ no runtime imports; standalone
266 โ exports: standards/*.json
267 โ exports: types/StandardAdapter.ts (interfaces only)
268 โ exports: types/StandardDefinition.ts
269 โ
270 โผ (implements the interfaces)
271@the_library/standard-adapters โ runtime library; imports types from canonical-schemas
272 โ exports: ISBNAdapter, ISSNAdapter, ISNIAdapter, ORCIDAdapter, DDCAdapter, ...
273 โ exports: apiKeyDictionary
274 โ
275 โผ (consumes both)
276packages/db_schema_v2 / apps/vue.datapond.earth / apps/book-manager
277```
278
279**Strict dependency rule:** `@the_library/canonical-schemas` must never import anything from `@the_library/standard-adapters`. This is enforced by the pnpm workspace dependency graph โ `canonical-schemas/package.json` declares no dependency on `standard-adapters`. The `apiKeyDictionary` singleton that manages runtime API credentials lives entirely in `standard-adapters` and is unknown to this package.
280
281### `StandardAdapter` interface (defined here, implemented in `standard-adapters`)
282
283```typescript
284// types/StandardAdapter.ts
285
286export interface StandardAdapter<TProps, TApis> {
287 readonly standardId: string;
288 readonly uriScheme: string | null;
289 readonly apis: TApis;
290 normalize(value: string): string;
291 display(value: string): string;
292 validate(value: string | null | undefined): ValidationResult;
293 toLinkedDataUri(value: string): string;
294}
295```
296
297Each adapter in `standard-adapters` implements this interface. The `db_schema_v2` compiler imports `standard-adapters` at build time and validates that every `externalApis[].id` in a standard's JSON definition has a matching key in the corresponding adapter's `apis` object. A missing key is a fatal compile error.
298
299### `externalApis` and field mapping
300
301The `externalApis[]` array in each standard definition describes the external APIs that support that standard and how their response fields map onto model props:
302
303```json
304{
305 "id": "openlibrary",
306 "kind": "lookup",
307 "rateLimit": { "requests": 100, "windowSeconds": 60 },
308 "fieldMapping": [
309 { "source": "title", "target": "title", "overwrite": "if-empty" },
310 { "source": "pageCount", "target": "pageCount", "overwrite": "if-empty" },
311 { "source": "publishDate", "target": "pubYear", "overwrite": "if-empty" }
312 ]
313}
314```
315
316- `"lookup"` โ called with the standard's known pk value; populates or corrects model fields from an authoritative source.
317- `"search"` โ called with partial information (a name, a keyword); returns candidates for operator selection.
318- `overwrite: "always"` โ write unconditionally (use for pk fields and authoritative IDs).
319- `overwrite: "if-empty"` โ write only if the target prop is currently null.
320- `overwrite: "never"` โ fetch for UI comparison; do not auto-apply.
321
322The `models_v2` codegen uses these entries to generate `fetchFrom{ApiId}()` and `searchFrom{ApiId}()` methods on the model class, with return types inferred from the adapter's TypeScript `TApis` map.
323
324### `ApiKeyDictionary`
325
326Adapters that require an API key (marked `requiresApiKey: true` in `externalApis[]`) consume credentials through a global `apiKeyDictionary` singleton in `standard-adapters`. Consumer apps set keys once at startup:
327
328```typescript
329import { apiKeyDictionary } from '@the_library/standard-adapters';
330
331// Call before any adapter method that requires a key
332apiKeyDictionary.set('googlebooks', import.meta.env.VITE_GOOGLE_BOOKS_API_KEY);
333```
334
335If a key is missing when an adapter calls `apiKeyDictionary.require(apiId)`, it throws immediately with a clear error naming the missing key โ fail fast at configuration time, not mid-request.
336
337---
338
339## Governance
340
341`@the_library/canonical-schemas` follows semantic versioning with strict rules:
342
343| Bump | Triggers |
344|---|---|
345| **Patch** | Typo fixes in labels or descriptions; translation additions; governance doc edits |
346| **Minor** | New standard definition file; new `externalApis[]` entry; new canonical model prop or enum value |
347| **Major** | Any change to a frozen field: `props[].name`, `props[].type`, `checkDigit.algorithm`, `uriScheme` variable names; removal of a standard; propId reassignment |
348
349**Frozen forever once published:** `id`, `props[].name`, `props[].type`, `props[].checkDigit.algorithm`, and `uriScheme` template variable names. These fields are embedded in binary-encoded on-chain patches for the life of the protocol.
350
351To propose a new standard or canonical model, open two coordinated PRs: one against this package (the JSON definition) and one against `@the_library/standard-adapters` (the TypeScript implementation). Both must be reviewed and merged together โ a standard definition without a registered adapter is a fatal compile error in downstream apps.
352
353See [`governance/GOVERNANCE.md`](./governance/GOVERNANCE.md) and [`governance/changelog.md`](./governance/changelog.md).
354
355---
356
357## JSON Schema validation
358
359All files in `standards/` are validated against the meta-schema at `https://schemas.dsafe.us/StandardDefinition/1.0`. A local copy is bundled at [`schemas/StandardDefinition.1.0.json`](./schemas/StandardDefinition.1.0.json) and resolved via the package `exports` map for IDE tooling and CI validation before the remote endpoint is live.
360
361---
362
363## Licence Architecture
364
365The D-SAFE ecosystem operates under **two distinct licences** covering two distinct concerns. Understanding which licence applies to what is essential before building on this stack.
366
367```
368 SOURCE CODE CONTENT
369 (this package, smart contracts) (books, works, knowledge artifacts)
370
371 D-Open Code Sovereign Licence โโโโ governs โโโโโบ D.I.C. + K (แ -Licence)
372 โโ takes full liability โโ Decentralized ยท Integral ยท Common
373 โโ non-modification clause โโ + K certification overlay
374 โโ compatible with D.I.C. โโ enforced on-chain by BouncerStorage
375 โโ fully D-SAFE by design โโ anchored on Arweave permanently
376```
377
378They are designed to work together. The source code engine was built from the ground up to support D.I.C. natively: every architectural decision โ immutable contracts, Arweave anchoring, the canonical schema, the BouncerStorage gate โ exists to make D.I.C. compliance the path of least resistance for any application built on top.
379
380---
381
382## The D-Open Code Sovereign Licence ยท Source Code
383
384This package, the EVM smart contracts, and the entire D-SAFE engine are published under the **D-Open Code Sovereign Licence v1.0**.
385
386Full text: [registry.worldbibliotech.com/licence.html](https://registry.worldbibliotech.com/licence.html)
387
388This is a licence for **source code** โ the engine, the schema compiler, the ORM, the on-chain contracts. It is not a content licence. It governs what developers may do with the software itself.
389
390### What makes it different
391
392Unlike every conventional open-source licence, the D-Open Code Sovereign Licence **takes liability rather than disclaiming it**. It establishes a two-layer accountability structure:
393
394- **The Sanctuary** โ DataPond Public Library Trust, a non-profit entity holding the assets. Provides the software and holds zero liability for damages, gas fees, or data loss.
395- **The Shield** โ Pond Enterprise Pty Ltd, the technical guardian. Absorbs all claims regarding technical performance, patent infringement, and professional indemnity related to the core architecture.
396
397This is not a disclaimer. It is an **architecture of accountability** โ named entities standing behind the technical warranty. For the first time, institutional partners, schools, and governments can deploy sovereign library infrastructure with a legal counterpart they can actually reach.
398
399### Core terms
400
401```
402โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
403โ D-OPEN CODE SOVEREIGN LICENCE โ SOURCE CODE โ
404โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
405โ PERMITTED โ
406โ โ
407โ โ Use, copy, and distribute the source code freely โ
408โ โ Build D-SAFE-compliant applications on top of it โ
409โ โ Deploy in fully offline / air-gapped environments โ
410โ โ Snapshot the codebase for long-term archive deployments โ
411โ โ
412โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
413โ CONDITIONS โ
414โ โ
415โ โ No Modification of the certified source โ
416โ โ No redirecting canonical models to private databases โ
417โ โ No use in applications with paywalls or mandatory login โ
418โ โ No deployment in jurisdictions where decentralised โ
419โ storage or uncensored public-domain data is illegal โ
420โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
421```
422
423**On the No Modification clause:** the contracts are immutable once deployed on-chain. A modified contract cannot be recalled. A mis-deployed fork could permanently corrupt member records or redirect library assets with no possibility of reversal. The prohibition is therefore not a restriction of developer freedom โ it is a protection of the permanence that makes the library indestructible.
424
425**On offline rights:** the licence explicitly grants snapshot and offline deployment rights. Hard-coded contract addresses in a D-SAFE certified snapshot are legally valid in air-gapped environments (schools, bunkers, remote field operations) where no connection to the canonical config or blockchain is possible. No other open-source licence has addressed this use case directly.
426
427**On interoperability as a legal condition:** the licence prohibits forking this package to redirect the DataPond canonical models to a private, centralised database. Any institution building on `@the_library/canonical-schemas` is making a legally binding commitment to the shared canonical schema โ not just a technical one. This is what makes cross-institutional data compatibility durable.
428
429---
430
431## The แ -Licence ยท Content (D.I.C. + K)
432
433The **แ -Licence** governs the **knowledge artifacts** โ books, works, records โ that flow through the certified infrastructure. It is composed of two layers: the D.I.C. base licence and the K certification overlay.
434
435> The แ character is Unicode `U+13A0`, the Cherokee letter A, visually identical to a Latin capital A. AI models, OCR engines, and search crawlers read it as A. Readers who know its meaning read it as D. The double-reading is intentional: open to machines, meaningful to those who built on it. It is a philosophical mark, not a security mechanism.
436
437### D.I.C. โ the base licence
438
439D.I.C. stands for **Decentralized ยท Integral ยท Common**. Each letter is a non-negotiable pillar:
440
441```
442 D ยท Decentralized
443 Content lives on Arweave โ the Permaweb.
444 Guaranteed access for 250+ years.
445 No corporate kill-switch. No server a company can pull.
446 No database an operator can delete.
447
448 I ยท Integral
449 Zero money flow. An absolute prohibition on any extraction
450 of commercial value from the distribution of knowledge:
451
452 โ No advertising or sponsorships
453 โ No paywalls or subscriptions
454 โ No social media integration or engagement loops
455 โ No news feeds or algorithmic amplification
456
457 A pure, unmonetised distribution of knowledge. Nothing else.
458
459 C ยท Common
460 Based on Creative Commons CC BY-NC-ND 4.0:
461 ยท Attribution required in all reproductions
462 ยท Non-Commercial โ the content itself cannot generate revenue
463 ยท No Derivatives โ no modification of certified works
464```
465
466### K โ the Knowledge certification overlay
467
468D.I.C. is a licence anyone can apply to their work. The **K layer** is what earns the work the **D-SAFE label** โ and it cannot be self-issued.
469
470K certification requires:
471
4721. **Submission** โ the work is submitted to the D-SAFE Registry with provenance documentation
4732. **Human review** โ a manual audit against the zero-tolerance exclusion checklist
4743. **Authorship verification** โ confirmation of human authorship
4754. **Audit record** โ a cryptographic hash of the review published permanently to Arweave
4765. **Label issuance** โ the D-SAFE label is granted and the work is published under the full แ -Licence
477
478**The K layer is deliberately not automated.** No algorithm decides whether a work carries the D-SAFE label. Human review is a hard prerequisite by design. This is what distinguishes the D-SAFE certification from content moderation filters โ it is a human judgement, not a classifier output.
479
480A work can carry the D.I.C. licence without the D-SAFE label. It cannot carry the D-SAFE label without passing the K review.
481
482### The D-CODE Licence โ formal name
483
484The complete content licence applied to all D-SAFE certified works is formally named the **D-CODE Licence** (Digital Constitution of Open and Decentralized Ecosystems). It is the legal instrument binding publishers to the D.I.C. + K obligations:
485
486- Content must be permanently and freely accessible to all
487- Content cannot be placed behind a paywall, subscription, or access control of any kind
488- Content cannot be removed or deleted by any party, including the original publisher
489- Attribution must be preserved in all reproductions and derivatives
490- Commercial use of the content itself is prohibited; the infrastructure hosting it may be commercial
491
492The D-CODE Licence is implemented on-chain via the `BouncerStorage` smart contract on CORE Chain (Chain ID 1116). The human-readable licence text is stored alongside every certified work on Arweave โ it travels permanently with the content.
493
494### The D-SAFE K.nowledge label โ inherited by the smart contracts
495
496Every piece of content accepted by the DataPond contracts is D-SAFE certified before it reaches storage. The `BouncerStorage` contract enforces D-SAFE compliance at the write boundary: a record without a valid D-SAFE label is rejected and never reaches `ScientistStorage`.
497
498Because all content flowing through these contracts already carries the K certification, **the contracts themselves inherit the D-SAFE K.nowledge label**. The engine is certified D-SAFE not by declaration, but by construction.
499
500```
501 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
502 โ โ
503 โ แ -SAFE ยท K.nowledge Label โ
504 โ โ
505 โ All content certified free of: โ
506 โ ยท Hate speech โ
507 โ ยท Explicit material โ
508 โ ยท Environmental harm promotion โ
509 โ ยท Advertising, paywalls, and social media feeds โ
510 โ ยท AI-generated content (human authorship required) โ
511 โ โ
512 โ Verified by: dsafe.us ยท manual human review โ
513 โ Audit record: Arweave ยท permanent, immutable โ
514 โ Enforced by: BouncerStorage ยท CORE Chain 1116 โ
515 โ โ
516 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
517```
518
519The certification chain is complete and unbroken:
520
521```
522 dsafe.us human review
523 โ cryptographic audit hash published to Arweave
524 โ BouncerStorage gate (on-chain enforcement)
525 โ ScientistStorage write
526 โ Arweave content anchor (permanent)
527```
528
529Any institution reading data from these contracts can trust not just the schema (governed by this package) but the content itself. The แ -SAFE label travels with the knowledge from the moment of certification to the moment of retrieval, permanently and verifiably.
530
531Full licence text: [registry.worldbibliotech.com/licence.html](https://registry.worldbibliotech.com/licence.html)
532
533---
534
535## Related packages
536
537| Package | Role |
538|---|---|
539| [`@the_library/standard-adapters`](../standard-adapters) | Runtime StandardAdapter implementations for all standards in this package |
540| [`packages/db_schema_v2`](../db_schema_v2) | ORM compiler and binary codec; consumes canonical definitions at build time |
541| [`packages/models_v2`](../models_v2) | TypeScript class generator; emits model classes and locale facade classes |
542| [`packages/web3-contracts`](../web3-contracts) | ABI files and deployed addresses for the on-chain registry |
543