musubix2 0.5.30 → 0.5.32
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/.claude/.musubix-managed +1 -1
- package/dist/assets/skills-manifest.json +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +182 -37
- package/dist/cli.js.map +1 -1
- package/dist/index.js +182 -37
- package/package.json +1 -1
package/.claude/.musubix-managed
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generator":"musubix2","version":"0.5.
|
|
1
|
+
{"generator":"musubix2","version":"0.5.32","timestamp":"2026-07-09T22:14:59.968Z"}
|
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;AAgC9D,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,GAAG,UAAU,CAmDpD;AAwGD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAuBjD;AAID,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC1E,MAAM,EAAE,CAAC,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AAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAClC,OAAO,CAAC,aAAa,CAAC,CAyExB;AAID,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAAC,aAAa,CAAC,CAexB;AAID;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAUhG;AAiBD,wBAAgB,kBAAkB,IAAI,UAAU,EAAE,CAwejD;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CASnD"}
|
package/dist/cli.js
CHANGED
|
@@ -7654,8 +7654,9 @@ var init_dist4 = __esm({
|
|
|
7654
7654
|
{ kind: "variable", regex: /(?:export\s+)?(?:const|let|var)\s+(\w+)/ }
|
|
7655
7655
|
],
|
|
7656
7656
|
python: [
|
|
7657
|
-
{ kind: "class", regex:
|
|
7658
|
-
|
|
7657
|
+
{ kind: "class", regex: /^\s*class\s+(\w+)/ },
|
|
7658
|
+
// Allow leading indentation so class methods and nested defs are captured.
|
|
7659
|
+
{ kind: "function", regex: /^\s*(?:async\s+)?def\s+(\w+)/ },
|
|
7659
7660
|
{ kind: "import", regex: /^(?:from\s+(\S+)\s+import|import\s+(\S+))/ },
|
|
7660
7661
|
{ kind: "variable", regex: /^(\w+)\s*(?::\s*\w+)?\s*=/ }
|
|
7661
7662
|
],
|
|
@@ -16599,7 +16600,108 @@ var BUILTIN_CALL_NAMES = /* @__PURE__ */ new Set([
|
|
|
16599
16600
|
"info",
|
|
16600
16601
|
"debug",
|
|
16601
16602
|
"trace",
|
|
16602
|
-
"assert"
|
|
16603
|
+
"assert",
|
|
16604
|
+
// Python container / string built-in methods
|
|
16605
|
+
"append",
|
|
16606
|
+
"extend",
|
|
16607
|
+
"insert",
|
|
16608
|
+
"remove",
|
|
16609
|
+
"count",
|
|
16610
|
+
"update",
|
|
16611
|
+
"items",
|
|
16612
|
+
"setdefault",
|
|
16613
|
+
"strip",
|
|
16614
|
+
"lstrip",
|
|
16615
|
+
"rstrip",
|
|
16616
|
+
"format",
|
|
16617
|
+
"encode",
|
|
16618
|
+
"decode",
|
|
16619
|
+
// Python global built-in functions (a user `def super`/`type`/… otherwise
|
|
16620
|
+
// captures every builtin call across the codebase — 17% of Django's edges).
|
|
16621
|
+
"super",
|
|
16622
|
+
"type",
|
|
16623
|
+
"len",
|
|
16624
|
+
"str",
|
|
16625
|
+
"int",
|
|
16626
|
+
"float",
|
|
16627
|
+
"bool",
|
|
16628
|
+
"dict",
|
|
16629
|
+
"list",
|
|
16630
|
+
"tuple",
|
|
16631
|
+
"frozenset",
|
|
16632
|
+
"bytes",
|
|
16633
|
+
"bytearray",
|
|
16634
|
+
"complex",
|
|
16635
|
+
"object",
|
|
16636
|
+
"range",
|
|
16637
|
+
"isinstance",
|
|
16638
|
+
"issubclass",
|
|
16639
|
+
"hasattr",
|
|
16640
|
+
"getattr",
|
|
16641
|
+
"setattr",
|
|
16642
|
+
"delattr",
|
|
16643
|
+
"property",
|
|
16644
|
+
"staticmethod",
|
|
16645
|
+
"classmethod",
|
|
16646
|
+
"repr",
|
|
16647
|
+
"print",
|
|
16648
|
+
"input",
|
|
16649
|
+
"enumerate",
|
|
16650
|
+
"zip",
|
|
16651
|
+
"sorted",
|
|
16652
|
+
"reversed",
|
|
16653
|
+
"min",
|
|
16654
|
+
"max",
|
|
16655
|
+
"sum",
|
|
16656
|
+
"abs",
|
|
16657
|
+
"round",
|
|
16658
|
+
"iter",
|
|
16659
|
+
"vars",
|
|
16660
|
+
"dir",
|
|
16661
|
+
"hash",
|
|
16662
|
+
"callable",
|
|
16663
|
+
"any",
|
|
16664
|
+
"all",
|
|
16665
|
+
"chr",
|
|
16666
|
+
"ord",
|
|
16667
|
+
"hex",
|
|
16668
|
+
"oct",
|
|
16669
|
+
"bin",
|
|
16670
|
+
"divmod",
|
|
16671
|
+
"pow",
|
|
16672
|
+
"globals",
|
|
16673
|
+
"locals",
|
|
16674
|
+
// Python str/bytes methods (lowercase — distinct from the camelCase JS ones)
|
|
16675
|
+
"upper",
|
|
16676
|
+
"lower",
|
|
16677
|
+
"title",
|
|
16678
|
+
"capitalize",
|
|
16679
|
+
"swapcase",
|
|
16680
|
+
"casefold",
|
|
16681
|
+
"startswith",
|
|
16682
|
+
"endswith",
|
|
16683
|
+
"splitlines",
|
|
16684
|
+
"zfill",
|
|
16685
|
+
"ljust",
|
|
16686
|
+
"rjust",
|
|
16687
|
+
"center",
|
|
16688
|
+
"expandtabs",
|
|
16689
|
+
"translate",
|
|
16690
|
+
"partition",
|
|
16691
|
+
"rpartition",
|
|
16692
|
+
"rsplit",
|
|
16693
|
+
"rfind",
|
|
16694
|
+
"rindex",
|
|
16695
|
+
"isdigit",
|
|
16696
|
+
"isalpha",
|
|
16697
|
+
"isalnum",
|
|
16698
|
+
"isspace",
|
|
16699
|
+
"islower",
|
|
16700
|
+
"isupper",
|
|
16701
|
+
"istitle",
|
|
16702
|
+
"isidentifier",
|
|
16703
|
+
"isnumeric",
|
|
16704
|
+
"isdecimal"
|
|
16603
16705
|
]);
|
|
16604
16706
|
function buildResolutionMaps(nodes) {
|
|
16605
16707
|
const defFiles = /* @__PURE__ */ new Map();
|
|
@@ -16735,7 +16837,7 @@ var CG_SUBCOMMAND_HELP = {
|
|
|
16735
16837
|
deps: "musubix cg deps [path-fragment]\n List outgoing dependencies (\u2192 #include targets and function calls) per\n file. Call edges are annotated `name() [call]`.",
|
|
16736
16838
|
impact: "musubix cg impact <path-fragment> [--direct] [--depth N] [--json]\n Reverse reachability: which files are affected if the target changes.\n Splits direct (depth-1) from indirect dependents.\n --direct show only immediate (depth-1) dependents\n --depth N limit transitive expansion to N hops\n --json machine-readable output (for CI/automation)",
|
|
16737
16839
|
candidates: "musubix cg candidates [N] [--json]\n Rank files by suitability for an isolated rewrite (e.g. to Rust):\n score = (functions + dependents) / (1 + external deps). Test files are\n excluded. N limits the number of rows (default 15). --json for automation.",
|
|
16738
|
-
path: 'musubix cg path <from-fragment> <to-fragment> [--json]\n Show the shortest dependency chain from a file matching <from> to one\n matching <to> (over depends-on edges). Answers "why does A need B?".\n
|
|
16840
|
+
path: 'musubix cg path <from-fragment> <to-fragment> [--all] [--json]\n Show the shortest dependency chain from a file matching <from> to one\n matching <to> (over depends-on edges). Answers "why does A need B?".\n --all list all shortest paths (up to 20), not just one\n --json machine-readable output',
|
|
16739
16841
|
cycles: "musubix cg cycles [path-fragment] [N] [--json]\n Detect circular file dependencies (strongly-connected components of the\n file-level graph with >1 member). N limits the number of cycles shown\n (default 20); a path-fragment restricts to cycles touching those files.\n --json for machine-readable output.",
|
|
16740
16842
|
export: "musubix cg export [path-fragment] [--format dot|json] [--out <file>] [--cluster]\n Export the file-level dependency graph (symbol edges resolved to\n file \u2192 file). Default format dot (Graphviz), or json. Writes to <file>\n with --out, else stdout. A path-fragment limits it to a subgraph.\n --cluster (dot only) group nodes into a subgraph per directory",
|
|
16741
16843
|
gate: "musubix cg gate [--max-cycles N] [--forbid A:B[,C:D]] [--json]\n CI quality gate: check architectural rules against the current graph and\n exit non-zero on any violation.\n --max-cycles N fail if dependency cycles exceed N\n --forbid A:B fail if any file matching 'A' depends on one matching 'B'\n (comma-separate multiple rules); --json for automation",
|
|
@@ -16772,7 +16874,7 @@ async function handleCodegraph(sub, args) {
|
|
|
16772
16874
|
const fileCalls = [];
|
|
16773
16875
|
const globalFnToFiles = /* @__PURE__ */ new Map();
|
|
16774
16876
|
const fileDefines = /* @__PURE__ */ new Map();
|
|
16775
|
-
const
|
|
16877
|
+
const nonCDefNames = /* @__PURE__ */ new Set();
|
|
16776
16878
|
let indexedFiles = 0;
|
|
16777
16879
|
for (const file of files) {
|
|
16778
16880
|
const ext = file.split(".").pop() ?? "";
|
|
@@ -16799,6 +16901,8 @@ async function handleCodegraph(sub, args) {
|
|
|
16799
16901
|
const defined = fileDefines.get(file) ?? /* @__PURE__ */ new Set();
|
|
16800
16902
|
defined.add(node.name);
|
|
16801
16903
|
fileDefines.set(file, defined);
|
|
16904
|
+
if (lang !== "c")
|
|
16905
|
+
nonCDefNames.add(node.name);
|
|
16802
16906
|
if (!isStatic) {
|
|
16803
16907
|
const set = globalFnToFiles.get(node.name) ?? /* @__PURE__ */ new Set();
|
|
16804
16908
|
set.add(file);
|
|
@@ -16827,7 +16931,7 @@ async function handleCodegraph(sub, args) {
|
|
|
16827
16931
|
const defined = fileDefines.get(file) ?? /* @__PURE__ */ new Set();
|
|
16828
16932
|
defined.add(child.name);
|
|
16829
16933
|
fileDefines.set(file, defined);
|
|
16830
|
-
|
|
16934
|
+
nonCDefNames.add(child.name);
|
|
16831
16935
|
const set = globalFnToFiles.get(child.name) ?? /* @__PURE__ */ new Set();
|
|
16832
16936
|
set.add(file);
|
|
16833
16937
|
globalFnToFiles.set(child.name, set);
|
|
@@ -16839,7 +16943,7 @@ async function handleCodegraph(sub, args) {
|
|
|
16839
16943
|
for (const { file, calls } of fileCalls) {
|
|
16840
16944
|
const localDefs = fileDefines.get(file);
|
|
16841
16945
|
for (const name of calls) {
|
|
16842
|
-
if (
|
|
16946
|
+
if (nonCDefNames.has(name) && BUILTIN_CALL_NAMES.has(name))
|
|
16843
16947
|
continue;
|
|
16844
16948
|
if (localDefs?.has(name))
|
|
16845
16949
|
continue;
|
|
@@ -16956,14 +17060,20 @@ async function handleCodegraph(sub, args) {
|
|
|
16956
17060
|
set.add(e.from);
|
|
16957
17061
|
dependents.set(target, set);
|
|
16958
17062
|
}
|
|
17063
|
+
const cyclePenalty = /* @__PURE__ */ new Map();
|
|
17064
|
+
for (const scc of findDependencyCycles(nodes, edges)) {
|
|
17065
|
+
for (const f of scc)
|
|
17066
|
+
cyclePenalty.set(f, scc.length - 1);
|
|
17067
|
+
}
|
|
16959
17068
|
const cands = [];
|
|
16960
17069
|
for (const [file, fns] of fnCount) {
|
|
16961
17070
|
if (fns < 1 || isTestFile(file))
|
|
16962
17071
|
continue;
|
|
16963
17072
|
const deps = extDeps.get(file)?.size ?? 0;
|
|
16964
17073
|
const users = dependents.get(file)?.size ?? 0;
|
|
16965
|
-
const
|
|
16966
|
-
|
|
17074
|
+
const cycle = cyclePenalty.get(file) ?? 0;
|
|
17075
|
+
const score = (fns + users) / (1 + deps + cycle);
|
|
17076
|
+
cands.push({ file, fns, deps, users, cycle, score });
|
|
16967
17077
|
}
|
|
16968
17078
|
cands.sort((a, b) => b.score - a.score);
|
|
16969
17079
|
if (args.includes("--json")) {
|
|
@@ -16974,15 +17084,16 @@ async function handleCodegraph(sub, args) {
|
|
|
16974
17084
|
functions: c.fns,
|
|
16975
17085
|
externalDeps: c.deps,
|
|
16976
17086
|
dependents: c.users,
|
|
17087
|
+
cyclePenalty: c.cycle,
|
|
16977
17088
|
score: Number(c.score.toFixed(3))
|
|
16978
17089
|
}))
|
|
16979
17090
|
}, null, 2));
|
|
16980
17091
|
return ExitCode.SUCCESS;
|
|
16981
17092
|
}
|
|
16982
|
-
console.log(`Rewrite candidates (top ${Math.min(limit, cands.length)} of ${cands.length}, by self-containment \xD7 usage):`);
|
|
16983
|
-
console.log(` ${"score".padStart(7)} ${"fns".padStart(4)} ${"deps".padStart(4)} ${"users".padStart(5)} file`);
|
|
17093
|
+
console.log(`Rewrite candidates (top ${Math.min(limit, cands.length)} of ${cands.length}, by self-containment \xD7 usage, minus cycle entanglement):`);
|
|
17094
|
+
console.log(` ${"score".padStart(7)} ${"fns".padStart(4)} ${"deps".padStart(4)} ${"users".padStart(5)} ${"cyc".padStart(4)} file`);
|
|
16984
17095
|
for (const c of cands.slice(0, limit)) {
|
|
16985
|
-
console.log(` ${c.score.toFixed(1).padStart(7)} ${String(c.fns).padStart(4)} ${String(c.deps).padStart(4)} ${String(c.users).padStart(5)} ${c.file}`);
|
|
17096
|
+
console.log(` ${c.score.toFixed(1).padStart(7)} ${String(c.fns).padStart(4)} ${String(c.deps).padStart(4)} ${String(c.users).padStart(5)} ${String(c.cycle).padStart(4)} ${c.file}`);
|
|
16986
17097
|
}
|
|
16987
17098
|
return ExitCode.SUCCESS;
|
|
16988
17099
|
}
|
|
@@ -17124,11 +17235,12 @@ async function handleCodegraph(sub, args) {
|
|
|
17124
17235
|
}
|
|
17125
17236
|
case "path": {
|
|
17126
17237
|
const asJson = args.includes("--json");
|
|
17238
|
+
const showAll = args.includes("--all");
|
|
17127
17239
|
const positional = args.filter((a) => !a.startsWith("--"));
|
|
17128
17240
|
const fromFrag = positional[0];
|
|
17129
17241
|
const toFrag = positional[1];
|
|
17130
17242
|
if (!fromFrag || !toFrag) {
|
|
17131
|
-
console.error("\u274C Usage: musubix cg path <from-fragment> <to-fragment> [--json]");
|
|
17243
|
+
console.error("\u274C Usage: musubix cg path <from-fragment> <to-fragment> [--all] [--json]");
|
|
17132
17244
|
return ExitCode.VALIDATION_ERROR;
|
|
17133
17245
|
}
|
|
17134
17246
|
const { nodes, edges } = loadCodeGraphData();
|
|
@@ -17150,46 +17262,77 @@ async function handleCodegraph(sub, args) {
|
|
|
17150
17262
|
console.log(`No indexed file matches '${fromFrag}'.`);
|
|
17151
17263
|
return ExitCode.SUCCESS;
|
|
17152
17264
|
}
|
|
17153
|
-
const
|
|
17265
|
+
const dist = /* @__PURE__ */ new Map();
|
|
17266
|
+
const preds = /* @__PURE__ */ new Map();
|
|
17154
17267
|
const queue = [];
|
|
17155
17268
|
for (const f of froms) {
|
|
17156
|
-
|
|
17269
|
+
dist.set(f, 0);
|
|
17270
|
+
preds.set(f, []);
|
|
17157
17271
|
queue.push(f);
|
|
17158
17272
|
}
|
|
17159
|
-
|
|
17160
|
-
for (const f of froms)
|
|
17161
|
-
if (isTarget(f)) {
|
|
17162
|
-
found = f;
|
|
17163
|
-
break;
|
|
17164
|
-
}
|
|
17165
|
-
while (!found && queue.length > 0) {
|
|
17273
|
+
while (queue.length > 0) {
|
|
17166
17274
|
const f = queue.shift();
|
|
17275
|
+
const d = dist.get(f);
|
|
17167
17276
|
for (const dep of adj.get(f) ?? []) {
|
|
17168
|
-
if (
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17277
|
+
if (!dist.has(dep)) {
|
|
17278
|
+
dist.set(dep, d + 1);
|
|
17279
|
+
preds.set(dep, [f]);
|
|
17280
|
+
queue.push(dep);
|
|
17281
|
+
} else if (dist.get(dep) === d + 1) {
|
|
17282
|
+
preds.get(dep).push(f);
|
|
17174
17283
|
}
|
|
17175
|
-
queue.push(dep);
|
|
17176
17284
|
}
|
|
17177
17285
|
}
|
|
17178
|
-
|
|
17286
|
+
const targets = allFiles.filter((f) => isTarget(f) && dist.has(f));
|
|
17287
|
+
const minDist = targets.length ? Math.min(...targets.map((f) => dist.get(f))) : Infinity;
|
|
17288
|
+
const nearest = targets.filter((f) => dist.get(f) === minDist);
|
|
17289
|
+
if (nearest.length === 0) {
|
|
17179
17290
|
if (asJson)
|
|
17180
|
-
console.log(JSON.stringify({ from: fromFrag, to: toFrag,
|
|
17291
|
+
console.log(JSON.stringify({ from: fromFrag, to: toFrag, paths: [] }, null, 2));
|
|
17181
17292
|
else
|
|
17182
17293
|
console.log(`No dependency path from '${fromFrag}' to '${toFrag}'.`);
|
|
17183
17294
|
return ExitCode.SUCCESS;
|
|
17184
17295
|
}
|
|
17185
|
-
const
|
|
17186
|
-
|
|
17187
|
-
|
|
17296
|
+
const CAP = showAll ? 20 : 1;
|
|
17297
|
+
const paths = [];
|
|
17298
|
+
const build = (node, tail) => {
|
|
17299
|
+
if (paths.length >= CAP)
|
|
17300
|
+
return;
|
|
17301
|
+
const chain = [node, ...tail];
|
|
17302
|
+
const ps = preds.get(node) ?? [];
|
|
17303
|
+
if (ps.length === 0) {
|
|
17304
|
+
paths.push(chain);
|
|
17305
|
+
return;
|
|
17306
|
+
}
|
|
17307
|
+
for (const p of ps) {
|
|
17308
|
+
if (paths.length >= CAP)
|
|
17309
|
+
return;
|
|
17310
|
+
build(p, chain);
|
|
17311
|
+
}
|
|
17312
|
+
};
|
|
17313
|
+
for (const t of nearest) {
|
|
17314
|
+
if (paths.length >= CAP)
|
|
17315
|
+
break;
|
|
17316
|
+
build(t, []);
|
|
17317
|
+
}
|
|
17188
17318
|
if (asJson) {
|
|
17189
|
-
console.log(JSON.stringify({
|
|
17319
|
+
console.log(JSON.stringify({
|
|
17320
|
+
from: fromFrag,
|
|
17321
|
+
to: toFrag,
|
|
17322
|
+
hops: minDist,
|
|
17323
|
+
paths: showAll ? paths : void 0,
|
|
17324
|
+
path: showAll ? void 0 : paths[0]
|
|
17325
|
+
}, null, 2));
|
|
17326
|
+
} else if (showAll) {
|
|
17327
|
+
console.log(`${paths.length} shortest dependency path(s) (${minDist} hop(s) each):`);
|
|
17328
|
+
paths.forEach((p, i) => {
|
|
17329
|
+
console.log(`
|
|
17330
|
+
Path ${i + 1}:`);
|
|
17331
|
+
p.forEach((f, j) => console.log(` ${j === 0 ? "\u25C9" : "\u2192"} ${f}`));
|
|
17332
|
+
});
|
|
17190
17333
|
} else {
|
|
17191
|
-
console.log(`Dependency path (${
|
|
17192
|
-
|
|
17334
|
+
console.log(`Dependency path (${minDist} hop(s)):`);
|
|
17335
|
+
paths[0].forEach((f, i) => console.log(` ${i === 0 ? "\u25C9" : "\u2192"} ${f}`));
|
|
17193
17336
|
}
|
|
17194
17337
|
return ExitCode.SUCCESS;
|
|
17195
17338
|
}
|
|
@@ -18800,6 +18943,8 @@ function getDefaultCommands() {
|
|
|
18800
18943
|
positionalArgs.push("--forbid", String(args["forbid"]));
|
|
18801
18944
|
if (args["cluster"] === true)
|
|
18802
18945
|
positionalArgs.push("--cluster");
|
|
18946
|
+
if (args["all"] === true)
|
|
18947
|
+
positionalArgs.push("--all");
|
|
18803
18948
|
return await handleCodegraph(sub, positionalArgs);
|
|
18804
18949
|
}
|
|
18805
18950
|
},
|