@company-semantics/contracts 47.2.0 → 48.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ralph/prd.ts +56 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "47.2.0",
3
+ "version": "48.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/ralph/prd.ts CHANGED
@@ -167,21 +167,71 @@ export type RalphMeta = {
167
167
  *
168
168
  * Discriminated union of verification check types.
169
169
  * All criteria must pass for feature to be marked passes: true.
170
+ *
171
+ * This union is the contract for what the Ralph verifier dispatch actually
172
+ * runs (control repo, `acceptance-verifier-dispatch.ts`) — every member here
173
+ * has a runner; anything else is rejected at preflight
174
+ * (ADR-CONTRACTS-121). Field names are canonical: the runner-side alias
175
+ * `expected` (for `expectedExitCode`) survives one release and then dies.
176
+ *
177
+ * `ci_status` was REMOVED in ADR-CONTRACTS-121: it was never implemented
178
+ * (the runner passed unconditionally) and had zero uses in the PRD corpus.
179
+ * CI is verified by guards — use `guard_passes` / `guard_suite`.
170
180
  */
171
181
  export type RalphAcceptanceCriteria =
172
- | { type: "file_contains"; path: string; pattern: string }
182
+ | {
183
+ type: "file_contains";
184
+ path: string;
185
+ /** Regex (default) or literal needle. Forbidden when match is "semantic". */
186
+ pattern?: string;
187
+ /** Regex flags (regex match mode only). */
188
+ flags?: string;
189
+ /** Match mode; default "regex". "semantic" judges `claim` via LLM. */
190
+ match?: "regex" | "literal" | "semantic";
191
+ /** Semantic-judge assertion (required iff match is "semantic"). */
192
+ claim?: string;
193
+ }
194
+ | { type: "file_not_contains"; path: string; pattern: string; flags?: string }
195
+ | { type: "file_exists"; path: string }
196
+ | { type: "file_not_exists"; path: string }
173
197
  | {
174
198
  type: "command_exit";
175
199
  command: string;
176
200
  expectedExitCode: number;
201
+ /** Explicit working directory override (ADR-CTRL-078 in control). */
202
+ cwd?: string;
203
+ }
204
+ | {
205
+ type: "test_passes";
206
+ /** Vitest file-path/test-name filter. */
207
+ pattern?: string;
208
+ /** Sibling repo whose suite runs (executor worktree preferred; ADR-CTRL-386). */
209
+ repo?: string;
210
+ }
211
+ | {
212
+ type: "grep_count";
213
+ path: string;
214
+ pattern: string;
215
+ /** At-least-N semantics. Exactly one of minCount/expectedCount. */
216
+ minCount?: number;
217
+ /** Exactly-N semantics. Exactly one of minCount/expectedCount. */
218
+ expectedCount?: number;
219
+ }
220
+ | {
221
+ type: "guard_passes";
222
+ guard: string;
223
+ /** Sibling repo to run in (executor worktree preferred; ADR-CTRL-386). */
224
+ repo?: string;
177
225
  }
178
226
  | {
179
- type: "ci_status";
180
- workflow?: string;
181
- status: "success" | "failure";
182
- scope?: "current_sha" | "branch";
227
+ type: "guard_suite";
228
+ /** "quick" (default) = pnpm guard:quick; "full" = pnpm guard. */
229
+ mode?: "quick" | "full";
230
+ repo?: string;
183
231
  }
184
- | { type: "test_passes"; pattern?: string };
232
+ | { type: "schema_sync" }
233
+ | { type: "migration_applied" }
234
+ | { type: "migration_idempotent" };
185
235
 
186
236
  /**
187
237
  * Code shape guidance for feature implementation.