@markstanden/opencode-test-container 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +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/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,209 @@
|
|
|
1
|
+
import type { ToolIdentity } from "../contracts/version.ts";
|
|
2
|
+
import type { Slot } from "../contracts/types.ts";
|
|
3
|
+
import { type ContainerPlan } from "../adapters/podman/container.ts";
|
|
4
|
+
import type { CommandResult } from "../adapters/process.ts";
|
|
5
|
+
import { type RecoveryPolicy, type SelectionRecord } from "../evaluators/docs/analysis/recovery.ts";
|
|
6
|
+
import { type DocState, type DocumentationOutcome, type JudgeFailureClass } from "../evaluators/docs/scoring.ts";
|
|
7
|
+
import { type PreparedManifest } from "./prepare.ts";
|
|
8
|
+
/** The terminal state of one judge attempt. */
|
|
9
|
+
export type JudgeAttemptStatus = "judged" | "invalid-verdict" | "judge-error";
|
|
10
|
+
/** A judge attempt's recorded state, including an unfinished dispatch. */
|
|
11
|
+
export type JudgeMetaStatus = JudgeAttemptStatus | "started";
|
|
12
|
+
/** One immutable judge attempt record. */
|
|
13
|
+
export interface JudgeAttemptMeta {
|
|
14
|
+
/** The schema version value. */
|
|
15
|
+
schemaVersion: 1;
|
|
16
|
+
/** The campaign id value. */
|
|
17
|
+
campaignId: string;
|
|
18
|
+
/** The slot id value. */
|
|
19
|
+
slotId: string;
|
|
20
|
+
/** The case id value. */
|
|
21
|
+
caseId: string;
|
|
22
|
+
/** The arm id value. */
|
|
23
|
+
armId: string;
|
|
24
|
+
/** The attempt id value. */
|
|
25
|
+
attemptId: string;
|
|
26
|
+
/** The judge model route. */
|
|
27
|
+
judgeModel: string;
|
|
28
|
+
/** The packet sha256 value; every recovery attempt must match it. */
|
|
29
|
+
packetSha256: string;
|
|
30
|
+
/** The attempt status value. */
|
|
31
|
+
judgementStatus: JudgeMetaStatus;
|
|
32
|
+
/** The failure class, or null on a usable judgement. */
|
|
33
|
+
failureClass: JudgeFailureClass | null;
|
|
34
|
+
/** Whether the capture proves a complete final response. */
|
|
35
|
+
complete: boolean;
|
|
36
|
+
/** The started at value. */
|
|
37
|
+
startedAt: string;
|
|
38
|
+
/** The completed at value. */
|
|
39
|
+
completedAt: string;
|
|
40
|
+
/** The exit value. */
|
|
41
|
+
exit: number | null;
|
|
42
|
+
/** The timed out value. */
|
|
43
|
+
timedOut: boolean;
|
|
44
|
+
/** The capture problems value. */
|
|
45
|
+
captureProblems: string[];
|
|
46
|
+
/** The judgement sha256 value, or null. */
|
|
47
|
+
judgementSha256: string | null;
|
|
48
|
+
}
|
|
49
|
+
/** One stored judgement. */
|
|
50
|
+
export interface StoredJudgement {
|
|
51
|
+
/** The schema version value. */
|
|
52
|
+
schemaVersion: 1;
|
|
53
|
+
/** The slot id value. */
|
|
54
|
+
slotId: string;
|
|
55
|
+
/** The attempt id value. */
|
|
56
|
+
attemptId: string;
|
|
57
|
+
/** The judged value, when usable. */
|
|
58
|
+
status: JudgeAttemptStatus;
|
|
59
|
+
/** The documentation outcome, when usable. */
|
|
60
|
+
documentationOutcome: DocumentationOutcome | null;
|
|
61
|
+
/** The utility score, when usable. */
|
|
62
|
+
utility: number | null;
|
|
63
|
+
/** The judgement payload. */
|
|
64
|
+
value: Record<string, unknown> | null;
|
|
65
|
+
/** The problems, empty on a usable judgement. */
|
|
66
|
+
problems: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Everything one judge invocation did. */
|
|
69
|
+
export interface JudgeSummary {
|
|
70
|
+
/** Whether every selected slot produced a usable judgement or was skipped. */
|
|
71
|
+
ok: boolean;
|
|
72
|
+
/** Slots with a usable judgement, including idempotent skips. */
|
|
73
|
+
judged: string[];
|
|
74
|
+
/** Slots skipped because a checked selection already existed. */
|
|
75
|
+
skipped: string[];
|
|
76
|
+
/** Slots that produced no usable judgement. */
|
|
77
|
+
refused: string[];
|
|
78
|
+
/** The problems value. */
|
|
79
|
+
problems: string[];
|
|
80
|
+
}
|
|
81
|
+
/** Dependencies the judge accepts, so ordinary tests need no Podman. */
|
|
82
|
+
export interface JudgeDeps {
|
|
83
|
+
/** The run container value. */
|
|
84
|
+
runContainer?: (plan: ContainerPlan) => Promise<CommandResult>;
|
|
85
|
+
/** The now value. */
|
|
86
|
+
now?: () => string;
|
|
87
|
+
/** The executing tool identity, injected for drift tests. */
|
|
88
|
+
tool?: ToolIdentity;
|
|
89
|
+
}
|
|
90
|
+
/** The path of one slot's judgement evidence. */
|
|
91
|
+
export declare function judgeDirectory(root: string, slotId: string): string;
|
|
92
|
+
/** The one canonical claims location: the campaign evidence root. */
|
|
93
|
+
export declare function claimsRoot(root: string): string;
|
|
94
|
+
/** The path of one slot's checked selection. */
|
|
95
|
+
export declare function selectionPath(root: string, slotId: string): string;
|
|
96
|
+
/** The path of one slot's immutable packet. */
|
|
97
|
+
export declare function packetPath(root: string, slotId: string): string;
|
|
98
|
+
/** The registered recovery policy, or a parse refusal. */
|
|
99
|
+
export declare function policyOf(manifest: PreparedManifest): {
|
|
100
|
+
ok: true;
|
|
101
|
+
policy: RecoveryPolicy | null;
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
problems: string[];
|
|
105
|
+
};
|
|
106
|
+
/** One checked per-slot selection and the evidence it names. */
|
|
107
|
+
export interface CheckedSelection {
|
|
108
|
+
/** The checked selection record. */
|
|
109
|
+
selection: SelectionRecord;
|
|
110
|
+
/** The selected attempt's metadata. */
|
|
111
|
+
meta: JudgeAttemptMeta;
|
|
112
|
+
/** The selected attempt's stored judgement. */
|
|
113
|
+
judgement: StoredJudgement;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Re-derive the packet evidence for one slot: every recorded attempt's packet
|
|
117
|
+
* must hash to its registered identity, the slot and attempt copies must agree,
|
|
118
|
+
* and every copy must equal the packet reconstructed from current evidence.
|
|
119
|
+
* @param root The campaign root.
|
|
120
|
+
* @param manifest The prepared manifest.
|
|
121
|
+
* @param slot The scheduled slot.
|
|
122
|
+
* @returns Packet integrity problems; empty means the packet is bound.
|
|
123
|
+
*/
|
|
124
|
+
export declare function packetIntegrityProblems(root: string, manifest: PreparedManifest, slot: Slot): string[];
|
|
125
|
+
/**
|
|
126
|
+
* Re-derive one slot's selection from evidence. A readable object is not a
|
|
127
|
+
* selection: attempt identity, packet identity, the selected judgement's hash,
|
|
128
|
+
* its outcome/utility and its agreement with the documented mutation state are
|
|
129
|
+
* all checked before status, closure, reporting or the judge trust it.
|
|
130
|
+
* @param options The campaign root, manifest, slot and registered policy.
|
|
131
|
+
* @returns The checked selection, or every inconsistency found.
|
|
132
|
+
* @param options.root The campaign root.
|
|
133
|
+
* @param options.manifest The prepared manifest.
|
|
134
|
+
* @param options.slot The scheduled slot.
|
|
135
|
+
* @param options.policy The parsed recovery policy, or null.
|
|
136
|
+
*/
|
|
137
|
+
export declare function checkedSelection(options: {
|
|
138
|
+
root: string;
|
|
139
|
+
manifest: PreparedManifest;
|
|
140
|
+
slot: Slot;
|
|
141
|
+
policy: RecoveryPolicy | null;
|
|
142
|
+
}): {
|
|
143
|
+
ok: true;
|
|
144
|
+
value: CheckedSelection;
|
|
145
|
+
} | {
|
|
146
|
+
ok: false;
|
|
147
|
+
problems: string[];
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Load the manifest and policy, then check one slot's selection.
|
|
151
|
+
* @param root The campaign root.
|
|
152
|
+
* @param slotId The scheduled slot.
|
|
153
|
+
* @returns The checked selection, or every inconsistency.
|
|
154
|
+
*/
|
|
155
|
+
export declare function checkedSelectionForSlot(root: string, slotId: string): {
|
|
156
|
+
ok: true;
|
|
157
|
+
value: CheckedSelection;
|
|
158
|
+
} | {
|
|
159
|
+
ok: false;
|
|
160
|
+
problems: string[];
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Build the exact judge packet for one slot without dispatching.
|
|
164
|
+
* @param root The campaign root.
|
|
165
|
+
* @param slotId The scheduled slot.
|
|
166
|
+
* @returns The packet and mutation state, or the refusal.
|
|
167
|
+
*/
|
|
168
|
+
export declare function buildJudgePacketForSlot(root: string, slotId: string): {
|
|
169
|
+
ok: true;
|
|
170
|
+
packet: string;
|
|
171
|
+
state: DocState;
|
|
172
|
+
} | {
|
|
173
|
+
ok: false;
|
|
174
|
+
problems: string[];
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Judge every selected slot from checked evidence. A usable selection is
|
|
178
|
+
* idempotent; a complete `json-syntax` failure is recovered once when a policy
|
|
179
|
+
* is registered, from the same packet bytes and against durable ceilings.
|
|
180
|
+
* @param root The frozen campaign root.
|
|
181
|
+
* @param options Slot selection and dry-run choice.
|
|
182
|
+
* @param options.slotIds The selected slots.
|
|
183
|
+
* @param options.dryRun Build and check the packet without dispatching.
|
|
184
|
+
* @param deps Injected process runner and clock.
|
|
185
|
+
* @returns What was judged, skipped or refused.
|
|
186
|
+
*/
|
|
187
|
+
export declare function judgeCampaign(root: string, options?: {
|
|
188
|
+
slotIds?: readonly string[];
|
|
189
|
+
dryRun?: boolean;
|
|
190
|
+
}, deps?: JudgeDeps): Promise<JudgeSummary>;
|
|
191
|
+
/** Read a slot's attempt metadata, sorted by attempt id. */
|
|
192
|
+
export declare function readJudgeAttempts(root: string, slotId: string): JudgeAttemptMeta[];
|
|
193
|
+
/** One selected judgement and the attempt that produced it. */
|
|
194
|
+
export interface SelectedJudgement {
|
|
195
|
+
/** The checked selection record. */
|
|
196
|
+
selection: SelectionRecord;
|
|
197
|
+
/** The selected attempt's metadata. */
|
|
198
|
+
meta: JudgeAttemptMeta;
|
|
199
|
+
/** The stored judgement. */
|
|
200
|
+
judgement: StoredJudgement;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Read the selected judgement for one slot, or null when no usable selection
|
|
204
|
+
* exists. The selection is evidence, so callers validate it separately.
|
|
205
|
+
* @param root The campaign root.
|
|
206
|
+
* @param slotId The slot id.
|
|
207
|
+
* @returns The selected attempt's stored judgement, or null.
|
|
208
|
+
*/
|
|
209
|
+
export declare function readSelectedJudgement(root: string, slotId: string): SelectedJudgement | null;
|