@markstanden/opencode-test-container 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +263 -2
- package/container/Containerfile +24 -0
- package/container/README.md +29 -0
- package/dist/adapters/opencode/events.d.ts +90 -0
- package/dist/adapters/opencode/events.js +213 -0
- package/dist/adapters/opencode/runtime.d.ts +87 -0
- package/dist/adapters/opencode/runtime.js +136 -0
- package/dist/adapters/podman/container.d.ts +62 -0
- package/dist/adapters/podman/container.js +119 -0
- package/dist/adapters/podman/image.d.ts +50 -0
- package/dist/adapters/podman/image.js +124 -0
- package/dist/adapters/process.d.ts +38 -0
- package/dist/adapters/process.js +71 -0
- package/dist/campaign/assess.d.ts +45 -0
- package/dist/campaign/assess.js +208 -0
- package/dist/campaign/close.d.ts +17 -0
- package/dist/campaign/close.js +112 -0
- package/dist/campaign/evidence-guard.d.ts +24 -0
- package/dist/campaign/evidence-guard.js +49 -0
- package/dist/campaign/freeze.d.ts +94 -0
- package/dist/campaign/freeze.js +297 -0
- package/dist/campaign/inventory.d.ts +62 -0
- package/dist/campaign/inventory.js +192 -0
- package/dist/campaign/judge.d.ts +209 -0
- package/dist/campaign/judge.js +1285 -0
- package/dist/campaign/ledger.d.ts +64 -0
- package/dist/campaign/ledger.js +149 -0
- package/dist/campaign/prepare.d.ts +129 -0
- package/dist/campaign/prepare.js +483 -0
- package/dist/campaign/primary.d.ts +96 -0
- package/dist/campaign/primary.js +189 -0
- package/dist/campaign/run.d.ts +151 -0
- package/dist/campaign/run.js +562 -0
- package/dist/campaign/status.d.ts +76 -0
- package/dist/campaign/status.js +237 -0
- package/dist/cli/otc.d.ts +51 -0
- package/dist/cli/otc.js +435 -0
- package/dist/contracts/canonical.d.ts +21 -0
- package/dist/contracts/canonical.js +44 -0
- package/dist/contracts/types.d.ts +261 -0
- package/dist/contracts/types.js +9 -0
- package/dist/contracts/validate.d.ts +72 -0
- package/dist/contracts/validate.js +1021 -0
- package/dist/contracts/version.d.ts +44 -0
- package/dist/contracts/version.js +147 -0
- package/dist/evaluators/docs/analysis/accounting.d.ts +140 -0
- package/dist/evaluators/docs/analysis/accounting.js +237 -0
- package/dist/evaluators/docs/analysis/blinding.d.ts +40 -0
- package/dist/evaluators/docs/analysis/blinding.js +80 -0
- package/dist/evaluators/docs/analysis/bounds.d.ts +40 -0
- package/dist/evaluators/docs/analysis/bounds.js +31 -0
- package/dist/evaluators/docs/analysis/budget.d.ts +137 -0
- package/dist/evaluators/docs/analysis/budget.js +305 -0
- package/dist/evaluators/docs/analysis/closure.d.ts +175 -0
- package/dist/evaluators/docs/analysis/closure.js +251 -0
- package/dist/evaluators/docs/analysis/decision.d.ts +59 -0
- package/dist/evaluators/docs/analysis/decision.js +161 -0
- package/dist/evaluators/docs/analysis/freeze.d.ts +201 -0
- package/dist/evaluators/docs/analysis/freeze.js +395 -0
- package/dist/evaluators/docs/analysis/guardrails.d.ts +51 -0
- package/dist/evaluators/docs/analysis/guardrails.js +194 -0
- package/dist/evaluators/docs/analysis/journal.d.ts +150 -0
- package/dist/evaluators/docs/analysis/journal.js +475 -0
- package/dist/evaluators/docs/analysis/ledger.d.ts +78 -0
- package/dist/evaluators/docs/analysis/ledger.js +145 -0
- package/dist/evaluators/docs/analysis/measures.d.ts +302 -0
- package/dist/evaluators/docs/analysis/measures.js +1069 -0
- package/dist/evaluators/docs/analysis/model.d.ts +236 -0
- package/dist/evaluators/docs/analysis/model.js +740 -0
- package/dist/evaluators/docs/analysis/pairing.d.ts +68 -0
- package/dist/evaluators/docs/analysis/pairing.js +95 -0
- package/dist/evaluators/docs/analysis/records.d.ts +229 -0
- package/dist/evaluators/docs/analysis/records.js +935 -0
- package/dist/evaluators/docs/analysis/recovery.d.ts +225 -0
- package/dist/evaluators/docs/analysis/recovery.js +507 -0
- package/dist/evaluators/docs/analysis/render.d.ts +235 -0
- package/dist/evaluators/docs/analysis/render.js +566 -0
- package/dist/evaluators/docs/analysis/replay.d.ts +15 -0
- package/dist/evaluators/docs/analysis/replay.js +1272 -0
- package/dist/evaluators/docs/analysis/screening/inventory.d.ts +136 -0
- package/dist/evaluators/docs/analysis/screening/inventory.js +307 -0
- package/dist/evaluators/docs/analysis/screening/noteVersion.d.ts +15 -0
- package/dist/evaluators/docs/analysis/screening/noteVersion.js +46 -0
- package/dist/evaluators/docs/analysis/screening/reconcile.d.ts +38 -0
- package/dist/evaluators/docs/analysis/screening/reconcile.js +40 -0
- package/dist/evaluators/docs/analysis/screening/rules.d.ts +163 -0
- package/dist/evaluators/docs/analysis/screening/rules.js +330 -0
- package/dist/evaluators/docs/analysis/screening/scan.d.ts +72 -0
- package/dist/evaluators/docs/analysis/screening/scan.js +362 -0
- package/dist/evaluators/docs/analysis/selector.d.ts +68 -0
- package/dist/evaluators/docs/analysis/selector.js +123 -0
- package/dist/evaluators/docs/assess.d.ts +129 -0
- package/dist/evaluators/docs/assess.js +433 -0
- package/dist/evaluators/docs/campaign.d.ts +133 -0
- package/dist/evaluators/docs/campaign.js +222 -0
- package/dist/evaluators/docs/index.d.ts +25 -0
- package/dist/evaluators/docs/index.js +25 -0
- package/dist/evaluators/docs/journal.d.ts +150 -0
- package/dist/evaluators/docs/journal.js +475 -0
- package/dist/evaluators/docs/scoring.d.ts +367 -0
- package/dist/evaluators/docs/scoring.js +662 -0
- package/dist/evaluators/skills/assess.d.ts +94 -0
- package/dist/evaluators/skills/assess.js +207 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +29 -0
- package/dist/legacy/prod014.d.ts +86 -0
- package/dist/legacy/prod014.js +209 -0
- package/dist/reporting/report.d.ts +79 -0
- package/dist/reporting/report.js +242 -0
- package/docs/architecture.md +106 -0
- package/docs/capability-matrix.md +84 -0
- package/docs/offline-rehearsal.md +75 -0
- package/docs/parity-record.md +81 -0
- package/docs/pr-description.md +103 -0
- package/docs/release-0.1.0.md +52 -0
- package/docs/releasing.md +82 -0
- package/docs/schema.md +97 -0
- package/examples/skills/README.md +13 -0
- package/examples/skills/campaign.json +73 -0
- package/examples/skills/skills/otel-helper/SKILL.md +10 -0
- package/examples/skills/suite.json +29 -0
- package/package.json +45 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pairing for the analysis framework.
|
|
3
|
+
*
|
|
4
|
+
* Pairs come from the declared pair identities in the manifest schedule and
|
|
5
|
+
* are matched to observations by declared slot identity — never by array
|
|
6
|
+
* adjacency. A complete pair holds an assessed observation for every declared
|
|
7
|
+
* arm; an incomplete pair yields its assessed sides as unmatched observations,
|
|
8
|
+
* and observations outside any declared pair stay visible as unpaired.
|
|
9
|
+
*/
|
|
10
|
+
import type { TrialScored } from "./accounting.ts";
|
|
11
|
+
import type { Interval } from "./bounds.ts";
|
|
12
|
+
import type { SlotSpec } from "./model.ts";
|
|
13
|
+
/** One declared pair with its observations by arm. */
|
|
14
|
+
export interface PairView {
|
|
15
|
+
/** The declared pair id. */
|
|
16
|
+
pairId: string;
|
|
17
|
+
/** The pair's scenario. */
|
|
18
|
+
scenario: string;
|
|
19
|
+
/** The pair's repetition. */
|
|
20
|
+
repetition: number;
|
|
21
|
+
/** Observations keyed by declared arm; undefined when absent. */
|
|
22
|
+
arms: Record<string, TrialScored | undefined>;
|
|
23
|
+
/** Whether every declared arm has a fully assessed observation. */
|
|
24
|
+
complete: boolean;
|
|
25
|
+
/** Declared arms without a fully assessed observation. */
|
|
26
|
+
missingArms: string[];
|
|
27
|
+
}
|
|
28
|
+
/** The pairing result for one measured population. */
|
|
29
|
+
export interface PairingResult {
|
|
30
|
+
/** Declared pairs in declared order. */
|
|
31
|
+
pairs: PairView[];
|
|
32
|
+
/** Assessed observations in incomplete pairs. */
|
|
33
|
+
unmatched: TrialScored[];
|
|
34
|
+
/** Observations outside any declared pair. */
|
|
35
|
+
unpaired: TrialScored[];
|
|
36
|
+
/** Evidence problems found while pairing (e.g. duplicate observations). */
|
|
37
|
+
problems: string[];
|
|
38
|
+
}
|
|
39
|
+
/** A candidate-minus-control comparison over complete pairs. */
|
|
40
|
+
export interface PairedComparison {
|
|
41
|
+
/** Complete pairs carrying both compared arms. */
|
|
42
|
+
completePairs: number;
|
|
43
|
+
/** Pairs where the control scored higher. */
|
|
44
|
+
controlBetter: number;
|
|
45
|
+
/** Pairs where the candidate scored higher. */
|
|
46
|
+
candidateBetter: number;
|
|
47
|
+
/** Pairs with equal scores. */
|
|
48
|
+
ties: number;
|
|
49
|
+
/** Summed candidate-minus-control delta over complete pairs. */
|
|
50
|
+
delta: number;
|
|
51
|
+
/** Closed delta interval from the per-arm bounds. */
|
|
52
|
+
interval: Interval;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Pair a measured population by declared identity.
|
|
56
|
+
* @param scored The scored trials.
|
|
57
|
+
* @param slots The declared schedule slots.
|
|
58
|
+
* @returns Complete pairs, unmatched observations, unpaired evidence and problems.
|
|
59
|
+
*/
|
|
60
|
+
export declare function pairObservations(scored: readonly TrialScored[], slots: readonly SlotSpec[]): PairingResult;
|
|
61
|
+
/**
|
|
62
|
+
* Compare a candidate arm against a control arm over complete pairs.
|
|
63
|
+
* @param pairs The paired population.
|
|
64
|
+
* @param controlArm The control arm id.
|
|
65
|
+
* @param candidateArm The candidate arm id.
|
|
66
|
+
* @returns Pair counts, the summed delta and its interval.
|
|
67
|
+
*/
|
|
68
|
+
export declare function pairedComparison(pairs: readonly PairView[], controlArm: string, candidateArm: string): PairedComparison;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build one pair view from its declared slots.
|
|
3
|
+
* @param pairId The declared pair id.
|
|
4
|
+
* @param group The pair's slots, in declared order.
|
|
5
|
+
* @param bySlot First-attempt observations keyed by slot number.
|
|
6
|
+
* @returns The pair view.
|
|
7
|
+
*/
|
|
8
|
+
function pairViewOf(pairId, group, bySlot) {
|
|
9
|
+
const arms = {};
|
|
10
|
+
const missingArms = [];
|
|
11
|
+
for (const slot of group) {
|
|
12
|
+
const row = bySlot.get(slot.slot);
|
|
13
|
+
arms[slot.arm] = row;
|
|
14
|
+
if (row === undefined || !row.utility.assessed) {
|
|
15
|
+
missingArms.push(slot.arm);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
pairId,
|
|
20
|
+
scenario: group[0]?.scenario ?? "",
|
|
21
|
+
repetition: group[0]?.repetition ?? 0,
|
|
22
|
+
arms,
|
|
23
|
+
complete: missingArms.length === 0,
|
|
24
|
+
missingArms,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pair a measured population by declared identity.
|
|
29
|
+
* @param scored The scored trials.
|
|
30
|
+
* @param slots The declared schedule slots.
|
|
31
|
+
* @returns Complete pairs, unmatched observations, unpaired evidence and problems.
|
|
32
|
+
*/
|
|
33
|
+
export function pairObservations(scored, slots) {
|
|
34
|
+
const observed = scored.filter((row) => row.disposition === "first-attempt");
|
|
35
|
+
const problems = [];
|
|
36
|
+
const bySlot = new Map();
|
|
37
|
+
for (const row of observed) {
|
|
38
|
+
if (row.identity.slot === null)
|
|
39
|
+
continue;
|
|
40
|
+
if (bySlot.has(row.identity.slot)) {
|
|
41
|
+
problems.push(`duplicate first-attempt observation for slot ${String(row.identity.slot)}`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
bySlot.set(row.identity.slot, row);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const pairIds = [
|
|
48
|
+
...new Set(slots.flatMap((slot) => slot.pairId === undefined ? [] : [slot.pairId])),
|
|
49
|
+
];
|
|
50
|
+
const pairs = pairIds.map((pairId) => pairViewOf(pairId, slots.filter((slot) => slot.pairId === pairId), bySlot));
|
|
51
|
+
const unmatched = pairs
|
|
52
|
+
.filter((pair) => !pair.complete)
|
|
53
|
+
.flatMap((pair) => Object.values(pair.arms).filter((row) => row !== undefined && row.utility.assessed));
|
|
54
|
+
const pairedSlots = new Set(slots.flatMap((slot) => (slot.pairId === undefined ? [] : [slot.slot])));
|
|
55
|
+
const unpaired = observed.filter((row) => row.identity.slot === null || !pairedSlots.has(row.identity.slot));
|
|
56
|
+
return { pairs, unmatched, unpaired, problems };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Compare a candidate arm against a control arm over complete pairs.
|
|
60
|
+
* @param pairs The paired population.
|
|
61
|
+
* @param controlArm The control arm id.
|
|
62
|
+
* @param candidateArm The candidate arm id.
|
|
63
|
+
* @returns Pair counts, the summed delta and its interval.
|
|
64
|
+
*/
|
|
65
|
+
export function pairedComparison(pairs, controlArm, candidateArm) {
|
|
66
|
+
const comparison = {
|
|
67
|
+
completePairs: 0,
|
|
68
|
+
controlBetter: 0,
|
|
69
|
+
candidateBetter: 0,
|
|
70
|
+
ties: 0,
|
|
71
|
+
delta: 0,
|
|
72
|
+
interval: { low: 0, high: 0 },
|
|
73
|
+
};
|
|
74
|
+
for (const pair of pairs) {
|
|
75
|
+
if (!pair.complete)
|
|
76
|
+
continue;
|
|
77
|
+
const control = pair.arms[controlArm];
|
|
78
|
+
const candidate = pair.arms[candidateArm];
|
|
79
|
+
if (control === undefined || candidate === undefined)
|
|
80
|
+
continue;
|
|
81
|
+
comparison.completePairs += 1;
|
|
82
|
+
const delta = candidate.utility.score - control.utility.score;
|
|
83
|
+
comparison.delta += delta;
|
|
84
|
+
comparison.interval.low += candidate.utility.low - control.utility.high;
|
|
85
|
+
comparison.interval.high +=
|
|
86
|
+
candidate.utility.high - control.utility.low;
|
|
87
|
+
if (delta > 0)
|
|
88
|
+
comparison.candidateBetter += 1;
|
|
89
|
+
else if (delta < 0)
|
|
90
|
+
comparison.controlBetter += 1;
|
|
91
|
+
else
|
|
92
|
+
comparison.ties += 1;
|
|
93
|
+
}
|
|
94
|
+
return comparison;
|
|
95
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence loading for the trial analysis framework.
|
|
3
|
+
*
|
|
4
|
+
* Every record is read through an injected {@link EvidenceReader} and lands
|
|
5
|
+
* in one of four explicit states: available, missing, malformed or
|
|
6
|
+
* unsupported-loaded. Absence is never conflated with emptiness — a missing
|
|
7
|
+
* snapshot is not an empty lake, and an absent judgement is not "none". The
|
|
8
|
+
* ac-v1 adapter reads the layout the 2026-11-10 campaigns recorded (per-arm
|
|
9
|
+
* result roots holding run metadata, gate and primary-check records, judge
|
|
10
|
+
* attempt directories and trial artefacts). A legacy record without the
|
|
11
|
+
* fields it needs stays limited or unknown; it is never silently upgraded.
|
|
12
|
+
*
|
|
13
|
+
* Nothing here touches the filesystem or calls a model: the CLI supplies the
|
|
14
|
+
* reader, and tests supply an in-memory one.
|
|
15
|
+
*/
|
|
16
|
+
import { type DocumentationOutcome } from "../scoring.ts";
|
|
17
|
+
import type { LakeDocument } from "../campaign.ts";
|
|
18
|
+
import type { SelectionPolicy } from "./model.ts";
|
|
19
|
+
import { type RecoveryPolicy } from "./recovery.ts";
|
|
20
|
+
import { type JournalVerification } from "./journal.ts";
|
|
21
|
+
/** The explicit state of one loaded record. */
|
|
22
|
+
export type Loaded<T> = {
|
|
23
|
+
state: "available";
|
|
24
|
+
value: T;
|
|
25
|
+
source: string;
|
|
26
|
+
} | {
|
|
27
|
+
state: "missing";
|
|
28
|
+
source: string;
|
|
29
|
+
} | {
|
|
30
|
+
state: "not-a-directory";
|
|
31
|
+
source: string;
|
|
32
|
+
} | {
|
|
33
|
+
state: "malformed";
|
|
34
|
+
source: string;
|
|
35
|
+
problems: string[];
|
|
36
|
+
} | {
|
|
37
|
+
state: "unsupported-loaded";
|
|
38
|
+
source: string;
|
|
39
|
+
reason: string;
|
|
40
|
+
};
|
|
41
|
+
/** The filesystem boundary the loader reads through. */
|
|
42
|
+
export interface EvidenceReader {
|
|
43
|
+
/** Read one UTF-8 text file; a missing file is a state, not an error. */
|
|
44
|
+
readTextFile(path: string): Loaded<string>;
|
|
45
|
+
/** List one directory's entry names, sorted; missing is a state. */
|
|
46
|
+
readDirectoryEntries(path: string): Loaded<string[]>;
|
|
47
|
+
}
|
|
48
|
+
/** Whether one trial directory proves a recorded run. */
|
|
49
|
+
export type AttemptState = "recorded" | "reservation-only" | "unknown" | "absent";
|
|
50
|
+
/** The gate record as the harness wrote it. */
|
|
51
|
+
export interface GateRecord {
|
|
52
|
+
/** The recorded gate status string (e.g. `pass`, `blocked`). */
|
|
53
|
+
status: string;
|
|
54
|
+
/** The recorded reason, or null. */
|
|
55
|
+
reason: string | null;
|
|
56
|
+
}
|
|
57
|
+
/** One preservation observation as a judgement recorded it. */
|
|
58
|
+
export interface PreservationObservation {
|
|
59
|
+
/** The recorded assessment state (e.g. `retained`, `lost`). */
|
|
60
|
+
state: string;
|
|
61
|
+
/** The decisive excerpt the judgement quoted. */
|
|
62
|
+
quote: string;
|
|
63
|
+
}
|
|
64
|
+
/** Per-fact preservation observations keyed by inventory fact id. */
|
|
65
|
+
export type PreservationByFact = Record<string, Loaded<PreservationObservation>>;
|
|
66
|
+
/** One token field's subtotal and independent step coverage. */
|
|
67
|
+
export interface TokenFieldUsage {
|
|
68
|
+
/** Sum over steps that reported this field; meaningful only with coverage. */
|
|
69
|
+
total: number;
|
|
70
|
+
/** Observed steps reporting a numeric value, including explicit zero. */
|
|
71
|
+
measuredSteps: number;
|
|
72
|
+
/** Observed steps not reporting this field. */
|
|
73
|
+
unknownSteps: number;
|
|
74
|
+
}
|
|
75
|
+
/** Token accounting summed from a recorded session trail, per field. */
|
|
76
|
+
export interface TokenUsage {
|
|
77
|
+
/** Observed step_finish events, with or without token telemetry. */
|
|
78
|
+
steps: number;
|
|
79
|
+
/** Input-token subtotal and coverage. */
|
|
80
|
+
input: TokenFieldUsage;
|
|
81
|
+
/** Output-token subtotal and coverage. */
|
|
82
|
+
output: TokenFieldUsage;
|
|
83
|
+
/** Reasoning-token subtotal and coverage. */
|
|
84
|
+
reasoning: TokenFieldUsage;
|
|
85
|
+
/** Cache-read-token subtotal and coverage. */
|
|
86
|
+
cacheRead: TokenFieldUsage;
|
|
87
|
+
}
|
|
88
|
+
/** One recorded campaign-attempt ledger event. */
|
|
89
|
+
export interface LaunchRecord {
|
|
90
|
+
/** Event timestamp, or null when the event carried none. */
|
|
91
|
+
at: string | null;
|
|
92
|
+
/** The recorded event name (e.g. `launch`, `slot-complete`). */
|
|
93
|
+
event: string;
|
|
94
|
+
/** The trial stamp, or null when the event carried none. */
|
|
95
|
+
stamp: string | null;
|
|
96
|
+
}
|
|
97
|
+
/** The assessment status of one trial's judgement layer. */
|
|
98
|
+
export type AssessmentStatus = "judged" | "invalid-verdict" | "judge-error" | "unassessed" | "not-run" | "unknown";
|
|
99
|
+
/** One trial's retrieval-application observation as the judge recorded it. */
|
|
100
|
+
export interface RetrievalObservation {
|
|
101
|
+
/** The recorded state (e.g. applied, read-not-applied). */
|
|
102
|
+
state: string;
|
|
103
|
+
/** The decisive excerpt connecting the retrieved detail to the work. */
|
|
104
|
+
quote: string;
|
|
105
|
+
}
|
|
106
|
+
/** One trial's resolved assessment. */
|
|
107
|
+
export interface TrialAssessment {
|
|
108
|
+
/** The status of the selected judgement layer. */
|
|
109
|
+
status: AssessmentStatus;
|
|
110
|
+
/** Which layer the recorded selection policy chose. */
|
|
111
|
+
layer: "judge" | "deterministic-resolution" | "none";
|
|
112
|
+
/** The documentation outcome, undefined when no usable one was recorded. */
|
|
113
|
+
outcome: DocumentationOutcome | undefined;
|
|
114
|
+
/** The judgement's stated reason, when present. */
|
|
115
|
+
reason: string | undefined;
|
|
116
|
+
/** The judgement's evidence quotes, when present. */
|
|
117
|
+
evidence: string[];
|
|
118
|
+
/** Per-fact preservation observations for the scenario's inventory. */
|
|
119
|
+
preservation: Loaded<PreservationByFact>;
|
|
120
|
+
/** The judge's retrieval-application finding, when one was recorded. */
|
|
121
|
+
retrieval: Loaded<RetrievalObservation>;
|
|
122
|
+
/** The published selection's attempt, when a selection record exists. */
|
|
123
|
+
selectedAttemptId?: string;
|
|
124
|
+
/** Every problem found while loading or validating the assessment. */
|
|
125
|
+
problems: string[];
|
|
126
|
+
}
|
|
127
|
+
/** The artefacts a static screen reads for one trial. */
|
|
128
|
+
export interface TrialArtefacts {
|
|
129
|
+
/** The trial's final answer text. */
|
|
130
|
+
finalAnswer: Loaded<string>;
|
|
131
|
+
/** The recorded writes report text. */
|
|
132
|
+
writesText: Loaded<string>;
|
|
133
|
+
/** The recorded docs-operation journal lines. */
|
|
134
|
+
docsOperations: Loaded<string[]>;
|
|
135
|
+
/** The trial's prompt text. */
|
|
136
|
+
promptText: Loaded<string>;
|
|
137
|
+
}
|
|
138
|
+
/** One trial's loaded evidence. */
|
|
139
|
+
export interface TrialRecord {
|
|
140
|
+
/** The declared identity this record was loaded for. */
|
|
141
|
+
identity: {
|
|
142
|
+
resultRoot: string;
|
|
143
|
+
stamp: string;
|
|
144
|
+
scenario: string;
|
|
145
|
+
};
|
|
146
|
+
/** What the trial directory proves about the run. */
|
|
147
|
+
attempt: {
|
|
148
|
+
/** The attempt state derived from directory contents. */
|
|
149
|
+
state: AttemptState;
|
|
150
|
+
/** Usability: true, false, or unknown without a run record. */
|
|
151
|
+
usable: boolean | "unknown";
|
|
152
|
+
/** Why usability holds or fails, for visible limitations. */
|
|
153
|
+
problems: string[];
|
|
154
|
+
};
|
|
155
|
+
/** The run metadata record, for policy and cost fields. */
|
|
156
|
+
run: Loaded<Record<string, unknown>>;
|
|
157
|
+
/** The recorded deterministic gate verdict. */
|
|
158
|
+
gate: Loaded<GateRecord>;
|
|
159
|
+
/** The independent primary-task result. */
|
|
160
|
+
primary: {
|
|
161
|
+
status: "pass" | "fail" | "unknown";
|
|
162
|
+
problems: string[];
|
|
163
|
+
};
|
|
164
|
+
/** The resolved judgement layer. */
|
|
165
|
+
assessment: TrialAssessment;
|
|
166
|
+
/** The judge model identity, when recorded. */
|
|
167
|
+
judgeModel: Loaded<string>;
|
|
168
|
+
/** Token accounting from the session trail. */
|
|
169
|
+
tokens: Loaded<TokenUsage>;
|
|
170
|
+
/** The trial artefacts a static screen reads. */
|
|
171
|
+
artefacts: TrialArtefacts;
|
|
172
|
+
/**
|
|
173
|
+
* The verified operation-journal evidence. Absent only on a legacy record
|
|
174
|
+
* built without one; the loader always sets it, and an unverified journal
|
|
175
|
+
* earns no credit.
|
|
176
|
+
*/
|
|
177
|
+
journal?: JournalVerification;
|
|
178
|
+
/** Why the captured answer is not bound to the run, or null. */
|
|
179
|
+
answerProblem?: string | null;
|
|
180
|
+
}
|
|
181
|
+
/** Options for loading one trial under the ac-v1 layout. */
|
|
182
|
+
export interface TrialRecordOptions {
|
|
183
|
+
/** The arm's result root, relative to the evidence root. */
|
|
184
|
+
resultRoot: string;
|
|
185
|
+
/** The selected judge attempt directory; defaults to `attempt-001`. */
|
|
186
|
+
attemptId?: string;
|
|
187
|
+
/** The trial stamp to load. */
|
|
188
|
+
stamp: string;
|
|
189
|
+
/** The scenario the slot declared. */
|
|
190
|
+
scenario: string;
|
|
191
|
+
/** The scheduled slot number, when the caller knows it. */
|
|
192
|
+
slot?: number;
|
|
193
|
+
/** The pair id, when the caller knows it. */
|
|
194
|
+
pairId?: string;
|
|
195
|
+
/** The arm id, when the caller knows it. */
|
|
196
|
+
arm?: string;
|
|
197
|
+
/** The scenario's inventory fact ids, for per-fact preservation loading. */
|
|
198
|
+
inventoryFactIds: string[];
|
|
199
|
+
/** The manifest's recorded judgement-layer selection policy. */
|
|
200
|
+
selectionPolicy: SelectionPolicy;
|
|
201
|
+
/** The registered recovery policy, when the manifest declares one. */
|
|
202
|
+
recoveryPolicy?: RecoveryPolicy | undefined;
|
|
203
|
+
/** Whether legacy evidence without an answer hash is accepted. */
|
|
204
|
+
allowUnboundAnswer?: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Read the Markdown documents under one directory, recursively and sorted.
|
|
208
|
+
* A missing directory stays missing; an existing directory with no Markdown
|
|
209
|
+
* documents is available and empty — absence is never conflated with
|
|
210
|
+
* emptiness.
|
|
211
|
+
* @param reader The evidence reader.
|
|
212
|
+
* @param dir The directory, relative to the evidence root.
|
|
213
|
+
* @returns The documents sorted by path, or the explicit state.
|
|
214
|
+
*/
|
|
215
|
+
export declare function readMarkdownTree(reader: EvidenceReader, dir: string): Loaded<LakeDocument[]>;
|
|
216
|
+
/**
|
|
217
|
+
* Load one trial's evidence under the ac-v1 layout.
|
|
218
|
+
* @param reader The evidence reader rooted at the evidence root.
|
|
219
|
+
* @param options Which trial to load and how to select judgement layers.
|
|
220
|
+
* @returns The trial record.
|
|
221
|
+
*/
|
|
222
|
+
export declare function loadTrialRecord(reader: EvidenceReader, options: TrialRecordOptions): TrialRecord;
|
|
223
|
+
/**
|
|
224
|
+
* Load the campaign attempt ledger (one JSON event per line).
|
|
225
|
+
* @param reader The evidence reader.
|
|
226
|
+
* @param path The ledger path, relative to the evidence root.
|
|
227
|
+
* @returns The events, or the explicit state.
|
|
228
|
+
*/
|
|
229
|
+
export declare function loadLaunchLedger(reader: EvidenceReader, path: string): Loaded<LaunchRecord[]>;
|