mneme-ai 2.52.0 → 2.54.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.js CHANGED
@@ -4580,10 +4580,13 @@ export async function run(argv) {
4580
4580
  // v2.49.0 — `mneme probe coverage` (formal verb + subcommand).
4581
4581
  // v2.50.0 — Multi-alias: `probe` / `gate` / `coverage` / `probecoverage`
4582
4582
  // / `probe_coverage` all default to running the coverage gate.
4583
- const runCoverageGate = async () => {
4583
+ // v2.53.0 accept --threshold <n> for soft enforcement (default 50%).
4584
+ // Without --threshold, gate uses 50%. With --threshold 0, gate disabled.
4585
+ const runCoverageGate = async (options) => {
4584
4586
  try {
4585
4587
  const core = await import("@mneme-ai/core");
4586
- const r = core.releaseGate.crossCheckFromDisk(process.cwd());
4588
+ const threshold = Number.isFinite(options?.threshold) ? options.threshold : 50;
4589
+ const r = core.releaseGate.crossCheckFromDisk(process.cwd(), { threshold });
4587
4590
  process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4588
4591
  if (!r.ok)
4589
4592
  process.exitCode = 1;
@@ -4593,15 +4596,179 @@ export async function run(argv) {
4593
4596
  process.exitCode = 1;
4594
4597
  }
4595
4598
  };
4596
- const probeParent = program.command("probe").description("v2.49 — TRUTH GATE probe utilities. Default action = coverage gate.").action(runCoverageGate);
4597
- probeParent.command("coverage").description("Cross-check tool catalog vs claim catalog; report uncovered tools.").action(runCoverageGate);
4599
+ const probeParent = program.command("probe")
4600
+ .description("v2.49 TRUTH GATE probe utilities. Default action = coverage gate.")
4601
+ .option("--threshold <n>", "v2.53 minimum coverage % (default 50)", (v) => Number(v))
4602
+ .action((opts) => runCoverageGate(opts));
4603
+ probeParent.command("coverage")
4604
+ .description("Cross-check tool catalog vs claim catalog; report uncovered tools + coverage %.")
4605
+ .option("--threshold <n>", "Minimum coverage % (default 50)", (v) => Number(v))
4606
+ .action((opts) => runCoverageGate(opts));
4598
4607
  // v2.50.0 — top-level aliases for the coverage gate.
4599
4608
  for (const alias of ["gate", "coverage", "probecoverage", "probe_coverage"]) {
4600
4609
  program
4601
4610
  .command(alias)
4602
4611
  .description(`v2.50 alias for \`mneme probe coverage\` — run the TRUTH GATE probe-coverage gate.`)
4603
- .action(runCoverageGate);
4612
+ .option("--threshold <n>", "v2.53 minimum coverage % (default 50)", (v) => Number(v))
4613
+ .action((opts) => runCoverageGate(opts));
4604
4614
  }
4615
+ // v2.53.0 — WIRING-LAG gate CLI surface.
4616
+ program
4617
+ .command("wiring_lag")
4618
+ .description("v2.53 P0-3 — parse recent commit msgs for `mneme <verb>` claims + spawn each as subprocess; report 'unknown command' as wiring-lag bugs.")
4619
+ .option("--max-commits <n>", "How many recent commits to scan", (v) => Number(v), 10)
4620
+ .action(async (opts) => {
4621
+ try {
4622
+ const core = await import("@mneme-ai/core");
4623
+ const r = core.wiringLag.checkWiringLag(process.cwd(), { maxCommits: opts.maxCommits ?? 10 });
4624
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4625
+ if (!r.ok)
4626
+ process.exitCode = 1;
4627
+ }
4628
+ catch (e) {
4629
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4630
+ process.exitCode = 1;
4631
+ }
4632
+ });
4633
+ // v2.54.0 — STRATEGY primitive (RFC drafts + pricing tiers).
4634
+ const strategyParent = program
4635
+ .command("strategy")
4636
+ .description("v2.54 — strategy primitive: RFC drafts + pricing tiers + roadmap. Default action = full report.")
4637
+ .action(async () => {
4638
+ try {
4639
+ const core = await import("@mneme-ai/core");
4640
+ process.stdout.write(JSON.stringify(core.getStrategyReport(), null, 2) + "\n");
4641
+ }
4642
+ catch (e) {
4643
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4644
+ process.exitCode = 1;
4645
+ }
4646
+ });
4647
+ strategyParent.command("rfc")
4648
+ .description("v2.54 — list RFC drafts (W3C / ECMA / NIST) with status + standards-body target.")
4649
+ .action(async () => {
4650
+ try {
4651
+ const core = await import("@mneme-ai/core");
4652
+ process.stdout.write(JSON.stringify({ rfcDrafts: core.RFC_DRAFTS, rendered: core.renderRfcIndex() }, null, 2) + "\n");
4653
+ }
4654
+ catch (e) {
4655
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4656
+ process.exitCode = 1;
4657
+ }
4658
+ });
4659
+ strategyParent.command("pricing")
4660
+ .description("v2.54 — list pricing tiers (Free local / Pro Federation / Enterprise / Sovereign).")
4661
+ .action(async () => {
4662
+ try {
4663
+ const core = await import("@mneme-ai/core");
4664
+ process.stdout.write(JSON.stringify({ pricing: core.PRICING_TIERS, rendered: core.renderPricingTable() }, null, 2) + "\n");
4665
+ }
4666
+ catch (e) {
4667
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4668
+ process.exitCode = 1;
4669
+ }
4670
+ });
4671
+ // v2.54.0 — PERF BUDGET primitive.
4672
+ const perfParent = program
4673
+ .command("perf")
4674
+ .description("v2.54 P2 — performance budget primitive. Default action = run budgets.")
4675
+ .action(async () => {
4676
+ try {
4677
+ const core = await import("@mneme-ai/core");
4678
+ const r = core.runPerfBudget();
4679
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4680
+ if (!r.ok)
4681
+ process.exitCode = 1;
4682
+ }
4683
+ catch (e) {
4684
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4685
+ process.exitCode = 1;
4686
+ }
4687
+ });
4688
+ perfParent.command("budget")
4689
+ .description("Run the in-process perf budget suite; reports warm mean / p95 / cold-first per op + pass/fail.")
4690
+ .action(async () => {
4691
+ try {
4692
+ const core = await import("@mneme-ai/core");
4693
+ const r = core.runPerfBudget();
4694
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4695
+ if (!r.ok)
4696
+ process.exitCode = 1;
4697
+ }
4698
+ catch (e) {
4699
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4700
+ process.exitCode = 1;
4701
+ }
4702
+ });
4703
+ // v2.54.0 — INDISPENSABILITY measurable checklist.
4704
+ program
4705
+ .command("indispensability")
4706
+ .description("v2.54 Tier-3 — score Mneme against the 6-criterion indispensability checklist (UX degradation / onboarding / cost / switching / trust / regulator). Weighted 0..100.")
4707
+ .action(async () => {
4708
+ try {
4709
+ const core = await import("@mneme-ai/core");
4710
+ const r = core.evaluateIndispensability(process.cwd());
4711
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4712
+ }
4713
+ catch (e) {
4714
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4715
+ process.exitCode = 1;
4716
+ }
4717
+ });
4718
+ // v2.53.0 — CATALOG COUNT single source of truth.
4719
+ const catalogParent = program
4720
+ .command("catalog")
4721
+ .description("v2.53 P1-5 — catalog count + HMAC-signed envelope; cite in docs to prevent count drift.")
4722
+ .action(async () => {
4723
+ try {
4724
+ const core = await import("@mneme-ai/core");
4725
+ const c = core.getCatalogCount({});
4726
+ process.stdout.write(JSON.stringify(c, null, 2) + "\n");
4727
+ }
4728
+ catch (e) {
4729
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4730
+ process.exitCode = 1;
4731
+ }
4732
+ });
4733
+ catalogParent.command("count")
4734
+ .description("Live catalog count + per-group breakdown + signed envelope.")
4735
+ .action(async () => {
4736
+ try {
4737
+ const core = await import("@mneme-ai/core");
4738
+ const c = core.getCatalogCount({});
4739
+ process.stdout.write(JSON.stringify(c, null, 2) + "\n");
4740
+ }
4741
+ catch (e) {
4742
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4743
+ process.exitCode = 1;
4744
+ }
4745
+ });
4746
+ catalogParent.command("verify")
4747
+ .description("Verify a CatalogCount JSON envelope via --stdin.")
4748
+ .option("--stdin", "Read CatalogCount JSON from stdin")
4749
+ .action(async () => {
4750
+ try {
4751
+ const core = await import("@mneme-ai/core");
4752
+ const chunks = [];
4753
+ for await (const c of process.stdin)
4754
+ chunks.push(c);
4755
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4756
+ if (!body) {
4757
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass JSON via --stdin" }) + "\n");
4758
+ process.exitCode = 1;
4759
+ return;
4760
+ }
4761
+ const c = JSON.parse(body);
4762
+ const valid = core.verifyCatalogCount(c);
4763
+ process.stdout.write(JSON.stringify({ ok: valid, valid }) + "\n");
4764
+ if (!valid)
4765
+ process.exitCode = 1;
4766
+ }
4767
+ catch (e) {
4768
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4769
+ process.exitCode = 1;
4770
+ }
4771
+ });
4605
4772
  // v2.50.0 — heat-map CLI for tracking alias misses + auto-promotion.
4606
4773
  const aliasMisses = program.command("alias_misses").description("v2.50 — read/promote `.mneme/alias_misses.jsonl` so unknown-verbs typed by users can become real aliases in next release.");
4607
4774
  aliasMisses.command("report")