@333eco/corpus 1.0.0

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 ADDED
@@ -0,0 +1,135 @@
1
+ # corpus.333.eco
2
+
3
+ An **MCP server** for an open-licensed corpus — 132 documents across mechanism
4
+ papers, essays, institutional positions and white papers — served with
5
+ **verifiable provenance**.
6
+
7
+ ```sh
8
+ npx @333eco/corpus
9
+ ```
10
+
11
+ Every response carries the document's `sha256`, its DOI where one exists, and
12
+ whether an OpenTimestamps proof is anchored beside the source. **A retrieval
13
+ server normally asks to be believed. This one hands over the means to check it.**
14
+
15
+ ## Why that matters
16
+
17
+ An agent that cites a passage is in a worse position than a human who does: it
18
+ cannot walk to the shelf. It takes whatever the transport delivered, and nothing
19
+ about a plausible-looking response distinguishes the canonical text from a
20
+ paraphrase, a truncation, or a substitution somewhere upstream.
21
+
22
+ So the check moves into the response:
23
+
24
+ ```json
25
+ "provenance": {
26
+ "sha256": "91a41c759b1e9fdac3c0da667fe32a906aef98e4edec4832c09ac27b2c7663c0",
27
+ "doi": "10.5281/zenodo.22217516",
28
+ "opentimestamps": true,
29
+ "deposited_matches_current": true,
30
+ "verify": {
31
+ "sha256": "printf '%s' \"$(cat <file>)\" | shasum -a 256 # compare to provenance.sha256",
32
+ "doi": "https://doi.org/10.5281/zenodo.22217516",
33
+ "opentimestamps": "ots verify defensive-publications/zero-point-game.md.ots"
34
+ }
35
+ }
36
+ ```
37
+
38
+ The `verify` block is an instruction, not a promise — it tells you exactly what
39
+ to run, so you do not have to trust this sentence either.
40
+
41
+ ⭐ **The demonstration is the contribution.** Anyone can propose provenance-carrying
42
+ retrieval. Serving it over a corpus where the anchors are already years deep in
43
+ the Bitcoin blockchain is a different claim, and it is not one that can be
44
+ manufactured on a schedule.
45
+
46
+ ## Tools
47
+
48
+ | Tool | Returns |
49
+ | --- | --- |
50
+ | `search_corpus` | matching documents, provenance envelope, and an excerpt around each match |
51
+ | `get_document` | one document in full — canonical text, never a summary |
52
+ | `list_documents` | slugs, titles, genres, licences, provenance summaries |
53
+
54
+ **Text is returned verbatim and is never summarised.** Not a stylistic
55
+ preference — a summary cannot be hash-verified, so summarising at the server
56
+ would destroy the only property this server has.
57
+
58
+ ## Licences, and the gate
59
+
60
+ | Licence | Documents |
61
+ | --- | --- |
62
+ | CC0-1.0 | 125 |
63
+ | CC-BY-4.0 | 7 |
64
+
65
+ CC-BY documents carry `attribute_to` inside their licence block, so an agent can
66
+ comply without parsing a licence identifier.
67
+
68
+ ⛔ **The gate is a property, not a policy.** A document reaches the index if and
69
+ only if its own source declares a licence this corpus publishes under. There is
70
+ no glob and no directory allowlist, because the source repositories are **not**
71
+ uniformly licensed and never were:
72
+
73
+ - `TH/publications` — 96 CC0, **7 CC-BY author-voice essays**
74
+ - `TH/film` — rights-reserved, a separate repository *by licence*. Never served.
75
+ - `333.eco` — the namespace policy is commercial and explicitly unpublished.
76
+
77
+ A glob would have relicensed seven essays by publication. A file with **no**
78
+ declaration is excluded and reported, never assumed CC0 — the default-open
79
+ failure is the one nobody can undo after somebody builds on it.
80
+
81
+ ⚠️ The gate lives in `scripts/build-index.mjs`, not in the request path. A gate a
82
+ refactor can route around is a rule; a gate in the artifact is a property. **The
83
+ server has no filesystem access to the corpus at all** — it can only serve what
84
+ the index contains.
85
+
86
+ ## Two metadata conventions, kept visible
87
+
88
+ `TH/publications` uses YAML front matter. Sixteen `H3/publications` documents use
89
+ a leading markdown table. Both are parsed, and each document records which
90
+ convention it used in `metadata_convention` — because a divergence that gets
91
+ silently normalised is a divergence nobody fixes. H3 should converge on front
92
+ matter; until it does, this is the honest reading.
93
+
94
+ *The first build reported those sixteen as unlicensed. They were not — the gate
95
+ was right about what it could read and wrong about what was there.*
96
+
97
+ ## Staleness
98
+
99
+ ```sh
100
+ npm run build # regenerate dist/corpus.json from the corpora
101
+ npm run check # fail if the committed index is not what the corpora produce
102
+ ```
103
+
104
+ ⚠️ **A stale corpus server is worse than a stale website**, because the citing
105
+ agent cannot tell — it will quote superseded text under an authoritative version
106
+ number. `npm run check` runs in CI, and the published package is built from the
107
+ same commit that ships it.
108
+
109
+ ## Architecture
110
+
111
+ ```
112
+ scripts/build-index.mjs the licence gate + provenance builder
113
+ dist/corpus.json GENERATED, committed — the only thing the server reads
114
+ src/server.mjs MCP over stdio. Zero dependencies, including no MCP SDK
115
+ ```
116
+
117
+ No dependencies at all: MCP over stdio is newline-delimited JSON-RPC 2.0, which
118
+ is a few hundred lines to speak correctly, and this estate's standing rule is
119
+ node built-ins only. The cost is that protocol revisions are tracked by hand —
120
+ `PROTOCOL_VERSIONS` in `src/server.mjs` is where that lives.
121
+
122
+ ## Client configuration
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "corpus": { "command": "npx", "args": ["-y", "@333eco/corpus"] }
128
+ }
129
+ }
130
+ ```
131
+
132
+ ## Licence
133
+
134
+ This package is CC0-1.0. **The documents it serves carry their own licences** —
135
+ read `licence` in each response, not this heading.