mneme-ai 2.73.0 → 2.74.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/index.d.ts.map +1 -1
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAixMvD"}
|
package/dist/index.js
CHANGED
|
@@ -4682,6 +4682,97 @@ export async function run(argv) {
|
|
|
4682
4682
|
process.exitCode = 1;
|
|
4683
4683
|
}
|
|
4684
4684
|
});
|
|
4685
|
+
// v2.74.0 — CHRONOS: temporal self-consistency honesty signal.
|
|
4686
|
+
const chronosParent = program
|
|
4687
|
+
.command("chronos")
|
|
4688
|
+
.description("v2.74 — temporal self-consistency (ground-truth-free honesty). Default = list agents + scores.")
|
|
4689
|
+
.action(async () => {
|
|
4690
|
+
try {
|
|
4691
|
+
const core = await import("@mneme-ai/core");
|
|
4692
|
+
const agents = core.chronos.listAgents(process.cwd());
|
|
4693
|
+
const scores = agents.map((a) => { const s = core.chronos.scoreAgent(a, process.cwd()); return { agent: a, score: s.score, band: s.band, silentDrift: s.tally.silentDrift }; });
|
|
4694
|
+
const led = core.chronos.verifyLedgerChain(process.cwd());
|
|
4695
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, ledger: led, agents: scores }, null, 2) + "\n");
|
|
4696
|
+
}
|
|
4697
|
+
catch (e) {
|
|
4698
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4699
|
+
process.exitCode = 1;
|
|
4700
|
+
}
|
|
4701
|
+
});
|
|
4702
|
+
chronosParent.command("record")
|
|
4703
|
+
.description("Record an AI answer (topic + stance + answer) to the temporal ledger; classifies drift vs prior answers.")
|
|
4704
|
+
.requiredOption("--agent <id>", "Agent id (consistency is per-agent)")
|
|
4705
|
+
.requiredOption("--topic <text>", "The question / subject")
|
|
4706
|
+
.requiredOption("--stance <text>", "The position taken (the answer's core assertion)")
|
|
4707
|
+
.option("--answer <text>", "Full answer text (evidence extracted from it); defaults to --stance")
|
|
4708
|
+
.option("--self-reported", "AI is explicitly flagging it is revising a prior answer", false)
|
|
4709
|
+
.action(async (opts) => {
|
|
4710
|
+
try {
|
|
4711
|
+
const core = await import("@mneme-ai/core");
|
|
4712
|
+
const r = core.chronos.record({ agent: opts.agent, topic: opts.topic, stance: opts.stance, answerText: opts.answer, selfReportedDrift: opts.selfReported, cwd: process.cwd() });
|
|
4713
|
+
process.stdout.write(JSON.stringify({ ok: r.ok, verdict: r.drift.verdict, reason: r.drift.reason, entryId: r.entry.id, matchedId: r.drift.matched?.id, topicCosine: r.drift.topicCosine }, null, 2) + "\n");
|
|
4714
|
+
if (r.drift.verdict === "SILENT_DRIFT")
|
|
4715
|
+
process.exitCode = 1;
|
|
4716
|
+
}
|
|
4717
|
+
catch (e) {
|
|
4718
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4719
|
+
process.exitCode = 1;
|
|
4720
|
+
}
|
|
4721
|
+
});
|
|
4722
|
+
chronosParent.command("check")
|
|
4723
|
+
.description("Classify a candidate answer vs the ledger WITHOUT recording it (dry-run drift check).")
|
|
4724
|
+
.requiredOption("--agent <id>", "Agent id")
|
|
4725
|
+
.requiredOption("--topic <text>", "The question / subject")
|
|
4726
|
+
.requiredOption("--stance <text>", "The position to check")
|
|
4727
|
+
.option("--answer <text>", "Full answer text; defaults to --stance")
|
|
4728
|
+
.option("--self-reported", "Treat as self-reported drift", false)
|
|
4729
|
+
.action(async (opts) => {
|
|
4730
|
+
try {
|
|
4731
|
+
const core = await import("@mneme-ai/core");
|
|
4732
|
+
const r = core.chronos.check({ agent: opts.agent, topic: opts.topic, stance: opts.stance, answerText: opts.answer, selfReportedDrift: opts.selfReported }, { cwd: process.cwd() });
|
|
4733
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4734
|
+
}
|
|
4735
|
+
catch (e) {
|
|
4736
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4737
|
+
process.exitCode = 1;
|
|
4738
|
+
}
|
|
4739
|
+
});
|
|
4740
|
+
chronosParent.command("score")
|
|
4741
|
+
.description("Show the temporal-honesty score for an agent (0-100 + band + silent-drift list).")
|
|
4742
|
+
.requiredOption("--agent <id>", "Agent id")
|
|
4743
|
+
.option("--banner", "Render ASCII banner instead of JSON")
|
|
4744
|
+
.action(async (opts) => {
|
|
4745
|
+
try {
|
|
4746
|
+
const core = await import("@mneme-ai/core");
|
|
4747
|
+
const s = core.chronos.scoreAgent(opts.agent, process.cwd());
|
|
4748
|
+
if (opts.banner)
|
|
4749
|
+
process.stdout.write(core.chronos.renderScoreBanner(s) + "\n");
|
|
4750
|
+
else
|
|
4751
|
+
process.stdout.write(JSON.stringify(s, null, 2) + "\n");
|
|
4752
|
+
}
|
|
4753
|
+
catch (e) {
|
|
4754
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4755
|
+
process.exitCode = 1;
|
|
4756
|
+
}
|
|
4757
|
+
});
|
|
4758
|
+
chronosParent.command("audit")
|
|
4759
|
+
.description("Verify the HMAC-chained CHRONOS ledger + show last N entries.")
|
|
4760
|
+
.option("--limit <n>", "Max rows", (v) => Number(v), 20)
|
|
4761
|
+
.action(async (opts) => {
|
|
4762
|
+
try {
|
|
4763
|
+
const core = await import("@mneme-ai/core");
|
|
4764
|
+
const led = core.chronos.verifyLedgerChain(process.cwd());
|
|
4765
|
+
const rows = core.chronos.readLedger(process.cwd());
|
|
4766
|
+
const recent = rows.slice(-(opts.limit ?? 20)).map((e) => ({ id: e.id, at: e.at, agent: e.agent, topic: e.topic, stance: e.stance, verdict: e.driftVerdict, matchedId: e.matchedId }));
|
|
4767
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, totalRows: led.rows, brokenAt: led.brokenAt, recent }, null, 2) + "\n");
|
|
4768
|
+
if (!led.ok)
|
|
4769
|
+
process.exitCode = 1;
|
|
4770
|
+
}
|
|
4771
|
+
catch (e) {
|
|
4772
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4773
|
+
process.exitCode = 1;
|
|
4774
|
+
}
|
|
4775
|
+
});
|
|
4685
4776
|
// v2.66.0 — REFLOG: cross-session time-machine.
|
|
4686
4777
|
const reflogParent = program
|
|
4687
4778
|
.command("reflog")
|