@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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +263 -2
  3. package/container/Containerfile +24 -0
  4. package/container/README.md +29 -0
  5. package/dist/adapters/opencode/events.d.ts +90 -0
  6. package/dist/adapters/opencode/events.js +213 -0
  7. package/dist/adapters/opencode/runtime.d.ts +87 -0
  8. package/dist/adapters/opencode/runtime.js +136 -0
  9. package/dist/adapters/podman/container.d.ts +62 -0
  10. package/dist/adapters/podman/container.js +119 -0
  11. package/dist/adapters/podman/image.d.ts +50 -0
  12. package/dist/adapters/podman/image.js +124 -0
  13. package/dist/adapters/process.d.ts +38 -0
  14. package/dist/adapters/process.js +71 -0
  15. package/dist/campaign/assess.d.ts +45 -0
  16. package/dist/campaign/assess.js +208 -0
  17. package/dist/campaign/close.d.ts +17 -0
  18. package/dist/campaign/close.js +112 -0
  19. package/dist/campaign/evidence-guard.d.ts +24 -0
  20. package/dist/campaign/evidence-guard.js +49 -0
  21. package/dist/campaign/freeze.d.ts +94 -0
  22. package/dist/campaign/freeze.js +297 -0
  23. package/dist/campaign/inventory.d.ts +62 -0
  24. package/dist/campaign/inventory.js +192 -0
  25. package/dist/campaign/judge.d.ts +209 -0
  26. package/dist/campaign/judge.js +1285 -0
  27. package/dist/campaign/ledger.d.ts +64 -0
  28. package/dist/campaign/ledger.js +149 -0
  29. package/dist/campaign/prepare.d.ts +129 -0
  30. package/dist/campaign/prepare.js +483 -0
  31. package/dist/campaign/primary.d.ts +96 -0
  32. package/dist/campaign/primary.js +189 -0
  33. package/dist/campaign/run.d.ts +151 -0
  34. package/dist/campaign/run.js +562 -0
  35. package/dist/campaign/status.d.ts +76 -0
  36. package/dist/campaign/status.js +237 -0
  37. package/dist/cli/otc.d.ts +51 -0
  38. package/dist/cli/otc.js +435 -0
  39. package/dist/contracts/canonical.d.ts +21 -0
  40. package/dist/contracts/canonical.js +44 -0
  41. package/dist/contracts/types.d.ts +261 -0
  42. package/dist/contracts/types.js +9 -0
  43. package/dist/contracts/validate.d.ts +72 -0
  44. package/dist/contracts/validate.js +1021 -0
  45. package/dist/contracts/version.d.ts +44 -0
  46. package/dist/contracts/version.js +147 -0
  47. package/dist/evaluators/docs/analysis/accounting.d.ts +140 -0
  48. package/dist/evaluators/docs/analysis/accounting.js +237 -0
  49. package/dist/evaluators/docs/analysis/blinding.d.ts +40 -0
  50. package/dist/evaluators/docs/analysis/blinding.js +80 -0
  51. package/dist/evaluators/docs/analysis/bounds.d.ts +40 -0
  52. package/dist/evaluators/docs/analysis/bounds.js +31 -0
  53. package/dist/evaluators/docs/analysis/budget.d.ts +137 -0
  54. package/dist/evaluators/docs/analysis/budget.js +305 -0
  55. package/dist/evaluators/docs/analysis/closure.d.ts +175 -0
  56. package/dist/evaluators/docs/analysis/closure.js +251 -0
  57. package/dist/evaluators/docs/analysis/decision.d.ts +59 -0
  58. package/dist/evaluators/docs/analysis/decision.js +161 -0
  59. package/dist/evaluators/docs/analysis/freeze.d.ts +201 -0
  60. package/dist/evaluators/docs/analysis/freeze.js +395 -0
  61. package/dist/evaluators/docs/analysis/guardrails.d.ts +51 -0
  62. package/dist/evaluators/docs/analysis/guardrails.js +194 -0
  63. package/dist/evaluators/docs/analysis/journal.d.ts +150 -0
  64. package/dist/evaluators/docs/analysis/journal.js +475 -0
  65. package/dist/evaluators/docs/analysis/ledger.d.ts +78 -0
  66. package/dist/evaluators/docs/analysis/ledger.js +145 -0
  67. package/dist/evaluators/docs/analysis/measures.d.ts +302 -0
  68. package/dist/evaluators/docs/analysis/measures.js +1069 -0
  69. package/dist/evaluators/docs/analysis/model.d.ts +236 -0
  70. package/dist/evaluators/docs/analysis/model.js +740 -0
  71. package/dist/evaluators/docs/analysis/pairing.d.ts +68 -0
  72. package/dist/evaluators/docs/analysis/pairing.js +95 -0
  73. package/dist/evaluators/docs/analysis/records.d.ts +229 -0
  74. package/dist/evaluators/docs/analysis/records.js +935 -0
  75. package/dist/evaluators/docs/analysis/recovery.d.ts +225 -0
  76. package/dist/evaluators/docs/analysis/recovery.js +507 -0
  77. package/dist/evaluators/docs/analysis/render.d.ts +235 -0
  78. package/dist/evaluators/docs/analysis/render.js +566 -0
  79. package/dist/evaluators/docs/analysis/replay.d.ts +15 -0
  80. package/dist/evaluators/docs/analysis/replay.js +1272 -0
  81. package/dist/evaluators/docs/analysis/screening/inventory.d.ts +136 -0
  82. package/dist/evaluators/docs/analysis/screening/inventory.js +307 -0
  83. package/dist/evaluators/docs/analysis/screening/noteVersion.d.ts +15 -0
  84. package/dist/evaluators/docs/analysis/screening/noteVersion.js +46 -0
  85. package/dist/evaluators/docs/analysis/screening/reconcile.d.ts +38 -0
  86. package/dist/evaluators/docs/analysis/screening/reconcile.js +40 -0
  87. package/dist/evaluators/docs/analysis/screening/rules.d.ts +163 -0
  88. package/dist/evaluators/docs/analysis/screening/rules.js +330 -0
  89. package/dist/evaluators/docs/analysis/screening/scan.d.ts +72 -0
  90. package/dist/evaluators/docs/analysis/screening/scan.js +362 -0
  91. package/dist/evaluators/docs/analysis/selector.d.ts +68 -0
  92. package/dist/evaluators/docs/analysis/selector.js +123 -0
  93. package/dist/evaluators/docs/assess.d.ts +129 -0
  94. package/dist/evaluators/docs/assess.js +433 -0
  95. package/dist/evaluators/docs/campaign.d.ts +133 -0
  96. package/dist/evaluators/docs/campaign.js +222 -0
  97. package/dist/evaluators/docs/index.d.ts +25 -0
  98. package/dist/evaluators/docs/index.js +25 -0
  99. package/dist/evaluators/docs/journal.d.ts +150 -0
  100. package/dist/evaluators/docs/journal.js +475 -0
  101. package/dist/evaluators/docs/scoring.d.ts +367 -0
  102. package/dist/evaluators/docs/scoring.js +662 -0
  103. package/dist/evaluators/skills/assess.d.ts +94 -0
  104. package/dist/evaluators/skills/assess.js +207 -0
  105. package/dist/index.d.ts +46 -0
  106. package/dist/index.js +29 -0
  107. package/dist/legacy/prod014.d.ts +86 -0
  108. package/dist/legacy/prod014.js +209 -0
  109. package/dist/reporting/report.d.ts +79 -0
  110. package/dist/reporting/report.js +242 -0
  111. package/docs/architecture.md +106 -0
  112. package/docs/capability-matrix.md +84 -0
  113. package/docs/offline-rehearsal.md +75 -0
  114. package/docs/parity-record.md +81 -0
  115. package/docs/pr-description.md +103 -0
  116. package/docs/release-0.1.0.md +52 -0
  117. package/docs/releasing.md +82 -0
  118. package/docs/schema.md +97 -0
  119. package/examples/skills/README.md +13 -0
  120. package/examples/skills/campaign.json +73 -0
  121. package/examples/skills/skills/otel-helper/SKILL.md +10 -0
  122. package/examples/skills/suite.json +29 -0
  123. package/package.json +45 -5
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Versioned campaign manifest for the trial analysis framework.
3
+ *
4
+ * A manifest describes a campaign as data — identity, arms, scenarios, the
5
+ * frozen schedule with declared pair identities, the evidence layout, the
6
+ * recorded assessment-layer selection policy and the frozen measurement
7
+ * policy — so a future agent can run the standard analyser without writing
8
+ * another calculator. Validation is pure and total: it collects problems
9
+ * instead of throwing, so a CLI can report every defect in one pass.
10
+ *
11
+ * Manifests are portable: evidence locations are layout ids and paths relative
12
+ * to a runtime evidence root. Absolute paths and traversal segments are
13
+ * refused here, never resolved at parse time. Nothing in this module reads
14
+ * the filesystem or calls a model.
15
+ */
16
+ import { type RecoveryPolicy } from "./recovery.ts";
17
+ /** The only manifest schema version this framework parses. */
18
+ export declare const MANIFEST_SCHEMA_VERSION = 1;
19
+ /**
20
+ * Evidence layout adapters the loader knows how to read. The ledger-shaped
21
+ * `rr-ledger-v1` layout is deliberately absent until an adapter exists: a
22
+ * manifest declaring an unreadable layout is refused, never accepted and
23
+ * silently read as ac-v1.
24
+ */
25
+ export declare const EVIDENCE_LAYOUTS: readonly ["ac-v1"];
26
+ /** A known evidence layout adapter id. */
27
+ export type EvidenceLayout = (typeof EVIDENCE_LAYOUTS)[number];
28
+ /** Recorded policies for choosing among multiple judgement layers. */
29
+ export declare const SELECTION_POLICIES: readonly ["resolution-then-judgement", "judgement-only"];
30
+ /** A known judgement-layer selection policy id. */
31
+ export type SelectionPolicy = (typeof SELECTION_POLICIES)[number];
32
+ /** Guardrail kinds the evaluator implements. */
33
+ export declare const GUARDRAIL_KINDS: readonly ["mutation-policy", "destructive-loss"];
34
+ /** A known guardrail kind. */
35
+ export type GuardrailKind = (typeof GUARDRAIL_KINDS)[number];
36
+ /** How a slot's observation relates to the frozen schedule. */
37
+ export declare const DISPOSITIONS: readonly ["first-attempt", "replacement", "excluded"];
38
+ /** A known observation disposition. */
39
+ export type Disposition = (typeof DISPOSITIONS)[number];
40
+ /** The campaign being analysed. */
41
+ export interface CampaignIdentity {
42
+ /** Stable campaign id, e.g. `rc-20261110`. */
43
+ id: string;
44
+ /** The frozen question, quoted in reports. */
45
+ question?: string | undefined;
46
+ }
47
+ /** One arm's declared identity. */
48
+ export interface ArmIdentity {
49
+ /** Stable arm id used by schedule slots and evidence roots. */
50
+ id: string;
51
+ /** Human-readable label, quoted in reports. */
52
+ label?: string | undefined;
53
+ }
54
+ /** One configured still-valid fact an inventory assesses for preservation. */
55
+ export interface PreservationFactSpec {
56
+ /** Stable fact id, e.g. `poolSize`; never a hard-coded framework name. */
57
+ id: string;
58
+ /** Human-readable label, quoted in findings. */
59
+ label: string;
60
+ /** Focused regex sources recognising the fact and its supported equivalents. */
61
+ mentionPatterns?: string[] | undefined;
62
+ /** Regex sources asserting the fact's obsolete current form (obsolete-claim facts). */
63
+ obsoleteCurrentPatterns?: string[] | undefined;
64
+ }
65
+ /** One scenario's configured preservation inventory. */
66
+ export interface PreservationInventorySpec {
67
+ /** The facts assessed for preservation. */
68
+ facts: PreservationFactSpec[];
69
+ /** Regex sources whose in-assertion match negates a fact mention. */
70
+ negationCues: string[];
71
+ }
72
+ /** A scenario's recorded mutation policy and its visible constraints. */
73
+ export interface MutationPolicySpec {
74
+ /** Allowed mutation globs, relative to the trial workspace. */
75
+ allowed: string[];
76
+ /** Constraints the task prompt communicated, when recorded. */
77
+ visibleConstraints?: string[] | undefined;
78
+ }
79
+ /** One scenario's declared identity and optional measurement configuration. */
80
+ export interface ScenarioIdentity {
81
+ /** Stable scenario id used by schedule slots and evidence. */
82
+ id: string;
83
+ /** Display-only measurement kind, e.g. `reuse-create`. */
84
+ kind?: string | undefined;
85
+ /** The scenario's configured preservation inventory, when it has one. */
86
+ preservationInventory?: PreservationInventorySpec | undefined;
87
+ /** The scenario's recorded mutation policy, when the campaign declares one. */
88
+ mutationPolicy?: MutationPolicySpec | undefined;
89
+ }
90
+ /** One scheduled trial slot: a declared identity, never an array position. */
91
+ export interface SlotSpec {
92
+ /** One-based position in the frozen execution order. */
93
+ slot: number;
94
+ /** The trial's result stamp. */
95
+ stamp: string;
96
+ /** The scenario the slot runs. */
97
+ scenario: string;
98
+ /** The arm the slot runs. */
99
+ arm: string;
100
+ /** The repetition within scenario and arm. */
101
+ repetition: number;
102
+ /** The declared pair id; pairs hold exactly two distinct-arm slots. */
103
+ pairId?: string | undefined;
104
+ /** How the observation relates to the schedule; defaults to first-attempt. */
105
+ disposition?: Disposition | undefined;
106
+ }
107
+ /** The frozen schedule. */
108
+ export interface ScheduleSpec {
109
+ /** Every scheduled slot; may be empty so zero denominators stay reportable. */
110
+ slots: SlotSpec[];
111
+ }
112
+ /** Evidence locations relative to the runtime evidence root. */
113
+ export interface EvidenceSpec {
114
+ /** The layout adapter id the loader uses to read this campaign. */
115
+ layout: EvidenceLayout;
116
+ /** Per-arm result roots, relative to the evidence root. */
117
+ resultRoots: Record<string, string>;
118
+ /** Extra named inputs, relative to the evidence root (e.g. a ledger). */
119
+ inputs?: Record<string, string> | undefined;
120
+ }
121
+ /** The recorded policy for choosing among judgement layers. */
122
+ export interface AssessmentSpec {
123
+ /** A known selection policy id; never implicitly "newest wins". */
124
+ selectionPolicy: SelectionPolicy;
125
+ /**
126
+ * The judge attempt directory to read, e.g. `attempt-002`. Absent means
127
+ * `attempt-001`; a preserved earlier attempt is never overwritten.
128
+ */
129
+ attemptId?: string;
130
+ /**
131
+ * The registered recovery policy. Absent means the historical behaviour:
132
+ * no recovery is authorised. Present, it is validated here and its per-slot
133
+ * selection record becomes the checked evidence for recovered slots.
134
+ */
135
+ recovery?: RecoveryPolicy;
136
+ }
137
+ /** One non-compensable guardrail. */
138
+ export interface GuardrailSpec {
139
+ /** Stable guardrail id. */
140
+ id: string;
141
+ /** A known guardrail kind the evaluator implements. */
142
+ kind: GuardrailKind;
143
+ /** The requirement, quoted verbatim in reports. */
144
+ requirement: string;
145
+ }
146
+ /** The declared pairwise comparison rule; absent means "not defined". */
147
+ export interface SelectionSpec {
148
+ /** The arm the candidate is compared against. */
149
+ controlArm: string;
150
+ /** The arm under evaluation. */
151
+ candidateArm: string;
152
+ /** The required utility lead of candidate over control. */
153
+ threshold: number;
154
+ /** Whether complete assessment coverage of planned slots is required. */
155
+ requireCompleteCoverage: boolean;
156
+ }
157
+ /** An optional sensitivity grid, frozen before scoring. */
158
+ export interface SensitivitySpec {
159
+ /** Useful create/update rewards to explore. */
160
+ usefulWeights: number[];
161
+ /** Transient penalties (positive magnitudes) to explore. */
162
+ transientPenalties: number[];
163
+ }
164
+ /** Optional static-screening configuration. */
165
+ export interface ScreeningSpec {
166
+ /** The screening rules version these settings belong to. */
167
+ rulesVersion: string;
168
+ /** Advisory regex sources for transient-state wording. */
169
+ transientWordingPatterns?: string[] | undefined;
170
+ /** Regex sources for durable-troubleshooting counterexample wording. */
171
+ durableCounterexamplePatterns?: string[] | undefined;
172
+ }
173
+ /** The frozen measurement policy. */
174
+ export interface PolicySpec {
175
+ /** Identity of the frozen policy, quoted in reports. */
176
+ policyId: string;
177
+ /** Utility weights; complete, finite, frozen before scoring. */
178
+ weights: UtilityWeightsSpec;
179
+ /** The non-compensable guardrails this campaign declares. */
180
+ guardrails: GuardrailSpec[];
181
+ /** The declared comparison rule, when the campaign freezes one. */
182
+ selection?: SelectionSpec | undefined;
183
+ /** The declared sensitivity grid, when the campaign freezes one. */
184
+ sensitivity?: SensitivitySpec | undefined;
185
+ /** Static-screening configuration, when the campaign uses the scanner. */
186
+ screening?: ScreeningSpec | undefined;
187
+ }
188
+ /** The five utility weight keys, all required. */
189
+ export interface UtilityWeightsSpec {
190
+ /** Reward for a useful create and a useful update. */
191
+ useful: number;
192
+ /** Penalty for a supported but valueless transient note. */
193
+ transient: number;
194
+ /** Penalty for a duplicate note. */
195
+ duplicate: number;
196
+ /** Penalty for misleading or unsupported documentation. */
197
+ misleading: number;
198
+ /** Penalty for a failed primary task. */
199
+ taskFailure: number;
200
+ }
201
+ /** A validated campaign manifest. */
202
+ export interface CampaignManifest {
203
+ /** The manifest schema version; only 1 is accepted. */
204
+ schemaVersion: number;
205
+ /** The campaign identity. */
206
+ campaign: CampaignIdentity;
207
+ /** The declared arms. */
208
+ arms: ArmIdentity[];
209
+ /** The declared scenarios. */
210
+ scenarios: ScenarioIdentity[];
211
+ /** The frozen schedule. */
212
+ schedule: ScheduleSpec;
213
+ /** Evidence locations. */
214
+ evidence: EvidenceSpec;
215
+ /** The recorded judgement-layer policy. */
216
+ assessment: AssessmentSpec;
217
+ /** The frozen measurement policy. */
218
+ policy: PolicySpec;
219
+ }
220
+ /** The outcome of parsing one manifest. */
221
+ export interface ManifestParseResult {
222
+ /** The validated manifest, present only when there are no problems. */
223
+ value?: CampaignManifest | undefined;
224
+ /** Every validation problem found, each naming the offending field. */
225
+ problems: string[];
226
+ }
227
+ /**
228
+ * Parse and validate one manifest value.
229
+ *
230
+ * The parse is total: junk input yields problems instead of an exception.
231
+ * The returned value is cast only after every field has been validated, so
232
+ * the cast carries the guarantee the validators establish.
233
+ * @param value The raw manifest value (as parsed from JSON).
234
+ * @returns The validated manifest, or every problem found.
235
+ */
236
+ export declare function parseManifest(value: unknown): ManifestParseResult;