tribunal-kit 4.4.1 โ 4.4.3
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/marathon_harness.js +799 -0
- package/.agent/scripts/prompt_compiler.js +56 -0
- 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/.agent/skills/agent-organizer/SKILL.md +42 -0
- package/.agent/skills/agentic-patterns/SKILL.md +42 -0
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +42 -0
- package/.agent/skills/api-patterns/SKILL.md +42 -0
- package/.agent/skills/api-security-auditor/SKILL.md +42 -0
- package/.agent/skills/app-builder/SKILL.md +42 -0
- package/.agent/skills/appflow-wireframe/SKILL.md +42 -0
- package/.agent/skills/architecture/SKILL.md +42 -0
- package/.agent/skills/authentication-best-practices/SKILL.md +42 -0
- package/.agent/skills/backend-security-expert/SKILL.md +122 -0
- package/.agent/skills/bash-linux/SKILL.md +42 -0
- package/.agent/skills/behavioral-modes/SKILL.md +42 -0
- package/.agent/skills/brainstorming/SKILL.md +42 -0
- package/.agent/skills/building-native-ui/SKILL.md +42 -0
- package/.agent/skills/clean-code/SKILL.md +42 -0
- package/.agent/skills/code-review-checklist/SKILL.md +42 -0
- package/.agent/skills/config-validator/SKILL.md +42 -0
- package/.agent/skills/csharp-developer/SKILL.md +42 -0
- package/.agent/skills/data-validation-schemas/SKILL.md +42 -0
- package/.agent/skills/database-design/SKILL.md +42 -0
- package/.agent/skills/deployment-procedures/SKILL.md +42 -0
- package/.agent/skills/devops-engineer/SKILL.md +42 -0
- package/.agent/skills/devops-incident-responder/SKILL.md +42 -0
- package/.agent/skills/documentation-templates/SKILL.md +42 -0
- package/.agent/skills/edge-computing/SKILL.md +42 -0
- package/.agent/skills/error-resilience/SKILL.md +42 -0
- package/.agent/skills/extract-design-system/SKILL.md +42 -0
- package/.agent/skills/framer-motion-expert/SKILL.md +42 -0
- package/.agent/skills/frontend-design/SKILL.md +42 -0
- package/.agent/skills/frontend-security-expert/SKILL.md +123 -0
- package/.agent/skills/game-design-expert/SKILL.md +42 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +42 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +42 -0
- package/.agent/skills/github-operations/SKILL.md +42 -0
- package/.agent/skills/gsap-core/SKILL.md +42 -0
- package/.agent/skills/gsap-frameworks/SKILL.md +42 -0
- package/.agent/skills/gsap-performance/SKILL.md +42 -0
- package/.agent/skills/gsap-plugins/SKILL.md +42 -0
- package/.agent/skills/gsap-react/SKILL.md +42 -0
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +42 -0
- package/.agent/skills/gsap-timeline/SKILL.md +42 -0
- package/.agent/skills/gsap-utils/SKILL.md +42 -0
- package/.agent/skills/i18n-localization/SKILL.md +42 -0
- package/.agent/skills/intelligent-routing/SKILL.md +42 -0
- package/.agent/skills/knowledge-graph/SKILL.md +42 -0
- package/.agent/skills/lint-and-validate/SKILL.md +42 -0
- package/.agent/skills/llm-engineering/SKILL.md +42 -0
- package/.agent/skills/local-first/SKILL.md +42 -0
- package/.agent/skills/mcp-builder/SKILL.md +42 -0
- package/.agent/skills/mobile-design/SKILL.md +42 -0
- package/.agent/skills/monorepo-management/SKILL.md +42 -0
- package/.agent/skills/motion-engineering/SKILL.md +42 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +42 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +42 -0
- package/.agent/skills/observability/SKILL.md +42 -0
- package/.agent/skills/parallel-agents/SKILL.md +42 -0
- package/.agent/skills/performance-profiling/SKILL.md +42 -0
- package/.agent/skills/plan-writing/SKILL.md +42 -0
- package/.agent/skills/platform-engineer/SKILL.md +42 -0
- package/.agent/skills/playwright-best-practices/SKILL.md +42 -0
- package/.agent/skills/powershell-windows/SKILL.md +42 -0
- package/.agent/skills/project-idioms/SKILL.md +42 -0
- package/.agent/skills/python-patterns/SKILL.md +42 -0
- package/.agent/skills/python-pro/SKILL.md +42 -0
- package/.agent/skills/react-specialist/SKILL.md +42 -0
- package/.agent/skills/readme-builder/SKILL.md +42 -0
- package/.agent/skills/realtime-patterns/SKILL.md +42 -0
- package/.agent/skills/red-team-tactics/SKILL.md +42 -0
- package/.agent/skills/rust-pro/SKILL.md +42 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +42 -0
- package/.agent/skills/server-management/SKILL.md +42 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +42 -0
- package/.agent/skills/skill-creator/SKILL.md +42 -0
- package/.agent/skills/sql-pro/SKILL.md +42 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +42 -0
- package/.agent/skills/swiftui-expert/SKILL.md +42 -0
- package/.agent/skills/systematic-debugging/SKILL.md +42 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +42 -0
- package/.agent/skills/tdd-workflow/SKILL.md +42 -0
- package/.agent/skills/test-result-analyzer/SKILL.md +42 -0
- package/.agent/skills/testing-patterns/SKILL.md +42 -0
- package/.agent/skills/trend-researcher/SKILL.md +42 -0
- package/.agent/skills/typescript-advanced/SKILL.md +42 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +42 -0
- package/.agent/skills/ui-ux-researcher/SKILL.md +42 -0
- package/.agent/skills/vue-expert/SKILL.md +42 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +42 -0
- package/.agent/skills/web-accessibility-auditor/SKILL.md +42 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +42 -0
- package/.agent/skills/webapp-testing/SKILL.md +42 -0
- package/.agent/skills/whimsy-injector/SKILL.md +42 -0
- package/.agent/skills/workflow-optimizer/SKILL.md +42 -0
- package/.agent/workflows/marathon.md +247 -0
- package/.agent/workflows/super-prompt.md +27 -0
- package/bin/tribunal-kit.js +47 -1
- package/package.json +3 -2
|
@@ -1,257 +1,248 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* verify_all.js โ Full pre-deploy validation suite for the Tribunal Agent Kit.
|
|
4
|
-
*
|
|
5
|
-
* Runs comprehensive checks before any production deployment.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* node .agent/scripts/verify_all.js
|
|
9
|
-
* node .agent/scripts/verify_all.js --skip build,deps
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
const fs = require('fs');
|
|
15
|
-
const path = require('path');
|
|
16
|
-
const { execFileSync } = require('child_process');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const noteStr = note ? `\n ${note}` : '';
|
|
40
|
-
console.log(` ${RED}โ ${label}${RESET}${noteStr}`);
|
|
41
|
-
RESULTS.push({ label,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
console.log(` ${YELLOW}โญ๏ธ ${label} โ ${reason}${RESET}`);
|
|
46
|
-
RESULTS.push({ label,
|
|
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
|
-
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
// โโโ Exports for testing & programmatic use โโโ
|
|
253
|
-
module.exports = { verifyAll, scanSecrets, hasNpm };
|
|
254
|
-
|
|
255
|
-
if (require.main === module) {
|
|
256
|
-
main();
|
|
257
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* verify_all.js โ Full pre-deploy validation suite for the Tribunal Agent Kit.
|
|
4
|
+
*
|
|
5
|
+
* Runs comprehensive checks before any production deployment.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node .agent/scripts/verify_all.js
|
|
9
|
+
* node .agent/scripts/verify_all.js --skip build,deps
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const { execFileSync } = require('child_process');
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
RED, GREEN, YELLOW, BLUE, BOLD, DIM, CYAN, RESET,
|
|
20
|
+
banner, sectionHeader, summaryTable, timer, formatMs,
|
|
21
|
+
ok, fail, skip,
|
|
22
|
+
} = require('./_colors');
|
|
23
|
+
|
|
24
|
+
const { walkDir, hasNpm, SOURCE_EXTENSIONS } = require('./_utils');
|
|
25
|
+
|
|
26
|
+
// โโ Results Tracking โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
27
|
+
|
|
28
|
+
const RESULTS = [];
|
|
29
|
+
|
|
30
|
+
function trackOk(label, ms, note) {
|
|
31
|
+
const timing = ms != null ? `${DIM}(${formatMs(ms)})${RESET}` : '';
|
|
32
|
+
const noteStr = note ? ` ${DIM}${note}${RESET}` : '';
|
|
33
|
+
console.log(` ${GREEN}โ
${label}${RESET} ${timing}${noteStr}`);
|
|
34
|
+
RESULTS.push({ name: label, status: 'pass', ms, note: note || '' });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function trackFail(label, ms, note) {
|
|
38
|
+
const timing = ms != null ? `${DIM}(${formatMs(ms)})${RESET}` : '';
|
|
39
|
+
const noteStr = note ? `\n ${note}` : '';
|
|
40
|
+
console.log(` ${RED}โ ${label}${RESET} ${timing}${noteStr}`);
|
|
41
|
+
RESULTS.push({ name: label, status: 'fail', ms, note: note || '' });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function trackSkip(label, reason) {
|
|
45
|
+
console.log(` ${YELLOW}โญ๏ธ ${label} โ ${reason}${RESET}`);
|
|
46
|
+
RESULTS.push({ name: label, status: 'skip', note: `skipped: ${reason}` });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// โโ Command Runner โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Run a shell command and return true if it exits with code 0.
|
|
53
|
+
*/
|
|
54
|
+
function run(label, cmd, cwd) {
|
|
55
|
+
const elapsed = timer();
|
|
56
|
+
try {
|
|
57
|
+
const isWindows = process.platform === 'win32';
|
|
58
|
+
|
|
59
|
+
execFileSync(cmd[0], cmd.slice(1), {
|
|
60
|
+
cwd,
|
|
61
|
+
stdio: 'pipe',
|
|
62
|
+
timeout: 120000,
|
|
63
|
+
encoding: 'utf8',
|
|
64
|
+
shell: isWindows
|
|
65
|
+
});
|
|
66
|
+
trackOk(label, elapsed());
|
|
67
|
+
return true;
|
|
68
|
+
} catch (err) {
|
|
69
|
+
const ms = elapsed();
|
|
70
|
+
if (err.code === 'ENOENT') {
|
|
71
|
+
trackSkip(label, 'tool not installed โ skipping');
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (err.killed) {
|
|
75
|
+
trackFail(label, ms, 'timed out after 120s');
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const output = ((err.stdout || '') + (err.stderr || '')).trim();
|
|
79
|
+
trackFail(label, ms, output ? output.slice(0, 500) : 'non-zero exit code');
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Scan source files for obviously hardcoded credentials.
|
|
87
|
+
* Uses shared walkDir from _utils.js to eliminate duplicated walker code.
|
|
88
|
+
*/
|
|
89
|
+
function scanSecrets(cwd) {
|
|
90
|
+
const elapsed = timer();
|
|
91
|
+
const patterns = ['password=', 'secret=', 'api_key=', 'private_key=', 'auth_token='];
|
|
92
|
+
const found = [];
|
|
93
|
+
|
|
94
|
+
const sourceExtensions = new Set(['.ts', '.tsx', '.js', '.jsx', '.py']);
|
|
95
|
+
const files = walkDir(cwd, { extensions: sourceExtensions });
|
|
96
|
+
|
|
97
|
+
for (const fullPath of files) {
|
|
98
|
+
let content;
|
|
99
|
+
try { content = fs.readFileSync(fullPath, 'utf8'); } catch { continue; }
|
|
100
|
+
|
|
101
|
+
const lines = content.split('\n');
|
|
102
|
+
for (let i = 0; i < lines.length; i++) {
|
|
103
|
+
const low = lines[i].toLowerCase().trim();
|
|
104
|
+
const hasPattern = patterns.some(p => low.includes(p));
|
|
105
|
+
if (hasPattern && !low.startsWith('#') && low.includes('=')) {
|
|
106
|
+
const rel = path.relative(cwd, fullPath);
|
|
107
|
+
found.push(`${rel}:${i + 1}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const ms = elapsed();
|
|
113
|
+
if (found.length > 0) {
|
|
114
|
+
trackFail('Secret scan', ms, found.slice(0, 5).join('\n '));
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
trackOk('Secret scan โ no hardcoded credentials found', ms, `${files.length} files scanned`);
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Run all verification checks. Returns number of failures.
|
|
124
|
+
*/
|
|
125
|
+
function verifyAll(cwd, skipped) {
|
|
126
|
+
let failures = 0;
|
|
127
|
+
RESULTS.length = 0; // Reset for clean runs (prevents accumulation in tests)
|
|
128
|
+
const totalTimer = timer();
|
|
129
|
+
|
|
130
|
+
console.log(sectionHeader('Secret Scan', 1));
|
|
131
|
+
if (!skipped.includes('secrets')) {
|
|
132
|
+
if (!scanSecrets(cwd)) failures++;
|
|
133
|
+
} else {
|
|
134
|
+
trackSkip('Secret scan', 'skipped by flag');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
console.log(sectionHeader('TypeScript', 2));
|
|
138
|
+
if (!skipped.includes('typescript')) {
|
|
139
|
+
if (hasNpm(cwd)) {
|
|
140
|
+
if (!run('tsc --noEmit', ['npx', 'tsc', '--noEmit'], cwd)) failures++;
|
|
141
|
+
} else {
|
|
142
|
+
trackSkip('TypeScript', 'no package.json found in project');
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
trackSkip('TypeScript', 'skipped by flag');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
console.log(sectionHeader('ESLint', 3));
|
|
149
|
+
if (!skipped.includes('lint')) {
|
|
150
|
+
if (hasNpm(cwd)) {
|
|
151
|
+
if (!run('ESLint', ['npx', 'eslint', '.', '--max-warnings=0'], cwd)) failures++;
|
|
152
|
+
} else {
|
|
153
|
+
trackSkip('ESLint', 'no package.json found in project');
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
trackSkip('ESLint', 'skipped by flag');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
console.log(sectionHeader('Unit Tests', 4));
|
|
160
|
+
if (!skipped.includes('tests')) {
|
|
161
|
+
if (hasNpm(cwd)) {
|
|
162
|
+
if (!run('Test suite', ['npm', 'test', '--', '--passWithNoTests'], cwd)) failures++;
|
|
163
|
+
} else {
|
|
164
|
+
trackSkip('Tests', 'no package.json found in project');
|
|
165
|
+
}
|
|
166
|
+
} else {
|
|
167
|
+
trackSkip('Tests', 'skipped by flag');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
console.log(sectionHeader('Build', 5));
|
|
171
|
+
if (!skipped.includes('build')) {
|
|
172
|
+
if (hasNpm(cwd)) {
|
|
173
|
+
if (!run('npm run build', ['npm', 'run', 'build'], cwd)) failures++;
|
|
174
|
+
} else {
|
|
175
|
+
trackSkip('Build', 'no package.json found in project');
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
trackSkip('Build', 'skipped by flag');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
console.log(sectionHeader('Dependency Audit', 6));
|
|
182
|
+
if (!skipped.includes('deps')) {
|
|
183
|
+
if (hasNpm(cwd)) {
|
|
184
|
+
if (!run('npm audit', ['npm', 'audit', '--audit-level=high'], cwd)) failures++;
|
|
185
|
+
} else {
|
|
186
|
+
trackSkip('Dependency audit', 'no package.json found in project');
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
trackSkip('Dependency audit', 'skipped by flag');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// โโโ Summary Table โโโ
|
|
193
|
+
const totalMs = totalTimer();
|
|
194
|
+
console.log(`\n${BOLD}${CYAN}โโโ Verification Summary โโโ${RESET}`);
|
|
195
|
+
summaryTable(RESULTS);
|
|
196
|
+
|
|
197
|
+
const passCount = RESULTS.filter(r => r.status === 'pass').length;
|
|
198
|
+
const failCount = RESULTS.filter(r => r.status === 'fail').length;
|
|
199
|
+
const skipCount = RESULTS.filter(r => r.status === 'skip').length;
|
|
200
|
+
|
|
201
|
+
console.log(`\n ${DIM}Total: ${RESULTS.length} checks in ${formatMs(totalMs)}${RESET}`);
|
|
202
|
+
console.log(` ${GREEN}${passCount} passed${RESET} ${failCount > 0 ? `${RED}${failCount} failed${RESET} ` : ''}${skipCount > 0 ? `${YELLOW}${skipCount} skipped${RESET}` : ''}`);
|
|
203
|
+
|
|
204
|
+
console.log();
|
|
205
|
+
if (failures === 0) {
|
|
206
|
+
console.log(`${GREEN}${BOLD} โ All checks passed โ safe to deploy.${RESET}`);
|
|
207
|
+
} else {
|
|
208
|
+
console.log(`${RED}${BOLD} โ ${failures} check(s) failed โ fix before deploying.${RESET}`);
|
|
209
|
+
}
|
|
210
|
+
console.log();
|
|
211
|
+
|
|
212
|
+
return failures;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Parse CLI arguments manually (no external dependencies).
|
|
218
|
+
*/
|
|
219
|
+
function parseArgs(argv) {
|
|
220
|
+
const args = { skip: [] };
|
|
221
|
+
const raw = argv.slice(2);
|
|
222
|
+
|
|
223
|
+
for (let i = 0; i < raw.length; i++) {
|
|
224
|
+
if (raw[i] === '--skip' && raw[i + 1]) {
|
|
225
|
+
args.skip = raw[++i].split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return args;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
function main() {
|
|
233
|
+
const args = parseArgs(process.argv);
|
|
234
|
+
const cwd = process.cwd();
|
|
235
|
+
|
|
236
|
+
console.log(banner('verify_all.js', { Project: cwd }));
|
|
237
|
+
|
|
238
|
+
const failures = verifyAll(cwd, args.skip);
|
|
239
|
+
process.exit(failures > 0 ? 1 : 0);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
// โโโ Exports for testing & programmatic use โโโ
|
|
244
|
+
module.exports = { verifyAll, scanSecrets, hasNpm };
|
|
245
|
+
|
|
246
|
+
if (require.main === module) {
|
|
247
|
+
main();
|
|
248
|
+
}
|
|
@@ -148,3 +148,45 @@ Review these questions before confirming output:
|
|
|
148
148
|
|
|
149
149
|
## VBC Protocol (Verification-Before-Completion)
|
|
150
150
|
You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## ๐ค LLM-Specific Traps
|
|
156
|
+
|
|
157
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
158
|
+
|
|
159
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
160
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
161
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
162
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
163
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
168
|
+
|
|
169
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
170
|
+
**Active reviewers: `logic-reviewer` ยท `security-auditor`**
|
|
171
|
+
|
|
172
|
+
### โ Forbidden AI Tropes
|
|
173
|
+
|
|
174
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
175
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
176
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
177
|
+
|
|
178
|
+
### โ
Pre-Flight Self-Audit
|
|
179
|
+
|
|
180
|
+
Review these questions before confirming output:
|
|
181
|
+
```
|
|
182
|
+
โ
Did I rely ONLY on real, verified tools and methods?
|
|
183
|
+
โ
Is this solution appropriately scoped to the user's constraints?
|
|
184
|
+
โ
Did I handle potential failure modes and edge cases?
|
|
185
|
+
โ
Have I avoided generic boilerplate that doesn't add value?
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### ๐ Verification-Before-Completion (VBC) Protocol
|
|
189
|
+
|
|
190
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
191
|
+
- โ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
192
|
+
- โ
**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.
|
|
@@ -313,3 +313,45 @@ Review these questions before confirming output:
|
|
|
313
313
|
|
|
314
314
|
## VBC Protocol (Verification-Before-Completion)
|
|
315
315
|
You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## ๐ค LLM-Specific Traps
|
|
321
|
+
|
|
322
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
323
|
+
|
|
324
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
325
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
326
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
327
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
328
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
333
|
+
|
|
334
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
335
|
+
**Active reviewers: `logic-reviewer` ยท `security-auditor`**
|
|
336
|
+
|
|
337
|
+
### โ Forbidden AI Tropes
|
|
338
|
+
|
|
339
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
340
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
341
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
342
|
+
|
|
343
|
+
### โ
Pre-Flight Self-Audit
|
|
344
|
+
|
|
345
|
+
Review these questions before confirming output:
|
|
346
|
+
```
|
|
347
|
+
โ
Did I rely ONLY on real, verified tools and methods?
|
|
348
|
+
โ
Is this solution appropriately scoped to the user's constraints?
|
|
349
|
+
โ
Did I handle potential failure modes and edge cases?
|
|
350
|
+
โ
Have I avoided generic boilerplate that doesn't add value?
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### ๐ Verification-Before-Completion (VBC) Protocol
|
|
354
|
+
|
|
355
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
356
|
+
- โ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
357
|
+
- โ
**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.
|
|
@@ -182,3 +182,45 @@ Review these questions before confirming output:
|
|
|
182
182
|
|
|
183
183
|
## VBC Protocol (Verification-Before-Completion)
|
|
184
184
|
You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## ๐ค LLM-Specific Traps
|
|
190
|
+
|
|
191
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
192
|
+
|
|
193
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
194
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
195
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
196
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
197
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
202
|
+
|
|
203
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
204
|
+
**Active reviewers: `logic-reviewer` ยท `security-auditor`**
|
|
205
|
+
|
|
206
|
+
### โ Forbidden AI Tropes
|
|
207
|
+
|
|
208
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
209
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
210
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
211
|
+
|
|
212
|
+
### โ
Pre-Flight Self-Audit
|
|
213
|
+
|
|
214
|
+
Review these questions before confirming output:
|
|
215
|
+
```
|
|
216
|
+
โ
Did I rely ONLY on real, verified tools and methods?
|
|
217
|
+
โ
Is this solution appropriately scoped to the user's constraints?
|
|
218
|
+
โ
Did I handle potential failure modes and edge cases?
|
|
219
|
+
โ
Have I avoided generic boilerplate that doesn't add value?
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### ๐ Verification-Before-Completion (VBC) Protocol
|
|
223
|
+
|
|
224
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
225
|
+
- โ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
226
|
+
- โ
**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.
|