@agenticprimitives/content-primitives 1.0.0-alpha.6 → 1.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -13
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# @agenticprimitives/content-primitives
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
content that lives off-platform and is controlled by third-party rights holders.
|
|
3
|
+
The verifiable content substrate — name, resolve, commit, entitlement-gate, and cite content that lives off-platform and is controlled by third-party rights holders.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
Agents increasingly act on content they do not own: quoting a licensed text, citing a canonical passage, gating access to a rights-held corpus. The naive approaches all fail — copy the text and you violate the license; trust the platform and the citation is unverifiable; mint every passage an identity and the identity layer drowns. This package takes the third path: content is **never an agent and never stored**. A unit of content gets a deterministic, scheme-anchored address; an issuer (who IS a Smart Agent) signs a commitment to it; readers verify the signature, evaluate the entitlement, and cite the result — all without the text ever entering the substrate ([ADR-0033](../../docs/architecture/decisions/0033-content-agnostic-verifiable-content-firewall.md)).
|
|
6
|
+
|
|
7
|
+
The package is strictly content-agnostic: no rendering text in any descriptor or commitment we store (R3), no licensed material in the repo (R1), and the reference grammar is app-injected, never hardcoded (R4). Trust derives from the issuer's signature and access policy, never a platform claim (R5).
|
|
8
|
+
|
|
9
|
+
Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
11
10
|
|
|
12
11
|
## Model (FRBR)
|
|
13
12
|
|
|
@@ -18,6 +17,8 @@ not its vocabulary.
|
|
|
18
17
|
| Item | `ContentDescriptor` | commitment + `retrievalPointer` + issuer signature — **never text** |
|
|
19
18
|
| — | `Entitlement` / `CitationAssertion` | W3C VC 2.0 subjects |
|
|
20
19
|
|
|
20
|
+
The FRBR Work/Item split is why this is a new substrate and not another naming-record type: a content locus is an address computed from a reference scheme, while only issuers, corpora owners, and parties are Smart Agents (ADR-0010 still governs *them*).
|
|
21
|
+
|
|
21
22
|
## Quick start
|
|
22
23
|
|
|
23
24
|
```ts
|
|
@@ -28,15 +29,15 @@ import {
|
|
|
28
29
|
} from '@agenticprimitives/content-primitives';
|
|
29
30
|
|
|
30
31
|
// 1. App supplies the reference grammar (kept out of the package — R4).
|
|
31
|
-
const
|
|
32
|
-
const locus = buildCanonicalLocus(
|
|
32
|
+
const clauseScheme = { id: 'standard-clause', normalize: (p: string) => /* canonical form */ p };
|
|
33
|
+
const locus = buildCanonicalLocus(clauseScheme, 'Part 4, Section 2'); // -> { locusId, path: 'Part4.Section2' }
|
|
33
34
|
|
|
34
35
|
// 2. Issuer commits to off-platform text + signs a descriptor (no text on-chain — R3).
|
|
35
36
|
const commitment = contentCommitment(renderingText); // keccak256, off-platform
|
|
36
37
|
const descriptor = await buildContentDescriptor(
|
|
37
|
-
{ locusId: locus.locusId, corpusRef: ref, contentType: '
|
|
38
|
+
{ locusId: locus.locusId, corpusRef: ref, contentType: 'standard-clause',
|
|
38
39
|
commitment, proofPolicy: 'signature', accessPolicy: 'public',
|
|
39
|
-
retrievalPointer: 'content://
|
|
40
|
+
retrievalPointer: 'content://standard-clause/v3/Part4.Section2', issuer },
|
|
40
41
|
issuerSign, // signs descriptorHash via the issuer SA (ERC-1271)
|
|
41
42
|
);
|
|
42
43
|
|
|
@@ -45,5 +46,18 @@ const ok = await verifyContentDescriptor(descriptor, { verifySignature });
|
|
|
45
46
|
const gate = evaluateEntitlement(descriptor.accessPolicy, descriptor.corpusRef);
|
|
46
47
|
```
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
Entitlement evaluation is fail-closed; Merkle helpers ship under the `/merkle` subpath; ERC-1271 signature verification is dependency-injected so the package stays at the base of the graph.
|
|
50
|
+
|
|
51
|
+
## Status
|
|
52
|
+
|
|
53
|
+
Phases 1–3 (naming, commitment, descriptor verification, entitlement gating, citation) are implemented and tested. **ZK proofs and paid access are reserved (Phase 4/5) and throw until implemented** — the full SDK surface and phased roadmap live in [spec 266](../../specs/266-verifiable-content-substrate.md) (see [`spec.md`](./spec.md)).
|
|
54
|
+
|
|
55
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
|
56
|
+
|
|
57
|
+
## Build
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pnpm --filter @agenticprimitives/content-primitives typecheck
|
|
61
|
+
pnpm --filter @agenticprimitives/content-primitives test
|
|
62
|
+
pnpm --filter @agenticprimitives/content-primitives build
|
|
63
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/content-primitives",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.7",
|
|
4
4
|
"description": "Verifiable Content Substrate SDK: name, resolve, commit, entitlement-gate, and cite off-platform content controlled by third-party rights holders. Owns CanonicalLocus / CorpusManifest / ContentDescriptor / CitationAssertion / Entitlement (FRBR-aligned), deterministic locusId, Merkle corpus commitments, and issuer-signature verification. Content-agnostic — no vertical/faith vocabulary, no content text (ADR-0033).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,13 +32,22 @@
|
|
|
32
32
|
"README.md",
|
|
33
33
|
"CLAUDE.md"
|
|
34
34
|
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.build.json",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:unit": "vitest run test/reference.test.ts test/merkle.test.ts test/descriptor.test.ts test/entitlement.test.ts test/resolution.test.ts --passWithNoTests",
|
|
40
|
+
"test:integration": "vitest run test/integration --passWithNoTests",
|
|
41
|
+
"test:watch": "vitest",
|
|
42
|
+
"clean": "rm -rf dist"
|
|
43
|
+
},
|
|
35
44
|
"publishConfig": {
|
|
36
45
|
"access": "public"
|
|
37
46
|
},
|
|
38
47
|
"peerDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"@agenticprimitives/
|
|
41
|
-
"
|
|
48
|
+
"@agenticprimitives/types": "workspace:*",
|
|
49
|
+
"@agenticprimitives/verifiable-credentials": "workspace:*",
|
|
50
|
+
"viem": "^2.52.2"
|
|
42
51
|
},
|
|
43
52
|
"devDependencies": {
|
|
44
53
|
"@types/node": "^22.7.0",
|
|
@@ -51,14 +60,5 @@
|
|
|
51
60
|
"provenance",
|
|
52
61
|
"citation",
|
|
53
62
|
"agentic"
|
|
54
|
-
]
|
|
55
|
-
|
|
56
|
-
"build": "tsc -p tsconfig.build.json",
|
|
57
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
58
|
-
"test": "vitest run",
|
|
59
|
-
"test:unit": "vitest run test/reference.test.ts test/merkle.test.ts test/descriptor.test.ts test/entitlement.test.ts",
|
|
60
|
-
"test:integration": "vitest run test/integration.test.ts",
|
|
61
|
-
"test:watch": "vitest",
|
|
62
|
-
"clean": "rm -rf dist"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
63
|
+
]
|
|
64
|
+
}
|