@mcptoolshop/research-os 0.5.0 → 0.6.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/dist/index.js CHANGED
@@ -110,84 +110,103 @@ var init_errors = __esm({
110
110
  }
111
111
  });
112
112
 
113
- // src/intake/schema.ts
113
+ // src/review/reviewer-options-schema.ts
114
114
  import { z } from "zod";
115
+ var ReviewerOptionsSchema;
116
+ var init_reviewer_options_schema = __esm({
117
+ "src/review/reviewer-options-schema.ts"() {
118
+ "use strict";
119
+ ReviewerOptionsSchema = z.object({
120
+ num_ctx: z.number().int().positive().optional(),
121
+ temperature: z.number().min(0).max(2).optional(),
122
+ seed: z.number().int().optional(),
123
+ top_p: z.number().min(0).max(1).optional(),
124
+ top_k: z.number().int().nonnegative().optional(),
125
+ repeat_penalty: z.number().min(0).optional()
126
+ });
127
+ }
128
+ });
129
+
130
+ // src/intake/schema.ts
131
+ import { z as z2 } from "zod";
115
132
  var SectionStatusSchema, SectionSchema, SourceFloorGateSchema, ClaimIntegrityGateSchema, FreshnessGateSchema, ContradictionGateSchema, SectionBudgetGateSchema, GateConfigSchema, SectionScopedWaiverSchema, PrimarySourceWaiverSchema, FreshnessRequirementsSchema, ReviewProfilePresetSchema, DEFAULT_REVIEW_PROFILES, ResearchYamlSchema;
116
133
  var init_schema = __esm({
117
134
  "src/intake/schema.ts"() {
118
135
  "use strict";
119
- SectionStatusSchema = z.enum([
136
+ init_reviewer_options_schema();
137
+ SectionStatusSchema = z2.enum([
120
138
  "draft",
121
139
  "gathering",
122
140
  "gated",
123
141
  "reviewed",
124
142
  "frozen"
125
143
  ]);
126
- SectionSchema = z.object({
127
- id: z.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
128
- purpose: z.string().min(1),
129
- max_time_minutes: z.number().int().positive().default(45),
130
- min_sources: z.number().int().nonnegative().default(8),
131
- primary_sources_required: z.number().int().nonnegative().default(2),
132
- contradictions_required: z.boolean().default(true),
144
+ SectionSchema = z2.object({
145
+ id: z2.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
146
+ purpose: z2.string().min(1),
147
+ max_time_minutes: z2.number().int().positive().default(45),
148
+ min_sources: z2.number().int().nonnegative().default(8),
149
+ primary_sources_required: z2.number().int().nonnegative().default(2),
150
+ contradictions_required: z2.boolean().default(true),
133
151
  status: SectionStatusSchema.default("draft")
134
152
  });
135
- SourceFloorGateSchema = z.object({
136
- min_sources: z.number().int().nonnegative().default(8),
137
- min_independent_publishers: z.number().int().nonnegative().default(4),
138
- primary_sources_required: z.number().int().nonnegative().default(2),
139
- primary_source_waiver_allowed: z.boolean().default(true)
153
+ SourceFloorGateSchema = z2.object({
154
+ min_sources: z2.number().int().nonnegative().default(8),
155
+ min_independent_publishers: z2.number().int().nonnegative().default(4),
156
+ primary_sources_required: z2.number().int().nonnegative().default(2),
157
+ primary_source_waiver_allowed: z2.boolean().default(true)
140
158
  });
141
- ClaimIntegrityGateSchema = z.object({
142
- every_claim_needs_source: z.boolean().default(true),
143
- no_orphan_claims: z.boolean().default(true),
144
- no_source_cluster_monopoly: z.boolean().default(true)
159
+ ClaimIntegrityGateSchema = z2.object({
160
+ every_claim_needs_source: z2.boolean().default(true),
161
+ no_orphan_claims: z2.boolean().default(true),
162
+ no_source_cluster_monopoly: z2.boolean().default(true)
145
163
  });
146
- FreshnessGateSchema = z.object({
147
- required_for_current_topics: z.boolean().default(true),
148
- stale_source_policy: z.enum(["warn", "fail"]).default("warn")
164
+ FreshnessGateSchema = z2.object({
165
+ required_for_current_topics: z2.boolean().default(true),
166
+ stale_source_policy: z2.enum(["warn", "fail"]).default("warn")
149
167
  });
150
- ContradictionGateSchema = z.object({
151
- required: z.boolean().default(true),
152
- unresolved_contradictions_block_synthesis: z.boolean().default(true)
168
+ ContradictionGateSchema = z2.object({
169
+ required: z2.boolean().default(true),
170
+ unresolved_contradictions_block_synthesis: z2.boolean().default(true)
153
171
  });
154
- SectionBudgetGateSchema = z.object({
155
- max_time_minutes: z.number().int().positive().default(45),
156
- extension_requires_evidence: z.boolean().default(true)
172
+ SectionBudgetGateSchema = z2.object({
173
+ max_time_minutes: z2.number().int().positive().default(45),
174
+ extension_requires_evidence: z2.boolean().default(true)
157
175
  });
158
- GateConfigSchema = z.object({
176
+ GateConfigSchema = z2.object({
159
177
  source_floor: SourceFloorGateSchema.default({}),
160
178
  claim_integrity: ClaimIntegrityGateSchema.default({}),
161
179
  freshness: FreshnessGateSchema.default({}),
162
180
  contradiction: ContradictionGateSchema.default({}),
163
181
  section_budget: SectionBudgetGateSchema.default({})
164
182
  });
165
- SectionScopedWaiverSchema = z.object({
166
- section_id: z.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
167
- scope: z.enum(["min_independent_publishers", "primary_sources_required"]),
168
- reason: z.string().min(1),
169
- compensating_controls: z.array(z.string()).min(1)
170
- });
171
- PrimarySourceWaiverSchema = z.object({
172
- status: z.enum(["none", "requested", "granted"]).default("none"),
173
- reason: z.string().optional(),
174
- compensating_controls: z.array(z.string()).default([]),
183
+ SectionScopedWaiverSchema = z2.object({
184
+ section_id: z2.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
185
+ scope: z2.enum(["min_independent_publishers", "primary_sources_required"]),
186
+ reason: z2.string().min(1),
187
+ compensating_controls: z2.array(z2.string()).min(1)
188
+ });
189
+ PrimarySourceWaiverSchema = z2.object({
190
+ status: z2.enum(["none", "requested", "granted"]).default("none"),
191
+ reason: z2.string().optional(),
192
+ compensating_controls: z2.array(z2.string()).default([]),
175
193
  // Section-scoped waivers; each entry is its own waiver record. Independent
176
194
  // of the pack-level status/reason/compensating_controls fields above.
177
195
  // Defaults to [] for backward compatibility — existing packs unaffected.
178
- section_waivers: z.array(SectionScopedWaiverSchema).default([])
196
+ section_waivers: z2.array(SectionScopedWaiverSchema).default([])
179
197
  });
180
- FreshnessRequirementsSchema = z.object({
181
- required: z.boolean().default(true),
182
- max_source_age_months: z.number().int().positive().nullable().default(null)
198
+ FreshnessRequirementsSchema = z2.object({
199
+ required: z2.boolean().default(true),
200
+ max_source_age_months: z2.number().int().positive().nullable().default(null)
183
201
  });
184
- ReviewProfilePresetSchema = z.object({
185
- general_model: z.string().nullable().default(null),
186
- critic_model: z.string().nullable().default(null),
187
- review_window: z.number().int().positive().nullable().default(null),
188
- mode: z.enum(["general", "two_pass"]).default("two_pass"),
189
- status: z.enum(["calibrated_baseline", "experimental", "deprecated"]).default("experimental"),
190
- notes: z.string().nullable().default(null)
202
+ ReviewProfilePresetSchema = z2.object({
203
+ general_model: z2.string().nullable().default(null),
204
+ critic_model: z2.string().nullable().default(null),
205
+ review_window: z2.number().int().positive().nullable().default(null),
206
+ mode: z2.enum(["general", "two_pass"]).default("two_pass"),
207
+ status: z2.enum(["calibrated_baseline", "experimental", "deprecated"]).default("experimental"),
208
+ notes: z2.string().nullable().default(null),
209
+ reviewer_options: ReviewerOptionsSchema.optional()
191
210
  });
192
211
  DEFAULT_REVIEW_PROFILES = {
193
212
  // The dogfood-validated baseline. Section 03 of research-os-spec is the
@@ -201,27 +220,36 @@ var init_schema = __esm({
201
220
  mode: "two_pass",
202
221
  status: "calibrated_baseline",
203
222
  notes: "Calibrated baseline as of v0.1. 0% good-claim FPR on the seeded fixture; bad-claim any-flag recall 9/13 (69%). Smaller window required because hermes3:8b at 4-bit on a 5080 cannot complete 25-claim windows within a 3-minute budget."
223
+ },
224
+ "hermes-two-pass-deterministic": {
225
+ general_model: "hermes3:8b",
226
+ critic_model: "hermes3:8b",
227
+ review_window: 30,
228
+ mode: "two_pass",
229
+ status: "experimental",
230
+ notes: "Deterministic Hermes baseline (temperature=0, seed=7). seeded-v1 canonical receipt: failed (recurring per_category_any_flag_floor + decision_vocab_completeness \u2014 F-52, F-49). See calibration/reviewer-profiles/hermes-two-pass-deterministic/seeded-v1.md.",
231
+ reviewer_options: { temperature: 0, seed: 7 }
204
232
  }
205
233
  };
206
- ResearchYamlSchema = z.object({
207
- research_os_version: z.string(),
208
- created_at: z.string(),
209
- topic: z.string().min(10, "Topic must be at least 10 characters"),
210
- decision: z.string().default(""),
211
- audience: z.string().default("self"),
212
- desired_output: z.string().default(""),
213
- max_runtime_minutes: z.number().int().positive().default(240),
234
+ ResearchYamlSchema = z2.object({
235
+ research_os_version: z2.string(),
236
+ created_at: z2.string(),
237
+ topic: z2.string().min(10, "Topic must be at least 10 characters"),
238
+ decision: z2.string().default(""),
239
+ audience: z2.string().default("self"),
240
+ desired_output: z2.string().default(""),
241
+ max_runtime_minutes: z2.number().int().positive().default(240),
214
242
  freshness: FreshnessRequirementsSchema.default({}),
215
- excluded_sources: z.array(z.string()).default([]),
243
+ excluded_sources: z2.array(z2.string()).default([]),
216
244
  primary_source_waiver: PrimarySourceWaiverSchema.default({}),
217
- sections: z.array(SectionSchema).default([]),
245
+ sections: z2.array(SectionSchema).default([]),
218
246
  gates: GateConfigSchema.default({}),
219
247
  // Reviewer-profile presets baked into the pack so future review runs
220
248
  // (across any section in this pack) inherit the calibrated configuration
221
249
  // without rediscovering rig-specific timeouts and context issues. Override
222
250
  // with `--preset <name>` on `research-os review`.
223
- review_profiles: z.record(z.string(), ReviewProfilePresetSchema).default(() => ({ ...DEFAULT_REVIEW_PROFILES })),
224
- frozen_at: z.string().nullable().default(null)
251
+ review_profiles: z2.record(z2.string(), ReviewProfilePresetSchema).default(() => ({ ...DEFAULT_REVIEW_PROFILES })),
252
+ frozen_at: z2.string().nullable().default(null)
225
253
  });
226
254
  }
227
255
  });
@@ -365,21 +393,21 @@ var init_intake = __esm({
365
393
  });
366
394
 
367
395
  // src/sections/schema.ts
368
- import { z as z2 } from "zod";
396
+ import { z as z3 } from "zod";
369
397
  var SectionGatesYamlSchema;
370
398
  var init_schema2 = __esm({
371
399
  "src/sections/schema.ts"() {
372
400
  "use strict";
373
401
  init_schema();
374
- SectionGatesYamlSchema = z2.object({
375
- section_id: z2.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
376
- purpose: z2.string().min(1),
402
+ SectionGatesYamlSchema = z3.object({
403
+ section_id: z3.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
404
+ purpose: z3.string().min(1),
377
405
  status: SectionStatusSchema,
378
- created_at: z2.string(),
379
- max_time_minutes: z2.number().int().positive(),
380
- min_sources: z2.number().int().nonnegative(),
381
- primary_sources_required: z2.number().int().nonnegative(),
382
- contradictions_required: z2.boolean()
406
+ created_at: z3.string(),
407
+ max_time_minutes: z3.number().int().positive(),
408
+ min_sources: z3.number().int().nonnegative(),
409
+ primary_sources_required: z3.number().int().nonnegative(),
410
+ contradictions_required: z3.boolean()
383
411
  });
384
412
  }
385
413
  });
@@ -946,12 +974,12 @@ var init_extractors = __esm({
946
974
  });
947
975
 
948
976
  // src/sources/schema.ts
949
- import { z as z3 } from "zod";
977
+ import { z as z4 } from "zod";
950
978
  var SourceTypeSchema, RelevanceSchema, ExtractorNameSchema, FetchReceiptSchema, SourceCardSchema;
951
979
  var init_schema3 = __esm({
952
980
  "src/sources/schema.ts"() {
953
981
  "use strict";
954
- SourceTypeSchema = z3.enum([
982
+ SourceTypeSchema = z4.enum([
955
983
  "primary",
956
984
  "secondary",
957
985
  "forum",
@@ -959,51 +987,51 @@ var init_schema3 = __esm({
959
987
  "docs",
960
988
  "unknown"
961
989
  ]);
962
- RelevanceSchema = z3.enum(["high", "medium", "low", "unknown"]);
963
- ExtractorNameSchema = z3.enum(["heuristic", "ollama-intern"]);
964
- FetchReceiptSchema = z3.object({
965
- receipt_id: z3.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
966
- source_id: z3.string().regex(/^src_[a-f0-9]{12}$/),
967
- section_id: z3.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
968
- requested_url: z3.string().url(),
969
- final_url: z3.string().url().nullable(),
970
- status: z3.number().int().nullable(),
971
- status_text: z3.string().nullable(),
972
- content_type: z3.string().nullable(),
973
- fetched_at: z3.string(),
974
- byte_count: z3.number().int().nonnegative().nullable(),
975
- sha256: z3.string().regex(/^[a-f0-9]{64}$/).nullable(),
976
- title: z3.string().nullable(),
977
- raw_text_path: z3.string().nullable(),
978
- fetch_outcome: z3.enum(["ok", "http_error", "network_error"]),
979
- fetch_error: z3.string().nullable(),
980
- extraction_outcome: z3.enum(["ok", "failed", "skipped"]),
990
+ RelevanceSchema = z4.enum(["high", "medium", "low", "unknown"]);
991
+ ExtractorNameSchema = z4.enum(["heuristic", "ollama-intern"]);
992
+ FetchReceiptSchema = z4.object({
993
+ receipt_id: z4.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
994
+ source_id: z4.string().regex(/^src_[a-f0-9]{12}$/),
995
+ section_id: z4.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
996
+ requested_url: z4.string().url(),
997
+ final_url: z4.string().url().nullable(),
998
+ status: z4.number().int().nullable(),
999
+ status_text: z4.string().nullable(),
1000
+ content_type: z4.string().nullable(),
1001
+ fetched_at: z4.string(),
1002
+ byte_count: z4.number().int().nonnegative().nullable(),
1003
+ sha256: z4.string().regex(/^[a-f0-9]{64}$/).nullable(),
1004
+ title: z4.string().nullable(),
1005
+ raw_text_path: z4.string().nullable(),
1006
+ fetch_outcome: z4.enum(["ok", "http_error", "network_error"]),
1007
+ fetch_error: z4.string().nullable(),
1008
+ extraction_outcome: z4.enum(["ok", "failed", "skipped"]),
981
1009
  extraction_extractor: ExtractorNameSchema.nullable(),
982
- extraction_error: z3.string().nullable()
983
- });
984
- SourceCardSchema = z3.object({
985
- source_id: z3.string().regex(/^src_[a-f0-9]{12}$/),
986
- receipt_id: z3.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
987
- section_id: z3.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
988
- url: z3.string().url(),
989
- final_url: z3.string().url().nullable(),
990
- fetched_at: z3.string(),
991
- publisher: z3.string().nullable(),
992
- published_at: z3.string().nullable(),
993
- title: z3.string().min(1),
1010
+ extraction_error: z4.string().nullable()
1011
+ });
1012
+ SourceCardSchema = z4.object({
1013
+ source_id: z4.string().regex(/^src_[a-f0-9]{12}$/),
1014
+ receipt_id: z4.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
1015
+ section_id: z4.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
1016
+ url: z4.string().url(),
1017
+ final_url: z4.string().url().nullable(),
1018
+ fetched_at: z4.string(),
1019
+ publisher: z4.string().nullable(),
1020
+ published_at: z4.string().nullable(),
1021
+ title: z4.string().min(1),
994
1022
  source_type: SourceTypeSchema,
995
1023
  relevance: RelevanceSchema,
996
- key_points: z3.array(z3.string()),
997
- limitations: z3.array(z3.string()),
998
- asserts: z3.string().min(1),
999
- scope: z3.string().nullable(),
1000
- not: z3.string().nullable(),
1024
+ key_points: z4.array(z4.string()),
1025
+ limitations: z4.array(z4.string()),
1026
+ asserts: z4.string().min(1),
1027
+ scope: z4.string().nullable(),
1028
+ not: z4.string().nullable(),
1001
1029
  extracted_by: ExtractorNameSchema,
1002
- extracted_at: z3.string(),
1030
+ extracted_at: z4.string(),
1003
1031
  /** Rule that classified the URL. Added by Component B (v0.4). Optional for back-compat with pre-v0.4 cards. */
1004
- rule_hint: z3.string().optional(),
1032
+ rule_hint: z4.string().optional(),
1005
1033
  /** Precedence level of the rule that fired (2–6). Optional for back-compat with pre-v0.4 cards. */
1006
- precedence_level: z3.union([z3.literal(2), z3.literal(3), z3.literal(4), z3.literal(5), z3.literal(6)]).optional()
1034
+ precedence_level: z4.union([z4.literal(2), z4.literal(3), z4.literal(4), z4.literal(5), z4.literal(6)]).optional()
1007
1035
  });
1008
1036
  }
1009
1037
  });
@@ -1300,7 +1328,7 @@ var init_cards = __esm({
1300
1328
  });
1301
1329
 
1302
1330
  // src/sources/source-card-overrides-schema.ts
1303
- import { z as z4 } from "zod";
1331
+ import { z as z5 } from "zod";
1304
1332
  function validateSourceCardOverride(input) {
1305
1333
  return SourceCardOverrideSchema.parse(input);
1306
1334
  }
@@ -1309,20 +1337,20 @@ var init_source_card_overrides_schema = __esm({
1309
1337
  "src/sources/source-card-overrides-schema.ts"() {
1310
1338
  "use strict";
1311
1339
  init_schema3();
1312
- SourceCardOverrideSchema = z4.object({
1313
- source_id: z4.string().min(1, "source_id must be non-empty"),
1314
- url: z4.string().min(1, "url must be non-empty"),
1315
- previous_source_type: z4.string().nullable().optional(),
1340
+ SourceCardOverrideSchema = z5.object({
1341
+ source_id: z5.string().min(1, "source_id must be non-empty"),
1342
+ url: z5.string().min(1, "url must be non-empty"),
1343
+ previous_source_type: z5.string().nullable().optional(),
1316
1344
  new_source_type: SourceTypeSchema.nullable().optional(),
1317
- previous_publisher: z4.string().nullable().optional(),
1318
- new_publisher: z4.string().nullable().optional(),
1319
- reason: z4.string().refine((v) => v.trim().length > 0, { message: "reason must be non-empty after trim" }),
1320
- operator: z4.string().min(1, "operator must be non-empty"),
1321
- created_at: z4.string().refine((v) => isFinite(Date.parse(v)), {
1345
+ previous_publisher: z5.string().nullable().optional(),
1346
+ new_publisher: z5.string().nullable().optional(),
1347
+ reason: z5.string().refine((v) => v.trim().length > 0, { message: "reason must be non-empty after trim" }),
1348
+ operator: z5.string().min(1, "operator must be non-empty"),
1349
+ created_at: z5.string().refine((v) => isFinite(Date.parse(v)), {
1322
1350
  message: "created_at must be a valid ISO 8601 timestamp"
1323
1351
  }),
1324
- rule_hint: z4.string().nullable().optional(),
1325
- pack_version: z4.string().min(1, "pack_version must be non-empty")
1352
+ rule_hint: z5.string().nullable().optional(),
1353
+ pack_version: z5.string().min(1, "pack_version must be non-empty")
1326
1354
  }).refine(
1327
1355
  (obj) => obj.new_source_type != null && obj.new_source_type !== void 0 || obj.new_publisher != null && obj.new_publisher !== void 0,
1328
1356
  {
@@ -1463,23 +1491,23 @@ var init_gather = __esm({
1463
1491
  });
1464
1492
 
1465
1493
  // src/sources/excerpts/schema.ts
1466
- import { z as z5 } from "zod";
1494
+ import { z as z6 } from "zod";
1467
1495
  var EXCERPT_ID_PATTERN, ExcerptOriginSchema, ExcerptSchema;
1468
1496
  var init_schema4 = __esm({
1469
1497
  "src/sources/excerpts/schema.ts"() {
1470
1498
  "use strict";
1471
1499
  EXCERPT_ID_PATTERN = /^ex_[a-f0-9]{12}_\d{3,}$/;
1472
- ExcerptOriginSchema = z5.enum(["raw_text", "key_point"]);
1473
- ExcerptSchema = z5.object({
1474
- excerpt_id: z5.string().regex(EXCERPT_ID_PATTERN),
1475
- source_id: z5.string().regex(/^src_[a-f0-9]{12}$/),
1476
- source_hash: z5.string().regex(/^[a-f0-9]{64}$/).nullable(),
1477
- text: z5.string().min(1),
1478
- location_hint: z5.string().nullable(),
1479
- char_start: z5.number().int().nonnegative(),
1480
- char_end: z5.number().int().nonnegative(),
1500
+ ExcerptOriginSchema = z6.enum(["raw_text", "key_point"]);
1501
+ ExcerptSchema = z6.object({
1502
+ excerpt_id: z6.string().regex(EXCERPT_ID_PATTERN),
1503
+ source_id: z6.string().regex(/^src_[a-f0-9]{12}$/),
1504
+ source_hash: z6.string().regex(/^[a-f0-9]{64}$/).nullable(),
1505
+ text: z6.string().min(1),
1506
+ location_hint: z6.string().nullable(),
1507
+ char_start: z6.number().int().nonnegative(),
1508
+ char_end: z6.number().int().nonnegative(),
1481
1509
  origin: ExcerptOriginSchema,
1482
- created_at: z5.string()
1510
+ created_at: z6.string()
1483
1511
  });
1484
1512
  }
1485
1513
  });
@@ -2022,41 +2050,41 @@ var init_extractors2 = __esm({
2022
2050
  });
2023
2051
 
2024
2052
  // src/claims/schema.ts
2025
- import { z as z6 } from "zod";
2053
+ import { z as z7 } from "zod";
2026
2054
  var ConfidenceSchema, ClaimExtractorSchema, ReviewStateSchema, ClaimSchema;
2027
2055
  var init_schema5 = __esm({
2028
2056
  "src/claims/schema.ts"() {
2029
2057
  "use strict";
2030
2058
  init_schema4();
2031
- ConfidenceSchema = z6.enum(["low", "medium", "high"]);
2032
- ClaimExtractorSchema = z6.enum(["heuristic", "ollama-intern"]);
2033
- ReviewStateSchema = z6.enum([
2059
+ ConfidenceSchema = z7.enum(["low", "medium", "high"]);
2060
+ ClaimExtractorSchema = z7.enum(["heuristic", "ollama-intern"]);
2061
+ ReviewStateSchema = z7.enum([
2034
2062
  "candidate",
2035
2063
  "gated",
2036
2064
  "reviewed",
2037
2065
  "rejected",
2038
2066
  "accepted"
2039
2067
  ]);
2040
- ClaimSchema = z6.object({
2041
- claim_id: z6.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
2042
- section_id: z6.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2043
- source_ids: z6.array(z6.string().regex(/^src_[a-f0-9]{12}$/)).min(1, "every claim must reference at least one source_id"),
2044
- source_hashes: z6.array(z6.string().regex(/^[a-f0-9]{64}$/)),
2045
- asserts: z6.string().min(1),
2046
- scope: z6.string().nullable(),
2047
- not: z6.string().nullable(),
2068
+ ClaimSchema = z7.object({
2069
+ claim_id: z7.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
2070
+ section_id: z7.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2071
+ source_ids: z7.array(z7.string().regex(/^src_[a-f0-9]{12}$/)).min(1, "every claim must reference at least one source_id"),
2072
+ source_hashes: z7.array(z7.string().regex(/^[a-f0-9]{64}$/)),
2073
+ asserts: z7.string().min(1),
2074
+ scope: z7.string().nullable(),
2075
+ not: z7.string().nullable(),
2048
2076
  // Span-first extraction: the model picks excerpt IDs from the deterministic
2049
2077
  // ledger; research-os copies the literal text into evidence_excerpt. Models
2050
2078
  // may interpret source spans; they may not author evidence spans.
2051
2079
  // Allowed empty for legacy claims that pre-date span-first extraction —
2052
2080
  // those should be re-extracted; new writes always populate at least one ID.
2053
- evidence_excerpt_ids: z6.array(z6.string().regex(EXCERPT_ID_PATTERN)).default([]),
2054
- evidence_excerpt: z6.string().min(1),
2055
- evidence_location: z6.string().nullable(),
2081
+ evidence_excerpt_ids: z7.array(z7.string().regex(EXCERPT_ID_PATTERN)).default([]),
2082
+ evidence_excerpt: z7.string().min(1),
2083
+ evidence_location: z7.string().nullable(),
2056
2084
  confidence: ConfidenceSchema,
2057
2085
  extractor: ClaimExtractorSchema,
2058
- extraction_method: z6.string().min(1),
2059
- created_at: z6.string(),
2086
+ extraction_method: z7.string().min(1),
2087
+ created_at: z7.string(),
2060
2088
  review_state: ReviewStateSchema
2061
2089
  });
2062
2090
  }
@@ -2344,53 +2372,53 @@ var init_extract = __esm({
2344
2372
  });
2345
2373
 
2346
2374
  // src/claims/density/schema.ts
2347
- import { z as z7 } from "zod";
2375
+ import { z as z8 } from "zod";
2348
2376
  var PerSourceDensitySchema, NearDuplicateClusterSchema, DensityFlagSchema, ClaimDensityAuditSchema;
2349
2377
  var init_schema6 = __esm({
2350
2378
  "src/claims/density/schema.ts"() {
2351
2379
  "use strict";
2352
- PerSourceDensitySchema = z7.object({
2353
- source_id: z7.string().regex(/^src_[a-f0-9]{12}$/),
2354
- publisher: z7.string().nullable(),
2355
- source_word_count: z7.number().int().nonnegative(),
2356
- claim_count: z7.number().int().nonnegative(),
2357
- claims_per_1k_words: z7.number(),
2358
- share_of_section: z7.number(),
2380
+ PerSourceDensitySchema = z8.object({
2381
+ source_id: z8.string().regex(/^src_[a-f0-9]{12}$/),
2382
+ publisher: z8.string().nullable(),
2383
+ source_word_count: z8.number().int().nonnegative(),
2384
+ claim_count: z8.number().int().nonnegative(),
2385
+ claims_per_1k_words: z8.number(),
2386
+ share_of_section: z8.number(),
2359
2387
  // 0..1
2360
- weak_scope_count: z7.number().int().nonnegative(),
2361
- generic_scope_count: z7.number().int().nonnegative()
2388
+ weak_scope_count: z8.number().int().nonnegative(),
2389
+ generic_scope_count: z8.number().int().nonnegative()
2362
2390
  });
2363
- NearDuplicateClusterSchema = z7.object({
2364
- representative_assert: z7.string(),
2365
- member_count: z7.number().int().nonnegative(),
2366
- claim_ids: z7.array(z7.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/))
2391
+ NearDuplicateClusterSchema = z8.object({
2392
+ representative_assert: z8.string(),
2393
+ member_count: z8.number().int().nonnegative(),
2394
+ claim_ids: z8.array(z8.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/))
2367
2395
  });
2368
- DensityFlagSchema = z7.object({
2369
- type: z7.enum([
2396
+ DensityFlagSchema = z8.object({
2397
+ type: z8.enum([
2370
2398
  "source_dominance",
2371
2399
  "high_per_word_density",
2372
2400
  "large_near_duplicate_cluster",
2373
2401
  "weak_scope_majority"
2374
2402
  ]),
2375
- severity: z7.enum(["info", "warn", "block"]),
2376
- message: z7.string(),
2377
- affects_source_ids: z7.array(z7.string().regex(/^src_[a-f0-9]{12}$/)).default([]),
2378
- affects_claim_ids: z7.array(z7.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)).default([])
2403
+ severity: z8.enum(["info", "warn", "block"]),
2404
+ message: z8.string(),
2405
+ affects_source_ids: z8.array(z8.string().regex(/^src_[a-f0-9]{12}$/)).default([]),
2406
+ affects_claim_ids: z8.array(z8.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)).default([])
2379
2407
  });
2380
- ClaimDensityAuditSchema = z7.object({
2381
- audit_id: z7.string().regex(/^cda_[0-9]+_[a-z0-9-]+$/),
2382
- section_id: z7.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2383
- audited_at: z7.string(),
2384
- research_os_version: z7.string(),
2385
- candidate_claim_count: z7.number().int().nonnegative(),
2386
- source_count: z7.number().int().nonnegative(),
2387
- total_source_word_count: z7.number().int().nonnegative(),
2388
- claims_per_1k_words: z7.number(),
2389
- weak_scope_count: z7.number().int().nonnegative(),
2390
- generic_scope_count: z7.number().int().nonnegative(),
2391
- per_source: z7.array(PerSourceDensitySchema),
2392
- near_duplicate_clusters: z7.array(NearDuplicateClusterSchema),
2393
- flags: z7.array(DensityFlagSchema)
2408
+ ClaimDensityAuditSchema = z8.object({
2409
+ audit_id: z8.string().regex(/^cda_[0-9]+_[a-z0-9-]+$/),
2410
+ section_id: z8.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2411
+ audited_at: z8.string(),
2412
+ research_os_version: z8.string(),
2413
+ candidate_claim_count: z8.number().int().nonnegative(),
2414
+ source_count: z8.number().int().nonnegative(),
2415
+ total_source_word_count: z8.number().int().nonnegative(),
2416
+ claims_per_1k_words: z8.number(),
2417
+ weak_scope_count: z8.number().int().nonnegative(),
2418
+ generic_scope_count: z8.number().int().nonnegative(),
2419
+ per_source: z8.array(PerSourceDensitySchema),
2420
+ near_duplicate_clusters: z8.array(NearDuplicateClusterSchema),
2421
+ flags: z8.array(DensityFlagSchema)
2394
2422
  });
2395
2423
  }
2396
2424
  });
@@ -2707,12 +2735,12 @@ var init_claims = __esm({
2707
2735
  });
2708
2736
 
2709
2737
  // src/contradictions/schema.ts
2710
- import { z as z8 } from "zod";
2738
+ import { z as z9 } from "zod";
2711
2739
  var ContradictionTypeSchema, SeveritySchema, OverlapAssessmentSchema, ContradictionDetectorSchema, ContradictionStatusSchema, ContradictionConfidenceSchema, ContradictionSchema;
2712
2740
  var init_schema7 = __esm({
2713
2741
  "src/contradictions/schema.ts"() {
2714
2742
  "use strict";
2715
- ContradictionTypeSchema = z8.enum([
2743
+ ContradictionTypeSchema = z9.enum([
2716
2744
  "direct_conflict",
2717
2745
  "scope_conflict",
2718
2746
  "temporal_conflict",
@@ -2720,37 +2748,37 @@ var init_schema7 = __esm({
2720
2748
  "evidence_conflict",
2721
2749
  "overgeneralization_risk"
2722
2750
  ]);
2723
- SeveritySchema = z8.enum(["low", "medium", "high", "blocking"]);
2724
- OverlapAssessmentSchema = z8.enum([
2751
+ SeveritySchema = z9.enum(["low", "medium", "high", "blocking"]);
2752
+ OverlapAssessmentSchema = z9.enum([
2725
2753
  "fully_overlapping",
2726
2754
  "partially_overlapping",
2727
2755
  "non_overlapping",
2728
2756
  "unknown"
2729
2757
  ]);
2730
- ContradictionDetectorSchema = z8.enum(["heuristic", "ollama-intern"]);
2731
- ContradictionStatusSchema = z8.enum([
2758
+ ContradictionDetectorSchema = z9.enum(["heuristic", "ollama-intern"]);
2759
+ ContradictionStatusSchema = z9.enum([
2732
2760
  "unresolved",
2733
2761
  "reconciled",
2734
2762
  "preserved_deliberately",
2735
2763
  "rejected"
2736
2764
  ]);
2737
- ContradictionConfidenceSchema = z8.enum(["low", "medium", "high"]);
2738
- ContradictionSchema = z8.object({
2739
- contradiction_id: z8.string().regex(/^cnt_[a-f0-9]{12}_(heuristic|ollama_intern)$/),
2740
- section_id: z8.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2741
- claim_ids: z8.array(z8.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)).length(2, "contradictions are pair-wise in v0.1"),
2742
- source_ids: z8.array(z8.string().regex(/^src_[a-f0-9]{12}$/)).min(1),
2765
+ ContradictionConfidenceSchema = z9.enum(["low", "medium", "high"]);
2766
+ ContradictionSchema = z9.object({
2767
+ contradiction_id: z9.string().regex(/^cnt_[a-f0-9]{12}_(heuristic|ollama_intern)$/),
2768
+ section_id: z9.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
2769
+ claim_ids: z9.array(z9.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)).length(2, "contradictions are pair-wise in v0.1"),
2770
+ source_ids: z9.array(z9.string().regex(/^src_[a-f0-9]{12}$/)).min(1),
2743
2771
  type: ContradictionTypeSchema,
2744
- summary: z8.string().min(1),
2745
- scope_analysis: z8.string(),
2772
+ summary: z9.string().min(1),
2773
+ scope_analysis: z9.string(),
2746
2774
  overlap_assessment: OverlapAssessmentSchema,
2747
2775
  severity: SeveritySchema,
2748
2776
  confidence: ContradictionConfidenceSchema,
2749
2777
  detector: ContradictionDetectorSchema,
2750
- detection_method: z8.string().min(1),
2751
- evidence: z8.string(),
2778
+ detection_method: z9.string().min(1),
2779
+ evidence: z9.string(),
2752
2780
  status: ContradictionStatusSchema,
2753
- created_at: z8.string()
2781
+ created_at: z9.string()
2754
2782
  });
2755
2783
  }
2756
2784
  });
@@ -3195,12 +3223,12 @@ var init_markdown = __esm({
3195
3223
  });
3196
3224
 
3197
3225
  // src/triage/schema.ts
3198
- import { z as z9 } from "zod";
3226
+ import { z as z10 } from "zod";
3199
3227
  var TriageDecisionSchema, ClaimTriageSchema, TriageSummarySchema;
3200
3228
  var init_schema8 = __esm({
3201
3229
  "src/triage/schema.ts"() {
3202
3230
  "use strict";
3203
- TriageDecisionSchema = z9.enum([
3231
+ TriageDecisionSchema = z10.enum([
3204
3232
  // Passes triage and is forwarded to review.
3205
3233
  "selected_for_review",
3206
3234
  // Parked: kept on the canonical ledger as research truth, but not advanced.
@@ -3212,36 +3240,36 @@ var init_schema8 = __esm({
3212
3240
  "needs_scope_repair",
3213
3241
  "needs_human_review"
3214
3242
  ]);
3215
- ClaimTriageSchema = z9.object({
3216
- triage_id: z9.string().regex(/^tri_[a-f0-9]{12}$/),
3217
- claim_id: z9.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
3218
- section_id: z9.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3243
+ ClaimTriageSchema = z10.object({
3244
+ triage_id: z10.string().regex(/^tri_[a-f0-9]{12}$/),
3245
+ claim_id: z10.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
3246
+ section_id: z10.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3219
3247
  decision: TriageDecisionSchema,
3220
- reason: z9.string().min(1),
3248
+ reason: z10.string().min(1),
3221
3249
  // Rank among selected_for_review claims (1 = highest priority). null for
3222
3250
  // any non-selected decision.
3223
- rank: z9.number().int().positive().nullable(),
3251
+ rank: z10.number().int().positive().nullable(),
3224
3252
  // Quality score [0..1] used to sort. Stable. Higher = better.
3225
- quality_score: z9.number().min(0).max(1),
3226
- triage_method: z9.string().min(1),
3227
- created_at: z9.string()
3228
- });
3229
- TriageSummarySchema = z9.object({
3230
- summary_id: z9.string().regex(/^tris_[0-9]+_[a-z0-9-]+$/),
3231
- section_id: z9.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3232
- triaged_at: z9.string(),
3233
- research_os_version: z9.string(),
3234
- triage_method: z9.string(),
3235
- candidate_claims: z9.number().int().nonnegative(),
3236
- decisions: z9.record(TriageDecisionSchema, z9.number().int().nonnegative()),
3237
- per_source_cap: z9.number().int().positive(),
3238
- duplicate_clusters_collapsed: z9.number().int().nonnegative(),
3239
- selected_count: z9.number().int().nonnegative(),
3240
- selected_per_source: z9.array(
3241
- z9.object({
3242
- source_id: z9.string().regex(/^src_[a-f0-9]{12}$/),
3243
- selected: z9.number().int().nonnegative(),
3244
- total: z9.number().int().nonnegative()
3253
+ quality_score: z10.number().min(0).max(1),
3254
+ triage_method: z10.string().min(1),
3255
+ created_at: z10.string()
3256
+ });
3257
+ TriageSummarySchema = z10.object({
3258
+ summary_id: z10.string().regex(/^tris_[0-9]+_[a-z0-9-]+$/),
3259
+ section_id: z10.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3260
+ triaged_at: z10.string(),
3261
+ research_os_version: z10.string(),
3262
+ triage_method: z10.string(),
3263
+ candidate_claims: z10.number().int().nonnegative(),
3264
+ decisions: z10.record(TriageDecisionSchema, z10.number().int().nonnegative()),
3265
+ per_source_cap: z10.number().int().positive(),
3266
+ duplicate_clusters_collapsed: z10.number().int().nonnegative(),
3267
+ selected_count: z10.number().int().nonnegative(),
3268
+ selected_per_source: z10.array(
3269
+ z10.object({
3270
+ source_id: z10.string().regex(/^src_[a-f0-9]{12}$/),
3271
+ selected: z10.number().int().nonnegative(),
3272
+ total: z10.number().int().nonnegative()
3245
3273
  })
3246
3274
  )
3247
3275
  });
@@ -3738,23 +3766,23 @@ var init_map = __esm({
3738
3766
  });
3739
3767
 
3740
3768
  // src/contradictions/resolution-schema.ts
3741
- import { z as z10 } from "zod";
3769
+ import { z as z11 } from "zod";
3742
3770
  var ResolutionStatusSchema, ContradictionResolutionSchema;
3743
3771
  var init_resolution_schema = __esm({
3744
3772
  "src/contradictions/resolution-schema.ts"() {
3745
3773
  "use strict";
3746
- ResolutionStatusSchema = z10.enum([
3774
+ ResolutionStatusSchema = z11.enum([
3747
3775
  "unresolved",
3748
3776
  "resolved",
3749
3777
  "preserved",
3750
3778
  "rejected"
3751
3779
  ]);
3752
- ContradictionResolutionSchema = z10.object({
3753
- contradiction_id: z10.string().min(1),
3780
+ ContradictionResolutionSchema = z11.object({
3781
+ contradiction_id: z11.string().min(1),
3754
3782
  status: ResolutionStatusSchema,
3755
- reason: z10.string().min(4),
3756
- resolved_at: z10.string().min(1),
3757
- resolved_by: z10.string().min(1)
3783
+ reason: z11.string().min(4),
3784
+ resolved_at: z11.string().min(1),
3785
+ resolved_by: z11.string().min(1)
3758
3786
  });
3759
3787
  }
3760
3788
  });
@@ -3871,12 +3899,13 @@ var init_contradictions = __esm({
3871
3899
  });
3872
3900
 
3873
3901
  // src/review/schema.ts
3874
- import { z as z11 } from "zod";
3902
+ import { z as z12 } from "zod";
3875
3903
  var FindingCategorySchema, FindingSeveritySchema, ReviewerNameSchema, ReviewDecisionSchema, ReviewConfidenceSchema, ReviewFindingSchema, ClaimReviewSchema, ReviewSnapshotSchema;
3876
3904
  var init_schema9 = __esm({
3877
3905
  "src/review/schema.ts"() {
3878
3906
  "use strict";
3879
- FindingCategorySchema = z11.enum([
3907
+ init_reviewer_options_schema();
3908
+ FindingCategorySchema = z12.enum([
3880
3909
  "unsupported_claim",
3881
3910
  "ungrounded_excerpt",
3882
3911
  "stale_claim",
@@ -3903,9 +3932,9 @@ var init_schema9 = __esm({
3903
3932
  // a low-value claim can appear in a perfectly-sized section.
3904
3933
  "valid_but_low_value"
3905
3934
  ]);
3906
- FindingSeveritySchema = z11.enum(["info", "warn", "block"]);
3907
- ReviewerNameSchema = z11.enum(["heuristic", "ollama-intern"]);
3908
- ReviewDecisionSchema = z11.enum([
3935
+ FindingSeveritySchema = z12.enum(["info", "warn", "block"]);
3936
+ ReviewerNameSchema = z12.enum(["heuristic", "ollama-intern"]);
3937
+ ReviewDecisionSchema = z12.enum([
3909
3938
  "accepted_for_synthesis",
3910
3939
  "rejected",
3911
3940
  "needs_scope_repair",
@@ -3913,47 +3942,48 @@ var init_schema9 = __esm({
3913
3942
  "needs_contradiction_mapping",
3914
3943
  "needs_human_review"
3915
3944
  ]);
3916
- ReviewConfidenceSchema = z11.enum(["low", "medium", "high"]);
3917
- ReviewFindingSchema = z11.object({
3918
- finding_id: z11.string().regex(/^fnd_[a-f0-9]{12}$/),
3919
- section_id: z11.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3920
- claim_ids: z11.array(z11.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)),
3921
- source_ids: z11.array(z11.string().regex(/^src_[a-f0-9]{12}$/)),
3945
+ ReviewConfidenceSchema = z12.enum(["low", "medium", "high"]);
3946
+ ReviewFindingSchema = z12.object({
3947
+ finding_id: z12.string().regex(/^fnd_[a-f0-9]{12}$/),
3948
+ section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3949
+ claim_ids: z12.array(z12.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)),
3950
+ source_ids: z12.array(z12.string().regex(/^src_[a-f0-9]{12}$/)),
3922
3951
  category: FindingCategorySchema,
3923
3952
  severity: FindingSeveritySchema,
3924
- summary: z11.string().min(1),
3925
- evidence: z11.string(),
3926
- required_action: z11.string(),
3953
+ summary: z12.string().min(1),
3954
+ evidence: z12.string(),
3955
+ required_action: z12.string(),
3927
3956
  reviewer: ReviewerNameSchema,
3928
- review_method: z11.string().min(1),
3957
+ review_method: z12.string().min(1),
3929
3958
  confidence: ReviewConfidenceSchema,
3930
- created_at: z11.string()
3959
+ created_at: z12.string()
3931
3960
  });
3932
- ClaimReviewSchema = z11.object({
3933
- claim_id: z11.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
3961
+ ClaimReviewSchema = z12.object({
3962
+ claim_id: z12.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
3934
3963
  decision: ReviewDecisionSchema,
3935
- reason: z11.string().min(1),
3936
- finding_ids: z11.array(z11.string()),
3964
+ reason: z12.string().min(1),
3965
+ finding_ids: z12.array(z12.string()),
3937
3966
  reviewer: ReviewerNameSchema,
3938
- review_method: z11.string().min(1),
3939
- created_at: z11.string(),
3967
+ review_method: z12.string().min(1),
3968
+ created_at: z12.string(),
3940
3969
  // v0.5: optional profile lineage. Additive-optional — pre-v0.5 records
3941
3970
  // without this field parse cleanly. Frozen packs unaffected (Zod .optional()
3942
3971
  // with no .default() leaves absent keys absent on round-trip).
3943
- profile: z11.string().optional()
3972
+ profile: z12.string().optional()
3944
3973
  });
3945
- ReviewSnapshotSchema = z11.object({
3946
- section_id: z11.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3974
+ ReviewSnapshotSchema = z12.object({
3975
+ section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3947
3976
  reviewer: ReviewerNameSchema,
3948
- review_method: z11.string(),
3949
- reviewed_at: z11.string(),
3950
- candidate_claims: z11.number().int().nonnegative(),
3951
- findings: z11.array(ReviewFindingSchema),
3952
- claim_reviews: z11.array(ClaimReviewSchema),
3953
- decision_counts: z11.record(ReviewDecisionSchema, z11.number().int().nonnegative()),
3954
- severity_counts: z11.record(FindingSeveritySchema, z11.number().int().nonnegative()),
3955
- llm_findings_rejected_ungrounded: z11.number().int().nonnegative(),
3956
- promoted_to_reviewed: z11.boolean()
3977
+ review_method: z12.string(),
3978
+ reviewed_at: z12.string(),
3979
+ candidate_claims: z12.number().int().nonnegative(),
3980
+ findings: z12.array(ReviewFindingSchema),
3981
+ claim_reviews: z12.array(ClaimReviewSchema),
3982
+ decision_counts: z12.record(ReviewDecisionSchema, z12.number().int().nonnegative()),
3983
+ severity_counts: z12.record(FindingSeveritySchema, z12.number().int().nonnegative()),
3984
+ llm_findings_rejected_ungrounded: z12.number().int().nonnegative(),
3985
+ promoted_to_reviewed: z12.boolean(),
3986
+ reviewer_options: ReviewerOptionsSchema.optional()
3957
3987
  });
3958
3988
  }
3959
3989
  });
@@ -4841,12 +4871,12 @@ var init_markdown2 = __esm({
4841
4871
  });
4842
4872
 
4843
4873
  // src/gates/schema.ts
4844
- import { z as z12 } from "zod";
4874
+ import { z as z13 } from "zod";
4845
4875
  var GateFamilySchema, GateCheckStatusSchema, VerdictSchema, GateCheckResultSchema, WaiverApplicationSchema, SectionGateResultSchema;
4846
4876
  var init_schema10 = __esm({
4847
4877
  "src/gates/schema.ts"() {
4848
4878
  "use strict";
4849
- GateFamilySchema = z12.enum([
4879
+ GateFamilySchema = z13.enum([
4850
4880
  "source_floor",
4851
4881
  "claim_integrity",
4852
4882
  "scope_integrity",
@@ -4856,85 +4886,85 @@ var init_schema10 = __esm({
4856
4886
  "waivers",
4857
4887
  "accepted_claim_floor"
4858
4888
  ]);
4859
- GateCheckStatusSchema = z12.enum([
4889
+ GateCheckStatusSchema = z13.enum([
4860
4890
  "pass",
4861
4891
  "warn",
4862
4892
  "fail",
4863
4893
  "pass_with_waiver",
4864
4894
  "warn_with_waiver"
4865
4895
  ]);
4866
- VerdictSchema = z12.enum(["pass", "warn", "fail", "blocked"]);
4867
- GateCheckResultSchema = z12.object({
4896
+ VerdictSchema = z13.enum(["pass", "warn", "fail", "blocked"]);
4897
+ GateCheckResultSchema = z13.object({
4868
4898
  family: GateFamilySchema,
4869
- check: z12.string().min(1),
4899
+ check: z13.string().min(1),
4870
4900
  status: GateCheckStatusSchema,
4871
- detail: z12.string(),
4872
- evidence: z12.array(z12.string()),
4873
- blocks_synthesis: z12.boolean()
4901
+ detail: z13.string(),
4902
+ evidence: z13.array(z13.string()),
4903
+ blocks_synthesis: z13.boolean()
4874
4904
  });
4875
- WaiverApplicationSchema = z12.object({
4905
+ WaiverApplicationSchema = z13.object({
4876
4906
  family: GateFamilySchema,
4877
- check: z12.string().min(1),
4878
- reason: z12.string().min(1),
4879
- compensating_controls: z12.array(z12.string()),
4907
+ check: z13.string().min(1),
4908
+ reason: z13.string().min(1),
4909
+ compensating_controls: z13.array(z13.string()),
4880
4910
  original_status: GateCheckStatusSchema,
4881
4911
  new_status: GateCheckStatusSchema
4882
4912
  });
4883
- SectionGateResultSchema = z12.object({
4884
- section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
4913
+ SectionGateResultSchema = z13.object({
4914
+ section_id: z13.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
4885
4915
  verdict: VerdictSchema,
4886
- summary: z12.string(),
4887
- checked_at: z12.string(),
4888
- synthesis_eligible: z12.boolean(),
4889
- gate_results: z12.array(GateCheckResultSchema),
4890
- failures: z12.array(GateCheckResultSchema),
4891
- warnings: z12.array(GateCheckResultSchema),
4892
- waivers_applied: z12.array(WaiverApplicationSchema),
4893
- blocking_reasons: z12.array(z12.string()),
4894
- claim_counts: z12.object({
4895
- total: z12.number().int().nonnegative(),
4896
- candidate: z12.number().int().nonnegative(),
4897
- with_evidence_excerpt: z12.number().int().nonnegative(),
4898
- with_source_hashes: z12.number().int().nonnegative(),
4899
- with_scope: z12.number().int().nonnegative(),
4900
- with_not: z12.number().int().nonnegative(),
4901
- universal_scope_null: z12.number().int().nonnegative(),
4902
- orphans: z12.number().int().nonnegative()
4916
+ summary: z13.string(),
4917
+ checked_at: z13.string(),
4918
+ synthesis_eligible: z13.boolean(),
4919
+ gate_results: z13.array(GateCheckResultSchema),
4920
+ failures: z13.array(GateCheckResultSchema),
4921
+ warnings: z13.array(GateCheckResultSchema),
4922
+ waivers_applied: z13.array(WaiverApplicationSchema),
4923
+ blocking_reasons: z13.array(z13.string()),
4924
+ claim_counts: z13.object({
4925
+ total: z13.number().int().nonnegative(),
4926
+ candidate: z13.number().int().nonnegative(),
4927
+ with_evidence_excerpt: z13.number().int().nonnegative(),
4928
+ with_source_hashes: z13.number().int().nonnegative(),
4929
+ with_scope: z13.number().int().nonnegative(),
4930
+ with_not: z13.number().int().nonnegative(),
4931
+ universal_scope_null: z13.number().int().nonnegative(),
4932
+ orphans: z13.number().int().nonnegative()
4903
4933
  }),
4904
- source_counts: z12.object({
4905
- total: z12.number().int().nonnegative(),
4906
- primary: z12.number().int().nonnegative(),
4907
- secondary: z12.number().int().nonnegative(),
4908
- forum: z12.number().int().nonnegative(),
4909
- benchmark: z12.number().int().nonnegative(),
4910
- docs: z12.number().int().nonnegative(),
4911
- unknown: z12.number().int().nonnegative(),
4912
- independent_publishers: z12.number().int().nonnegative(),
4913
- failed_fetches: z12.number().int().nonnegative(),
4914
- section_primary: z12.number().int().nonnegative(),
4915
- section_independent_publishers: z12.number().int().nonnegative()
4934
+ source_counts: z13.object({
4935
+ total: z13.number().int().nonnegative(),
4936
+ primary: z13.number().int().nonnegative(),
4937
+ secondary: z13.number().int().nonnegative(),
4938
+ forum: z13.number().int().nonnegative(),
4939
+ benchmark: z13.number().int().nonnegative(),
4940
+ docs: z13.number().int().nonnegative(),
4941
+ unknown: z13.number().int().nonnegative(),
4942
+ independent_publishers: z13.number().int().nonnegative(),
4943
+ failed_fetches: z13.number().int().nonnegative(),
4944
+ section_primary: z13.number().int().nonnegative().optional().default(0),
4945
+ section_independent_publishers: z13.number().int().nonnegative().optional().default(0)
4916
4946
  }),
4917
- contradiction_counts: z12.object({
4918
- total: z12.number().int().nonnegative(),
4919
- unresolved: z12.number().int().nonnegative(),
4920
- blocking: z12.number().int().nonnegative(),
4921
- by_type: z12.record(z12.string(), z12.number().int().nonnegative())
4947
+ contradiction_counts: z13.object({
4948
+ total: z13.number().int().nonnegative(),
4949
+ unresolved: z13.number().int().nonnegative(),
4950
+ blocking: z13.number().int().nonnegative(),
4951
+ by_type: z13.record(z13.string(), z13.number().int().nonnegative())
4922
4952
  }),
4923
- freshness_summary: z12.object({
4924
- policy_required: z12.boolean(),
4925
- max_source_age_months: z12.number().int().nullable(),
4926
- stale_source_policy: z12.enum(["warn", "fail"]),
4927
- stale_count: z12.number().int().nonnegative(),
4928
- unknown_date_count: z12.number().int().nonnegative()
4953
+ freshness_summary: z13.object({
4954
+ policy_required: z13.boolean(),
4955
+ max_source_age_months: z13.number().int().nullable(),
4956
+ stale_source_policy: z13.enum(["warn", "fail"]),
4957
+ stale_count: z13.number().int().nonnegative(),
4958
+ unknown_date_count: z13.number().int().nonnegative()
4929
4959
  }),
4930
- scope_integrity_summary: z12.object({
4931
- universal_claims: z12.number().int().nonnegative(),
4932
- scoped_claims: z12.number().int().nonnegative(),
4933
- with_not_constraint: z12.number().int().nonnegative(),
4934
- overgen_risks_total: z12.number().int().nonnegative(),
4935
- overgen_risks_blocking: z12.number().int().nonnegative()
4960
+ scope_integrity_summary: z13.object({
4961
+ universal_claims: z13.number().int().nonnegative(),
4962
+ scoped_claims: z13.number().int().nonnegative(),
4963
+ with_not_constraint: z13.number().int().nonnegative(),
4964
+ overgen_risks_total: z13.number().int().nonnegative(),
4965
+ overgen_risks_blocking: z13.number().int().nonnegative()
4936
4966
  }),
4937
- next_actions: z12.array(z12.string())
4967
+ next_actions: z13.array(z13.string())
4938
4968
  });
4939
4969
  }
4940
4970
  });
@@ -5271,7 +5301,7 @@ var init_gates = __esm({
5271
5301
  import { existsSync as existsSync13 } from "fs";
5272
5302
  import { mkdir as mkdir11, readFile as readFile13, writeFile as writeFile11 } from "fs/promises";
5273
5303
  import { join as join14 } from "path";
5274
- import { z as z13 } from "zod";
5304
+ import { z as z14 } from "zod";
5275
5305
  function reviewActivePath(packPath, sectionId) {
5276
5306
  return join14(packPath, "sections", sectionId, "review-active.json");
5277
5307
  }
@@ -5301,22 +5331,22 @@ var init_profiles = __esm({
5301
5331
  "src/review/profiles.ts"() {
5302
5332
  "use strict";
5303
5333
  DEFAULT_PROFILE = "default";
5304
- PromotionCalibrationSummarySchema = z13.object({
5305
- fixture: z13.string().nullable().default(null),
5306
- good_false_positive_rate: z13.string().nullable().default(null),
5307
- bad_any_flag_recall: z13.string().nullable().default(null),
5308
- strict_category_recall: z13.string().nullable().default(null),
5309
- unsupported_claim_recall: z13.string().nullable().default(null),
5310
- notes: z13.string().nullable().default(null)
5311
- });
5312
- ReviewActiveSchema = z13.object({
5313
- active_profile: z13.string().min(1),
5314
- promoted_at: z13.string(),
5315
- promoted_method: z13.string(),
5316
- promoted_reviewer: z13.string(),
5334
+ PromotionCalibrationSummarySchema = z14.object({
5335
+ fixture: z14.string().nullable().default(null),
5336
+ good_false_positive_rate: z14.string().nullable().default(null),
5337
+ bad_any_flag_recall: z14.string().nullable().default(null),
5338
+ strict_category_recall: z14.string().nullable().default(null),
5339
+ unsupported_claim_recall: z14.string().nullable().default(null),
5340
+ notes: z14.string().nullable().default(null)
5341
+ });
5342
+ ReviewActiveSchema = z14.object({
5343
+ active_profile: z14.string().min(1),
5344
+ promoted_at: z14.string(),
5345
+ promoted_method: z14.string(),
5346
+ promoted_reviewer: z14.string(),
5317
5347
  // Free-text reason the profile was promoted. Recorded once at promotion
5318
5348
  // time; not derived from artifacts. Required.
5319
- promotion_reason: z13.string().min(8).default("promoted via review-promote without an explicit reason"),
5349
+ promotion_reason: z14.string().min(8).default("promoted via review-promote without an explicit reason"),
5320
5350
  // Optional calibration evidence captured at promotion time so downstream
5321
5351
  // consumers can see WHY the reviewer was trusted.
5322
5352
  calibration_summary: PromotionCalibrationSummarySchema.nullable().default(null)
@@ -5664,6 +5694,7 @@ var init_ollama_intern4 = __esm({
5664
5694
  "src/review/reviewers/ollama-intern.ts"() {
5665
5695
  "use strict";
5666
5696
  init_ollama_intern();
5697
+ init_reviewer_options_schema();
5667
5698
  DEFAULT_HOST4 = "http://localhost:11434";
5668
5699
  DEFAULT_MODEL4 = "hermes3:8b";
5669
5700
  DEFAULT_TIMEOUT_MS3 = 18e4;
@@ -5752,6 +5783,7 @@ Return ONE JSON object: {"findings": [...]}.`;
5752
5783
  timeoutMs;
5753
5784
  claimsPerWindow;
5754
5785
  fetchImpl;
5786
+ reviewerOptions;
5755
5787
  constructor(config = {}) {
5756
5788
  this.host = normalizeOllamaHost(config.host ?? process.env.OLLAMA_HOST ?? DEFAULT_HOST4);
5757
5789
  this.model = config.model ?? process.env.OLLAMA_INTERN_MODEL ?? DEFAULT_MODEL4;
@@ -5760,6 +5792,7 @@ Return ONE JSON object: {"findings": [...]}.`;
5760
5792
  const envWindow = process.env.OLLAMA_INTERN_REVIEW_WINDOW;
5761
5793
  this.claimsPerWindow = config.claimsPerWindow ?? (envWindow ? parseInt(envWindow, 10) || DEFAULT_CLAIMS_PER_WINDOW : DEFAULT_CLAIMS_PER_WINDOW);
5762
5794
  this.fetchImpl = config.fetchImpl ?? globalThis.fetch;
5795
+ this.reviewerOptions = config.reviewer_options ? ReviewerOptionsSchema.parse(config.reviewer_options) : void 0;
5763
5796
  }
5764
5797
  async available() {
5765
5798
  try {
@@ -5812,7 +5845,17 @@ ${claimsBlock}`;
5812
5845
  // native window; review prompts with 20+ claims exceed that and
5813
5846
  // get silently truncated, which drops claim_ids and confuses the
5814
5847
  // model. Explicitly request 8K so paged windows fit cleanly.
5815
- options: { num_ctx: 8192 },
5848
+ // Additional sampling params (temperature, seed, etc.) are merged
5849
+ // from reviewerOptions when set. Use !== undefined throughout —
5850
+ // temperature: 0 is valid and must not be dropped by truthiness.
5851
+ options: {
5852
+ num_ctx: this.reviewerOptions?.num_ctx ?? 8192,
5853
+ ...this.reviewerOptions?.temperature !== void 0 && { temperature: this.reviewerOptions.temperature },
5854
+ ...this.reviewerOptions?.seed !== void 0 && { seed: this.reviewerOptions.seed },
5855
+ ...this.reviewerOptions?.top_p !== void 0 && { top_p: this.reviewerOptions.top_p },
5856
+ ...this.reviewerOptions?.top_k !== void 0 && { top_k: this.reviewerOptions.top_k },
5857
+ ...this.reviewerOptions?.repeat_penalty !== void 0 && { repeat_penalty: this.reviewerOptions.repeat_penalty }
5858
+ },
5816
5859
  messages: [
5817
5860
  {
5818
5861
  role: "system",
@@ -6063,6 +6106,16 @@ function renderReviewMarkdown(snapshot) {
6063
6106
  lines.push("");
6064
6107
  lines.push("> Adversarial review judges research integrity. It does not synthesize, rewrite source truth, or erase extraction history. Decisions below are review truth \u2014 claims.jsonl is unchanged.");
6065
6108
  lines.push("");
6109
+ const opts = snapshot.reviewer_options;
6110
+ if (opts && Object.keys(opts).length > 0) {
6111
+ lines.push("## Reviewer options");
6112
+ lines.push("");
6113
+ const KEY_ORDER = ["num_ctx", "temperature", "seed", "top_p", "top_k", "repeat_penalty"];
6114
+ for (const key of KEY_ORDER) {
6115
+ if (opts[key] !== void 0) lines.push(`- ${key}: ${opts[key]}`);
6116
+ }
6117
+ lines.push("");
6118
+ }
6066
6119
  lines.push("## Effective decisions");
6067
6120
  lines.push("");
6068
6121
  const decisions = snapshot.decision_counts;
@@ -6430,7 +6483,8 @@ async function runMultiPassReview(args) {
6430
6483
  drafts: merged,
6431
6484
  llmFindingsRejected,
6432
6485
  profile: args.options.profile ?? DEFAULT_PROFILE,
6433
- research: args.research
6486
+ research: args.research,
6487
+ reviewer_options: args.options.reviewer_options
6434
6488
  });
6435
6489
  }
6436
6490
  async function reviewWithSpecificReviewer(args) {
@@ -6459,7 +6513,8 @@ async function reviewWithSpecificReviewer(args) {
6459
6513
  drafts: result.drafts,
6460
6514
  llmFindingsRejected: 0,
6461
6515
  profile: args.options.profile ?? DEFAULT_PROFILE,
6462
- research: args.research
6516
+ research: args.research,
6517
+ reviewer_options: args.options.reviewer_options
6463
6518
  });
6464
6519
  }
6465
6520
  async function finalizeReview(args) {
@@ -6519,7 +6574,8 @@ async function finalizeReview(args) {
6519
6574
  decision_counts: decisionCounts,
6520
6575
  severity_counts: severityCounts,
6521
6576
  llm_findings_rejected_ungrounded: args.llmFindingsRejected,
6522
- promoted_to_reviewed: promoted
6577
+ promoted_to_reviewed: promoted,
6578
+ reviewer_options: args.reviewer_options
6523
6579
  });
6524
6580
  const profDir = profileDir(args.packPath, args.sectionId, args.profile);
6525
6581
  await mkdir12(profDir, { recursive: true });
@@ -7605,26 +7661,26 @@ var init_indexer = __esm({
7605
7661
  });
7606
7662
 
7607
7663
  // src/dispositions/schema.ts
7608
- import { z as z14 } from "zod";
7664
+ import { z as z15 } from "zod";
7609
7665
  var ClaimSynthesisDispositionStatusSchema, ClaimSynthesisDispositionSchema;
7610
7666
  var init_schema12 = __esm({
7611
7667
  "src/dispositions/schema.ts"() {
7612
7668
  "use strict";
7613
- ClaimSynthesisDispositionStatusSchema = z14.enum([
7669
+ ClaimSynthesisDispositionStatusSchema = z15.enum([
7614
7670
  "parked_not_for_synthesis",
7615
7671
  "preserved_for_human_note",
7616
7672
  "needs_human_review_excluded",
7617
7673
  "out_of_bounds_regression_fixture"
7618
7674
  ]);
7619
- ClaimSynthesisDispositionSchema = z14.object({
7620
- claim_id: z14.string().min(1),
7621
- section_id: z14.string().min(1),
7675
+ ClaimSynthesisDispositionSchema = z15.object({
7676
+ claim_id: z15.string().min(1),
7677
+ section_id: z15.string().min(1),
7622
7678
  status: ClaimSynthesisDispositionStatusSchema,
7623
- reason: z14.string().min(4),
7624
- decided_by: z14.string().min(1),
7625
- authorized_by: z14.string().min(1),
7626
- source: z14.string().min(1),
7627
- created_at: z14.string().min(1)
7679
+ reason: z15.string().min(4),
7680
+ decided_by: z15.string().min(1),
7681
+ authorized_by: z15.string().min(1),
7682
+ source: z15.string().min(1),
7683
+ created_at: z15.string().min(1)
7628
7684
  });
7629
7685
  }
7630
7686
  });
@@ -7955,91 +8011,91 @@ var init_derive = __esm({
7955
8011
  });
7956
8012
 
7957
8013
  // src/cowork/schema.ts
7958
- import { z as z15 } from "zod";
8014
+ import { z as z16 } from "zod";
7959
8015
  var HandoffModeSchema, IndexStatusSchema, ProvenanceSummarySchema, SectionStateSchema, WaiverEntrySchema, GateVerdictEntrySchema, ReviewDecisionCountSchema, CoworkHandoffPayloadSchema;
7960
8016
  var init_schema13 = __esm({
7961
8017
  "src/cowork/schema.ts"() {
7962
8018
  "use strict";
7963
- HandoffModeSchema = z15.enum([
8019
+ HandoffModeSchema = z16.enum([
7964
8020
  "repair_required",
7965
8021
  "synthesis_ready",
7966
8022
  "human_review_required"
7967
8023
  ]);
7968
- IndexStatusSchema = z15.enum(["present", "missing"]);
7969
- ProvenanceSummarySchema = z15.object({
7970
- accepted_count: z15.number().int().nonnegative(),
7971
- rejected_count: z15.number().int().nonnegative(),
7972
- triage_parked_count: z15.number().int().nonnegative(),
7973
- needs_review_undispositioned_count: z15.number().int().nonnegative(),
7974
- dispositioned_count: z15.number().int().nonnegative(),
7975
- dispositioned_breakdown: z15.object({
7976
- parked_not_for_synthesis: z15.number().int().nonnegative(),
7977
- preserved_for_human_note: z15.number().int().nonnegative(),
7978
- needs_human_review_excluded: z15.number().int().nonnegative(),
7979
- out_of_bounds_regression_fixture: z15.number().int().nonnegative()
8024
+ IndexStatusSchema = z16.enum(["present", "missing"]);
8025
+ ProvenanceSummarySchema = z16.object({
8026
+ accepted_count: z16.number().int().nonnegative(),
8027
+ rejected_count: z16.number().int().nonnegative(),
8028
+ triage_parked_count: z16.number().int().nonnegative(),
8029
+ needs_review_undispositioned_count: z16.number().int().nonnegative(),
8030
+ dispositioned_count: z16.number().int().nonnegative(),
8031
+ dispositioned_breakdown: z16.object({
8032
+ parked_not_for_synthesis: z16.number().int().nonnegative(),
8033
+ preserved_for_human_note: z16.number().int().nonnegative(),
8034
+ needs_human_review_excluded: z16.number().int().nonnegative(),
8035
+ out_of_bounds_regression_fixture: z16.number().int().nonnegative()
7980
8036
  }),
7981
- active_repair_blockers: z15.number().int().nonnegative(),
7982
- active_unresolved_contradictions: z15.number().int().nonnegative(),
7983
- waivers_active: z15.array(z15.string()),
7984
- overrides_applied_count: z15.number().int().nonnegative()
7985
- });
7986
- SectionStateSchema = z15.object({
7987
- section_id: z15.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
7988
- purpose: z15.string(),
7989
- status: z15.string(),
7990
- has_gate_run: z15.boolean(),
7991
- has_review_run: z15.boolean(),
7992
- gate_verdict: z15.string().nullable(),
7993
- synthesis_eligible: z15.boolean(),
7994
- accepted_claim_ids: z15.array(z15.string()),
7995
- repair_claim_ids: z15.array(z15.string()),
7996
- rejected_claim_ids: z15.array(z15.string()),
7997
- dispositioned_claim_ids: z15.array(z15.string()).default([]),
7998
- candidate_claims_total: z15.number().int().nonnegative(),
7999
- unresolved_contradiction_ids: z15.array(z15.string()),
8000
- blocking_reasons: z15.array(z15.string()),
8001
- active_blockers: z15.array(z15.string()).default([]),
8002
- blocking_contradictions_unresolved: z15.number().int().nonnegative(),
8037
+ active_repair_blockers: z16.number().int().nonnegative(),
8038
+ active_unresolved_contradictions: z16.number().int().nonnegative(),
8039
+ waivers_active: z16.array(z16.string()),
8040
+ overrides_applied_count: z16.number().int().nonnegative()
8041
+ });
8042
+ SectionStateSchema = z16.object({
8043
+ section_id: z16.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
8044
+ purpose: z16.string(),
8045
+ status: z16.string(),
8046
+ has_gate_run: z16.boolean(),
8047
+ has_review_run: z16.boolean(),
8048
+ gate_verdict: z16.string().nullable(),
8049
+ synthesis_eligible: z16.boolean(),
8050
+ accepted_claim_ids: z16.array(z16.string()),
8051
+ repair_claim_ids: z16.array(z16.string()),
8052
+ rejected_claim_ids: z16.array(z16.string()),
8053
+ dispositioned_claim_ids: z16.array(z16.string()).default([]),
8054
+ candidate_claims_total: z16.number().int().nonnegative(),
8055
+ unresolved_contradiction_ids: z16.array(z16.string()),
8056
+ blocking_reasons: z16.array(z16.string()),
8057
+ active_blockers: z16.array(z16.string()).default([]),
8058
+ blocking_contradictions_unresolved: z16.number().int().nonnegative(),
8003
8059
  provenance_summary: ProvenanceSummarySchema.optional()
8004
8060
  });
8005
- WaiverEntrySchema = z15.object({
8006
- scope: z15.enum(["pack", "gate"]),
8007
- family: z15.string(),
8008
- reason: z15.string(),
8009
- compensating_controls: z15.array(z15.string()),
8010
- applied_to: z15.string()
8011
- });
8012
- GateVerdictEntrySchema = z15.object({
8013
- section_id: z15.string(),
8014
- verdict: z15.string(),
8015
- synthesis_eligible: z15.boolean()
8016
- });
8017
- ReviewDecisionCountSchema = z15.object({
8018
- section_id: z15.string(),
8019
- decision: z15.string(),
8020
- count: z15.number().int().nonnegative()
8021
- });
8022
- CoworkHandoffPayloadSchema = z15.object({
8023
- pack_id: z15.string(),
8024
- pack_topic: z15.string(),
8025
- generated_at: z15.string(),
8061
+ WaiverEntrySchema = z16.object({
8062
+ scope: z16.enum(["pack", "gate"]),
8063
+ family: z16.string(),
8064
+ reason: z16.string(),
8065
+ compensating_controls: z16.array(z16.string()),
8066
+ applied_to: z16.string()
8067
+ });
8068
+ GateVerdictEntrySchema = z16.object({
8069
+ section_id: z16.string(),
8070
+ verdict: z16.string(),
8071
+ synthesis_eligible: z16.boolean()
8072
+ });
8073
+ ReviewDecisionCountSchema = z16.object({
8074
+ section_id: z16.string(),
8075
+ decision: z16.string(),
8076
+ count: z16.number().int().nonnegative()
8077
+ });
8078
+ CoworkHandoffPayloadSchema = z16.object({
8079
+ pack_id: z16.string(),
8080
+ pack_topic: z16.string(),
8081
+ generated_at: z16.string(),
8026
8082
  mode: HandoffModeSchema,
8027
- synthesis_allowed: z15.boolean(),
8028
- summary: z15.string(),
8029
- sections: z15.array(SectionStateSchema),
8030
- accepted_claim_ids: z15.array(z15.string()),
8031
- repair_claim_ids: z15.array(z15.string()),
8032
- blocked_claim_ids: z15.array(z15.string()),
8033
- dispositioned_claim_ids: z15.array(z15.string()).default([]),
8034
- unresolved_contradiction_ids: z15.array(z15.string()),
8035
- waivers: z15.array(WaiverEntrySchema),
8036
- gate_verdicts: z15.array(GateVerdictEntrySchema),
8037
- review_decisions: z15.array(ReviewDecisionCountSchema),
8038
- recommended_next_actions: z15.array(z15.string()),
8039
- allowed_write_paths: z15.array(z15.string()),
8040
- forbidden_actions: z15.array(z15.string()),
8083
+ synthesis_allowed: z16.boolean(),
8084
+ summary: z16.string(),
8085
+ sections: z16.array(SectionStateSchema),
8086
+ accepted_claim_ids: z16.array(z16.string()),
8087
+ repair_claim_ids: z16.array(z16.string()),
8088
+ blocked_claim_ids: z16.array(z16.string()),
8089
+ dispositioned_claim_ids: z16.array(z16.string()).default([]),
8090
+ unresolved_contradiction_ids: z16.array(z16.string()),
8091
+ waivers: z16.array(WaiverEntrySchema),
8092
+ gate_verdicts: z16.array(GateVerdictEntrySchema),
8093
+ review_decisions: z16.array(ReviewDecisionCountSchema),
8094
+ recommended_next_actions: z16.array(z16.string()),
8095
+ allowed_write_paths: z16.array(z16.string()),
8096
+ forbidden_actions: z16.array(z16.string()),
8041
8097
  index_status: IndexStatusSchema,
8042
- warnings: z15.array(z15.string())
8098
+ warnings: z16.array(z16.string())
8043
8099
  });
8044
8100
  }
8045
8101
  });
@@ -8589,86 +8645,86 @@ var init_derive2 = __esm({
8589
8645
  });
8590
8646
 
8591
8647
  // src/synth/schema.ts
8592
- import { z as z16 } from "zod";
8648
+ import { z as z17 } from "zod";
8593
8649
  var SectionAcceptedSummarySchema, ClaimClusterSchema, SharedSourceSchema, ScopeOverlapSchema, CrossSectionContradictionRefSchema, WaiverDependencySchema, AllowedSynthesisInputSchema, ForbiddenInputSchema, CrossSectionMapSchema;
8594
8650
  var init_schema14 = __esm({
8595
8651
  "src/synth/schema.ts"() {
8596
8652
  "use strict";
8597
- SectionAcceptedSummarySchema = z16.object({
8598
- section_id: z16.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
8599
- purpose: z16.string(),
8600
- status: z16.string(),
8601
- accepted_claim_ids: z16.array(z16.string()),
8602
- excluded_reason: z16.string().nullable()
8603
- });
8604
- ClaimClusterSchema = z16.object({
8605
- cluster_id: z16.string(),
8606
- shared_source_ids: z16.array(z16.string()),
8607
- member_claim_ids: z16.array(z16.string()).min(1),
8608
- spans_sections: z16.array(z16.string())
8609
- });
8610
- SharedSourceSchema = z16.object({
8611
- source_id: z16.string(),
8612
- publisher: z16.string().nullable(),
8613
- source_type: z16.string(),
8614
- used_by_claim_ids: z16.array(z16.string()),
8615
- spans_sections: z16.array(z16.string())
8616
- });
8617
- ScopeOverlapSchema = z16.object({
8618
- claim_a: z16.string(),
8619
- claim_b: z16.string(),
8620
- scope_a: z16.string().nullable(),
8621
- scope_b: z16.string().nullable(),
8622
- jaccard: z16.number().min(0).max(1),
8623
- cross_section: z16.boolean(),
8624
- warning: z16.string()
8625
- });
8626
- CrossSectionContradictionRefSchema = z16.object({
8627
- contradiction_id: z16.string(),
8628
- claim_ids: z16.array(z16.string()),
8629
- sections: z16.array(z16.string()),
8630
- type: z16.string(),
8631
- severity: z16.string(),
8632
- status: z16.string()
8633
- });
8634
- WaiverDependencySchema = z16.object({
8635
- scope: z16.enum(["pack", "gate"]),
8636
- family: z16.string(),
8637
- reason: z16.string(),
8638
- compensating_controls: z16.array(z16.string()),
8639
- applied_to: z16.string(),
8640
- must_disclose_in: z16.enum(["decision-brief.md", "final-report.md", "both"])
8653
+ SectionAcceptedSummarySchema = z17.object({
8654
+ section_id: z17.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
8655
+ purpose: z17.string(),
8656
+ status: z17.string(),
8657
+ accepted_claim_ids: z17.array(z17.string()),
8658
+ excluded_reason: z17.string().nullable()
8641
8659
  });
8642
- AllowedSynthesisInputSchema = z16.object({
8643
- claim_id: z16.string(),
8644
- section_id: z16.string(),
8645
- artifact_path: z16.string(),
8646
- asserts: z16.string(),
8647
- scope: z16.string().nullable(),
8648
- not: z16.string().nullable(),
8649
- source_ids: z16.array(z16.string())
8650
- });
8651
- ForbiddenInputSchema = z16.object({
8652
- claim_id: z16.string(),
8653
- section_id: z16.string(),
8654
- decision: z16.string(),
8655
- reason: z16.string()
8660
+ ClaimClusterSchema = z17.object({
8661
+ cluster_id: z17.string(),
8662
+ shared_source_ids: z17.array(z17.string()),
8663
+ member_claim_ids: z17.array(z17.string()).min(1),
8664
+ spans_sections: z17.array(z17.string())
8656
8665
  });
8657
- CrossSectionMapSchema = z16.object({
8658
- pack_id: z16.string(),
8659
- pack_topic: z16.string(),
8660
- pack_decision: z16.string(),
8661
- generated_at: z16.string(),
8662
- accepted_claim_ids: z16.array(z16.string()),
8663
- sections: z16.array(SectionAcceptedSummarySchema),
8664
- claim_clusters: z16.array(ClaimClusterSchema),
8665
- shared_sources: z16.array(SharedSourceSchema),
8666
- scope_overlaps: z16.array(ScopeOverlapSchema),
8667
- cross_section_contradictions: z16.array(CrossSectionContradictionRefSchema),
8668
- waiver_dependencies: z16.array(WaiverDependencySchema),
8669
- open_questions: z16.array(z16.string()),
8670
- allowed_synthesis_inputs: z16.array(AllowedSynthesisInputSchema),
8671
- forbidden_inputs: z16.array(ForbiddenInputSchema)
8666
+ SharedSourceSchema = z17.object({
8667
+ source_id: z17.string(),
8668
+ publisher: z17.string().nullable(),
8669
+ source_type: z17.string(),
8670
+ used_by_claim_ids: z17.array(z17.string()),
8671
+ spans_sections: z17.array(z17.string())
8672
+ });
8673
+ ScopeOverlapSchema = z17.object({
8674
+ claim_a: z17.string(),
8675
+ claim_b: z17.string(),
8676
+ scope_a: z17.string().nullable(),
8677
+ scope_b: z17.string().nullable(),
8678
+ jaccard: z17.number().min(0).max(1),
8679
+ cross_section: z17.boolean(),
8680
+ warning: z17.string()
8681
+ });
8682
+ CrossSectionContradictionRefSchema = z17.object({
8683
+ contradiction_id: z17.string(),
8684
+ claim_ids: z17.array(z17.string()),
8685
+ sections: z17.array(z17.string()),
8686
+ type: z17.string(),
8687
+ severity: z17.string(),
8688
+ status: z17.string()
8689
+ });
8690
+ WaiverDependencySchema = z17.object({
8691
+ scope: z17.enum(["pack", "gate"]),
8692
+ family: z17.string(),
8693
+ reason: z17.string(),
8694
+ compensating_controls: z17.array(z17.string()),
8695
+ applied_to: z17.string(),
8696
+ must_disclose_in: z17.enum(["decision-brief.md", "final-report.md", "both"])
8697
+ });
8698
+ AllowedSynthesisInputSchema = z17.object({
8699
+ claim_id: z17.string(),
8700
+ section_id: z17.string(),
8701
+ artifact_path: z17.string(),
8702
+ asserts: z17.string(),
8703
+ scope: z17.string().nullable(),
8704
+ not: z17.string().nullable(),
8705
+ source_ids: z17.array(z17.string())
8706
+ });
8707
+ ForbiddenInputSchema = z17.object({
8708
+ claim_id: z17.string(),
8709
+ section_id: z17.string(),
8710
+ decision: z17.string(),
8711
+ reason: z17.string()
8712
+ });
8713
+ CrossSectionMapSchema = z17.object({
8714
+ pack_id: z17.string(),
8715
+ pack_topic: z17.string(),
8716
+ pack_decision: z17.string(),
8717
+ generated_at: z17.string(),
8718
+ accepted_claim_ids: z17.array(z17.string()),
8719
+ sections: z17.array(SectionAcceptedSummarySchema),
8720
+ claim_clusters: z17.array(ClaimClusterSchema),
8721
+ shared_sources: z17.array(SharedSourceSchema),
8722
+ scope_overlaps: z17.array(ScopeOverlapSchema),
8723
+ cross_section_contradictions: z17.array(CrossSectionContradictionRefSchema),
8724
+ waiver_dependencies: z17.array(WaiverDependencySchema),
8725
+ open_questions: z17.array(z17.string()),
8726
+ allowed_synthesis_inputs: z17.array(AllowedSynthesisInputSchema),
8727
+ forbidden_inputs: z17.array(ForbiddenInputSchema)
8672
8728
  });
8673
8729
  }
8674
8730
  });
@@ -9836,179 +9892,179 @@ var init_aggregate = __esm({
9836
9892
  });
9837
9893
 
9838
9894
  // src/audit/schema.ts
9839
- import { z as z17 } from "zod";
9895
+ import { z as z18 } from "zod";
9840
9896
  var PackVerdictSchema, HandoffModeSchema2, OrphanClaimRowSchema, StaleSourceRowSchema, WeakSourceRowSchema, UnresolvedContradictionRowSchema, ScopeWideningRiskRowSchema, SourceDiversityGapRowSchema, SynthesisReadinessRowSchema, PackAuditPayloadSchema;
9841
9897
  var init_schema15 = __esm({
9842
9898
  "src/audit/schema.ts"() {
9843
9899
  "use strict";
9844
- PackVerdictSchema = z17.enum([
9900
+ PackVerdictSchema = z18.enum([
9845
9901
  "ready_for_synthesis",
9846
9902
  "repair_required",
9847
9903
  "human_review_required",
9848
9904
  "blocked"
9849
9905
  ]);
9850
- HandoffModeSchema2 = z17.enum([
9906
+ HandoffModeSchema2 = z18.enum([
9851
9907
  "repair_required",
9852
9908
  "synthesis_ready",
9853
9909
  "human_review_required",
9854
9910
  "unknown"
9855
9911
  ]);
9856
- OrphanClaimRowSchema = z17.object({
9857
- claim_id: z17.string(),
9858
- section_id: z17.string(),
9859
- reason: z17.enum([
9912
+ OrphanClaimRowSchema = z18.object({
9913
+ claim_id: z18.string(),
9914
+ section_id: z18.string(),
9915
+ reason: z18.enum([
9860
9916
  "missing_source_card",
9861
9917
  "missing_source_hash",
9862
9918
  "missing_evidence_excerpt",
9863
9919
  "unresolvable_source_id"
9864
9920
  ]),
9865
- details: z17.string(),
9866
- artifact_path: z17.string()
9867
- });
9868
- StaleSourceRowSchema = z17.object({
9869
- source_id: z17.string(),
9870
- section_id: z17.string(),
9871
- publisher: z17.string().nullable(),
9872
- reason: z17.enum(["too_old", "missing_date", "unparseable_date"]),
9873
- details: z17.string(),
9874
- artifact_path: z17.string(),
9875
- policy: z17.object({
9876
- required: z17.boolean(),
9877
- max_source_age_months: z17.number().int().nullable(),
9878
- stale_source_policy: z17.enum(["warn", "fail"])
9921
+ details: z18.string(),
9922
+ artifact_path: z18.string()
9923
+ });
9924
+ StaleSourceRowSchema = z18.object({
9925
+ source_id: z18.string(),
9926
+ section_id: z18.string(),
9927
+ publisher: z18.string().nullable(),
9928
+ reason: z18.enum(["too_old", "missing_date", "unparseable_date"]),
9929
+ details: z18.string(),
9930
+ artifact_path: z18.string(),
9931
+ policy: z18.object({
9932
+ required: z18.boolean(),
9933
+ max_source_age_months: z18.number().int().nullable(),
9934
+ stale_source_policy: z18.enum(["warn", "fail"])
9879
9935
  })
9880
9936
  });
9881
- WeakSourceRowSchema = z17.object({
9882
- reason: z17.enum([
9937
+ WeakSourceRowSchema = z18.object({
9938
+ reason: z18.enum([
9883
9939
  "source_cluster_monopoly",
9884
9940
  "low_independent_publishers",
9885
9941
  "missing_primary_source",
9886
9942
  "excessive_type_imbalance",
9887
9943
  "failed_fetches_reducing_floor"
9888
9944
  ]),
9889
- section_id: z17.string(),
9890
- details: z17.string(),
9891
- evidence_ids: z17.array(z17.string()),
9892
- artifact_path: z17.string()
9893
- });
9894
- UnresolvedContradictionRowSchema = z17.object({
9895
- contradiction_id: z17.string(),
9896
- section_id: z17.string(),
9897
- type: z17.string(),
9898
- severity: z17.string(),
9899
- status: z17.string(),
9900
- claim_ids: z17.array(z17.string()),
9901
- artifact_path: z17.string()
9902
- });
9903
- ScopeWideningRiskRowSchema = z17.object({
9904
- reason: z17.enum([
9945
+ section_id: z18.string(),
9946
+ details: z18.string(),
9947
+ evidence_ids: z18.array(z18.string()),
9948
+ artifact_path: z18.string()
9949
+ });
9950
+ UnresolvedContradictionRowSchema = z18.object({
9951
+ contradiction_id: z18.string(),
9952
+ section_id: z18.string(),
9953
+ type: z18.string(),
9954
+ severity: z18.string(),
9955
+ status: z18.string(),
9956
+ claim_ids: z18.array(z18.string()),
9957
+ artifact_path: z18.string()
9958
+ });
9959
+ ScopeWideningRiskRowSchema = z18.object({
9960
+ reason: z18.enum([
9905
9961
  "overgeneralization_finding",
9906
9962
  "scope_null_in_use",
9907
9963
  "missing_not_flagged",
9908
9964
  "contextual_to_universal_risk"
9909
9965
  ]),
9910
- claim_id: z17.string(),
9911
- section_id: z17.string(),
9912
- details: z17.string(),
9913
- artifact_path: z17.string()
9966
+ claim_id: z18.string(),
9967
+ section_id: z18.string(),
9968
+ details: z18.string(),
9969
+ artifact_path: z18.string()
9914
9970
  });
9915
- SourceDiversityGapRowSchema = z17.object({
9916
- reason: z17.enum([
9971
+ SourceDiversityGapRowSchema = z18.object({
9972
+ reason: z18.enum([
9917
9973
  "section_publisher_monopoly",
9918
9974
  "low_section_publisher_count",
9919
9975
  "cross_section_publisher_overlap",
9920
9976
  "section_has_no_sources"
9921
9977
  ]),
9922
- section_id: z17.string(),
9923
- details: z17.string(),
9924
- evidence_ids: z17.array(z17.string())
9925
- });
9926
- SynthesisReadinessRowSchema = z17.object({
9927
- section_id: z17.string(),
9928
- purpose: z17.string(),
9929
- status: z17.string(),
9930
- has_gate_run: z17.boolean(),
9931
- has_review_run: z17.boolean(),
9932
- gate_verdict: z17.string().nullable(),
9933
- synthesis_eligible: z17.boolean(),
9934
- candidate_claims: z17.number().int().nonnegative(),
9935
- accepted_claims: z17.number().int().nonnegative(),
9936
- repair_claims: z17.number().int().nonnegative(),
9937
- rejected_claims: z17.number().int().nonnegative(),
9938
- dispositioned_claims: z17.number().int().nonnegative(),
9939
- blocking_reasons: z17.array(z17.string()),
9978
+ section_id: z18.string(),
9979
+ details: z18.string(),
9980
+ evidence_ids: z18.array(z18.string())
9981
+ });
9982
+ SynthesisReadinessRowSchema = z18.object({
9983
+ section_id: z18.string(),
9984
+ purpose: z18.string(),
9985
+ status: z18.string(),
9986
+ has_gate_run: z18.boolean(),
9987
+ has_review_run: z18.boolean(),
9988
+ gate_verdict: z18.string().nullable(),
9989
+ synthesis_eligible: z18.boolean(),
9990
+ candidate_claims: z18.number().int().nonnegative(),
9991
+ accepted_claims: z18.number().int().nonnegative(),
9992
+ repair_claims: z18.number().int().nonnegative(),
9993
+ rejected_claims: z18.number().int().nonnegative(),
9994
+ dispositioned_claims: z18.number().int().nonnegative(),
9995
+ blocking_reasons: z18.array(z18.string()),
9940
9996
  cowork_handoff_mode: HandoffModeSchema2,
9941
- workspace_allowed: z17.boolean()
9997
+ workspace_allowed: z18.boolean()
9942
9998
  });
9943
- PackAuditPayloadSchema = z17.object({
9944
- pack_id: z17.string(),
9945
- pack_topic: z17.string(),
9946
- generated_at: z17.string(),
9999
+ PackAuditPayloadSchema = z18.object({
10000
+ pack_id: z18.string(),
10001
+ pack_topic: z18.string(),
10002
+ generated_at: z18.string(),
9947
10003
  verdict: PackVerdictSchema,
9948
- synthesis_allowed: z17.boolean(),
9949
- section_summaries: z17.array(SynthesisReadinessRowSchema),
9950
- claim_summary: z17.object({
9951
- total: z17.number().int().nonnegative(),
9952
- candidate: z17.number().int().nonnegative(),
9953
- accepted_for_synthesis: z17.number().int().nonnegative(),
9954
- rejected: z17.number().int().nonnegative(),
9955
- needs_repair: z17.number().int().nonnegative(),
9956
- dispositioned: z17.number().int().nonnegative(),
9957
- no_review: z17.number().int().nonnegative(),
9958
- with_evidence_excerpt: z17.number().int().nonnegative(),
9959
- with_source_hashes: z17.number().int().nonnegative(),
9960
- scope_null: z17.number().int().nonnegative(),
9961
- not_null: z17.number().int().nonnegative(),
9962
- orphans: z17.number().int().nonnegative()
10004
+ synthesis_allowed: z18.boolean(),
10005
+ section_summaries: z18.array(SynthesisReadinessRowSchema),
10006
+ claim_summary: z18.object({
10007
+ total: z18.number().int().nonnegative(),
10008
+ candidate: z18.number().int().nonnegative(),
10009
+ accepted_for_synthesis: z18.number().int().nonnegative(),
10010
+ rejected: z18.number().int().nonnegative(),
10011
+ needs_repair: z18.number().int().nonnegative(),
10012
+ dispositioned: z18.number().int().nonnegative(),
10013
+ no_review: z18.number().int().nonnegative(),
10014
+ with_evidence_excerpt: z18.number().int().nonnegative(),
10015
+ with_source_hashes: z18.number().int().nonnegative(),
10016
+ scope_null: z18.number().int().nonnegative(),
10017
+ not_null: z18.number().int().nonnegative(),
10018
+ orphans: z18.number().int().nonnegative()
9963
10019
  }),
9964
- source_summary: z17.object({
9965
- total: z17.number().int().nonnegative(),
9966
- primary: z17.number().int().nonnegative(),
9967
- secondary: z17.number().int().nonnegative(),
9968
- forum: z17.number().int().nonnegative(),
9969
- benchmark: z17.number().int().nonnegative(),
9970
- docs: z17.number().int().nonnegative(),
9971
- unknown: z17.number().int().nonnegative(),
9972
- independent_publishers: z17.number().int().nonnegative(),
9973
- failed_fetches: z17.number().int().nonnegative(),
9974
- sections_with_sources: z17.number().int().nonnegative(),
9975
- sections_without_sources: z17.number().int().nonnegative()
10020
+ source_summary: z18.object({
10021
+ total: z18.number().int().nonnegative(),
10022
+ primary: z18.number().int().nonnegative(),
10023
+ secondary: z18.number().int().nonnegative(),
10024
+ forum: z18.number().int().nonnegative(),
10025
+ benchmark: z18.number().int().nonnegative(),
10026
+ docs: z18.number().int().nonnegative(),
10027
+ unknown: z18.number().int().nonnegative(),
10028
+ independent_publishers: z18.number().int().nonnegative(),
10029
+ failed_fetches: z18.number().int().nonnegative(),
10030
+ sections_with_sources: z18.number().int().nonnegative(),
10031
+ sections_without_sources: z18.number().int().nonnegative()
9976
10032
  }),
9977
- contradiction_summary: z17.object({
9978
- total: z17.number().int().nonnegative(),
9979
- unresolved: z17.number().int().nonnegative(),
9980
- blocking: z17.number().int().nonnegative(),
9981
- reconciled: z17.number().int().nonnegative(),
9982
- preserved_deliberately: z17.number().int().nonnegative(),
9983
- rejected: z17.number().int().nonnegative(),
9984
- by_type: z17.record(z17.string(), z17.number().int().nonnegative()),
9985
- sections_with_clean_ledger: z17.number().int().nonnegative()
10033
+ contradiction_summary: z18.object({
10034
+ total: z18.number().int().nonnegative(),
10035
+ unresolved: z18.number().int().nonnegative(),
10036
+ blocking: z18.number().int().nonnegative(),
10037
+ reconciled: z18.number().int().nonnegative(),
10038
+ preserved_deliberately: z18.number().int().nonnegative(),
10039
+ rejected: z18.number().int().nonnegative(),
10040
+ by_type: z18.record(z18.string(), z18.number().int().nonnegative()),
10041
+ sections_with_clean_ledger: z18.number().int().nonnegative()
9986
10042
  }),
9987
- review_summary: z17.object({
9988
- sections_with_review_run: z17.number().int().nonnegative(),
9989
- sections_without_review_run: z17.number().int().nonnegative(),
9990
- decision_counts: z17.record(z17.string(), z17.number().int().nonnegative()),
9991
- blocking_findings: z17.number().int().nonnegative()
10043
+ review_summary: z18.object({
10044
+ sections_with_review_run: z18.number().int().nonnegative(),
10045
+ sections_without_review_run: z18.number().int().nonnegative(),
10046
+ decision_counts: z18.record(z18.string(), z18.number().int().nonnegative()),
10047
+ blocking_findings: z18.number().int().nonnegative()
9992
10048
  }),
9993
- waiver_summary: z17.object({
9994
- total: z17.number().int().nonnegative(),
9995
- invalid: z17.number().int().nonnegative(),
9996
- by_family: z17.record(z17.string(), z17.number().int().nonnegative())
10049
+ waiver_summary: z18.object({
10050
+ total: z18.number().int().nonnegative(),
10051
+ invalid: z18.number().int().nonnegative(),
10052
+ by_family: z18.record(z18.string(), z18.number().int().nonnegative())
9997
10053
  }),
9998
- readiness_summary: z17.object({
9999
- total_sections: z17.number().int().nonnegative(),
10000
- ready_sections: z17.number().int().nonnegative(),
10001
- repair_sections: z17.number().int().nonnegative(),
10002
- blocked_sections: z17.number().int().nonnegative(),
10003
- no_gate_sections: z17.number().int().nonnegative(),
10004
- no_review_sections: z17.number().int().nonnegative(),
10054
+ readiness_summary: z18.object({
10055
+ total_sections: z18.number().int().nonnegative(),
10056
+ ready_sections: z18.number().int().nonnegative(),
10057
+ repair_sections: z18.number().int().nonnegative(),
10058
+ blocked_sections: z18.number().int().nonnegative(),
10059
+ no_gate_sections: z18.number().int().nonnegative(),
10060
+ no_review_sections: z18.number().int().nonnegative(),
10005
10061
  cowork_handoff_mode: HandoffModeSchema2,
10006
- workspace_allowed: z17.boolean()
10062
+ workspace_allowed: z18.boolean()
10007
10063
  }),
10008
- audit_files: z17.array(z17.string()),
10009
- blocking_reasons: z17.array(z17.string()),
10010
- warnings: z17.array(z17.string()),
10011
- next_actions: z17.array(z17.string())
10064
+ audit_files: z18.array(z18.string()),
10065
+ blocking_reasons: z18.array(z18.string()),
10066
+ warnings: z18.array(z18.string()),
10067
+ next_actions: z18.array(z18.string())
10012
10068
  });
10013
10069
  }
10014
10070
  });
@@ -10682,79 +10738,79 @@ var init_markdown7 = __esm({
10682
10738
  });
10683
10739
 
10684
10740
  // src/freeze/schema.ts
10685
- import { z as z18 } from "zod";
10741
+ import { z as z19 } from "zod";
10686
10742
  var ArtifactHashSchema, IntegrityCheckSchema, FreezeReceiptPayloadSchema, FreezeRefusalPayloadSchema;
10687
10743
  var init_schema16 = __esm({
10688
10744
  "src/freeze/schema.ts"() {
10689
10745
  "use strict";
10690
- ArtifactHashSchema = z18.object({
10691
- path: z18.string(),
10692
- sha256: z18.string().regex(/^[a-f0-9]{64}$/),
10693
- bytes: z18.number().int().nonnegative()
10694
- });
10695
- IntegrityCheckSchema = z18.object({
10696
- name: z18.string().min(1),
10697
- passed: z18.boolean(),
10698
- detail: z18.string()
10699
- });
10700
- FreezeReceiptPayloadSchema = z18.object({
10701
- pack_id: z18.string(),
10702
- pack_topic: z18.string(),
10703
- frozen_at: z18.string(),
10704
- verdict: z18.literal("frozen"),
10705
- pack_audit_hash: z18.string().regex(/^[a-f0-9]{64}$/),
10706
- handoff_hash: z18.string().regex(/^[a-f0-9]{64}$/),
10707
- synthesis_hashes: z18.array(ArtifactHashSchema),
10708
- canonical_artifact_hashes: z18.array(ArtifactHashSchema),
10709
- accepted_claim_ids: z18.array(z18.string()),
10710
- cited_claim_ids: z18.array(z18.string()),
10711
- uncited_accepted_claim_ids: z18.array(z18.string()),
10712
- unresolved_contradictions: z18.array(
10713
- z18.object({
10714
- contradiction_id: z18.string(),
10715
- section_id: z18.string(),
10716
- type: z18.string(),
10717
- severity: z18.string(),
10718
- status: z18.string(),
10719
- disclosed_in: z18.array(z18.string())
10746
+ ArtifactHashSchema = z19.object({
10747
+ path: z19.string(),
10748
+ sha256: z19.string().regex(/^[a-f0-9]{64}$/),
10749
+ bytes: z19.number().int().nonnegative()
10750
+ });
10751
+ IntegrityCheckSchema = z19.object({
10752
+ name: z19.string().min(1),
10753
+ passed: z19.boolean(),
10754
+ detail: z19.string()
10755
+ });
10756
+ FreezeReceiptPayloadSchema = z19.object({
10757
+ pack_id: z19.string(),
10758
+ pack_topic: z19.string(),
10759
+ frozen_at: z19.string(),
10760
+ verdict: z19.literal("frozen"),
10761
+ pack_audit_hash: z19.string().regex(/^[a-f0-9]{64}$/),
10762
+ handoff_hash: z19.string().regex(/^[a-f0-9]{64}$/),
10763
+ synthesis_hashes: z19.array(ArtifactHashSchema),
10764
+ canonical_artifact_hashes: z19.array(ArtifactHashSchema),
10765
+ accepted_claim_ids: z19.array(z19.string()),
10766
+ cited_claim_ids: z19.array(z19.string()),
10767
+ uncited_accepted_claim_ids: z19.array(z19.string()),
10768
+ unresolved_contradictions: z19.array(
10769
+ z19.object({
10770
+ contradiction_id: z19.string(),
10771
+ section_id: z19.string(),
10772
+ type: z19.string(),
10773
+ severity: z19.string(),
10774
+ status: z19.string(),
10775
+ disclosed_in: z19.array(z19.string())
10720
10776
  })
10721
10777
  ),
10722
- waivers_disclosed: z18.array(
10723
- z18.object({
10724
- family: z18.string(),
10725
- applied_to: z18.string(),
10726
- reason: z18.string(),
10727
- compensating_controls: z18.array(z18.string()),
10728
- disclosed_in: z18.array(z18.string())
10778
+ waivers_disclosed: z19.array(
10779
+ z19.object({
10780
+ family: z19.string(),
10781
+ applied_to: z19.string(),
10782
+ reason: z19.string(),
10783
+ compensating_controls: z19.array(z19.string()),
10784
+ disclosed_in: z19.array(z19.string())
10729
10785
  })
10730
10786
  ),
10731
- sections: z18.array(
10732
- z18.object({
10733
- section_id: z18.string(),
10734
- status: z18.string(),
10735
- accepted_claims: z18.number().int().nonnegative(),
10736
- sources: z18.number().int().nonnegative(),
10737
- contradictions: z18.number().int().nonnegative()
10787
+ sections: z19.array(
10788
+ z19.object({
10789
+ section_id: z19.string(),
10790
+ status: z19.string(),
10791
+ accepted_claims: z19.number().int().nonnegative(),
10792
+ sources: z19.number().int().nonnegative(),
10793
+ contradictions: z19.number().int().nonnegative()
10738
10794
  })
10739
10795
  ),
10740
- source_count: z18.number().int().nonnegative(),
10741
- claim_count: z18.number().int().nonnegative(),
10742
- contradiction_count: z18.number().int().nonnegative(),
10743
- review_finding_count: z18.number().int().nonnegative(),
10744
- gate_result_count: z18.number().int().nonnegative(),
10745
- integrity_checks: z18.array(IntegrityCheckSchema)
10746
- });
10747
- FreezeRefusalPayloadSchema = z18.object({
10748
- pack_id: z18.string(),
10749
- pack_topic: z18.string(),
10750
- checked_at: z18.string(),
10751
- verdict: z18.literal("refused"),
10752
- reasons: z18.array(z18.string()),
10753
- blocking_reasons: z18.array(z18.string()),
10754
- missing_artifacts: z18.array(z18.string()),
10755
- invalid_artifacts: z18.array(z18.object({ path: z18.string(), error: z18.string() })),
10756
- next_actions: z18.array(z18.string()),
10757
- would_freeze: z18.literal(false)
10796
+ source_count: z19.number().int().nonnegative(),
10797
+ claim_count: z19.number().int().nonnegative(),
10798
+ contradiction_count: z19.number().int().nonnegative(),
10799
+ review_finding_count: z19.number().int().nonnegative(),
10800
+ gate_result_count: z19.number().int().nonnegative(),
10801
+ integrity_checks: z19.array(IntegrityCheckSchema)
10802
+ });
10803
+ FreezeRefusalPayloadSchema = z19.object({
10804
+ pack_id: z19.string(),
10805
+ pack_topic: z19.string(),
10806
+ checked_at: z19.string(),
10807
+ verdict: z19.literal("refused"),
10808
+ reasons: z19.array(z19.string()),
10809
+ blocking_reasons: z19.array(z19.string()),
10810
+ missing_artifacts: z19.array(z19.string()),
10811
+ invalid_artifacts: z19.array(z19.object({ path: z19.string(), error: z19.string() })),
10812
+ next_actions: z19.array(z19.string()),
10813
+ would_freeze: z19.literal(false)
10758
10814
  });
10759
10815
  }
10760
10816
  });
@@ -11228,35 +11284,35 @@ var init_freeze = __esm({
11228
11284
  });
11229
11285
 
11230
11286
  // src/invalidate/schema.ts
11231
- import { z as z19 } from "zod";
11287
+ import { z as z20 } from "zod";
11232
11288
  var ArchivedArtifactSchema, SectionStatusChangeSchema, InvalidationReceiptSchema;
11233
11289
  var init_schema17 = __esm({
11234
11290
  "src/invalidate/schema.ts"() {
11235
11291
  "use strict";
11236
- ArchivedArtifactSchema = z19.object({
11237
- src: z19.string(),
11292
+ ArchivedArtifactSchema = z20.object({
11293
+ src: z20.string(),
11238
11294
  // path relative to packPath, before archival
11239
- dst: z19.string()
11295
+ dst: z20.string()
11240
11296
  // path relative to packPath, after archival
11241
11297
  });
11242
- SectionStatusChangeSchema = z19.object({
11243
- section_id: z19.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11244
- before: z19.string(),
11245
- after: z19.string()
11246
- });
11247
- InvalidationReceiptSchema = z19.object({
11248
- receipt_id: z19.string().regex(/^inv_[0-9]+_[a-z0-9-]+$/),
11249
- contract_label: z19.string().min(1),
11250
- superseded_contract: z19.string().min(1).nullable(),
11251
- new_contract: z19.string().min(1),
11252
- reason: z19.string().min(8),
11253
- invalidated_at: z19.string(),
11254
- research_os_version: z19.string(),
11255
- affected_sections: z19.array(z19.string().regex(/^[0-9]{2}-[a-z0-9-]+$/)),
11256
- archived_artifacts: z19.array(ArchivedArtifactSchema),
11257
- section_status_changes: z19.array(SectionStatusChangeSchema),
11258
- frozen_at_cleared: z19.boolean(),
11259
- notes: z19.string().nullable()
11298
+ SectionStatusChangeSchema = z20.object({
11299
+ section_id: z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11300
+ before: z20.string(),
11301
+ after: z20.string()
11302
+ });
11303
+ InvalidationReceiptSchema = z20.object({
11304
+ receipt_id: z20.string().regex(/^inv_[0-9]+_[a-z0-9-]+$/),
11305
+ contract_label: z20.string().min(1),
11306
+ superseded_contract: z20.string().min(1).nullable(),
11307
+ new_contract: z20.string().min(1),
11308
+ reason: z20.string().min(8),
11309
+ invalidated_at: z20.string(),
11310
+ research_os_version: z20.string(),
11311
+ affected_sections: z20.array(z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/)),
11312
+ archived_artifacts: z20.array(ArchivedArtifactSchema),
11313
+ section_status_changes: z20.array(SectionStatusChangeSchema),
11314
+ frozen_at_cleared: z20.boolean(),
11315
+ notes: z20.string().nullable()
11260
11316
  });
11261
11317
  }
11262
11318
  });
@@ -11522,7 +11578,7 @@ var init_run9 = __esm({
11522
11578
  import { existsSync as existsSync26 } from "fs";
11523
11579
  import { mkdir as mkdir20, rename as rename2, writeFile as writeFile20 } from "fs/promises";
11524
11580
  import { dirname as dirname7, join as join26, posix as posix2, relative as relative4, resolve as resolve21, sep as sep2 } from "path";
11525
- import { z as z20 } from "zod";
11581
+ import { z as z21 } from "zod";
11526
11582
  function posixify2(p) {
11527
11583
  return p.split(sep2).join("/");
11528
11584
  }
@@ -11654,15 +11710,15 @@ var init_review2 = __esm({
11654
11710
  init_errors();
11655
11711
  init_src();
11656
11712
  init_schema17();
11657
- ReviewInvalidationReceiptSchema = z20.object({
11658
- receipt_id: z20.string().regex(/^invr_[0-9]+_[a-z0-9-]+$/),
11659
- section_id: z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11660
- contract_label: z20.string().min(1),
11661
- reason: z20.string().min(8),
11662
- invalidated_at: z20.string(),
11663
- research_os_version: z20.string(),
11664
- archived_artifacts: z20.array(ArchivedArtifactSchema),
11665
- notes: z20.string().nullable()
11713
+ ReviewInvalidationReceiptSchema = z21.object({
11714
+ receipt_id: z21.string().regex(/^invr_[0-9]+_[a-z0-9-]+$/),
11715
+ section_id: z21.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11716
+ contract_label: z21.string().min(1),
11717
+ reason: z21.string().min(8),
11718
+ invalidated_at: z21.string(),
11719
+ research_os_version: z21.string(),
11720
+ archived_artifacts: z21.array(ArchivedArtifactSchema),
11721
+ notes: z21.string().nullable()
11666
11722
  });
11667
11723
  }
11668
11724
  });
@@ -11678,83 +11734,83 @@ var init_invalidate = __esm({
11678
11734
  });
11679
11735
 
11680
11736
  // src/section_report/schema.ts
11681
- import { z as z21 } from "zod";
11737
+ import { z as z22 } from "zod";
11682
11738
  var SectionReportSourcesSchema, SectionReportExtractionSchema, SectionReportContradictionsSchema, SectionReportReviewSchema, SectionReportAcceptanceSchema, SectionReportSchema;
11683
11739
  var init_schema18 = __esm({
11684
11740
  "src/section_report/schema.ts"() {
11685
11741
  "use strict";
11686
- SectionReportSourcesSchema = z21.object({
11687
- fetched_ok: z21.number().int().nonnegative(),
11688
- source_cards: z21.number().int().nonnegative(),
11689
- publishers: z21.array(z21.string()),
11690
- primary_source_waiver: z21.object({
11691
- status: z21.enum(["none", "requested", "granted"]),
11692
- reason: z21.string().nullable(),
11693
- compensating_controls: z21.array(z21.string())
11742
+ SectionReportSourcesSchema = z22.object({
11743
+ fetched_ok: z22.number().int().nonnegative(),
11744
+ source_cards: z22.number().int().nonnegative(),
11745
+ publishers: z22.array(z22.string()),
11746
+ primary_source_waiver: z22.object({
11747
+ status: z22.enum(["none", "requested", "granted"]),
11748
+ reason: z22.string().nullable(),
11749
+ compensating_controls: z22.array(z22.string())
11694
11750
  })
11695
11751
  });
11696
- SectionReportExtractionSchema = z21.object({
11697
- candidate_claims: z21.number().int().nonnegative(),
11698
- claims_per_source: z21.array(
11699
- z21.object({
11700
- source_id: z21.string(),
11701
- claims: z21.number().int().nonnegative()
11752
+ SectionReportExtractionSchema = z22.object({
11753
+ candidate_claims: z22.number().int().nonnegative(),
11754
+ claims_per_source: z22.array(
11755
+ z22.object({
11756
+ source_id: z22.string(),
11757
+ claims: z22.number().int().nonnegative()
11702
11758
  })
11703
11759
  ),
11704
- claims_per_1k_words: z21.number(),
11705
- excerpt_pages_processed: z21.number().int().nonnegative().nullable(),
11706
- excerpt_id_failures: z21.number().int().nonnegative().nullable(),
11707
- malformed_extractor_outputs: z21.number().int().nonnegative().nullable(),
11708
- near_duplicate_clusters: z21.number().int().nonnegative(),
11709
- weak_scope_count: z21.number().int().nonnegative(),
11710
- generic_scope_count: z21.number().int().nonnegative(),
11711
- density_flags: z21.number().int().nonnegative()
11712
- });
11713
- SectionReportContradictionsSchema = z21.object({
11714
- pairs_compared: z21.number().int().nonnegative().nullable(),
11715
- contradiction_candidates: z21.number().int().nonnegative(),
11716
- overgeneralization_risks: z21.number().int().nonnegative()
11717
- });
11718
- SectionReportReviewSchema = z21.object({
11719
- reviewed: z21.boolean(),
11720
- accepted_for_synthesis: z21.number().int().nonnegative(),
11721
- needs_scope_repair: z21.number().int().nonnegative(),
11722
- needs_source_repair: z21.number().int().nonnegative(),
11723
- needs_contradiction_mapping: z21.number().int().nonnegative(),
11724
- rejected: z21.number().int().nonnegative(),
11725
- needs_human_review: z21.number().int().nonnegative(),
11726
- rejection_or_repair_by_category: z21.array(
11727
- z21.object({
11728
- category: z21.string(),
11729
- count: z21.number().int().nonnegative()
11760
+ claims_per_1k_words: z22.number(),
11761
+ excerpt_pages_processed: z22.number().int().nonnegative().nullable(),
11762
+ excerpt_id_failures: z22.number().int().nonnegative().nullable(),
11763
+ malformed_extractor_outputs: z22.number().int().nonnegative().nullable(),
11764
+ near_duplicate_clusters: z22.number().int().nonnegative(),
11765
+ weak_scope_count: z22.number().int().nonnegative(),
11766
+ generic_scope_count: z22.number().int().nonnegative(),
11767
+ density_flags: z22.number().int().nonnegative()
11768
+ });
11769
+ SectionReportContradictionsSchema = z22.object({
11770
+ pairs_compared: z22.number().int().nonnegative().nullable(),
11771
+ contradiction_candidates: z22.number().int().nonnegative(),
11772
+ overgeneralization_risks: z22.number().int().nonnegative()
11773
+ });
11774
+ SectionReportReviewSchema = z22.object({
11775
+ reviewed: z22.boolean(),
11776
+ accepted_for_synthesis: z22.number().int().nonnegative(),
11777
+ needs_scope_repair: z22.number().int().nonnegative(),
11778
+ needs_source_repair: z22.number().int().nonnegative(),
11779
+ needs_contradiction_mapping: z22.number().int().nonnegative(),
11780
+ rejected: z22.number().int().nonnegative(),
11781
+ needs_human_review: z22.number().int().nonnegative(),
11782
+ rejection_or_repair_by_category: z22.array(
11783
+ z22.object({
11784
+ category: z22.string(),
11785
+ count: z22.number().int().nonnegative()
11730
11786
  })
11731
11787
  )
11732
11788
  });
11733
- SectionReportAcceptanceSchema = z21.object({
11734
- candidate_claims: z21.number().int().nonnegative(),
11735
- accepted_for_synthesis: z21.number().int().nonnegative(),
11736
- acceptance_ratio: z21.number(),
11789
+ SectionReportAcceptanceSchema = z22.object({
11790
+ candidate_claims: z22.number().int().nonnegative(),
11791
+ accepted_for_synthesis: z22.number().int().nonnegative(),
11792
+ acceptance_ratio: z22.number(),
11737
11793
  // 0..1
11738
- accepted_per_source: z21.number(),
11794
+ accepted_per_source: z22.number(),
11739
11795
  // accepted / source_count, 0 if no sources
11740
- accepted_per_1k_words: z21.number(),
11741
- top_rejection_category: z21.string().nullable(),
11742
- claim_overproduction_fired: z21.boolean(),
11743
- synthesis_ready: z21.boolean()
11796
+ accepted_per_1k_words: z22.number(),
11797
+ top_rejection_category: z22.string().nullable(),
11798
+ claim_overproduction_fired: z22.boolean(),
11799
+ synthesis_ready: z22.boolean()
11744
11800
  });
11745
- SectionReportSchema = z21.object({
11746
- report_id: z21.string().regex(/^secrep_[0-9]+_[a-z0-9-]+$/),
11747
- section_id: z21.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11748
- reported_at: z21.string(),
11749
- research_os_version: z21.string(),
11750
- status: z21.string(),
11801
+ SectionReportSchema = z22.object({
11802
+ report_id: z22.string().regex(/^secrep_[0-9]+_[a-z0-9-]+$/),
11803
+ section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11804
+ reported_at: z22.string(),
11805
+ research_os_version: z22.string(),
11806
+ status: z22.string(),
11751
11807
  sources: SectionReportSourcesSchema,
11752
11808
  extraction: SectionReportExtractionSchema,
11753
11809
  contradictions: SectionReportContradictionsSchema,
11754
11810
  review: SectionReportReviewSchema,
11755
11811
  acceptance: SectionReportAcceptanceSchema,
11756
- gate_verdict: z21.string().nullable(),
11757
- gate_synthesis_eligible: z21.boolean().nullable()
11812
+ gate_verdict: z22.string().nullable(),
11813
+ gate_synthesis_eligible: z22.boolean().nullable()
11758
11814
  });
11759
11815
  }
11760
11816
  });
@@ -12097,17 +12153,17 @@ var init_triage = __esm({
12097
12153
  });
12098
12154
 
12099
12155
  // src/discover/schema.ts
12100
- import { z as z22 } from "zod";
12156
+ import { z as z23 } from "zod";
12101
12157
  var DiscoveryCandidateStatusSchema, SourceTypeGuessSchema, DiscoveryCandidateSchema, DiscoverySummarySchema;
12102
12158
  var init_schema19 = __esm({
12103
12159
  "src/discover/schema.ts"() {
12104
12160
  "use strict";
12105
- DiscoveryCandidateStatusSchema = z22.enum([
12161
+ DiscoveryCandidateStatusSchema = z23.enum([
12106
12162
  "candidate",
12107
12163
  "approved",
12108
12164
  "rejected"
12109
12165
  ]);
12110
- SourceTypeGuessSchema = z22.enum([
12166
+ SourceTypeGuessSchema = z23.enum([
12111
12167
  "primary",
12112
12168
  "docs",
12113
12169
  "paper",
@@ -12117,36 +12173,36 @@ var init_schema19 = __esm({
12117
12173
  "benchmark",
12118
12174
  "unknown"
12119
12175
  ]);
12120
- DiscoveryCandidateSchema = z22.object({
12121
- candidate_id: z22.string().regex(/^disc_[a-f0-9]{12}$/),
12122
- section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12123
- url: z22.string().url(),
12124
- title: z22.string().min(1),
12125
- publisher: z22.string().nullable(),
12176
+ DiscoveryCandidateSchema = z23.object({
12177
+ candidate_id: z23.string().regex(/^disc_[a-f0-9]{12}$/),
12178
+ section_id: z23.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12179
+ url: z23.string().url(),
12180
+ title: z23.string().min(1),
12181
+ publisher: z23.string().nullable(),
12126
12182
  source_type_guess: SourceTypeGuessSchema,
12127
- why_relevant: z22.string().min(1),
12183
+ why_relevant: z23.string().min(1),
12128
12184
  // The free-text query that produced this candidate (for traceability).
12129
- query: z22.string().min(1),
12185
+ query: z23.string().min(1),
12130
12186
  // Lower rank = more central. Stable per-(query, provider) ordering.
12131
- rank: z22.number().int().positive(),
12132
- discovered_at: z22.string(),
12187
+ rank: z23.number().int().positive(),
12188
+ discovered_at: z23.string(),
12133
12189
  // 'candidate' | 'approved' | 'rejected'. Append-only: new entries with
12134
12190
  // same candidate_id supersede older ones; the latest entry's status wins.
12135
12191
  status: DiscoveryCandidateStatusSchema,
12136
- discovered_by: z22.string().min(1),
12137
- reason: z22.string().nullable().default(null)
12138
- });
12139
- DiscoverySummarySchema = z22.object({
12140
- summary_id: z22.string().regex(/^disum_[0-9]+_[a-z0-9-]+$/),
12141
- section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12142
- ran_at: z22.string(),
12143
- research_os_version: z22.string(),
12144
- query: z22.string().min(1),
12145
- provider: z22.string().min(1),
12146
- candidates_proposed: z22.number().int().nonnegative(),
12147
- candidates_validated: z22.number().int().nonnegative(),
12148
- candidates_rejected_invalid_url: z22.number().int().nonnegative(),
12149
- warnings: z22.array(z22.string())
12192
+ discovered_by: z23.string().min(1),
12193
+ reason: z23.string().nullable().default(null)
12194
+ });
12195
+ DiscoverySummarySchema = z23.object({
12196
+ summary_id: z23.string().regex(/^disum_[0-9]+_[a-z0-9-]+$/),
12197
+ section_id: z23.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12198
+ ran_at: z23.string(),
12199
+ research_os_version: z23.string(),
12200
+ query: z23.string().min(1),
12201
+ provider: z23.string().min(1),
12202
+ candidates_proposed: z23.number().int().nonnegative(),
12203
+ candidates_validated: z23.number().int().nonnegative(),
12204
+ candidates_rejected_invalid_url: z23.number().int().nonnegative(),
12205
+ warnings: z23.array(z23.string())
12150
12206
  });
12151
12207
  }
12152
12208
  });
@@ -12629,7 +12685,7 @@ var init_src = __esm({
12629
12685
  init_triage();
12630
12686
  init_discover();
12631
12687
  init_errors();
12632
- RESEARCH_OS_VERSION = "0.5.0";
12688
+ RESEARCH_OS_VERSION = "0.6.0";
12633
12689
  }
12634
12690
  });
12635
12691
  init_src();