@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,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Versioned suite and campaign contracts.
|
|
3
|
+
*
|
|
4
|
+
* A suite is reusable case data plus one declared assessment kind. A campaign
|
|
5
|
+
* freezes a suite reference, subjects, an explicit execution schedule and the
|
|
6
|
+
* runtime/provider route. Both are plain data: no campaign field names an
|
|
7
|
+
* executable, so an evidence directory can never inject code.
|
|
8
|
+
*/
|
|
9
|
+
/** The assessment implementations OTC trusts by name. */
|
|
10
|
+
export type AssessmentKind = "skill-activation" | "docs-recording";
|
|
11
|
+
/** One expected docs write outcome. */
|
|
12
|
+
export interface ExpectedDocs {
|
|
13
|
+
/** `none` means the case expects the write to be refused. */
|
|
14
|
+
kind: "create" | "replace" | "none";
|
|
15
|
+
/** The lake path the write should target. */
|
|
16
|
+
target?: string;
|
|
17
|
+
/** A relative link the written doc should contain. */
|
|
18
|
+
link?: string;
|
|
19
|
+
/** Text the written doc must retain. */
|
|
20
|
+
retains?: string[];
|
|
21
|
+
/** Text the written doc must omit. */
|
|
22
|
+
omits?: string[];
|
|
23
|
+
}
|
|
24
|
+
/** One primary check the deterministic docs evaluator must satisfy. */
|
|
25
|
+
export interface DocsCriterion {
|
|
26
|
+
/** Verified docs calls required; zero is a valid restraint expectation. */
|
|
27
|
+
minVerifiedCalls: number;
|
|
28
|
+
/** Accepted docs verbs. */
|
|
29
|
+
verbs?: string[];
|
|
30
|
+
}
|
|
31
|
+
/** A deterministic guardrail over the final workspace. */
|
|
32
|
+
export interface DocsGuardrails {
|
|
33
|
+
/** Paths that must remain unchanged. */
|
|
34
|
+
unchanged?: string[];
|
|
35
|
+
/** Paths that must not exist. */
|
|
36
|
+
absent?: string[];
|
|
37
|
+
}
|
|
38
|
+
/** Fields shared by every case kind. */
|
|
39
|
+
export interface CaseBase {
|
|
40
|
+
/** Stable selector, unique within the suite. */
|
|
41
|
+
caseId: string;
|
|
42
|
+
/** The exact prompt given to the subject. */
|
|
43
|
+
prompt: string;
|
|
44
|
+
/** A directory copied into the trial workspace before the run. */
|
|
45
|
+
fixture?: string;
|
|
46
|
+
/** Inline workspace files, relative to the workspace root. */
|
|
47
|
+
files?: Record<string, string>;
|
|
48
|
+
}
|
|
49
|
+
/** A case that expects a named skill to be activated, or restraint. */
|
|
50
|
+
export interface SkillTriggerCase extends CaseBase {
|
|
51
|
+
/** The kind value. */
|
|
52
|
+
kind: "skill-trigger";
|
|
53
|
+
/** The exact skill identity the criterion observes. */
|
|
54
|
+
targetSkillId: string;
|
|
55
|
+
/** `activation` expects a successful target load; restraint expects none. */
|
|
56
|
+
expected: "activation" | "no-activation";
|
|
57
|
+
/** How to treat a non-skill route to the body. Default `fail`. */
|
|
58
|
+
contamination?: "fail" | "record";
|
|
59
|
+
/** Allow the arm to omit the target, to rehearse an operational failure. */
|
|
60
|
+
allowMissingTarget?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** A product-supplied, immutable primary check for one docs case. */
|
|
63
|
+
export interface PrimaryCheckSpec {
|
|
64
|
+
/** Stable checker identity recorded with every result. */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Source directory, resolved relative to the suite document. */
|
|
67
|
+
directory: string;
|
|
68
|
+
/** Script inside that directory; the fixed interpreter is `node`. */
|
|
69
|
+
script: string;
|
|
70
|
+
/** Wall-clock bound; defaults to 30000. */
|
|
71
|
+
timeoutMs?: number;
|
|
72
|
+
}
|
|
73
|
+
/** A case that expects a docs write, or a deliberate refused write. */
|
|
74
|
+
export interface DocsTaskCase extends CaseBase {
|
|
75
|
+
/** The kind value. */
|
|
76
|
+
kind: "docs-task";
|
|
77
|
+
/** The expected docs value. */
|
|
78
|
+
expectedDocs: ExpectedDocs;
|
|
79
|
+
/** The criterion value. */
|
|
80
|
+
criterion?: DocsCriterion;
|
|
81
|
+
/** The guardrails value. */
|
|
82
|
+
guardrails?: DocsGuardrails;
|
|
83
|
+
/** Workspace-relative lake root; defaults to `docs`. */
|
|
84
|
+
lakeRoot?: string;
|
|
85
|
+
/** Arm-blind facts the judge may use; never mounted in the trial. */
|
|
86
|
+
truth?: string;
|
|
87
|
+
/** The product's independent primary check, executed after the trial. */
|
|
88
|
+
primaryCheck?: PrimaryCheckSpec;
|
|
89
|
+
}
|
|
90
|
+
/** One declared judge-recovery registration, validated by the analysis policy. */
|
|
91
|
+
export interface RecoveryDeclaration {
|
|
92
|
+
/** The schema version value. */
|
|
93
|
+
version: number;
|
|
94
|
+
/** The eligible failure classes. */
|
|
95
|
+
eligibleFailureClasses: string[];
|
|
96
|
+
/** Whether completion evidence is mandatory. */
|
|
97
|
+
requiresCompletionEvidence: boolean;
|
|
98
|
+
/** Recoveries per failed slot. */
|
|
99
|
+
maxRecoveriesPerSlot: number;
|
|
100
|
+
/** Campaign-wide recovery attempts. */
|
|
101
|
+
recoveryCeiling: number;
|
|
102
|
+
/** Total judge attempts, initial assessments plus recoveries. */
|
|
103
|
+
totalJudgeAttempts: number;
|
|
104
|
+
/** Requests per attempt the adapter exposes, or null when unavailable. */
|
|
105
|
+
providerRequestLimit: number | null;
|
|
106
|
+
}
|
|
107
|
+
/** One reusable, discriminated case definition. */
|
|
108
|
+
export type SuiteCase = SkillTriggerCase | DocsTaskCase;
|
|
109
|
+
/** A versioned suite document. */
|
|
110
|
+
export interface Suite {
|
|
111
|
+
/** The schema version value. */
|
|
112
|
+
schemaVersion: 1;
|
|
113
|
+
/** The suite id value. */
|
|
114
|
+
suiteId: string;
|
|
115
|
+
/** The description value. */
|
|
116
|
+
description?: string;
|
|
117
|
+
/** The assessment value. */
|
|
118
|
+
assessment: AssessmentKind;
|
|
119
|
+
/** The cases value. */
|
|
120
|
+
cases: SuiteCase[];
|
|
121
|
+
}
|
|
122
|
+
/** One skill bundle supplied by an arm. */
|
|
123
|
+
export interface SkillSubject {
|
|
124
|
+
/** The id value. */
|
|
125
|
+
id: string;
|
|
126
|
+
/** The path value. */
|
|
127
|
+
path: string;
|
|
128
|
+
}
|
|
129
|
+
/** One plugin package supplied by an arm. */
|
|
130
|
+
export interface PluginSubject {
|
|
131
|
+
/** The id value. */
|
|
132
|
+
id: string;
|
|
133
|
+
/** The path value. */
|
|
134
|
+
path: string;
|
|
135
|
+
/** Package-relative members staged for the runtime; defaults apply. */
|
|
136
|
+
include?: string[];
|
|
137
|
+
/** Non-secret plugin options handed to OpenCode. */
|
|
138
|
+
options?: unknown;
|
|
139
|
+
}
|
|
140
|
+
/** One instruction overlay copied into the trial workspace. */
|
|
141
|
+
export interface InstructionSubject {
|
|
142
|
+
/** The id value. */
|
|
143
|
+
id: string;
|
|
144
|
+
/** The path value. */
|
|
145
|
+
path: string;
|
|
146
|
+
/** Workspace-relative destination; defaults to `AGENTS.md`. */
|
|
147
|
+
as?: string;
|
|
148
|
+
}
|
|
149
|
+
/** One treatment configuration. */
|
|
150
|
+
export interface Arm {
|
|
151
|
+
/** The arm id value. */
|
|
152
|
+
armId: string;
|
|
153
|
+
/** The skills value. */
|
|
154
|
+
skills?: SkillSubject[];
|
|
155
|
+
/** The plugins value. */
|
|
156
|
+
plugins?: PluginSubject[];
|
|
157
|
+
/** The instructions value. */
|
|
158
|
+
instructions?: InstructionSubject[];
|
|
159
|
+
}
|
|
160
|
+
/** One scheduled case × arm × repetition. */
|
|
161
|
+
export interface Slot {
|
|
162
|
+
/** The slot id value. */
|
|
163
|
+
slotId: string;
|
|
164
|
+
/** The case id value. */
|
|
165
|
+
caseId: string;
|
|
166
|
+
/** The arm id value. */
|
|
167
|
+
armId: string;
|
|
168
|
+
/** The repetition id value. */
|
|
169
|
+
repetitionId: string;
|
|
170
|
+
}
|
|
171
|
+
/** The provider route the runtime uses. */
|
|
172
|
+
export interface ProviderRoute {
|
|
173
|
+
/** A human-readable route label, e.g. `scripted` or `host-proxy`. */
|
|
174
|
+
route: string;
|
|
175
|
+
/** OpenCode model route (`provider/model`). */
|
|
176
|
+
model: string;
|
|
177
|
+
/** Non-secret provider overlay merged into OPENCODE_CONFIG_CONTENT. */
|
|
178
|
+
overlay?: Record<string, unknown>;
|
|
179
|
+
}
|
|
180
|
+
/** The pinned execution environment. */
|
|
181
|
+
export interface RuntimeSpec {
|
|
182
|
+
/** Image tag or local name used to build/resolve the run image. */
|
|
183
|
+
image: string;
|
|
184
|
+
/** Immutable image identity, required once frozen. */
|
|
185
|
+
imageId?: string;
|
|
186
|
+
/** The OpenCode CLI version the image is expected to contain. */
|
|
187
|
+
opencodeVersion: string;
|
|
188
|
+
/** The provider value. */
|
|
189
|
+
provider: ProviderRoute;
|
|
190
|
+
/** Per-trial wall-clock budget. */
|
|
191
|
+
timeoutMs: number;
|
|
192
|
+
/** `host` shares the host network; it is not provider-only isolation. */
|
|
193
|
+
network: "host" | "none";
|
|
194
|
+
/** Container CLI; podman is the only supported adapter today. */
|
|
195
|
+
containerCli?: "podman";
|
|
196
|
+
/** Extra non-secret environment names passed through, never values. */
|
|
197
|
+
passthroughEnv?: string[];
|
|
198
|
+
}
|
|
199
|
+
/** Explicit spend ceilings; a campaign never infers them. */
|
|
200
|
+
export interface Budgets {
|
|
201
|
+
/** The trials value. */
|
|
202
|
+
trials: number;
|
|
203
|
+
/** The judge attempts value. */
|
|
204
|
+
judgeAttempts: number;
|
|
205
|
+
}
|
|
206
|
+
/** Assessment configuration, separate from the suite's assessment kind. */
|
|
207
|
+
export interface AssessmentSpec {
|
|
208
|
+
/** The kind value. */
|
|
209
|
+
kind: AssessmentKind;
|
|
210
|
+
/** A model judge is optional and never implied by a deterministic suite. */
|
|
211
|
+
judge?: {
|
|
212
|
+
model: string;
|
|
213
|
+
timeoutMs?: number;
|
|
214
|
+
};
|
|
215
|
+
/** An explicit recovery registration; absent means no retry. */
|
|
216
|
+
recovery?: RecoveryDeclaration;
|
|
217
|
+
}
|
|
218
|
+
/** A versioned campaign document. */
|
|
219
|
+
export interface Campaign {
|
|
220
|
+
/** The schema version value. */
|
|
221
|
+
schemaVersion: 1;
|
|
222
|
+
/** The campaign id value. */
|
|
223
|
+
campaignId: string;
|
|
224
|
+
/** Suite location, relative to the campaign document. */
|
|
225
|
+
suite: {
|
|
226
|
+
path: string;
|
|
227
|
+
sha256?: string;
|
|
228
|
+
};
|
|
229
|
+
/** The subjects value. */
|
|
230
|
+
subjects: Arm[];
|
|
231
|
+
/** The schedule value. */
|
|
232
|
+
schedule: {
|
|
233
|
+
kind: "explicit";
|
|
234
|
+
slots: Slot[];
|
|
235
|
+
};
|
|
236
|
+
/** The runtime value. */
|
|
237
|
+
runtime: RuntimeSpec;
|
|
238
|
+
/** The budgets value. */
|
|
239
|
+
budgets: Budgets;
|
|
240
|
+
/** The assessment value. */
|
|
241
|
+
assessment: AssessmentSpec;
|
|
242
|
+
/** OpenCode permission configuration; never credentials. */
|
|
243
|
+
permissions?: Record<string, unknown>;
|
|
244
|
+
/** Stop after the first unusable or failed assessment. */
|
|
245
|
+
stopOnFirstFailure?: boolean;
|
|
246
|
+
}
|
|
247
|
+
/** A validated campaign plus its resolved suite. */
|
|
248
|
+
export interface CampaignBundle {
|
|
249
|
+
/** The campaign value. */
|
|
250
|
+
campaign: Campaign;
|
|
251
|
+
/** The suite value. */
|
|
252
|
+
suite: Suite;
|
|
253
|
+
/** Absolute path of the campaign document. */
|
|
254
|
+
campaignPath: string;
|
|
255
|
+
/** Absolute path of the resolved suite document. */
|
|
256
|
+
suitePath: string;
|
|
257
|
+
/** The campaign document's declared suite hash, or null when omitted. */
|
|
258
|
+
declaredSuiteSha256: string | null;
|
|
259
|
+
}
|
|
260
|
+
/** The finite lifecycle states derived from evidence. */
|
|
261
|
+
export type LifecycleState = "prepared" | "frozen" | "running" | "assessed" | "closed" | "blocked";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Versioned suite and campaign contracts.
|
|
3
|
+
*
|
|
4
|
+
* A suite is reusable case data plus one declared assessment kind. A campaign
|
|
5
|
+
* freezes a suite reference, subjects, an explicit execution schedule and the
|
|
6
|
+
* runtime/provider route. Both are plain data: no campaign field names an
|
|
7
|
+
* executable, so an evidence directory can never inject code.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { AssessmentKind, Campaign, CampaignBundle, Suite } from "./types.ts";
|
|
2
|
+
/** A successful parse, or the actionable problems that prevent one. */
|
|
3
|
+
export type Parsed<T> = {
|
|
4
|
+
ok: true;
|
|
5
|
+
value: T;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
problems: string[];
|
|
9
|
+
};
|
|
10
|
+
/** The identifier syntax every new OTC identity uses. */
|
|
11
|
+
export declare const ID_PATTERN: RegExp;
|
|
12
|
+
/** Whether a value is a plain JSON object. */
|
|
13
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
14
|
+
/** Whether a string is a usable identifier. */
|
|
15
|
+
export declare function isId(value: unknown): value is string;
|
|
16
|
+
/** Whether a string is a non-blank value. */
|
|
17
|
+
export declare function isText(value: unknown): value is string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a path is relative, non-empty and free of parent traversal. It is
|
|
20
|
+
* syntax validation only; containment of an existing file is checked when it
|
|
21
|
+
* is resolved.
|
|
22
|
+
* @param value The candidate path.
|
|
23
|
+
* @returns True for a safe relative path.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isSafeRelativePath(value: unknown): value is string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether a subject source path is acceptable. Subject payloads are staged
|
|
28
|
+
* and hashed before dispatch, so a source outside the campaign document is
|
|
29
|
+
* allowed; containment and symlink escapes are enforced on the staged tree,
|
|
30
|
+
* not on the developer's layout.
|
|
31
|
+
* @param value The candidate source path.
|
|
32
|
+
* @returns True for a non-blank, NUL-free path.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isSourcePath(value: unknown): value is string;
|
|
35
|
+
/** Read JSON from a path, preserving parse failure as a problem. */
|
|
36
|
+
export declare function readJson(path: string): {
|
|
37
|
+
ok: true;
|
|
38
|
+
value: unknown;
|
|
39
|
+
} | {
|
|
40
|
+
ok: false;
|
|
41
|
+
problem: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Validate a suite document.
|
|
45
|
+
* @param value The parsed JSON value.
|
|
46
|
+
* @returns The typed suite or every problem found.
|
|
47
|
+
*/
|
|
48
|
+
export declare function validateSuite(value: unknown): Parsed<Suite>;
|
|
49
|
+
/**
|
|
50
|
+
* Validate a campaign document, before its suite is resolved.
|
|
51
|
+
* @param value The parsed JSON value.
|
|
52
|
+
* @param baseDir Directory for relative subject sources.
|
|
53
|
+
* @returns The typed campaign or every problem found.
|
|
54
|
+
*/
|
|
55
|
+
export declare function validateCampaign(value: unknown, baseDir?: string): Parsed<Campaign>;
|
|
56
|
+
/**
|
|
57
|
+
* Validate a campaign together with its suite and cross-references.
|
|
58
|
+
* @param campaignValue The parsed campaign document.
|
|
59
|
+
* @param suiteValue The parsed suite document.
|
|
60
|
+
* @param campaignPath Absolute campaign path, used for suite containment.
|
|
61
|
+
* @param suitePath Absolute suite path.
|
|
62
|
+
* @returns The bundle or every problem found.
|
|
63
|
+
*/
|
|
64
|
+
export declare function validateBundle(campaignValue: unknown, suiteValue: unknown, campaignPath: string, suitePath: string): Parsed<CampaignBundle>;
|
|
65
|
+
/**
|
|
66
|
+
* Read and validate a campaign and its suite from disk.
|
|
67
|
+
* @param campaignPath The campaign document path.
|
|
68
|
+
* @returns The bundle, or actionable problems including unreadable files.
|
|
69
|
+
*/
|
|
70
|
+
export declare function loadCampaignBundle(campaignPath: string): Parsed<CampaignBundle>;
|
|
71
|
+
/** Whether a value is one of the finite assessment kinds. */
|
|
72
|
+
export declare function isAssessmentKind(value: unknown): value is AssessmentKind;
|