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.
- package/.agent/history/architecture-graph.yaml +140 -0
- package/.agent/history/graph-cache.json +262 -0
- package/.agent/history/snapshots/bin__tribunal-kit.js.json +19 -0
- package/.agent/history/snapshots/eslint.config.js.json +9 -0
- package/.agent/history/snapshots/migrate_refs.js.json +11 -0
- package/.agent/history/snapshots/scripts__changelog.js.json +13 -0
- package/.agent/history/snapshots/scripts__sync-version.js.json +12 -0
- package/.agent/history/snapshots/scripts__validate-payload.js.json +12 -0
- package/.agent/history/snapshots/test__integration__bridges.test.js.json +14 -0
- package/.agent/history/snapshots/test__integration__init.test.js.json +14 -0
- package/.agent/history/snapshots/test__integration__routing.test.js.json +12 -0
- package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +14 -0
- package/.agent/history/snapshots/test__integration__wave2.test.js.json +14 -0
- package/.agent/history/snapshots/test__unit__args.test.js.json +20 -0
- package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__context_broker.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__copyDir.test.js.json +23 -0
- package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +12 -0
- package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +23 -0
- package/.agent/history/snapshots/test__unit__semver.test.js.json +20 -0
- package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +12 -0
- package/.agent/scripts/_colors.js +170 -18
- package/.agent/scripts/_utils.js +244 -42
- package/.agent/scripts/bundle_analyzer.js +261 -290
- package/.agent/scripts/case_law_manager.js +1 -7
- package/.agent/scripts/checklist.js +278 -266
- package/.agent/scripts/colors.js +11 -17
- package/.agent/scripts/context_broker.js +1 -7
- package/.agent/scripts/dependency_analyzer.js +234 -272
- package/.agent/scripts/graph_builder.js +46 -18
- package/.agent/scripts/graph_visualizer.js +10 -4
- package/.agent/scripts/graph_zoom.js +6 -4
- package/.agent/scripts/inner_loop_validator.js +2 -8
- package/.agent/scripts/lint_runner.js +186 -187
- package/.agent/scripts/schema_validator.js +8 -25
- package/.agent/scripts/security_scan.js +276 -303
- package/.agent/scripts/session_manager.js +1 -7
- package/.agent/scripts/skill_evolution.js +1 -8
- package/.agent/scripts/skill_integrator.js +1 -7
- package/.agent/scripts/test_runner.js +186 -193
- package/.agent/scripts/utils.js +17 -32
- package/.agent/scripts/verify_all.js +248 -257
- 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
console.log(` ${GREEN}✅ ${
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (!runCheck('
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
console.log(`\n${BOLD}━━━ Checklist Summary ━━━${RESET}`);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
+
}
|
package/.agent/scripts/colors.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* colors.js
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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.
|