tribunal-kit 5.8.0 → 5.8.2

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,6 +1,6 @@
1
1
  # 🧠 Tribunal Memory Index
2
2
  > Auto-generated by `tribunal-kit memory export`. Do not edit manually.
3
- > Entries: 50 | Semantic: 40 | Procedural: 10 | Episodic: 0 | Working: 0
3
+ > Entries: 131 | Semantic: 105 | Procedural: 26 | Episodic: 0 | Working: 0
4
4
 
5
5
  ## SEMANTIC (Permanent Facts)
6
6
  | ID | Content | Tags | Source | Created |
@@ -45,6 +45,71 @@
45
45
  | 46 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783152364Z |
46
46
  | 47 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783152364Z |
47
47
  | 48 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783152364Z |
48
+ | 51 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438387Z |
49
+ | 52 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438387Z |
50
+ | 53 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438387Z |
51
+ | 54 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438387Z |
52
+ | 55 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438387Z |
53
+ | 56 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438387Z |
54
+ | 57 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438387Z |
55
+ | 58 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438387Z |
56
+ | 61 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438449Z |
57
+ | 62 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438449Z |
58
+ | 63 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438449Z |
59
+ | 64 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438449Z |
60
+ | 65 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438449Z |
61
+ | 66 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438449Z |
62
+ | 67 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438449Z |
63
+ | 68 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438449Z |
64
+ | 71 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783438727Z |
65
+ | 72 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783438727Z |
66
+ | 73 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438727Z |
67
+ | 74 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438727Z |
68
+ | 75 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783438727Z |
69
+ | 76 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783438727Z |
70
+ | 77 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783438727Z |
71
+ | 78 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783438727Z |
72
+ | 81 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783782112Z |
73
+ | 82 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783782112Z |
74
+ | 83 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782112Z |
75
+ | 84 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782112Z |
76
+ | 85 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783782112Z |
77
+ | 86 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783782112Z |
78
+ | 87 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782112Z |
79
+ | 88 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782112Z |
80
+ | 91 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783782132Z |
81
+ | 92 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783782132Z |
82
+ | 93 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782132Z |
83
+ | 94 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782132Z |
84
+ | 95 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783782132Z |
85
+ | 96 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783782132Z |
86
+ | 97 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783782132Z |
87
+ | 98 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783782132Z |
88
+ | 101 | Database is PostgreSQL | db, postgres | manual | 1783783700Z |
89
+ | 102 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783785670Z |
90
+ | 103 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783785670Z |
91
+ | 104 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783785670Z |
92
+ | 105 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783785670Z |
93
+ | 106 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783785670Z |
94
+ | 107 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783785670Z |
95
+ | 108 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783785670Z |
96
+ | 109 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783785670Z |
97
+ | 112 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1783790009Z |
98
+ | 113 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1783790009Z |
99
+ | 114 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783790009Z |
100
+ | 115 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783790009Z |
101
+ | 116 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1783790009Z |
102
+ | 117 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1783790009Z |
103
+ | 118 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1783790009Z |
104
+ | 119 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1783790009Z |
105
+ | 122 | ❌ Overriding project idioms without explicit justification -> ✅ Idioms represent team decisions; flag deviations with reasoning | project-idiom, auto-learned | manual | 1784187808Z |
106
+ | 123 | ❌ Applying idioms from one project to a different project -> ✅ Idioms are project-specific; verify they apply to the current codebase | project-idiom, auto-learned | manual | 1784187808Z |
107
+ | 124 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1784187808Z |
108
+ | 125 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1784187808Z |
109
+ | 126 | [ ] Have I reviewed the user's specific constraints and requests? | project-idiom, auto-learned | manual | 1784187808Z |
110
+ | 127 | [ ] Have I checked the environment for relevant existing implementations? | project-idiom, auto-learned | manual | 1784187808Z |
111
+ | 128 | ❌ **Forbidden:** Declaring a task complete because the output "looks correct." | project-idiom, auto-learned | manual | 1784187808Z |
112
+ | 129 | ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended. | project-idiom, auto-learned | manual | 1784187808Z |
48
113
 
49
114
  ## PROCEDURAL (How-To Recipes)
50
115
  | ID | Content | Tags | Source | Created |
@@ -59,4 +124,20 @@
59
124
  | 40 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783148917Z |
60
125
  | 49 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783152364Z |
61
126
  | 50 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783152364Z |
127
+ | 59 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438387Z |
128
+ | 60 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438387Z |
129
+ | 69 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438449Z |
130
+ | 70 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438449Z |
131
+ | 79 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783438727Z |
132
+ | 80 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783438727Z |
133
+ | 89 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783782112Z |
134
+ | 90 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783782112Z |
135
+ | 99 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783782132Z |
136
+ | 100 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783782132Z |
137
+ | 110 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783785670Z |
138
+ | 111 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783785670Z |
139
+ | 120 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1783790009Z |
140
+ | 121 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1783790009Z |
141
+ | 130 | Run `echo 'No build step required for this project'` to build the project | build-script, build, auto-learned | manual | 1784187808Z |
142
+ | 131 | Run `npm run validate-payload && jest --coverage` to test the project | build-script, test, auto-learned | manual | 1784187808Z |
62
143
 
@@ -22,6 +22,13 @@ Has this information possibly changed since my training?
22
22
  → Yes → Search before answering. Never serve stale facts.
23
23
  Am I importing a package/method that exists?
24
24
  → Verify against package.json / requirements.txt / official docs.
25
+
26
+ Epistemic Confidence Levels (L1-L5):
27
+ - L1: Absolute Certainty (Verified against active codebase or official docs)
28
+ - L2: High Confidence (Standard library or stable unchanged APIs)
29
+ - L3: Moderate Confidence (Likely but unverified custom utils; requires // VERIFY)
30
+ - L4: Low Confidence (Speculative unstable features; requires immediate search)
31
+ - L5: Pure Speculation (Guessed; strictly forbidden from code generation)
25
32
  ```
26
33
 
27
34
  ### 0b. Response Format Decision
@@ -210,12 +217,12 @@ The Human Gate is never skipped. No code is written to a file without explicit u
210
217
 
211
218
  | Code type | Reviewers |
212
219
  | --------------------- | --------------------------------------------------------------------------------------------------- |
213
- | Backend/API | logic + security + dependency + type-safety + resilience + schema |
214
- | Frontend/React | logic + security + frontend + type-safety + ui-ux-auditor + review-animations |
215
- | Database/SQL | logic + security + sql + schema |
216
- | Mobile/Cross-platform | logic + security + mobile-reviewer + type-safety |
220
+ | Backend/API | logic + security + dependency + type-safety + resilience + schema + complexity-reviewer |
221
+ | Frontend/React | logic + security + frontend + type-safety + ui-ux-auditor + review-animations + complexity-reviewer |
222
+ | Database/SQL | logic + security + sql + schema + complexity-reviewer |
223
+ | Mobile/Cross-platform | logic + security + mobile-reviewer + type-safety + complexity-reviewer |
217
224
  | Any domain | + performance (if optimization) |
218
- | Before merge | /tribunal-full (all 19) |
225
+ | Before merge | /tribunal-full (all 20) |
219
226
 
220
227
  ---
221
228
 
@@ -399,6 +406,24 @@ Before modifying any file:
399
406
 
400
407
  ---
401
408
 
409
+ ## Fabel-5 Cognitive Boundaries (Wellbeing, Evenhandedness, Memory)
410
+
411
+ ### User Wellbeing & Safety
412
+ * **No Psychoanalysis / Diagnosis**: Reflect what is said without diagnosing or assigning psychological narratives (e.g. "you restrict because of trauma"). Suggest professional help without clinical labels.
413
+ * **Self-Harm Interruptions**: Never suggest physical substitutes (holding ice, snapping rubber bands, drawing lines) or mimic self-harm. They reinforce the self-harm loop.
414
+ * **No Over-reliance**: Do not thank the user for reaching out, encourage them to stay, or reiterate willingness to continue. Avoid conversational dependencies.
415
+ * **Positive Paths**: Acknowledge distress without reflective listening that amplifies negative spirals. Keep paths to external help open.
416
+
417
+ ### Moral & Political Evenhandedness
418
+ * **Nuance Over Brevity**: Reject requests for simple yes/no or one-word answers on contested political, ethical, or policy issues. Give a fair, balanced overview of existing positions.
419
+ * **Opposing Perspectives**: Conclude arguments for positions by presenting opposing viewpoints or empirical disputes even if the user/AI agrees with the primary view.
420
+
421
+ ### Memory & Preference Boundaries
422
+ * **Invisible Integration**: Integrate remembered user context silently without attribution or observation verbs ("I notice in your profile...", "Based on your memory...").
423
+ * **Expertise Tuning**: Match language and technical depth to the user's stated background without lecturing.
424
+
425
+ ---
426
+
402
427
  ## Quick Reference
403
428
 
404
429
  **Scripts:** `.agent/scripts/`
@@ -0,0 +1,173 @@
1
+ /**
2
+ * signal_detector.js — Tribunal Kit Signal Detector
3
+ * ====================================================
4
+ * Parses runtime log files, test logs, and build transcripts to extract
5
+ * structured "Improvement Signals" (errors, bottlenecks, gaps).
6
+ *
7
+ * Supported log sources/patterns:
8
+ * - JS/TS Node Stack Traces
9
+ * - Python Stack Traces
10
+ * - Rust Compiler Errors
11
+ * - Jest/Vitest Test Failures
12
+ * - ESLint Warnings/Errors
13
+ * - Performance measurements (e.g. "Slow query", "duration: 1200ms")
14
+ */
15
+
16
+ "use strict";
17
+
18
+ const fs = require("fs");
19
+ const path = require("path");
20
+
21
+ const SIGNAL_TYPES = {
22
+ ERROR: "log_error",
23
+ PERF: "perf_bottleneck",
24
+ GAP: "capability_gap",
25
+ };
26
+
27
+ /**
28
+ * Parses a string log and extracts list of typed signals.
29
+ * @param {string} logText
30
+ * @returns {Array<{type: string, file: string|null, line: number|null, message: string, context: string}>}
31
+ */
32
+ function detectSignals(logText) {
33
+ const signals = [];
34
+ const lines = logText.split(/\r?\n/);
35
+
36
+ // 1. Check for stack traces and syntax/runtime errors
37
+ // JS/TS stack trace line: " at Object.foo (src/utils.js:12:45)" or " at src/utils.js:12:45"
38
+ const jsStackRegex = /\bat\s+(?:async\s+)?(?:[^(]+\()?([^:()\s]+):(\d+):(\d+)\)?/;
39
+ // Python File location: ' File "src/main.py", line 12, in <module>'
40
+ const pyStackRegex = /File\s+"([^"]+)"\s*,\s*line\s*(\d+)/;
41
+ // Rust location: ' --> src/main.rs:12:34'
42
+ const rustRegex = /-->\s*([^:\s]+):(\d+):(\d+)/;
43
+ // ESLint standard line: ' /path/to/file.js:12:34: error: Message' or ' 12:34 error Message'
44
+ // But ESLint often has file heading first. So let's handle inline: 'file.js: line 12, col 34, Error - Message'
45
+ const eslintInlineRegex = /([^:\s]+):\s*line\s*(\d+)\s*,\s*col\s*\d+,\s*(?:Error|Warning)\s*-\s*(.+)/i;
46
+ // Also standard unix format: '/path/to/file.js:12:34: error message'
47
+ const unixErrorRegex = /^([^:\s\(\)]+):(\d+):(?:\d+:)?\s*(error|warning|info):?\s*(.+)/i;
48
+
49
+ // Let's also scan for performance bottlenecks
50
+ const slowQueryRegex = /slow\s+query|duration:\s*(\d+)ms|execution\s+time:\s*(\d+)ms|response\s+time\s*>\s*(\d+)ms/i;
51
+
52
+ let currentFile = null;
53
+
54
+ for (let i = 0; i < lines.length; i++) {
55
+ const line = lines[i];
56
+
57
+ // Detect Jest/Vitest file heading: "FAIL src/utils.test.js"
58
+ if (line.startsWith("FAIL ")) {
59
+ const match = line.match(/^FAIL\s+(\S+)/);
60
+ if (match) {
61
+ currentFile = match[1];
62
+ signals.push({
63
+ type: SIGNAL_TYPES.ERROR,
64
+ file: currentFile,
65
+ line: null,
66
+ message: `Test suite failed: ${path.basename(currentFile)}`,
67
+ context: lines.slice(Math.max(0, i - 1), Math.min(lines.length, i + 5)).join("\n"),
68
+ });
69
+ }
70
+ continue;
71
+ }
72
+
73
+ // JS Stack Trace Match
74
+ const jsMatch = line.match(jsStackRegex);
75
+ if (jsMatch && !line.includes("node_modules")) {
76
+ const filePath = jsMatch[1].replace(/\\/g, "/");
77
+ signals.push({
78
+ type: SIGNAL_TYPES.ERROR,
79
+ file: filePath,
80
+ line: parseInt(jsMatch[2], 10),
81
+ message: `Stack Trace Error: ${line.trim()}`,
82
+ context: lines.slice(Math.max(0, i - 2), Math.min(lines.length, i + 3)).join("\n"),
83
+ });
84
+ continue;
85
+ }
86
+
87
+ // Python Stack Trace Match
88
+ const pyMatch = line.match(pyStackRegex);
89
+ if (pyMatch) {
90
+ const filePath = pyMatch[1].replace(/\\/g, "/");
91
+ signals.push({
92
+ type: SIGNAL_TYPES.ERROR,
93
+ file: filePath,
94
+ line: parseInt(pyMatch[2], 10),
95
+ message: `Python Exception: ${lines[i+1] ? lines[i+1].trim() : line.trim()}`,
96
+ context: lines.slice(Math.max(0, i - 1), Math.min(lines.length, i + 4)).join("\n"),
97
+ });
98
+ continue;
99
+ }
100
+
101
+ // Rust Compiler Error Match
102
+ const rustMatch = line.match(rustRegex);
103
+ if (rustMatch) {
104
+ const filePath = rustMatch[1].replace(/\\/g, "/");
105
+ signals.push({
106
+ type: SIGNAL_TYPES.ERROR,
107
+ file: filePath,
108
+ line: parseInt(rustMatch[2], 10),
109
+ message: `Rust compilation failure: ${lines[Math.max(0, i - 1)].trim()}`,
110
+ context: lines.slice(Math.max(0, i - 2), Math.min(lines.length, i + 5)).join("\n"),
111
+ });
112
+ continue;
113
+ }
114
+
115
+ // ESLint Inline Match
116
+ const eslintMatch = line.match(eslintInlineRegex);
117
+ if (eslintMatch) {
118
+ signals.push({
119
+ type: SIGNAL_TYPES.ERROR,
120
+ file: eslintMatch[1].replace(/\\/g, "/"),
121
+ line: parseInt(eslintMatch[2], 10),
122
+ message: `Linter Violation: ${eslintMatch[3]}`,
123
+ context: line.trim(),
124
+ });
125
+ continue;
126
+ }
127
+
128
+ // Unix Error Format Match
129
+ const unixMatch = line.match(unixErrorRegex);
130
+ if (unixMatch && !line.includes("node_modules")) {
131
+ const filePath = unixMatch[1].replace(/\\/g, "/");
132
+ signals.push({
133
+ type: SIGNAL_TYPES.ERROR,
134
+ file: filePath,
135
+ line: parseInt(unixMatch[2], 10),
136
+ message: `${unixMatch[3].toUpperCase()}: ${unixMatch[4]}`,
137
+ context: line.trim(),
138
+ });
139
+ continue;
140
+ }
141
+
142
+ // Slow Query/Performance Match
143
+ const slowMatch = line.match(slowQueryRegex);
144
+ if (slowMatch) {
145
+ signals.push({
146
+ type: SIGNAL_TYPES.PERF,
147
+ file: currentFile || null,
148
+ line: null,
149
+ message: `Performance warning: ${line.trim()}`,
150
+ context: lines.slice(Math.max(0, i - 1), Math.min(lines.length, i + 2)).join("\n"),
151
+ });
152
+ continue;
153
+ }
154
+ }
155
+
156
+ // Deduplicate near-identical signals (same file, line, and message type)
157
+ const unique = [];
158
+ const keys = new Set();
159
+ for (const s of signals) {
160
+ const key = `${s.type}:${s.file}:${s.line}:${s.message.substring(0, 40)}`;
161
+ if (!keys.has(key)) {
162
+ keys.add(key);
163
+ unique.push(s);
164
+ }
165
+ }
166
+
167
+ return unique;
168
+ }
169
+
170
+ module.exports = {
171
+ detectSignals,
172
+ SIGNAL_TYPES,
173
+ };