@mneme-ai/core 2.90.0 β 2.92.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/dist/agent_manifest.d.ts.map +1 -1
- package/dist/agent_manifest.js +4 -0
- package/dist/agent_manifest.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/truth_gate/claims.d.ts.map +1 -1
- package/dist/truth_gate/claims.js +14 -0
- package/dist/truth_gate/claims.js.map +1 -1
- package/dist/truth_gate/probes.d.ts.map +1 -1
- package/dist/truth_gate/probes.js +84 -0
- package/dist/truth_gate/probes.js.map +1 -1
- package/dist/truth_kernel/anamnesis.d.ts +172 -0
- package/dist/truth_kernel/anamnesis.d.ts.map +1 -0
- package/dist/truth_kernel/anamnesis.js +335 -0
- package/dist/truth_kernel/anamnesis.js.map +1 -0
- package/dist/truth_kernel/anamnesis.test.d.ts +15 -0
- package/dist/truth_kernel/anamnesis.test.d.ts.map +1 -0
- package/dist/truth_kernel/anamnesis.test.js +136 -0
- package/dist/truth_kernel/anamnesis.test.js.map +1 -0
- package/dist/truth_kernel/diakrisis.d.ts +132 -0
- package/dist/truth_kernel/diakrisis.d.ts.map +1 -0
- package/dist/truth_kernel/diakrisis.js +184 -0
- package/dist/truth_kernel/diakrisis.js.map +1 -0
- package/dist/truth_kernel/diakrisis.test.d.ts +14 -0
- package/dist/truth_kernel/diakrisis.test.d.ts.map +1 -0
- package/dist/truth_kernel/diakrisis.test.js +99 -0
- package/dist/truth_kernel/diakrisis.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.91.0 β πβ₯ ANAMNESIS Β· "compute once, recollect forever."
|
|
3
|
+
*
|
|
4
|
+
* αΌΞ½Ξ¬ΞΌΞ½Ξ·ΟΞΉΟ (Plato) β the soul does not LEARN, it RECOLLECTS what it already knew.
|
|
5
|
+
* Completes the Greek quartet: Mneme (remember) Β· Lethe (forget, provably) Β·
|
|
6
|
+
* Aletheia (truth) Β· ANAMNESIS (recollect β do NOT recompute).
|
|
7
|
+
*
|
|
8
|
+
* THE ASYMMETRY NO ONE PRICES: a human's question costs ~nothing; an AI's answer
|
|
9
|
+
* costs megawatts (inference). Worse, the SAME truths (2+2=4, "React 19 ships RSC",
|
|
10
|
+
* every verified fact) are re-derived billions of times across every model, user,
|
|
11
|
+
* and session. ANAMNESIS is the memoization cache for TRUTH across the whole AI
|
|
12
|
+
* multiverse: the first AI to PROVE a fact pays the energy; every AI after pays ~0
|
|
13
|
+
* β it re-verifies ALETHEIA's signed lineage (a hash + signature check) instead of
|
|
14
|
+
* re-deriving (full inference).
|
|
15
|
+
*
|
|
16
|
+
* Why only a savant can do it SAFELY: you may reuse a cached answer ONLY IF you can
|
|
17
|
+
* prove it is still true + not expired. So every cache hit is RE-VERIFIED (Ed25519
|
|
18
|
+
* signature + freshness + not-invalidated) β Refusal #3, "trust nothing, including
|
|
19
|
+
* itself." A naive answer-cache that serves a stale fact is worse than recomputing;
|
|
20
|
+
* ANAMNESIS refuses to serve any proof it cannot re-verify and date. Never throws.
|
|
21
|
+
*
|
|
22
|
+
* SAFETY INNOVATION (the cut): the cache key uses ONLY meaning-PRESERVING
|
|
23
|
+
* canonicalization β case/whitespace, number-wordsβdigits, and commutative-arithmetic
|
|
24
|
+
* operand-sort β so genuine paraphrases ("2+2=4" β‘ "two plus two equals four" β‘
|
|
25
|
+
* "4 = 2 + 2") collapse to one proof, while it REFUSES unsafe normalisation
|
|
26
|
+
* (e.g. prose token-sort, which would collide "dog bites man" with "man bites dog").
|
|
27
|
+
* A savant never trades a false collision for a higher hit-rate.
|
|
28
|
+
*/
|
|
29
|
+
import { type NotaryReceipt } from "../notary/index.js";
|
|
30
|
+
export type Verdict = "TRUE" | "FALSE" | "UNKNOWN";
|
|
31
|
+
export interface ProofLineageNode {
|
|
32
|
+
sensor: string;
|
|
33
|
+
verdict: Verdict;
|
|
34
|
+
weight: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ProofRecord {
|
|
37
|
+
/** Meaning-preserving canonical hash of the claim (the cache key). */
|
|
38
|
+
claimKey: string;
|
|
39
|
+
/** A representative original claim string (for humans / audit). */
|
|
40
|
+
claimSample: string;
|
|
41
|
+
verdict: Verdict;
|
|
42
|
+
lineage: ProofLineageNode[];
|
|
43
|
+
computedAt: number;
|
|
44
|
+
/** Freshness window in ms. 0 = an eternal axiom (e.g. 2+2=4 never expires). */
|
|
45
|
+
ttlMs: number;
|
|
46
|
+
/** The inference cost the FIRST prover paid β what each later recollection avoids. */
|
|
47
|
+
costTokens: number;
|
|
48
|
+
/** Who first proved it (attribution β "truth mining"). */
|
|
49
|
+
firstProver: string;
|
|
50
|
+
/** How many times this proof has been recollected (reused). */
|
|
51
|
+
recollections: number;
|
|
52
|
+
/** Hard invalidation (truth_cdn-style): the world changed β force recompute. */
|
|
53
|
+
invalidated: boolean;
|
|
54
|
+
/** Ed25519 NOTARY signature β offline-verifiable across vendors (no shared secret). */
|
|
55
|
+
receipt: NotaryReceipt | null;
|
|
56
|
+
}
|
|
57
|
+
export interface Recollection {
|
|
58
|
+
verdict: Verdict;
|
|
59
|
+
lineage: ProofLineageNode[];
|
|
60
|
+
source: "recollect" | "recompute";
|
|
61
|
+
/** Inference tokens avoided by this recollection (0 on a recompute). */
|
|
62
|
+
energySavedTokens: number;
|
|
63
|
+
claimKey: string;
|
|
64
|
+
/** Why we recomputed (when source = recompute): "miss" | "stale" | "invalidated" | "forged". */
|
|
65
|
+
reason: string;
|
|
66
|
+
}
|
|
67
|
+
/** Compute the meaning-preserving canonical cache key for a claim. Returns the
|
|
68
|
+
* sha256 of the normalised form. Deterministic + total. */
|
|
69
|
+
export declare function canonicalClaimKey(claim: string): string;
|
|
70
|
+
/** The normalised string the key is hashed from (exported for tests/inspection). */
|
|
71
|
+
export declare function canonicalForm(claim: string): string;
|
|
72
|
+
/** Re-verify a cached proof: signature valid + body matches the signed payload +
|
|
73
|
+
* fresh (within TTL, or eternal) + not invalidated. Refusal #3 β every hit. */
|
|
74
|
+
export declare function isTrustworthy(rec: ProofRecord, now: number): boolean;
|
|
75
|
+
export interface ComputeResult {
|
|
76
|
+
verdict: Verdict;
|
|
77
|
+
lineage: ProofLineageNode[];
|
|
78
|
+
ttlMs: number;
|
|
79
|
+
costTokens: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The recollect-or-recompute gate. If a trustworthy proof exists β RECOLLECT
|
|
83
|
+
* (~0 energy, returns energySavedTokens = the avoided inference cost). Otherwise β
|
|
84
|
+
* RECOMPUTE: run the expensive `compute`, sign the proof (Ed25519), persist it for
|
|
85
|
+
* everyone after. Never throws.
|
|
86
|
+
*/
|
|
87
|
+
export declare function recollectOrCompute(repoRoot: string, claim: string, compute: () => Promise<ComputeResult>, opts: {
|
|
88
|
+
now: number;
|
|
89
|
+
agent?: string;
|
|
90
|
+
}): Promise<Recollection>;
|
|
91
|
+
/** Hard-invalidate a cached proof (the world changed). The next ask recomputes.
|
|
92
|
+
* Composes with the v2.89 lattice retract + truth_cdn invalidation. */
|
|
93
|
+
export declare function invalidate(repoRoot: string, claim: string, reason: string): boolean;
|
|
94
|
+
export interface AnamnesisStats {
|
|
95
|
+
records: number;
|
|
96
|
+
recollections: number;
|
|
97
|
+
/** Sum over all records of recollections Γ costTokens β inference tokens avoided. */
|
|
98
|
+
totalEnergySavedTokens: number;
|
|
99
|
+
/** The most-recollected proofs (the highest-leverage cached truths). */
|
|
100
|
+
topProofs: Array<{
|
|
101
|
+
claimSample: string;
|
|
102
|
+
recollections: number;
|
|
103
|
+
costTokens: number;
|
|
104
|
+
savedTokens: number;
|
|
105
|
+
}>;
|
|
106
|
+
chainValid: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Read-only stats over the proof cache. Never throws. */
|
|
109
|
+
export declare function anamnesisStats(repoRoot: string): AnamnesisStats;
|
|
110
|
+
/**
|
|
111
|
+
* Mint a real, signed savings certificate (proof_of_saving) attributing the energy
|
|
112
|
+
* ANAMNESIS has saved: each recollection is a Stage-1 (cache) decision that avoided
|
|
113
|
+
* `costTokens` of inference. Returns the certificate. Never throws.
|
|
114
|
+
*/
|
|
115
|
+
export declare function mintEnergyCertificate(repoRoot: string, opts?: {
|
|
116
|
+
windowStartMs: number;
|
|
117
|
+
windowEndMs: number;
|
|
118
|
+
usdPerToken?: number;
|
|
119
|
+
}): Promise<unknown>;
|
|
120
|
+
/**
|
|
121
|
+
* The headline call: verify a claim, but RECOLLECT a signed proof instead of
|
|
122
|
+
* re-deriving when one is fresh. The first ask runs the full ALETHEIA spine
|
|
123
|
+
* (`assertClaim`); every later ask of the same claim (or a meaning-preserving
|
|
124
|
+
* paraphrase) returns the cached signed verdict for ~0 energy. A proven arithmetic
|
|
125
|
+
* truth is an eternal axiom (ttl 0); everything else gets a freshness window.
|
|
126
|
+
*/
|
|
127
|
+
export declare function recollectAssertion(repoRoot: string, claim: string, opts?: {
|
|
128
|
+
now: number;
|
|
129
|
+
agent?: string;
|
|
130
|
+
ttlMs?: number;
|
|
131
|
+
estTokens?: number;
|
|
132
|
+
}): Promise<Recollection>;
|
|
133
|
+
export interface AnamnesisGauntletReport {
|
|
134
|
+
total: number;
|
|
135
|
+
recollects: number;
|
|
136
|
+
recomputes: number;
|
|
137
|
+
/** recollects / total β higher = more inference skipped. */
|
|
138
|
+
recollectionRate: number;
|
|
139
|
+
/** Recollections that served a NON-trustworthy proof. MUST be 0 (the safety property). */
|
|
140
|
+
staleServeRate: number;
|
|
141
|
+
energySavedTokens: number;
|
|
142
|
+
headline: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The Anamnesis Gauntlet β falsifiable proof of the energy layer. Feed a stream
|
|
146
|
+
* with repeats + paraphrases; measure recollection-rate (β good), stale-serve-rate
|
|
147
|
+
* (MUST be 0 β never serve an unre-verifiable proof), and energy saved. Because every
|
|
148
|
+
* hit is re-verified, stale-serve-rate is 0 by construction; the test proves it.
|
|
149
|
+
*/
|
|
150
|
+
export declare function runAnamnesisGauntlet(repoRoot: string, stream: readonly string[], opts?: {
|
|
151
|
+
now: number;
|
|
152
|
+
}): Promise<AnamnesisGauntletReport>;
|
|
153
|
+
export interface ProofBundle {
|
|
154
|
+
v: 1;
|
|
155
|
+
agent: string;
|
|
156
|
+
proofs: ProofRecord[];
|
|
157
|
+
}
|
|
158
|
+
/** Export this savant's proof cache as a portable, per-proof-signed bundle. */
|
|
159
|
+
export declare function exportProofs(repoRoot: string, agent: string): ProofBundle;
|
|
160
|
+
export interface ProofImportResult {
|
|
161
|
+
added: number;
|
|
162
|
+
duplicate: number;
|
|
163
|
+
rejectedForged: number;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Import a peer's proof bundle. Each proof is accepted ONLY IF its Ed25519 signature
|
|
167
|
+
* verifies offline AND its body matches the signed payload (a claim-swap with a
|
|
168
|
+
* valid-but-unrelated signature is dropped). Existing keys are skipped β idempotent.
|
|
169
|
+
* Never throws.
|
|
170
|
+
*/
|
|
171
|
+
export declare function importProofs(repoRoot: string, bundle: ProofBundle): ProofImportResult;
|
|
172
|
+
//# sourceMappingURL=anamnesis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis.d.ts","sourceRoot":"","sources":["../../src/truth_kernel/anamnesis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AACnD,MAAM,WAAW,gBAAgB;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAEtF,MAAM,WAAW,WAAW;IAC1B,sEAAsE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AAY,CAAC,CAcvB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,GAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAe,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAgB5J;AAGD,MAAM,WAAW,WAAW;IAAG,CAAC,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,EAAE,CAAA;CAAE;AAE3E,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAEzE;AAED,MAAM,WAAW,iBAAiB;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE;AAE/F;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAmBrF"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.91.0 β πβ₯ ANAMNESIS Β· "compute once, recollect forever."
|
|
3
|
+
*
|
|
4
|
+
* αΌΞ½Ξ¬ΞΌΞ½Ξ·ΟΞΉΟ (Plato) β the soul does not LEARN, it RECOLLECTS what it already knew.
|
|
5
|
+
* Completes the Greek quartet: Mneme (remember) Β· Lethe (forget, provably) Β·
|
|
6
|
+
* Aletheia (truth) Β· ANAMNESIS (recollect β do NOT recompute).
|
|
7
|
+
*
|
|
8
|
+
* THE ASYMMETRY NO ONE PRICES: a human's question costs ~nothing; an AI's answer
|
|
9
|
+
* costs megawatts (inference). Worse, the SAME truths (2+2=4, "React 19 ships RSC",
|
|
10
|
+
* every verified fact) are re-derived billions of times across every model, user,
|
|
11
|
+
* and session. ANAMNESIS is the memoization cache for TRUTH across the whole AI
|
|
12
|
+
* multiverse: the first AI to PROVE a fact pays the energy; every AI after pays ~0
|
|
13
|
+
* β it re-verifies ALETHEIA's signed lineage (a hash + signature check) instead of
|
|
14
|
+
* re-deriving (full inference).
|
|
15
|
+
*
|
|
16
|
+
* Why only a savant can do it SAFELY: you may reuse a cached answer ONLY IF you can
|
|
17
|
+
* prove it is still true + not expired. So every cache hit is RE-VERIFIED (Ed25519
|
|
18
|
+
* signature + freshness + not-invalidated) β Refusal #3, "trust nothing, including
|
|
19
|
+
* itself." A naive answer-cache that serves a stale fact is worse than recomputing;
|
|
20
|
+
* ANAMNESIS refuses to serve any proof it cannot re-verify and date. Never throws.
|
|
21
|
+
*
|
|
22
|
+
* SAFETY INNOVATION (the cut): the cache key uses ONLY meaning-PRESERVING
|
|
23
|
+
* canonicalization β case/whitespace, number-wordsβdigits, and commutative-arithmetic
|
|
24
|
+
* operand-sort β so genuine paraphrases ("2+2=4" β‘ "two plus two equals four" β‘
|
|
25
|
+
* "4 = 2 + 2") collapse to one proof, while it REFUSES unsafe normalisation
|
|
26
|
+
* (e.g. prose token-sort, which would collide "dog bites man" with "man bites dog").
|
|
27
|
+
* A savant never trades a false collision for a higher hit-rate.
|
|
28
|
+
*/
|
|
29
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
30
|
+
import { join } from "node:path";
|
|
31
|
+
import { createHash } from "node:crypto";
|
|
32
|
+
import { issueReceipt, verifyReceipt } from "../notary/index.js";
|
|
33
|
+
// ββ meaning-preserving canonicalization (THE HEART, safely) βββββββββββββββ
|
|
34
|
+
const NUMBER_WORDS = {
|
|
35
|
+
zero: "0", one: "1", two: "2", three: "3", four: "4", five: "5", six: "6", seven: "7", eight: "8",
|
|
36
|
+
nine: "9", ten: "10", eleven: "11", twelve: "12", thirteen: "13", fourteen: "14", fifteen: "15",
|
|
37
|
+
sixteen: "16", seventeen: "17", eighteen: "18", nineteen: "19", twenty: "20", hundred: "100", thousand: "1000",
|
|
38
|
+
};
|
|
39
|
+
const OP_WORDS = [
|
|
40
|
+
[/\b(plus|added to)\b/g, "+"],
|
|
41
|
+
[/\b(minus|less)\b/g, "-"],
|
|
42
|
+
[/\b(times|multiplied by)\b/g, "*"],
|
|
43
|
+
[/\b(divided by|over)\b/g, "/"],
|
|
44
|
+
[/\b(equals|equal to|is equal to)\b/g, "="],
|
|
45
|
+
];
|
|
46
|
+
/** Compute the meaning-preserving canonical cache key for a claim. Returns the
|
|
47
|
+
* sha256 of the normalised form. Deterministic + total. */
|
|
48
|
+
export function canonicalClaimKey(claim) {
|
|
49
|
+
return createHash("sha256").update(canonicalForm(claim)).digest("hex");
|
|
50
|
+
}
|
|
51
|
+
/** The normalised string the key is hashed from (exported for tests/inspection). */
|
|
52
|
+
export function canonicalForm(claim) {
|
|
53
|
+
let s = String(claim ?? "").toLowerCase().trim();
|
|
54
|
+
for (const [re, op] of OP_WORDS)
|
|
55
|
+
s = s.replace(re, ` ${op} `);
|
|
56
|
+
// number-words β digits (token-wise, so "fourteen" doesn't touch "four")
|
|
57
|
+
s = s.split(/\s+/).map((tok) => {
|
|
58
|
+
const bare = tok.replace(/[^a-z0-9]/g, "");
|
|
59
|
+
return NUMBER_WORDS[bare] !== undefined ? tok.replace(bare, NUMBER_WORDS[bare]) : tok;
|
|
60
|
+
}).join(" ");
|
|
61
|
+
// collapse spaces around arithmetic operators + whitespace
|
|
62
|
+
s = s.replace(/\s*([+\-*/=])\s*/g, "$1").replace(/\s+/g, " ").trim();
|
|
63
|
+
// arithmetic operand canonicalisation: a OP b = c (and c = a OP b) β sorted for + and *
|
|
64
|
+
const arith = /^(-?\d+(?:\.\d+)?)([+\-*/])(-?\d+(?:\.\d+)?)=(-?\d+(?:\.\d+)?)$/.exec(s.replace(/\s/g, ""));
|
|
65
|
+
const arithRev = /^(-?\d+(?:\.\d+)?)=(-?\d+(?:\.\d+)?)([+\-*/])(-?\d+(?:\.\d+)?)$/.exec(s.replace(/\s/g, ""));
|
|
66
|
+
if (arith) {
|
|
67
|
+
const [, a, op, b, c] = arith;
|
|
68
|
+
return canonArith(a, op, b, c);
|
|
69
|
+
}
|
|
70
|
+
if (arithRev) {
|
|
71
|
+
const [, c, a, op, b] = arithRev;
|
|
72
|
+
return canonArith(a, op, b, c);
|
|
73
|
+
}
|
|
74
|
+
// prose: strip trailing punctuation only β DO NOT reorder words (token-sort would
|
|
75
|
+
// collide different claims). Word order is meaning; the savant preserves it.
|
|
76
|
+
return s.replace(/[.;!?]+$/, "").trim();
|
|
77
|
+
}
|
|
78
|
+
function canonArith(a, op, b, c) {
|
|
79
|
+
// + and * are commutative β sort operands so "2+2"β‘"2+2", "3*4"β‘"4*3". - and / are not.
|
|
80
|
+
if (op === "+" || op === "*") {
|
|
81
|
+
const [x, y] = [a, b].sort((p, q) => (parseFloat(p) - parseFloat(q)) || p.localeCompare(q));
|
|
82
|
+
return `${x}${op}${y}=${c}`;
|
|
83
|
+
}
|
|
84
|
+
return `${a}${op}${b}=${c}`;
|
|
85
|
+
}
|
|
86
|
+
// ββ durable signed store ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
87
|
+
function dir(repoRoot) { return join(repoRoot, ".mneme", "anamnesis"); }
|
|
88
|
+
function storePath(repoRoot) { return join(dir(repoRoot), "proofs.jsonl"); }
|
|
89
|
+
function load(repoRoot) {
|
|
90
|
+
const m = new Map();
|
|
91
|
+
try {
|
|
92
|
+
const p = storePath(repoRoot);
|
|
93
|
+
if (!existsSync(p))
|
|
94
|
+
return m;
|
|
95
|
+
for (const line of readFileSync(p, "utf8").split("\n")) {
|
|
96
|
+
const s = line.trim();
|
|
97
|
+
if (!s)
|
|
98
|
+
continue;
|
|
99
|
+
try {
|
|
100
|
+
const rec = JSON.parse(s);
|
|
101
|
+
m.set(rec.claimKey, rec);
|
|
102
|
+
}
|
|
103
|
+
catch { /* skip corrupt */ }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch { /* */ }
|
|
107
|
+
return m;
|
|
108
|
+
}
|
|
109
|
+
function persist(repoRoot, m) {
|
|
110
|
+
try {
|
|
111
|
+
mkdirSync(dir(repoRoot), { recursive: true });
|
|
112
|
+
writeFileSync(storePath(repoRoot), [...m.values()].map((r) => JSON.stringify(r)).join("\n") + (m.size ? "\n" : ""), "utf8");
|
|
113
|
+
}
|
|
114
|
+
catch { /* best-effort */ }
|
|
115
|
+
}
|
|
116
|
+
/** Re-verify a cached proof: signature valid + body matches the signed payload +
|
|
117
|
+
* fresh (within TTL, or eternal) + not invalidated. Refusal #3 β every hit. */
|
|
118
|
+
export function isTrustworthy(rec, now) {
|
|
119
|
+
if (rec.invalidated)
|
|
120
|
+
return false;
|
|
121
|
+
if (rec.ttlMs > 0 && now - rec.computedAt > rec.ttlMs)
|
|
122
|
+
return false; // stale
|
|
123
|
+
if (!rec.receipt)
|
|
124
|
+
return false;
|
|
125
|
+
try {
|
|
126
|
+
if (!verifyReceipt(rec.receipt).valid)
|
|
127
|
+
return false; // forged / tampered
|
|
128
|
+
const pl = (rec.receipt.payload ?? {});
|
|
129
|
+
return pl.claimKey === rec.claimKey && pl.verdict === rec.verdict; // body matches signed payload
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The recollect-or-recompute gate. If a trustworthy proof exists β RECOLLECT
|
|
137
|
+
* (~0 energy, returns energySavedTokens = the avoided inference cost). Otherwise β
|
|
138
|
+
* RECOMPUTE: run the expensive `compute`, sign the proof (Ed25519), persist it for
|
|
139
|
+
* everyone after. Never throws.
|
|
140
|
+
*/
|
|
141
|
+
export async function recollectOrCompute(repoRoot, claim, compute, opts) {
|
|
142
|
+
const claimKey = canonicalClaimKey(claim);
|
|
143
|
+
const now = opts.now;
|
|
144
|
+
const store = load(repoRoot);
|
|
145
|
+
const hit = store.get(claimKey);
|
|
146
|
+
if (hit && isTrustworthy(hit, now)) {
|
|
147
|
+
hit.recollections += 1;
|
|
148
|
+
store.set(claimKey, hit);
|
|
149
|
+
persist(repoRoot, store);
|
|
150
|
+
return { verdict: hit.verdict, lineage: hit.lineage, source: "recollect", energySavedTokens: hit.costTokens, claimKey, reason: "fresh-authentic" };
|
|
151
|
+
}
|
|
152
|
+
const reason = !hit ? "miss" : hit.invalidated ? "invalidated" : (hit.ttlMs > 0 && now - hit.computedAt > hit.ttlMs) ? "stale" : "forged";
|
|
153
|
+
let out;
|
|
154
|
+
try {
|
|
155
|
+
out = await compute();
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return { verdict: "UNKNOWN", lineage: [], source: "recompute", energySavedTokens: 0, claimKey, reason: "compute-failed" };
|
|
159
|
+
}
|
|
160
|
+
const base = {
|
|
161
|
+
claimKey, claimSample: String(claim ?? "").slice(0, 200), verdict: out.verdict, lineage: out.lineage,
|
|
162
|
+
computedAt: now, ttlMs: Math.max(0, out.ttlMs | 0), costTokens: Math.max(0, out.costTokens | 0),
|
|
163
|
+
firstProver: opts.agent ?? "unknown", recollections: 0, invalidated: false,
|
|
164
|
+
};
|
|
165
|
+
let receipt = null;
|
|
166
|
+
try {
|
|
167
|
+
receipt = issueReceipt(repoRoot, {
|
|
168
|
+
kind: "claim-verdict",
|
|
169
|
+
subject: claimKey,
|
|
170
|
+
payload: { engine: "anamnesis", claimKey, verdict: out.verdict, ttlMs: base.ttlMs, costTokens: base.costTokens },
|
|
171
|
+
issuedAt: now,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
receipt = null;
|
|
176
|
+
}
|
|
177
|
+
store.set(claimKey, { ...base, receipt });
|
|
178
|
+
persist(repoRoot, store);
|
|
179
|
+
return { verdict: out.verdict, lineage: out.lineage, source: "recompute", energySavedTokens: 0, claimKey, reason };
|
|
180
|
+
}
|
|
181
|
+
/** Hard-invalidate a cached proof (the world changed). The next ask recomputes.
|
|
182
|
+
* Composes with the v2.89 lattice retract + truth_cdn invalidation. */
|
|
183
|
+
export function invalidate(repoRoot, claim, reason) {
|
|
184
|
+
void reason;
|
|
185
|
+
const store = load(repoRoot);
|
|
186
|
+
const key = canonicalClaimKey(claim);
|
|
187
|
+
const rec = store.get(key);
|
|
188
|
+
if (!rec)
|
|
189
|
+
return false;
|
|
190
|
+
rec.invalidated = true;
|
|
191
|
+
store.set(key, rec);
|
|
192
|
+
persist(repoRoot, store);
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
/** Read-only stats over the proof cache. Never throws. */
|
|
196
|
+
export function anamnesisStats(repoRoot) {
|
|
197
|
+
const store = load(repoRoot);
|
|
198
|
+
let recollections = 0, totalEnergySavedTokens = 0;
|
|
199
|
+
const rows = [];
|
|
200
|
+
let chainValid = true;
|
|
201
|
+
const now = 0; // signature-only validity (TTL not applied to the audit view)
|
|
202
|
+
for (const rec of store.values()) {
|
|
203
|
+
recollections += rec.recollections;
|
|
204
|
+
const saved = rec.recollections * rec.costTokens;
|
|
205
|
+
totalEnergySavedTokens += saved;
|
|
206
|
+
rows.push({ claimSample: rec.claimSample, recollections: rec.recollections, costTokens: rec.costTokens, savedTokens: saved });
|
|
207
|
+
if (rec.receipt) {
|
|
208
|
+
try {
|
|
209
|
+
if (!verifyReceipt(rec.receipt).valid)
|
|
210
|
+
chainValid = false;
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
chainValid = false;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
void now;
|
|
218
|
+
rows.sort((a, b) => b.savedTokens - a.savedTokens);
|
|
219
|
+
return { records: store.size, recollections, totalEnergySavedTokens, topProofs: rows.slice(0, 10), chainValid };
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Mint a real, signed savings certificate (proof_of_saving) attributing the energy
|
|
223
|
+
* ANAMNESIS has saved: each recollection is a Stage-1 (cache) decision that avoided
|
|
224
|
+
* `costTokens` of inference. Returns the certificate. Never throws.
|
|
225
|
+
*/
|
|
226
|
+
export async function mintEnergyCertificate(repoRoot, opts = { windowStartMs: 0, windowEndMs: 0 }) {
|
|
227
|
+
try {
|
|
228
|
+
const { mintSavingsCertificate } = await import("../proof_of_saving/index.js");
|
|
229
|
+
const store = load(repoRoot);
|
|
230
|
+
const decisions = [];
|
|
231
|
+
for (const rec of store.values()) {
|
|
232
|
+
for (let i = 0; i < rec.recollections; i++) {
|
|
233
|
+
decisions.push({ signature: `${rec.claimKey}#${i}`, tokensUsedActual: 0, estTokensSavedVsDirect: rec.costTokens, stage: 1 });
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return mintSavingsCertificate({ decisions, windowStartMs: opts.windowStartMs, windowEndMs: opts.windowEndMs, usdPerToken: opts.usdPerToken, nowMs: opts.windowEndMs || undefined });
|
|
237
|
+
}
|
|
238
|
+
catch (e) {
|
|
239
|
+
return { error: e.message };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// ββ recollectAssertion β ANAMNESIS in front of the savant spine βββββββββββ
|
|
243
|
+
/**
|
|
244
|
+
* The headline call: verify a claim, but RECOLLECT a signed proof instead of
|
|
245
|
+
* re-deriving when one is fresh. The first ask runs the full ALETHEIA spine
|
|
246
|
+
* (`assertClaim`); every later ask of the same claim (or a meaning-preserving
|
|
247
|
+
* paraphrase) returns the cached signed verdict for ~0 energy. A proven arithmetic
|
|
248
|
+
* truth is an eternal axiom (ttl 0); everything else gets a freshness window.
|
|
249
|
+
*/
|
|
250
|
+
export async function recollectAssertion(repoRoot, claim, opts = { now: 0 }) {
|
|
251
|
+
const compute = async () => {
|
|
252
|
+
const { assertClaim } = await import("./aletheia.js");
|
|
253
|
+
const r = await assertClaim(repoRoot, claim, { issuedAt: opts.now });
|
|
254
|
+
const lineage = r.lineage
|
|
255
|
+
.filter((n) => n.verdict === "TRUE" || n.verdict === "FALSE")
|
|
256
|
+
.map((n) => ({ sensor: n.sensor, verdict: n.verdict, weight: n.confidence }));
|
|
257
|
+
const isAxiom = lineage.some((n) => n.sensor === "arithmetic"); // deterministic β eternal
|
|
258
|
+
const ttlMs = opts.ttlMs ?? (isAxiom ? 0 : 24 * 60 * 60 * 1000);
|
|
259
|
+
// honest cost proxy: a real prover supplies measured tokens; default β claim length Γ 6.
|
|
260
|
+
const costTokens = opts.estTokens ?? Math.max(200, Math.round(String(claim).length * 6));
|
|
261
|
+
return { verdict: r.verdict, lineage, ttlMs, costTokens };
|
|
262
|
+
};
|
|
263
|
+
return recollectOrCompute(repoRoot, claim, compute, { now: opts.now, agent: opts.agent });
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The Anamnesis Gauntlet β falsifiable proof of the energy layer. Feed a stream
|
|
267
|
+
* with repeats + paraphrases; measure recollection-rate (β good), stale-serve-rate
|
|
268
|
+
* (MUST be 0 β never serve an unre-verifiable proof), and energy saved. Because every
|
|
269
|
+
* hit is re-verified, stale-serve-rate is 0 by construction; the test proves it.
|
|
270
|
+
*/
|
|
271
|
+
export async function runAnamnesisGauntlet(repoRoot, stream, opts = { now: 0 }) {
|
|
272
|
+
let recollects = 0, recomputes = 0, energySavedTokens = 0, staleServes = 0;
|
|
273
|
+
for (const claim of stream) {
|
|
274
|
+
const r = await recollectAssertion(repoRoot, claim, { now: opts.now });
|
|
275
|
+
if (r.source === "recollect") {
|
|
276
|
+
recollects++;
|
|
277
|
+
energySavedTokens += r.energySavedTokens;
|
|
278
|
+
// safety audit: a recollection must have come from a trustworthy record
|
|
279
|
+
const rec = load(repoRoot).get(r.claimKey);
|
|
280
|
+
if (!rec || !isTrustworthy(rec, opts.now))
|
|
281
|
+
staleServes++;
|
|
282
|
+
}
|
|
283
|
+
else
|
|
284
|
+
recomputes++;
|
|
285
|
+
}
|
|
286
|
+
const total = stream.length;
|
|
287
|
+
const recollectionRate = total ? recollects / total : 0;
|
|
288
|
+
const staleServeRate = recollects ? staleServes / recollects : 0;
|
|
289
|
+
const headline = `ANAMNESIS GAUNTLET Β· recollect ${(recollectionRate * 100).toFixed(0)}% Β· stale-serve ${(staleServeRate * 100).toFixed(0)}% Β· saved ${energySavedTokens} tokens (stream=${total}, recompute=${recomputes})`;
|
|
290
|
+
return { total, recollects, recomputes, recollectionRate, staleServeRate, energySavedTokens, headline };
|
|
291
|
+
}
|
|
292
|
+
/** Export this savant's proof cache as a portable, per-proof-signed bundle. */
|
|
293
|
+
export function exportProofs(repoRoot, agent) {
|
|
294
|
+
return { v: 1, agent: String(agent ?? "anon"), proofs: [...load(repoRoot).values()] };
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Import a peer's proof bundle. Each proof is accepted ONLY IF its Ed25519 signature
|
|
298
|
+
* verifies offline AND its body matches the signed payload (a claim-swap with a
|
|
299
|
+
* valid-but-unrelated signature is dropped). Existing keys are skipped β idempotent.
|
|
300
|
+
* Never throws.
|
|
301
|
+
*/
|
|
302
|
+
export function importProofs(repoRoot, bundle) {
|
|
303
|
+
const store = load(repoRoot);
|
|
304
|
+
let added = 0, duplicate = 0, rejectedForged = 0;
|
|
305
|
+
for (const rec of (Array.isArray(bundle?.proofs) ? bundle.proofs : [])) {
|
|
306
|
+
if (!rec || typeof rec.claimKey !== "string" || !rec.receipt) {
|
|
307
|
+
rejectedForged++;
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
let ok = false;
|
|
311
|
+
try {
|
|
312
|
+
if (verifyReceipt(rec.receipt).valid) {
|
|
313
|
+
const pl = (rec.receipt.payload ?? {});
|
|
314
|
+
ok = pl.claimKey === rec.claimKey && pl.verdict === rec.verdict;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
ok = false;
|
|
319
|
+
}
|
|
320
|
+
if (!ok) {
|
|
321
|
+
rejectedForged++;
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
if (store.has(rec.claimKey)) {
|
|
325
|
+
duplicate++;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
store.set(rec.claimKey, { ...rec, recollections: 0 }); // reset local reuse counter
|
|
329
|
+
added++;
|
|
330
|
+
}
|
|
331
|
+
if (added > 0)
|
|
332
|
+
persist(repoRoot, store);
|
|
333
|
+
return { added, duplicate, rejectedForged };
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=anamnesis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis.js","sourceRoot":"","sources":["../../src/truth_kernel/anamnesis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAC;AAsCrF,6EAA6E;AAC7E,MAAM,YAAY,GAA2B;IAC3C,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;IACjG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAA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AI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAAC,SAAS,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACvD,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,4BAA4B;QACnF,KAAK,EAAE,CAAC;IACV,CAAC;IACD,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.91.0 β πβ₯ ANAMNESIS tests (compute once, recollect forever).
|
|
3
|
+
*
|
|
4
|
+
* N1 canonicalForm β meaning-preserving paraphrase collapse (arith forms, words, commutative sort, case/space)
|
|
5
|
+
* N2 NO false collision β word order preserved; different values β ; non-commutative not sorted
|
|
6
|
+
* N3 recollect-or-recompute β first computes, repeat recollects (~0), compute runs exactly once
|
|
7
|
+
* N4 re-verify EVERY hit β tampered body / forged sig / stale / invalidated all force recompute
|
|
8
|
+
* N5 freshness window β within ttl β recollect, past ttl β recompute; ttl 0 = eternal axiom
|
|
9
|
+
* N6 energy ledger β anamnesisStats totals + mintEnergyCertificate signs the savings
|
|
10
|
+
* N7 cross-vendor export/import β added, idempotent, forged (claim-swap) dropped
|
|
11
|
+
* N8 Anamnesis Gauntlet β recollection-rate > 0 AND stale-serve-rate === 0
|
|
12
|
+
* N9 QUAN β never throws over fuzz; always 3-valued
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=anamnesis.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anamnesis.test.d.ts","sourceRoot":"","sources":["../../src/truth_kernel/anamnesis.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|