musubix2 0.5.75 → 0.5.77

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.75","timestamp":"2026-07-10T23:55:04.204Z"}
1
+ {"generator":"musubix2","version":"0.5.77","timestamp":"2026-07-11T00:18:49.514Z"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0",
3
- "generatedAt": "2026-07-10T23:55:04.235Z",
3
+ "generatedAt": "2026-07-11T00:18:49.545Z",
4
4
  "entries": [
5
5
  {
6
6
  "platform": "copilot",
package/dist/cli.js CHANGED
@@ -1210,7 +1210,7 @@ var init_markdown_ears_parser = __esm({
1210
1210
  }
1211
1211
  parse(markdown) {
1212
1212
  const requirements = [];
1213
- const lines = markdown.split("\n");
1213
+ const lines = markdown.split(/\r\n|\r|\n/);
1214
1214
  let currentReq = null;
1215
1215
  let currentBlock = "";
1216
1216
  let blockStartLine = 0;
@@ -2979,26 +2979,28 @@ var init_design = __esm({
2979
2979
  ISP: 100,
2980
2980
  DIP: 100
2981
2981
  };
2982
- for (const section of design.sections) {
2983
- if (section.requirementIds.length > 5) {
2982
+ for (const section of design.sections ?? []) {
2983
+ const reqCount = (section.requirementIds ?? []).length;
2984
+ const ifaceCount = (section.interfaces ?? []).length;
2985
+ if (reqCount > 5) {
2984
2986
  violations.push({
2985
2987
  principle: "SRP",
2986
2988
  section: section.id,
2987
- message: `Section handles ${section.requirementIds.length} requirements (>5)`,
2989
+ message: `Section handles ${reqCount} requirements (>5)`,
2988
2990
  suggestion: "Consider splitting this section into smaller, focused sections"
2989
2991
  });
2990
2992
  principleScores.SRP = Math.max(0, principleScores.SRP - 20);
2991
2993
  }
2992
- if (section.interfaces.length > 4) {
2994
+ if (ifaceCount > 4) {
2993
2995
  violations.push({
2994
2996
  principle: "ISP",
2995
2997
  section: section.id,
2996
- message: `Section suggests ${section.interfaces.length} interfaces (>4)`,
2998
+ message: `Section suggests ${ifaceCount} interfaces (>4)`,
2997
2999
  suggestion: "Consider splitting large interfaces into smaller, role-specific ones"
2998
3000
  });
2999
3001
  principleScores.ISP = Math.max(0, principleScores.ISP - 15);
3000
3002
  }
3001
- if (section.interfaces.length === 0 && section.requirementIds.length > 1) {
3003
+ if (ifaceCount === 0 && reqCount > 1) {
3002
3004
  violations.push({
3003
3005
  principle: "DIP",
3004
3006
  section: section.id,
@@ -12543,7 +12545,7 @@ var init_dist13 = __esm({
12543
12545
  }
12544
12546
  }
12545
12547
  for (const [term, df] of this.documentFrequency) {
12546
- this.idfScores.set(term, Math.log(this.documentCount / df));
12548
+ this.idfScores.set(term, Math.log((1 + this.documentCount) / (1 + df)) + 1);
12547
12549
  }
12548
12550
  }
12549
12551
  /** Get current vocabulary size. */
@@ -15629,10 +15631,10 @@ function policyTools() {
15629
15631
  try {
15630
15632
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15631
15633
  const engine = new policy.PolicyEngine();
15632
- const result = engine.validate(params["artifact"], params["articleIds"]);
15633
- return ok(result);
15634
- } catch {
15635
- return ok({ valid: true, violations: [] });
15634
+ const report = await engine.validateAll(params["artifact"] ?? {});
15635
+ return ok(report);
15636
+ } catch (err) {
15637
+ return fail(errMsg(err));
15636
15638
  }
15637
15639
  }),
15638
15640
  tool("policy.gate.run", "Run a quality gate check", "policy", [
@@ -15642,20 +15644,19 @@ function policyTools() {
15642
15644
  try {
15643
15645
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15644
15646
  const runner = new policy.QualityGateRunner();
15645
- const result = runner.run(params["gate"], params["context"]);
15646
- return ok(result);
15647
- } catch {
15648
- return ok({ passed: true, gate: params["gate"], details: [] });
15647
+ const results = await runner.runAll(params["context"] ?? {});
15648
+ return ok({ gate: params["gate"], results, passed: runner.allPassed(results) });
15649
+ } catch (err) {
15650
+ return fail(errMsg(err));
15649
15651
  }
15650
15652
  }),
15651
15653
  tool("policy.articles.list", "List all constitution articles", "policy", [], async () => {
15652
15654
  try {
15653
15655
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15654
15656
  const engine = new policy.PolicyEngine();
15655
- const articles = engine.listArticles();
15656
- return ok(articles);
15657
- } catch {
15658
- return ok([]);
15657
+ return ok(engine.listPolicies());
15658
+ } catch (err) {
15659
+ return fail(errMsg(err));
15659
15660
  }
15660
15661
  })
15661
15662
  ];
package/dist/index.js CHANGED
@@ -1210,7 +1210,7 @@ var init_markdown_ears_parser = __esm({
1210
1210
  }
1211
1211
  parse(markdown) {
1212
1212
  const requirements = [];
1213
- const lines = markdown.split("\n");
1213
+ const lines = markdown.split(/\r\n|\r|\n/);
1214
1214
  let currentReq = null;
1215
1215
  let currentBlock = "";
1216
1216
  let blockStartLine = 0;
@@ -2979,26 +2979,28 @@ var init_design = __esm({
2979
2979
  ISP: 100,
2980
2980
  DIP: 100
2981
2981
  };
2982
- for (const section of design.sections) {
2983
- if (section.requirementIds.length > 5) {
2982
+ for (const section of design.sections ?? []) {
2983
+ const reqCount = (section.requirementIds ?? []).length;
2984
+ const ifaceCount = (section.interfaces ?? []).length;
2985
+ if (reqCount > 5) {
2984
2986
  violations.push({
2985
2987
  principle: "SRP",
2986
2988
  section: section.id,
2987
- message: `Section handles ${section.requirementIds.length} requirements (>5)`,
2989
+ message: `Section handles ${reqCount} requirements (>5)`,
2988
2990
  suggestion: "Consider splitting this section into smaller, focused sections"
2989
2991
  });
2990
2992
  principleScores.SRP = Math.max(0, principleScores.SRP - 20);
2991
2993
  }
2992
- if (section.interfaces.length > 4) {
2994
+ if (ifaceCount > 4) {
2993
2995
  violations.push({
2994
2996
  principle: "ISP",
2995
2997
  section: section.id,
2996
- message: `Section suggests ${section.interfaces.length} interfaces (>4)`,
2998
+ message: `Section suggests ${ifaceCount} interfaces (>4)`,
2997
2999
  suggestion: "Consider splitting large interfaces into smaller, role-specific ones"
2998
3000
  });
2999
3001
  principleScores.ISP = Math.max(0, principleScores.ISP - 15);
3000
3002
  }
3001
- if (section.interfaces.length === 0 && section.requirementIds.length > 1) {
3003
+ if (ifaceCount === 0 && reqCount > 1) {
3002
3004
  violations.push({
3003
3005
  principle: "DIP",
3004
3006
  section: section.id,
@@ -12543,7 +12545,7 @@ var init_dist13 = __esm({
12543
12545
  }
12544
12546
  }
12545
12547
  for (const [term, df] of this.documentFrequency) {
12546
- this.idfScores.set(term, Math.log(this.documentCount / df));
12548
+ this.idfScores.set(term, Math.log((1 + this.documentCount) / (1 + df)) + 1);
12547
12549
  }
12548
12550
  }
12549
12551
  /** Get current vocabulary size. */
@@ -15629,10 +15631,10 @@ function policyTools() {
15629
15631
  try {
15630
15632
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15631
15633
  const engine = new policy.PolicyEngine();
15632
- const result = engine.validate(params["artifact"], params["articleIds"]);
15633
- return ok(result);
15634
- } catch {
15635
- return ok({ valid: true, violations: [] });
15634
+ const report = await engine.validateAll(params["artifact"] ?? {});
15635
+ return ok(report);
15636
+ } catch (err) {
15637
+ return fail(errMsg(err));
15636
15638
  }
15637
15639
  }),
15638
15640
  tool("policy.gate.run", "Run a quality gate check", "policy", [
@@ -15642,20 +15644,19 @@ function policyTools() {
15642
15644
  try {
15643
15645
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15644
15646
  const runner = new policy.QualityGateRunner();
15645
- const result = runner.run(params["gate"], params["context"]);
15646
- return ok(result);
15647
- } catch {
15648
- return ok({ passed: true, gate: params["gate"], details: [] });
15647
+ const results = await runner.runAll(params["context"] ?? {});
15648
+ return ok({ gate: params["gate"], results, passed: runner.allPassed(results) });
15649
+ } catch (err) {
15650
+ return fail(errMsg(err));
15649
15651
  }
15650
15652
  }),
15651
15653
  tool("policy.articles.list", "List all constitution articles", "policy", [], async () => {
15652
15654
  try {
15653
15655
  const policy = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
15654
15656
  const engine = new policy.PolicyEngine();
15655
- const articles = engine.listArticles();
15656
- return ok(articles);
15657
- } catch {
15658
- return ok([]);
15657
+ return ok(engine.listPolicies());
15658
+ } catch (err) {
15659
+ return fail(errMsg(err));
15659
15660
  }
15660
15661
  })
15661
15662
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musubix2",
3
- "version": "0.5.75",
3
+ "version": "0.5.77",
4
4
  "description": "MUSUBIX2 — Specification Driven Development System",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",