@massu/core 1.10.2 → 1.10.4

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/cli.js CHANGED
@@ -1605,7 +1605,7 @@ function addFailureClass(db, opts) {
1605
1605
  return Number(result.lastInsertRowid);
1606
1606
  }
1607
1607
  function getFailureClasses(db) {
1608
- const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name").all();
1608
+ const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name LIMIT 10000").all();
1609
1609
  return rows.map((row) => ({
1610
1610
  id: row.id,
1611
1611
  name: row.name,
@@ -25469,7 +25469,7 @@ function buildCrossReferences(db) {
25469
25469
  const insertEdge = db.prepare(
25470
25470
  "INSERT OR IGNORE INTO knowledge_edges (source_type, source_id, target_type, target_id, edge_type) VALUES (?, ?, ?, ?, ?)"
25471
25471
  );
25472
- const rules = db.prepare("SELECT rule_id, vr_type, reference_path FROM knowledge_rules").all();
25472
+ const rules = db.prepare("SELECT rule_id, vr_type, reference_path FROM knowledge_rules LIMIT 10000").all();
25473
25473
  for (const rule of rules) {
25474
25474
  if (rule.vr_type && rule.vr_type !== "VR-*") {
25475
25475
  const vrTypes = rule.vr_type.split(/[,\s]+/).filter((v3) => v3.startsWith("VR-"));
@@ -25484,7 +25484,7 @@ function buildCrossReferences(db) {
25484
25484
  edgeCount++;
25485
25485
  }
25486
25486
  }
25487
- const incidents = db.prepare("SELECT incident_num, cr_added FROM knowledge_incidents WHERE cr_added IS NOT NULL").all();
25487
+ const incidents = db.prepare("SELECT incident_num, cr_added FROM knowledge_incidents WHERE cr_added IS NOT NULL LIMIT 10000").all();
25488
25488
  for (const inc of incidents) {
25489
25489
  if (inc.cr_added) {
25490
25490
  const crIds = inc.cr_added.match(/CR-\d+/g) || [];
@@ -25494,7 +25494,7 @@ function buildCrossReferences(db) {
25494
25494
  }
25495
25495
  }
25496
25496
  }
25497
- const chunks = db.prepare("SELECT id, content, metadata FROM knowledge_chunks").all();
25497
+ const chunks = db.prepare("SELECT id, content, metadata FROM knowledge_chunks LIMIT 100000").all();
25498
25498
  for (const chunk of chunks) {
25499
25499
  const text18 = chunk.content;
25500
25500
  const crRefs = text18.match(/CR-\d+/g);
@@ -26108,7 +26108,7 @@ function handleRule(db, args2) {
26108
26108
  lines.push(`- **${rule.rule_id}**: ${rule.rule_text} | VR: ${rule.vr_type || "N/A"} | Ref: ${rule.reference_path || "N/A"}`);
26109
26109
  }
26110
26110
  } else {
26111
- const rules = db.prepare("SELECT * FROM knowledge_rules ORDER BY rule_id").all();
26111
+ const rules = db.prepare("SELECT * FROM knowledge_rules ORDER BY rule_id LIMIT 10000").all();
26112
26112
  lines.push(`## All Canonical Rules (${rules.length} total)`);
26113
26113
  lines.push("");
26114
26114
  for (const rule of rules) {
@@ -26217,7 +26217,7 @@ function handleSchemaCheck(db, args2) {
26217
26217
  }
26218
26218
  }
26219
26219
  if (!table && !column) {
26220
- const all = db.prepare("SELECT * FROM knowledge_schema_mismatches ORDER BY table_name").all();
26220
+ const all = db.prepare("SELECT * FROM knowledge_schema_mismatches ORDER BY table_name LIMIT 10000").all();
26221
26221
  lines.push(`## All Known Schema Mismatches (${all.length} total)`);
26222
26222
  lines.push("");
26223
26223
  lines.push("| Table | WRONG | CORRECT |");
@@ -26355,7 +26355,7 @@ function handleVerification(db, args2) {
26355
26355
  lines.push("");
26356
26356
  }
26357
26357
  } else {
26358
- const all = db.prepare("SELECT vr_type, command, use_when FROM knowledge_verifications ORDER BY vr_type").all();
26358
+ const all = db.prepare("SELECT vr_type, command, use_when FROM knowledge_verifications ORDER BY vr_type LIMIT 10000").all();
26359
26359
  lines.push(`## All Verification Types (${all.length} total)`);
26360
26360
  lines.push("");
26361
26361
  for (const vr of all) {
@@ -26743,7 +26743,7 @@ function handleEffectiveness2(db, args2) {
26743
26743
  const topN = Math.min(args2.top_n || 10, 50);
26744
26744
  const mode = args2.mode || "most_violated";
26745
26745
  const lines = [];
26746
- const allRules = db.prepare("SELECT rule_id, rule_text FROM knowledge_rules ORDER BY rule_id").all();
26746
+ const allRules = db.prepare("SELECT rule_id, rule_text FROM knowledge_rules ORDER BY rule_id LIMIT 10000").all();
26747
26747
  let memoryDb = null;
26748
26748
  const violationCounts = /* @__PURE__ */ new Map();
26749
26749
  const lastViolated = /* @__PURE__ */ new Map();
@@ -1042,7 +1042,7 @@ function initMemorySchema(db) {
1042
1042
  `);
1043
1043
  }
1044
1044
  function getFailureClasses(db) {
1045
- const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name").all();
1045
+ const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name LIMIT 10000").all();
1046
1046
  return rows.map((row) => ({
1047
1047
  id: row.id,
1048
1048
  name: row.name,
@@ -1059,7 +1059,7 @@ function addFailureClass(db, opts) {
1059
1059
  return Number(result.lastInsertRowid);
1060
1060
  }
1061
1061
  function getFailureClasses(db) {
1062
- const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name").all();
1062
+ const rows = db.prepare("SELECT * FROM failure_classes ORDER BY name LIMIT 10000").all();
1063
1063
  return rows.map((row) => ({
1064
1064
  id: row.id,
1065
1065
  name: row.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massu/core",
3
- "version": "1.10.2",
3
+ "version": "1.10.4",
4
4
  "type": "module",
5
5
  "description": "AI Engineering Governance MCP Server - Session memory, knowledge system, feature registry, code intelligence, rule enforcement, tiered tooling (12 free / 73 total), 59 workflow commands, 11 agents, 20+ patterns",
6
6
  "main": "src/server.ts",
@@ -349,7 +349,7 @@ export function buildCrossReferences(db: Database.Database): number {
349
349
  );
350
350
 
351
351
  // CR -> VR edges (from knowledge_rules)
352
- const rules = db.prepare('SELECT rule_id, vr_type, reference_path FROM knowledge_rules').all() as CRRule[];
352
+ const rules = db.prepare('SELECT rule_id, vr_type, reference_path FROM knowledge_rules LIMIT 10000').all() as CRRule[];
353
353
  for (const rule of rules) {
354
354
  if (rule.vr_type && rule.vr_type !== 'VR-*') {
355
355
  // Split compound VR types (e.g., "VR-SCHEMA" or "VR-*")
@@ -367,7 +367,7 @@ export function buildCrossReferences(db: Database.Database): number {
367
367
  }
368
368
 
369
369
  // Incident -> CR edges (from knowledge_incidents)
370
- const incidents = db.prepare('SELECT incident_num, cr_added FROM knowledge_incidents WHERE cr_added IS NOT NULL').all() as { incident_num: number; cr_added: string }[];
370
+ const incidents = db.prepare('SELECT incident_num, cr_added FROM knowledge_incidents WHERE cr_added IS NOT NULL LIMIT 10000').all() as { incident_num: number; cr_added: string }[];
371
371
  for (const inc of incidents) {
372
372
  if (inc.cr_added) {
373
373
  const crIds = inc.cr_added.match(/CR-\d+/g) || [];
@@ -379,7 +379,7 @@ export function buildCrossReferences(db: Database.Database): number {
379
379
  }
380
380
 
381
381
  // Scan all chunks for cross-references
382
- const chunks = db.prepare('SELECT id, content, metadata FROM knowledge_chunks').all() as { id: number; content: string; metadata: string }[];
382
+ const chunks = db.prepare('SELECT id, content, metadata FROM knowledge_chunks LIMIT 100000').all() as { id: number; content: string; metadata: string }[];
383
383
  for (const chunk of chunks) {
384
384
  const text = chunk.content;
385
385
 
@@ -462,7 +462,7 @@ function handleRule(db: Database.Database, args: Record<string, unknown>): ToolR
462
462
  }
463
463
  } else {
464
464
  // List all rules
465
- const rules = db.prepare('SELECT * FROM knowledge_rules ORDER BY rule_id').all() as {
465
+ const rules = db.prepare('SELECT * FROM knowledge_rules ORDER BY rule_id LIMIT 10000').all() as {
466
466
  rule_id: string; rule_text: string; vr_type: string;
467
467
  }[];
468
468
 
@@ -614,7 +614,7 @@ function handleSchemaCheck(db: Database.Database, args: Record<string, unknown>)
614
614
 
615
615
  if (!table && !column) {
616
616
  // Show all mismatches
617
- const all = db.prepare('SELECT * FROM knowledge_schema_mismatches ORDER BY table_name').all() as {
617
+ const all = db.prepare('SELECT * FROM knowledge_schema_mismatches ORDER BY table_name LIMIT 10000').all() as {
618
618
  table_name: string; wrong_column: string; correct_column: string;
619
619
  }[];
620
620
 
@@ -804,7 +804,7 @@ function handleVerification(db: Database.Database, args: Record<string, unknown>
804
804
  }
805
805
  } else {
806
806
  // List all
807
- const all = db.prepare('SELECT vr_type, command, use_when FROM knowledge_verifications ORDER BY vr_type').all() as {
807
+ const all = db.prepare('SELECT vr_type, command, use_when FROM knowledge_verifications ORDER BY vr_type LIMIT 10000').all() as {
808
808
  vr_type: string; command: string; use_when: string;
809
809
  }[];
810
810
 
@@ -1319,7 +1319,7 @@ function handleEffectiveness(db: Database.Database, args: Record<string, unknown
1319
1319
  const lines: string[] = [];
1320
1320
 
1321
1321
  // Get all CR rules from knowledge DB
1322
- const allRules = db.prepare('SELECT rule_id, rule_text FROM knowledge_rules ORDER BY rule_id').all() as {
1322
+ const allRules = db.prepare('SELECT rule_id, rule_text FROM knowledge_rules ORDER BY rule_id LIMIT 10000').all() as {
1323
1323
  rule_id: string; rule_text: string;
1324
1324
  }[];
1325
1325
 
package/src/memory-db.ts CHANGED
@@ -1497,7 +1497,7 @@ export function addFailureClass(db: Database.Database, opts: AddFailureClassOpts
1497
1497
  * Get all failure classes from the taxonomy.
1498
1498
  */
1499
1499
  export function getFailureClasses(db: Database.Database): FailureClass[] {
1500
- const rows = db.prepare('SELECT * FROM failure_classes ORDER BY name').all() as Array<Record<string, unknown>>;
1500
+ const rows = db.prepare('SELECT * FROM failure_classes ORDER BY name LIMIT 10000').all() as Array<Record<string, unknown>>;
1501
1501
  return rows.map(row => ({
1502
1502
  id: row.id as number,
1503
1503
  name: row.name as string,
@@ -1,4 +1,4 @@
1
- // AUTO-GENERATED by scripts/bundle-pubkey.mjs at 2026-05-17T05:30:32.527Z.
1
+ // AUTO-GENERATED by scripts/bundle-pubkey.mjs at 2026-05-17T05:57:44.313Z.
2
2
  // Source pem: packages/core/security/registry-pubkey.pem
3
3
  // RAW-bytes sha256: 3b6226d036c472e533110d11a7d0cd2773ce1d7d4f1003517d5bd69c5418ed4c
4
4
  // DO NOT EDIT — regenerate via `node scripts/bundle-pubkey.mjs` or