@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,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable reporting for the analysis framework.
|
|
3
|
+
*
|
|
4
|
+
* One structured result renders both the versioned machine-readable analysis
|
|
5
|
+
* and the Markdown report, so the numbers and the decision wording cannot
|
|
6
|
+
* drift apart. Rendering is deterministic for identical input; the render
|
|
7
|
+
* timestamp is injected and recorded separately from any execution time.
|
|
8
|
+
* Markdown cells are escaped so evidence text cannot corrupt a table.
|
|
9
|
+
*/
|
|
10
|
+
import type { SensitivityCell, UtilityWeights } from "../scoring.ts";
|
|
11
|
+
import type { AccountingCounts } from "./accounting.ts";
|
|
12
|
+
import type { MeasuresReport } from "./measures.ts";
|
|
13
|
+
import type { Interval } from "./bounds.ts";
|
|
14
|
+
import type { DecisionResult } from "./decision.ts";
|
|
15
|
+
import type { GuardrailArmSummary } from "./guardrails.ts";
|
|
16
|
+
import type { GuardrailSpec, SelectionSpec } from "./model.ts";
|
|
17
|
+
import type { PairedComparison } from "./pairing.ts";
|
|
18
|
+
import type { Finding } from "./screening/rules.ts";
|
|
19
|
+
import type { ReconcileRow } from "./screening/reconcile.ts";
|
|
20
|
+
/** The analyser implementation identity. */
|
|
21
|
+
export declare const ANALYSER_VERSION = "analysis-framework/1";
|
|
22
|
+
/** The report template this renderer follows. */
|
|
23
|
+
export declare const REPORT_TEMPLATE_VERSION = "trial-feedback-report/2026-11-10";
|
|
24
|
+
/** One arm's report block. */
|
|
25
|
+
export interface AnalysisArmReport {
|
|
26
|
+
/** The arm's accounting counts. */
|
|
27
|
+
accounting: AccountingCounts;
|
|
28
|
+
/** The arm's full-population utility interval. */
|
|
29
|
+
interval: Interval;
|
|
30
|
+
/** The arm's guardrail summaries. */
|
|
31
|
+
guardrails: GuardrailArmSummary[];
|
|
32
|
+
}
|
|
33
|
+
/** The pairing summary included in the report. */
|
|
34
|
+
export interface PairingSummary {
|
|
35
|
+
/** Declared pairs. */
|
|
36
|
+
pairs: number;
|
|
37
|
+
/** Pairs with every arm assessed. */
|
|
38
|
+
completePairs: number;
|
|
39
|
+
/** Assessed observations in incomplete pairs. */
|
|
40
|
+
unmatched: Array<{
|
|
41
|
+
stamp: string;
|
|
42
|
+
arm: string;
|
|
43
|
+
scenario: string;
|
|
44
|
+
score: number;
|
|
45
|
+
}>;
|
|
46
|
+
/** Observations outside any declared pair. */
|
|
47
|
+
unpaired: number;
|
|
48
|
+
/** Evidence problems found while pairing. */
|
|
49
|
+
problems: string[];
|
|
50
|
+
}
|
|
51
|
+
/** One token field's campaign subtotal and independent step coverage. */
|
|
52
|
+
export interface TokenFieldCoverage {
|
|
53
|
+
/** Sum over reporting steps, or null when no step reported the field. */
|
|
54
|
+
total: number | null;
|
|
55
|
+
/** Observed steps reporting a numeric value, including explicit zero. */
|
|
56
|
+
measuredSteps: number;
|
|
57
|
+
/** Observed steps not reporting the field. */
|
|
58
|
+
unknownSteps: number;
|
|
59
|
+
}
|
|
60
|
+
/** Captured token usage, with coverage kept independently per field. */
|
|
61
|
+
export interface UsageSummary {
|
|
62
|
+
/** Input-token subtotal and coverage. */
|
|
63
|
+
input: TokenFieldCoverage;
|
|
64
|
+
/** Output-token subtotal and coverage. */
|
|
65
|
+
output: TokenFieldCoverage;
|
|
66
|
+
/** Reasoning-token subtotal and coverage. */
|
|
67
|
+
reasoning: TokenFieldCoverage;
|
|
68
|
+
/** Cache-read-token subtotal and coverage. */
|
|
69
|
+
cacheRead: TokenFieldCoverage;
|
|
70
|
+
/** Observed step_finish events, or null when no trail was readable. */
|
|
71
|
+
steps: number | null;
|
|
72
|
+
/** Trials whose session trail was readable. */
|
|
73
|
+
measuredTrials: number;
|
|
74
|
+
/** Trials whose session trail was unreadable. */
|
|
75
|
+
unknownTrials: number;
|
|
76
|
+
}
|
|
77
|
+
/** Cost availability: token telemetry is not a monetary cost. */
|
|
78
|
+
export interface CostSummary {
|
|
79
|
+
/** Whether a recorded cost exists; this analyser records none. */
|
|
80
|
+
available: false;
|
|
81
|
+
/** Why the cost is unavailable. */
|
|
82
|
+
note: string;
|
|
83
|
+
}
|
|
84
|
+
/** The reconciled attempt-ledger summary. */
|
|
85
|
+
export interface LedgerSummary {
|
|
86
|
+
/** The ledger's stable root-relative reference. */
|
|
87
|
+
reference: string;
|
|
88
|
+
/** Whether the ledger was readable. */
|
|
89
|
+
state: "available" | "missing" | "malformed";
|
|
90
|
+
/** Event counts keyed by recorded event name. */
|
|
91
|
+
events: Record<string, number>;
|
|
92
|
+
/** Scheduled slots the campaign declared. */
|
|
93
|
+
scheduled: number;
|
|
94
|
+
/** Scheduled slots with a recorded launch. */
|
|
95
|
+
launched: number;
|
|
96
|
+
/** Scheduled slots with a recorded judge attempt. */
|
|
97
|
+
judged: number;
|
|
98
|
+
/** Scheduled slots with no recorded launch. */
|
|
99
|
+
missingLaunches: string[];
|
|
100
|
+
/** Scheduled slots with no recorded judge attempt. */
|
|
101
|
+
missingJudgeAttempts: string[];
|
|
102
|
+
/** Ledger stamps outside the declared schedule. */
|
|
103
|
+
unknownStamps: string[];
|
|
104
|
+
/** Stamps with more than one recorded launch. */
|
|
105
|
+
duplicateLaunches: string[];
|
|
106
|
+
/** Loading and reconciliation problems. */
|
|
107
|
+
problems: string[];
|
|
108
|
+
}
|
|
109
|
+
/** The structured analysis result: the single source for every rendering. */
|
|
110
|
+
export interface AnalysisResult {
|
|
111
|
+
/** The analysis schema version. */
|
|
112
|
+
analysisVersion: string;
|
|
113
|
+
/** The campaign identity. */
|
|
114
|
+
campaign: {
|
|
115
|
+
id: string;
|
|
116
|
+
question: string | null;
|
|
117
|
+
};
|
|
118
|
+
/** SHA-256 of the manifest bytes. */
|
|
119
|
+
manifestSha256: string;
|
|
120
|
+
/** The evidence layout adapter. */
|
|
121
|
+
layout: string;
|
|
122
|
+
/** The recorded judgement-layer policy. */
|
|
123
|
+
selectionPolicy: string;
|
|
124
|
+
/** The frozen policy identity. */
|
|
125
|
+
policyId: string;
|
|
126
|
+
/** The frozen utility weights. */
|
|
127
|
+
weights: UtilityWeights;
|
|
128
|
+
/** The declared guardrails. */
|
|
129
|
+
guardrails: GuardrailSpec[];
|
|
130
|
+
/** The declared selection rule, when present. */
|
|
131
|
+
selection: SelectionSpec | null;
|
|
132
|
+
/** Per-arm reports. */
|
|
133
|
+
arms: Record<string, AnalysisArmReport>;
|
|
134
|
+
/** Per-arm, per-scenario accounting. */
|
|
135
|
+
scenarios: Record<string, Record<string, AccountingCounts>>;
|
|
136
|
+
/** The recording and retrieval opportunity measures, and the personal-trial screen. */
|
|
137
|
+
measures: MeasuresReport;
|
|
138
|
+
/** The whole measured population. */
|
|
139
|
+
totals: AccountingCounts;
|
|
140
|
+
/** The pairing summary. */
|
|
141
|
+
pairing: PairingSummary;
|
|
142
|
+
/** The candidate-minus-control comparison, when a rule is declared. */
|
|
143
|
+
paired: PairedComparison | null;
|
|
144
|
+
/** Full-population candidate-minus-control interval, when a rule is declared. */
|
|
145
|
+
bounds: {
|
|
146
|
+
delta: Interval | null;
|
|
147
|
+
};
|
|
148
|
+
/** The three-limb decision. */
|
|
149
|
+
decision: DecisionResult;
|
|
150
|
+
/** The sensitivity grid, when the campaign froze one. */
|
|
151
|
+
sensitivity: SensitivityCell[] | null;
|
|
152
|
+
/** Static-screen findings and their reconciliation, kept advisory. */
|
|
153
|
+
screening: {
|
|
154
|
+
rulesVersion: string;
|
|
155
|
+
findings: Finding[];
|
|
156
|
+
reconciliation: ReconcileRow[];
|
|
157
|
+
/** The one personal-trial decision, shared with the headline. */
|
|
158
|
+
personalTrial: MeasuresReport["personalTrial"];
|
|
159
|
+
};
|
|
160
|
+
/** Integrity identities. */
|
|
161
|
+
integrity: {
|
|
162
|
+
sources: Array<{
|
|
163
|
+
reference: string;
|
|
164
|
+
sha256: string;
|
|
165
|
+
}>;
|
|
166
|
+
judgedBy: string[];
|
|
167
|
+
};
|
|
168
|
+
/** Captured token usage; never an invented zero. */
|
|
169
|
+
usage: UsageSummary;
|
|
170
|
+
/** Monetary cost availability. */
|
|
171
|
+
cost: CostSummary;
|
|
172
|
+
/** The reconciled attempt ledger, when the campaign declared one. */
|
|
173
|
+
ledger: LedgerSummary | null;
|
|
174
|
+
/** Per-slot assessment selection, from checked selection records. */
|
|
175
|
+
assessmentSelection: {
|
|
176
|
+
/** Every scheduled slot's selected attempt, or null when unrecorded. */
|
|
177
|
+
slots: Array<{
|
|
178
|
+
stamp: string;
|
|
179
|
+
selectedAttemptId: string | null;
|
|
180
|
+
recovered: boolean;
|
|
181
|
+
}>;
|
|
182
|
+
/** Slots whose selection is the frozen first attempt. */
|
|
183
|
+
initial: number;
|
|
184
|
+
/** Slots whose selection is a recovery attempt. */
|
|
185
|
+
recovered: number;
|
|
186
|
+
/** Slots with no selection record (historical evidence). */
|
|
187
|
+
unrecorded: number;
|
|
188
|
+
};
|
|
189
|
+
/** Explicit limitations, rendered verbatim. */
|
|
190
|
+
limitations: string[];
|
|
191
|
+
}
|
|
192
|
+
/** The receipt written beside the analysis. */
|
|
193
|
+
export interface AnalysisReceipt {
|
|
194
|
+
/** The analyser identity. */
|
|
195
|
+
analyserVersion: string;
|
|
196
|
+
/** The report template identity. */
|
|
197
|
+
templateVersion: string;
|
|
198
|
+
/** SHA-256 of the manifest bytes. */
|
|
199
|
+
manifestSha256: string;
|
|
200
|
+
/** The frozen policy identity. */
|
|
201
|
+
policyId: string;
|
|
202
|
+
/** The injected rendering timestamp. */
|
|
203
|
+
renderedAt: string;
|
|
204
|
+
/** Every consumed observation with its identity and explicit state, sorted. */
|
|
205
|
+
inputs: Array<{
|
|
206
|
+
reference: string;
|
|
207
|
+
kind: "file" | "directory";
|
|
208
|
+
sha256: string | null;
|
|
209
|
+
state: "available" | "missing" | "not-a-directory" | "malformed";
|
|
210
|
+
}>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Escape one Markdown table cell.
|
|
214
|
+
* @param value The raw cell value.
|
|
215
|
+
* @returns The escaped, single-line value.
|
|
216
|
+
*/
|
|
217
|
+
export declare function escapeCell(value: unknown): string;
|
|
218
|
+
/**
|
|
219
|
+
* Render the full analysis report.
|
|
220
|
+
* @param result The analysis result.
|
|
221
|
+
* @returns Markdown.
|
|
222
|
+
*/
|
|
223
|
+
export declare function renderReport(result: AnalysisResult): string;
|
|
224
|
+
/**
|
|
225
|
+
* Render the versioned machine-readable analysis.
|
|
226
|
+
* @param result The analysis result.
|
|
227
|
+
* @returns The JSON document with a trailing newline.
|
|
228
|
+
*/
|
|
229
|
+
export declare function renderAnalysisJson(result: AnalysisResult): string;
|
|
230
|
+
/**
|
|
231
|
+
* Render the analysis receipt.
|
|
232
|
+
* @param receipt The receipt fields, including the injected timestamp.
|
|
233
|
+
* @returns The JSON document with a trailing newline.
|
|
234
|
+
*/
|
|
235
|
+
export declare function renderReceipt(receipt: AnalysisReceipt): string;
|