mneme-ai 2.55.0 → 2.57.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.
@@ -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,CA6gKvD"}
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,CAwxKvD"}
package/dist/index.js CHANGED
@@ -4715,6 +4715,340 @@ export async function run(argv) {
4715
4715
  process.exitCode = 1;
4716
4716
  }
4717
4717
  });
4718
+ // v2.56.0 — xAI / GROK / SpaceX ALIGNMENT — 3 wild primitives.
4719
+ const launchParent = program
4720
+ .command("launch_window")
4721
+ .description("🚀 v2.56 — SpaceX-style GO/NO-GO release verdict aggregator. Runs TRUTH GATE + PEAK GAUNTLET subset + PERF BUDGET + INDISPENSABILITY + WIRING LAG + PROBE COVERAGE + SDK BUILT gates → single status + HMAC certificate.")
4722
+ .option("--fast", "skip slow gates (truth_gate subset)", false)
4723
+ .action(async (opts) => {
4724
+ try {
4725
+ const core = await import("@mneme-ai/core");
4726
+ const v = await core.xaiAlignment.evaluateLaunchWindow({ cwd: process.cwd(), fast: opts.fast ?? false });
4727
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4728
+ process.stderr.write(core.xaiAlignment.renderLaunchBanner(v) + "\n");
4729
+ if (v.status !== "GO")
4730
+ process.exitCode = 1;
4731
+ }
4732
+ catch (e) {
4733
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4734
+ process.exitCode = 1;
4735
+ }
4736
+ });
4737
+ launchParent.command("check")
4738
+ .description("Alias for `mneme launch_window` default action.")
4739
+ .option("--fast", "skip slow gates", false)
4740
+ .action(async (opts) => {
4741
+ try {
4742
+ const core = await import("@mneme-ai/core");
4743
+ const v = await core.xaiAlignment.evaluateLaunchWindow({ cwd: process.cwd(), fast: opts.fast ?? false });
4744
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4745
+ if (v.status !== "GO")
4746
+ process.exitCode = 1;
4747
+ }
4748
+ catch (e) {
4749
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4750
+ process.exitCode = 1;
4751
+ }
4752
+ });
4753
+ const dragonParent = program
4754
+ .command("dragon")
4755
+ .description("🔥 v2.56 — emergency rollback primitive (DRAGON EJECT). Use `mneme dragon eject <commit> --rationale '...' [--confirm]`.");
4756
+ dragonParent.command("eject <commit>")
4757
+ .description("Eject (revert) a doomed commit + emit GAVEL-grade forensic bundle. Dry-run by default; --confirm to execute.")
4758
+ .requiredOption("--rationale <text>", "WHY are we ejecting? (one-line audit trail)")
4759
+ .option("--probe <id...>", "Failing probe id(s)")
4760
+ .option("--test <id...>", "Failing test id(s)")
4761
+ .option("--perf <op...>", "Perf budget violation(s)")
4762
+ .option("--confirm", "Execute the real eject (default: dry-run)", false)
4763
+ .action(async (commit, opts) => {
4764
+ try {
4765
+ const core = await import("@mneme-ai/core");
4766
+ const r = core.xaiAlignment.dragonEject({
4767
+ repoRoot: process.cwd(),
4768
+ commit,
4769
+ reason: {
4770
+ rationale: opts.rationale,
4771
+ failingProbes: opts.probe ?? [],
4772
+ failingTests: opts.test ?? [],
4773
+ perfViolations: opts.perf ?? [],
4774
+ },
4775
+ dryRun: !opts.confirm,
4776
+ confirm: opts.confirm ?? false,
4777
+ });
4778
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4779
+ if (!r.ok)
4780
+ process.exitCode = 1;
4781
+ }
4782
+ catch (e) {
4783
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4784
+ process.exitCode = 1;
4785
+ }
4786
+ });
4787
+ dragonParent.command("chain")
4788
+ .description("Verify the DRAGON eject ledger HMAC chain.")
4789
+ .action(async () => {
4790
+ try {
4791
+ const core = await import("@mneme-ai/core");
4792
+ const chain = core.xaiAlignment.verifyDragonChain(process.cwd());
4793
+ const events = core.xaiAlignment.listEjects(process.cwd());
4794
+ process.stdout.write(JSON.stringify({ ok: chain.ok, chain, eventCount: events.length, events }, null, 2) + "\n");
4795
+ }
4796
+ catch (e) {
4797
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4798
+ process.exitCode = 1;
4799
+ }
4800
+ });
4801
+ const stargateParent = program
4802
+ .command("stargate")
4803
+ .description("🛡 v2.56 — open-source publish of the augmented calibration corpus (MIT-licensed). Make Mneme the Switzerland of AI vendor identity verification.");
4804
+ stargateParent.command("publish")
4805
+ .description("Build + (optionally) write the corpus bundle. Use --out <path> + --format json|jsonl|md.")
4806
+ .option("--out <path>", "Output file path")
4807
+ .option("--format <fmt>", "Output format: json | jsonl | md", "json")
4808
+ .option("--version <v>", "Mneme version label for the bundle", "2.56.0")
4809
+ .action(async (opts) => {
4810
+ try {
4811
+ const core = await import("@mneme-ai/core");
4812
+ const r = core.xaiAlignment.publishStargate({
4813
+ outPath: opts.out,
4814
+ format: opts.format ?? "json",
4815
+ mnemeVersion: opts.version ?? "2.56.0",
4816
+ });
4817
+ const { bundle, ...rest } = r;
4818
+ process.stdout.write(JSON.stringify({ ...rest, fixtureCount: bundle?.fixtureCount, vendors: bundle?.vendors, augmentationKinds: bundle?.augmentationKinds, contentSha256: bundle?.contentSha256, hmac: bundle?.hmac, citation: bundle?.citation, fixturesPreview: bundle?.fixtures.slice(0, 1) }, null, 2) + "\n");
4819
+ if (!r.ok)
4820
+ process.exitCode = 1;
4821
+ }
4822
+ catch (e) {
4823
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4824
+ process.exitCode = 1;
4825
+ }
4826
+ });
4827
+ stargateParent.command("verify")
4828
+ .description("Verify a STARGATE bundle envelope offline. Use --stdin.")
4829
+ .option("--stdin", "Read bundle JSON from stdin")
4830
+ .action(async () => {
4831
+ try {
4832
+ const core = await import("@mneme-ai/core");
4833
+ const chunks = [];
4834
+ for await (const c of process.stdin)
4835
+ chunks.push(c);
4836
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4837
+ if (!body) {
4838
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass bundle JSON via stdin" }) + "\n");
4839
+ process.exitCode = 1;
4840
+ return;
4841
+ }
4842
+ const r = core.xaiAlignment.verifyStargateBundle(JSON.parse(body));
4843
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4844
+ if (!r.ok)
4845
+ process.exitCode = 1;
4846
+ }
4847
+ catch (e) {
4848
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4849
+ process.exitCode = 1;
4850
+ }
4851
+ });
4852
+ // ──────────────────────────────────────────────────────────────────
4853
+ // v2.57.0 — Top-level surface promotion (no `nemesis` prefix needed)
4854
+ // + WIRING DOCTOR primitive (AST-level per-feature check)
4855
+ // ──────────────────────────────────────────────────────────────────
4856
+ // 🧠 LETHE top-level alias
4857
+ const letheParent = program
4858
+ .command("lethe")
4859
+ .description("🧠 v2.57 — LETHE alias (forwards to `mneme nemesis lethe_forget`). GDPR Art 17 forget primitive.");
4860
+ letheParent.command("forget")
4861
+ .description("Forget a row from a JSONL ledger. Use --ledger <p> --row <n> [--dry-run].")
4862
+ .requiredOption("--ledger <p>", "Repo-relative ledger path")
4863
+ .requiredOption("--row <n>", "Row index (0-based)", (v) => Number(v))
4864
+ .option("--jurisdiction <t>", "GDPR jurisdiction tag", "EU-GDPR-Art17")
4865
+ .option("--dry-run", "Build receipt without rewriting", false)
4866
+ .action(async (opts) => {
4867
+ try {
4868
+ const core = await import("@mneme-ai/core");
4869
+ const r = core.nemesis.forgetRow({ repoRoot: process.cwd(), ledgerRelative: opts.ledger, rowIndex: opts.row, jurisdiction: opts.jurisdiction, dryRun: opts.dryRun ?? false });
4870
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4871
+ if (!r.ok)
4872
+ process.exitCode = 1;
4873
+ }
4874
+ catch (e) {
4875
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4876
+ process.exitCode = 1;
4877
+ }
4878
+ });
4879
+ letheParent.command("verify")
4880
+ .description("Verify a ForgetReceipt cryptographically. Use --stdin.")
4881
+ .option("--stdin", "Read receipt JSON from stdin")
4882
+ .action(async () => {
4883
+ try {
4884
+ const core = await import("@mneme-ai/core");
4885
+ const chunks = [];
4886
+ for await (const c of process.stdin)
4887
+ chunks.push(c);
4888
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4889
+ if (!body) {
4890
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass receipt JSON via stdin" }) + "\n");
4891
+ process.exitCode = 1;
4892
+ return;
4893
+ }
4894
+ const v = core.nemesis.verifyForgetReceipt(JSON.parse(body));
4895
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4896
+ if (!v.ok)
4897
+ process.exitCode = 1;
4898
+ }
4899
+ catch (e) {
4900
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4901
+ process.exitCode = 1;
4902
+ }
4903
+ });
4904
+ // ⚖ GAVEL top-level alias
4905
+ const gavelParent = program
4906
+ .command("gavel")
4907
+ .description("⚖ v2.57 — GAVEL alias (forwards to `mneme nemesis gavel_pack/verify`). Court-admissible bundle.");
4908
+ gavelParent.command("pack")
4909
+ .description("Bind THEMIS + EU stamp + SIBYL into court-admissible Merkle bundle. Use --stdin.")
4910
+ .option("--stdin", "Read bundle input JSON from stdin")
4911
+ .action(async () => {
4912
+ try {
4913
+ const core = await import("@mneme-ai/core");
4914
+ const chunks = [];
4915
+ for await (const c of process.stdin)
4916
+ chunks.push(c);
4917
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4918
+ if (!body) {
4919
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass bundle input JSON via stdin" }) + "\n");
4920
+ process.exitCode = 1;
4921
+ return;
4922
+ }
4923
+ const r = core.nemesis.buildGavelBundle(JSON.parse(body));
4924
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4925
+ if (!r.ok)
4926
+ process.exitCode = 1;
4927
+ }
4928
+ catch (e) {
4929
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4930
+ process.exitCode = 1;
4931
+ }
4932
+ });
4933
+ gavelParent.command("verify")
4934
+ .description("Verify bundle HMAC + Merkle root + per-artifact signature. Use --stdin.")
4935
+ .option("--stdin", "Read bundle JSON from stdin")
4936
+ .action(async () => {
4937
+ try {
4938
+ const core = await import("@mneme-ai/core");
4939
+ const chunks = [];
4940
+ for await (const c of process.stdin)
4941
+ chunks.push(c);
4942
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4943
+ if (!body) {
4944
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass bundle JSON via stdin" }) + "\n");
4945
+ process.exitCode = 1;
4946
+ return;
4947
+ }
4948
+ const v = core.nemesis.verifyGavelBundle(JSON.parse(body));
4949
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4950
+ if (!v.ok)
4951
+ process.exitCode = 1;
4952
+ }
4953
+ catch (e) {
4954
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4955
+ process.exitCode = 1;
4956
+ }
4957
+ });
4958
+ // 🌐 NIMBUS top-level alias
4959
+ const nimbusParent = program
4960
+ .command("nimbus")
4961
+ .description("🌐 v2.57 — NIMBUS alias (forwards to `mneme nemesis nimbus_*`). Federated trust mesh.");
4962
+ nimbusParent.command("publish")
4963
+ .description("Publish leaderboard card to local pub-store. Use --stdin or --org-tag.")
4964
+ .option("--stdin", "Read publish input JSON from stdin")
4965
+ .option("--org-tag <name>", "Org tag (alternative to --stdin)")
4966
+ .action(async (opts) => {
4967
+ try {
4968
+ const core = await import("@mneme-ai/core");
4969
+ let j = null;
4970
+ if (opts.stdin) {
4971
+ const chunks = [];
4972
+ for await (const c of process.stdin)
4973
+ chunks.push(c);
4974
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4975
+ if (body)
4976
+ j = JSON.parse(body);
4977
+ }
4978
+ const orgTag = opts.orgTag ?? j?.orgTag;
4979
+ if (!orgTag) {
4980
+ process.stdout.write(JSON.stringify({ ok: false, error: "orgTag required (--org-tag or via stdin)" }) + "\n");
4981
+ process.exitCode = 1;
4982
+ return;
4983
+ }
4984
+ const input = { ...(j ?? {}), repoRoot: process.cwd(), orgTag };
4985
+ const r = core.nemesis.publishCard(input);
4986
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4987
+ if (!r.ok)
4988
+ process.exitCode = 1;
4989
+ }
4990
+ catch (e) {
4991
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4992
+ process.exitCode = 1;
4993
+ }
4994
+ });
4995
+ nimbusParent.command("subscribe")
4996
+ .description("Subscribe to foreign org's card. Verifies HMAC + expiry. --trust <0..1> optional.")
4997
+ .option("--stdin", "Read card JSON from stdin")
4998
+ .option("--trust <n>", "Local trust weight (0..1)", (v) => Number(v), 0.5)
4999
+ .action(async (opts) => {
5000
+ try {
5001
+ const core = await import("@mneme-ai/core");
5002
+ const chunks = [];
5003
+ for await (const c of process.stdin)
5004
+ chunks.push(c);
5005
+ const body = Buffer.concat(chunks).toString("utf8").trim();
5006
+ if (!body) {
5007
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass card JSON via stdin" }) + "\n");
5008
+ process.exitCode = 1;
5009
+ return;
5010
+ }
5011
+ const r = core.nemesis.subscribeCard({ repoRoot: process.cwd(), card: JSON.parse(body), trustWeight: opts.trust });
5012
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
5013
+ if (!r.ok)
5014
+ process.exitCode = 1;
5015
+ }
5016
+ catch (e) {
5017
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5018
+ process.exitCode = 1;
5019
+ }
5020
+ });
5021
+ nimbusParent.command("reputation")
5022
+ .description("Compute cross-org weighted vendor reputation from subscribed cards.")
5023
+ .action(async () => {
5024
+ try {
5025
+ const core = await import("@mneme-ai/core");
5026
+ const r = core.nemesis.computeCrossOrgReputation(process.cwd());
5027
+ process.stdout.write(JSON.stringify({ ok: true, vendors: r }, null, 2) + "\n");
5028
+ }
5029
+ catch (e) {
5030
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5031
+ process.exitCode = 1;
5032
+ }
5033
+ });
5034
+ // 🤯 WIRING DOCTOR — AST-level per-feature surface check
5035
+ program
5036
+ .command("wiring_doctor")
5037
+ .description("🤯 v2.57 — WIRING DOCTOR: scan core / sdk / cli source for per-feature surface coverage (core export · SDK method · CLI verb · TG claim). Replaces commit-msg parsing with structural verification.")
5038
+ .option("--features <list...>", "Features to check (default: lethe / gavel / nimbus / janus / stargate / dragon / launch_window)")
5039
+ .action(async (opts) => {
5040
+ try {
5041
+ const core = await import("@mneme-ai/core");
5042
+ const r = core.wiringDoctor.diagnose(process.cwd(), { features: opts.features });
5043
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
5044
+ if (!r.ok)
5045
+ process.exitCode = 1;
5046
+ }
5047
+ catch (e) {
5048
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5049
+ process.exitCode = 1;
5050
+ }
5051
+ });
4718
5052
  // v2.53.0 — CATALOG COUNT single source of truth.
4719
5053
  const catalogParent = program
4720
5054
  .command("catalog")