@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/index.js
CHANGED
|
@@ -1113,7 +1113,7 @@ var init_defaults = __esm({
|
|
|
1113
1113
|
copilot: ".github/prompts",
|
|
1114
1114
|
codex: ".codex/agents"
|
|
1115
1115
|
};
|
|
1116
|
-
WAIRON_VERSION = "5.1.1-dev.
|
|
1116
|
+
WAIRON_VERSION = "5.1.1-dev.29";
|
|
1117
1117
|
GITHUB_REPO = "SYW-Apps/Waffle-AIron";
|
|
1118
1118
|
ARCHITECT_AGENT_ID = "agent-architect";
|
|
1119
1119
|
ARCHITECT_TEMPLATE_ID = "architect";
|
|
@@ -14560,13 +14560,21 @@ function groupsSharingCollaborators(calledBy) {
|
|
|
14560
14560
|
}
|
|
14561
14561
|
return [...groups.values()];
|
|
14562
14562
|
}
|
|
14563
|
+
function isForwardingMethod(narrative) {
|
|
14564
|
+
let handoffs = 0;
|
|
14565
|
+
for (const step of narrative) {
|
|
14566
|
+
if (step.type === "call" || step.type === "dispatch") handoffs++;
|
|
14567
|
+
else if (step.type !== "return") return false;
|
|
14568
|
+
}
|
|
14569
|
+
return handoffs === 1;
|
|
14570
|
+
}
|
|
14563
14571
|
var methodCohesionRule;
|
|
14564
14572
|
var init_method_cohesion = __esm({
|
|
14565
14573
|
"src/core/rules/heuristic/method-cohesion.ts"() {
|
|
14566
14574
|
"use strict";
|
|
14567
14575
|
methodCohesionRule = {
|
|
14568
14576
|
name: "method-cohesion",
|
|
14569
|
-
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.",
|
|
14577
|
+
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.",
|
|
14570
14578
|
codes: [
|
|
14571
14579
|
{ code: "INCOHESIVE_METHODS", defaultSeverity: "warning", summary: "Orchestrator's methods form two or more groups of two or more that share no called component" }
|
|
14572
14580
|
],
|
|
@@ -14576,6 +14584,8 @@ var init_method_cohesion = __esm({
|
|
|
14576
14584
|
const intf = ctx.interfaceMap.get(impl.contract);
|
|
14577
14585
|
const comp = intf ? ctx.componentMap.get(intf.component) : void 0;
|
|
14578
14586
|
if (!comp || comp.componentType !== "Orchestrator") continue;
|
|
14587
|
+
const narrated = impl.methods.filter((m) => (m.narrative ?? []).length > 0);
|
|
14588
|
+
if (narrated.length > 0 && narrated.every((m) => isForwardingMethod(m.narrative ?? []))) continue;
|
|
14579
14589
|
const calledBy = /* @__PURE__ */ new Map();
|
|
14580
14590
|
for (const method of impl.methods) {
|
|
14581
14591
|
const reached = /* @__PURE__ */ new Set();
|
|
@@ -14597,7 +14607,7 @@ var init_method_cohesion = __esm({
|
|
|
14597
14607
|
ctx.addIssue(
|
|
14598
14608
|
"warning",
|
|
14599
14609
|
"INCOHESIVE_METHODS",
|
|
14600
|
-
`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.`,
|
|
14610
|
+
`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.`,
|
|
14601
14611
|
component.id,
|
|
14602
14612
|
ctx.isComponentDraft(component.id)
|
|
14603
14613
|
);
|