@333eco/corpus 1.2.5 → 2.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 +70 -0
- package/dist/corpus.json +1420 -127
- package/package.json +4 -3
- package/src/base-tools.mjs +72 -0
- package/src/program-tools.mjs +181 -0
- package/src/prompts.mjs +134 -0
- package/src/resources.mjs +215 -0
- package/src/results.mjs +40 -0
- package/src/server.mjs +94 -52
package/README.md
CHANGED
|
@@ -50,6 +50,76 @@ manufactured on a schedule.
|
|
|
50
50
|
| `search_corpus` | matching documents, provenance envelope, and an excerpt around each match |
|
|
51
51
|
| `get_document` | one document in full — canonical text, never a summary |
|
|
52
52
|
| `list_documents` | slugs, titles, genres, licences, provenance summaries |
|
|
53
|
+
| `list_predictions` | the research program's pre-registered predictions, with falsifiers and status |
|
|
54
|
+
| `get_prediction` | one prediction, plus the provenance envelope of the paper that registered it |
|
|
55
|
+
| `get_program` | the program's hard core, chapters, stopping rule and count reconciliation, verbatim |
|
|
56
|
+
|
|
57
|
+
⭐ **The three program tools return the STATING PAPER's envelope, not the register's.**
|
|
58
|
+
That is the register's own instruction rather than a design flourish: *"verify the
|
|
59
|
+
stating paper against its stored proof rather than trusting this register — this
|
|
60
|
+
file is a convenience index, and the proofs are the evidence."* A prediction's
|
|
61
|
+
authority is the paper that registered it, so that is the hash, DOI and
|
|
62
|
+
OpenTimestamps command a caller gets back. Every field is a verbatim table cell,
|
|
63
|
+
and the build refuses to emit one that is not — a field must match a *complete*
|
|
64
|
+
cell of its source, because a fragment of a cell is still a substring of it.
|
|
65
|
+
|
|
66
|
+
The program tools appear only when the index carries a program block. An index
|
|
67
|
+
built over a corpus without one advertises three tools, not six.
|
|
68
|
+
|
|
69
|
+
## Resources
|
|
70
|
+
|
|
71
|
+
Every document is also an MCP resource at `corpus://<slug>` — listed by
|
|
72
|
+
`resources/list` (paged), described by the `corpus://{slug}` template, and read by
|
|
73
|
+
`resources/read`.
|
|
74
|
+
|
|
75
|
+
⭐⭐ **A resource carries its provenance IN THE TEXT, not beside it.** A tool
|
|
76
|
+
response wraps a document in an envelope and the caller reads the envelope. A
|
|
77
|
+
resource is consumed differently: clients hand its contents straight to a model as
|
|
78
|
+
context, and a `mimeType` field does not travel with a quotation. So every read
|
|
79
|
+
returns a `[PROVENANCE — corpus.333.eco]` header — licence and whom to attribute,
|
|
80
|
+
sha256 and **what it does not cover**, both DOIs, the OpenTimestamps command, and
|
|
81
|
+
the one-line `curl … | shasum` check — followed by the document verbatim.
|
|
82
|
+
|
|
83
|
+
This is the letters' rule applied a second time. Voice in the letters is marked
|
|
84
|
+
inline rather than in metadata because *with a field an agent must LOOK to know;
|
|
85
|
+
with a marker it must STRIP not to.* The same asymmetry decides this.
|
|
86
|
+
|
|
87
|
+
`subscribe` and `listChanged` are deliberately not declared: the corpus is fixed
|
|
88
|
+
for the life of a build, so a subscription would promise notifications that can
|
|
89
|
+
never fire.
|
|
90
|
+
|
|
91
|
+
## Prompts
|
|
92
|
+
|
|
93
|
+
Three worked examples of the API — `orient`, `verify_a_quote(slug)`,
|
|
94
|
+
`what_would_falsify(claim)` — surfaced as slash commands in clients that support
|
|
95
|
+
them, with `slug` autocompleted by `completion/complete`.
|
|
96
|
+
|
|
97
|
+
⛔ **A prompt here may describe the API. It may never describe the subject
|
|
98
|
+
matter.** The moment one says something about the corpus's claims, this server has
|
|
99
|
+
begun editorialising on its own documents — which is precisely what the provenance
|
|
100
|
+
envelope exists to make unnecessary. There is deliberately no "verify before
|
|
101
|
+
citing" prompt: that would be a *rule* where the server already has a *property*,
|
|
102
|
+
since every document by every route arrives behind a header the reader must
|
|
103
|
+
actively strip.
|
|
104
|
+
|
|
105
|
+
## Attribution is a build-time property
|
|
106
|
+
|
|
107
|
+
Seven documents are CC-BY and the rest CC0. A CC-BY document that names no author
|
|
108
|
+
hands every consumer an obligation nobody can discharge, so **the build fails**
|
|
109
|
+
rather than serving it — the same reasoning as the licence gate: a property, not a
|
|
110
|
+
rule someone has to remember.
|
|
111
|
+
|
|
112
|
+
| `list_predictions` | the research program's pre-registered predictions, with falsifiers and status |
|
|
113
|
+
|
|
114
|
+
**Results are structured.** Every tool returns `structuredContent` — the typed
|
|
115
|
+
object — and uses `content` for the human form: the document text with its
|
|
116
|
+
provenance header for `get_document`, readable excerpts for `search_corpus`, a
|
|
117
|
+
compact serialisation for the rest. ⛔ **Nothing is sent twice.** The spec's
|
|
118
|
+
back-compat advice is to serialise the JSON into `content` as well; measured, that
|
|
119
|
+
doubles every response (1.76×–2.00×), so this server splits by role instead —
|
|
120
|
+
`content` is read, `structuredContent` is validated, and the two carry different
|
|
121
|
+
things. `outputSchema` is deliberately not declared yet: a schema binds the server
|
|
122
|
+
on every future change, and the envelope is still moving.
|
|
53
123
|
|
|
54
124
|
**Text is returned verbatim and is never summarised.** Not a stylistic
|
|
55
125
|
preference — a summary cannot be hash-verified, so summarising at the server
|