@event4u/agent-config 9.17.0 → 9.18.1
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-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +122 -171
- package/dist/agent-src/commands/challenge-me/vision.md +5 -0
- package/dist/agent-src/commands/evals/rule-compliance-audit.json +46 -0
- package/dist/agent-src/commands/feature/plan.md +20 -0
- package/dist/agent-src/commands/feature/roadmap.md +19 -0
- package/dist/agent-src/commands/pr/create.md +29 -0
- package/dist/agent-src/commands/roadmap/create.md +29 -0
- package/dist/agent-src/commands/rule-compliance-audit.md +28 -5
- package/dist/agent-src/contexts/execution/plan-confidence-gate.md +133 -0
- package/dist/agent-src/rules/active-remediation.md +2 -0
- package/dist/agent-src/rules/architecture.md +2 -0
- package/dist/agent-src/rules/augment-edit-discipline.md +2 -0
- package/dist/agent-src/rules/brand-consistency.md +10 -62
- package/dist/agent-src/rules/brand-source-of-truth.md +62 -11
- package/dist/agent-src/rules/broken-access-control.md +4 -0
- package/dist/agent-src/rules/cli-output-handling.md +5 -0
- package/dist/agent-src/rules/code-comment-discipline.md +3 -0
- package/dist/agent-src/rules/commit-conventions.md +2 -0
- package/dist/agent-src/rules/cross-source-consistency.md +3 -0
- package/dist/agent-src/rules/design-fidelity.md +2 -0
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +2 -0
- package/dist/agent-src/rules/docker-commands.md +4 -0
- package/dist/agent-src/rules/domain-adoption-policy.md +2 -0
- package/dist/agent-src/rules/domain-safety-disclaimer.md +5 -2
- package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +9 -0
- package/dist/agent-src/rules/image-likeness-and-rights.md +4 -0
- package/dist/agent-src/rules/improve-before-implement.md +4 -0
- package/dist/agent-src/rules/laravel-routing.md +4 -0
- package/dist/agent-src/rules/legal-safety-floor.md +3 -0
- package/dist/agent-src/rules/lethal-trifecta-guard.md +3 -0
- package/dist/agent-src/rules/media-governance-routing.md +5 -0
- package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
- package/dist/agent-src/rules/no-roadmap-references.md +2 -0
- package/dist/agent-src/rules/notes-first-reasoning.md +2 -0
- package/dist/agent-src/rules/php-coding.md +2 -0
- package/dist/agent-src/rules/prefer-enums-over-literals.md +3 -0
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +5 -0
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +2 -0
- package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
- package/dist/agent-src/rules/rule-type-governance.md +2 -0
- package/dist/agent-src/rules/scale-discipline.md +3 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +9 -2
- package/dist/agent-src/rules/senior-engineering-discipline.md +6 -0
- package/dist/agent-src/rules/skill-quality.md +2 -0
- package/dist/agent-src/rules/source-confidentiality.md +4 -0
- package/dist/agent-src/rules/source-discovery-gate.md +3 -0
- package/dist/agent-src/rules/source-of-truth.md +2 -0
- package/dist/agent-src/rules/strategy-safety-floor.md +2 -0
- package/dist/agent-src/rules/think-before-action.md +5 -0
- package/dist/agent-src/rules/ui-audit-gate.md +2 -0
- package/dist/agent-src/skills/design-intelligence/SKILL.md +6 -180
- package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +100 -0
- package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +91 -0
- package/dist/agent-src/skills/design-review/SKILL.md +4 -141
- package/dist/agent-src/skills/design-review/references/review-communication.md +92 -0
- package/dist/agent-src/skills/design-review/references/verification-automation.md +61 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +8 -27
- package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +31 -0
- package/dist/agent-src/skills/fe-design/SKILL.md +4 -289
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +227 -0
- package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +75 -0
- package/dist/agent-src/skills/roadmap-management/SKILL.md +10 -0
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +12 -1
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +12 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
- package/dist/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
- package/dist/cli/registry.js +2 -0
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/chunk-AIIUU73N.js +2040 -0
- package/dist/cli-delegate/{chunk-IMSXPRVH.js → chunk-ELMFOQPW.js} +11 -0
- package/dist/cli-delegate/chunk-LF2KKJ4Q.js +183 -0
- package/dist/cli-delegate/cmd_explain.js +36 -36
- package/dist/cli-delegate/cmd_export.js +1 -1
- package/dist/cli-delegate/cmd_handoff.js +203 -2228
- package/dist/cli-delegate/cmd_prune.js +1 -1
- package/dist/cli-delegate/cmd_route_audit.js +249 -0
- package/dist/cli-delegate/cmd_route_explain.js +285 -0
- package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +1 -1
- package/dist/cli-delegate/cmd_uninstall.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +57 -57
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/install/install.mjs +11 -0
- package/dist/mcp/registry-manifest.json +1 -1
- package/dist/mcp/server.json +2 -2
- package/dist/router.json +1 -1
- package/dist/server/schemas/settings.js +12 -0
- package/dist/server/schemas/settings.js.map +1 -1
- package/package.json +1 -1
- package/src/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
- package/src/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
- package/src/config/agent-settings.template.yml +46 -0
- package/src/config/evaluator-budgets.json +3 -3
- package/src/config/gate-coverage.yml +44 -0
- package/src/scripts/_cli/cmd_explain.ts +41 -36
- package/src/scripts/_cli/cmd_route_audit.ts +290 -0
- package/src/scripts/_cli/cmd_route_explain.ts +269 -0
- package/src/scripts/_dispatch.bash +23 -0
- package/src/scripts/_lib/git_env.ts +40 -0
- package/src/scripts/_lib/md_table.ts +27 -0
- package/src/scripts/_lib/planning_settings.ts +43 -0
- package/src/scripts/_lib/release_highlights.ts +279 -0
- package/src/scripts/_lib/router_match.ts +301 -0
- package/src/scripts/annotate_r1_outcomes.ts +258 -0
- package/src/scripts/check_completion_review.ts +1322 -0
- package/src/scripts/check_release_highlights.ts +60 -152
- package/src/scripts/compile_router.ts +20 -3
- package/src/scripts/dispatch_r2_reviewer.ts +969 -0
- package/src/scripts/eval_ui_triviality.ts +156 -0
- package/src/scripts/lint_abstraction_thresholds.ts +3 -1
- package/src/scripts/lint_plan_risk_register.ts +931 -0
- package/src/scripts/lint_trigger_collisions.ts +257 -0
- package/src/scripts/release.ts +47 -13
- package/src/scripts/router_telemetry.ts +16 -290
- package/src/scripts/schemas/rule.schema.json +10 -0
- package/src/server/schemas/settings.ts +18 -0
|
@@ -5089,6 +5089,17 @@ var settingsSchema = external_exports.object({
|
|
|
5089
5089
|
'Optional planning horizon (weeks) the agent shows in roadmap framing ("next 4 weeks"). Set 0 to omit the horizon \u2014 most teams prefer to ship without a hardcoded window.'
|
|
5090
5090
|
)
|
|
5091
5091
|
}),
|
|
5092
|
+
planning: external_exports.object({
|
|
5093
|
+
challenge_on_create: external_exports.boolean().default(true).describe(
|
|
5094
|
+
"Gate C \u2014 plan-confidence gate before authoring. true (default) = a plan-artifact ask (/roadmap:create, roadmap-writing, /feature:plan, /feature:roadmap) first checks the four 95%-confidence conditions from /challenge-me vision; any gap routes into the interview (or the inline degrade protocol) before authoring, and a confident pass emits exactly one marker line. false = inert, plan asks author directly. An explicit user bypass always wins for that turn and is counted."
|
|
5095
|
+
),
|
|
5096
|
+
risk_review: external_exports.boolean().default(true).describe(
|
|
5097
|
+
'Gate R1 \u2014 plan-risk review. true (default) = every ready (non-draft) plan must carry a schema-valid "## Risk Register" section (ranked risks, mitigation + anchor per row, freshness marker, exact honest-null grammar), enforced by lint_plan_risk_register at pre-push + CI. false = escape hatch, the validator skips.'
|
|
5098
|
+
),
|
|
5099
|
+
completion_review: external_exports.boolean().default(true).describe(
|
|
5100
|
+
"Gate R2 \u2014 completion review at 100% roadmap completion / pre-PR. true (default) = a findings-before-fixes review by a fresh reviewer context must exist for the current diff hash (or an exact honest-null / skip declaration) before fix commits and PR creation, enforced by check_completion_review at pre-push + CI (CI authoritative; a crashed validator warns and allows). false = escape hatch, the validator skips."
|
|
5101
|
+
)
|
|
5102
|
+
}).default({}),
|
|
5092
5103
|
quality: external_exports.object({
|
|
5093
5104
|
local_auto_run: external_exports.boolean().default(false).describe(
|
|
5094
5105
|
"Run quality tools (linters, type-checks, formatters) and the local test suite autonomously after edits. Off by default \u2014 the agent never runs quality tools proactively and does not ask; the user runs them manually (e.g. /quality-fix) and remote CI is the authoritative gate. The agent only runs a quality tool on an explicit ask, a concrete CI failure, or the new-gate carve-out. Turn on to restore autonomous pipeline runs."
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/scripts/_lib/router_match.ts
|
|
4
|
+
function _fnmatchToRegExp(pat) {
|
|
5
|
+
let res = "";
|
|
6
|
+
let i = 0;
|
|
7
|
+
const n = pat.length;
|
|
8
|
+
while (i < n) {
|
|
9
|
+
const c = pat[i];
|
|
10
|
+
i += 1;
|
|
11
|
+
if (c === "*") {
|
|
12
|
+
res += ".*";
|
|
13
|
+
} else if (c === "?") {
|
|
14
|
+
res += ".";
|
|
15
|
+
} else if (c === "[") {
|
|
16
|
+
let j = i;
|
|
17
|
+
if (j < n && pat[j] === "!") {
|
|
18
|
+
j += 1;
|
|
19
|
+
}
|
|
20
|
+
if (j < n && pat[j] === "]") {
|
|
21
|
+
j += 1;
|
|
22
|
+
}
|
|
23
|
+
while (j < n && pat[j] !== "]") {
|
|
24
|
+
j += 1;
|
|
25
|
+
}
|
|
26
|
+
if (j >= n) {
|
|
27
|
+
res += "\\[";
|
|
28
|
+
} else {
|
|
29
|
+
let stuff = pat.slice(i, j);
|
|
30
|
+
if (!stuff.includes("-")) {
|
|
31
|
+
stuff = stuff.replace(/\\/g, "\\\\");
|
|
32
|
+
} else {
|
|
33
|
+
const chunks = [];
|
|
34
|
+
let k = pat[i] === "!" ? i + 2 : i + 1;
|
|
35
|
+
let start = i;
|
|
36
|
+
while (true) {
|
|
37
|
+
const rel = pat.slice(k, j).indexOf("-");
|
|
38
|
+
if (rel < 0) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
const idx = k + rel;
|
|
42
|
+
chunks.push(pat.slice(start, idx));
|
|
43
|
+
start = idx + 1;
|
|
44
|
+
k = idx + 3;
|
|
45
|
+
}
|
|
46
|
+
chunks.push(pat.slice(start, j));
|
|
47
|
+
stuff = chunks.map((s) => s.replace(/\\/g, "\\\\").replace(/-/g, "\\-")).join("-");
|
|
48
|
+
}
|
|
49
|
+
stuff = stuff.replace(/([&~|])/g, "\\$1");
|
|
50
|
+
i = j + 1;
|
|
51
|
+
if (stuff.startsWith("!")) {
|
|
52
|
+
stuff = "^" + stuff.slice(1);
|
|
53
|
+
} else if (stuff.startsWith("^") || stuff.startsWith("[")) {
|
|
54
|
+
stuff = "\\" + stuff;
|
|
55
|
+
}
|
|
56
|
+
res += `[${stuff}]`;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
res += c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return new RegExp(`^(?:${res})$`, "s");
|
|
63
|
+
}
|
|
64
|
+
function _fnmatch(name, pat) {
|
|
65
|
+
return _fnmatchToRegExp(pat).test(name);
|
|
66
|
+
}
|
|
67
|
+
var _WORD_CHAR = /[\p{L}\p{N}_]/u;
|
|
68
|
+
function _isWordChar(c) {
|
|
69
|
+
return c !== void 0 && _WORD_CHAR.test(c);
|
|
70
|
+
}
|
|
71
|
+
function keyword_matches_anchored(prompt_lower, kw_lower) {
|
|
72
|
+
if (kw_lower === "") {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const needLeft = _isWordChar(kw_lower[0]);
|
|
76
|
+
const needRight = _isWordChar(kw_lower[kw_lower.length - 1]);
|
|
77
|
+
let idx = prompt_lower.indexOf(kw_lower);
|
|
78
|
+
while (idx !== -1) {
|
|
79
|
+
const leftOk = !needLeft || !_isWordChar(prompt_lower[idx - 1]);
|
|
80
|
+
let rightOk = true;
|
|
81
|
+
if (needRight) {
|
|
82
|
+
let end = idx + kw_lower.length;
|
|
83
|
+
if (prompt_lower[end] === "s") {
|
|
84
|
+
end += 1;
|
|
85
|
+
}
|
|
86
|
+
rightOk = !_isWordChar(prompt_lower[end]);
|
|
87
|
+
}
|
|
88
|
+
if (leftOk && rightOk) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
idx = prompt_lower.indexOf(kw_lower, idx + 1);
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
function trigger_matches(trigger, prompt, open_files, command) {
|
|
96
|
+
const prompt_lower = prompt.toLowerCase();
|
|
97
|
+
if ("keyword" in trigger) {
|
|
98
|
+
return keyword_matches_anchored(prompt_lower, String(trigger["keyword"]).toLowerCase());
|
|
99
|
+
}
|
|
100
|
+
if ("phrase" in trigger) {
|
|
101
|
+
return prompt_lower.includes(String(trigger["phrase"]).toLowerCase());
|
|
102
|
+
}
|
|
103
|
+
if ("command" in trigger) {
|
|
104
|
+
if (!command) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return command.startsWith(String(trigger["command"]));
|
|
108
|
+
}
|
|
109
|
+
if ("path_prefix" in trigger) {
|
|
110
|
+
if (!open_files) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
const pref = String(trigger["path_prefix"]);
|
|
114
|
+
for (const p of open_files) {
|
|
115
|
+
if (String(p).startsWith(pref)) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if ("file_pattern" in trigger) {
|
|
122
|
+
if (!open_files) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
const pat = String(trigger["file_pattern"]);
|
|
126
|
+
for (const p of open_files) {
|
|
127
|
+
if (_fnmatch(String(p), pat)) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
function _asRuleList(value) {
|
|
136
|
+
if (!Array.isArray(value)) {
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
function _asTriggerList(value) {
|
|
142
|
+
if (!Array.isArray(value)) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
function match_prompt(router, prompt, profile = "full", open_files, command) {
|
|
148
|
+
const tiers = [
|
|
149
|
+
["tier_1", _asRuleList(router["tier_1"])]
|
|
150
|
+
];
|
|
151
|
+
if (profile === "full") {
|
|
152
|
+
tiers.push(["tier_2", _asRuleList(router["tier_2"])]);
|
|
153
|
+
}
|
|
154
|
+
const matched_triggers = [];
|
|
155
|
+
const activated_rules = [];
|
|
156
|
+
for (const [tier_name, rules] of tiers) {
|
|
157
|
+
for (const rule of rules) {
|
|
158
|
+
const rule_id = rule["id"];
|
|
159
|
+
const rule_triggers = _asTriggerList(rule["triggers"]);
|
|
160
|
+
let rule_hit = false;
|
|
161
|
+
for (const trig of rule_triggers) {
|
|
162
|
+
if (trigger_matches(trig, prompt, open_files, command)) {
|
|
163
|
+
matched_triggers.push({ tier: tier_name, rule: rule_id, trigger: trig });
|
|
164
|
+
rule_hit = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (rule_hit) {
|
|
168
|
+
activated_rules.push({ tier: tier_name, rule: rule_id });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const kernel = Array.isArray(router["kernel"]) ? router["kernel"] : [];
|
|
173
|
+
for (const kid of kernel) {
|
|
174
|
+
activated_rules.push({ tier: "kernel", rule: kid });
|
|
175
|
+
}
|
|
176
|
+
return { matched_triggers, activated_rules };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
trigger_matches,
|
|
181
|
+
_asRuleList,
|
|
182
|
+
match_prompt
|
|
183
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
trigger_matches
|
|
5
|
+
} from "./chunk-LF2KKJ4Q.js";
|
|
3
6
|
import {
|
|
4
7
|
StateLoadError,
|
|
5
8
|
load_state
|
|
@@ -2266,51 +2269,44 @@ function pyReprAny(value) {
|
|
|
2266
2269
|
}
|
|
2267
2270
|
return String(value);
|
|
2268
2271
|
}
|
|
2269
|
-
function
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
return `keyword: ${kw}`;
|
|
2274
|
-
}
|
|
2275
|
-
}
|
|
2276
|
-
if ("phrase" in trigger) {
|
|
2277
|
-
const ph = String(trigger["phrase"]).toLowerCase();
|
|
2278
|
-
if (ph && lowered.includes(ph)) {
|
|
2279
|
-
return `phrase: ${ph}`;
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
if ("path_prefix" in trigger) {
|
|
2283
|
-
const prefix = String(trigger["path_prefix"]);
|
|
2284
|
-
if (prefix && text.includes(prefix)) {
|
|
2285
|
-
return `path_prefix: ${prefix}`;
|
|
2272
|
+
function _trigger_reason(trigger) {
|
|
2273
|
+
for (const kind of ["keyword", "phrase", "command", "path_prefix", "file_pattern"]) {
|
|
2274
|
+
if (kind in trigger) {
|
|
2275
|
+
return `${kind}: ${String(trigger[kind])}`;
|
|
2286
2276
|
}
|
|
2287
2277
|
}
|
|
2288
|
-
return
|
|
2278
|
+
return `trigger: ${JSON.stringify(trigger)}`;
|
|
2289
2279
|
}
|
|
2290
2280
|
function _explain_route(project_root, text, as_json) {
|
|
2291
2281
|
const router = _load_router2(project_root);
|
|
2292
|
-
const
|
|
2293
|
-
const
|
|
2294
|
-
const
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2282
|
+
const tier_1_matches = [];
|
|
2283
|
+
const tier_2_matches = [];
|
|
2284
|
+
for (const [tier, sink] of [
|
|
2285
|
+
["tier_1", tier_1_matches],
|
|
2286
|
+
["tier_2", tier_2_matches]
|
|
2287
|
+
]) {
|
|
2288
|
+
const rules = router[tier] || [];
|
|
2289
|
+
for (const entry of rules) {
|
|
2290
|
+
const triggers = entry["triggers"] || [];
|
|
2291
|
+
for (const trig of triggers) {
|
|
2292
|
+
if (trigger_matches(trig, text, null, null)) {
|
|
2293
|
+
sink.push({ id: entry["id"], tier, reason: _trigger_reason(trig) });
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2302
2296
|
}
|
|
2303
2297
|
}
|
|
2304
2298
|
}
|
|
2299
|
+
const total = tier_1_matches.length + tier_2_matches.length;
|
|
2305
2300
|
const kernel_always = [...router["kernel"] || []];
|
|
2306
2301
|
const payload = {
|
|
2307
2302
|
input: text,
|
|
2308
2303
|
kernel_always,
|
|
2309
|
-
tier_1_matches
|
|
2304
|
+
tier_1_matches,
|
|
2305
|
+
tier_2_matches
|
|
2310
2306
|
};
|
|
2311
2307
|
if (as_json) {
|
|
2312
2308
|
_dumpJson(payload);
|
|
2313
|
-
return 0;
|
|
2309
|
+
return total === 0 ? 1 : 0;
|
|
2314
2310
|
}
|
|
2315
2311
|
print(` input: ${pyReprStr(text)}`);
|
|
2316
2312
|
print();
|
|
@@ -2319,14 +2315,19 @@ function _explain_route(project_root, text, as_json) {
|
|
|
2319
2315
|
print(` \xB7 ${pyStr(kid)}`);
|
|
2320
2316
|
}
|
|
2321
2317
|
print();
|
|
2322
|
-
print(` tier-1 matches (${
|
|
2323
|
-
|
|
2324
|
-
print(
|
|
2325
|
-
return 1;
|
|
2318
|
+
print(` tier-1 matches (${tier_1_matches.length}):`);
|
|
2319
|
+
for (const match of tier_1_matches) {
|
|
2320
|
+
print(` \xB7 ${match["id"]} (${match["reason"]})`);
|
|
2326
2321
|
}
|
|
2327
|
-
|
|
2322
|
+
print();
|
|
2323
|
+
print(` tier-2 matches (${tier_2_matches.length}):`);
|
|
2324
|
+
for (const match of tier_2_matches) {
|
|
2328
2325
|
print(` \xB7 ${match["id"]} (${match["reason"]})`);
|
|
2329
2326
|
}
|
|
2327
|
+
if (total === 0) {
|
|
2328
|
+
print(" \xB7 (no trigger matched \u2014 only kernel rules active)");
|
|
2329
|
+
return 1;
|
|
2330
|
+
}
|
|
2330
2331
|
return 0;
|
|
2331
2332
|
}
|
|
2332
2333
|
function _explain_last(project_root, state_file, as_json, quiet) {
|
|
@@ -2569,7 +2570,6 @@ export {
|
|
|
2569
2570
|
_find_rule,
|
|
2570
2571
|
_load_router2 as _load_router,
|
|
2571
2572
|
_load_user_settings,
|
|
2572
|
-
_matches_trigger,
|
|
2573
2573
|
_parse,
|
|
2574
2574
|
_resolve_root,
|
|
2575
2575
|
main
|