@mcptoolshop/research-os 0.4.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,43 +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()
3940
- });
3941
- ReviewSnapshotSchema = z11.object({
3942
- section_id: z11.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3967
+ review_method: z12.string().min(1),
3968
+ created_at: z12.string(),
3969
+ // v0.5: optional profile lineage. Additive-optional — pre-v0.5 records
3970
+ // without this field parse cleanly. Frozen packs unaffected (Zod .optional()
3971
+ // with no .default() leaves absent keys absent on round-trip).
3972
+ profile: z12.string().optional()
3973
+ });
3974
+ ReviewSnapshotSchema = z12.object({
3975
+ section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
3943
3976
  reviewer: ReviewerNameSchema,
3944
- review_method: z11.string(),
3945
- reviewed_at: z11.string(),
3946
- candidate_claims: z11.number().int().nonnegative(),
3947
- findings: z11.array(ReviewFindingSchema),
3948
- claim_reviews: z11.array(ClaimReviewSchema),
3949
- decision_counts: z11.record(ReviewDecisionSchema, z11.number().int().nonnegative()),
3950
- severity_counts: z11.record(FindingSeveritySchema, z11.number().int().nonnegative()),
3951
- llm_findings_rejected_ungrounded: z11.number().int().nonnegative(),
3952
- 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()
3953
3987
  });
3954
3988
  }
3955
3989
  });
@@ -4837,12 +4871,12 @@ var init_markdown2 = __esm({
4837
4871
  });
4838
4872
 
4839
4873
  // src/gates/schema.ts
4840
- import { z as z12 } from "zod";
4874
+ import { z as z13 } from "zod";
4841
4875
  var GateFamilySchema, GateCheckStatusSchema, VerdictSchema, GateCheckResultSchema, WaiverApplicationSchema, SectionGateResultSchema;
4842
4876
  var init_schema10 = __esm({
4843
4877
  "src/gates/schema.ts"() {
4844
4878
  "use strict";
4845
- GateFamilySchema = z12.enum([
4879
+ GateFamilySchema = z13.enum([
4846
4880
  "source_floor",
4847
4881
  "claim_integrity",
4848
4882
  "scope_integrity",
@@ -4852,85 +4886,85 @@ var init_schema10 = __esm({
4852
4886
  "waivers",
4853
4887
  "accepted_claim_floor"
4854
4888
  ]);
4855
- GateCheckStatusSchema = z12.enum([
4889
+ GateCheckStatusSchema = z13.enum([
4856
4890
  "pass",
4857
4891
  "warn",
4858
4892
  "fail",
4859
4893
  "pass_with_waiver",
4860
4894
  "warn_with_waiver"
4861
4895
  ]);
4862
- VerdictSchema = z12.enum(["pass", "warn", "fail", "blocked"]);
4863
- GateCheckResultSchema = z12.object({
4896
+ VerdictSchema = z13.enum(["pass", "warn", "fail", "blocked"]);
4897
+ GateCheckResultSchema = z13.object({
4864
4898
  family: GateFamilySchema,
4865
- check: z12.string().min(1),
4899
+ check: z13.string().min(1),
4866
4900
  status: GateCheckStatusSchema,
4867
- detail: z12.string(),
4868
- evidence: z12.array(z12.string()),
4869
- blocks_synthesis: z12.boolean()
4901
+ detail: z13.string(),
4902
+ evidence: z13.array(z13.string()),
4903
+ blocks_synthesis: z13.boolean()
4870
4904
  });
4871
- WaiverApplicationSchema = z12.object({
4905
+ WaiverApplicationSchema = z13.object({
4872
4906
  family: GateFamilySchema,
4873
- check: z12.string().min(1),
4874
- reason: z12.string().min(1),
4875
- 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()),
4876
4910
  original_status: GateCheckStatusSchema,
4877
4911
  new_status: GateCheckStatusSchema
4878
4912
  });
4879
- SectionGateResultSchema = z12.object({
4880
- 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-]+$/),
4881
4915
  verdict: VerdictSchema,
4882
- summary: z12.string(),
4883
- checked_at: z12.string(),
4884
- synthesis_eligible: z12.boolean(),
4885
- gate_results: z12.array(GateCheckResultSchema),
4886
- failures: z12.array(GateCheckResultSchema),
4887
- warnings: z12.array(GateCheckResultSchema),
4888
- waivers_applied: z12.array(WaiverApplicationSchema),
4889
- blocking_reasons: z12.array(z12.string()),
4890
- claim_counts: z12.object({
4891
- total: z12.number().int().nonnegative(),
4892
- candidate: z12.number().int().nonnegative(),
4893
- with_evidence_excerpt: z12.number().int().nonnegative(),
4894
- with_source_hashes: z12.number().int().nonnegative(),
4895
- with_scope: z12.number().int().nonnegative(),
4896
- with_not: z12.number().int().nonnegative(),
4897
- universal_scope_null: z12.number().int().nonnegative(),
4898
- 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()
4899
4933
  }),
4900
- source_counts: z12.object({
4901
- total: z12.number().int().nonnegative(),
4902
- primary: z12.number().int().nonnegative(),
4903
- secondary: z12.number().int().nonnegative(),
4904
- forum: z12.number().int().nonnegative(),
4905
- benchmark: z12.number().int().nonnegative(),
4906
- docs: z12.number().int().nonnegative(),
4907
- unknown: z12.number().int().nonnegative(),
4908
- independent_publishers: z12.number().int().nonnegative(),
4909
- failed_fetches: z12.number().int().nonnegative(),
4910
- section_primary: z12.number().int().nonnegative(),
4911
- 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)
4912
4946
  }),
4913
- contradiction_counts: z12.object({
4914
- total: z12.number().int().nonnegative(),
4915
- unresolved: z12.number().int().nonnegative(),
4916
- blocking: z12.number().int().nonnegative(),
4917
- 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())
4918
4952
  }),
4919
- freshness_summary: z12.object({
4920
- policy_required: z12.boolean(),
4921
- max_source_age_months: z12.number().int().nullable(),
4922
- stale_source_policy: z12.enum(["warn", "fail"]),
4923
- stale_count: z12.number().int().nonnegative(),
4924
- 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()
4925
4959
  }),
4926
- scope_integrity_summary: z12.object({
4927
- universal_claims: z12.number().int().nonnegative(),
4928
- scoped_claims: z12.number().int().nonnegative(),
4929
- with_not_constraint: z12.number().int().nonnegative(),
4930
- overgen_risks_total: z12.number().int().nonnegative(),
4931
- 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()
4932
4966
  }),
4933
- next_actions: z12.array(z12.string())
4967
+ next_actions: z13.array(z13.string())
4934
4968
  });
4935
4969
  }
4936
4970
  });
@@ -5267,7 +5301,7 @@ var init_gates = __esm({
5267
5301
  import { existsSync as existsSync13 } from "fs";
5268
5302
  import { mkdir as mkdir11, readFile as readFile13, writeFile as writeFile11 } from "fs/promises";
5269
5303
  import { join as join14 } from "path";
5270
- import { z as z13 } from "zod";
5304
+ import { z as z14 } from "zod";
5271
5305
  function reviewActivePath(packPath, sectionId) {
5272
5306
  return join14(packPath, "sections", sectionId, "review-active.json");
5273
5307
  }
@@ -5297,22 +5331,22 @@ var init_profiles = __esm({
5297
5331
  "src/review/profiles.ts"() {
5298
5332
  "use strict";
5299
5333
  DEFAULT_PROFILE = "default";
5300
- PromotionCalibrationSummarySchema = z13.object({
5301
- fixture: z13.string().nullable().default(null),
5302
- good_false_positive_rate: z13.string().nullable().default(null),
5303
- bad_any_flag_recall: z13.string().nullable().default(null),
5304
- strict_category_recall: z13.string().nullable().default(null),
5305
- unsupported_claim_recall: z13.string().nullable().default(null),
5306
- notes: z13.string().nullable().default(null)
5307
- });
5308
- ReviewActiveSchema = z13.object({
5309
- active_profile: z13.string().min(1),
5310
- promoted_at: z13.string(),
5311
- promoted_method: z13.string(),
5312
- 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(),
5313
5347
  // Free-text reason the profile was promoted. Recorded once at promotion
5314
5348
  // time; not derived from artifacts. Required.
5315
- 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"),
5316
5350
  // Optional calibration evidence captured at promotion time so downstream
5317
5351
  // consumers can see WHY the reviewer was trusted.
5318
5352
  calibration_summary: PromotionCalibrationSummarySchema.nullable().default(null)
@@ -5660,6 +5694,7 @@ var init_ollama_intern4 = __esm({
5660
5694
  "src/review/reviewers/ollama-intern.ts"() {
5661
5695
  "use strict";
5662
5696
  init_ollama_intern();
5697
+ init_reviewer_options_schema();
5663
5698
  DEFAULT_HOST4 = "http://localhost:11434";
5664
5699
  DEFAULT_MODEL4 = "hermes3:8b";
5665
5700
  DEFAULT_TIMEOUT_MS3 = 18e4;
@@ -5748,6 +5783,7 @@ Return ONE JSON object: {"findings": [...]}.`;
5748
5783
  timeoutMs;
5749
5784
  claimsPerWindow;
5750
5785
  fetchImpl;
5786
+ reviewerOptions;
5751
5787
  constructor(config = {}) {
5752
5788
  this.host = normalizeOllamaHost(config.host ?? process.env.OLLAMA_HOST ?? DEFAULT_HOST4);
5753
5789
  this.model = config.model ?? process.env.OLLAMA_INTERN_MODEL ?? DEFAULT_MODEL4;
@@ -5756,6 +5792,7 @@ Return ONE JSON object: {"findings": [...]}.`;
5756
5792
  const envWindow = process.env.OLLAMA_INTERN_REVIEW_WINDOW;
5757
5793
  this.claimsPerWindow = config.claimsPerWindow ?? (envWindow ? parseInt(envWindow, 10) || DEFAULT_CLAIMS_PER_WINDOW : DEFAULT_CLAIMS_PER_WINDOW);
5758
5794
  this.fetchImpl = config.fetchImpl ?? globalThis.fetch;
5795
+ this.reviewerOptions = config.reviewer_options ? ReviewerOptionsSchema.parse(config.reviewer_options) : void 0;
5759
5796
  }
5760
5797
  async available() {
5761
5798
  try {
@@ -5808,7 +5845,17 @@ ${claimsBlock}`;
5808
5845
  // native window; review prompts with 20+ claims exceed that and
5809
5846
  // get silently truncated, which drops claim_ids and confuses the
5810
5847
  // model. Explicitly request 8K so paged windows fit cleanly.
5811
- 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
+ },
5812
5859
  messages: [
5813
5860
  {
5814
5861
  role: "system",
@@ -5939,7 +5986,7 @@ function pickHighestPriority(decisions) {
5939
5986
  return "accepted_for_synthesis";
5940
5987
  }
5941
5988
  function deriveClaimReviews(args) {
5942
- const { claims, findings, reviewer, reviewMethod, activeSectionWaivers } = args;
5989
+ const { claims, findings, reviewer, reviewMethod, activeSectionWaivers, profile } = args;
5943
5990
  const reviews = [];
5944
5991
  const now = (/* @__PURE__ */ new Date()).toISOString();
5945
5992
  const monopolyWaived = Array.isArray(activeSectionWaivers) && activeSectionWaivers.some((w) => w.scope === "min_independent_publishers");
@@ -5954,7 +6001,8 @@ function deriveClaimReviews(args) {
5954
6001
  finding_ids: [],
5955
6002
  reviewer,
5956
6003
  review_method: reviewMethod,
5957
- created_at: now
6004
+ created_at: now,
6005
+ ...profile !== void 0 ? { profile } : {}
5958
6006
  });
5959
6007
  continue;
5960
6008
  }
@@ -5988,7 +6036,8 @@ function deriveClaimReviews(args) {
5988
6036
  finding_ids: claimFindings.map((f) => f.finding_id),
5989
6037
  reviewer,
5990
6038
  review_method: reviewMethod,
5991
- created_at: now
6039
+ created_at: now,
6040
+ ...profile !== void 0 ? { profile } : {}
5992
6041
  });
5993
6042
  }
5994
6043
  return reviews;
@@ -6057,6 +6106,16 @@ function renderReviewMarkdown(snapshot) {
6057
6106
  lines.push("");
6058
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.");
6059
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
+ }
6060
6119
  lines.push("## Effective decisions");
6061
6120
  lines.push("");
6062
6121
  const decisions = snapshot.decision_counts;
@@ -6424,7 +6483,8 @@ async function runMultiPassReview(args) {
6424
6483
  drafts: merged,
6425
6484
  llmFindingsRejected,
6426
6485
  profile: args.options.profile ?? DEFAULT_PROFILE,
6427
- research: args.research
6486
+ research: args.research,
6487
+ reviewer_options: args.options.reviewer_options
6428
6488
  });
6429
6489
  }
6430
6490
  async function reviewWithSpecificReviewer(args) {
@@ -6453,7 +6513,8 @@ async function reviewWithSpecificReviewer(args) {
6453
6513
  drafts: result.drafts,
6454
6514
  llmFindingsRejected: 0,
6455
6515
  profile: args.options.profile ?? DEFAULT_PROFILE,
6456
- research: args.research
6516
+ research: args.research,
6517
+ reviewer_options: args.options.reviewer_options
6457
6518
  });
6458
6519
  }
6459
6520
  async function finalizeReview(args) {
@@ -6484,7 +6545,8 @@ async function finalizeReview(args) {
6484
6545
  findings: dedupedFindings,
6485
6546
  reviewer: args.reviewer,
6486
6547
  reviewMethod: args.reviewMethod,
6487
- activeSectionWaivers
6548
+ activeSectionWaivers,
6549
+ profile: args.profile !== DEFAULT_PROFILE ? args.profile : void 0
6488
6550
  });
6489
6551
  const decisionCounts = {
6490
6552
  accepted_for_synthesis: 0,
@@ -6512,7 +6574,8 @@ async function finalizeReview(args) {
6512
6574
  decision_counts: decisionCounts,
6513
6575
  severity_counts: severityCounts,
6514
6576
  llm_findings_rejected_ungrounded: args.llmFindingsRejected,
6515
- promoted_to_reviewed: promoted
6577
+ promoted_to_reviewed: promoted,
6578
+ reviewer_options: args.reviewer_options
6516
6579
  });
6517
6580
  const profDir = profileDir(args.packPath, args.sectionId, args.profile);
6518
6581
  await mkdir12(profDir, { recursive: true });
@@ -7598,26 +7661,26 @@ var init_indexer = __esm({
7598
7661
  });
7599
7662
 
7600
7663
  // src/dispositions/schema.ts
7601
- import { z as z14 } from "zod";
7664
+ import { z as z15 } from "zod";
7602
7665
  var ClaimSynthesisDispositionStatusSchema, ClaimSynthesisDispositionSchema;
7603
7666
  var init_schema12 = __esm({
7604
7667
  "src/dispositions/schema.ts"() {
7605
7668
  "use strict";
7606
- ClaimSynthesisDispositionStatusSchema = z14.enum([
7669
+ ClaimSynthesisDispositionStatusSchema = z15.enum([
7607
7670
  "parked_not_for_synthesis",
7608
7671
  "preserved_for_human_note",
7609
7672
  "needs_human_review_excluded",
7610
7673
  "out_of_bounds_regression_fixture"
7611
7674
  ]);
7612
- ClaimSynthesisDispositionSchema = z14.object({
7613
- claim_id: z14.string().min(1),
7614
- section_id: z14.string().min(1),
7675
+ ClaimSynthesisDispositionSchema = z15.object({
7676
+ claim_id: z15.string().min(1),
7677
+ section_id: z15.string().min(1),
7615
7678
  status: ClaimSynthesisDispositionStatusSchema,
7616
- reason: z14.string().min(4),
7617
- decided_by: z14.string().min(1),
7618
- authorized_by: z14.string().min(1),
7619
- source: z14.string().min(1),
7620
- 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)
7621
7684
  });
7622
7685
  }
7623
7686
  });
@@ -7948,91 +8011,91 @@ var init_derive = __esm({
7948
8011
  });
7949
8012
 
7950
8013
  // src/cowork/schema.ts
7951
- import { z as z15 } from "zod";
8014
+ import { z as z16 } from "zod";
7952
8015
  var HandoffModeSchema, IndexStatusSchema, ProvenanceSummarySchema, SectionStateSchema, WaiverEntrySchema, GateVerdictEntrySchema, ReviewDecisionCountSchema, CoworkHandoffPayloadSchema;
7953
8016
  var init_schema13 = __esm({
7954
8017
  "src/cowork/schema.ts"() {
7955
8018
  "use strict";
7956
- HandoffModeSchema = z15.enum([
8019
+ HandoffModeSchema = z16.enum([
7957
8020
  "repair_required",
7958
8021
  "synthesis_ready",
7959
8022
  "human_review_required"
7960
8023
  ]);
7961
- IndexStatusSchema = z15.enum(["present", "missing"]);
7962
- ProvenanceSummarySchema = z15.object({
7963
- accepted_count: z15.number().int().nonnegative(),
7964
- rejected_count: z15.number().int().nonnegative(),
7965
- triage_parked_count: z15.number().int().nonnegative(),
7966
- needs_review_undispositioned_count: z15.number().int().nonnegative(),
7967
- dispositioned_count: z15.number().int().nonnegative(),
7968
- dispositioned_breakdown: z15.object({
7969
- parked_not_for_synthesis: z15.number().int().nonnegative(),
7970
- preserved_for_human_note: z15.number().int().nonnegative(),
7971
- needs_human_review_excluded: z15.number().int().nonnegative(),
7972
- 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()
7973
8036
  }),
7974
- active_repair_blockers: z15.number().int().nonnegative(),
7975
- active_unresolved_contradictions: z15.number().int().nonnegative(),
7976
- waivers_active: z15.array(z15.string()),
7977
- overrides_applied_count: z15.number().int().nonnegative()
7978
- });
7979
- SectionStateSchema = z15.object({
7980
- section_id: z15.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
7981
- purpose: z15.string(),
7982
- status: z15.string(),
7983
- has_gate_run: z15.boolean(),
7984
- has_review_run: z15.boolean(),
7985
- gate_verdict: z15.string().nullable(),
7986
- synthesis_eligible: z15.boolean(),
7987
- accepted_claim_ids: z15.array(z15.string()),
7988
- repair_claim_ids: z15.array(z15.string()),
7989
- rejected_claim_ids: z15.array(z15.string()),
7990
- dispositioned_claim_ids: z15.array(z15.string()).default([]),
7991
- candidate_claims_total: z15.number().int().nonnegative(),
7992
- unresolved_contradiction_ids: z15.array(z15.string()),
7993
- blocking_reasons: z15.array(z15.string()),
7994
- active_blockers: z15.array(z15.string()).default([]),
7995
- 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(),
7996
8059
  provenance_summary: ProvenanceSummarySchema.optional()
7997
8060
  });
7998
- WaiverEntrySchema = z15.object({
7999
- scope: z15.enum(["pack", "gate"]),
8000
- family: z15.string(),
8001
- reason: z15.string(),
8002
- compensating_controls: z15.array(z15.string()),
8003
- applied_to: z15.string()
8004
- });
8005
- GateVerdictEntrySchema = z15.object({
8006
- section_id: z15.string(),
8007
- verdict: z15.string(),
8008
- synthesis_eligible: z15.boolean()
8009
- });
8010
- ReviewDecisionCountSchema = z15.object({
8011
- section_id: z15.string(),
8012
- decision: z15.string(),
8013
- count: z15.number().int().nonnegative()
8014
- });
8015
- CoworkHandoffPayloadSchema = z15.object({
8016
- pack_id: z15.string(),
8017
- pack_topic: z15.string(),
8018
- 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(),
8019
8082
  mode: HandoffModeSchema,
8020
- synthesis_allowed: z15.boolean(),
8021
- summary: z15.string(),
8022
- sections: z15.array(SectionStateSchema),
8023
- accepted_claim_ids: z15.array(z15.string()),
8024
- repair_claim_ids: z15.array(z15.string()),
8025
- blocked_claim_ids: z15.array(z15.string()),
8026
- dispositioned_claim_ids: z15.array(z15.string()).default([]),
8027
- unresolved_contradiction_ids: z15.array(z15.string()),
8028
- waivers: z15.array(WaiverEntrySchema),
8029
- gate_verdicts: z15.array(GateVerdictEntrySchema),
8030
- review_decisions: z15.array(ReviewDecisionCountSchema),
8031
- recommended_next_actions: z15.array(z15.string()),
8032
- allowed_write_paths: z15.array(z15.string()),
8033
- 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()),
8034
8097
  index_status: IndexStatusSchema,
8035
- warnings: z15.array(z15.string())
8098
+ warnings: z16.array(z16.string())
8036
8099
  });
8037
8100
  }
8038
8101
  });
@@ -8582,86 +8645,86 @@ var init_derive2 = __esm({
8582
8645
  });
8583
8646
 
8584
8647
  // src/synth/schema.ts
8585
- import { z as z16 } from "zod";
8648
+ import { z as z17 } from "zod";
8586
8649
  var SectionAcceptedSummarySchema, ClaimClusterSchema, SharedSourceSchema, ScopeOverlapSchema, CrossSectionContradictionRefSchema, WaiverDependencySchema, AllowedSynthesisInputSchema, ForbiddenInputSchema, CrossSectionMapSchema;
8587
8650
  var init_schema14 = __esm({
8588
8651
  "src/synth/schema.ts"() {
8589
8652
  "use strict";
8590
- SectionAcceptedSummarySchema = z16.object({
8591
- section_id: z16.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
8592
- purpose: z16.string(),
8593
- status: z16.string(),
8594
- accepted_claim_ids: z16.array(z16.string()),
8595
- excluded_reason: z16.string().nullable()
8596
- });
8597
- ClaimClusterSchema = z16.object({
8598
- cluster_id: z16.string(),
8599
- shared_source_ids: z16.array(z16.string()),
8600
- member_claim_ids: z16.array(z16.string()).min(1),
8601
- spans_sections: z16.array(z16.string())
8602
- });
8603
- SharedSourceSchema = z16.object({
8604
- source_id: z16.string(),
8605
- publisher: z16.string().nullable(),
8606
- source_type: z16.string(),
8607
- used_by_claim_ids: z16.array(z16.string()),
8608
- spans_sections: z16.array(z16.string())
8609
- });
8610
- ScopeOverlapSchema = z16.object({
8611
- claim_a: z16.string(),
8612
- claim_b: z16.string(),
8613
- scope_a: z16.string().nullable(),
8614
- scope_b: z16.string().nullable(),
8615
- jaccard: z16.number().min(0).max(1),
8616
- cross_section: z16.boolean(),
8617
- warning: z16.string()
8618
- });
8619
- CrossSectionContradictionRefSchema = z16.object({
8620
- contradiction_id: z16.string(),
8621
- claim_ids: z16.array(z16.string()),
8622
- sections: z16.array(z16.string()),
8623
- type: z16.string(),
8624
- severity: z16.string(),
8625
- status: z16.string()
8626
- });
8627
- WaiverDependencySchema = z16.object({
8628
- scope: z16.enum(["pack", "gate"]),
8629
- family: z16.string(),
8630
- reason: z16.string(),
8631
- compensating_controls: z16.array(z16.string()),
8632
- applied_to: z16.string(),
8633
- 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()
8634
8659
  });
8635
- AllowedSynthesisInputSchema = z16.object({
8636
- claim_id: z16.string(),
8637
- section_id: z16.string(),
8638
- artifact_path: z16.string(),
8639
- asserts: z16.string(),
8640
- scope: z16.string().nullable(),
8641
- not: z16.string().nullable(),
8642
- source_ids: z16.array(z16.string())
8643
- });
8644
- ForbiddenInputSchema = z16.object({
8645
- claim_id: z16.string(),
8646
- section_id: z16.string(),
8647
- decision: z16.string(),
8648
- 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())
8649
8665
  });
8650
- CrossSectionMapSchema = z16.object({
8651
- pack_id: z16.string(),
8652
- pack_topic: z16.string(),
8653
- pack_decision: z16.string(),
8654
- generated_at: z16.string(),
8655
- accepted_claim_ids: z16.array(z16.string()),
8656
- sections: z16.array(SectionAcceptedSummarySchema),
8657
- claim_clusters: z16.array(ClaimClusterSchema),
8658
- shared_sources: z16.array(SharedSourceSchema),
8659
- scope_overlaps: z16.array(ScopeOverlapSchema),
8660
- cross_section_contradictions: z16.array(CrossSectionContradictionRefSchema),
8661
- waiver_dependencies: z16.array(WaiverDependencySchema),
8662
- open_questions: z16.array(z16.string()),
8663
- allowed_synthesis_inputs: z16.array(AllowedSynthesisInputSchema),
8664
- 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)
8665
8728
  });
8666
8729
  }
8667
8730
  });
@@ -9829,179 +9892,179 @@ var init_aggregate = __esm({
9829
9892
  });
9830
9893
 
9831
9894
  // src/audit/schema.ts
9832
- import { z as z17 } from "zod";
9895
+ import { z as z18 } from "zod";
9833
9896
  var PackVerdictSchema, HandoffModeSchema2, OrphanClaimRowSchema, StaleSourceRowSchema, WeakSourceRowSchema, UnresolvedContradictionRowSchema, ScopeWideningRiskRowSchema, SourceDiversityGapRowSchema, SynthesisReadinessRowSchema, PackAuditPayloadSchema;
9834
9897
  var init_schema15 = __esm({
9835
9898
  "src/audit/schema.ts"() {
9836
9899
  "use strict";
9837
- PackVerdictSchema = z17.enum([
9900
+ PackVerdictSchema = z18.enum([
9838
9901
  "ready_for_synthesis",
9839
9902
  "repair_required",
9840
9903
  "human_review_required",
9841
9904
  "blocked"
9842
9905
  ]);
9843
- HandoffModeSchema2 = z17.enum([
9906
+ HandoffModeSchema2 = z18.enum([
9844
9907
  "repair_required",
9845
9908
  "synthesis_ready",
9846
9909
  "human_review_required",
9847
9910
  "unknown"
9848
9911
  ]);
9849
- OrphanClaimRowSchema = z17.object({
9850
- claim_id: z17.string(),
9851
- section_id: z17.string(),
9852
- reason: z17.enum([
9912
+ OrphanClaimRowSchema = z18.object({
9913
+ claim_id: z18.string(),
9914
+ section_id: z18.string(),
9915
+ reason: z18.enum([
9853
9916
  "missing_source_card",
9854
9917
  "missing_source_hash",
9855
9918
  "missing_evidence_excerpt",
9856
9919
  "unresolvable_source_id"
9857
9920
  ]),
9858
- details: z17.string(),
9859
- artifact_path: z17.string()
9860
- });
9861
- StaleSourceRowSchema = z17.object({
9862
- source_id: z17.string(),
9863
- section_id: z17.string(),
9864
- publisher: z17.string().nullable(),
9865
- reason: z17.enum(["too_old", "missing_date", "unparseable_date"]),
9866
- details: z17.string(),
9867
- artifact_path: z17.string(),
9868
- policy: z17.object({
9869
- required: z17.boolean(),
9870
- max_source_age_months: z17.number().int().nullable(),
9871
- 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"])
9872
9935
  })
9873
9936
  });
9874
- WeakSourceRowSchema = z17.object({
9875
- reason: z17.enum([
9937
+ WeakSourceRowSchema = z18.object({
9938
+ reason: z18.enum([
9876
9939
  "source_cluster_monopoly",
9877
9940
  "low_independent_publishers",
9878
9941
  "missing_primary_source",
9879
9942
  "excessive_type_imbalance",
9880
9943
  "failed_fetches_reducing_floor"
9881
9944
  ]),
9882
- section_id: z17.string(),
9883
- details: z17.string(),
9884
- evidence_ids: z17.array(z17.string()),
9885
- artifact_path: z17.string()
9886
- });
9887
- UnresolvedContradictionRowSchema = z17.object({
9888
- contradiction_id: z17.string(),
9889
- section_id: z17.string(),
9890
- type: z17.string(),
9891
- severity: z17.string(),
9892
- status: z17.string(),
9893
- claim_ids: z17.array(z17.string()),
9894
- artifact_path: z17.string()
9895
- });
9896
- ScopeWideningRiskRowSchema = z17.object({
9897
- 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([
9898
9961
  "overgeneralization_finding",
9899
9962
  "scope_null_in_use",
9900
9963
  "missing_not_flagged",
9901
9964
  "contextual_to_universal_risk"
9902
9965
  ]),
9903
- claim_id: z17.string(),
9904
- section_id: z17.string(),
9905
- details: z17.string(),
9906
- artifact_path: z17.string()
9966
+ claim_id: z18.string(),
9967
+ section_id: z18.string(),
9968
+ details: z18.string(),
9969
+ artifact_path: z18.string()
9907
9970
  });
9908
- SourceDiversityGapRowSchema = z17.object({
9909
- reason: z17.enum([
9971
+ SourceDiversityGapRowSchema = z18.object({
9972
+ reason: z18.enum([
9910
9973
  "section_publisher_monopoly",
9911
9974
  "low_section_publisher_count",
9912
9975
  "cross_section_publisher_overlap",
9913
9976
  "section_has_no_sources"
9914
9977
  ]),
9915
- section_id: z17.string(),
9916
- details: z17.string(),
9917
- evidence_ids: z17.array(z17.string())
9918
- });
9919
- SynthesisReadinessRowSchema = z17.object({
9920
- section_id: z17.string(),
9921
- purpose: z17.string(),
9922
- status: z17.string(),
9923
- has_gate_run: z17.boolean(),
9924
- has_review_run: z17.boolean(),
9925
- gate_verdict: z17.string().nullable(),
9926
- synthesis_eligible: z17.boolean(),
9927
- candidate_claims: z17.number().int().nonnegative(),
9928
- accepted_claims: z17.number().int().nonnegative(),
9929
- repair_claims: z17.number().int().nonnegative(),
9930
- rejected_claims: z17.number().int().nonnegative(),
9931
- dispositioned_claims: z17.number().int().nonnegative(),
9932
- 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()),
9933
9996
  cowork_handoff_mode: HandoffModeSchema2,
9934
- workspace_allowed: z17.boolean()
9997
+ workspace_allowed: z18.boolean()
9935
9998
  });
9936
- PackAuditPayloadSchema = z17.object({
9937
- pack_id: z17.string(),
9938
- pack_topic: z17.string(),
9939
- generated_at: z17.string(),
9999
+ PackAuditPayloadSchema = z18.object({
10000
+ pack_id: z18.string(),
10001
+ pack_topic: z18.string(),
10002
+ generated_at: z18.string(),
9940
10003
  verdict: PackVerdictSchema,
9941
- synthesis_allowed: z17.boolean(),
9942
- section_summaries: z17.array(SynthesisReadinessRowSchema),
9943
- claim_summary: z17.object({
9944
- total: z17.number().int().nonnegative(),
9945
- candidate: z17.number().int().nonnegative(),
9946
- accepted_for_synthesis: z17.number().int().nonnegative(),
9947
- rejected: z17.number().int().nonnegative(),
9948
- needs_repair: z17.number().int().nonnegative(),
9949
- dispositioned: z17.number().int().nonnegative(),
9950
- no_review: z17.number().int().nonnegative(),
9951
- with_evidence_excerpt: z17.number().int().nonnegative(),
9952
- with_source_hashes: z17.number().int().nonnegative(),
9953
- scope_null: z17.number().int().nonnegative(),
9954
- not_null: z17.number().int().nonnegative(),
9955
- 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()
9956
10019
  }),
9957
- source_summary: z17.object({
9958
- total: z17.number().int().nonnegative(),
9959
- primary: z17.number().int().nonnegative(),
9960
- secondary: z17.number().int().nonnegative(),
9961
- forum: z17.number().int().nonnegative(),
9962
- benchmark: z17.number().int().nonnegative(),
9963
- docs: z17.number().int().nonnegative(),
9964
- unknown: z17.number().int().nonnegative(),
9965
- independent_publishers: z17.number().int().nonnegative(),
9966
- failed_fetches: z17.number().int().nonnegative(),
9967
- sections_with_sources: z17.number().int().nonnegative(),
9968
- 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()
9969
10032
  }),
9970
- contradiction_summary: z17.object({
9971
- total: z17.number().int().nonnegative(),
9972
- unresolved: z17.number().int().nonnegative(),
9973
- blocking: z17.number().int().nonnegative(),
9974
- reconciled: z17.number().int().nonnegative(),
9975
- preserved_deliberately: z17.number().int().nonnegative(),
9976
- rejected: z17.number().int().nonnegative(),
9977
- by_type: z17.record(z17.string(), z17.number().int().nonnegative()),
9978
- 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()
9979
10042
  }),
9980
- review_summary: z17.object({
9981
- sections_with_review_run: z17.number().int().nonnegative(),
9982
- sections_without_review_run: z17.number().int().nonnegative(),
9983
- decision_counts: z17.record(z17.string(), z17.number().int().nonnegative()),
9984
- 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()
9985
10048
  }),
9986
- waiver_summary: z17.object({
9987
- total: z17.number().int().nonnegative(),
9988
- invalid: z17.number().int().nonnegative(),
9989
- 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())
9990
10053
  }),
9991
- readiness_summary: z17.object({
9992
- total_sections: z17.number().int().nonnegative(),
9993
- ready_sections: z17.number().int().nonnegative(),
9994
- repair_sections: z17.number().int().nonnegative(),
9995
- blocked_sections: z17.number().int().nonnegative(),
9996
- no_gate_sections: z17.number().int().nonnegative(),
9997
- 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(),
9998
10061
  cowork_handoff_mode: HandoffModeSchema2,
9999
- workspace_allowed: z17.boolean()
10062
+ workspace_allowed: z18.boolean()
10000
10063
  }),
10001
- audit_files: z17.array(z17.string()),
10002
- blocking_reasons: z17.array(z17.string()),
10003
- warnings: z17.array(z17.string()),
10004
- 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())
10005
10068
  });
10006
10069
  }
10007
10070
  });
@@ -10675,79 +10738,79 @@ var init_markdown7 = __esm({
10675
10738
  });
10676
10739
 
10677
10740
  // src/freeze/schema.ts
10678
- import { z as z18 } from "zod";
10741
+ import { z as z19 } from "zod";
10679
10742
  var ArtifactHashSchema, IntegrityCheckSchema, FreezeReceiptPayloadSchema, FreezeRefusalPayloadSchema;
10680
10743
  var init_schema16 = __esm({
10681
10744
  "src/freeze/schema.ts"() {
10682
10745
  "use strict";
10683
- ArtifactHashSchema = z18.object({
10684
- path: z18.string(),
10685
- sha256: z18.string().regex(/^[a-f0-9]{64}$/),
10686
- bytes: z18.number().int().nonnegative()
10687
- });
10688
- IntegrityCheckSchema = z18.object({
10689
- name: z18.string().min(1),
10690
- passed: z18.boolean(),
10691
- detail: z18.string()
10692
- });
10693
- FreezeReceiptPayloadSchema = z18.object({
10694
- pack_id: z18.string(),
10695
- pack_topic: z18.string(),
10696
- frozen_at: z18.string(),
10697
- verdict: z18.literal("frozen"),
10698
- pack_audit_hash: z18.string().regex(/^[a-f0-9]{64}$/),
10699
- handoff_hash: z18.string().regex(/^[a-f0-9]{64}$/),
10700
- synthesis_hashes: z18.array(ArtifactHashSchema),
10701
- canonical_artifact_hashes: z18.array(ArtifactHashSchema),
10702
- accepted_claim_ids: z18.array(z18.string()),
10703
- cited_claim_ids: z18.array(z18.string()),
10704
- uncited_accepted_claim_ids: z18.array(z18.string()),
10705
- unresolved_contradictions: z18.array(
10706
- z18.object({
10707
- contradiction_id: z18.string(),
10708
- section_id: z18.string(),
10709
- type: z18.string(),
10710
- severity: z18.string(),
10711
- status: z18.string(),
10712
- 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())
10713
10776
  })
10714
10777
  ),
10715
- waivers_disclosed: z18.array(
10716
- z18.object({
10717
- family: z18.string(),
10718
- applied_to: z18.string(),
10719
- reason: z18.string(),
10720
- compensating_controls: z18.array(z18.string()),
10721
- 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())
10722
10785
  })
10723
10786
  ),
10724
- sections: z18.array(
10725
- z18.object({
10726
- section_id: z18.string(),
10727
- status: z18.string(),
10728
- accepted_claims: z18.number().int().nonnegative(),
10729
- sources: z18.number().int().nonnegative(),
10730
- 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()
10731
10794
  })
10732
10795
  ),
10733
- source_count: z18.number().int().nonnegative(),
10734
- claim_count: z18.number().int().nonnegative(),
10735
- contradiction_count: z18.number().int().nonnegative(),
10736
- review_finding_count: z18.number().int().nonnegative(),
10737
- gate_result_count: z18.number().int().nonnegative(),
10738
- integrity_checks: z18.array(IntegrityCheckSchema)
10739
- });
10740
- FreezeRefusalPayloadSchema = z18.object({
10741
- pack_id: z18.string(),
10742
- pack_topic: z18.string(),
10743
- checked_at: z18.string(),
10744
- verdict: z18.literal("refused"),
10745
- reasons: z18.array(z18.string()),
10746
- blocking_reasons: z18.array(z18.string()),
10747
- missing_artifacts: z18.array(z18.string()),
10748
- invalid_artifacts: z18.array(z18.object({ path: z18.string(), error: z18.string() })),
10749
- next_actions: z18.array(z18.string()),
10750
- 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)
10751
10814
  });
10752
10815
  }
10753
10816
  });
@@ -11221,35 +11284,35 @@ var init_freeze = __esm({
11221
11284
  });
11222
11285
 
11223
11286
  // src/invalidate/schema.ts
11224
- import { z as z19 } from "zod";
11287
+ import { z as z20 } from "zod";
11225
11288
  var ArchivedArtifactSchema, SectionStatusChangeSchema, InvalidationReceiptSchema;
11226
11289
  var init_schema17 = __esm({
11227
11290
  "src/invalidate/schema.ts"() {
11228
11291
  "use strict";
11229
- ArchivedArtifactSchema = z19.object({
11230
- src: z19.string(),
11292
+ ArchivedArtifactSchema = z20.object({
11293
+ src: z20.string(),
11231
11294
  // path relative to packPath, before archival
11232
- dst: z19.string()
11295
+ dst: z20.string()
11233
11296
  // path relative to packPath, after archival
11234
11297
  });
11235
- SectionStatusChangeSchema = z19.object({
11236
- section_id: z19.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11237
- before: z19.string(),
11238
- after: z19.string()
11239
- });
11240
- InvalidationReceiptSchema = z19.object({
11241
- receipt_id: z19.string().regex(/^inv_[0-9]+_[a-z0-9-]+$/),
11242
- contract_label: z19.string().min(1),
11243
- superseded_contract: z19.string().min(1).nullable(),
11244
- new_contract: z19.string().min(1),
11245
- reason: z19.string().min(8),
11246
- invalidated_at: z19.string(),
11247
- research_os_version: z19.string(),
11248
- affected_sections: z19.array(z19.string().regex(/^[0-9]{2}-[a-z0-9-]+$/)),
11249
- archived_artifacts: z19.array(ArchivedArtifactSchema),
11250
- section_status_changes: z19.array(SectionStatusChangeSchema),
11251
- frozen_at_cleared: z19.boolean(),
11252
- 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()
11253
11316
  });
11254
11317
  }
11255
11318
  });
@@ -11515,7 +11578,7 @@ var init_run9 = __esm({
11515
11578
  import { existsSync as existsSync26 } from "fs";
11516
11579
  import { mkdir as mkdir20, rename as rename2, writeFile as writeFile20 } from "fs/promises";
11517
11580
  import { dirname as dirname7, join as join26, posix as posix2, relative as relative4, resolve as resolve21, sep as sep2 } from "path";
11518
- import { z as z20 } from "zod";
11581
+ import { z as z21 } from "zod";
11519
11582
  function posixify2(p) {
11520
11583
  return p.split(sep2).join("/");
11521
11584
  }
@@ -11647,15 +11710,15 @@ var init_review2 = __esm({
11647
11710
  init_errors();
11648
11711
  init_src();
11649
11712
  init_schema17();
11650
- ReviewInvalidationReceiptSchema = z20.object({
11651
- receipt_id: z20.string().regex(/^invr_[0-9]+_[a-z0-9-]+$/),
11652
- section_id: z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11653
- contract_label: z20.string().min(1),
11654
- reason: z20.string().min(8),
11655
- invalidated_at: z20.string(),
11656
- research_os_version: z20.string(),
11657
- archived_artifacts: z20.array(ArchivedArtifactSchema),
11658
- 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()
11659
11722
  });
11660
11723
  }
11661
11724
  });
@@ -11671,83 +11734,83 @@ var init_invalidate = __esm({
11671
11734
  });
11672
11735
 
11673
11736
  // src/section_report/schema.ts
11674
- import { z as z21 } from "zod";
11737
+ import { z as z22 } from "zod";
11675
11738
  var SectionReportSourcesSchema, SectionReportExtractionSchema, SectionReportContradictionsSchema, SectionReportReviewSchema, SectionReportAcceptanceSchema, SectionReportSchema;
11676
11739
  var init_schema18 = __esm({
11677
11740
  "src/section_report/schema.ts"() {
11678
11741
  "use strict";
11679
- SectionReportSourcesSchema = z21.object({
11680
- fetched_ok: z21.number().int().nonnegative(),
11681
- source_cards: z21.number().int().nonnegative(),
11682
- publishers: z21.array(z21.string()),
11683
- primary_source_waiver: z21.object({
11684
- status: z21.enum(["none", "requested", "granted"]),
11685
- reason: z21.string().nullable(),
11686
- 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())
11687
11750
  })
11688
11751
  });
11689
- SectionReportExtractionSchema = z21.object({
11690
- candidate_claims: z21.number().int().nonnegative(),
11691
- claims_per_source: z21.array(
11692
- z21.object({
11693
- source_id: z21.string(),
11694
- 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()
11695
11758
  })
11696
11759
  ),
11697
- claims_per_1k_words: z21.number(),
11698
- excerpt_pages_processed: z21.number().int().nonnegative().nullable(),
11699
- excerpt_id_failures: z21.number().int().nonnegative().nullable(),
11700
- malformed_extractor_outputs: z21.number().int().nonnegative().nullable(),
11701
- near_duplicate_clusters: z21.number().int().nonnegative(),
11702
- weak_scope_count: z21.number().int().nonnegative(),
11703
- generic_scope_count: z21.number().int().nonnegative(),
11704
- density_flags: z21.number().int().nonnegative()
11705
- });
11706
- SectionReportContradictionsSchema = z21.object({
11707
- pairs_compared: z21.number().int().nonnegative().nullable(),
11708
- contradiction_candidates: z21.number().int().nonnegative(),
11709
- overgeneralization_risks: z21.number().int().nonnegative()
11710
- });
11711
- SectionReportReviewSchema = z21.object({
11712
- reviewed: z21.boolean(),
11713
- accepted_for_synthesis: z21.number().int().nonnegative(),
11714
- needs_scope_repair: z21.number().int().nonnegative(),
11715
- needs_source_repair: z21.number().int().nonnegative(),
11716
- needs_contradiction_mapping: z21.number().int().nonnegative(),
11717
- rejected: z21.number().int().nonnegative(),
11718
- needs_human_review: z21.number().int().nonnegative(),
11719
- rejection_or_repair_by_category: z21.array(
11720
- z21.object({
11721
- category: z21.string(),
11722
- 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()
11723
11786
  })
11724
11787
  )
11725
11788
  });
11726
- SectionReportAcceptanceSchema = z21.object({
11727
- candidate_claims: z21.number().int().nonnegative(),
11728
- accepted_for_synthesis: z21.number().int().nonnegative(),
11729
- 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(),
11730
11793
  // 0..1
11731
- accepted_per_source: z21.number(),
11794
+ accepted_per_source: z22.number(),
11732
11795
  // accepted / source_count, 0 if no sources
11733
- accepted_per_1k_words: z21.number(),
11734
- top_rejection_category: z21.string().nullable(),
11735
- claim_overproduction_fired: z21.boolean(),
11736
- 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()
11737
11800
  });
11738
- SectionReportSchema = z21.object({
11739
- report_id: z21.string().regex(/^secrep_[0-9]+_[a-z0-9-]+$/),
11740
- section_id: z21.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
11741
- reported_at: z21.string(),
11742
- research_os_version: z21.string(),
11743
- 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(),
11744
11807
  sources: SectionReportSourcesSchema,
11745
11808
  extraction: SectionReportExtractionSchema,
11746
11809
  contradictions: SectionReportContradictionsSchema,
11747
11810
  review: SectionReportReviewSchema,
11748
11811
  acceptance: SectionReportAcceptanceSchema,
11749
- gate_verdict: z21.string().nullable(),
11750
- gate_synthesis_eligible: z21.boolean().nullable()
11812
+ gate_verdict: z22.string().nullable(),
11813
+ gate_synthesis_eligible: z22.boolean().nullable()
11751
11814
  });
11752
11815
  }
11753
11816
  });
@@ -12090,17 +12153,17 @@ var init_triage = __esm({
12090
12153
  });
12091
12154
 
12092
12155
  // src/discover/schema.ts
12093
- import { z as z22 } from "zod";
12156
+ import { z as z23 } from "zod";
12094
12157
  var DiscoveryCandidateStatusSchema, SourceTypeGuessSchema, DiscoveryCandidateSchema, DiscoverySummarySchema;
12095
12158
  var init_schema19 = __esm({
12096
12159
  "src/discover/schema.ts"() {
12097
12160
  "use strict";
12098
- DiscoveryCandidateStatusSchema = z22.enum([
12161
+ DiscoveryCandidateStatusSchema = z23.enum([
12099
12162
  "candidate",
12100
12163
  "approved",
12101
12164
  "rejected"
12102
12165
  ]);
12103
- SourceTypeGuessSchema = z22.enum([
12166
+ SourceTypeGuessSchema = z23.enum([
12104
12167
  "primary",
12105
12168
  "docs",
12106
12169
  "paper",
@@ -12110,36 +12173,36 @@ var init_schema19 = __esm({
12110
12173
  "benchmark",
12111
12174
  "unknown"
12112
12175
  ]);
12113
- DiscoveryCandidateSchema = z22.object({
12114
- candidate_id: z22.string().regex(/^disc_[a-f0-9]{12}$/),
12115
- section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12116
- url: z22.string().url(),
12117
- title: z22.string().min(1),
12118
- 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(),
12119
12182
  source_type_guess: SourceTypeGuessSchema,
12120
- why_relevant: z22.string().min(1),
12183
+ why_relevant: z23.string().min(1),
12121
12184
  // The free-text query that produced this candidate (for traceability).
12122
- query: z22.string().min(1),
12185
+ query: z23.string().min(1),
12123
12186
  // Lower rank = more central. Stable per-(query, provider) ordering.
12124
- rank: z22.number().int().positive(),
12125
- discovered_at: z22.string(),
12187
+ rank: z23.number().int().positive(),
12188
+ discovered_at: z23.string(),
12126
12189
  // 'candidate' | 'approved' | 'rejected'. Append-only: new entries with
12127
12190
  // same candidate_id supersede older ones; the latest entry's status wins.
12128
12191
  status: DiscoveryCandidateStatusSchema,
12129
- discovered_by: z22.string().min(1),
12130
- reason: z22.string().nullable().default(null)
12131
- });
12132
- DiscoverySummarySchema = z22.object({
12133
- summary_id: z22.string().regex(/^disum_[0-9]+_[a-z0-9-]+$/),
12134
- section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
12135
- ran_at: z22.string(),
12136
- research_os_version: z22.string(),
12137
- query: z22.string().min(1),
12138
- provider: z22.string().min(1),
12139
- candidates_proposed: z22.number().int().nonnegative(),
12140
- candidates_validated: z22.number().int().nonnegative(),
12141
- candidates_rejected_invalid_url: z22.number().int().nonnegative(),
12142
- 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())
12143
12206
  });
12144
12207
  }
12145
12208
  });
@@ -12622,7 +12685,7 @@ var init_src = __esm({
12622
12685
  init_triage();
12623
12686
  init_discover();
12624
12687
  init_errors();
12625
- RESEARCH_OS_VERSION = "0.4.0";
12688
+ RESEARCH_OS_VERSION = "0.6.0";
12626
12689
  }
12627
12690
  });
12628
12691
  init_src();