llm-api-purity-check 0.0.0-stage → 1.3.0
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/LICENSE +27 -0
- package/README.md +161 -2
- package/README_CN.md +122 -0
- package/bin/cli.mjs +415 -0
- package/data/bank.generated.json +1 -0
- package/package.json +39 -4
- package/scripts/sync-bank.mjs +333 -0
- package/skills/aiapipk-check/SKILL.md +134 -0
- package/src/checks.mjs +1273 -0
- package/src/client.mjs +1240 -0
- package/src/fingerprint.mjs +665 -0
- package/src/links.mjs +135 -0
- package/src/modelIdNormalize.mjs +94 -0
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { callLlm, inferProtocol, isReasoningCapableModel } from '../src/client.mjs';
|
|
3
|
+
import {
|
|
4
|
+
attributeFingerprint,
|
|
5
|
+
generateFingerprintChallenges,
|
|
6
|
+
loadFingerprintBank,
|
|
7
|
+
} from '../src/fingerprint.mjs';
|
|
8
|
+
import {
|
|
9
|
+
runCacheCheck,
|
|
10
|
+
runInjectionProbe,
|
|
11
|
+
runLogicCheck,
|
|
12
|
+
runMultimodalCheck,
|
|
13
|
+
runSignatureRoundtripCheck,
|
|
14
|
+
runStreamAndTamperCheck,
|
|
15
|
+
} from '../src/checks.mjs';
|
|
16
|
+
import { buildContextualFooter } from '../src/links.mjs';
|
|
17
|
+
|
|
18
|
+
const HELP = `
|
|
19
|
+
llm-api-purity-check — Audit third-party LLM API proxies for hidden prompt injection,
|
|
20
|
+
model substitution, downgrade, fake Prompt Caching, instruction/tools tampering & token inflation.
|
|
21
|
+
|
|
22
|
+
Online zero-install web verifier (38-model bank + SVG visual comparison + live 370+ provider benchmark):
|
|
23
|
+
https://www.aiapipk.com/detect/ | https://www.aiapipk.com/
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
npx llm-api-purity-check --base-url <url> --api-key <key> --model <model> [options]
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--base-url <url> API base URL (e.g. https://api.example.com or https://api.example.com/v1)
|
|
30
|
+
--api-key <key> API key (or set env LLM_API_KEY / OPENAI_API_KEY / ANTHROPIC_API_KEY)
|
|
31
|
+
--model <name> Claimed model name (e.g. claude-sonnet-4-5, gpt-5, deepseek-chat)
|
|
32
|
+
--protocol <type> openai-chat | openai-responses | anthropic (auto-inferred if omitted)
|
|
33
|
+
--checks <list> Comma-separated: inject,stream,cache,logic,fingerprint,signature,multimodal (default: all)
|
|
34
|
+
--rounds <n> Number of 1-355 fingerprint sampling rounds (default: 3, range: 1-5)
|
|
35
|
+
--verify-signature Run optional Anthropic Thinking cryptographic signature roundtrip check
|
|
36
|
+
--multimodal Run optional 4-color rotating 64x64 solid PNG vision pass-through check
|
|
37
|
+
--json Emit machine-readable JSON report to stdout
|
|
38
|
+
--list-models List reference models bundled in the 1-355 fingerprint bank
|
|
39
|
+
-h, --help Show this help message
|
|
40
|
+
|
|
41
|
+
Examples:
|
|
42
|
+
node bin/cli.mjs --base-url https://api.example.com --api-key sk-xxx --model claude-sonnet-4-5
|
|
43
|
+
node bin/cli.mjs --base-url https://api.example.com --api-key sk-xxx --model claude-opus-4-6 --checks inject,stream --verify-signature
|
|
44
|
+
node bin/cli.mjs --base-url https://api.example.com --api-key sk-xxx --model gpt-5 --protocol openai-responses --checks inject,cache,stream --multimodal
|
|
45
|
+
node bin/cli.mjs --list-models
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
function parseArgs(argv) {
|
|
49
|
+
const opts = {
|
|
50
|
+
baseUrl: process.env.LLM_BASE_URL || '',
|
|
51
|
+
apiKey: process.env.LLM_API_KEY || process.env.OPENAI_API_KEY || process.env.ANTHROPIC_API_KEY || '',
|
|
52
|
+
model: process.env.LLM_MODEL || '',
|
|
53
|
+
protocol: '',
|
|
54
|
+
checks: 'all',
|
|
55
|
+
rounds: 3,
|
|
56
|
+
verifySignature: false,
|
|
57
|
+
multimodal: false,
|
|
58
|
+
json: false,
|
|
59
|
+
listModels: false,
|
|
60
|
+
help: false,
|
|
61
|
+
};
|
|
62
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
63
|
+
const a = argv[i];
|
|
64
|
+
if (a === '-h' || a === '--help') opts.help = true;
|
|
65
|
+
else if (a === '--json') opts.json = true;
|
|
66
|
+
else if (a === '--list-models') opts.listModels = true;
|
|
67
|
+
else if (a === '--verify-signature') opts.verifySignature = true;
|
|
68
|
+
else if (a === '--multimodal') opts.multimodal = true;
|
|
69
|
+
else if (a === '--base-url') opts.baseUrl = argv[++i] || '';
|
|
70
|
+
else if (a === '--api-key') opts.apiKey = argv[++i] || '';
|
|
71
|
+
else if (a === '--model') opts.model = argv[++i] || '';
|
|
72
|
+
else if (a === '--protocol') opts.protocol = argv[++i] || '';
|
|
73
|
+
else if (a === '--checks') opts.checks = argv[++i] || 'all';
|
|
74
|
+
else if (a === '--rounds') opts.rounds = Math.max(1, Math.min(5, Number(argv[++i]) || 3));
|
|
75
|
+
else throw new Error(`Unknown option: ${a}`);
|
|
76
|
+
}
|
|
77
|
+
return opts;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function formatCheckError(err) {
|
|
81
|
+
return {
|
|
82
|
+
status: 'error',
|
|
83
|
+
errorKind: err?.errorKind || 'request_error',
|
|
84
|
+
httpStatus: err?.httpStatus ?? null,
|
|
85
|
+
error: err?.message || String(err),
|
|
86
|
+
...(err?.hint ? { hint: err.hint } : {}),
|
|
87
|
+
...(err?.upstreamChannel ? { upstreamChannel: err.upstreamChannel } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function pickBestUpstreamChannel(results) {
|
|
92
|
+
let fallback = null;
|
|
93
|
+
for (const r of Object.values(results || {})) {
|
|
94
|
+
const ch = r?.upstreamChannel;
|
|
95
|
+
if (!ch) continue;
|
|
96
|
+
if (ch.channel && ch.channel !== 'unknown') return ch;
|
|
97
|
+
if (!fallback) fallback = ch;
|
|
98
|
+
}
|
|
99
|
+
return fallback || { channel: 'unknown', label: 'Unknown / Generic Relay', confidence: 'none', signals: [] };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function runFingerprintCheck({ baseUrl, apiKey, protocol, model, rounds, log }) {
|
|
103
|
+
const challenges = generateFingerprintChallenges(rounds);
|
|
104
|
+
const maxTokens = isReasoningCapableModel(model) ? 4096 : 1600;
|
|
105
|
+
const outputs = [];
|
|
106
|
+
let upstreamChannel = null;
|
|
107
|
+
for (let i = 0; i < challenges.length; i += 1) {
|
|
108
|
+
const ch = challenges[i];
|
|
109
|
+
log(` [fingerprint] round ${i + 1}/${challenges.length} (requesting ${ch.expectedCount} integers 1..355)...`);
|
|
110
|
+
const res = await callLlm({
|
|
111
|
+
baseUrl,
|
|
112
|
+
apiKey,
|
|
113
|
+
protocol,
|
|
114
|
+
model,
|
|
115
|
+
userPrompt: ch.prompt,
|
|
116
|
+
stream: false,
|
|
117
|
+
maxTokens,
|
|
118
|
+
});
|
|
119
|
+
if (!upstreamChannel || (upstreamChannel.channel === 'unknown' && res.upstreamChannel?.channel !== 'unknown')) {
|
|
120
|
+
upstreamChannel = res.upstreamChannel || null;
|
|
121
|
+
}
|
|
122
|
+
outputs.push({ text: res.text, expectedCount: ch.expectedCount });
|
|
123
|
+
}
|
|
124
|
+
const attr = attributeFingerprint(outputs, model);
|
|
125
|
+
const status =
|
|
126
|
+
attr.claimedMatchStatus === 'matched'
|
|
127
|
+
? 'pass'
|
|
128
|
+
: attr.claimedMatchStatus === 'mismatch' || attr.claimedMatchStatus === 'family_mismatch'
|
|
129
|
+
? 'fail'
|
|
130
|
+
: 'warn';
|
|
131
|
+
return { status, ...attr, upstreamChannel };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function main() {
|
|
135
|
+
const opts = parseArgs(process.argv.slice(2));
|
|
136
|
+
if (opts.help) {
|
|
137
|
+
console.log(HELP.trim());
|
|
138
|
+
process.exit(0);
|
|
139
|
+
}
|
|
140
|
+
if (opts.listModels) {
|
|
141
|
+
const bank = loadFingerprintBank();
|
|
142
|
+
console.log(`Bundled 1-355 Fingerprint Reference Bank (${bank.models.length} models):`);
|
|
143
|
+
for (const m of bank.models) {
|
|
144
|
+
console.log(` - ${m.id.padEnd(34)} [${m.family}] ${m.display_name || ''}`);
|
|
145
|
+
}
|
|
146
|
+
console.log(`\nFull ${bank.models.length}-model live bank + SVG downgrade comparison: https://www.aiapipk.com/detect/`);
|
|
147
|
+
process.exit(0);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!opts.baseUrl || !opts.apiKey || !opts.model) {
|
|
151
|
+
console.error('Error: --base-url, --api-key (or env var), and --model are required.\n');
|
|
152
|
+
console.log(HELP.trim());
|
|
153
|
+
process.exit(2);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const protocol = inferProtocol(opts.model, opts.protocol);
|
|
157
|
+
const enabled =
|
|
158
|
+
opts.checks === 'all'
|
|
159
|
+
? new Set(['inject', 'stream', 'cache', 'logic', 'fingerprint'])
|
|
160
|
+
: new Set(opts.checks.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean));
|
|
161
|
+
if (opts.verifySignature) enabled.add('signature');
|
|
162
|
+
if (opts.multimodal) enabled.add('multimodal');
|
|
163
|
+
|
|
164
|
+
const log = opts.json ? () => {} : (msg) => console.log(msg);
|
|
165
|
+
log(`\nAIAPIPK llm-api-purity-check`);
|
|
166
|
+
log(`Target : ${opts.baseUrl}`);
|
|
167
|
+
log(`Model : ${opts.model} (${protocol})`);
|
|
168
|
+
log(`Checks : ${Array.from(enabled).join(', ')}\n`);
|
|
169
|
+
|
|
170
|
+
const report = {
|
|
171
|
+
tool: 'llm-api-purity-check',
|
|
172
|
+
onlineVerifier: 'https://www.aiapipk.com/detect/',
|
|
173
|
+
benchmark: 'https://www.aiapipk.com/',
|
|
174
|
+
target: opts.baseUrl,
|
|
175
|
+
model: opts.model,
|
|
176
|
+
protocol,
|
|
177
|
+
timestamp: new Date().toISOString(),
|
|
178
|
+
results: {},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
let capturedSignatureTrace = null;
|
|
182
|
+
|
|
183
|
+
if (enabled.has('inject')) {
|
|
184
|
+
log('1) Running 10-second A/B/C single-char prompt-injection probe...');
|
|
185
|
+
try {
|
|
186
|
+
report.results.inject = await runInjectionProbe({
|
|
187
|
+
baseUrl: opts.baseUrl,
|
|
188
|
+
apiKey: opts.apiKey,
|
|
189
|
+
protocol,
|
|
190
|
+
model: opts.model,
|
|
191
|
+
});
|
|
192
|
+
} catch (err) {
|
|
193
|
+
report.results.inject = formatCheckError(err);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (enabled.has('stream')) {
|
|
198
|
+
log('2) Running streaming cadence, metadata & tamper check...');
|
|
199
|
+
try {
|
|
200
|
+
const streamRes = await runStreamAndTamperCheck({
|
|
201
|
+
baseUrl: opts.baseUrl,
|
|
202
|
+
apiKey: opts.apiKey,
|
|
203
|
+
protocol,
|
|
204
|
+
model: opts.model,
|
|
205
|
+
});
|
|
206
|
+
if (streamRes._signatureTrace) {
|
|
207
|
+
capturedSignatureTrace = streamRes._signatureTrace;
|
|
208
|
+
delete streamRes._signatureTrace;
|
|
209
|
+
}
|
|
210
|
+
report.results.stream = streamRes;
|
|
211
|
+
} catch (err) {
|
|
212
|
+
report.results.stream = formatCheckError(err);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (enabled.has('cache')) {
|
|
217
|
+
log('3) Running two-round real Prompt Caching check (2.5K+ token prefix)...');
|
|
218
|
+
try {
|
|
219
|
+
report.results.cache = await runCacheCheck({
|
|
220
|
+
baseUrl: opts.baseUrl,
|
|
221
|
+
apiKey: opts.apiKey,
|
|
222
|
+
protocol,
|
|
223
|
+
model: opts.model,
|
|
224
|
+
});
|
|
225
|
+
} catch (err) {
|
|
226
|
+
report.results.cache = formatCheckError(err);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (enabled.has('logic')) {
|
|
231
|
+
log('4) Running randomized anti-downgrade pigeonhole reasoning puzzle...');
|
|
232
|
+
try {
|
|
233
|
+
report.results.logic = await runLogicCheck({
|
|
234
|
+
baseUrl: opts.baseUrl,
|
|
235
|
+
apiKey: opts.apiKey,
|
|
236
|
+
protocol,
|
|
237
|
+
model: opts.model,
|
|
238
|
+
});
|
|
239
|
+
} catch (err) {
|
|
240
|
+
report.results.logic = formatCheckError(err);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (enabled.has('fingerprint')) {
|
|
245
|
+
log(`5) Running ${opts.rounds}-round 1-355 numerical fingerprinting check...`);
|
|
246
|
+
try {
|
|
247
|
+
report.results.fingerprint = await runFingerprintCheck({
|
|
248
|
+
baseUrl: opts.baseUrl,
|
|
249
|
+
apiKey: opts.apiKey,
|
|
250
|
+
protocol,
|
|
251
|
+
model: opts.model,
|
|
252
|
+
rounds: opts.rounds,
|
|
253
|
+
log,
|
|
254
|
+
});
|
|
255
|
+
} catch (err) {
|
|
256
|
+
report.results.fingerprint = formatCheckError(err);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (enabled.has('signature')) {
|
|
261
|
+
log('6) Running Anthropic Thinking cryptographic signature roundtrip check...');
|
|
262
|
+
try {
|
|
263
|
+
report.results.signature = await runSignatureRoundtripCheck({
|
|
264
|
+
baseUrl: opts.baseUrl,
|
|
265
|
+
apiKey: opts.apiKey,
|
|
266
|
+
protocol,
|
|
267
|
+
model: opts.model,
|
|
268
|
+
seedTrace: capturedSignatureTrace,
|
|
269
|
+
});
|
|
270
|
+
} catch (err) {
|
|
271
|
+
report.results.signature = formatCheckError(err);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (enabled.has('multimodal')) {
|
|
276
|
+
log('7) Running 4-color 64x64 solid PNG multimodal vision pass-through check...');
|
|
277
|
+
try {
|
|
278
|
+
report.results.multimodal = await runMultimodalCheck({
|
|
279
|
+
baseUrl: opts.baseUrl,
|
|
280
|
+
apiKey: opts.apiKey,
|
|
281
|
+
protocol,
|
|
282
|
+
model: opts.model,
|
|
283
|
+
});
|
|
284
|
+
} catch (err) {
|
|
285
|
+
report.results.multimodal = formatCheckError(err);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
report.upstreamChannel = pickBestUpstreamChannel(report.results);
|
|
290
|
+
const footerLinks = buildContextualFooter({
|
|
291
|
+
baseUrl: opts.baseUrl,
|
|
292
|
+
model: opts.model,
|
|
293
|
+
results: report.results,
|
|
294
|
+
});
|
|
295
|
+
report.links = footerLinks;
|
|
296
|
+
|
|
297
|
+
if (opts.json) {
|
|
298
|
+
console.log(JSON.stringify(report, null, 2));
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
console.log('\n==================== AUDIT SUMMARY ====================');
|
|
303
|
+
if (report.upstreamChannel) {
|
|
304
|
+
const sigStr =
|
|
305
|
+
report.upstreamChannel.signals?.length > 0
|
|
306
|
+
? ` (${report.upstreamChannel.signals.slice(0, 3).join(', ')})`
|
|
307
|
+
: '';
|
|
308
|
+
console.log(`[INFO] Upstream Hint : ${report.upstreamChannel.label}${sigStr}`);
|
|
309
|
+
}
|
|
310
|
+
if (report.results.inject) {
|
|
311
|
+
const j = report.results.inject;
|
|
312
|
+
if (j.status === 'error') {
|
|
313
|
+
console.log(`[ERROR:${j.errorKind}] Inject Probe : ${j.error}`);
|
|
314
|
+
if (j.hint) console.log(` Hint : ${j.hint}`);
|
|
315
|
+
} else {
|
|
316
|
+
const deltaA = j.deltaAgent != null ? `${j.deltaAgent >= 0 ? '+' : ''}${j.deltaAgent}` : '-';
|
|
317
|
+
const deltaT = j.deltaTool != null ? `${j.deltaTool >= 0 ? '+' : ''}${j.deltaTool}` : '-';
|
|
318
|
+
console.log(
|
|
319
|
+
`[${j.status.toUpperCase()}] Inject Probe : tier=${j.tier} | bare=${j.bareInputTokens ?? '-'}tok -> agent=${j.agentInputTokens ?? '-'}tok (${deltaA}) -> tool=${j.toolInputTokens ?? '-'}tok (${deltaT})`
|
|
320
|
+
);
|
|
321
|
+
if (j.tamperFlags?.length) console.log(` Tamper Flags : ${j.tamperFlags.join(', ')}`);
|
|
322
|
+
if (j.toolProbeNote) console.log(` Tool Note : ${j.toolProbeNote}`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (report.results.stream) {
|
|
326
|
+
const s = report.results.stream;
|
|
327
|
+
if (s.status === 'error') {
|
|
328
|
+
console.log(`[ERROR:${s.errorKind}] Stream/Tamper : ${s.error}`);
|
|
329
|
+
if (s.hint) console.log(` Hint : ${s.hint}`);
|
|
330
|
+
} else {
|
|
331
|
+
const thinkNote = s.thinkingExempt ? ` | thinkingExempt=${s.thinkingExemptReason}` : '';
|
|
332
|
+
console.log(
|
|
333
|
+
`[${s.status.toUpperCase()}] Stream/Tamper : TTFT=${s.ttftMs}ms | TPS=${s.tps} | chunks=${s.chunkCount} | fakeStream=${s.fakeStreamSuspect} | respModel=${s.responseModel || '-'}${thinkNote}`
|
|
334
|
+
);
|
|
335
|
+
if (s.warnings?.length) console.log(` Warnings : ${s.warnings.join(', ')}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (report.results.cache) {
|
|
339
|
+
const c = report.results.cache;
|
|
340
|
+
if (c.status === 'error') {
|
|
341
|
+
console.log(`[ERROR:${c.errorKind}] Prompt Cache : ${c.error}`);
|
|
342
|
+
if (c.hint) console.log(` Hint : ${c.hint}`);
|
|
343
|
+
} else {
|
|
344
|
+
console.log(
|
|
345
|
+
`[${c.status.toUpperCase()}] Prompt Cache : hitRate=${Math.round(c.cacheHitRate * 100)}% (R2 cached=${c.round2.cachedTokens}/${c.round2.inputTokens}) | TTFT R1=${c.round1.ttftMs}ms -> R2=${c.round2.ttftMs}ms`
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (report.results.logic) {
|
|
350
|
+
const l = report.results.logic;
|
|
351
|
+
if (l.status === 'error') {
|
|
352
|
+
console.log(`[ERROR:${l.errorKind}] Logic Puzzle : ${l.error}`);
|
|
353
|
+
if (l.hint) console.log(` Hint : ${l.hint}`);
|
|
354
|
+
} else {
|
|
355
|
+
console.log(
|
|
356
|
+
`[${l.status.toUpperCase()}] Logic Puzzle : parsed=${l.parsed} | expected=${l.expected} | trap=${l.trapAnswer}${l.hitTrap ? ' (HIT SKIP-STEP TRAP!)' : ''}`
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (report.results.fingerprint) {
|
|
361
|
+
const f = report.results.fingerprint;
|
|
362
|
+
if (f.status === 'error') {
|
|
363
|
+
console.log(`[ERROR:${f.errorKind}] Fingerprint : ${f.error}`);
|
|
364
|
+
if (f.hint) console.log(` Hint : ${f.hint}`);
|
|
365
|
+
} else {
|
|
366
|
+
const top3 = (f.topCandidates || [])
|
|
367
|
+
.slice(0, 3)
|
|
368
|
+
.map((x) => `${x.modelId} (${Math.round(x.probability * 100)}%)`)
|
|
369
|
+
.join(', ');
|
|
370
|
+
const siblingNote = f.siblingClusterMatched ? ' [sibling-cluster]' : '';
|
|
371
|
+
console.log(
|
|
372
|
+
`[${f.status.toUpperCase()}] Fingerprint : status=${f.claimedMatchStatus}${siblingNote} | top=${f.prediction || '-'} (${Math.round((f.probability || 0) * 100)}%) | family=${f.familyPrediction || '-'} | bank=${f.bankModelCount}`
|
|
373
|
+
);
|
|
374
|
+
if (top3) console.log(` Top 3 : ${top3}`);
|
|
375
|
+
if (f.topRawH != null) {
|
|
376
|
+
console.log(
|
|
377
|
+
` Fit Metrics : rawH=${f.topRawH} | rawOB=${f.topRawOB} | js=${f.topJsSimilarity}${f.degenerateRejectedCount ? ` | degRejected=${f.degenerateRejectedCount}` : ''}`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
if (f.baselineProvenanceWarning) {
|
|
381
|
+
console.log(` Baseline Note : ${f.baselineProvenanceWarning}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (report.results.signature) {
|
|
386
|
+
const sig = report.results.signature;
|
|
387
|
+
if (sig.status === 'error') {
|
|
388
|
+
console.log(`[ERROR:${sig.errorKind}] Thinking Sig : ${sig.error}`);
|
|
389
|
+
if (sig.hint) console.log(` Hint : ${sig.hint}`);
|
|
390
|
+
} else {
|
|
391
|
+
console.log(`[${sig.status.toUpperCase()}] Thinking Sig : verdict=${sig.verdict} | ${sig.summary}`);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (report.results.multimodal) {
|
|
395
|
+
const mm = report.results.multimodal;
|
|
396
|
+
if (mm.status === 'error') {
|
|
397
|
+
console.log(`[ERROR:${mm.errorKind}] Multimodal : ${mm.error}`);
|
|
398
|
+
if (mm.hint) console.log(` Hint : ${mm.hint}`);
|
|
399
|
+
} else {
|
|
400
|
+
console.log(
|
|
401
|
+
`[${mm.status.toUpperCase()}] Multimodal : expected=${mm.expectedColor} | detected=${mm.detectedColor || '-'} | png=${mm.pngDimensions || '64x64'} (${mm.pngBytes ?? '-'}B)`
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
console.log('=======================================================');
|
|
406
|
+
for (const item of footerLinks) {
|
|
407
|
+
console.log(`${item.label.padEnd(23)}: ${item.url}`);
|
|
408
|
+
}
|
|
409
|
+
console.log('');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
main().catch((err) => {
|
|
413
|
+
console.error(`Fatal: ${err.message}`);
|
|
414
|
+
process.exit(1);
|
|
415
|
+
});
|