ai-model-verifier 1.4.1 → 2.0.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/README.md +79 -22
- package/dist/engine/context.d.ts +43 -0
- package/dist/engine/context.d.ts.map +1 -0
- package/dist/engine/context.js +50 -0
- package/dist/engine/context.js.map +1 -0
- package/dist/engine/evidence.d.ts +40 -0
- package/dist/engine/evidence.d.ts.map +1 -0
- package/dist/engine/evidence.js +108 -0
- package/dist/engine/evidence.js.map +1 -0
- package/dist/engine/handshake.d.ts +16 -0
- package/dist/engine/handshake.d.ts.map +1 -0
- package/dist/{handshake.js → engine/handshake.js} +35 -63
- package/dist/engine/handshake.js.map +1 -0
- package/dist/engine/probe-runner.d.ts +14 -0
- package/dist/engine/probe-runner.d.ts.map +1 -0
- package/dist/engine/probe-runner.js +163 -0
- package/dist/engine/probe-runner.js.map +1 -0
- package/dist/engine/verdict.d.ts +15 -0
- package/dist/engine/verdict.d.ts.map +1 -0
- package/dist/engine/verdict.js +19 -0
- package/dist/engine/verdict.js.map +1 -0
- package/dist/highlight.d.ts +2 -2
- package/dist/highlight.d.ts.map +1 -1
- package/dist/highlight.js +10 -9
- package/dist/highlight.js.map +1 -1
- package/dist/{patterns.d.ts → identity/patterns.d.ts} +7 -0
- package/dist/identity/patterns.d.ts.map +1 -0
- package/dist/{patterns.js → identity/patterns.js} +7 -0
- package/dist/identity/patterns.js.map +1 -0
- package/dist/identity/signals.d.ts +15 -0
- package/dist/identity/signals.d.ts.map +1 -0
- package/dist/{signals.js → identity/signals.js} +15 -24
- package/dist/identity/signals.js.map +1 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/utils.d.ts +3 -1
- package/dist/internal/utils.d.ts.map +1 -1
- package/dist/internal/utils.js +12 -6
- package/dist/internal/utils.js.map +1 -1
- package/dist/models/catalog.d.ts +7 -0
- package/dist/models/catalog.d.ts.map +1 -0
- package/dist/models/catalog.js +23 -0
- package/dist/models/catalog.js.map +1 -0
- package/dist/models/facts.d.ts +56 -0
- package/dist/models/facts.d.ts.map +1 -0
- package/dist/models/facts.js +91 -0
- package/dist/models/facts.js.map +1 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +5 -0
- package/dist/models/index.js.map +1 -0
- package/dist/{substitution.d.ts → models/substitution.d.ts} +3 -4
- package/dist/models/substitution.d.ts.map +1 -0
- package/dist/{substitution.js → models/substitution.js} +3 -4
- package/dist/models/substitution.js.map +1 -0
- package/dist/models/tiers.d.ts +14 -0
- package/dist/models/tiers.d.ts.map +1 -0
- package/dist/models/tiers.js +35 -0
- package/dist/models/tiers.js.map +1 -0
- package/dist/probes/prompts.d.ts +23 -0
- package/dist/probes/prompts.d.ts.map +1 -0
- package/dist/probes/prompts.js +31 -0
- package/dist/probes/prompts.js.map +1 -0
- package/dist/probes/table.d.ts +37 -0
- package/dist/probes/table.d.ts.map +1 -0
- package/dist/probes/table.js +57 -0
- package/dist/probes/table.js.map +1 -0
- package/dist/registry.d.ts +26 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +23 -0
- package/dist/registry.js.map +1 -0
- package/dist/rules/index.d.ts +15 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +8 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/probe-ladder.d.ts +33 -0
- package/dist/rules/probe-ladder.d.ts.map +1 -0
- package/dist/rules/probe-ladder.js +156 -0
- package/dist/rules/probe-ladder.js.map +1 -0
- package/dist/{detectors → rules}/response-metadata.d.ts +11 -14
- package/dist/rules/response-metadata.d.ts.map +1 -0
- package/dist/{detectors → rules}/response-metadata.js +32 -15
- package/dist/rules/response-metadata.js.map +1 -0
- package/dist/rules/table.d.ts +27 -0
- package/dist/rules/table.d.ts.map +1 -0
- package/dist/rules/table.js +47 -0
- package/dist/rules/table.js.map +1 -0
- package/dist/{detectors → rules}/thinking-floor.d.ts +14 -29
- package/dist/rules/thinking-floor.d.ts.map +1 -0
- package/dist/rules/thinking-floor.js +119 -0
- package/dist/rules/thinking-floor.js.map +1 -0
- package/dist/rules/thinking-signature.d.ts +43 -0
- package/dist/rules/thinking-signature.d.ts.map +1 -0
- package/dist/rules/thinking-signature.js +72 -0
- package/dist/rules/thinking-signature.js.map +1 -0
- package/dist/{detectors → rules}/throughput.d.ts +7 -10
- package/dist/rules/throughput.d.ts.map +1 -0
- package/dist/{detectors → rules}/throughput.js +32 -11
- package/dist/rules/throughput.js.map +1 -0
- package/dist/{detectors → rules}/token-truth.d.ts +7 -13
- package/dist/rules/token-truth.d.ts.map +1 -0
- package/dist/rules/token-truth.js +112 -0
- package/dist/rules/token-truth.js.map +1 -0
- package/dist/{detectors → rules}/tokenizer-fingerprint.d.ts +7 -19
- package/dist/rules/tokenizer-fingerprint.d.ts.map +1 -0
- package/dist/{detectors → rules}/tokenizer-fingerprint.js +40 -58
- package/dist/rules/tokenizer-fingerprint.js.map +1 -0
- package/dist/rules/types.d.ts +57 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/transport.d.ts +10 -2
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +40 -32
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +70 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/vendors/anthropic.d.ts +44 -0
- package/dist/vendors/anthropic.d.ts.map +1 -0
- package/dist/vendors/anthropic.js +114 -0
- package/dist/vendors/anthropic.js.map +1 -0
- package/dist/vendors/base-url.d.ts +3 -0
- package/dist/vendors/base-url.d.ts.map +1 -0
- package/dist/vendors/base-url.js +6 -0
- package/dist/vendors/base-url.js.map +1 -0
- package/dist/vendors/gemini.d.ts +44 -0
- package/dist/vendors/gemini.d.ts.map +1 -0
- package/dist/vendors/gemini.js +77 -0
- package/dist/vendors/gemini.js.map +1 -0
- package/dist/vendors/index.d.ts +9 -0
- package/dist/vendors/index.d.ts.map +1 -0
- package/dist/vendors/index.js +7 -0
- package/dist/vendors/index.js.map +1 -0
- package/dist/vendors/openai.d.ts +46 -0
- package/dist/vendors/openai.d.ts.map +1 -0
- package/dist/vendors/openai.js +77 -0
- package/dist/vendors/openai.js.map +1 -0
- package/dist/vendors/table.d.ts +113 -0
- package/dist/vendors/table.d.ts.map +1 -0
- package/dist/vendors/table.js +14 -0
- package/dist/vendors/table.js.map +1 -0
- package/dist/vendors/types.d.ts +93 -0
- package/dist/vendors/types.d.ts.map +1 -0
- package/dist/vendors/types.js +2 -0
- package/dist/vendors/types.js.map +1 -0
- package/dist/verify.d.ts +30 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +185 -0
- package/dist/verify.js.map +1 -0
- package/package.json +25 -10
- package/dist/detectors/response-metadata.d.ts.map +0 -1
- package/dist/detectors/response-metadata.js.map +0 -1
- package/dist/detectors/thinking-floor.d.ts.map +0 -1
- package/dist/detectors/thinking-floor.js +0 -135
- package/dist/detectors/thinking-floor.js.map +0 -1
- package/dist/detectors/thinking-signature.d.ts +0 -70
- package/dist/detectors/thinking-signature.d.ts.map +0 -1
- package/dist/detectors/thinking-signature.js +0 -177
- package/dist/detectors/thinking-signature.js.map +0 -1
- package/dist/detectors/throughput.d.ts.map +0 -1
- package/dist/detectors/throughput.js.map +0 -1
- package/dist/detectors/token-truth.d.ts.map +0 -1
- package/dist/detectors/token-truth.js +0 -142
- package/dist/detectors/token-truth.js.map +0 -1
- package/dist/detectors/tokenizer-fingerprint.d.ts.map +0 -1
- package/dist/detectors/tokenizer-fingerprint.js.map +0 -1
- package/dist/handshake.d.ts +0 -23
- package/dist/handshake.d.ts.map +0 -1
- package/dist/handshake.js.map +0 -1
- package/dist/internal/fixed-text.d.ts +0 -13
- package/dist/internal/fixed-text.d.ts.map +0 -1
- package/dist/internal/fixed-text.js +0 -13
- package/dist/internal/fixed-text.js.map +0 -1
- package/dist/models.d.ts +0 -5
- package/dist/models.d.ts.map +0 -1
- package/dist/models.js +0 -54
- package/dist/models.js.map +0 -1
- package/dist/nonce.d.ts +0 -4
- package/dist/nonce.d.ts.map +0 -1
- package/dist/nonce.js +0 -12
- package/dist/nonce.js.map +0 -1
- package/dist/patterns.d.ts.map +0 -1
- package/dist/patterns.js.map +0 -1
- package/dist/probes.d.ts +0 -10
- package/dist/probes.d.ts.map +0 -1
- package/dist/probes.js +0 -54
- package/dist/probes.js.map +0 -1
- package/dist/providers/anthropic.d.ts +0 -3
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/anthropic.js +0 -67
- package/dist/providers/anthropic.js.map +0 -1
- package/dist/providers/config.d.ts +0 -34
- package/dist/providers/config.d.ts.map +0 -1
- package/dist/providers/config.js +0 -14
- package/dist/providers/config.js.map +0 -1
- package/dist/providers/gemini.d.ts +0 -3
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -58
- package/dist/providers/gemini.js.map +0 -1
- package/dist/providers/openai.d.ts +0 -3
- package/dist/providers/openai.d.ts.map +0 -1
- package/dist/providers/openai.js +0 -56
- package/dist/providers/openai.js.map +0 -1
- package/dist/rules.d.ts +0 -6
- package/dist/rules.d.ts.map +0 -1
- package/dist/rules.js +0 -28
- package/dist/rules.js.map +0 -1
- package/dist/runner.d.ts +0 -39
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js +0 -352
- package/dist/runner.js.map +0 -1
- package/dist/signals.d.ts +0 -11
- package/dist/signals.d.ts.map +0 -1
- package/dist/signals.js.map +0 -1
- package/dist/substitution.d.ts.map +0 -1
- package/dist/substitution.js.map +0 -1
- package/dist/verdict.d.ts +0 -26
- package/dist/verdict.d.ts.map +0 -1
- package/dist/verdict.js +0 -84
- package/dist/verdict.js.map +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the engine knows about a model id, in one table. Adapters and rules
|
|
3
|
+
* read facts; none of them carries a model-name regex of its own.
|
|
4
|
+
*
|
|
5
|
+
* Resolution is layered, first match per field: consumer entries, then this
|
|
6
|
+
* table, in order. A field an entry leaves out falls through to later entries,
|
|
7
|
+
* so a narrow entry (opus-4-7 thinks adaptively) sits above the broad one
|
|
8
|
+
* (every claude belongs to anthropic) and both apply.
|
|
9
|
+
*/
|
|
10
|
+
import type { VendorId } from "../vendors/table";
|
|
11
|
+
export type ThinkingMode = "adaptive" | "extended" | "none";
|
|
12
|
+
export type TokenizerGeneration = "claude-v1" | "claude-v2";
|
|
13
|
+
export type ModelFacts = {
|
|
14
|
+
/** Vendor that trained it; null when the id names nothing the table knows. */
|
|
15
|
+
vendor: VendorId | null;
|
|
16
|
+
thinking: ThinkingMode;
|
|
17
|
+
tokenizer: TokenizerGeneration | null;
|
|
18
|
+
/** Cannot switch reasoning off (a reply with no thought tokens is a cheaper tier). */
|
|
19
|
+
alwaysThinks: boolean;
|
|
20
|
+
/** Reasoning models need room for hidden thought before the visible answer. */
|
|
21
|
+
minOutputTokens: number | null;
|
|
22
|
+
};
|
|
23
|
+
export type FactsEntry = {
|
|
24
|
+
/** Glob(s) over the normalised id: `*` is the only wildcard, no `*` means exact. */
|
|
25
|
+
match: string | readonly string[];
|
|
26
|
+
} & Partial<ModelFacts>;
|
|
27
|
+
/** Lowercase, `.` and `_` to `-`, any `vendor/` or `pool/` prefix stripped. */
|
|
28
|
+
export declare const normalizeModelId: (model: string) => string;
|
|
29
|
+
export declare function globMatches(name: string, pattern: string): boolean;
|
|
30
|
+
export declare const MODEL_FACTS: readonly [{
|
|
31
|
+
readonly match: readonly ["claude-opus-4-7*", "claude-opus-4-8*"];
|
|
32
|
+
readonly thinking: "adaptive";
|
|
33
|
+
readonly tokenizer: "claude-v2";
|
|
34
|
+
}, {
|
|
35
|
+
readonly match: readonly ["claude-opus-4-6*", "claude-opus-4-5*", "claude-opus-4-1*", "claude-sonnet-4-6*", "claude-sonnet-4-5*", "claude-haiku-4-5*"];
|
|
36
|
+
readonly thinking: "extended";
|
|
37
|
+
}, {
|
|
38
|
+
readonly match: "*claude*";
|
|
39
|
+
readonly vendor: "anthropic";
|
|
40
|
+
readonly tokenizer: "claude-v1";
|
|
41
|
+
}, {
|
|
42
|
+
readonly match: "gemini-2-5-pro*";
|
|
43
|
+
readonly alwaysThinks: true;
|
|
44
|
+
}, {
|
|
45
|
+
readonly match: "*gemini*";
|
|
46
|
+
readonly vendor: "gemini";
|
|
47
|
+
}, {
|
|
48
|
+
readonly match: readonly ["gpt-5*", "o1*", "o2*", "o3*", "o4*", "o5*", "o6*", "o7*", "o8*", "o9*"];
|
|
49
|
+
readonly minOutputTokens: 2000;
|
|
50
|
+
}, {
|
|
51
|
+
readonly match: readonly ["gpt-*", "o1*", "o3*", "o4*", "chatgpt*"];
|
|
52
|
+
readonly vendor: "openai";
|
|
53
|
+
}];
|
|
54
|
+
export declare const defineModelFacts: <const F extends readonly FactsEntry[]>(facts: F) => F;
|
|
55
|
+
export declare function resolveModelFacts(model: string, extra?: readonly FactsEntry[]): ModelFacts;
|
|
56
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../../src/models/facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,WAAW,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB,8EAA8E;IAC9E,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACtC,sFAAsF;IACtF,YAAY,EAAE,OAAO,CAAC;IACtB,+EAA+E;IAC/E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,oFAAoF;IACpF,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACnC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAExB,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACwB,CAAC;AAI1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAMlE;AAED,eAAO,MAAM,WAAW;;uBAGV,UAAU;wBACT,WAAW;;;uBAWZ,UAAU;;oBAEb,UAAU;qBAAU,WAAW;wBAAa,WAAW;;oBACvD,iBAAiB;;;oBACjB,UAAU;qBAAU,QAAQ;;;8BAclB,IAAI;;;qBAEsC,QAAQ;EAC7B,CAAC;AAE3C,eAAO,MAAM,gBAAgB,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,SAC7D,CAAC,KACP,CAAU,CAAC;AA8Bd,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,SAAS,UAAU,EAAO,GAChC,UAAU,CAWZ"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the engine knows about a model id, in one table. Adapters and rules
|
|
3
|
+
* read facts; none of them carries a model-name regex of its own.
|
|
4
|
+
*
|
|
5
|
+
* Resolution is layered, first match per field: consumer entries, then this
|
|
6
|
+
* table, in order. A field an entry leaves out falls through to later entries,
|
|
7
|
+
* so a narrow entry (opus-4-7 thinks adaptively) sits above the broad one
|
|
8
|
+
* (every claude belongs to anthropic) and both apply.
|
|
9
|
+
*/
|
|
10
|
+
/** Lowercase, `.` and `_` to `-`, any `vendor/` or `pool/` prefix stripped. */
|
|
11
|
+
export const normalizeModelId = (model) => model.trim().toLowerCase().replace(/[._]/g, "-").split("/").pop() ?? "";
|
|
12
|
+
const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
13
|
+
export function globMatches(name, pattern) {
|
|
14
|
+
const p = pattern.toLowerCase();
|
|
15
|
+
if (!p.includes("*"))
|
|
16
|
+
return name === p;
|
|
17
|
+
return new RegExp(`^${p.split("*").map(escapeRegExp).join(".*")}$`).test(name);
|
|
18
|
+
}
|
|
19
|
+
export const MODEL_FACTS = [
|
|
20
|
+
{
|
|
21
|
+
match: ["claude-opus-4-7*", "claude-opus-4-8*"],
|
|
22
|
+
thinking: "adaptive",
|
|
23
|
+
tokenizer: "claude-v2",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
match: [
|
|
27
|
+
"claude-opus-4-6*",
|
|
28
|
+
"claude-opus-4-5*",
|
|
29
|
+
"claude-opus-4-1*",
|
|
30
|
+
"claude-sonnet-4-6*",
|
|
31
|
+
"claude-sonnet-4-5*",
|
|
32
|
+
"claude-haiku-4-5*",
|
|
33
|
+
],
|
|
34
|
+
thinking: "extended",
|
|
35
|
+
},
|
|
36
|
+
{ match: "*claude*", vendor: "anthropic", tokenizer: "claude-v1" },
|
|
37
|
+
{ match: "gemini-2-5-pro*", alwaysThinks: true },
|
|
38
|
+
{ match: "*gemini*", vendor: "gemini" },
|
|
39
|
+
{
|
|
40
|
+
match: [
|
|
41
|
+
"gpt-5*",
|
|
42
|
+
"o1*",
|
|
43
|
+
"o2*",
|
|
44
|
+
"o3*",
|
|
45
|
+
"o4*",
|
|
46
|
+
"o5*",
|
|
47
|
+
"o6*",
|
|
48
|
+
"o7*",
|
|
49
|
+
"o8*",
|
|
50
|
+
"o9*",
|
|
51
|
+
],
|
|
52
|
+
minOutputTokens: 2000,
|
|
53
|
+
},
|
|
54
|
+
{ match: ["gpt-*", "o1*", "o3*", "o4*", "chatgpt*"], vendor: "openai" },
|
|
55
|
+
];
|
|
56
|
+
export const defineModelFacts = (facts) => facts;
|
|
57
|
+
const DEFAULTS = {
|
|
58
|
+
vendor: null,
|
|
59
|
+
thinking: "none",
|
|
60
|
+
tokenizer: null,
|
|
61
|
+
alwaysThinks: false,
|
|
62
|
+
minOutputTokens: null,
|
|
63
|
+
};
|
|
64
|
+
const FACT_KEYS = [
|
|
65
|
+
"vendor",
|
|
66
|
+
"thinking",
|
|
67
|
+
"tokenizer",
|
|
68
|
+
"alwaysThinks",
|
|
69
|
+
"minOutputTokens",
|
|
70
|
+
];
|
|
71
|
+
function take(out, entry, key, seen) {
|
|
72
|
+
const v = entry[key];
|
|
73
|
+
if (seen.has(key) || v === undefined)
|
|
74
|
+
return;
|
|
75
|
+
out[key] = v;
|
|
76
|
+
seen.add(key);
|
|
77
|
+
}
|
|
78
|
+
export function resolveModelFacts(model, extra = []) {
|
|
79
|
+
const id = normalizeModelId(model);
|
|
80
|
+
const out = { ...DEFAULTS };
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
for (const entry of [...extra, ...MODEL_FACTS]) {
|
|
83
|
+
const patterns = typeof entry.match === "string" ? [entry.match] : entry.match;
|
|
84
|
+
if (!patterns.some((p) => globMatches(id, p)))
|
|
85
|
+
continue;
|
|
86
|
+
for (const key of FACT_KEYS)
|
|
87
|
+
take(out, entry, key, seen);
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.js","sourceRoot":"","sources":["../../src/models/facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuBH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACxD,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAE1E,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE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AAC,CAAC,CAAC;YAAE,SAAS;QACxD,KAAK,MAAM,GAAG,IAAI,SAAS;YAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MODEL_FACTS, defineModelFacts, globMatches, normalizeModelId, resolveModelFacts, } from "./facts";
|
|
2
|
+
export type { FactsEntry, ModelFacts, ThinkingMode, TokenizerGeneration, } from "./facts";
|
|
3
|
+
export { CURATED_MODELS, vendorForModel, vendorForRow } from "./catalog";
|
|
4
|
+
export { detectSubstitution, modelsMatch } from "./substitution";
|
|
5
|
+
export { detectServedModelMismatch, detectTierMismatch, tierOf } from "./tiers";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MODEL_FACTS, defineModelFacts, globMatches, normalizeModelId, resolveModelFacts, } from "./facts";
|
|
2
|
+
export { CURATED_MODELS, vendorForModel, vendorForRow } from "./catalog";
|
|
3
|
+
export { detectSubstitution, modelsMatch } from "./substitution";
|
|
4
|
+
export { detectServedModelMismatch, detectTierMismatch, tierOf } from "./tiers";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* nothing: the id is already in the response every probe makes.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* legitimately spell the same model:
|
|
10
|
+
* A strict comparison once condemned an honest upstream and cost it all ten of
|
|
11
|
+
* its Claude models, so this tolerates the three ways vendors legitimately
|
|
12
|
+
* spell the same model:
|
|
14
13
|
* - separator drift claude-opus-4.8 vs claude-opus-4-8
|
|
15
14
|
* - vendor-qualified ids anthropic/claude-opus-5 vs claude-opus-5
|
|
16
15
|
* - dated snapshots claude-haiku-4-5 vs claude-haiku-4-5-20251001
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"substitution.d.ts","sourceRoot":"","sources":["../../src/models/substitution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAOtE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACvC,MAAM,GAAG,IAAI,CAGf"}
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* nothing: the id is already in the response every probe makes.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* legitimately spell the same model:
|
|
10
|
+
* A strict comparison once condemned an honest upstream and cost it all ten of
|
|
11
|
+
* its Claude models, so this tolerates the three ways vendors legitimately
|
|
12
|
+
* spell the same model:
|
|
14
13
|
* - separator drift claude-opus-4.8 vs claude-opus-4-8
|
|
15
14
|
* - vendor-qualified ids anthropic/claude-opus-5 vs claude-opus-5
|
|
16
15
|
* - dated snapshots claude-haiku-4-5 vs claude-haiku-4-5-20251001
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"substitution.js","sourceRoot":"","sources":["../../src/models/substitution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,MAAc;IAC3D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CACzB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAiB,EACjB,aAAwC;IAExC,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The one tier a text names, or null when it names none or hedges ("opus or sonnet"). */
|
|
2
|
+
export declare function tierOf(text: string, tiers: readonly string[]): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* The tier the model-name reply claims when it contradicts the requested one.
|
|
5
|
+
* What a model calls itself is coachable, so callers treat this as a note.
|
|
6
|
+
*/
|
|
7
|
+
export declare function detectTierMismatch(requestedModel: string, modelNameText: string | undefined, tiers: readonly string[]): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* The served model id when the reply's own `model` field names another tier: a
|
|
10
|
+
* relay that maps the requested name to a cheaper backend reports it here while
|
|
11
|
+
* every behavioural probe passes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectServedModelMismatch(requestedModel: string, servedModels: readonly (string | null)[], tiers: readonly string[]): string | null;
|
|
14
|
+
//# sourceMappingURL=tiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../src/models/tiers.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAG5E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,GAAG,IAAI,CAKf;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EACxC,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The one tier a text names, or null when it names none or hedges ("opus or sonnet"). */
|
|
2
|
+
export function tierOf(text, tiers) {
|
|
3
|
+
const found = tiers.filter((tier) => text.includes(tier));
|
|
4
|
+
return found.length === 1 ? found[0] : null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The tier the model-name reply claims when it contradicts the requested one.
|
|
8
|
+
* What a model calls itself is coachable, so callers treat this as a note.
|
|
9
|
+
*/
|
|
10
|
+
export function detectTierMismatch(requestedModel, modelNameText, tiers) {
|
|
11
|
+
const reqTier = tierOf(requestedModel.toLowerCase(), tiers);
|
|
12
|
+
if (!reqTier || !modelNameText)
|
|
13
|
+
return null;
|
|
14
|
+
const saidTier = tierOf(modelNameText, tiers);
|
|
15
|
+
return saidTier && saidTier !== reqTier ? saidTier : null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The served model id when the reply's own `model` field names another tier: a
|
|
19
|
+
* relay that maps the requested name to a cheaper backend reports it here while
|
|
20
|
+
* every behavioural probe passes.
|
|
21
|
+
*/
|
|
22
|
+
export function detectServedModelMismatch(requestedModel, servedModels, tiers) {
|
|
23
|
+
const reqTier = tierOf(requestedModel.toLowerCase(), tiers);
|
|
24
|
+
if (!reqTier)
|
|
25
|
+
return null;
|
|
26
|
+
for (const served of servedModels) {
|
|
27
|
+
if (!served)
|
|
28
|
+
continue;
|
|
29
|
+
const tier = tierOf(served.toLowerCase(), tiers);
|
|
30
|
+
if (tier && tier !== reqTier)
|
|
31
|
+
return served.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=tiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiers.js","sourceRoot":"","sources":["../../src/models/tiers.ts"],"names":[],"m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AAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function makeNonce(): string;
|
|
2
|
+
export declare function nonceTag(nonce: string): string;
|
|
3
|
+
export declare function echoesNonce(text: string, nonce: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* The fixed prompt pair every token-count rule measures against. The short
|
|
6
|
+
* prompt anchors the count; the long one appends a known run of text, so the
|
|
7
|
+
* difference is the endpoint's tokenizer at work on that run alone. Anything a
|
|
8
|
+
* relay injects (a system prompt, a wrapper) is present in both and cancels.
|
|
9
|
+
*
|
|
10
|
+
* Do not change the text: every recorded delta was measured on exactly this
|
|
11
|
+
* pair, and a different run of text yields a different table of signatures.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SHORT_PROMPT = "Reply with exactly: ok";
|
|
14
|
+
export declare const LONG_PROMPT: string;
|
|
15
|
+
export declare const COUNT_PROBE_MAX_TOKENS = 16;
|
|
16
|
+
/**
|
|
17
|
+
* Multi-step GCD: hard enough that adaptive models decide to think, and
|
|
18
|
+
* deliberately not the 1071/462 pair from Anthropic's own docs, which a relay
|
|
19
|
+
* could special-case.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SIGNATURE_PROMPT = "Find the greatest common divisor of 2378 and 1547 using the Euclidean algorithm.";
|
|
22
|
+
export declare const FLOOR_PROMPT = "Reply with only the word ok.";
|
|
23
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/probes/prompts.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,IAAI,MAAM,CAIlC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,2BAA2B,CAAC;AACrD,eAAO,MAAM,WAAW,QAA6D,CAAC;AACtF,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,qFACuD,CAAC;AAErF,eAAO,MAAM,YAAY,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function makeNonce() {
|
|
2
|
+
const bytes = new Uint8Array(4);
|
|
3
|
+
crypto.getRandomValues(bytes);
|
|
4
|
+
return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
5
|
+
}
|
|
6
|
+
export function nonceTag(nonce) {
|
|
7
|
+
return `Begin your reply with the tag [${nonce}] then a space, then your answer.`;
|
|
8
|
+
}
|
|
9
|
+
export function echoesNonce(text, nonce) {
|
|
10
|
+
return text.includes(nonce.toLowerCase());
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The fixed prompt pair every token-count rule measures against. The short
|
|
14
|
+
* prompt anchors the count; the long one appends a known run of text, so the
|
|
15
|
+
* difference is the endpoint's tokenizer at work on that run alone. Anything a
|
|
16
|
+
* relay injects (a system prompt, a wrapper) is present in both and cancels.
|
|
17
|
+
*
|
|
18
|
+
* Do not change the text: every recorded delta was measured on exactly this
|
|
19
|
+
* pair, and a different run of text yields a different table of signatures.
|
|
20
|
+
*/
|
|
21
|
+
export const SHORT_PROMPT = "Reply with exactly: ok";
|
|
22
|
+
export const LONG_PROMPT = `${SHORT_PROMPT}\n\nReference text:${" apple".repeat(80)}`;
|
|
23
|
+
export const COUNT_PROBE_MAX_TOKENS = 16;
|
|
24
|
+
/**
|
|
25
|
+
* Multi-step GCD: hard enough that adaptive models decide to think, and
|
|
26
|
+
* deliberately not the 1071/462 pair from Anthropic's own docs, which a relay
|
|
27
|
+
* could special-case.
|
|
28
|
+
*/
|
|
29
|
+
export const SIGNATURE_PROMPT = "Find the greatest common divisor of 2378 and 1547 using the Euclidean algorithm.";
|
|
30
|
+
export const FLOOR_PROMPT = "Reply with only the word ok.";
|
|
31
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/probes/prompts.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS;IACvB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,kCAAkC,KAAK,mCAAmC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAa;IACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAwB,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,YAAY,sBAAsB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,kFAAkF,CAAC;AAErF,MAAM,CAAC,MAAM,YAAY,GAAG,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { VendorAdapter } from "../vendors/types";
|
|
2
|
+
/**
|
|
3
|
+
* A probe is a request plus a grader for its own reply. Probes are data, not
|
|
4
|
+
* rules: the ladder rules read across every probe's outcome (a quorum, a mux
|
|
5
|
+
* count), so a probe judging itself would be the wrong unit.
|
|
6
|
+
*/
|
|
7
|
+
export type ProbeDef<L extends string = string> = {
|
|
8
|
+
label: L;
|
|
9
|
+
maxTokens: number;
|
|
10
|
+
prompt(nonce: string): string;
|
|
11
|
+
grade(text: string, wire: VendorAdapter): boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const PROBES: readonly [{
|
|
14
|
+
readonly label: "emotional";
|
|
15
|
+
readonly maxTokens: 200;
|
|
16
|
+
readonly prompt: (n: string) => string;
|
|
17
|
+
readonly grade: (text: string) => boolean;
|
|
18
|
+
}, {
|
|
19
|
+
readonly label: "creative";
|
|
20
|
+
readonly maxTokens: 120;
|
|
21
|
+
readonly prompt: (n: string) => string;
|
|
22
|
+
readonly grade: (text: string) => boolean;
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "identity";
|
|
25
|
+
readonly maxTokens: 60;
|
|
26
|
+
readonly prompt: (n: string) => string;
|
|
27
|
+
readonly grade: (text: string, wire: VendorAdapter) => boolean;
|
|
28
|
+
}, {
|
|
29
|
+
readonly label: "model-name";
|
|
30
|
+
readonly maxTokens: 80;
|
|
31
|
+
readonly prompt: (n: string) => string;
|
|
32
|
+
readonly grade: (text: string, wire: VendorAdapter) => boolean;
|
|
33
|
+
}];
|
|
34
|
+
export type ProbeLabel = (typeof PROBES)[number]["label"];
|
|
35
|
+
export declare const PROBE_SIGNALS: readonly ["coding-tool", "scam", "foreign", "cloud-host", "cjk-leak", "blank"];
|
|
36
|
+
export type ProbeSignal = (typeof PROBE_SIGNALS)[number] | null;
|
|
37
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/probes/table.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAChD,KAAK,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,MAAM;oBAER,WAAW;wBACP,GAAG;yBACF,MAAM;2BAEJ,MAAM;;oBAIb,UAAU;wBACN,GAAG;yBACF,MAAM;2BAEJ,MAAM;;oBAIb,UAAU;wBACN,EAAE;yBACD,MAAM;2BAIJ,MAAM,QAAQ,aAAa;;oBAUlC,YAAY;wBACR,EAAE;yBACD,MAAM;2BAEJ,MAAM,QAAQ,aAAa;EAQL,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa,YACxB,aAAa,EACb,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,EACV,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cjkLeak, hasCodingToolRefusal, hasForeignIdentity, hasScamPage, includesAny, } from "../identity/signals";
|
|
2
|
+
import { CLOUD_HOST_PATTERNS, FAKE_RESPONSE_SIGNATURES, } from "../identity/patterns";
|
|
3
|
+
import { nonceTag } from "./prompts";
|
|
4
|
+
export const PROBES = [
|
|
5
|
+
{
|
|
6
|
+
label: "emotional",
|
|
7
|
+
maxTokens: 200,
|
|
8
|
+
prompt: (n) => `Tell me a 2-sentence sad story about a lost kitten. ${nonceTag(n)}`,
|
|
9
|
+
grade: (text) => !hasCodingToolRefusal(text) && !cjkLeak(text) && text.length >= 40,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: "creative",
|
|
13
|
+
maxTokens: 120,
|
|
14
|
+
prompt: (n) => `Write a haiku about the ocean at sunrise. ${nonceTag(n)}`,
|
|
15
|
+
grade: (text) => !hasCodingToolRefusal(text) && !cjkLeak(text) && text.length >= 25,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "identity",
|
|
19
|
+
maxTokens: 60,
|
|
20
|
+
prompt: (n) => "Which AI lab developed and trained the model you are running on? " +
|
|
21
|
+
"Not the company hosting you, the lab that trained the model. " +
|
|
22
|
+
`One word answer. ${nonceTag(n)}`,
|
|
23
|
+
grade: (text, wire) => {
|
|
24
|
+
if (hasCodingToolRefusal(text) || hasScamPage(text))
|
|
25
|
+
return false;
|
|
26
|
+
if (hasForeignIdentity(text, wire.identity, "identity"))
|
|
27
|
+
return false;
|
|
28
|
+
if (includesAny(text, wire.identity.home))
|
|
29
|
+
return true;
|
|
30
|
+
return (wire.identity.acceptsCloudHost && includesAny(text, CLOUD_HOST_PATTERNS));
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "model-name",
|
|
35
|
+
maxTokens: 80,
|
|
36
|
+
prompt: (n) => `Which model are you? Reply with only your model name. ${nonceTag(n)}`,
|
|
37
|
+
grade: (text, wire) => {
|
|
38
|
+
if (hasCodingToolRefusal(text) || hasScamPage(text))
|
|
39
|
+
return false;
|
|
40
|
+
if (hasForeignIdentity(text, wire.identity, "model-name"))
|
|
41
|
+
return false;
|
|
42
|
+
if (!includesAny(text, wire.identity.homeModelNames))
|
|
43
|
+
return false;
|
|
44
|
+
const stripped = text.replace(/^\s*\[[a-z0-9]{4,8}\]\s*/i, "").trim();
|
|
45
|
+
return !FAKE_RESPONSE_SIGNATURES.includes(stripped);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
export const PROBE_SIGNALS = [
|
|
50
|
+
"coding-tool",
|
|
51
|
+
"scam",
|
|
52
|
+
"foreign",
|
|
53
|
+
"cloud-host",
|
|
54
|
+
"cjk-leak",
|
|
55
|
+
"blank",
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/probes/table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAcrC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;QACE,KAAK,EAAE,WAAW;QAClB,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CACpB,uDAAuD,QAAQ,CAAC,CAAC,CAAC,EAAE;QACtE,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CACtB,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE;KACrE;IACD;QACE,KAAK,EAAE,UAAU;QACjB,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CACpB,6CAA6C,QAAQ,CAAC,CAAC,CAAC,EAAE;QAC5D,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CACtB,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE;KACrE;IACD;QACE,KAAK,EAAE,UAAU;QACjB,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CACpB,mEAAmE;YACnE,+DAA+D;YAC/D,oBAAoB,QAAQ,CAAC,CAAC,CAAC,E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,SAAS;IACT,YAAY;IACZ,UAAU;IACV,OAAO;CACC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FactsEntry } from "./models/facts";
|
|
2
|
+
import { type RuleId } from "./rules/table";
|
|
3
|
+
import type { Rule } from "./rules/types";
|
|
4
|
+
import type { RuleRun, VerifyOptions, VerifyResult } from "./types";
|
|
5
|
+
import { type VendorId } from "./vendors/table";
|
|
6
|
+
import type { VendorAdapter } from "./vendors/types";
|
|
7
|
+
import { type Registry } from "./verify";
|
|
8
|
+
/**
|
|
9
|
+
* A verifier with the built-in tables plus the caller's own vendors, rules and
|
|
10
|
+
* model facts. Consumer rules run after the built-ins (so they never outrank
|
|
11
|
+
* them); `omit` drops built-ins a consumer replaces or disagrees with; consumer
|
|
12
|
+
* model facts are consulted before the table.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createVerifier<V extends string = never, R extends string = never>(cfg: {
|
|
15
|
+
vendors?: readonly VendorAdapter<V>[];
|
|
16
|
+
rules?: readonly Rule<R>[];
|
|
17
|
+
omit?: readonly RuleId[];
|
|
18
|
+
modelFacts?: readonly FactsEntry[];
|
|
19
|
+
}): {
|
|
20
|
+
registry: Registry<"anthropic" | "gemini" | "openai" | V, "cjk-leak" | "coding-tool" | "envelope" | "foreign" | "mux" | "quorum" | "scam" | "served-model-mismatch" | "signature" | "substituted" | "thinking-floor" | "throughput" | "tier-self-report" | "token-truth" | "tokenizer-fingerprint" | R>;
|
|
21
|
+
verify: (opts: VerifyOptions<VendorId | V>) => Promise<VerifyResult<VendorId | V, RuleId | R>>;
|
|
22
|
+
runRules: (opts: VerifyOptions<VendorId | V> & {
|
|
23
|
+
only: readonly (RuleId | R)[];
|
|
24
|
+
}) => Promise<RuleRun<RuleId | R>>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],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
+
import { runRulesWith, verifyWith } from "./verify";
|
|
4
|
+
/**
|
|
5
|
+
* A verifier with the built-in tables plus the caller's own vendors, rules and
|
|
6
|
+
* model facts. Consumer rules run after the built-ins (so they never outrank
|
|
7
|
+
* them); `omit` drops built-ins a consumer replaces or disagrees with; consumer
|
|
8
|
+
* model facts are consulted before the table.
|
|
9
|
+
*/
|
|
10
|
+
export function createVerifier(cfg) {
|
|
11
|
+
const omit = new Set(cfg.omit ?? []);
|
|
12
|
+
const registry = {
|
|
13
|
+
vendors: [...VENDORS, ...(cfg.vendors ?? [])],
|
|
14
|
+
rules: [...RULES.filter((r) => !omit.has(r.id)), ...(cfg.rules ?? [])],
|
|
15
|
+
facts: cfg.modelFacts ?? [],
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
registry,
|
|
19
|
+
verify: (opts) => verifyWith(registry, opts),
|
|
20
|
+
runRules: (opts) => runRulesWith(registry, opts),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAiB,MAAM,UAAU,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAG5B,GAKD;IACC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAuC;QACnD,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC7C,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACtE,KAAK,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE;KAC5B,CAAC;IACF,OAAO;QACL,QAAQ;QACR,MAAM,EAAE,CACN,IAAiC,EACgB,EAAE,CACnD,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC;QAC5B,QAAQ,EAAE,CACR,IAAqE,EACvC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./table";
|
|
2
|
+
export { defineRule } from "./types";
|
|
3
|
+
export type * from "./types";
|
|
4
|
+
export { DEFAULT_MIN_COMPLETION_TOKENS, judgeThinkingFloor, judgeReasoningUsage, mustAlwaysThink, readThinkingUsage, } from "./thinking-floor";
|
|
5
|
+
export type { ThinkingFloorOptions, ThinkingFloorResult, ThinkingFloorState, } from "./thinking-floor";
|
|
6
|
+
export { DEFAULT_TIER_SIGNATURES, fingerprintDrifted, judgeTokenizerFingerprint, tierForDelta, } from "./tokenizer-fingerprint";
|
|
7
|
+
export type { TierSignatures, TokenizerFingerprintResult, TokenizerFingerprintState, } from "./tokenizer-fingerprint";
|
|
8
|
+
export type { SignatureResult, SignatureState } from "./thinking-signature";
|
|
9
|
+
export { expectedInputDelta } from "./token-truth";
|
|
10
|
+
export type { TokenTruthCheck, TokenTruthResult } from "./token-truth";
|
|
11
|
+
export { readResponseMetadata } from "./response-metadata";
|
|
12
|
+
export type { ResponseMetadata } from "./response-metadata";
|
|
13
|
+
export { compareThroughput, sampleThroughput } from "./throughput";
|
|
14
|
+
export type { ThroughputComparison, ThroughputSample } from "./throughput";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,cAAc,EACd,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./table";
|
|
2
|
+
export { defineRule } from "./types";
|
|
3
|
+
export { DEFAULT_MIN_COMPLETION_TOKENS, judgeThinkingFloor, judgeReasoningUsage, mustAlwaysThink, readThinkingUsage, } from "./thinking-floor";
|
|
4
|
+
export { DEFAULT_TIER_SIGNATURES, fingerprintDrifted, judgeTokenizerFingerprint, tierForDelta, } from "./tokenizer-fingerprint";
|
|
5
|
+
export { expectedInputDelta } from "./token-truth";
|
|
6
|
+
export { readResponseMetadata } from "./response-metadata";
|
|
7
|
+
export { compareThroughput, sampleThroughput } from "./throughput";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,GACb,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The behavioural ladder over the four probes, one rule per rung, in the order
|
|
3
|
+
* the table lists them. Each rule reads every probe's outcome, which is why the
|
|
4
|
+
* probes are data and the rules are here.
|
|
5
|
+
*/
|
|
6
|
+
export declare const codingToolRule: import("./types").Rule<"coding-tool", "probes", "probe">;
|
|
7
|
+
export declare const scamRule: import("./types").Rule<"scam", "probes", "probe">;
|
|
8
|
+
export declare const cjkLeakRule: import("./types").Rule<"cjk-leak", "probes", "probe">;
|
|
9
|
+
/** Two probes whose reply never carried their nonce: the proxy mixes responses. */
|
|
10
|
+
export declare const muxRule: import("./types").Rule<"mux", "probes", "probe">;
|
|
11
|
+
/**
|
|
12
|
+
* A foreign vendor on EITHER identity probe is a hard fail: a real model never
|
|
13
|
+
* names a competitor as its maker. The reason lists every foreign probe.
|
|
14
|
+
*/
|
|
15
|
+
export declare const foreignRule: import("./types").Rule<"foreign", "probes", "probe">;
|
|
16
|
+
/** The reply's own `model` field names another tier than the one requested. */
|
|
17
|
+
export declare const servedModelMismatchRule: import("./types").Rule<"served-model-mismatch", "probes", "probe">;
|
|
18
|
+
/** The reply's `model` field is not the requested model at all (lenient spelling). */
|
|
19
|
+
export declare const substitutedRule: import("./types").Rule<"substituted", "probes", "probe">;
|
|
20
|
+
/**
|
|
21
|
+
* Past the hard signals, the remaining failures are quality or transport. A
|
|
22
|
+
* shortfall driven only by transient upstream errors is inconclusive: a real
|
|
23
|
+
* lane that got rate limited mid-probe stays eligible and is probed again.
|
|
24
|
+
*/
|
|
25
|
+
export declare const quorumRule: import("./types").Rule<"quorum", "probes", "probe">;
|
|
26
|
+
/**
|
|
27
|
+
* What the model calls itself is coachable and unstable: a kiro pool's system
|
|
28
|
+
* prompt makes a real opus-4-6 answer "Claude 3.7 Sonnet" on one probe and
|
|
29
|
+
* refuse on the next. Logged only; the reply's model field and the tokenizer
|
|
30
|
+
* fingerprint are the evidence that fails a lane.
|
|
31
|
+
*/
|
|
32
|
+
export declare const tierSelfReportRule: import("./types").Rule<"tier-self-report", "probes", "note">;
|
|
33
|
+
//# sourceMappingURL=probe-ladder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-ladder.d.ts","sourceRoot":"","sources":["../../src/rules/probe-ladder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkCH,eAAO,MAAM,cAAc,0DAI1B,CAAC;AACF,eAAO,MAAM,QAAQ,mDAA0C,CAAC;AAChE,eAAO,MAAM,WAAW,uDAIvB,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,OAAO,kDAgBlB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,sDAmBtB,CAAC;AAEH,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,oEAoBlC,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,eAAe,0DAa1B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,qDA2BrB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,8DAoB7B,CAAC"}
|