musubix2 0.5.5 → 0.5.7

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
- {"generator":"musubix2","version":"0.5.5","timestamp":"2026-07-09T09:31:00.078Z"}
1
+ {"generator":"musubix2","version":"0.5.7","timestamp":"2026-07-09T10:10:51.798Z"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0",
3
- "generatedAt": "2026-07-09T09:31:00.109Z",
3
+ "generatedAt": "2026-07-09T10:10:51.826Z",
4
4
  "entries": [
5
5
  {
6
6
  "platform": "copilot",
package/dist/cli.d.ts CHANGED
@@ -67,10 +67,26 @@ export declare function handleTasksValidate(filePath: string): Promise<ExitCodeV
67
67
  export declare function handleTasksList(filePath?: string): Promise<ExitCodeValue>;
68
68
  export declare function handleTasksStats(filePath?: string): Promise<ExitCodeValue>;
69
69
  export declare function handleInit(targetPath?: string, name?: string, force?: boolean): Promise<ExitCodeValue>;
70
- export declare function handleTrace(sub: string | undefined, args: string[]): Promise<ExitCodeValue>;
71
- export declare function handleTraceVerify(): Promise<ExitCodeValue>;
70
+ interface CodeTraceData {
71
+ requirementIds: string[];
72
+ fileIds: string[];
73
+ links: Array<{
74
+ source: string;
75
+ target: string;
76
+ verified: boolean;
77
+ }>;
78
+ refsByReq: Map<string, string[]>;
79
+ }
80
+ /**
81
+ * Build real traceability data by parsing requirement ids from the specs file
82
+ * and scanning source files for `REQ-XXX-NNN` references. A requirement is
83
+ * "covered" when at least one source file references it.
84
+ */
85
+ export declare function buildCodeTraceData(specsFile: string, srcDir: string): CodeTraceData;
86
+ export declare function handleTrace(sub: string | undefined, args: string[], flags?: Record<string, unknown>): Promise<ExitCodeValue>;
87
+ export declare function handleTraceVerify(flags?: Record<string, unknown>): Promise<ExitCodeValue>;
72
88
  export declare function handlePolicy(sub: string | undefined, args: string[]): Promise<ExitCodeValue>;
73
- export declare function handleOntology(sub: string | undefined): Promise<ExitCodeValue>;
89
+ export declare function handleOntology(sub: string | undefined, args?: string[]): Promise<ExitCodeValue>;
74
90
  /**
75
91
  * Collect files from a path. A file returns itself; a directory is walked
76
92
  * recursively (skipping common vendor/build dirs). Optionally filter by
@@ -104,7 +120,7 @@ export declare function handleRepl(): Promise<ExitCodeValue>;
104
120
  export declare function handleScaffold(sub: string | undefined, args: string[]): Promise<ExitCodeValue>;
105
121
  export declare function handleExplain(input: string | undefined): Promise<ExitCodeValue>;
106
122
  export declare function handleLearn(sub: string | undefined, args: string[]): Promise<ExitCodeValue>;
107
- export declare function handleSynthesis(sub: string | undefined, args: string[]): Promise<ExitCodeValue>;
123
+ export declare function handleSynthesis(sub: string | undefined, args: string[], flags?: Record<string, unknown>): Promise<ExitCodeValue>;
108
124
  export declare function handleWatch(pattern: string | undefined): Promise<ExitCodeValue>;
109
125
  /**
110
126
  * Resolve the file/name target for a command, tolerating an optional leading
@@ -116,4 +132,5 @@ export declare function handleWatch(pattern: string | undefined): Promise<ExitCo
116
132
  export declare function resolveTarget(args: Record<string, unknown>, verbs: string[]): string | undefined;
117
133
  export declare function getDefaultCommands(): CLICommand[];
118
134
  export declare function createCLIDispatcher(): CLIDispatcher;
135
+ export {};
119
136
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAiC9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,G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,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAUhG;AAiBD,wBAAgB,kBAAkB,IAAI,UAAU,EAAE,CA0djD;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CASnD"}
package/dist/cli.js CHANGED
@@ -12124,6 +12124,19 @@ var init_transport = __esm({
12124
12124
  this.rl = null;
12125
12125
  }
12126
12126
  }
12127
+ /**
12128
+ * Resolve once the input stream closes (client disconnect / stdin EOF).
12129
+ * Used by the CLI launcher to keep the process alive for the lifetime of
12130
+ * the connection — `start()` intentionally resolves immediately so callers
12131
+ * can begin writing, so a separate wait hook is needed to block on.
12132
+ */
12133
+ async waitForClose() {
12134
+ if (!this.rl)
12135
+ return;
12136
+ await new Promise((resolve9) => {
12137
+ this.rl.once("close", () => resolve9());
12138
+ });
12139
+ }
12127
12140
  send(message) {
12128
12141
  this.output.write(JSON.stringify(message) + "\n");
12129
12142
  }
@@ -13989,7 +14002,7 @@ function knowledgeTools() {
13989
14002
  const { createKnowledgeStore: createKnowledgeStore2 } = await Promise.resolve().then(() => (init_dist8(), dist_exports8));
13990
14003
  const store = createKnowledgeStore2(params["basePath"] ?? ".knowledge");
13991
14004
  await store.load();
13992
- const entity = store.getEntity(params["id"]);
14005
+ const entity = await store.getEntity(params["id"]);
13993
14006
  return entity ? ok(entity) : fail("Entity not found");
13994
14007
  } catch {
13995
14008
  return fail("Knowledge package not available");
@@ -14062,7 +14075,7 @@ function knowledgeTools() {
14062
14075
  const { createKnowledgeStore: createKnowledgeStore2 } = await Promise.resolve().then(() => (init_dist8(), dist_exports8));
14063
14076
  const store = createKnowledgeStore2(params["basePath"] ?? ".knowledge");
14064
14077
  await store.load();
14065
- const results = store.search(params["query"], { limit: params["limit"] ?? 10 });
14078
+ const results = await store.search(params["query"], { limit: params["limit"] ?? 10 });
14066
14079
  return ok(results);
14067
14080
  } catch {
14068
14081
  return fail("Knowledge package not available");
@@ -14077,7 +14090,7 @@ function knowledgeTools() {
14077
14090
  const { createKnowledgeStore: createKnowledgeStore2 } = await Promise.resolve().then(() => (init_dist8(), dist_exports8));
14078
14091
  const store = createKnowledgeStore2(params["basePath"] ?? ".knowledge");
14079
14092
  await store.load();
14080
- const result = store.traverse(params["startId"], { depth: params["depth"] ?? 2 });
14093
+ const result = await store.traverse(params["startId"], { depth: params["depth"] ?? 2 });
14081
14094
  return ok(result);
14082
14095
  } catch {
14083
14096
  return fail("Knowledge package not available");
@@ -14249,52 +14262,64 @@ function codeAnalysisTools() {
14249
14262
  })
14250
14263
  ];
14251
14264
  }
14265
+ function sourceOf(params) {
14266
+ return params["code"] ?? params["source"] ?? params["target"] ?? "";
14267
+ }
14268
+ function severityOf(findings) {
14269
+ const order = ["critical", "high", "medium", "low", "info"];
14270
+ for (const s of order)
14271
+ if (findings.some((f) => f.severity === s))
14272
+ return s;
14273
+ return "none";
14274
+ }
14252
14275
  function securityTools() {
14253
14276
  return [
14254
14277
  tool("security.scan", "Run a security scan on source code", "security", [
14255
- param("target", "string", "File or directory path to scan"),
14256
- param("rules", "array", "Specific rules to apply", false)
14278
+ param("code", "string", "Source code to scan"),
14279
+ param("filePath", "string", "File path for the source (for reporting)", false, "inline")
14257
14280
  ], async (params) => {
14258
14281
  try {
14259
- const sec = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14260
- const result = sec.scan?.(params["target"], params["rules"]);
14261
- return ok(result ?? { findings: [], severity: "none" });
14282
+ const { createSecurityScanner: createSecurityScanner2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14283
+ const result = createSecurityScanner2().scan(sourceOf(params), params["filePath"] ?? "inline");
14284
+ return ok({ findings: result.findings, severity: severityOf(result.findings) });
14262
14285
  } catch {
14263
- return ok({ findings: [], severity: "none" });
14286
+ return fail("Security package not available");
14264
14287
  }
14265
14288
  }),
14266
- tool("security.secrets.detect", "Detect secrets and credentials in source code", "security", [param("target", "string", "File or directory path to scan")], async (params) => {
14289
+ tool("security.secrets.detect", "Detect secrets and credentials in source code", "security", [
14290
+ param("code", "string", "Source code to scan"),
14291
+ param("filePath", "string", "File path for the source", false, "inline")
14292
+ ], async (params) => {
14267
14293
  try {
14268
- const sec = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14269
- const result = sec.detectSecrets?.(params["target"]);
14270
- return ok(result ?? { secrets: [], count: 0 });
14294
+ const { createSecretDetector: createSecretDetector2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14295
+ const secrets = createSecretDetector2().scan(sourceOf(params), params["filePath"] ?? "inline");
14296
+ return ok({ secrets, count: secrets.length });
14271
14297
  } catch {
14272
- return ok({ secrets: [], count: 0 });
14298
+ return fail("Security package not available");
14273
14299
  }
14274
14300
  }),
14275
14301
  tool("security.taint.analyze", "Perform taint analysis to track untrusted data flow", "security", [
14276
- param("source", "string", "Source code to analyze"),
14277
- param("sources", "array", "Taint sources", false),
14278
- param("sinks", "array", "Taint sinks", false)
14302
+ param("code", "string", "Source code to analyze"),
14303
+ param("filePath", "string", "File path for the source", false, "inline")
14279
14304
  ], async (params) => {
14280
14305
  try {
14281
- const sec = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14282
- const result = sec.taintAnalysis?.(params["source"], params["sources"], params["sinks"]);
14283
- return ok(result ?? { tainted: [], paths: [] });
14306
+ const { TaintAnalyzer: TaintAnalyzer2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14307
+ const tainted = new TaintAnalyzer2().analyze(sourceOf(params), params["filePath"] ?? "inline");
14308
+ return ok({ tainted, count: tainted.length });
14284
14309
  } catch {
14285
- return ok({ tainted: [], paths: [] });
14310
+ return fail("Security package not available");
14286
14311
  }
14287
14312
  }),
14288
- tool("security.compliance.check", "Check code compliance against security standards", "security", [
14289
- param("target", "string", "File or directory path"),
14290
- param("standard", "string", "Compliance standard: owasp | cwe | sans", false, "owasp")
14313
+ tool("security.compliance.check", "Check code compliance against registered security policies", "security", [
14314
+ param("code", "string", "Source code to check"),
14315
+ param("filePath", "string", "File path for the source", false, "inline")
14291
14316
  ], async (params) => {
14292
14317
  try {
14293
- const sec = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14294
- const result = sec.complianceCheck?.(params["target"], params["standard"] ?? "owasp");
14295
- return ok(result ?? { compliant: true, issues: [] });
14318
+ const { createComplianceChecker: createComplianceChecker2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports5));
14319
+ const result = createComplianceChecker2().check(sourceOf(params), params["filePath"] ?? "inline", []);
14320
+ return ok(result);
14296
14321
  } catch {
14297
- return ok({ compliant: true, issues: [] });
14322
+ return fail("Security package not available");
14298
14323
  }
14299
14324
  })
14300
14325
  ];
@@ -15307,6 +15332,7 @@ var init_mcp_cli_launcher = __esm({
15307
15332
  } else {
15308
15333
  const transport = new StdioTransport2();
15309
15334
  await server.start(transport);
15335
+ await transport.waitForClose();
15310
15336
  }
15311
15337
  }
15312
15338
  };
@@ -15392,12 +15418,12 @@ var COMMAND_HELP = {
15392
15418
  description: "\u30BF\u30B9\u30AF\u7BA1\u7406"
15393
15419
  },
15394
15420
  trace: {
15395
- usage: "musubix trace <matrix|validate|impact> [args]",
15396
- description: "\u30C8\u30EC\u30FC\u30B5\u30D3\u30EA\u30C6\u30A3"
15421
+ usage: "musubix trace <matrix|validate|impact> [--specs <file>] [--src <dir>]",
15422
+ description: "\u30C8\u30EC\u30FC\u30B5\u30D3\u30EA\u30C6\u30A3\uFF08\u8981\u4EF6 \u2192 \u30B3\u30FC\u30C9\u306E REQ-ID \u53C2\u7167\u3092\u89E3\u6790\uFF09"
15397
15423
  },
15398
15424
  "trace:verify": {
15399
- usage: "musubix trace:verify",
15400
- description: "\u30C8\u30EC\u30FC\u30B5\u30D3\u30EA\u30C6\u30A3\u691C\u8A3C"
15425
+ usage: "musubix trace:verify [--specs <file>] [--src <dir>] [--strict]",
15426
+ description: "\u30C8\u30EC\u30FC\u30B5\u30D3\u30EA\u30C6\u30A3\u691C\u8A3C\uFF08\u672A\u53C2\u7167\u8981\u4EF6\u3092\u691C\u51FA\uFF09"
15401
15427
  },
15402
15428
  policy: {
15403
15429
  usage: "musubix policy <validate|list|info> [args]",
@@ -15412,7 +15438,7 @@ var COMMAND_HELP = {
15412
15438
  description: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u72B6\u6CC1"
15413
15439
  },
15414
15440
  ontology: {
15415
- usage: "musubix ontology <validate|stats>",
15441
+ usage: "musubix ontology <add|list|validate|stats> [args]",
15416
15442
  description: "\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u7BA1\u7406"
15417
15443
  },
15418
15444
  cg: {
@@ -15684,13 +15710,68 @@ async function handleInit(targetPath = ".", name, force) {
15684
15710
  }
15685
15711
  return ExitCode.SUCCESS;
15686
15712
  }
15687
- async function handleTrace(sub, args) {
15713
+ var REQ_ID_RE = /REQ-[A-Z]{3}-\d{3}/g;
15714
+ function buildCodeTraceData(specsFile, srcDir) {
15715
+ const reqIds = [];
15716
+ if (existsSync11(specsFile)) {
15717
+ const content = readFileSync6(specsFile, "utf-8");
15718
+ for (const line of content.split("\n")) {
15719
+ const m = line.match(/^#{1,4}\s+(REQ-[A-Z]{3}-\d{3})\b/);
15720
+ if (m)
15721
+ reqIds.push(m[1]);
15722
+ }
15723
+ if (reqIds.length === 0) {
15724
+ for (const m of content.matchAll(REQ_ID_RE))
15725
+ reqIds.push(m[0]);
15726
+ }
15727
+ }
15728
+ const requirementIds = [...new Set(reqIds)];
15729
+ const reqSet = new Set(requirementIds);
15730
+ const refsByReq = /* @__PURE__ */ new Map();
15731
+ const fileSet = /* @__PURE__ */ new Set();
15732
+ const links = [];
15733
+ if (existsSync11(srcDir)) {
15734
+ for (const file of collectFiles(srcDir, (ext) => ext in EXT_TO_LANG)) {
15735
+ const code = readFileSync6(file, "utf-8");
15736
+ const refs = /* @__PURE__ */ new Set();
15737
+ for (const m of code.matchAll(REQ_ID_RE)) {
15738
+ if (reqSet.has(m[0]))
15739
+ refs.add(m[0]);
15740
+ }
15741
+ for (const reqId of refs) {
15742
+ fileSet.add(file);
15743
+ links.push({ source: reqId, target: file, verified: false });
15744
+ const arr = refsByReq.get(reqId) ?? [];
15745
+ arr.push(file);
15746
+ refsByReq.set(reqId, arr);
15747
+ }
15748
+ }
15749
+ }
15750
+ return { requirementIds, fileIds: [...fileSet].sort(), links, refsByReq };
15751
+ }
15752
+ function resolveTraceInputs(flags) {
15753
+ return {
15754
+ specsFile: flags["specs"] ?? "storage/specs/requirements.md",
15755
+ srcDir: flags["src"] ?? (existsSync11("src") ? "src" : ".")
15756
+ };
15757
+ }
15758
+ async function handleTrace(sub, args, flags = {}) {
15688
15759
  switch (sub) {
15689
15760
  case "matrix": {
15761
+ const { specsFile, srcDir } = resolveTraceInputs(flags);
15762
+ const data = buildCodeTraceData(specsFile, srcDir);
15763
+ if (data.requirementIds.length === 0) {
15764
+ console.log(`No requirements found in ${specsFile} \u2014 nothing to trace.`);
15765
+ console.log("\u2139 Pass --specs <file> to point at your requirements document.");
15766
+ return ExitCode.SUCCESS;
15767
+ }
15690
15768
  const generator = createMatrixGenerator();
15691
- const report = generator.generate([], [], []);
15769
+ const report = generator.generate(data.requirementIds, data.fileIds, data.links);
15692
15770
  console.log(generator.toMarkdown(report));
15693
- console.log("\n\u2139 No traceability data loaded \u2014 matrix is empty (completeness is N/A).");
15771
+ const covered = data.requirementIds.filter((r) => (data.refsByReq.get(r)?.length ?? 0) > 0);
15772
+ const pct = Math.round(covered.length / data.requirementIds.length * 100);
15773
+ console.log(`
15774
+ Requirements: ${data.requirementIds.length}, referenced in code: ${covered.length} (${pct}%), source files: ${data.fileIds.length} (scanned ${srcDir}).`);
15694
15775
  return ExitCode.SUCCESS;
15695
15776
  }
15696
15777
  case "validate": {
@@ -15719,23 +15800,27 @@ async function handleTrace(sub, args) {
15719
15800
  return ExitCode.SUCCESS;
15720
15801
  }
15721
15802
  }
15722
- async function handleTraceVerify() {
15723
- const validator = createTraceabilityValidator();
15724
- const report = validator.validateCoverage([], [], [], []);
15725
- if (report.totalRequirements === 0) {
15726
- console.log("No traceability data loaded \u2014 nothing to verify.");
15803
+ async function handleTraceVerify(flags = {}) {
15804
+ const { specsFile, srcDir } = resolveTraceInputs(flags);
15805
+ const data = buildCodeTraceData(specsFile, srcDir);
15806
+ if (data.requirementIds.length === 0) {
15807
+ console.log(`No requirements found in ${specsFile} \u2014 nothing to verify.`);
15727
15808
  console.log("\u2139 Coverage cannot be computed with 0 requirements (reported as N/A).");
15728
15809
  return ExitCode.SUCCESS;
15729
15810
  }
15730
- console.log(`Coverage: ${report.coveragePercent}%`);
15731
- console.log(`Requirements: ${report.coveredRequirements}/${report.totalRequirements}`);
15732
- if (report.gaps.length > 0) {
15733
- console.log("Gaps:");
15734
- for (const gap of report.gaps) {
15735
- console.log(` - ${JSON.stringify(gap)}`);
15736
- }
15811
+ const covered = data.requirementIds.filter((r) => (data.refsByReq.get(r)?.length ?? 0) > 0);
15812
+ const gaps = data.requirementIds.filter((r) => (data.refsByReq.get(r)?.length ?? 0) === 0);
15813
+ const pct = Math.round(covered.length / data.requirementIds.length * 100);
15814
+ console.log(`Coverage: ${pct}%`);
15815
+ console.log(`Requirements: ${covered.length}/${data.requirementIds.length} referenced in ${srcDir}`);
15816
+ if (gaps.length > 0) {
15817
+ console.log("Gaps (requirements not referenced in code):");
15818
+ for (const id of gaps)
15819
+ console.log(` - ${id}`);
15820
+ if (flags["strict"] === true)
15821
+ return ExitCode.VALIDATION_ERROR;
15737
15822
  } else {
15738
- console.log("No gaps found");
15823
+ console.log("No gaps found \u2014 every requirement is referenced in code.");
15739
15824
  }
15740
15825
  return ExitCode.SUCCESS;
15741
15826
  }
@@ -15783,23 +15868,70 @@ async function handlePolicy(sub, args) {
15783
15868
  return ExitCode.SUCCESS;
15784
15869
  }
15785
15870
  }
15786
- async function handleOntology(sub) {
15871
+ var ONTOLOGY_STATE_FILE = ".musubix/ontology.json";
15872
+ function loadOntologyStore() {
15873
+ const store = createOntologyStore();
15874
+ try {
15875
+ if (existsSync11(ONTOLOGY_STATE_FILE)) {
15876
+ const triples = JSON.parse(readFileSync6(ONTOLOGY_STATE_FILE, "utf-8"));
15877
+ store.addTriples(triples);
15878
+ }
15879
+ } catch {
15880
+ }
15881
+ return store;
15882
+ }
15883
+ function saveOntologyStore(store) {
15884
+ mkdirSync3(dirnamePath(ONTOLOGY_STATE_FILE), { recursive: true });
15885
+ writeFileSync3(ONTOLOGY_STATE_FILE, JSON.stringify(store.getAll(), null, 2), "utf-8");
15886
+ }
15887
+ async function handleOntology(sub, args = []) {
15787
15888
  switch (sub) {
15889
+ case "add": {
15890
+ const [subject, predicate, object] = args;
15891
+ if (!subject || !predicate || !object) {
15892
+ console.error("\u274C Usage: musubix ontology add <subject> <predicate> <object>");
15893
+ return ExitCode.VALIDATION_ERROR;
15894
+ }
15895
+ const store = loadOntologyStore();
15896
+ store.addTriple({ subject, predicate, object });
15897
+ saveOntologyStore(store);
15898
+ console.log(`\u2705 Added triple: ${subject} \u2014[${predicate}]\u2192 ${object}`);
15899
+ console.log(` Total triples: ${store.size()}`);
15900
+ return ExitCode.SUCCESS;
15901
+ }
15902
+ case "list": {
15903
+ const store = loadOntologyStore();
15904
+ const triples = store.getAll();
15905
+ if (triples.length === 0) {
15906
+ console.log("No triples stored yet. Add one with: musubix ontology add <s> <p> <o>");
15907
+ } else {
15908
+ console.log(`Triples (${triples.length}):`);
15909
+ for (const t of triples) {
15910
+ console.log(` ${t.subject} \u2014[${t.predicate}]\u2192 ${t.object}`);
15911
+ }
15912
+ }
15913
+ return ExitCode.SUCCESS;
15914
+ }
15788
15915
  case "validate": {
15789
- const store = createOntologyStore();
15916
+ const store = loadOntologyStore();
15790
15917
  const validator = createConsistencyValidator();
15791
15918
  const result = validator.validate(store);
15792
- console.log(`Consistent: ${result.consistent ? "\u2705" : "\u274C"}`);
15919
+ if (store.size() === 0) {
15920
+ console.log("No triples stored \u2014 nothing to validate.");
15921
+ return ExitCode.SUCCESS;
15922
+ }
15923
+ console.log(`Consistent: ${result.consistent ? "\u2705" : "\u274C"} (${store.size()} triples)`);
15793
15924
  if (result.violations.length > 0) {
15794
15925
  console.log("Violations:");
15795
15926
  for (const v of result.violations) {
15796
15927
  console.log(` - ${JSON.stringify(v)}`);
15797
15928
  }
15929
+ return ExitCode.VALIDATION_ERROR;
15798
15930
  }
15799
15931
  return ExitCode.SUCCESS;
15800
15932
  }
15801
15933
  case "stats": {
15802
- const store = createOntologyStore();
15934
+ const store = loadOntologyStore();
15803
15935
  console.log(`Triples: ${store.size()}`);
15804
15936
  return ExitCode.SUCCESS;
15805
15937
  }
@@ -16853,7 +16985,7 @@ async function handleLearn(sub, args) {
16853
16985
  return ExitCode.SUCCESS;
16854
16986
  }
16855
16987
  }
16856
- async function handleSynthesis(sub, args) {
16988
+ async function handleSynthesis(sub, args, flags = {}) {
16857
16989
  switch (sub) {
16858
16990
  case "fromExamples": {
16859
16991
  const { createSynthesisEngine: createSynthesisEngine2 } = await Promise.resolve().then(() => (init_dist12(), dist_exports12));
@@ -16876,12 +17008,66 @@ async function handleSynthesis(sub, args) {
16876
17008
  const builder = createDSLBuilder2();
16877
17009
  const input = args[0];
16878
17010
  if (!input) {
16879
- console.error("\u274C Usage: musubix synthesis dsl <input>");
17011
+ console.error("\u274C Usage: musubix synthesis dsl <input> --ops <op[:arg...],...>");
17012
+ console.error(" ops: trim, upper, lower, reverse, capitalize, camelCase, snakeCase,");
17013
+ console.error(" replace:from:to, prefixRemove:p, suffixAppend:s, repeat:n");
16880
17014
  return ExitCode.GENERAL_ERROR;
16881
17015
  }
17016
+ const opsSpec = flags["ops"] ?? "";
17017
+ const ops = opsSpec.split(",").map((o) => o.trim()).filter(Boolean);
17018
+ if (ops.length === 0) {
17019
+ console.error("\u274C No transforms given. Pass --ops <op,...> (e.g. --ops trim,camelCase).");
17020
+ return ExitCode.VALIDATION_ERROR;
17021
+ }
17022
+ for (const op of ops) {
17023
+ const [name, ...opArgs] = op.split(":");
17024
+ switch (name) {
17025
+ case "trim":
17026
+ builder.trim();
17027
+ break;
17028
+ case "upper":
17029
+ case "toUpperCase":
17030
+ builder.toUpperCase();
17031
+ break;
17032
+ case "lower":
17033
+ case "toLowerCase":
17034
+ builder.toLowerCase();
17035
+ break;
17036
+ case "reverse":
17037
+ builder.reverse();
17038
+ break;
17039
+ case "capitalize":
17040
+ builder.capitalize();
17041
+ break;
17042
+ case "camelCase":
17043
+ case "camel":
17044
+ builder.camelCase();
17045
+ break;
17046
+ case "snakeCase":
17047
+ case "snake":
17048
+ builder.snakeCase();
17049
+ break;
17050
+ case "replace":
17051
+ builder.replace(opArgs[0] ?? "", opArgs[1] ?? "");
17052
+ break;
17053
+ case "prefixRemove":
17054
+ builder.prefixRemove(opArgs[0] ?? "");
17055
+ break;
17056
+ case "suffixAppend":
17057
+ builder.suffixAppend(opArgs[0] ?? "");
17058
+ break;
17059
+ case "repeat":
17060
+ builder.repeat(Number.parseInt(opArgs[0] ?? "1", 10) || 1);
17061
+ break;
17062
+ default:
17063
+ console.error(`\u274C Unknown DSL op: ${name}`);
17064
+ return ExitCode.VALIDATION_ERROR;
17065
+ }
17066
+ }
16882
17067
  const result = builder.execute(input);
16883
17068
  console.log(`DSL output:`);
16884
- console.log(` Input: ${input}`);
17069
+ console.log(` Input: ${input}`);
17070
+ console.log(` Ops: ${ops.join(" \u2192 ")}`);
16885
17071
  console.log(` Result: ${result}`);
16886
17072
  return ExitCode.SUCCESS;
16887
17073
  }
@@ -17154,7 +17340,7 @@ function getDefaultCommands() {
17154
17340
  }
17155
17341
  const sub = args["subcommand"];
17156
17342
  const positionalArgs = args["args"] ?? [];
17157
- return await handleTrace(sub, positionalArgs);
17343
+ return await handleTrace(sub, positionalArgs, args);
17158
17344
  }
17159
17345
  },
17160
17346
  {
@@ -17165,7 +17351,7 @@ function getDefaultCommands() {
17165
17351
  console.log(showHelp("trace:verify"));
17166
17352
  return;
17167
17353
  }
17168
- return await handleTraceVerify();
17354
+ return await handleTraceVerify(args);
17169
17355
  }
17170
17356
  },
17171
17357
  {
@@ -17190,7 +17376,8 @@ function getDefaultCommands() {
17190
17376
  return;
17191
17377
  }
17192
17378
  const sub = args["subcommand"];
17193
- return await handleOntology(sub);
17379
+ const positionalArgs = args["args"] ?? [];
17380
+ return await handleOntology(sub, positionalArgs);
17194
17381
  }
17195
17382
  },
17196
17383
  {
@@ -17359,7 +17546,7 @@ function getDefaultCommands() {
17359
17546
  }
17360
17547
  const sub = args["subcommand"];
17361
17548
  const positionalArgs = args["args"] ?? [];
17362
- return await handleSynthesis(sub, positionalArgs);
17549
+ return await handleSynthesis(sub, positionalArgs, args);
17363
17550
  }
17364
17551
  },
17365
17552
  {
@@ -17409,6 +17596,7 @@ function createCLIDispatcher() {
17409
17596
  }
17410
17597
  export {
17411
17598
  CLIDispatcher,
17599
+ buildCodeTraceData,
17412
17600
  collectFiles,
17413
17601
  createCLIDispatcher,
17414
17602
  getDefaultCommands,