mneme-ai 3.141.0 → 3.143.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/commands/honesty_ledger.d.ts +14 -0
- package/dist/commands/honesty_ledger.d.ts.map +1 -0
- package/dist/commands/honesty_ledger.js +90 -0
- package/dist/commands/honesty_ledger.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme truthproof` (v3.143.0) — THE PUBLIC HONESTY LEDGER.
|
|
3
|
+
*
|
|
4
|
+
* Turns the zero-drift TRUTH GATE into a VISIBLE, offline-verifiable moat:
|
|
5
|
+
* emit — reconcile every public claim + emit a signed JSON + human markdown + badge
|
|
6
|
+
* verify — verify a pasted ledger OFFLINE (Ed25519, re-derives its own math)
|
|
7
|
+
* badge — print the honest Truth-Gate badge (green ONLY when drift+refuted=0)
|
|
8
|
+
*
|
|
9
|
+
* mneme truthproof emit --out docs/HONESTY-LEDGER.json --md docs/HONESTY-LEDGER.md --badge assets/honesty-badge.svg
|
|
10
|
+
* mneme truthproof verify --file docs/HONESTY-LEDGER.json
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from "commander";
|
|
13
|
+
export declare function registerLedgerCommands(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=honesty_ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honesty_ledger.d.ts","sourceRoot":"","sources":["../../src/commands/honesty_ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2C7D"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme truthproof` (v3.143.0) — THE PUBLIC HONESTY LEDGER.
|
|
3
|
+
*
|
|
4
|
+
* Turns the zero-drift TRUTH GATE into a VISIBLE, offline-verifiable moat:
|
|
5
|
+
* emit — reconcile every public claim + emit a signed JSON + human markdown + badge
|
|
6
|
+
* verify — verify a pasted ledger OFFLINE (Ed25519, re-derives its own math)
|
|
7
|
+
* badge — print the honest Truth-Gate badge (green ONLY when drift+refuted=0)
|
|
8
|
+
*
|
|
9
|
+
* mneme truthproof emit --out docs/HONESTY-LEDGER.json --md docs/HONESTY-LEDGER.md --badge assets/honesty-badge.svg
|
|
10
|
+
* mneme truthproof verify --file docs/HONESTY-LEDGER.json
|
|
11
|
+
*/
|
|
12
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { honestyLedger } from "@mneme-ai/core";
|
|
14
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
15
|
+
function version() {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return "0.0.0";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function registerLedgerCommands(program) {
|
|
24
|
+
const c = program.command("truthproof")
|
|
25
|
+
.description("🛡 PUBLIC HONESTY LEDGER — a signed, offline-verifiable record that every public Mneme claim currently passes its probe (zero drift). The badge cannot be faked green. Verify offline: `mneme truthproof verify`.");
|
|
26
|
+
c.command("emit").description("reconcile every claim + emit a signed public ledger (JSON + markdown + badge)")
|
|
27
|
+
.option("--out <file>", "write signed JSON ledger to file")
|
|
28
|
+
.option("--md <file>", "write human markdown to file")
|
|
29
|
+
.option("--badge <file>", "write the SVG badge to file")
|
|
30
|
+
.option("--json", "print the signed receipt JSON to stdout")
|
|
31
|
+
.action(async (o) => {
|
|
32
|
+
const { ledger, receipt } = await honestyLedger.buildHonestyLedger(process.cwd(), version());
|
|
33
|
+
if (o.out)
|
|
34
|
+
writeFileSync(o.out, JSON.stringify(receipt, null, 2) + "\n");
|
|
35
|
+
if (o.md)
|
|
36
|
+
writeFileSync(o.md, honestyLedger.ledgerMarkdown(ledger, receipt) + "\n");
|
|
37
|
+
if (o.badge)
|
|
38
|
+
writeFileSync(o.badge, honestyLedger.badgeSVG(ledger.summary) + "\n");
|
|
39
|
+
if (o.json) {
|
|
40
|
+
out(JSON.stringify(receipt, null, 2));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const s = ledger.summary;
|
|
44
|
+
out(`🛡 HONESTY LEDGER — mneme@${ledger.version}`);
|
|
45
|
+
out(` ${s.honest ? "🟢 ZERO-DRIFT" : "⚠ DRIFTING"} · ${s.pass}/${s.measured} claims pass · drift ${s.drift} · refuted ${s.refuted} · unmeasured ${s.unmeasured} · score ${s.score}/100`);
|
|
46
|
+
out(` signed ${receipt.issuerFingerprint} · receipt ${receipt.receiptId.slice(0, 16)}…`);
|
|
47
|
+
if (o.out || o.md || o.badge)
|
|
48
|
+
out(` wrote: ${[o.out, o.md, o.badge].filter(Boolean).join(", ")}`);
|
|
49
|
+
else
|
|
50
|
+
out(` (add --out/--md/--badge to write artifacts; --json for the signed receipt)`);
|
|
51
|
+
});
|
|
52
|
+
c.command("verify").description("verify a public honesty ledger OFFLINE (Ed25519 + re-derives its own math)")
|
|
53
|
+
.option("--file <file>", "ledger receipt JSON file")
|
|
54
|
+
.action((o) => {
|
|
55
|
+
let raw = "";
|
|
56
|
+
try {
|
|
57
|
+
raw = o.file ? readFileSync(o.file, "utf8") : readFileSync(0, "utf8");
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
out("⛔ provide --file <ledger.json> (or pipe the JSON on stdin)");
|
|
61
|
+
process.exitCode = 2;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let receipt;
|
|
65
|
+
try {
|
|
66
|
+
receipt = JSON.parse(raw);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
out("⛔ not valid JSON");
|
|
70
|
+
process.exitCode = 2;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const v = honestyLedger.verifyHonestyLedger(receipt);
|
|
74
|
+
if (!v.valid) {
|
|
75
|
+
out(`🔴 INVALID — ${v.reason}`);
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
out(`🟢 VALID${v.honest ? " · HONEST (zero drift)" : " · ⚠ DRIFTING"} — ${v.summary.pass}/${v.summary.measured} pass, drift ${v.summary.drift}, refuted ${v.summary.refuted} (score ${v.summary.score}/100)`);
|
|
80
|
+
if (!v.honest)
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
});
|
|
83
|
+
c.command("badge").description("print the honest Truth-Gate badge (SVG, or --shields for shields.io JSON)")
|
|
84
|
+
.option("--shields", "emit shields.io endpoint JSON instead of SVG")
|
|
85
|
+
.action(async (o) => {
|
|
86
|
+
const { ledger } = await honestyLedger.buildHonestyLedger(process.cwd(), version());
|
|
87
|
+
out(o.shields ? JSON.stringify(honestyLedger.badgeShields(ledger.summary)) : honestyLedger.badgeSVG(ledger.summary));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=honesty_ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honesty_ledger.js","sourceRoot":"","sources":["../../src/commands/honesty_ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,SAAS,OAAO;IACd,IAAI,CAAC;QAAC,OAAQ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,G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AC,WAAW,EAAE,8CAA8C,CAAC;SACnE,MAAM,CAAC,KAAK,EAAE,CAAwB,EAAE,EAAE;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QACpF,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACvH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkNA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqnNvD"}
|
package/dist/index.js
CHANGED
|
@@ -140,6 +140,7 @@ import { registerCtxCommands } from "./commands/ctx.js";
|
|
|
140
140
|
import { registerLaunchCommands } from "./commands/launch.js";
|
|
141
141
|
import { registerArkCommands } from "./commands/ark.js";
|
|
142
142
|
import { registerCosmosCommands } from "./commands/cosmos.js";
|
|
143
|
+
import { registerLedgerCommands } from "./commands/honesty_ledger.js";
|
|
143
144
|
import { registerMoatCommands } from "./commands/moat.js";
|
|
144
145
|
import { attachRegretOracle } from "./commands/regret.js";
|
|
145
146
|
import { registerTrustCommands } from "./commands/trust.js";
|
|
@@ -4837,6 +4838,7 @@ export async function run(argv) {
|
|
|
4837
4838
|
registerLaunchCommands(program);
|
|
4838
4839
|
registerArkCommands(program);
|
|
4839
4840
|
registerCosmosCommands(program);
|
|
4841
|
+
registerLedgerCommands(program);
|
|
4840
4842
|
registerMoatCommands(program);
|
|
4841
4843
|
// ─── Trust calibrator (v1.31.0) -- per-subsystem precision/recall/band
|
|
4842
4844
|
registerTrustCommands(program);
|