@claudexor/harness-codex 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/effort-gate.d.ts +61 -0
- package/dist/effort-gate.d.ts.map +1 -0
- package/dist/effort-gate.js +61 -0
- package/dist/effort-gate.js.map +1 -0
- package/dist/effort-probe.d.ts +167 -0
- package/dist/effort-probe.d.ts.map +1 -0
- package/dist/effort-probe.js +487 -0
- package/dist/effort-probe.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -50
- package/dist/index.js.map +1 -1
- package/dist/parse.d.ts +4 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +47 -1
- package/dist/parse.js.map +1 -1
- package/dist/toml.d.ts +9 -0
- package/dist/toml.d.ts.map +1 -0
- package/dist/toml.js +33 -0
- package/dist/toml.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INV-105 version gate for the codex effort SNAPSHOT, plus the run's one
|
|
3
|
+
* effort-resolution seam. Split out of effort-probe.ts (discovery mechanics)
|
|
4
|
+
* so each file keeps a single altitude: the probe answers "what does the
|
|
5
|
+
* vendor advertise", this module answers "what may THIS run trust".
|
|
6
|
+
*/
|
|
7
|
+
import type { HarnessEvent, HarnessRunSpec } from "@claudexor/schema";
|
|
8
|
+
import { type CodexEffortCatalog, type CodexEffortProbe } from "./effort-probe.js";
|
|
9
|
+
/**
|
|
10
|
+
* Whether the recorded snapshot may be TRUSTED for arg emission against the
|
|
11
|
+
* installed binary (INV-105). The snapshot is another CLI version's recorded
|
|
12
|
+
* `model/list` answer, so it is only that binary's truth on the exact version
|
|
13
|
+
* it was captured from: 0.144.1 advertises `ultra` on gpt-5.6-sol, an older
|
|
14
|
+
* codex may not, and an install whose live probe failed used to be handed the
|
|
15
|
+
* 0.144.1 catalog anyway — `model_reasoning_effort="ultra"` then went to a CLI
|
|
16
|
+
* that refuses the value. Mirrors `claudeSnapshotTrustedForVersion`.
|
|
17
|
+
*
|
|
18
|
+
* The installed version string is whatever `codex --version` printed
|
|
19
|
+
* (e.g. `codex-cli 0.144.1`), so the comparison extracts the full dotted
|
|
20
|
+
* numeric token and requires it to EQUAL the snapshot stamp exactly. An
|
|
21
|
+
* unknown or unparseable version can never vouch for the snapshot.
|
|
22
|
+
*/
|
|
23
|
+
export declare function codexSnapshotTrustedForVersion(installedVersion: string | null): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The effort catalog the RUN may resolve `model_reasoning_effort` against,
|
|
26
|
+
* version-gating snapshot trust (INV-105) — the codex mirror of
|
|
27
|
+
* `claudeAdvertisedEffortsForRun`:
|
|
28
|
+
*
|
|
29
|
+
* - a LIVE `model/list` answer is the installed binary's own truth for the
|
|
30
|
+
* resolved env's account — trusted on any version;
|
|
31
|
+
* - the snapshot FALLBACK is trusted only when the installed version equals
|
|
32
|
+
* `CODEX_EFFORT_SNAPSHOT_VERIFIED_AGAINST` (same binary, same catalog);
|
|
33
|
+
* - a fallback on ANY OTHER version (mismatch, unknown, unparseable) yields an
|
|
34
|
+
* EMPTY catalog: the resolver then sends no effort flag at all, and the
|
|
35
|
+
* existing drop seam (`codexEffortIgnoredEvent`) discloses it — the run
|
|
36
|
+
* proceeds at the vendor default rather than forwarding a level another
|
|
37
|
+
* version's snapshot advertises to a binary that may reject it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function codexCatalogForRun(efforts: {
|
|
40
|
+
catalog: CodexEffortCatalog;
|
|
41
|
+
live: boolean;
|
|
42
|
+
}, installedVersion: string | null): CodexEffortCatalog;
|
|
43
|
+
/**
|
|
44
|
+
* The RUN's whole INV-105 effort seam in one place — the codex mirror of
|
|
45
|
+
* `claudeRunEffortResolution`: probe the catalog for THIS run's resolved env
|
|
46
|
+
* (profile / API-key `CODEX_HOME`s have their own accounts), version-gate
|
|
47
|
+
* snapshot-fallback trust (`codexCatalogForRun`), and derive the DROP/CLAMP
|
|
48
|
+
* disclosure on the SAME catalog the arg builder will resolve against — so the
|
|
49
|
+
* flag sent and the disclosure emitted can never disagree. The `--version`
|
|
50
|
+
* spawn happens only when it can matter (snapshot fallback AND an effort
|
|
51
|
+
* actually requested); a live probe or a hint-less run never pays for it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function codexRunEffortResolution(spec: Pick<HarnessRunSpec, "session_id" | "model_hint" | "effort_hint">, deps: {
|
|
54
|
+
probeEfforts: CodexEffortProbe;
|
|
55
|
+
nowMs: () => number;
|
|
56
|
+
detectVersion: (abortSignal?: AbortSignal, env?: Record<string, string | null | undefined>) => Promise<string | null>;
|
|
57
|
+
}, envPatch?: Record<string, string | null | undefined>, abortSignal?: AbortSignal): Promise<{
|
|
58
|
+
catalog: CodexEffortCatalog;
|
|
59
|
+
disclosure: HarnessEvent | null;
|
|
60
|
+
}>;
|
|
61
|
+
//# sourceMappingURL=effort-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effort-gate.d.ts","sourceRoot":"","sources":["../src/effort-gate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAIvF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,EACvD,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAC9B,kBAAkB,CAKpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC,EACvE,IAAI,EAAE;IACJ,YAAY,EAAE,gBAAgB,CAAC;IAC/B,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,aAAa,EAAE,CACb,WAAW,CAAC,EAAE,WAAW,EACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,KAC5C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B,EACD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EACpD,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,CAAC;IAAC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,CAAC,CAO3E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CODEX_EFFORT_SNAPSHOT_VERIFIED_AGAINST, codexEffortDisclosureEvent, codexEffortsForEnv, } from "./effort-probe.js";
|
|
2
|
+
/**
|
|
3
|
+
* Whether the recorded snapshot may be TRUSTED for arg emission against the
|
|
4
|
+
* installed binary (INV-105). The snapshot is another CLI version's recorded
|
|
5
|
+
* `model/list` answer, so it is only that binary's truth on the exact version
|
|
6
|
+
* it was captured from: 0.144.1 advertises `ultra` on gpt-5.6-sol, an older
|
|
7
|
+
* codex may not, and an install whose live probe failed used to be handed the
|
|
8
|
+
* 0.144.1 catalog anyway — `model_reasoning_effort="ultra"` then went to a CLI
|
|
9
|
+
* that refuses the value. Mirrors `claudeSnapshotTrustedForVersion`.
|
|
10
|
+
*
|
|
11
|
+
* The installed version string is whatever `codex --version` printed
|
|
12
|
+
* (e.g. `codex-cli 0.144.1`), so the comparison extracts the full dotted
|
|
13
|
+
* numeric token and requires it to EQUAL the snapshot stamp exactly. An
|
|
14
|
+
* unknown or unparseable version can never vouch for the snapshot.
|
|
15
|
+
*/
|
|
16
|
+
export function codexSnapshotTrustedForVersion(installedVersion) {
|
|
17
|
+
if (installedVersion === null)
|
|
18
|
+
return false;
|
|
19
|
+
const token = installedVersion.match(/\d+(?:\.\d+)+/);
|
|
20
|
+
return token !== null && token[0] === CODEX_EFFORT_SNAPSHOT_VERIFIED_AGAINST;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The effort catalog the RUN may resolve `model_reasoning_effort` against,
|
|
24
|
+
* version-gating snapshot trust (INV-105) — the codex mirror of
|
|
25
|
+
* `claudeAdvertisedEffortsForRun`:
|
|
26
|
+
*
|
|
27
|
+
* - a LIVE `model/list` answer is the installed binary's own truth for the
|
|
28
|
+
* resolved env's account — trusted on any version;
|
|
29
|
+
* - the snapshot FALLBACK is trusted only when the installed version equals
|
|
30
|
+
* `CODEX_EFFORT_SNAPSHOT_VERIFIED_AGAINST` (same binary, same catalog);
|
|
31
|
+
* - a fallback on ANY OTHER version (mismatch, unknown, unparseable) yields an
|
|
32
|
+
* EMPTY catalog: the resolver then sends no effort flag at all, and the
|
|
33
|
+
* existing drop seam (`codexEffortIgnoredEvent`) discloses it — the run
|
|
34
|
+
* proceeds at the vendor default rather than forwarding a level another
|
|
35
|
+
* version's snapshot advertises to a binary that may reject it.
|
|
36
|
+
*/
|
|
37
|
+
export function codexCatalogForRun(efforts, installedVersion) {
|
|
38
|
+
if (efforts.live)
|
|
39
|
+
return efforts.catalog;
|
|
40
|
+
return codexSnapshotTrustedForVersion(installedVersion)
|
|
41
|
+
? efforts.catalog
|
|
42
|
+
: { models: {}, defaultModel: null };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The RUN's whole INV-105 effort seam in one place — the codex mirror of
|
|
46
|
+
* `claudeRunEffortResolution`: probe the catalog for THIS run's resolved env
|
|
47
|
+
* (profile / API-key `CODEX_HOME`s have their own accounts), version-gate
|
|
48
|
+
* snapshot-fallback trust (`codexCatalogForRun`), and derive the DROP/CLAMP
|
|
49
|
+
* disclosure on the SAME catalog the arg builder will resolve against — so the
|
|
50
|
+
* flag sent and the disclosure emitted can never disagree. The `--version`
|
|
51
|
+
* spawn happens only when it can matter (snapshot fallback AND an effort
|
|
52
|
+
* actually requested); a live probe or a hint-less run never pays for it.
|
|
53
|
+
*/
|
|
54
|
+
export async function codexRunEffortResolution(spec, deps, envPatch, abortSignal) {
|
|
55
|
+
const efforts = await codexEffortsForEnv(deps, envPatch);
|
|
56
|
+
const catalog = efforts.live || !spec.effort_hint
|
|
57
|
+
? efforts.catalog
|
|
58
|
+
: codexCatalogForRun(efforts, await deps.detectVersion(abortSignal, envPatch));
|
|
59
|
+
return { catalog, disclosure: codexEffortDisclosureEvent(catalog, spec) };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=effort-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effort-gate.js","sourceRoot":"","sources":["../src/effort-gate.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,sCAAsC,EACtC,0BAA0B,EAC1B,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,8BAA8B,CAAC,gBAA+B;IAC5E,IAAI,gBAAgB,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACtD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,sCAAsC,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAuD,EACvD,gBAA+B;IAE/B,IAAI,OAAO,CAAC,IAAI;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC;IACzC,OAAO,8BAA8B,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,OAAO,CAAC,OAAO;QACjB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAuE,EACvE,IAOC,EACD,QAAoD,EACpD,WAAyB;IAEzB,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzD,MAAM,OAAO,GACX,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW;QAC/B,CAAC,CAAC,OAAO,CAAC,OAAO;QACjB,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,0BAA0B,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { HarnessEvent, HarnessRunSpec, ModelEffortCapability } from "@claudexor/schema";
|
|
2
|
+
import { EffortHint } from "@claudexor/schema";
|
|
3
|
+
export type CodexEffortCapability = Record<string, ModelEffortCapability>;
|
|
4
|
+
/**
|
|
5
|
+
* One account's whole advertised effort surface: the per-model vocabularies
|
|
6
|
+
* PLUS which model codex itself runs when no `-m` is given (`model/list` marks
|
|
7
|
+
* it with `isDefault`). The default matters for effort resolution: a run with
|
|
8
|
+
* no model hint executes on the DEFAULT model, so its ladder — not the
|
|
9
|
+
* harness-wide union — is what a requested level must be held to.
|
|
10
|
+
*/
|
|
11
|
+
export interface CodexEffortCatalog {
|
|
12
|
+
models: CodexEffortCapability;
|
|
13
|
+
/** `model/list` entry flagged `isDefault: true`; null when the vendor marked none. */
|
|
14
|
+
defaultModel: string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Recorded fallback, captured from a live `model/list` on the CLI version
|
|
18
|
+
* stamped below. Used ONLY when the live probe cannot answer; it is a snapshot
|
|
19
|
+
* of vendor state, never an allow-list this repo maintains by hand.
|
|
20
|
+
* (`defaultModel` is the entry that carried `isDefault: true` in that capture.)
|
|
21
|
+
*/
|
|
22
|
+
export declare const CODEX_EFFORT_SNAPSHOT: CodexEffortCatalog;
|
|
23
|
+
/** Vendor CLI version `CODEX_EFFORT_SNAPSHOT` was captured from. */
|
|
24
|
+
export declare const CODEX_EFFORT_SNAPSHOT_VERIFIED_AGAINST = "0.144.1";
|
|
25
|
+
/**
|
|
26
|
+
* Harness-wide merged ladder of an advertised catalog, weakest→strongest. Kept
|
|
27
|
+
* as the coarse `effort_levels` fallback so every existing reader (settings
|
|
28
|
+
* validation, the composer's picker, INV-105 disclosure) keeps working while
|
|
29
|
+
* per-model narrowing happens through `effortLevelsForModel`.
|
|
30
|
+
*
|
|
31
|
+
* Ordering authority is the VENDOR: `model/list` returns each model's
|
|
32
|
+
* `supportedReasoningEfforts` already ordered weakest→strongest, so the
|
|
33
|
+
* harness ladder is the positional merge of those lists (`mergeEffortLadders`)
|
|
34
|
+
* — never a table this repo maintains. The Swift composer merges the manifests'
|
|
35
|
+
* already-ordered arrays the same way, so both sides of the wire agree.
|
|
36
|
+
*
|
|
37
|
+
* A level NO model orders against the rest (`unconstrained`) still belongs to
|
|
38
|
+
* the advertised set — some model really accepts it — but has no honest rank,
|
|
39
|
+
* so it trails the ranked merge here (membership/display) while staying
|
|
40
|
+
* excluded from the clamping order (`mergeEffortLadders.order`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function unionEffortLevels(capability: CodexEffortCapability): EffortHint[];
|
|
43
|
+
/**
|
|
44
|
+
* The whole `model/list` payload as a capability map, or null for a FAILED probe.
|
|
45
|
+
*
|
|
46
|
+
* STRICT on purpose (the reviewed decision): ONE malformed value discards the
|
|
47
|
+
* ENTIRE live catalog and the caller degrades to the recorded snapshot, which is
|
|
48
|
+
* exactly what this module promises. Skipping the bad entry instead would publish
|
|
49
|
+
* a silently NARROWED ladder — a model advertising `["low", "HIGH!"]` would go out
|
|
50
|
+
* as `["low"]`, stamped with the installed CLI version, so a `high` request would
|
|
51
|
+
* clamp down to `low` and the freshness gate would call the ladder fresh. And a
|
|
52
|
+
* malformed value that reached the manifest would fail `HarnessManifest.parse`,
|
|
53
|
+
* breaking discovery rather than degrading it. The snapshot is a real, usable
|
|
54
|
+
* ladder, so strictness costs freshness and never capability.
|
|
55
|
+
*
|
|
56
|
+
* `defaultModel` is the entry the vendor flagged `isDefault: true`
|
|
57
|
+
* (live-verified on 0.144.1). Only a literal boolean true counts: the flag is
|
|
58
|
+
* model identity, not part of the effort wire contract, so an absent or odd
|
|
59
|
+
* value degrades the default to null rather than poisoning the catalog.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readModelListEfforts(data: unknown): CodexEffortCatalog | null;
|
|
62
|
+
/**
|
|
63
|
+
* Ask a live `codex app-server` what each model advertises. Resolves to null on
|
|
64
|
+
* ANY failure — the caller falls back to the snapshot.
|
|
65
|
+
*/
|
|
66
|
+
export declare function probeCodexEfforts(bin: string, opts?: {
|
|
67
|
+
timeoutMs?: number;
|
|
68
|
+
env?: NodeJS.ProcessEnv;
|
|
69
|
+
}): Promise<CodexEffortCatalog | null>;
|
|
70
|
+
/** Drop the cached effort probe (tests; and the doctor's `fresh` path). */
|
|
71
|
+
export declare function clearCodexEffortCache(): void;
|
|
72
|
+
/** Live entry count. Exported so the bound above can be asserted, not assumed. */
|
|
73
|
+
export declare function codexEffortCacheSize(): number;
|
|
74
|
+
/** Live per-model discovery for one binary in one resolved environment. */
|
|
75
|
+
export type CodexEffortProbe = (bin: string, env?: NodeJS.ProcessEnv) => Promise<CodexEffortCatalog | null>;
|
|
76
|
+
/**
|
|
77
|
+
* The per-model effort vocabulary codex currently advertises FOR THIS ENV. Live
|
|
78
|
+
* when the app-server answers, the recorded snapshot otherwise — a probe failure
|
|
79
|
+
* degrades the ladder's freshness, never the run.
|
|
80
|
+
*/
|
|
81
|
+
export declare function codexEffortCapability(probe: CodexEffortProbe, nowMs: () => number, bin: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
82
|
+
catalog: CodexEffortCatalog;
|
|
83
|
+
live: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* The catalog for the environment a codex child will ACTUALLY run in. ONE owner
|
|
87
|
+
* of that resolution: callers hand over their env PATCH (spec env + provider
|
|
88
|
+
* scrub + the resolved `CODEX_HOME`) and this resolves it exactly the way the
|
|
89
|
+
* spawn will, so the probe env and the cache identity can never disagree.
|
|
90
|
+
*
|
|
91
|
+
* An API-key route uses a fresh temporary `CODEX_HOME` per run, so it re-probes
|
|
92
|
+
* each time by construction. That is the correct trade: one bounded app-server
|
|
93
|
+
* spawn instead of a cross-account catalog served out of the cache.
|
|
94
|
+
*/
|
|
95
|
+
export declare function codexEffortsForEnv(deps: {
|
|
96
|
+
probeEfforts: CodexEffortProbe;
|
|
97
|
+
nowMs: () => number;
|
|
98
|
+
}, envPatch?: Record<string, string | null | undefined>): Promise<{
|
|
99
|
+
catalog: CodexEffortCatalog;
|
|
100
|
+
live: boolean;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* The full outcome of resolving one (model, requested) pair against a catalog:
|
|
104
|
+
* what to send, whether the merged vendor order MOVED it there, and which
|
|
105
|
+
* model's ladder decided. `codexEffortFor` keeps only the level for the arg
|
|
106
|
+
* builder; the disclosure seams need the other two facts, because a CLAMP is a
|
|
107
|
+
* changed setting the user asked for differently (INV-105) even though a flag
|
|
108
|
+
* is still sent.
|
|
109
|
+
*/
|
|
110
|
+
export interface CodexEffortResolution {
|
|
111
|
+
/** The level to send, or null when no flag should be sent at all. */
|
|
112
|
+
effort: EffortHint | null;
|
|
113
|
+
/** True when `effort` differs from the request — the merged vendor order clamped it. */
|
|
114
|
+
clamped: boolean;
|
|
115
|
+
/** The model whose advertised ladder decided this (the hint, or the catalog default). */
|
|
116
|
+
effectiveModel: string | null;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The effort value to send for one (model, requested) pair: advertised passes
|
|
120
|
+
* through verbatim, a level a SIBLING model advertises clamps inside the merged
|
|
121
|
+
* vendor order (`ultra` on gpt-5.4 → `xhigh` because the merged codex ladder
|
|
122
|
+
* places it), anything else sends no flag at all.
|
|
123
|
+
*
|
|
124
|
+
* If a future catalog ever contains two models whose advertised orders
|
|
125
|
+
* genuinely contradict each other, there is no honest merged rank — so
|
|
126
|
+
* cross-model clamping is treated as IMPOSSIBLE (the ladder collapses to the
|
|
127
|
+
* model's own list) and an unadvertised level is refused rather than clamped
|
|
128
|
+
* along an order this repo would have had to invent.
|
|
129
|
+
*/
|
|
130
|
+
export declare function codexEffortResolution(catalog: CodexEffortCatalog, model: string | null | undefined, requested: EffortHint | null | undefined): CodexEffortResolution;
|
|
131
|
+
/**
|
|
132
|
+
* The level the arg builder should emit for one (model, requested) pair, or
|
|
133
|
+
* null when no flag should be sent. Thin projection of
|
|
134
|
+
* `codexEffortResolution`; the run-side disclosure seams read the full
|
|
135
|
+
* resolution so a clamp or a drop is never silent.
|
|
136
|
+
*/
|
|
137
|
+
export declare function codexEffortFor(catalog: CodexEffortCatalog, model: string | null | undefined, requested: EffortHint | null | undefined): EffortHint | null;
|
|
138
|
+
/**
|
|
139
|
+
* The INV-105 disclosure for an effort the RUN itself could not honor, or null
|
|
140
|
+
* when nothing was dropped. Preflight validates against the manifest — the
|
|
141
|
+
* DEFAULT account's catalog — but the adapter resolves against the catalog for
|
|
142
|
+
* the env the child actually runs in (profile / API-key homes have their own
|
|
143
|
+
* accounts), so a level can pass preflight and still resolve to "send no flag"
|
|
144
|
+
* here. Without this event that run silently executed at the vendor default;
|
|
145
|
+
* the payload rides the same `ignored_settings` channel governance uses, so
|
|
146
|
+
* the timeline renders the same warning either way.
|
|
147
|
+
*/
|
|
148
|
+
export declare function codexEffortIgnoredEvent(catalog: CodexEffortCatalog, spec: Pick<HarnessRunSpec, "session_id" | "model_hint" | "effort_hint">): HarnessEvent | null;
|
|
149
|
+
/**
|
|
150
|
+
* The INV-105 disclosure for an effort the run CLAMPED, or null when the
|
|
151
|
+
* requested level rode through verbatim (or was dropped — that is
|
|
152
|
+
* `codexEffortIgnoredEvent`'s shape, and the two are mutually exclusive: a
|
|
153
|
+
* drop sends no level, a clamp sends a different one). A clamp is quieter than
|
|
154
|
+
* a drop but just as much a changed setting: `--effort ultra` on gpt-5.4 runs
|
|
155
|
+
* at `xhigh`, and without this event nothing in the timeline said so. The
|
|
156
|
+
* payload rides the same `ignored_settings` channel governance and the drop
|
|
157
|
+
* seam use, so every existing reader renders the same warning.
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* The one INV-105 seam the run yields: the DROP disclosure or the CLAMP
|
|
161
|
+
* disclosure, whichever applies (they are mutually exclusive by construction —
|
|
162
|
+
* a drop sends no flag, a clamp sends a different one), or null when the
|
|
163
|
+
* requested level rode through verbatim or nothing was requested.
|
|
164
|
+
*/
|
|
165
|
+
export declare function codexEffortDisclosureEvent(catalog: CodexEffortCatalog, spec: Pick<HarnessRunSpec, "session_id" | "model_hint" | "effort_hint">): HarnessEvent | null;
|
|
166
|
+
export declare function codexEffortClampedEvent(catalog: CodexEffortCatalog, spec: Pick<HarnessRunSpec, "session_id" | "model_hint" | "effort_hint">): HarnessEvent | null;
|
|
167
|
+
//# sourceMappingURL=effort-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effort-probe.d.ts","sourceRoot":"","sources":["../src/effort-probe.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAA4C,MAAM,mBAAmB,CAAC;AAKzF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,E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