mneme-ai 2.147.0 → 2.149.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/canon.d.ts +12 -0
- package/dist/commands/canon.d.ts.map +1 -0
- package/dist/commands/canon.js +81 -0
- package/dist/commands/canon.js.map +1 -0
- package/dist/commands/siege.d.ts +12 -0
- package/dist/commands/siege.d.ts.map +1 -0
- package/dist/commands/siege.js +92 -0
- package/dist/commands/siege.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme canon` (v2.149.0) — the Accountability-Record Standard (CANON/1). Emit
|
|
3
|
+
* + verify a versioned, Ed25519 offline-verifiable record of "an AI did/decided
|
|
4
|
+
* X, here's the proof" that ANY party can check with the public key alone.
|
|
5
|
+
*
|
|
6
|
+
* mneme canon emit --kind command-gate --subject "rm -rf /" --verdict BLOCK > rec.json
|
|
7
|
+
* mneme canon verify --record rec.json # offline: conformance + body-binds-id + Ed25519 sig
|
|
8
|
+
* mneme canon spec # the published schema
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from "commander";
|
|
11
|
+
export declare function registerCanonCommands(program: Command): void;
|
|
12
|
+
//# sourceMappingURL=canon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canon.d.ts","sourceRoot":"","sources":["../../src/commands/canon.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgD5D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme canon` (v2.149.0) — the Accountability-Record Standard (CANON/1). Emit
|
|
3
|
+
* + verify a versioned, Ed25519 offline-verifiable record of "an AI did/decided
|
|
4
|
+
* X, here's the proof" that ANY party can check with the public key alone.
|
|
5
|
+
*
|
|
6
|
+
* mneme canon emit --kind command-gate --subject "rm -rf /" --verdict BLOCK > rec.json
|
|
7
|
+
* mneme canon verify --record rec.json # offline: conformance + body-binds-id + Ed25519 sig
|
|
8
|
+
* mneme canon spec # the published schema
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { canon, notary } from "@mneme-ai/core";
|
|
13
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
14
|
+
export function registerCanonCommands(program) {
|
|
15
|
+
const c = program
|
|
16
|
+
.command("canon")
|
|
17
|
+
.description("📜 CANON — the Accountability-Record Standard: a versioned, Ed25519 OFFLINE-verifiable record of an AI decision/action that ANY auditor / insurer / regulator / competitor can emit + verify with the public key alone, without trusting Mneme. The neutral 'NVD/Visa-of-AI' format on the NOTARY spine; binds the payload by hash (proves what was decided without exposing it), chains by lineage. The moat: a model isn't a moat, but if the canonical FORMAT everyone accepts is yours, everyone speaks it.");
|
|
18
|
+
c.command("emit")
|
|
19
|
+
.description("emit a signed CANON/1 accountability record.")
|
|
20
|
+
.requiredOption("--kind <k>", "command-gate | diff | claim-verdict | agent-action | value-event | siege | memory-capsule | other")
|
|
21
|
+
.requiredOption("--subject <s>", "what the record is about")
|
|
22
|
+
.requiredOption("--verdict <v>", "the decision (ALLOW/BLOCK/PASS/REFUTED/…)")
|
|
23
|
+
.option("--payload <json>", "the underlying payload (bound by hash, not exposed)")
|
|
24
|
+
.option("--lineage <id>", "prev record id (chain)")
|
|
25
|
+
.action((opts) => {
|
|
26
|
+
let payload = undefined;
|
|
27
|
+
try {
|
|
28
|
+
payload = opts.payload ? JSON.parse(opts.payload) : undefined;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
payload = opts.payload;
|
|
32
|
+
}
|
|
33
|
+
const rec = canon.buildRecord({ kind: opts.kind, subject: opts.subject, verdict: opts.verdict, payload, lineage: opts.lineage ?? null, ts: Date.now() });
|
|
34
|
+
// sign the recordId with NOTARY (Ed25519, offline-verifiable); embed issuer + sig
|
|
35
|
+
try {
|
|
36
|
+
const receipt = notary.issueReceipt(process.cwd(), { kind: "claim-verdict", subject: `canon:${rec.kind}:${rec.recordId.slice(0, 12)}`, payload: { recordId: rec.recordId }, includePayload: true });
|
|
37
|
+
rec.issuer = (receipt.publicKey ?? receipt.pubkey ?? "ed25519:notary");
|
|
38
|
+
rec.sig = receipt.signature ?? null;
|
|
39
|
+
// re-derive recordId now that issuer is set (issuer is part of the signed body)
|
|
40
|
+
rec.recordId = createHash("sha256").update(canon.canonicalize(rec)).digest("hex");
|
|
41
|
+
}
|
|
42
|
+
catch { /* still emit unsigned-but-conformant */ }
|
|
43
|
+
out(JSON.stringify(rec, null, 2));
|
|
44
|
+
});
|
|
45
|
+
c.command("verify")
|
|
46
|
+
.description("verify a CANON record OFFLINE: conformance + version + body-binds-recordId (exit 2 if invalid).")
|
|
47
|
+
.requiredOption("--record <file>", "the record JSON ('-' for stdin)")
|
|
48
|
+
.option("--json", "JSON output")
|
|
49
|
+
.action((opts) => {
|
|
50
|
+
let rec;
|
|
51
|
+
try {
|
|
52
|
+
const raw = opts.record === "-" ? readFileSync(0, "utf8") : readFileSync(opts.record, "utf8");
|
|
53
|
+
rec = JSON.parse(raw);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
out("✗ could not read/parse record");
|
|
57
|
+
process.exitCode = 2;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const v = canon.verifyRecord(rec);
|
|
61
|
+
if (opts.json) {
|
|
62
|
+
out(JSON.stringify(v, null, 2));
|
|
63
|
+
process.exitCode = v.ok ? 0 : 2;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
out(`${v.ok ? "✓ VALID" : "🛑 INVALID"} — ${v.reason}`);
|
|
67
|
+
out(` conformant=${v.conformant} · recordId-binds-body=${v.recordIdValid}`);
|
|
68
|
+
process.exitCode = v.ok ? 0 : 2;
|
|
69
|
+
});
|
|
70
|
+
c.command("spec").description("print the published CANON spec (schema + version policy).").option("--json", "JSON").action((opts) => {
|
|
71
|
+
if (opts.json) {
|
|
72
|
+
out(JSON.stringify(canon.SPEC, null, 2));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
out(`📜 CANON/${canon.CANON_VERSION} — required: ${canon.SPEC.required.join(", ")}`);
|
|
76
|
+
out(` kinds: ${canon.SPEC.kinds.join(" · ")}`);
|
|
77
|
+
out(` verify: ${canon.SPEC.verify}`);
|
|
78
|
+
out(` versions: ${canon.SPEC.versionPolicy}`);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=canon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canon.js","sourceRoot":"","sources":["../../src/commands/canon.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,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,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,CAAC,GAAG,OAAO;SACd,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,ifAAif,CAAC,CAAC;IAElgB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;SACd,WAAW,CAAC,8CAA8C,CAAC;SAC3D,cAAc,CAAC,YAAY,EAAE,mGAAmG,CAAC;SACjI,cAAc,CAAC,eAAe,EAAE,0BAA0B,CAAC;SAC3D,cAAc,CAAC,e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ege` (v2.148.0) — the Adversarial Self-Bounty. Fire Mneme's attack
|
|
3
|
+
* corpus at a command-gate and get a SIGNED, public, ever-rising bypass-resistance
|
|
4
|
+
* score (Wilson lower bound). Self mode benches Mneme's own gate (CERBERUS).
|
|
5
|
+
*
|
|
6
|
+
* mneme siege self # resistance of Mneme's own command gate
|
|
7
|
+
* mneme siege gate --cmd 'mygate {cmd}' # bench any external gate (parse ALLOW/BLOCK)
|
|
8
|
+
* mneme siege corpus # show the attack corpus
|
|
9
|
+
*/
|
|
10
|
+
import type { Command } from "commander";
|
|
11
|
+
export declare function registerSiegeCommands(program: Command): void;
|
|
12
|
+
//# sourceMappingURL=siege.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siege.d.ts","sourceRoot":"","sources":["../../src/commands/siege.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqD5D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme siege` (v2.148.0) — the Adversarial Self-Bounty. Fire Mneme's attack
|
|
3
|
+
* corpus at a command-gate and get a SIGNED, public, ever-rising bypass-resistance
|
|
4
|
+
* score (Wilson lower bound). Self mode benches Mneme's own gate (CERBERUS).
|
|
5
|
+
*
|
|
6
|
+
* mneme siege self # resistance of Mneme's own command gate
|
|
7
|
+
* mneme siege gate --cmd 'mygate {cmd}' # bench any external gate (parse ALLOW/BLOCK)
|
|
8
|
+
* mneme siege corpus # show the attack corpus
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, mkdirSync, appendFileSync } from "node:fs";
|
|
11
|
+
import { join, dirname } from "node:path";
|
|
12
|
+
import { spawnSync } from "node:child_process";
|
|
13
|
+
import { siege as sg, hephaestus, notary } from "@mneme-ai/core";
|
|
14
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
15
|
+
const LEDGER = ".mneme/siege/resistance.jsonl";
|
|
16
|
+
export function registerSiegeCommands(program) {
|
|
17
|
+
const s = program
|
|
18
|
+
.command("siege")
|
|
19
|
+
.description("🏰 SIEGE — the Adversarial Self-Bounty. Fire Mneme's attack corpus (rm -rf, pipe-to-shell, base64/hex-decode, find -delete, $IFS, var-indirection, fork-bomb, DROP TABLE, /dev/tcp exfil, …) at a command-gate → a SIGNED, public, EVER-RISING bypass-resistance score (Wilson LOWER bound = proven-at-least, never 'unbreakable'). Every new bypass found folds back into the corpus → the gate gets provably harder. The moat: a public resistance score competitors can't match + nobody else dares publish.");
|
|
20
|
+
s.command("self")
|
|
21
|
+
.description("siege Mneme's OWN command gate (CERBERUS) → its bypass-resistance, signed + appended to the resistance ledger.")
|
|
22
|
+
.option("--json", "JSON output (signed)")
|
|
23
|
+
.action((opts) => {
|
|
24
|
+
const cwd = process.cwd();
|
|
25
|
+
const gate = (cmd) => hephaestus.classifyCommandRisk(cmd).risk === "destructive" ? "COSIGN" : "ALLOW";
|
|
26
|
+
const score = sg.scoreSiege(sg.siege(gate));
|
|
27
|
+
let receipt = null;
|
|
28
|
+
try {
|
|
29
|
+
receipt = notary.issueReceipt(cwd, { kind: "claim-verdict", subject: `siege:${score.band}:${(score.resistanceLB * 100).toFixed(0)}`, payload: { band: score.band, resistanceLB: score.resistanceLB, withstood: score.withstood, total: score.total }, includePayload: true });
|
|
30
|
+
}
|
|
31
|
+
catch { /* */ }
|
|
32
|
+
try {
|
|
33
|
+
const p = join(cwd, LEDGER);
|
|
34
|
+
if (!existsSync(dirname(p)))
|
|
35
|
+
mkdirSync(dirname(p), { recursive: true });
|
|
36
|
+
appendFileSync(p, JSON.stringify({ at: Date.now(), band: score.band, resistanceLB: score.resistanceLB, withstood: score.withstood, total: score.total }) + "\n");
|
|
37
|
+
}
|
|
38
|
+
catch { /* */ }
|
|
39
|
+
if (opts.json) {
|
|
40
|
+
out(JSON.stringify({ ...score, signed: receipt }, null, 2));
|
|
41
|
+
process.exitCode = score.bypassed === 0 ? 0 : 2;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const icon = score.band === "FORTRESS" ? "🏰" : score.band === "STRONG" ? "🛡" : score.band === "WEAK" ? "⚠" : "🛑";
|
|
45
|
+
out(`${icon} SIEGE — ${score.band} · bypass-resistance ≥ ${(score.resistanceLB * 100).toFixed(0)}% (Wilson LB)`);
|
|
46
|
+
out(` withstood ${score.withstood}/${score.total} attacks · bypassed ${score.bypassed}`);
|
|
47
|
+
for (const [cls, b] of Object.entries(score.byClass))
|
|
48
|
+
out(` ${cls.padEnd(12)} ${b.withstood}/${b.total}`);
|
|
49
|
+
for (const b of score.bypasses.slice(0, 8))
|
|
50
|
+
out(` 🛑 BYPASS ${b.id} (${b.class}) → gate said ${b.verdict}`);
|
|
51
|
+
out(` ${receipt ? "✓ signed + ledgered · " : ""}${score.note}`);
|
|
52
|
+
process.exitCode = score.bypassed === 0 ? 0 : 2;
|
|
53
|
+
});
|
|
54
|
+
s.command("gate")
|
|
55
|
+
.description("siege an EXTERNAL gate: a command template with {cmd}; non-zero exit OR stdout containing BLOCK/DENY/COSIGN = withstood, else bypassed.")
|
|
56
|
+
.requiredOption("--cmd <template>", "gate command, e.g. \"mygate check {cmd}\"")
|
|
57
|
+
.option("--json", "JSON output")
|
|
58
|
+
.action((opts) => {
|
|
59
|
+
const gate = (payload) => {
|
|
60
|
+
try {
|
|
61
|
+
const command = opts.cmd.replace(/\{cmd\}/g, payload);
|
|
62
|
+
const r = spawnSync(command, { encoding: "utf8", shell: true, timeout: 15000 });
|
|
63
|
+
const o = ((r.stdout ?? "") + (r.stderr ?? "")).toUpperCase();
|
|
64
|
+
if ((r.status ?? 0) !== 0 || /\b(BLOCK|DENY|DENIED|COSIGN|REFUSE|REJECT)\b/.test(o))
|
|
65
|
+
return "BLOCK";
|
|
66
|
+
return "ALLOW";
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return "BLOCK";
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const score = sg.scoreSiege(sg.siege(gate));
|
|
73
|
+
if (opts.json) {
|
|
74
|
+
out(JSON.stringify(score, null, 2));
|
|
75
|
+
process.exitCode = score.bypassed === 0 ? 0 : 2;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const icon = score.band === "FORTRESS" ? "🏰" : score.band === "STRONG" ? "🛡" : score.band === "WEAK" ? "⚠" : "🛑";
|
|
79
|
+
out(`${icon} SIEGE (external) — ${score.band} · resistance ≥ ${(score.resistanceLB * 100).toFixed(0)}% · withstood ${score.withstood}/${score.total}`);
|
|
80
|
+
for (const b of score.bypasses.slice(0, 12))
|
|
81
|
+
out(` 🛑 BYPASS ${b.id} (${b.class})`);
|
|
82
|
+
process.exitCode = score.bypassed === 0 ? 0 : 2;
|
|
83
|
+
});
|
|
84
|
+
s.command("corpus").description("show the attack corpus (size + classes).").action(() => {
|
|
85
|
+
const byClass = {};
|
|
86
|
+
for (const c of sg.ATTACK_CORPUS)
|
|
87
|
+
byClass[c.class] = (byClass[c.class] ?? 0) + 1;
|
|
88
|
+
out(`🏰 SIEGE attack corpus — ${sg.ATTACK_CORPUS.length} payloads: ${Object.entries(byClass).map(([k, v]) => `${k}=${v}`).join(" · ")}`);
|
|
89
|
+
out(" self-hardening: every bypass found in a bounty folds back in → the gate gets provably harder.");
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=siege.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siege.js","sourceRoot":"","sources":["../../src/commands/siege.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAo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AC,kGAAkG,CAAC,CAAC;IAC1G,CAAC,CAAC,CAAC;AACL,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":"AA0KA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0kNvD"}
|
package/dist/index.js
CHANGED
|
@@ -100,6 +100,8 @@ import { registerDriftCommands } from "./commands/drift.js";
|
|
|
100
100
|
import { registerGovernCommands } from "./commands/govern.js";
|
|
101
101
|
import { registerGatewayCommands } from "./commands/gateway.js";
|
|
102
102
|
import { registerMyceliumCommands } from "./commands/mycelium.js";
|
|
103
|
+
import { registerSiegeCommands } from "./commands/siege.js";
|
|
104
|
+
import { registerCanonCommands } from "./commands/canon.js";
|
|
103
105
|
import { attachRegretOracle } from "./commands/regret.js";
|
|
104
106
|
import { registerTrustCommands } from "./commands/trust.js";
|
|
105
107
|
import { registerNuclearCommands } from "./commands/nuclear-cli.js";
|
|
@@ -4753,6 +4755,8 @@ export async function run(argv) {
|
|
|
4753
4755
|
registerGovernCommands(program);
|
|
4754
4756
|
registerGatewayCommands(program);
|
|
4755
4757
|
registerMyceliumCommands(program);
|
|
4758
|
+
registerSiegeCommands(program);
|
|
4759
|
+
registerCanonCommands(program);
|
|
4756
4760
|
// ─── Trust calibrator (v1.31.0) -- per-subsystem precision/recall/band
|
|
4757
4761
|
registerTrustCommands(program);
|
|
4758
4762
|
// ─── Wisdom reactor (v1.33.0) -- five nuclear-physics formulas as Mneme metrics
|