tribunal-kit 4.4.1 → 4.4.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.
Files changed (44) hide show
  1. package/.agent/history/architecture-graph.yaml +140 -0
  2. package/.agent/history/graph-cache.json +262 -0
  3. package/.agent/history/snapshots/bin__tribunal-kit.js.json +19 -0
  4. package/.agent/history/snapshots/eslint.config.js.json +9 -0
  5. package/.agent/history/snapshots/migrate_refs.js.json +11 -0
  6. package/.agent/history/snapshots/scripts__changelog.js.json +13 -0
  7. package/.agent/history/snapshots/scripts__sync-version.js.json +12 -0
  8. package/.agent/history/snapshots/scripts__validate-payload.js.json +12 -0
  9. package/.agent/history/snapshots/test__integration__bridges.test.js.json +14 -0
  10. package/.agent/history/snapshots/test__integration__init.test.js.json +14 -0
  11. package/.agent/history/snapshots/test__integration__routing.test.js.json +12 -0
  12. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +14 -0
  13. package/.agent/history/snapshots/test__integration__wave2.test.js.json +14 -0
  14. package/.agent/history/snapshots/test__unit__args.test.js.json +20 -0
  15. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +11 -0
  16. package/.agent/history/snapshots/test__unit__context_broker.test.js.json +11 -0
  17. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +23 -0
  18. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +12 -0
  19. package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +11 -0
  20. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +23 -0
  21. package/.agent/history/snapshots/test__unit__semver.test.js.json +20 -0
  22. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +12 -0
  23. package/.agent/scripts/_colors.js +170 -18
  24. package/.agent/scripts/_utils.js +244 -42
  25. package/.agent/scripts/bundle_analyzer.js +261 -290
  26. package/.agent/scripts/case_law_manager.js +1 -7
  27. package/.agent/scripts/checklist.js +278 -266
  28. package/.agent/scripts/colors.js +11 -17
  29. package/.agent/scripts/context_broker.js +1 -7
  30. package/.agent/scripts/dependency_analyzer.js +234 -272
  31. package/.agent/scripts/graph_builder.js +46 -18
  32. package/.agent/scripts/graph_visualizer.js +10 -4
  33. package/.agent/scripts/graph_zoom.js +6 -4
  34. package/.agent/scripts/inner_loop_validator.js +2 -8
  35. package/.agent/scripts/lint_runner.js +186 -187
  36. package/.agent/scripts/schema_validator.js +8 -25
  37. package/.agent/scripts/security_scan.js +276 -303
  38. package/.agent/scripts/session_manager.js +1 -7
  39. package/.agent/scripts/skill_evolution.js +1 -8
  40. package/.agent/scripts/skill_integrator.js +1 -7
  41. package/.agent/scripts/test_runner.js +186 -193
  42. package/.agent/scripts/utils.js +17 -32
  43. package/.agent/scripts/verify_all.js +248 -257
  44. package/package.json +1 -1
@@ -1,266 +1,278 @@
1
- #!/usr/bin/env node
2
- /**
3
- * checklist.js — Priority-based project audit runner for the Tribunal Agent Kit.
4
- *
5
- * Runs a tiered audit sequence:
6
- * Priority 1: Security
7
- * Priority 2: Lint
8
- * Priority 3: Schema validation
9
- * Priority 4: Tests
10
- * Priority 5: UX / Accessibility
11
- * Priority 6: SEO
12
- * Priority 7: Lighthouse / E2E (requires --url)
13
- *
14
- * Usage:
15
- * node .agent/scripts/checklist.js .
16
- * node .agent/scripts/checklist.js . --url http://localhost:3000
17
- * node .agent/scripts/checklist.js . --skip security,seo
18
- */
19
-
20
- 'use strict';
21
-
22
- const fs = require('fs');
23
- const path = require('path');
24
- const { execFileSync } = require('child_process');
25
-
26
- // ━━━ ANSI color output ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
- const RED = '\x1b[91m';
28
- const GREEN = '\x1b[92m';
29
- const YELLOW = '\x1b[93m';
30
- const BLUE = '\x1b[94m';
31
- const BOLD = '\x1b[1m';
32
- const RESET = '\x1b[0m';
33
-
34
-
35
- function printHeader(title) {
36
- console.log(`\n${BOLD}${BLUE}━━━ ${title} ━━━${RESET}`);
37
- }
38
-
39
- function printOk(msg) {
40
- console.log(` ${GREEN}✅ ${msg}${RESET}`);
41
- }
42
-
43
- function printFail(msg) {
44
- console.log(` ${RED}❌ ${msg}${RESET}`);
45
- }
46
-
47
- function printSkip(msg) {
48
- console.log(` ${YELLOW}⏭️ Skipped: ${msg}${RESET}`);
49
- }
50
-
51
-
52
- /**
53
- * Run a shell command and return true if it exits with code 0.
54
- * @param {string} label - Human-readable label for the check.
55
- * @param {string[]} cmd - Command and arguments array.
56
- * @param {string} cwd - Working directory.
57
- * @returns {boolean}
58
- */
59
- function runCheck(label, cmd, cwd) {
60
- try {
61
- execFileSync(cmd[0], cmd.slice(1), {
62
- cwd,
63
- stdio: 'pipe',
64
- timeout: 60000,
65
- encoding: 'utf8',
66
- });
67
- printOk(`${label} passed`);
68
- return true;
69
- } catch (err) {
70
- if (err.code === 'ENOENT') {
71
- printSkip(`${label} — command not found (tool not installed)`);
72
- return true; // Don't block on tools that aren't installed
73
- }
74
- if (err.killed) {
75
- printFail(`${label} — timed out after 60s`);
76
- return false;
77
- }
78
- printFail(`${label} failed`);
79
- const output = (err.stdout || '') + (err.stderr || '');
80
- if (output.trim()) {
81
- console.log(` ${output.trim().slice(0, 500)}`);
82
- }
83
- return false;
84
- }
85
- }
86
-
87
-
88
- /**
89
- * Scan for hardcoded secrets in source files.
90
- * @param {string} projectRoot - Project root directory.
91
- * @returns {boolean} True if no secrets found.
92
- */
93
- function checkSecrets(projectRoot) {
94
- printHeader('Security Secret Scan');
95
- const dangerousPatterns = [
96
- 'password=', 'secret=', 'api_key=',
97
- 'apikey=', 'auth_token=', 'private_key=',
98
- ];
99
- let foundIssues = false;
100
- const sourceExtensions = new Set(['.ts', '.tsx', '.js', '.jsx', '.py', '.env']);
101
- const skipDirs = new Set(['node_modules', '.git', '.agent', 'dist', '__pycache__']);
102
-
103
- function walk(dir) {
104
- let entries;
105
- try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
106
-
107
- for (const entry of entries) {
108
- const fullPath = path.join(dir, entry.name);
109
- if (entry.isDirectory()) {
110
- if (!skipDirs.has(entry.name)) walk(fullPath);
111
- } else if (entry.isFile()) {
112
- const ext = path.extname(entry.name);
113
- if (!sourceExtensions.has(ext)) continue;
114
- if (entry.name.startsWith('.env')) continue; // .env files are allowed
115
-
116
- let content;
117
- try { content = fs.readFileSync(fullPath, 'utf8'); } catch { continue; }
118
-
119
- const lines = content.split('\n');
120
- for (let i = 0; i < lines.length; i++) {
121
- const lineLower = lines[i].toLowerCase().trim();
122
- const hasPattern = dangerousPatterns.some(p => lineLower.includes(p));
123
- if (hasPattern && lineLower.includes('=') && !lineLower.startsWith('#')) {
124
- const rel = path.relative(projectRoot, fullPath);
125
- printFail(`Possible secret: ${rel}:${i + 1} → ${lines[i].trim().slice(0, 80)}`);
126
- foundIssues = true;
127
- }
128
- }
129
- }
130
- }
131
- }
132
-
133
- walk(projectRoot);
134
-
135
- if (!foundIssues) {
136
- printOk('No hardcoded secrets detected');
137
- }
138
- return !foundIssues;
139
- }
140
-
141
-
142
- /**
143
- * Run all checklist tiers. Returns number of failures.
144
- * @param {string} projectRoot - Project root.
145
- * @param {string|null} url - URL for Lighthouse/E2E checks.
146
- * @param {string[]} skip - Tiers to skip.
147
- * @returns {number}
148
- */
149
- function runAll(projectRoot, url, skip) {
150
- let failures = 0;
151
-
152
- // Priority 1 — Security
153
- if (!skip.includes('security')) {
154
- printHeader('Priority 1 — Security');
155
- if (!checkSecrets(projectRoot)) failures++;
156
- } else {
157
- printSkip('Security tier');
158
- }
159
-
160
- // Priority 2 — Lint
161
- if (!skip.includes('lint')) {
162
- printHeader('Priority 2 Lint');
163
- if (!runCheck('ESLint', ['npx', 'eslint', '.', '--max-warnings=0'], projectRoot)) failures++;
164
- if (!runCheck('TypeScript', ['npx', 'tsc', '--noEmit'], projectRoot)) failures++;
165
- } else {
166
- printSkip('Lint tier');
167
- }
168
-
169
- // Priority 3 — Schema
170
- if (!skip.includes('schema')) {
171
- printHeader('Priority 3 Schema');
172
- printSkip('Schema check — run manually if you have DB migrations');
173
- } else {
174
- printSkip('Schema tier');
175
- }
176
-
177
- // Priority 4 — Tests
178
- if (!skip.includes('tests')) {
179
- printHeader('Priority 4 Tests');
180
- if (!runCheck('Test suite', ['npm', 'test', '--', '--passWithNoTests'], projectRoot)) failures++;
181
- } else {
182
- printSkip('Tests tier');
183
- }
184
-
185
- // Priority 5 — UX
186
- if (!skip.includes('ux')) {
187
- printHeader('Priority 5 UX / Accessibility');
188
- printSkip('UX audit — run /preview start then check manually or with Lighthouse');
189
- } else {
190
- printSkip('UX tier');
191
- }
192
-
193
- // Priority 6 — SEO
194
- if (!skip.includes('seo')) {
195
- printHeader('Priority 6 SEO');
196
- printSkip('SEO check — use /ui-ux-pro-max for SEO-sensitive pages');
197
- } else {
198
- printSkip('SEO tier');
199
- }
200
-
201
- // Priority 7 Lighthouse / E2E
202
- if (url && !skip.includes('e2e')) {
203
- printHeader('Priority 7 Lighthouse / E2E');
204
- if (!runCheck('Playwright E2E', ['npx', 'playwright', 'test'], projectRoot)) failures++;
205
- } else if (!url) {
206
- printSkip('E2E / Lighthouse — pass --url to enable');
207
- }
208
-
209
- // ━━━ Summary ━━━
210
- console.log(`\n${BOLD}━━━ Checklist Summary ━━━${RESET}`);
211
- if (failures === 0) {
212
- printOk('All checks passed — ready to proceed');
213
- } else {
214
- printFail(`${failures} tier(s) failed fix Critical issues before proceeding`);
215
- }
216
-
217
- return failures;
218
- }
219
-
220
-
221
- /**
222
- * Parse CLI arguments manually (no external dependencies).
223
- */
224
- function parseArgs(argv) {
225
- const args = { path: null, url: null, skip: [] };
226
- const raw = argv.slice(2);
227
-
228
- for (let i = 0; i < raw.length; i++) {
229
- if (raw[i] === '--url' && raw[i + 1]) {
230
- args.url = raw[++i];
231
- } else if (raw[i] === '--skip' && raw[i + 1]) {
232
- args.skip = raw[++i].split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
233
- } else if (!raw[i].startsWith('--') && !args.path) {
234
- args.path = raw[i];
235
- }
236
- }
237
- return args;
238
- }
239
-
240
-
241
- function main() {
242
- const args = parseArgs(process.argv);
243
-
244
- if (!args.path) {
245
- console.error(`Usage: node checklist.js <path> [--url <url>] [--skip security,lint,schema,tests,ux,seo,e2e]`);
246
- process.exit(1);
247
- }
248
-
249
- const projectRoot = path.resolve(args.path);
250
- if (!fs.existsSync(projectRoot) || !fs.statSync(projectRoot).isDirectory()) {
251
- printFail(`Directory not found: ${projectRoot}`);
252
- process.exit(1);
253
- }
254
-
255
- console.log(`${BOLD}Tribunal Checklist — ${projectRoot}${RESET}`);
256
- const failures = runAll(projectRoot, args.url, args.skip);
257
- process.exit(failures > 0 ? 1 : 0);
258
- }
259
-
260
-
261
- // ━━━ Exports for testing & programmatic use ━━━
262
- module.exports = { runCheck, checkSecrets, runAll };
263
-
264
- if (require.main === module) {
265
- main();
266
- }
1
+ #!/usr/bin/env node
2
+ /**
3
+ * checklist.js — Priority-based project audit runner for the Tribunal Agent Kit.
4
+ *
5
+ * Runs a tiered audit sequence:
6
+ * Priority 1: Security
7
+ * Priority 2: Lint
8
+ * Priority 3: Schema validation
9
+ * Priority 4: Tests
10
+ * Priority 5: UX / Accessibility
11
+ * Priority 6: SEO
12
+ * Priority 7: Lighthouse / E2E (requires --url)
13
+ *
14
+ * Usage:
15
+ * node .agent/scripts/checklist.js .
16
+ * node .agent/scripts/checklist.js . --url http://localhost:3000
17
+ * node .agent/scripts/checklist.js . --skip security,seo
18
+ */
19
+
20
+ 'use strict';
21
+
22
+ const fs = require('fs');
23
+ const path = require('path');
24
+ const { execFileSync } = require('child_process');
25
+
26
+ const {
27
+ RED, GREEN, YELLOW, BLUE, BOLD, DIM, CYAN, RESET,
28
+ banner, sectionHeader, summaryTable, timer, formatMs,
29
+ ok, fail, skip,
30
+ } = require('./_colors');
31
+
32
+ const { walkDir } = require('./_utils');
33
+
34
+ // ── Results Tracking ────────────────────────────────────────────────────────
35
+
36
+ const RESULTS = [];
37
+
38
+ function trackOk(label, ms) {
39
+ const timing = ms != null ? `${DIM}(${formatMs(ms)})${RESET}` : '';
40
+ console.log(` ${GREEN}✅ ${label}${RESET} ${timing}`);
41
+ RESULTS.push({ name: label, status: 'pass', ms });
42
+ }
43
+
44
+ function trackFail(label, ms, note) {
45
+ const timing = ms != null ? `${DIM}(${formatMs(ms)})${RESET}` : '';
46
+ console.log(` ${RED}❌ ${label}${RESET} ${timing}`);
47
+ if (note) console.log(` ${note.slice(0, 500)}`);
48
+ RESULTS.push({ name: label, status: 'fail', ms });
49
+ }
50
+
51
+ function trackSkip(label, reason) {
52
+ console.log(` ${YELLOW}⏭️ ${label} — ${reason}${RESET}`);
53
+ RESULTS.push({ name: label, status: 'skip' });
54
+ }
55
+
56
+
57
+ /**
58
+ * Run a shell command and return true if it exits with code 0.
59
+ * @param {string} label - Human-readable label for the check.
60
+ * @param {string[]} cmd - Command and arguments array.
61
+ * @param {string} cwd - Working directory.
62
+ * @returns {boolean}
63
+ */
64
+ function runCheck(label, cmd, cwd) {
65
+ const elapsed = timer();
66
+ try {
67
+ execFileSync(cmd[0], cmd.slice(1), {
68
+ cwd,
69
+ stdio: 'pipe',
70
+ timeout: 60000,
71
+ encoding: 'utf8',
72
+ shell: process.platform === 'win32',
73
+ });
74
+ trackOk(`${label} passed`, elapsed());
75
+ return true;
76
+ } catch (err) {
77
+ const ms = elapsed();
78
+ if (err.code === 'ENOENT') {
79
+ trackSkip(label, 'command not found (tool not installed)');
80
+ return true; // Don't block on tools that aren't installed
81
+ }
82
+ if (err.killed) {
83
+ trackFail(label, ms, 'timed out after 60s');
84
+ return false;
85
+ }
86
+ const output = ((err.stdout || '') + (err.stderr || '')).trim();
87
+ trackFail(`${label} failed`, ms, output || 'non-zero exit code');
88
+ return false;
89
+ }
90
+ }
91
+
92
+
93
+ /**
94
+ * Scan for hardcoded secrets in source files.
95
+ * Uses shared walkDir from _utils.js.
96
+ * @param {string} projectRoot - Project root directory.
97
+ * @returns {boolean} True if no secrets found.
98
+ */
99
+ function checkSecrets(projectRoot) {
100
+ const elapsed = timer();
101
+ const dangerousPatterns = [
102
+ 'password=', 'secret=', 'api_key=',
103
+ 'apikey=', 'auth_token=', 'private_key=',
104
+ ];
105
+ let foundIssues = false;
106
+ const sourceExtensions = new Set(['.ts', '.tsx', '.js', '.jsx', '.py']);
107
+
108
+ const files = walkDir(projectRoot, { extensions: sourceExtensions });
109
+
110
+ for (const fullPath of files) {
111
+ // Skip .env files — they are allowed to contain secrets
112
+ if (path.basename(fullPath).startsWith('.env')) continue;
113
+
114
+ let content;
115
+ try { content = fs.readFileSync(fullPath, 'utf8'); } catch { continue; }
116
+
117
+ const lines = content.split('\n');
118
+ for (let i = 0; i < lines.length; i++) {
119
+ const lineLower = lines[i].toLowerCase().trim();
120
+ const hasPattern = dangerousPatterns.some(p => lineLower.includes(p));
121
+ if (hasPattern && lineLower.includes('=') && !lineLower.startsWith('#')) {
122
+ const rel = path.relative(projectRoot, fullPath);
123
+ fail(`Possible secret: ${rel}:${i + 1} → ${lines[i].trim().slice(0, 80)}`);
124
+ foundIssues = true;
125
+ }
126
+ }
127
+ }
128
+
129
+ const ms = elapsed();
130
+ if (!foundIssues) {
131
+ trackOk(`Secret scan — ${files.length} files clean`, ms);
132
+ } else {
133
+ trackFail('Secret scan — hardcoded credentials detected', ms);
134
+ }
135
+ return !foundIssues;
136
+ }
137
+
138
+
139
+ /**
140
+ * Run all checklist tiers. Returns number of failures.
141
+ * @param {string} projectRoot - Project root.
142
+ * @param {string|null} url - URL for Lighthouse/E2E checks.
143
+ * @param {string[]} skipTiers - Tiers to skip.
144
+ * @returns {number}
145
+ */
146
+ function runAll(projectRoot, url, skipTiers) {
147
+ let failures = 0;
148
+ RESULTS.length = 0;
149
+ const totalTimer = timer();
150
+
151
+ // Priority 1 — Security
152
+ if (!skipTiers.includes('security')) {
153
+ console.log(sectionHeader('Security — Secret Scan', 1));
154
+ if (!checkSecrets(projectRoot)) failures++;
155
+ } else {
156
+ trackSkip('Security', 'skipped by flag');
157
+ }
158
+
159
+ // Priority 2 — Lint
160
+ if (!skipTiers.includes('lint')) {
161
+ console.log(sectionHeader('Lint', 2));
162
+ if (!runCheck('ESLint', ['npx', 'eslint', '.', '--max-warnings=0'], projectRoot)) failures++;
163
+ if (!runCheck('TypeScript', ['npx', 'tsc', '--noEmit'], projectRoot)) failures++;
164
+ } else {
165
+ trackSkip('Lint', 'skipped by flag');
166
+ }
167
+
168
+ // Priority 3 — Schema
169
+ if (!skipTiers.includes('schema')) {
170
+ console.log(sectionHeader('Schema Validation', 3));
171
+ trackSkip('Schema', 'run manually if you have DB migrations');
172
+ } else {
173
+ trackSkip('Schema', 'skipped by flag');
174
+ }
175
+
176
+ // Priority 4 — Tests
177
+ if (!skipTiers.includes('tests')) {
178
+ console.log(sectionHeader('Tests', 4));
179
+ if (!runCheck('Test suite', ['npm', 'test', '--', '--passWithNoTests'], projectRoot)) failures++;
180
+ } else {
181
+ trackSkip('Tests', 'skipped by flag');
182
+ }
183
+
184
+ // Priority 5 — UX
185
+ if (!skipTiers.includes('ux')) {
186
+ console.log(sectionHeader('UX / Accessibility', 5));
187
+ trackSkip('UX audit', 'run /preview start then check with Lighthouse');
188
+ } else {
189
+ trackSkip('UX', 'skipped by flag');
190
+ }
191
+
192
+ // Priority 6 — SEO
193
+ if (!skipTiers.includes('seo')) {
194
+ console.log(sectionHeader('SEO', 6));
195
+ trackSkip('SEO check', 'use /ui-ux-pro-max for SEO-sensitive pages');
196
+ } else {
197
+ trackSkip('SEO', 'skipped by flag');
198
+ }
199
+
200
+ // Priority 7 — Lighthouse / E2E
201
+ if (url && !skipTiers.includes('e2e')) {
202
+ console.log(sectionHeader('Lighthouse / E2E', 7));
203
+ if (!runCheck('Playwright E2E', ['npx', 'playwright', 'test'], projectRoot)) failures++;
204
+ } else if (!url) {
205
+ trackSkip('E2E / Lighthouse', 'pass --url to enable');
206
+ }
207
+
208
+ // ━━━ Summary ━━━
209
+ const totalMs = totalTimer();
210
+ console.log(`\n${BOLD}${CYAN}━━━ Checklist Summary ━━━${RESET}`);
211
+ summaryTable(RESULTS);
212
+
213
+ const passCount = RESULTS.filter(r => r.status === 'pass').length;
214
+ const failCount = RESULTS.filter(r => r.status === 'fail').length;
215
+ const skipCount = RESULTS.filter(r => r.status === 'skip').length;
216
+
217
+ console.log(`\n ${DIM}Total: ${RESULTS.length} checks in ${formatMs(totalMs)}${RESET}`);
218
+ console.log(` ${GREEN}${passCount} passed${RESET} ${failCount > 0 ? `${RED}${failCount} failed${RESET} ` : ''}${skipCount > 0 ? `${YELLOW}${skipCount} skipped${RESET}` : ''}`);
219
+
220
+ console.log();
221
+ if (failures === 0) {
222
+ console.log(`${GREEN}${BOLD} ✔ All checks passed ready to proceed.${RESET}`);
223
+ } else {
224
+ console.log(`${RED}${BOLD} ✖ ${failures} tier(s) failed — fix critical issues before proceeding.${RESET}`);
225
+ }
226
+ console.log();
227
+
228
+ return failures;
229
+ }
230
+
231
+
232
+ /**
233
+ * Parse CLI arguments manually (no external dependencies).
234
+ */
235
+ function parseArgs(argv) {
236
+ const args = { path: null, url: null, skip: [] };
237
+ const raw = argv.slice(2);
238
+
239
+ for (let i = 0; i < raw.length; i++) {
240
+ if (raw[i] === '--url' && raw[i + 1]) {
241
+ args.url = raw[++i];
242
+ } else if (raw[i] === '--skip' && raw[i + 1]) {
243
+ args.skip = raw[++i].split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
244
+ } else if (!raw[i].startsWith('--') && !args.path) {
245
+ args.path = raw[i];
246
+ }
247
+ }
248
+ return args;
249
+ }
250
+
251
+
252
+ function main() {
253
+ const args = parseArgs(process.argv);
254
+
255
+ if (!args.path) {
256
+ console.error(`Usage: node checklist.js <path> [--url <url>] [--skip security,lint,schema,tests,ux,seo,e2e]`);
257
+ process.exit(1);
258
+ }
259
+
260
+ const projectRoot = path.resolve(args.path);
261
+ if (!fs.existsSync(projectRoot) || !fs.statSync(projectRoot).isDirectory()) {
262
+ fail(`Directory not found: ${projectRoot}`);
263
+ process.exit(1);
264
+ }
265
+
266
+ console.log(banner('checklist.js', { Project: projectRoot }));
267
+
268
+ const failures = runAll(projectRoot, args.url, args.skip);
269
+ process.exit(failures > 0 ? 1 : 0);
270
+ }
271
+
272
+
273
+ // ━━━ Exports for testing & programmatic use ━━━
274
+ module.exports = { runCheck, checkSecrets, runAll };
275
+
276
+ if (require.main === module) {
277
+ main();
278
+ }
@@ -1,17 +1,11 @@
1
- /**
2
- * colors.js
3
- * Shared ANSI color constants for Tribunal Kit Node scripts.
4
- */
5
- 'use strict';
6
-
7
- module.exports = {
8
- GREEN: "\x1b[92m",
9
- YELLOW: "\x1b[93m",
10
- CYAN: "\x1b[96m",
11
- RED: "\x1b[91m",
12
- BLUE: "\x1b[94m",
13
- MAGENTA: "\x1b[95m",
14
- BOLD: "\x1b[1m",
15
- DIM: "\x1b[2m",
16
- RESET: "\x1b[0m"
17
- };
1
+ /**
2
+ * colors.js — Backward-compatible re-export of _colors.js
3
+ * ════════════════════════════════════════════════════════
4
+ * All color constants and helpers are defined in _colors.js.
5
+ * This file re-exports them for scripts that import from './colors.js'.
6
+ *
7
+ * New scripts should import from './_colors' directly.
8
+ */
9
+ 'use strict';
10
+
11
+ module.exports = require('./_colors');
@@ -51,13 +51,7 @@ const fs = require('fs');
51
51
  const path = require('path');
52
52
 
53
53
  // ── Colours ───────────────────────────────────────────────────────────────────
54
- const GREEN = '\x1b[92m';
55
- const YELLOW = '\x1b[93m';
56
- const CYAN = '\x1b[96m';
57
- const RED = '\x1b[91m';
58
- const BOLD = '\x1b[1m';
59
- const DIM = '\x1b[2m';
60
- const RESET = '\x1b[0m';
54
+ const { GREEN, YELLOW, CYAN, RED, BOLD, DIM, RESET } = require('./_colors');
61
55
 
62
56
  // ── Domain → Skill affinity map ───────────────────────────────────────────────
63
57
  // Keywords in the user's task that strongly indicate specific skills.