@ceccec/millennium-solutions 9.7.6 → 9.8.3

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.
Files changed (59) hide show
  1. package/README.md +299 -107
  2. package/dist/data/baked/answer_gate.json +1 -0
  3. package/dist/data/baked/answer_verify_arith.json +1 -0
  4. package/dist/data/baked/answer_verify_arxiv.json +1 -0
  5. package/dist/data/baked/anti_fake.json +1 -0
  6. package/dist/data/baked/api_gates.json +1 -0
  7. package/dist/data/baked/apis_guru_cross.json +1 -0
  8. package/dist/data/baked/apis_guru_gaps.json +1 -0
  9. package/dist/data/baked/apis_theorems.json +1 -0
  10. package/dist/data/baked/coils.json +1 -0
  11. package/dist/data/baked/constants_check.json +1 -0
  12. package/dist/data/baked/contradictions.json +1 -0
  13. package/dist/data/baked/discover.json +1 -0
  14. package/dist/data/baked/discoveries.json +1 -0
  15. package/dist/data/baked/entanglements.json +1 -0
  16. package/dist/data/baked/evidence.json +1 -0
  17. package/dist/data/baked/hexbit_route.json +1 -0
  18. package/dist/data/baked/index.json +41 -0
  19. package/dist/data/baked/leads.json +1 -0
  20. package/dist/data/baked/leaks.json +1 -0
  21. package/dist/data/baked/memory_check.json +1 -0
  22. package/dist/data/baked/memory_derive.json +1 -0
  23. package/dist/data/baked/metrics_face.json +1 -0
  24. package/dist/data/baked/package_gates.json +1 -0
  25. package/dist/data/baked/prefix_check.json +1 -0
  26. package/dist/data/baked/prose_check.json +1 -0
  27. package/dist/data/baked/qpu_court_local.json +1 -0
  28. package/dist/data/baked/qpu_families.json +1 -0
  29. package/dist/data/baked/recompute.json +1 -0
  30. package/dist/data/baked/session_report.json +1 -0
  31. package/dist/data/baked/theorem_only.json +1 -0
  32. package/dist/data/baked/trinity.json +1 -0
  33. package/dist/data/discovered.json +149408 -0
  34. package/dist/data/formulas.jsonld +470143 -0
  35. package/dist/mcp.bin.d.ts +2 -0
  36. package/dist/mcp.bin.js +80 -0
  37. package/dist/src/0/index.d.ts +1 -0
  38. package/dist/src/0/index.js +7 -8
  39. package/dist/src/face/index.d.ts +41 -0
  40. package/dist/src/face/index.js +32 -0
  41. package/dist/src/factor/index.d.ts +58 -0
  42. package/dist/src/factor/index.js +209 -0
  43. package/dist/src/factor/verify.d.ts +18 -0
  44. package/dist/src/factor/verify.js +28 -0
  45. package/dist/src/handle/index.d.ts +9 -0
  46. package/dist/src/handle/index.js +10 -0
  47. package/dist/src/mcp/index.d.ts +4199 -0
  48. package/dist/src/mcp/index.js +249 -0
  49. package/dist/src/mcp/serve.d.ts +100 -0
  50. package/dist/src/mcp/serve.js +282 -0
  51. package/dist/src/mcp/suites.d.ts +1 -0
  52. package/dist/src/mcp/suites.js +14 -0
  53. package/dist/src/mirror/index.d.ts +18 -0
  54. package/dist/src/mirror/index.js +37 -0
  55. package/dist/src/policy/index.d.ts +8 -0
  56. package/dist/src/policy/index.js +23 -0
  57. package/dist/src/the/rosetta/index.d.ts +3 -0
  58. package/dist/src/the/rosetta/index.js +25 -0
  59. package/package.json +55 -8
@@ -0,0 +1,249 @@
1
+ import { SUITES } from './suites.js';
2
+ export const WRITES = new Set(['lean_seal', 'lean_generate', 'pages', 'ledger_trial']);
3
+ export const TOOLS = [
4
+ { name: 'novelty', description: 'Run this deposit\'s own prior-art search against any statement: zbMATH, OpenAlex, Crossref, arXiv, and the OEIS for any integer sequence in it. Returns the verdict vocabulary the record uses — CANDIDATES | NONE_FOUND | NONE_FOUND_PARTIAL | NOT_MEASURED | TOO_FEW_TERMS — with the queries sent, the hits, and THE FLOORS APPLIED (relevance ≥ 0.6 over the first 5 results per source), because a verdict cannot be read apart from the domain that made it. NONE_FOUND means "these searches, on this date, returned nothing" and never "nothing earlier exists": a keyword search misses what it does not name. Writes nothing.',
5
+ inputSchema: { type: 'object', properties: { statement: { type: 'string' }, anchors: { type: 'array', items: { type: 'string' } } }, required: ['statement'] } },
6
+ { name: 'coils', description: 'The cross formulas, clustered: every expression in the deposit\'s vocabulary evaluated at every point of a grid and grouped by the resulting vector. Two expressions in one coil prove each other — compute either and the other is computed. Returns the coils, the pair count, and the expressions that coil with NOTHING, which are the ones prose must never interchange.',
7
+ inputSchema: { type: 'object', properties: {}, required: [] } },
8
+ { name: 'discoveries', description: 'Where the next prior-art search should go, consolidating the generators: which theorems sit in files declaring their own work, which have no search recorded, which families are at octave scale. A RANK IS NOT A NOVELTY CLAIM — this orders a queue, and only a performed search can say whether a statement has an earlier author. Reports the coverage, which is the finding: novelty in this tree is measured for a few per cent of it.',
9
+ inputSchema: { type: 'object', properties: { cursor: { type: 'number', description: 'the next cursor from the previous page; omit for the first page' }, limit: { type: 'number' } }, required: [] } },
10
+ { name: 'formulas', description: 'Every formula this deposit decides, as data: the proposition the Lean kernel accepted, character for character, with its file, namespace, wing, tactic and ledger key. Filter by any of them. Nothing summarised and nothing authored.',
11
+ inputSchema: { type: 'object', properties: { cursor: { type: 'number', description: 'the next cursor from the previous page; omit for the first page' }, wing: { type: 'string' }, file: { type: 'string' }, contains: { type: 'string' }, limit: { type: 'number' } }, required: [] } },
12
+ { name: 'handle', description: 'The SHORT FORM: the first four hex of an address, plus the message, determine the whole address — so nothing but the message ever travels. Pass text to mint a handle; pass handle AND text to resolve one. ROUTES and REJECTS, never identifies: 16 bits over 2912 sealed receipts collide 71 times (birthday expectation 64.7), and the collision-free minimum today is 7 hex. The window is the FRONT four hex because hex 12..16 and 16..20 overlap the forced version/variant bits and carry less — and hex 12..16 is the third dash-group of the display form, the one an eye would reach for.',
13
+ inputSchema: { type: 'object', properties: { text: { type: 'string' }, handle: { type: 'string' } }, required: ['text'] } },
14
+ { name: 'content_address', description: 'Content-address (uuid) any text — INTEGRITY/provenance, NOT encryption or proof.',
15
+ inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'] } },
16
+ { name: 'honesty_gate', description: 'Run the honesty gate: binary 1 (no named overclaim) or 0 (drains) + the hit. A lexical FLOOR, not a truth oracle; passing != true.',
17
+ inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'] } },
18
+ { name: 'merkle_fold', description: 'Order-independent merkle fold of a list of strings into one address.',
19
+ inputSchema: { type: 'object', properties: { items: { type: 'array', items: { type: 'string' } } }, required: ['items'] } },
20
+ { name: 'probe', description: 'Read-only reachability probe of a public URL: REACHED | INCONCLUSIVE | DRAINS + HTTP failure-mode (429/403/404/5xx classified, rate-respecting). A timeout is INCONCLUSIVE, never "blocked" — HTTP status indexed honestly.',
21
+ inputSchema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'] } },
22
+ { name: 'lineage', description: 'Delivery vs churn across release tags, by git tree hash (git\'s own faithful content-address). Identical trees = a tag minted over no delta (churn); distinct = a delivery. Integrity-level: measures WHAT was delivered, not whether it is true. Heroes and traitors by deeds, not statements.',
23
+ inputSchema: { type: 'object', properties: {}, required: [] } },
24
+ { name: 'verify', description: 'Audit any prose/message, or decode-and-verify a uuid across BOTH evidence sets. Prose → honesty-gate verdict + content-address. A uuid is a ONE-WAY address (never reversed); "decode" looks it up in (1) the agent-statement receipts (src/receipts/, verifies toUuid(message)===uuid + observer/role) then (2) the discovery ledger (reports the fact, chain position, and whether the chain-of-custody link is intact). In neither ⇒ opaque, honestly.',
25
+ inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'] } },
26
+ { name: 'discover', description: 'The discovery engine: computationally-generated + curated candidate facts over ℤ/9, each tested by exhaustion. Returns discovered (provable) vs refuted + a discovery root. Decidable facts only.',
27
+ inputSchema: { type: 'object', properties: {}, required: [] } },
28
+ { name: 'recompute', description: 'Recompute ALL theorems: re-run every candidate\'s formula (its test) by exhaustion, report how many hold vs refuted, verify every RECORDED ledger theorem still recomputes true, and fold the recompute root — the whole deposit recomputes from its theorems, not from stored answers. A theorem without a formula that recomputes true is refused (hallucination). Decidable.',
29
+ inputSchema: { type: 'object', properties: {}, required: [] } },
30
+ { name: 'rosetta', description: 'The completed cross-domain rosetta as a reusable endpoint: every domain family one hop from the shared core, content-addressed and folded to one rosetta root, all addresses distinct (no collision unless consolidated or redistributed). Returns the core address, the domain list and count, the collision check, and the rosetta root. Integrity of the cross-domain map, not truth.',
31
+ inputSchema: { type: 'object', properties: {}, required: [] } },
32
+ { name: 'audit', description: 'Self-audit of THIS MCP server: content-address every tool (name+description+schema), verify each declared tool has a handler and each handler is declared (coverage), fold to one self-audit root. Integrity of the tool surface, not truth.',
33
+ inputSchema: { type: 'object', properties: {}, required: [] } },
34
+ { name: 'forensics', description: 'Chain-of-custody for the discovery ledger: recompute the receipt chain link-by-link (receipt[i]=toUuid(receipt[i-1]→key[i]), seed axiom:TRINITY), pinpoint any break, check for duplicate keys/receipts, and fold a tamper-evident seal. Genesis discontinuities are a documented baseline; a NEW break is tampering. Integrity/provenance of evidence, not truth.',
35
+ inputSchema: { type: 'object', properties: {}, required: [] } },
36
+ { name: 'lean_verify', description: 'Compile every Lean file and audit it per theorem: #print axioms on each, hygiene (no sorry / native_decide outside comments), theorem counts. Fails if any file carries an axiom or does not compile. This is the gate every seal depends on.',
37
+ inputSchema: { type: 'object', properties: { file: { type: 'string', description: 'optional single file to verify' } }, required: [] } },
38
+ { name: 'lean_audit_library', description: 'Audit every theorem a Lean library declares, not only the ones a tool serves: build the library, then for each module check that it compiles, carries no sorry, and that each theorem is axiom-free or uses only the standard axioms (propext, Quot.sound). Reports any custom axiom or failure by name.',
39
+ inputSchema: { type: 'object', properties: { project: { type: 'string', description: 'the Lake project directory' }, src: { type: 'string', description: 'the library source root, relative to the project' }, prefix: { type: 'string', description: 'the module prefix, e.g. Qpu' } }, required: ['project', 'src', 'prefix'] } },
40
+ { name: 'web_search', description: 'Search a free public index — wikipedia, openalex or arxiv — and return its hits: title, address, and the snippet it returned. A NONE result means the index returned nothing for that query on this date, never that nothing exists. Use it for online answers through the MCP.',
41
+ inputSchema: { type: 'object', properties: { source: { type: 'string', enum: ['wikipedia', 'openalex', 'arxiv'] }, query: { type: 'string' }, limit: { type: 'number', description: '1 to 10, default 5' } }, required: ['source', 'query'] } },
42
+ { name: 'clay_conditions', description: 'Test the three conditions CMI sets before it considers a proposed solution (publication in a Qualifying Outlet under §6, two years since publication, general acceptance), one verdict each, MET or NOT MET with the reason. The §6(e) and §6(f) text is read from the live rules PDF through web_fetch first. With no evidence record every condition is NOT MET.',
43
+ inputSchema: { type: 'object', properties: {}, required: [] } },
44
+ { name: 'web_fetch', description: 'Read one public http(s) page and return only the passages that match a case-insensitive pattern, each with context, and the content address of the fetched body. Use it for online answers through the MCP. The passages are the page as fetched now; nothing is checked against another source.',
45
+ inputSchema: { type: 'object', properties: { url: { type: 'string' }, pattern: { type: 'string', description: 'regular expression, case-insensitive' }, window: { type: 'number', description: 'characters of context on each side, 20 to 600, default 160' }, raw: { type: 'boolean', description: 'match the HTML itself, so href links can be found' } }, required: ['url', 'pattern'] } },
46
+ { name: 'lean_split', description: 'Break one large Lean statement into smaller questions and answer each yes or no. The statement must be a conjunction A ∧ B ∧ ...; it is split at its top level, each conjunct becomes its own theorem, and lean_ask answers each one. The whole holds only when every part does. The answer names which part failed and why.',
47
+ inputSchema: { type: 'object', properties: { source: { type: 'string', description: 'Lean source whose last theorem has a conjunction as its statement' } }, required: ['source'] } },
48
+ { name: 'task_route', description: 'Paste anything. An integer is classified and checked: trial division, then a Miller–Rabin test. Composite answers come with a proof (a witness or an exact product check); probable primes are labelled probable, not proved. Factors are returned only when the product check passes; large factorisation is not attempted. Text is returned unrouted, with the tools that can take it.',
49
+ inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'the pasted number or text' } }, required: ['input'] } },
50
+ { name: 'run_suite', description: 'Run one named test suite through the server and return its verdict: PASS, FAIL, or SKIPPED (skipped by the environment, never a pass). Suites are an allowlist: mcp-gate, hardcode-gate, mcp-check, net-tools-test, clay-conditions, clay-conditions-self-test, environment.',
51
+ inputSchema: { type: 'object', properties: { suite: { type: 'string', enum: Object.keys(SUITES) } }, required: ['suite'] } },
52
+ { name: 'stall_check', description: 'Flag submitted text that says the next step is unknown, by phrase match on each line. It reads only the text it is given. It cannot see reasoning that was not written down, and no match does not mean the author is not stalled.',
53
+ inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'the text to check' } }, required: ['text'] } },
54
+ { name: 'session_report', description: 'Report the calls this server served in its log: how many, by tool and by status, first and last, and total time. It counts only this server\'s calls. A client reports its own token spend; the server cannot see it.',
55
+ inputSchema: { type: 'object', properties: {}, required: [] } },
56
+ { name: 'git_commit_paths', description: 'Commit only the named files of an allowlisted repository (millennium or qpu) through its own hooks. The hooks run and are never bypassed: a hook that refuses refuses the commit, and the named paths are unstaged again. Pathspec only: nothing else staged enters the commit. Never pushes, amends, or rewrites history.',
57
+ inputSchema: { type: 'object', properties: { repo: { type: 'string', enum: ['millennium', 'qpu'] }, message: { type: 'string', description: 'the commit message; its first line is the subject' }, paths: { type: 'array', items: { type: 'string' }, description: 'the files to commit, relative to the repository' } }, required: ['repo', 'message', 'paths'] } },
58
+ { name: 'answer', description: 'Answer one question with TRUE, FALSE, SOURCED, or UNKNOWN. The question is routed by kind: an integer goes to the arithmetic verifier (TRUE or FALSE from an exact witness), a Lean theorem to the kernel (TRUE only when it compiles with no sorry and no axiom), a DOI to the record resolver (SOURCED only for the canonical record), a Clay problem or other text to UNKNOWN with its reason. Every TRUE or FALSE carries its certificate.',
59
+ inputSchema: { type: 'object', properties: { question: { type: 'string', description: 'an integer, a Lean theorem, a DOI, or a question' } }, required: ['question'] } },
60
+ { name: 'lean_ask', description: 'Answer one Lean question from its source: does it compile, does it use sorry, and which axioms each theorem in it depends on. Compiles in a temporary directory, never in the tree, with the toolchain pinned in lean-toolchain. Answers ABSENT when the Lean toolchain is not on PATH.',
61
+ inputSchema: { type: 'object', properties: { source: { type: 'string', description: 'the Lean source to answer about' } }, required: ['source'] } },
62
+ { name: 'lean_seal', description: 'Seal every compiled, axiom-free Lean theorem into the ledger with a chained receipt. ONLY by-decide theorems are sealed — rfl on a declared constant proves the declaration, not a fact. Gated on lean_verify; seals nothing if the layer does not verify. Pass dry=true to report without writing.',
63
+ inputSchema: { type: 'object', properties: { dry: { type: 'boolean' } }, required: [] } },
64
+ { name: 'lean_generate', description: 'Generate quantified Lean for ledger families — one theorem subsuming a whole family of per-parameter rows. Five gates: compiles, axiom-free, agrees with the ledger test at every parameter, carries a boundary case, and flags a zero divisor in range. Pass emit=true to write.',
65
+ inputSchema: { type: 'object', properties: { emit: { type: 'boolean' } }, required: [] } },
66
+ { name: 'metrics_face', description: 'This repository\'s build face: one row per measurement, each carrying the claim, the value, THE COMMAND THAT RECOMPUTES IT, and a receipt over the row\'s own fields. Gate results are run, not remembered, and a failing gate is reported as FAIL rather than suppressed. A sibling session calls this instead of being sent a prose summary.',
67
+ inputSchema: { type: 'object', properties: {}, required: [] } },
68
+ { name: 'verify_face', description: 'Verify a face emitted by ANY repository — pass its JSON or a path. Recomputes every receipt and the merkle root from the rows themselves, needing nothing from the emitting tree. INTEGRITY ONLY: this establishes that the rows are unaltered since sealing, NOT that any figure is correct. Reading a passing verify as evidence a number is right is the error this exists to prevent.',
69
+ inputSchema: { type: 'object', properties: { json: { type: 'string' }, path: { type: 'string' } }, required: [] } },
70
+ { name: 'peer_faces', description: 'List and verify every face present in the shared fusion directory, so this session can check what siblings published rather than trust their reports. Reports each repo, its root, whether it is intact, and any gate it published as FAIL.',
71
+ inputSchema: { type: 'object', properties: { dir: { type: 'string' } }, required: [] } },
72
+ { name: 'entanglements', description: 'The cross-domain identity map: 80 expressions from 24 subjects — music, biology, sport, juggling, botany, law, textiles, cryptography and the rest — evaluated on ONE shared grid n = 1..20 and clustered by agreeing at every point. Returns the identities (a knockout bracket and an n-bit register are the same integer; phyllotaxis, breeding pairs and Zeckendorf are one recursion), the domains each joins, the expressions that join NOTHING, and whether the entanglement graph is connected. Decided in src/proof/coils.lean, so the identities hold whether or not this tool answers. An identity is not an explanation: neither subject explains the other, they are one object approached from two sides.',
73
+ inputSchema: { type: 'object', properties: { domain: { type: 'string' }, spanningOnly: { type: 'boolean' } } } },
74
+ { name: 'api_joins', description: 'Ask several independent public services for the SAME entity and report which values two or more of them return — the join DISCOVERED from the data rather than declared. PubChem, ChEMBL and ChEBI all return the InChIKey BSYNRYMUTXBXSQ-UHFFFAOYSA-N for aspirin, at three different paths, from two institutions on two continents. Negative results are reported and are the interesting ones: two plant-naming authorities share no joinable value, which is the problem Kew\'s credential-gated MPNS exists to solve. A JOIN IS NOT A TRUTH — it establishes that two databases mean the same entity, never that either is correct; two services can agree and both be wrong. Reaches the network; writes nothing.',
75
+ inputSchema: { type: 'object', properties: { probe: { type: 'string', enum: ['drug', 'protein', 'plant', 'paper'] } } } },
76
+ { name: 'leaks', description: 'Measure where runtime temperature (random draws) and time (clock reads, timers) enter the deposit: every site in src/ and scripts/, classified by kind and role, with the cracks that are to be replaced by theorems. Read from the source on each call; nothing is typed.',
77
+ inputSchema: { type: 'object', properties: { json: { type: 'boolean', description: 'true for the inventory as JSON, false or absent for markdown' } }, required: [] } },
78
+ { name: 'cern', description: 'Enumerate the public CERN Open Data corpus through the sitemap that its robots.txt advertises (never the disallowed /api/), address every record, and run the involution check with its control: a non-involution must go red. Writes .cern/ and checks docs/CERN-ENUMERATION.md against the figures measured. Needs the network; takes minutes.',
79
+ inputSchema: { type: 'object', properties: {}, required: [] } },
80
+ { name: 'apis_guru_cross', description: 'Cross-check the APIs.guru catalogue, offline: for each catalogued API, its spec verdict (is the OpenAPI document served and a spec?) read against its live verdict (does its own server answer?). Reports agreements and disagreements. Reads the committed runs; makes no request.', inputSchema: { type: 'object', properties: {}, required: [] } },
81
+ { name: 'api_adapters', description: 'Ask every API adapter in the registry live, one verdict each: PROVEN when the reply contains the fact the adapter states, WRONG when it does not, REFUSED when robots.txt disallows the path, GATED when a key or licence is needed, NOT MEASURED when the host did not answer. Makes network requests, paced one per second per host.', inputSchema: { type: 'object', properties: {}, required: [] } },
82
+ { name: 'apis_guru_gaps', description: 'The APIs.guru catalogue set against the hosts this tree names: gaps are catalogued APIs whose server the code names but no adapter covers; unused are the rest. Offline; reads the committed live run.', inputSchema: { type: 'object', properties: {}, required: [] } },
83
+ { name: 'understand', description: 'Say which route a request belongs to, and say when none does. Returns UNDERSTOOD with the tool and its arguments, or UNDERSTOOD false with the options the server has. Never answers a request with a route it does not match.', inputSchema: { type: 'object', properties: { request: { type: 'string', description: 'the request as written' } }, required: ['request'] } },
84
+ { name: 'contradictions', description: 'The prose of this deposit set against its own Lean proofs: every place a document says what src/proof does not establish. Reads the tree; makes no request. Each finding names the file and line.', inputSchema: { type: 'object', properties: {}, required: [] } },
85
+ { name: 'answer_gate', description: "Refuse stored or emitted answers that break the certificate rules. The rules are kernel-checked Lean; this reads a JSON array of answers and asks the kernel whether each holds.", inputSchema: { "type": "object", "properties": { "answers": { "type": "array" } }, "required": [] } },
86
+ { name: 'answer_verify_arith', description: "The C2 verifier: proposes a factor or a primality proof and asks the Lean kernel whether it holds. TRUE or FALSE only when the kernel accepts it; otherwise UNKNOWN.", inputSchema: { "type": "object", "properties": { "input": { "type": "string", "description": "the integer to decide" } }, "required": [] } },
87
+ { name: 'answer_verify_arxiv', description: "The C3 verifier for arXiv: SOURCED only when the abstract page of the preprint resolves to the stated title. Fetched robots-respecting and keyless.", inputSchema: { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" } }, "required": [] } },
88
+ { name: 'answer_verify_doi', description: "The C3 verifier for a DOI: resolves it through the MCP and returns SOURCED or UNKNOWN.", inputSchema: { "type": "object", "properties": { "doi": { "type": "string" } }, "required": [] } },
89
+ { name: 'answer_verify_lean', description: "The C1 verifier: runs the Lean kernel on a source and returns TRUE or UNKNOWN for one theorem.", inputSchema: { "type": "object", "properties": { "theorem": { "type": "string" }, "source": { "type": "string", "description": "the Lean source" } }, "required": [] } },
90
+ { name: 'anti_fake', description: "Flag Lean code that claims a proof it does not have. By default checks the Lean files staged for a commit.", inputSchema: { "type": "object", "properties": { "staged": { "type": "boolean" } }, "required": [] } },
91
+ { name: 'apis_guru', description: "The APIs.guru catalogue. mode catalogue snapshots the directory (fast). mode probe starts the full probe of every catalogued specification in the background; its result is written to the evidence folder.", inputSchema: { "type": "object", "properties": { "mode": { "type": "string", "enum": ["catalogue", "probe"] } }, "required": [] } },
92
+ { name: 'apis_guru_live', description: "Starts, in the background, the live reachability pass over every catalogued API server that its specification allows without a key. The result is written to the evidence folder.", inputSchema: { "type": "object", "properties": {}, "required": [] } },
93
+ { name: 'apis_theorems', description: "Writes src/proof/apis.lean from the committed APIs.guru run, so the kernel decides statements about the verdict counts. The counts are read from the run, not typed.", inputSchema: { "type": "object", "properties": {}, "required": [] } },
94
+ { name: 'pre_commit_court', description: "The pre-commit court: manual work is sent to the court before it is committed. Runs the court over the staged work.", inputSchema: { "type": "object", "properties": {}, "required": [] } },
95
+ { name: 'prefix_check', description: "A name that repeats the repository it lives in carries no information. Flags served names that carry a repository prefix.", inputSchema: { "type": "object", "properties": { "repo": { "type": "string" }, "prefixes": { "type": "array" } }, "required": [] } },
96
+ { name: 'secure_split', description: 'Split a secret below 2^256 into shares locally, so that no single share reveals it (additive sharing over Z/2^256, randomness from the operating system). action split takes secret and parts; action join takes shares and recovers the secret. Computed on this machine; nothing is sent anywhere.', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['split', 'join'] }, secret: { type: 'string' }, parts: { type: 'number' }, shares: { type: 'array' } }, required: ['action'] } },
97
+ { name: 'factor_verify', description: 'Check a claimed factorisation of an integer without trusting the claim: the factors must multiply to the integer exactly, each at least 2, and each is tested for primality. VERIFIED when every factor is proved prime; PROBABLE when a factor above 3.3e24 only passes a probabilistic test; REFUSED on a wrong product, a factor below 2, or a composite factor.', inputSchema: { type: 'object', properties: { n: { type: 'string', description: 'the integer, decimal digits' }, factors: { type: 'array', items: { type: 'string' }, description: 'the claimed factors, decimal digits' } }, required: ['n', 'factors'] } },
98
+ { name: 'digit_mirror', description: 'The digit mirror: each digit d becomes 10 − d, so 369 mirrors to 741. Defined only when no digit is 0. Checks that mirroring twice gives back the number (the involution).', inputSchema: { type: 'object', properties: { n: { type: 'string' } }, required: ['n'] } },
99
+ { name: 'semiprime_search', description: 'Semiprimes n = p × q (p ≠ q, both prime) for n in [lo, hi], exact by trial division. noZero excludes numbers with a zero digit, so each has a digit mirror. The limit caps the number of results.', inputSchema: { type: 'object', properties: { lo: { type: 'number' }, hi: { type: 'number' }, noZero: { type: 'boolean' }, limit: { type: 'number' } }, required: ['lo', 'hi'] } },
100
+ { name: 'shor_wave', description: 'Send a wave of integers to the QPU Shor tool and check every factorisation it returns with the verifier, not with a product alone. Reports per input: what the QPU returned, and VERIFIED, PROBABLE, REFUSED or NOT_FACTORED.', inputSchema: { type: 'object', properties: { inputs: { type: 'array', items: { type: 'string' } } }, required: ['inputs'] } },
101
+ { name: 'qpu_wave', description: 'A whole wave in one call: search the range [lo, hi] for semiprimes with no zero digit, mirror each one, send every input and its mirror to the QPU Shor tool in parallel, and verify each factorisation with the verifier. Returns the counts and every row.', inputSchema: { type: 'object', properties: { lo: { type: 'number' }, hi: { type: 'number' }, count: { type: 'number', description: 'semiprimes to take from the range' } }, required: ['lo', 'hi'] } },
102
+ { name: 'trinity', description: 'The trinity in one call: the four gates of the scheduled trinity workflow (gaps, seal, wholeness, lean-claims), run in order, each with its exit status and last lines, so a failure names the gate and the reason.', inputSchema: { type: 'object', properties: {}, required: [] } },
103
+ { name: 'family', description: 'One QPU family by name (one lowercase word, such as analytics): runs the family tests through qpu_families and returns only that family\'s lines.', inputSchema: { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] } },
104
+ { name: 'api_gates', description: 'Every API in the registry as a gate: filesystem gates are checked now (a missing file or a file that no longer states the expected fact refuses); online and gated ones are named, never requested. Offline; reaches no network.', inputSchema: { type: 'object', properties: {} } },
105
+ { name: 'package_gates', description: 'Every lockfile package as a gate at its deepest path: a pinned version and an integrity hash each, refused and named when either is missing. With dockerfiles, each apk add package is a gate too. Offline; reads files only.', inputSchema: { type: 'object', properties: { dockerfiles: { type: 'array', items: { type: 'string' } } } } },
106
+ { name: 'memory_check', description: 'Check the memory directory: every index line links a file, every memory has its frontmatter (name, description, metadata.type), and every [[link]] resolves to a memory. Reads files only; never writes.', inputSchema: { type: 'object', properties: {} } },
107
+ { name: 'memory_derive', description: 'Print the measured block the memory directory is derived from: counts and verdicts read from the ledger, the Lean files and package.json at this moment. Prints only; it never writes the memory files.', inputSchema: { type: 'object', properties: {} } },
108
+ { name: 'api_lattice', description: 'The API lattice: every tool that reaches the network, keyed by its handle (first eight hex digits of its name\'s content address) and set against its declared needs. The catalogue as a grid.', inputSchema: { type: 'object', properties: {}, required: [] } },
109
+ { name: 'policy', description: 'Classify a request to build a capability against the repository rules: ALLOWED (read-only public sources), GATED (changes state, enabled by the owner per credential), or NEEDS_OWNER (money or prices, or no rule names it). A rule-based classification, not a legal ruling; it grants nothing.', inputSchema: { type: 'object', properties: { request: { type: 'string' } }, required: ['request'] } },
110
+ { name: 'factor', description: 'The production factor: the factors of an integer of any width in any binary variant — decimal, 0b binary or 0x hex. FACTORED when every factor is proved (trial division, or a deterministic primality test below 3.3e24). PARTIAL when a cofactor has no factor below 10^6 and is not proved prime: the factors found and the blocking step are returned, nothing is guessed. REFUSED for a non-integer or a value below 2. Every answer carries its witness: the served register qpu.lean pins (faces = coins × rays = 2 × 7) rotated over the fact — the integer and its digit mirror, each rendered in radix 2^k for k = 1..7 and parsed back, each state checked; agree is true only when all fourteen hold and every factorisation multiplies back. Served from every install.', inputSchema: { type: 'object', properties: { n: { type: 'string', description: 'the integer in decimal digits, any length' } }, required: ['n'] } },
111
+ { name: 'hexbit_route', description: 'Route a bit string to its hexbit folder: the content address of the input gives its handle (the first 8 hex digits, per the handle family), and the folder is that handle. Returns the files of the repository that share the handle, each rechecked from its own bytes. Nothing is created. With index true, returns the whole index of the repository\'s Lean sources by folder.', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'the bit string to route' }, index: { type: 'boolean', description: 'true for the whole index instead of one route' } }, required: [] } },
112
+ { name: 'qpu_crosscheck', description: 'Cross-check the GHZ cancellation claim against the qpu connector: qpu\'s X-basis amplitudes, if it returns them, compared with the values computed from the Lean definitions. Corroboration only, never proof; reports NOT MEASURED until qpu returns the amplitudes. Token free: the comparison is a script.', inputSchema: { type: 'object', properties: {}, required: [] } },
113
+ { name: 'prose_check', description: "Check the staged prose of the commit against the Lean ledger, through the same precommit script the hook runs. Judges citations; reports the verdict and the count of staged prose files.", inputSchema: { type: 'object', properties: {}, required: [] } },
114
+ { name: 'theorem_only', description: "Run the theorem-only check over this repository: every runtime test is a violation, and each one names its candidate Lean proofs. Exits non-zero while any runtime test remains.", inputSchema: { type: 'object', properties: {}, required: [] } },
115
+ { name: 'constants_check', description: "Check that README.md and index.md agree with the numbers scripts/pages.ts derives. Reports each disagreement; regenerate with the pages tool.", inputSchema: { type: 'object', properties: {}, required: [] } },
116
+ { name: 'pre_commit_e2e', description: "Run the whole pre-commit hook end to end without committing: prose, forensics, Lean claims, the parallel gates, the court. Returns the hook output and its exit code. The commit tool runs the same hook and is the way to commit.", inputSchema: { type: 'object', properties: {}, required: [] } },
117
+ { name: 'qpu_court_local', description: "Run qpu's own gate-court test from its build, offline. Reports pass and fail counts. The public court is a separate check, through the qpu connector.", inputSchema: { type: 'object', properties: {}, required: [] } },
118
+ { name: 'qpu_families', description: "Run every qpu family test file from its build, in one invocation, and return the pass and fail counts. Each family's own test decides its verdict.", inputSchema: { type: 'object', properties: {}, required: [] } },
119
+ { name: 'clay_online', description: 'The online evidence for each Clay problem, gathered the same way every time: OpenAlex and Crossref literature hits, and the Clay Institute page, each source read through its robots.txt first (a disallowed path is skipped and named). Reports what the sources return. A literature hit is not a proof, and the Clay page status is not determined from its text; the verdicts stay with the answer tool.', inputSchema: { type: 'object', properties: {}, required: [] } },
120
+ { name: 'links_check', description: 'Check every external link in README.md and index.md, once, the same way every time: each host\'s robots.txt is read first, a disallowed path is skipped and named, one request is in flight per host, a HEAD is retried as GET where refused, and a 429 is backed off. Each link is LIVE, DEAD (with its status), or UNREACHABLE (with the reason).', inputSchema: { type: 'object', properties: {}, required: [] } },
121
+ { name: 'explain', description: 'What a named theorem or Lean file is, from its Lean documentation by default: the doc comment or the file header, as the Lean source carries it. Writes no prose of its own; a name with no doc in the Lean source is reported as having none.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'a theorem name, or a Lean file name' } }, required: ['name'] } },
122
+ { name: 'novelty_batch', description: 'Run the deposit\'s prior-art search over the theorems that are unknown or stale: the incremental runner of scripts/novelty.ts. Takes at most limit theorems and at most minutes of work per call; a source that refuses is cooled down and reported as NOT_MEASURED, never as absence. Resumes where the previous call stopped.', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'at most this many theorems in this call' }, minutes: { type: 'number', description: 'the time budget of this call, in minutes' } }, required: [] } },
123
+ { name: 'connect_status', description: 'The state of a background connector call started with connect async true: RUNNING, DONE with the connector\'s reply, or FAILED with its reason.', inputSchema: { type: 'object', properties: { job: { type: 'string', description: 'the job id that connect returned' } }, required: ['job'] } },
124
+ { name: 'evidence', description: 'The deposit\'s evidence, as data: each evidence folder under evidence/ with its files and each file\'s content address. Read from the repository on each call; nothing is typed. Takes an optional folder to list only that folder.', inputSchema: { type: 'object', properties: { folder: { type: 'string', description: 'an evidence folder to list, such as constants; omit for all' } }, required: [] } },
125
+ { name: 'court_trial', description: 'A claim tried by both sides, decided by the Lean kernel: the defence compiles the claim as a theorem, the prosecution compiles its negation. SEALED when only the defence proves; REFUSED when only the prosecution proves; UNKNOWN when neither does; NOT TRIABLE when the claim is not a Lean proposition. Takes the claim as a Lean proposition in the claim field.', inputSchema: { type: 'object', properties: { claim: { type: 'string', description: 'a Lean proposition, such as 2 + 2 = 4' } }, required: ['claim'] } },
126
+ { name: 'leads', description: 'The deposit\'s own open questions, derived from the tree rather than listed: uncontrolled refusing gates, unminted depositions, theorems that read back a hand-set value, MCP tools an install cannot reach. Also CROSSES them by cause — publication, authority, instrument, derivation, environment — because two leads sharing a cause are one problem with two faces and only one of them may be closable. Reports and does not gate: an open question is work not done, which is not work that is wrong.',
127
+ inputSchema: { type: 'object', properties: { area: { type: 'string' } } } },
128
+ { name: 'gates_fire', description: 'Run every refusing gate\'s negative control: each gate must reject its own mutation. It writes into tracked files to do that, so it refuses while the tree has uncommitted changes, while a commit or gate is running, or while a restore marker from a killed run is still present. Controls that fail on a clean tree or match nothing are reported as untrusted.', inputSchema: { type: 'object', properties: {} } },
129
+ { name: 'readers', description: 'Ask the scientific and medical sources this deposit investigates through — Europe PMC, PubMed, PubChem, ChEMBL, UniProt, Ensembl, KEGG, Reactome, GBIF, RxNorm, openFDA, MeSH, ClinicalTrials.gov and more — whether each still answers with a fact known BEFORE it was asked. Three verdicts kept apart: PROVEN, WRONG (the reader is broken OR the expectation was), and NOT MEASURED (it did not answer — silence is not absence). 8 further sources are named as credential- or licence-gated rather than omitted, because an unrecorded gap becomes an implicit claim of completeness. CITATION INSTRUMENTS, NOT MEDICAL ADVICE: a documented traditional use is an anthropological fact, never evidence a use works, and never a dose.',
130
+ inputSchema: { type: 'object', properties: { domain: { type: 'string' }, list: { type: 'boolean' } } } },
131
+ { name: 'live', description: 'What this deposit has actually SHIPPED, asked of the registries rather than the tree: the npm version against package.json, the newest provenance tag, and the site against the ledger this tree holds. A green publish workflow says npm was called, not that the version on the registry is the one here — that gap has been real for three releases. Reports, never gates: network state must not decide whether a local build is allowed.',
132
+ inputSchema: { type: 'object', properties: {} } },
133
+ { name: 'connect', description: 'Call a declared live MCP server and return ITS answer, attributed. With no arguments, lists the connectors and what each one\'s answers do and do not establish. Currently one: qpu.uuidna.com, sixteen tools over the same JSON-RPC this server speaks — its state-vector circuit, its Lean rows, and the Shor run factoring 91 = 7 x 13 by period-finding. FORWARDS, NEVER MIRRORS: copying a remote answer into this tree would make a second source of one truth that drifts from the first and then disagrees silently. A connected answer is a third party\'s report of ITSELF on a date, carrying no more authority than that — and two services agreeing is a join key, never a truth.',
134
+ inputSchema: { type: 'object', properties: { connector: { type: 'string' }, tool: { type: 'string' }, arguments: { type: 'object' } } } },
135
+ { name: 'ledger_status', description: 'Composition of the ledger: total, live, lean-backed, revoked, portable-to-Lean, chain breaks, duplicate keys/receipts, octave remainder. Measurement only — writes nothing.',
136
+ inputSchema: { type: 'object', properties: {}, required: [] } },
137
+ { name: 'ledger_trial', description: 'Put every ledger entry in the dock and record a verdict with its ground — no bare verdicts. Writes src/proof/trial-all.json. Adjudicates, never removes: what follows from a refusal is the captain\'s to order.',
138
+ inputSchema: { type: 'object', properties: {}, required: [] } },
139
+ { name: 'pages', description: 'Regenerate README.md and the homepage from one generator. Every claim derives its sentence from the artefact it reads and must declare the values it read; a claim that measures nothing is refused and nothing is written.',
140
+ inputSchema: { type: 'object', properties: {}, required: [] } },
141
+ ];
142
+ export const LISTED = [
143
+ {
144
+ name: 'list_tools',
145
+ description: "List this server's tools, or give one tool's description and inputSchema.",
146
+ inputSchema: { type: 'object', properties: { name: { type: 'string' } } },
147
+ },
148
+ {
149
+ name: 'call_tool',
150
+ description: "Call one of this server's tools by name with its arguments. `list_tools` lists them.",
151
+ inputSchema: { type: 'object', properties: { name: { type: 'string', enum: TOOLS.map((t) => t.name) }, arguments: { type: 'object' } }, required: ['name'] },
152
+ },
153
+ ];
154
+ export const NEEDS = {
155
+ novelty: ['net'],
156
+ entanglements: ['tree'],
157
+ leads: ['tree'],
158
+ gates_fire: ['net', 'tree'],
159
+ readers: ['net', 'tree'],
160
+ live: ['net', 'tree'],
161
+ connect: ['net', 'tree', 'git'],
162
+ api_joins: ['net', 'tree'],
163
+ coils: ['tree'],
164
+ discoveries: ['tree'],
165
+ formulas: ['tree'],
166
+ handle: ['core'],
167
+ lean_verify: ['lean', 'tree'],
168
+ lean_ask: ['lean', 'tree'],
169
+ answer: ['net', 'lean', 'tree'],
170
+ git_commit_paths: ['git', 'tree'],
171
+ session_report: ['tree'],
172
+ stall_check: ['tree'],
173
+ run_suite: ['net', 'tree'],
174
+ task_route: ['tree'],
175
+ lean_split: ['lean', 'tree'],
176
+ web_fetch: ['net', 'tree'],
177
+ clay_conditions: ['net', 'tree'],
178
+ leaks: ['tree'],
179
+ hexbit_route: ['tree'],
180
+ apis_guru_cross: ['tree'],
181
+ apis_guru_gaps: ['tree'],
182
+ factor: ['core'],
183
+ trinity: ['tree'],
184
+ family: ['tree'],
185
+ memory_check: ['tree'],
186
+ memory_derive: ['tree'],
187
+ api_gates: ['tree'],
188
+ package_gates: ['tree'],
189
+ api_lattice: ['core'],
190
+ policy: ['core'],
191
+ digit_mirror: ['core'],
192
+ semiprime_search: ['tree'],
193
+ shor_wave: ['net', 'tree'],
194
+ qpu_wave: ['net'],
195
+ factor_verify: ['core'],
196
+ secure_split: ['core'],
197
+ contradictions: ['tree'],
198
+ answer_gate: ['tree'],
199
+ answer_verify_arith: ['tree'],
200
+ answer_verify_arxiv: ['tree'],
201
+ answer_verify_doi: ['net', 'tree'],
202
+ answer_verify_lean: ['lean', 'tree'],
203
+ anti_fake: ['tree'],
204
+ apis_guru: ['net', 'tree'],
205
+ apis_guru_live: ['net', 'tree'],
206
+ apis_theorems: ['tree'],
207
+ pre_commit_court: ['net', 'tree'],
208
+ prefix_check: ['tree'],
209
+ understand: ['tree'],
210
+ api_adapters: ['net', 'tree'],
211
+ prose_check: ['tree'],
212
+ theorem_only: ['tree'],
213
+ constants_check: ['tree'],
214
+ pre_commit_e2e: ['tree', 'git', 'lean', 'ledger', 'net'],
215
+ qpu_court_local: ['tree'],
216
+ qpu_families: ['tree'],
217
+ qpu_crosscheck: ['net', 'tree'],
218
+ clay_online: ['net', 'tree'],
219
+ links_check: ['net', 'tree'],
220
+ explain: ['tree'],
221
+ court_trial: ['lean', 'tree'],
222
+ evidence: ['tree'],
223
+ novelty_batch: ['net', 'tree'],
224
+ connect_status: ['tree'],
225
+ cern: ['net', 'tree'],
226
+ web_search: ['net', 'tree'],
227
+ lean_audit_library: ['lean', 'tree'],
228
+ lean_seal: ['lean', 'tree'],
229
+ lean_generate: ['lean', 'tree'],
230
+ ledger_trial: ['tree'],
231
+ pages: ['shared', 'tree'],
232
+ metrics_face: ['tree'],
233
+ verify_face: ['core'],
234
+ peer_faces: ['shared'],
235
+ ledger_status: ['ledger'],
236
+ content_address: ['core'],
237
+ honesty_gate: ['core'],
238
+ merkle_fold: ['core'],
239
+ probe: ['net'],
240
+ verify: ['ledger'],
241
+ lineage: ['git'],
242
+ discover: ['core'],
243
+ recompute: ['ledger'],
244
+ rosetta: ['core'],
245
+ forensics: ['ledger'],
246
+ audit: ['lean', 'tree'],
247
+ };
248
+ export const SELF_SUFFICIENT = Object.entries(NEEDS)
249
+ .filter(([, n]) => n.length === 1 && n[0] === 'core').map(([k]) => k).sort();
@@ -0,0 +1,100 @@
1
+ export type Row = {
2
+ key: string;
3
+ name?: string;
4
+ receipt: string;
5
+ revoked?: boolean;
6
+ reason?: string;
7
+ supersededBy?: string;
8
+ };
9
+ export declare const ledgerStatus: (rows: Row[]) => {
10
+ total: number;
11
+ live: number;
12
+ revoked: number;
13
+ carried: number;
14
+ duplicateKeys: string[];
15
+ duplicateReceipts: string[];
16
+ octave: {
17
+ size: number;
18
+ remainder: number;
19
+ exact: boolean;
20
+ };
21
+ note: string;
22
+ };
23
+ export declare const forensicsOf: (rows: Row[], seed?: string) => {
24
+ entries: number;
25
+ breaks: number;
26
+ genesisDiscontinuities: number;
27
+ newBreaks: {
28
+ index: number;
29
+ key: string;
30
+ expected: string;
31
+ found: string;
32
+ }[];
33
+ intactFromIndex: number;
34
+ seal: string;
35
+ note: string;
36
+ };
37
+ export declare const verifyIn: (rows: Row[], uuid: string) => {
38
+ index?: undefined;
39
+ name?: undefined;
40
+ uuid: string;
41
+ found: boolean;
42
+ note: string;
43
+ key?: undefined;
44
+ live?: undefined;
45
+ supersededBy?: undefined;
46
+ reason?: undefined;
47
+ chainIntactHere?: undefined;
48
+ } | {
49
+ uuid: string;
50
+ found: boolean;
51
+ index: number;
52
+ key: string;
53
+ name: string;
54
+ live: boolean;
55
+ supersededBy: string;
56
+ reason: string;
57
+ chainIntactHere: boolean;
58
+ note: string;
59
+ };
60
+ export declare const CANNOT_SHIP: Record<string, string>;
61
+ export declare const BAKEABLE: string[];
62
+ export type Bake = {
63
+ stamp: Record<string, unknown>;
64
+ answers: Record<string, string>;
65
+ notBaked: Record<string, string>;
66
+ };
67
+ export declare const withBake: (b: Bake) => void;
68
+ export declare const hasBake: () => boolean;
69
+ export declare const FROM_BAKE: Record<string, string>;
70
+ export declare const whyNot: (name: string) => string;
71
+ export declare const SERVED_CORE: string[];
72
+ export declare const SERVED_WITH_LEDGER: string[];
73
+ export declare const served: () => string[];
74
+ export type Formula = {
75
+ name: string;
76
+ statement: string;
77
+ key: string;
78
+ source: string;
79
+ wing: string;
80
+ proof: string;
81
+ };
82
+ export declare const formulasFrom: (rows: Formula[], a?: {
83
+ wing?: string;
84
+ file?: string;
85
+ contains?: string;
86
+ limit?: number;
87
+ }) => {
88
+ total: number;
89
+ matched: number;
90
+ showing: number;
91
+ wings: string[];
92
+ formulas: Formula[];
93
+ note: string;
94
+ };
95
+ export declare const withLedger: (rows: Row[]) => void;
96
+ export declare const hasLedger: () => boolean;
97
+ export declare const withFormulas: (rows: Formula[]) => void;
98
+ export declare const hasFormulas: () => boolean;
99
+ export declare const listTools: (name?: unknown) => string;
100
+ export declare const run: (name: string, a: any) => string;