@wairon/cli 5.1.1-dev.27 → 5.1.1-dev.29
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/index.js +13 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var init_defaults = __esm({
|
|
|
65
65
|
copilot: ".github/prompts",
|
|
66
66
|
codex: ".codex/agents"
|
|
67
67
|
};
|
|
68
|
-
WAIRON_VERSION = "5.1.1-dev.
|
|
68
|
+
WAIRON_VERSION = "5.1.1-dev.29";
|
|
69
69
|
GITHUB_REPO = "SYW-Apps/Waffle-AIron";
|
|
70
70
|
SUPPORTED_ALIASES = ["wai"];
|
|
71
71
|
SCAN_EXCLUDE_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -14614,13 +14614,21 @@ function groupsSharingCollaborators(calledBy) {
|
|
|
14614
14614
|
}
|
|
14615
14615
|
return [...groups.values()];
|
|
14616
14616
|
}
|
|
14617
|
+
function isForwardingMethod(narrative) {
|
|
14618
|
+
let handoffs = 0;
|
|
14619
|
+
for (const step of narrative) {
|
|
14620
|
+
if (step.type === "call" || step.type === "dispatch") handoffs++;
|
|
14621
|
+
else if (step.type !== "return") return false;
|
|
14622
|
+
}
|
|
14623
|
+
return handoffs === 1;
|
|
14624
|
+
}
|
|
14617
14625
|
var methodCohesionRule;
|
|
14618
14626
|
var init_method_cohesion = __esm({
|
|
14619
14627
|
"src/core/rules/heuristic/method-cohesion.ts"() {
|
|
14620
14628
|
"use strict";
|
|
14621
14629
|
methodCohesionRule = {
|
|
14622
14630
|
name: "method-cohesion",
|
|
14623
|
-
description: "An Orchestrator's methods share collaborators; when they split into groups that call no component in common, the component holds more than one responsibility. Reported only where two or more groups each hold two or more methods, so a single specialized method is not a finding.",
|
|
14631
|
+
description: "An Orchestrator's methods share collaborators; when they split into groups that call no component in common, the component holds more than one responsibility. Reported only where two or more groups each hold two or more methods, so a single specialized method is not a finding \u2014 and never on a pure forwarder, whose every narrated method is a single hand-off and whose responsibility therefore lives in what it forwards to.",
|
|
14624
14632
|
codes: [
|
|
14625
14633
|
{ code: "INCOHESIVE_METHODS", defaultSeverity: "warning", summary: "Orchestrator's methods form two or more groups of two or more that share no called component" }
|
|
14626
14634
|
],
|
|
@@ -14630,6 +14638,8 @@ var init_method_cohesion = __esm({
|
|
|
14630
14638
|
const intf = ctx.interfaceMap.get(impl.contract);
|
|
14631
14639
|
const comp = intf ? ctx.componentMap.get(intf.component) : void 0;
|
|
14632
14640
|
if (!comp || comp.componentType !== "Orchestrator") continue;
|
|
14641
|
+
const narrated = impl.methods.filter((m) => (m.narrative ?? []).length > 0);
|
|
14642
|
+
if (narrated.length > 0 && narrated.every((m) => isForwardingMethod(m.narrative ?? []))) continue;
|
|
14633
14643
|
const calledBy = /* @__PURE__ */ new Map();
|
|
14634
14644
|
for (const method2 of impl.methods) {
|
|
14635
14645
|
const reached = /* @__PURE__ */ new Set();
|
|
@@ -14651,7 +14661,7 @@ var init_method_cohesion = __esm({
|
|
|
14651
14661
|
ctx.addIssue(
|
|
14652
14662
|
"warning",
|
|
14653
14663
|
"INCOHESIVE_METHODS",
|
|
14654
|
-
`Orchestrator "${component.id}" holds ${groups.length} groups of methods that share no called component: ${described}. Split it along those groups, or acknowledge a deliberate facade with a reasoned lint.allow for INCOHESIVE_METHODS.`,
|
|
14664
|
+
`Orchestrator "${component.id}" holds ${groups.length} groups of methods that share no called component: ${described}. Split it along those groups, move the logic out until every method is a single hand-off (a pure forwarder is exempt), or acknowledge a deliberate facade with a reasoned lint.allow for INCOHESIVE_METHODS.`,
|
|
14655
14665
|
component.id,
|
|
14656
14666
|
ctx.isComponentDraft(component.id)
|
|
14657
14667
|
);
|