@mcptoolshop/research-os 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/README.es.md +11 -3
- package/README.fr.md +14 -6
- package/README.hi.md +33 -20
- package/README.it.md +11 -3
- package/README.ja.md +15 -7
- package/README.md +20 -4
- package/README.pt-BR.md +11 -3
- package/README.zh.md +11 -3
- package/dist/calibration/aggregate-receipt-schema.d.ts +38 -0
- package/dist/calibration/aggregate-receipt-schema.js +99 -82
- package/dist/calibration/aggregate-receipt-schema.js.map +1 -1
- package/dist/calibration/aggregate.d.ts +2 -0
- package/dist/calibration/aggregate.js +123 -84
- package/dist/calibration/aggregate.js.map +1 -1
- package/dist/calibration/receipt-schema.d.ts +45 -6
- package/dist/calibration/receipt-schema.js +53 -38
- package/dist/calibration/receipt-schema.js.map +1 -1
- package/dist/calibration/receipt.d.ts +1 -0
- package/dist/calibration/receipt.js +20 -1
- package/dist/calibration/receipt.js.map +1 -1
- package/dist/cli.js +948 -885
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +145 -49
- package/dist/index.js +870 -814
- package/dist/index.js.map +1 -1
- package/dist/reviewer-options-schema-PZacF_MO.d.ts +27 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -92,6 +92,23 @@ var init_errors = __esm({
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
// src/review/reviewer-options-schema.ts
|
|
96
|
+
import { z } from "zod";
|
|
97
|
+
var ReviewerOptionsSchema;
|
|
98
|
+
var init_reviewer_options_schema = __esm({
|
|
99
|
+
"src/review/reviewer-options-schema.ts"() {
|
|
100
|
+
"use strict";
|
|
101
|
+
ReviewerOptionsSchema = z.object({
|
|
102
|
+
num_ctx: z.number().int().positive().optional(),
|
|
103
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
104
|
+
seed: z.number().int().optional(),
|
|
105
|
+
top_p: z.number().min(0).max(1).optional(),
|
|
106
|
+
top_k: z.number().int().nonnegative().optional(),
|
|
107
|
+
repeat_penalty: z.number().min(0).optional()
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
95
112
|
// src/intake/schema.ts
|
|
96
113
|
var schema_exports = {};
|
|
97
114
|
__export(schema_exports, {
|
|
@@ -110,83 +127,85 @@ __export(schema_exports, {
|
|
|
110
127
|
SectionStatusSchema: () => SectionStatusSchema,
|
|
111
128
|
SourceFloorGateSchema: () => SourceFloorGateSchema
|
|
112
129
|
});
|
|
113
|
-
import { z } from "zod";
|
|
130
|
+
import { z as z2 } from "zod";
|
|
114
131
|
var SectionStatusSchema, SectionSchema, SourceFloorGateSchema, ClaimIntegrityGateSchema, FreshnessGateSchema, ContradictionGateSchema, SectionBudgetGateSchema, GateConfigSchema, SectionScopedWaiverSchema, PrimarySourceWaiverSchema, FreshnessRequirementsSchema, ReviewProfilePresetSchema, DEFAULT_REVIEW_PROFILES, ResearchYamlSchema;
|
|
115
132
|
var init_schema = __esm({
|
|
116
133
|
"src/intake/schema.ts"() {
|
|
117
134
|
"use strict";
|
|
118
|
-
|
|
135
|
+
init_reviewer_options_schema();
|
|
136
|
+
SectionStatusSchema = z2.enum([
|
|
119
137
|
"draft",
|
|
120
138
|
"gathering",
|
|
121
139
|
"gated",
|
|
122
140
|
"reviewed",
|
|
123
141
|
"frozen"
|
|
124
142
|
]);
|
|
125
|
-
SectionSchema =
|
|
126
|
-
id:
|
|
127
|
-
purpose:
|
|
128
|
-
max_time_minutes:
|
|
129
|
-
min_sources:
|
|
130
|
-
primary_sources_required:
|
|
131
|
-
contradictions_required:
|
|
143
|
+
SectionSchema = z2.object({
|
|
144
|
+
id: z2.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
|
|
145
|
+
purpose: z2.string().min(1),
|
|
146
|
+
max_time_minutes: z2.number().int().positive().default(45),
|
|
147
|
+
min_sources: z2.number().int().nonnegative().default(8),
|
|
148
|
+
primary_sources_required: z2.number().int().nonnegative().default(2),
|
|
149
|
+
contradictions_required: z2.boolean().default(true),
|
|
132
150
|
status: SectionStatusSchema.default("draft")
|
|
133
151
|
});
|
|
134
|
-
SourceFloorGateSchema =
|
|
135
|
-
min_sources:
|
|
136
|
-
min_independent_publishers:
|
|
137
|
-
primary_sources_required:
|
|
138
|
-
primary_source_waiver_allowed:
|
|
152
|
+
SourceFloorGateSchema = z2.object({
|
|
153
|
+
min_sources: z2.number().int().nonnegative().default(8),
|
|
154
|
+
min_independent_publishers: z2.number().int().nonnegative().default(4),
|
|
155
|
+
primary_sources_required: z2.number().int().nonnegative().default(2),
|
|
156
|
+
primary_source_waiver_allowed: z2.boolean().default(true)
|
|
139
157
|
});
|
|
140
|
-
ClaimIntegrityGateSchema =
|
|
141
|
-
every_claim_needs_source:
|
|
142
|
-
no_orphan_claims:
|
|
143
|
-
no_source_cluster_monopoly:
|
|
158
|
+
ClaimIntegrityGateSchema = z2.object({
|
|
159
|
+
every_claim_needs_source: z2.boolean().default(true),
|
|
160
|
+
no_orphan_claims: z2.boolean().default(true),
|
|
161
|
+
no_source_cluster_monopoly: z2.boolean().default(true)
|
|
144
162
|
});
|
|
145
|
-
FreshnessGateSchema =
|
|
146
|
-
required_for_current_topics:
|
|
147
|
-
stale_source_policy:
|
|
163
|
+
FreshnessGateSchema = z2.object({
|
|
164
|
+
required_for_current_topics: z2.boolean().default(true),
|
|
165
|
+
stale_source_policy: z2.enum(["warn", "fail"]).default("warn")
|
|
148
166
|
});
|
|
149
|
-
ContradictionGateSchema =
|
|
150
|
-
required:
|
|
151
|
-
unresolved_contradictions_block_synthesis:
|
|
167
|
+
ContradictionGateSchema = z2.object({
|
|
168
|
+
required: z2.boolean().default(true),
|
|
169
|
+
unresolved_contradictions_block_synthesis: z2.boolean().default(true)
|
|
152
170
|
});
|
|
153
|
-
SectionBudgetGateSchema =
|
|
154
|
-
max_time_minutes:
|
|
155
|
-
extension_requires_evidence:
|
|
171
|
+
SectionBudgetGateSchema = z2.object({
|
|
172
|
+
max_time_minutes: z2.number().int().positive().default(45),
|
|
173
|
+
extension_requires_evidence: z2.boolean().default(true)
|
|
156
174
|
});
|
|
157
|
-
GateConfigSchema =
|
|
175
|
+
GateConfigSchema = z2.object({
|
|
158
176
|
source_floor: SourceFloorGateSchema.default({}),
|
|
159
177
|
claim_integrity: ClaimIntegrityGateSchema.default({}),
|
|
160
178
|
freshness: FreshnessGateSchema.default({}),
|
|
161
179
|
contradiction: ContradictionGateSchema.default({}),
|
|
162
180
|
section_budget: SectionBudgetGateSchema.default({})
|
|
163
181
|
});
|
|
164
|
-
SectionScopedWaiverSchema =
|
|
165
|
-
section_id:
|
|
166
|
-
scope:
|
|
167
|
-
reason:
|
|
168
|
-
compensating_controls:
|
|
169
|
-
});
|
|
170
|
-
PrimarySourceWaiverSchema =
|
|
171
|
-
status:
|
|
172
|
-
reason:
|
|
173
|
-
compensating_controls:
|
|
182
|
+
SectionScopedWaiverSchema = z2.object({
|
|
183
|
+
section_id: z2.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
|
|
184
|
+
scope: z2.enum(["min_independent_publishers", "primary_sources_required"]),
|
|
185
|
+
reason: z2.string().min(1),
|
|
186
|
+
compensating_controls: z2.array(z2.string()).min(1)
|
|
187
|
+
});
|
|
188
|
+
PrimarySourceWaiverSchema = z2.object({
|
|
189
|
+
status: z2.enum(["none", "requested", "granted"]).default("none"),
|
|
190
|
+
reason: z2.string().optional(),
|
|
191
|
+
compensating_controls: z2.array(z2.string()).default([]),
|
|
174
192
|
// Section-scoped waivers; each entry is its own waiver record. Independent
|
|
175
193
|
// of the pack-level status/reason/compensating_controls fields above.
|
|
176
194
|
// Defaults to [] for backward compatibility — existing packs unaffected.
|
|
177
|
-
section_waivers:
|
|
195
|
+
section_waivers: z2.array(SectionScopedWaiverSchema).default([])
|
|
178
196
|
});
|
|
179
|
-
FreshnessRequirementsSchema =
|
|
180
|
-
required:
|
|
181
|
-
max_source_age_months:
|
|
197
|
+
FreshnessRequirementsSchema = z2.object({
|
|
198
|
+
required: z2.boolean().default(true),
|
|
199
|
+
max_source_age_months: z2.number().int().positive().nullable().default(null)
|
|
182
200
|
});
|
|
183
|
-
ReviewProfilePresetSchema =
|
|
184
|
-
general_model:
|
|
185
|
-
critic_model:
|
|
186
|
-
review_window:
|
|
187
|
-
mode:
|
|
188
|
-
status:
|
|
189
|
-
notes:
|
|
201
|
+
ReviewProfilePresetSchema = z2.object({
|
|
202
|
+
general_model: z2.string().nullable().default(null),
|
|
203
|
+
critic_model: z2.string().nullable().default(null),
|
|
204
|
+
review_window: z2.number().int().positive().nullable().default(null),
|
|
205
|
+
mode: z2.enum(["general", "two_pass"]).default("two_pass"),
|
|
206
|
+
status: z2.enum(["calibrated_baseline", "experimental", "deprecated"]).default("experimental"),
|
|
207
|
+
notes: z2.string().nullable().default(null),
|
|
208
|
+
reviewer_options: ReviewerOptionsSchema.optional()
|
|
190
209
|
});
|
|
191
210
|
DEFAULT_REVIEW_PROFILES = {
|
|
192
211
|
// The dogfood-validated baseline. Section 03 of research-os-spec is the
|
|
@@ -200,27 +219,36 @@ var init_schema = __esm({
|
|
|
200
219
|
mode: "two_pass",
|
|
201
220
|
status: "calibrated_baseline",
|
|
202
221
|
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."
|
|
222
|
+
},
|
|
223
|
+
"hermes-two-pass-deterministic": {
|
|
224
|
+
general_model: "hermes3:8b",
|
|
225
|
+
critic_model: "hermes3:8b",
|
|
226
|
+
review_window: 30,
|
|
227
|
+
mode: "two_pass",
|
|
228
|
+
status: "experimental",
|
|
229
|
+
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.",
|
|
230
|
+
reviewer_options: { temperature: 0, seed: 7 }
|
|
203
231
|
}
|
|
204
232
|
};
|
|
205
|
-
ResearchYamlSchema =
|
|
206
|
-
research_os_version:
|
|
207
|
-
created_at:
|
|
208
|
-
topic:
|
|
209
|
-
decision:
|
|
210
|
-
audience:
|
|
211
|
-
desired_output:
|
|
212
|
-
max_runtime_minutes:
|
|
233
|
+
ResearchYamlSchema = z2.object({
|
|
234
|
+
research_os_version: z2.string(),
|
|
235
|
+
created_at: z2.string(),
|
|
236
|
+
topic: z2.string().min(10, "Topic must be at least 10 characters"),
|
|
237
|
+
decision: z2.string().default(""),
|
|
238
|
+
audience: z2.string().default("self"),
|
|
239
|
+
desired_output: z2.string().default(""),
|
|
240
|
+
max_runtime_minutes: z2.number().int().positive().default(240),
|
|
213
241
|
freshness: FreshnessRequirementsSchema.default({}),
|
|
214
|
-
excluded_sources:
|
|
242
|
+
excluded_sources: z2.array(z2.string()).default([]),
|
|
215
243
|
primary_source_waiver: PrimarySourceWaiverSchema.default({}),
|
|
216
|
-
sections:
|
|
244
|
+
sections: z2.array(SectionSchema).default([]),
|
|
217
245
|
gates: GateConfigSchema.default({}),
|
|
218
246
|
// Reviewer-profile presets baked into the pack so future review runs
|
|
219
247
|
// (across any section in this pack) inherit the calibrated configuration
|
|
220
248
|
// without rediscovering rig-specific timeouts and context issues. Override
|
|
221
249
|
// with `--preset <name>` on `research-os review`.
|
|
222
|
-
review_profiles:
|
|
223
|
-
frozen_at:
|
|
250
|
+
review_profiles: z2.record(z2.string(), ReviewProfilePresetSchema).default(() => ({ ...DEFAULT_REVIEW_PROFILES })),
|
|
251
|
+
frozen_at: z2.string().nullable().default(null)
|
|
224
252
|
});
|
|
225
253
|
}
|
|
226
254
|
});
|
|
@@ -364,21 +392,21 @@ var init_intake = __esm({
|
|
|
364
392
|
});
|
|
365
393
|
|
|
366
394
|
// src/sections/schema.ts
|
|
367
|
-
import { z as
|
|
395
|
+
import { z as z3 } from "zod";
|
|
368
396
|
var SectionGatesYamlSchema;
|
|
369
397
|
var init_schema2 = __esm({
|
|
370
398
|
"src/sections/schema.ts"() {
|
|
371
399
|
"use strict";
|
|
372
400
|
init_schema();
|
|
373
|
-
SectionGatesYamlSchema =
|
|
374
|
-
section_id:
|
|
375
|
-
purpose:
|
|
401
|
+
SectionGatesYamlSchema = z3.object({
|
|
402
|
+
section_id: z3.string().regex(/^[0-9]{2}-[a-z0-9-]+$/, 'Section id must look like "01-landscape"'),
|
|
403
|
+
purpose: z3.string().min(1),
|
|
376
404
|
status: SectionStatusSchema,
|
|
377
|
-
created_at:
|
|
378
|
-
max_time_minutes:
|
|
379
|
-
min_sources:
|
|
380
|
-
primary_sources_required:
|
|
381
|
-
contradictions_required:
|
|
405
|
+
created_at: z3.string(),
|
|
406
|
+
max_time_minutes: z3.number().int().positive(),
|
|
407
|
+
min_sources: z3.number().int().nonnegative(),
|
|
408
|
+
primary_sources_required: z3.number().int().nonnegative(),
|
|
409
|
+
contradictions_required: z3.boolean()
|
|
382
410
|
});
|
|
383
411
|
}
|
|
384
412
|
});
|
|
@@ -945,12 +973,12 @@ var init_extractors = __esm({
|
|
|
945
973
|
});
|
|
946
974
|
|
|
947
975
|
// src/sources/schema.ts
|
|
948
|
-
import { z as
|
|
976
|
+
import { z as z4 } from "zod";
|
|
949
977
|
var SourceTypeSchema, RelevanceSchema, ExtractorNameSchema, FetchReceiptSchema, SourceCardSchema;
|
|
950
978
|
var init_schema3 = __esm({
|
|
951
979
|
"src/sources/schema.ts"() {
|
|
952
980
|
"use strict";
|
|
953
|
-
SourceTypeSchema =
|
|
981
|
+
SourceTypeSchema = z4.enum([
|
|
954
982
|
"primary",
|
|
955
983
|
"secondary",
|
|
956
984
|
"forum",
|
|
@@ -958,51 +986,51 @@ var init_schema3 = __esm({
|
|
|
958
986
|
"docs",
|
|
959
987
|
"unknown"
|
|
960
988
|
]);
|
|
961
|
-
RelevanceSchema =
|
|
962
|
-
ExtractorNameSchema =
|
|
963
|
-
FetchReceiptSchema =
|
|
964
|
-
receipt_id:
|
|
965
|
-
source_id:
|
|
966
|
-
section_id:
|
|
967
|
-
requested_url:
|
|
968
|
-
final_url:
|
|
969
|
-
status:
|
|
970
|
-
status_text:
|
|
971
|
-
content_type:
|
|
972
|
-
fetched_at:
|
|
973
|
-
byte_count:
|
|
974
|
-
sha256:
|
|
975
|
-
title:
|
|
976
|
-
raw_text_path:
|
|
977
|
-
fetch_outcome:
|
|
978
|
-
fetch_error:
|
|
979
|
-
extraction_outcome:
|
|
989
|
+
RelevanceSchema = z4.enum(["high", "medium", "low", "unknown"]);
|
|
990
|
+
ExtractorNameSchema = z4.enum(["heuristic", "ollama-intern"]);
|
|
991
|
+
FetchReceiptSchema = z4.object({
|
|
992
|
+
receipt_id: z4.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
|
|
993
|
+
source_id: z4.string().regex(/^src_[a-f0-9]{12}$/),
|
|
994
|
+
section_id: z4.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
995
|
+
requested_url: z4.string().url(),
|
|
996
|
+
final_url: z4.string().url().nullable(),
|
|
997
|
+
status: z4.number().int().nullable(),
|
|
998
|
+
status_text: z4.string().nullable(),
|
|
999
|
+
content_type: z4.string().nullable(),
|
|
1000
|
+
fetched_at: z4.string(),
|
|
1001
|
+
byte_count: z4.number().int().nonnegative().nullable(),
|
|
1002
|
+
sha256: z4.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
1003
|
+
title: z4.string().nullable(),
|
|
1004
|
+
raw_text_path: z4.string().nullable(),
|
|
1005
|
+
fetch_outcome: z4.enum(["ok", "http_error", "network_error"]),
|
|
1006
|
+
fetch_error: z4.string().nullable(),
|
|
1007
|
+
extraction_outcome: z4.enum(["ok", "failed", "skipped"]),
|
|
980
1008
|
extraction_extractor: ExtractorNameSchema.nullable(),
|
|
981
|
-
extraction_error:
|
|
982
|
-
});
|
|
983
|
-
SourceCardSchema =
|
|
984
|
-
source_id:
|
|
985
|
-
receipt_id:
|
|
986
|
-
section_id:
|
|
987
|
-
url:
|
|
988
|
-
final_url:
|
|
989
|
-
fetched_at:
|
|
990
|
-
publisher:
|
|
991
|
-
published_at:
|
|
992
|
-
title:
|
|
1009
|
+
extraction_error: z4.string().nullable()
|
|
1010
|
+
});
|
|
1011
|
+
SourceCardSchema = z4.object({
|
|
1012
|
+
source_id: z4.string().regex(/^src_[a-f0-9]{12}$/),
|
|
1013
|
+
receipt_id: z4.string().regex(/^rcpt_[a-z0-9]+_\d+$/),
|
|
1014
|
+
section_id: z4.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
1015
|
+
url: z4.string().url(),
|
|
1016
|
+
final_url: z4.string().url().nullable(),
|
|
1017
|
+
fetched_at: z4.string(),
|
|
1018
|
+
publisher: z4.string().nullable(),
|
|
1019
|
+
published_at: z4.string().nullable(),
|
|
1020
|
+
title: z4.string().min(1),
|
|
993
1021
|
source_type: SourceTypeSchema,
|
|
994
1022
|
relevance: RelevanceSchema,
|
|
995
|
-
key_points:
|
|
996
|
-
limitations:
|
|
997
|
-
asserts:
|
|
998
|
-
scope:
|
|
999
|
-
not:
|
|
1023
|
+
key_points: z4.array(z4.string()),
|
|
1024
|
+
limitations: z4.array(z4.string()),
|
|
1025
|
+
asserts: z4.string().min(1),
|
|
1026
|
+
scope: z4.string().nullable(),
|
|
1027
|
+
not: z4.string().nullable(),
|
|
1000
1028
|
extracted_by: ExtractorNameSchema,
|
|
1001
|
-
extracted_at:
|
|
1029
|
+
extracted_at: z4.string(),
|
|
1002
1030
|
/** Rule that classified the URL. Added by Component B (v0.4). Optional for back-compat with pre-v0.4 cards. */
|
|
1003
|
-
rule_hint:
|
|
1031
|
+
rule_hint: z4.string().optional(),
|
|
1004
1032
|
/** Precedence level of the rule that fired (2–6). Optional for back-compat with pre-v0.4 cards. */
|
|
1005
|
-
precedence_level:
|
|
1033
|
+
precedence_level: z4.union([z4.literal(2), z4.literal(3), z4.literal(4), z4.literal(5), z4.literal(6)]).optional()
|
|
1006
1034
|
});
|
|
1007
1035
|
}
|
|
1008
1036
|
});
|
|
@@ -1299,7 +1327,7 @@ var init_cards = __esm({
|
|
|
1299
1327
|
});
|
|
1300
1328
|
|
|
1301
1329
|
// src/sources/source-card-overrides-schema.ts
|
|
1302
|
-
import { z as
|
|
1330
|
+
import { z as z5 } from "zod";
|
|
1303
1331
|
function validateSourceCardOverride(input) {
|
|
1304
1332
|
return SourceCardOverrideSchema.parse(input);
|
|
1305
1333
|
}
|
|
@@ -1308,20 +1336,20 @@ var init_source_card_overrides_schema = __esm({
|
|
|
1308
1336
|
"src/sources/source-card-overrides-schema.ts"() {
|
|
1309
1337
|
"use strict";
|
|
1310
1338
|
init_schema3();
|
|
1311
|
-
SourceCardOverrideSchema =
|
|
1312
|
-
source_id:
|
|
1313
|
-
url:
|
|
1314
|
-
previous_source_type:
|
|
1339
|
+
SourceCardOverrideSchema = z5.object({
|
|
1340
|
+
source_id: z5.string().min(1, "source_id must be non-empty"),
|
|
1341
|
+
url: z5.string().min(1, "url must be non-empty"),
|
|
1342
|
+
previous_source_type: z5.string().nullable().optional(),
|
|
1315
1343
|
new_source_type: SourceTypeSchema.nullable().optional(),
|
|
1316
|
-
previous_publisher:
|
|
1317
|
-
new_publisher:
|
|
1318
|
-
reason:
|
|
1319
|
-
operator:
|
|
1320
|
-
created_at:
|
|
1344
|
+
previous_publisher: z5.string().nullable().optional(),
|
|
1345
|
+
new_publisher: z5.string().nullable().optional(),
|
|
1346
|
+
reason: z5.string().refine((v) => v.trim().length > 0, { message: "reason must be non-empty after trim" }),
|
|
1347
|
+
operator: z5.string().min(1, "operator must be non-empty"),
|
|
1348
|
+
created_at: z5.string().refine((v) => isFinite(Date.parse(v)), {
|
|
1321
1349
|
message: "created_at must be a valid ISO 8601 timestamp"
|
|
1322
1350
|
}),
|
|
1323
|
-
rule_hint:
|
|
1324
|
-
pack_version:
|
|
1351
|
+
rule_hint: z5.string().nullable().optional(),
|
|
1352
|
+
pack_version: z5.string().min(1, "pack_version must be non-empty")
|
|
1325
1353
|
}).refine(
|
|
1326
1354
|
(obj) => obj.new_source_type != null && obj.new_source_type !== void 0 || obj.new_publisher != null && obj.new_publisher !== void 0,
|
|
1327
1355
|
{
|
|
@@ -1462,23 +1490,23 @@ var init_gather = __esm({
|
|
|
1462
1490
|
});
|
|
1463
1491
|
|
|
1464
1492
|
// src/sources/excerpts/schema.ts
|
|
1465
|
-
import { z as
|
|
1493
|
+
import { z as z6 } from "zod";
|
|
1466
1494
|
var EXCERPT_ID_PATTERN, ExcerptOriginSchema, ExcerptSchema;
|
|
1467
1495
|
var init_schema4 = __esm({
|
|
1468
1496
|
"src/sources/excerpts/schema.ts"() {
|
|
1469
1497
|
"use strict";
|
|
1470
1498
|
EXCERPT_ID_PATTERN = /^ex_[a-f0-9]{12}_\d{3,}$/;
|
|
1471
|
-
ExcerptOriginSchema =
|
|
1472
|
-
ExcerptSchema =
|
|
1473
|
-
excerpt_id:
|
|
1474
|
-
source_id:
|
|
1475
|
-
source_hash:
|
|
1476
|
-
text:
|
|
1477
|
-
location_hint:
|
|
1478
|
-
char_start:
|
|
1479
|
-
char_end:
|
|
1499
|
+
ExcerptOriginSchema = z6.enum(["raw_text", "key_point"]);
|
|
1500
|
+
ExcerptSchema = z6.object({
|
|
1501
|
+
excerpt_id: z6.string().regex(EXCERPT_ID_PATTERN),
|
|
1502
|
+
source_id: z6.string().regex(/^src_[a-f0-9]{12}$/),
|
|
1503
|
+
source_hash: z6.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
1504
|
+
text: z6.string().min(1),
|
|
1505
|
+
location_hint: z6.string().nullable(),
|
|
1506
|
+
char_start: z6.number().int().nonnegative(),
|
|
1507
|
+
char_end: z6.number().int().nonnegative(),
|
|
1480
1508
|
origin: ExcerptOriginSchema,
|
|
1481
|
-
created_at:
|
|
1509
|
+
created_at: z6.string()
|
|
1482
1510
|
});
|
|
1483
1511
|
}
|
|
1484
1512
|
});
|
|
@@ -2021,41 +2049,41 @@ var init_extractors2 = __esm({
|
|
|
2021
2049
|
});
|
|
2022
2050
|
|
|
2023
2051
|
// src/claims/schema.ts
|
|
2024
|
-
import { z as
|
|
2052
|
+
import { z as z7 } from "zod";
|
|
2025
2053
|
var ConfidenceSchema, ClaimExtractorSchema, ReviewStateSchema, ClaimSchema;
|
|
2026
2054
|
var init_schema5 = __esm({
|
|
2027
2055
|
"src/claims/schema.ts"() {
|
|
2028
2056
|
"use strict";
|
|
2029
2057
|
init_schema4();
|
|
2030
|
-
ConfidenceSchema =
|
|
2031
|
-
ClaimExtractorSchema =
|
|
2032
|
-
ReviewStateSchema =
|
|
2058
|
+
ConfidenceSchema = z7.enum(["low", "medium", "high"]);
|
|
2059
|
+
ClaimExtractorSchema = z7.enum(["heuristic", "ollama-intern"]);
|
|
2060
|
+
ReviewStateSchema = z7.enum([
|
|
2033
2061
|
"candidate",
|
|
2034
2062
|
"gated",
|
|
2035
2063
|
"reviewed",
|
|
2036
2064
|
"rejected",
|
|
2037
2065
|
"accepted"
|
|
2038
2066
|
]);
|
|
2039
|
-
ClaimSchema =
|
|
2040
|
-
claim_id:
|
|
2041
|
-
section_id:
|
|
2042
|
-
source_ids:
|
|
2043
|
-
source_hashes:
|
|
2044
|
-
asserts:
|
|
2045
|
-
scope:
|
|
2046
|
-
not:
|
|
2067
|
+
ClaimSchema = z7.object({
|
|
2068
|
+
claim_id: z7.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
|
|
2069
|
+
section_id: z7.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
2070
|
+
source_ids: z7.array(z7.string().regex(/^src_[a-f0-9]{12}$/)).min(1, "every claim must reference at least one source_id"),
|
|
2071
|
+
source_hashes: z7.array(z7.string().regex(/^[a-f0-9]{64}$/)),
|
|
2072
|
+
asserts: z7.string().min(1),
|
|
2073
|
+
scope: z7.string().nullable(),
|
|
2074
|
+
not: z7.string().nullable(),
|
|
2047
2075
|
// Span-first extraction: the model picks excerpt IDs from the deterministic
|
|
2048
2076
|
// ledger; research-os copies the literal text into evidence_excerpt. Models
|
|
2049
2077
|
// may interpret source spans; they may not author evidence spans.
|
|
2050
2078
|
// Allowed empty for legacy claims that pre-date span-first extraction —
|
|
2051
2079
|
// those should be re-extracted; new writes always populate at least one ID.
|
|
2052
|
-
evidence_excerpt_ids:
|
|
2053
|
-
evidence_excerpt:
|
|
2054
|
-
evidence_location:
|
|
2080
|
+
evidence_excerpt_ids: z7.array(z7.string().regex(EXCERPT_ID_PATTERN)).default([]),
|
|
2081
|
+
evidence_excerpt: z7.string().min(1),
|
|
2082
|
+
evidence_location: z7.string().nullable(),
|
|
2055
2083
|
confidence: ConfidenceSchema,
|
|
2056
2084
|
extractor: ClaimExtractorSchema,
|
|
2057
|
-
extraction_method:
|
|
2058
|
-
created_at:
|
|
2085
|
+
extraction_method: z7.string().min(1),
|
|
2086
|
+
created_at: z7.string(),
|
|
2059
2087
|
review_state: ReviewStateSchema
|
|
2060
2088
|
});
|
|
2061
2089
|
}
|
|
@@ -2333,53 +2361,53 @@ var init_extract = __esm({
|
|
|
2333
2361
|
});
|
|
2334
2362
|
|
|
2335
2363
|
// src/claims/density/schema.ts
|
|
2336
|
-
import { z as
|
|
2364
|
+
import { z as z8 } from "zod";
|
|
2337
2365
|
var PerSourceDensitySchema, NearDuplicateClusterSchema, DensityFlagSchema, ClaimDensityAuditSchema;
|
|
2338
2366
|
var init_schema6 = __esm({
|
|
2339
2367
|
"src/claims/density/schema.ts"() {
|
|
2340
2368
|
"use strict";
|
|
2341
|
-
PerSourceDensitySchema =
|
|
2342
|
-
source_id:
|
|
2343
|
-
publisher:
|
|
2344
|
-
source_word_count:
|
|
2345
|
-
claim_count:
|
|
2346
|
-
claims_per_1k_words:
|
|
2347
|
-
share_of_section:
|
|
2369
|
+
PerSourceDensitySchema = z8.object({
|
|
2370
|
+
source_id: z8.string().regex(/^src_[a-f0-9]{12}$/),
|
|
2371
|
+
publisher: z8.string().nullable(),
|
|
2372
|
+
source_word_count: z8.number().int().nonnegative(),
|
|
2373
|
+
claim_count: z8.number().int().nonnegative(),
|
|
2374
|
+
claims_per_1k_words: z8.number(),
|
|
2375
|
+
share_of_section: z8.number(),
|
|
2348
2376
|
// 0..1
|
|
2349
|
-
weak_scope_count:
|
|
2350
|
-
generic_scope_count:
|
|
2377
|
+
weak_scope_count: z8.number().int().nonnegative(),
|
|
2378
|
+
generic_scope_count: z8.number().int().nonnegative()
|
|
2351
2379
|
});
|
|
2352
|
-
NearDuplicateClusterSchema =
|
|
2353
|
-
representative_assert:
|
|
2354
|
-
member_count:
|
|
2355
|
-
claim_ids:
|
|
2380
|
+
NearDuplicateClusterSchema = z8.object({
|
|
2381
|
+
representative_assert: z8.string(),
|
|
2382
|
+
member_count: z8.number().int().nonnegative(),
|
|
2383
|
+
claim_ids: z8.array(z8.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/))
|
|
2356
2384
|
});
|
|
2357
|
-
DensityFlagSchema =
|
|
2358
|
-
type:
|
|
2385
|
+
DensityFlagSchema = z8.object({
|
|
2386
|
+
type: z8.enum([
|
|
2359
2387
|
"source_dominance",
|
|
2360
2388
|
"high_per_word_density",
|
|
2361
2389
|
"large_near_duplicate_cluster",
|
|
2362
2390
|
"weak_scope_majority"
|
|
2363
2391
|
]),
|
|
2364
|
-
severity:
|
|
2365
|
-
message:
|
|
2366
|
-
affects_source_ids:
|
|
2367
|
-
affects_claim_ids:
|
|
2392
|
+
severity: z8.enum(["info", "warn", "block"]),
|
|
2393
|
+
message: z8.string(),
|
|
2394
|
+
affects_source_ids: z8.array(z8.string().regex(/^src_[a-f0-9]{12}$/)).default([]),
|
|
2395
|
+
affects_claim_ids: z8.array(z8.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)).default([])
|
|
2368
2396
|
});
|
|
2369
|
-
ClaimDensityAuditSchema =
|
|
2370
|
-
audit_id:
|
|
2371
|
-
section_id:
|
|
2372
|
-
audited_at:
|
|
2373
|
-
research_os_version:
|
|
2374
|
-
candidate_claim_count:
|
|
2375
|
-
source_count:
|
|
2376
|
-
total_source_word_count:
|
|
2377
|
-
claims_per_1k_words:
|
|
2378
|
-
weak_scope_count:
|
|
2379
|
-
generic_scope_count:
|
|
2380
|
-
per_source:
|
|
2381
|
-
near_duplicate_clusters:
|
|
2382
|
-
flags:
|
|
2397
|
+
ClaimDensityAuditSchema = z8.object({
|
|
2398
|
+
audit_id: z8.string().regex(/^cda_[0-9]+_[a-z0-9-]+$/),
|
|
2399
|
+
section_id: z8.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
2400
|
+
audited_at: z8.string(),
|
|
2401
|
+
research_os_version: z8.string(),
|
|
2402
|
+
candidate_claim_count: z8.number().int().nonnegative(),
|
|
2403
|
+
source_count: z8.number().int().nonnegative(),
|
|
2404
|
+
total_source_word_count: z8.number().int().nonnegative(),
|
|
2405
|
+
claims_per_1k_words: z8.number(),
|
|
2406
|
+
weak_scope_count: z8.number().int().nonnegative(),
|
|
2407
|
+
generic_scope_count: z8.number().int().nonnegative(),
|
|
2408
|
+
per_source: z8.array(PerSourceDensitySchema),
|
|
2409
|
+
near_duplicate_clusters: z8.array(NearDuplicateClusterSchema),
|
|
2410
|
+
flags: z8.array(DensityFlagSchema)
|
|
2383
2411
|
});
|
|
2384
2412
|
}
|
|
2385
2413
|
});
|
|
@@ -2696,12 +2724,12 @@ var init_claims = __esm({
|
|
|
2696
2724
|
});
|
|
2697
2725
|
|
|
2698
2726
|
// src/contradictions/schema.ts
|
|
2699
|
-
import { z as
|
|
2727
|
+
import { z as z9 } from "zod";
|
|
2700
2728
|
var ContradictionTypeSchema, SeveritySchema, OverlapAssessmentSchema, ContradictionDetectorSchema, ContradictionStatusSchema, ContradictionConfidenceSchema, ContradictionSchema;
|
|
2701
2729
|
var init_schema7 = __esm({
|
|
2702
2730
|
"src/contradictions/schema.ts"() {
|
|
2703
2731
|
"use strict";
|
|
2704
|
-
ContradictionTypeSchema =
|
|
2732
|
+
ContradictionTypeSchema = z9.enum([
|
|
2705
2733
|
"direct_conflict",
|
|
2706
2734
|
"scope_conflict",
|
|
2707
2735
|
"temporal_conflict",
|
|
@@ -2709,37 +2737,37 @@ var init_schema7 = __esm({
|
|
|
2709
2737
|
"evidence_conflict",
|
|
2710
2738
|
"overgeneralization_risk"
|
|
2711
2739
|
]);
|
|
2712
|
-
SeveritySchema =
|
|
2713
|
-
OverlapAssessmentSchema =
|
|
2740
|
+
SeveritySchema = z9.enum(["low", "medium", "high", "blocking"]);
|
|
2741
|
+
OverlapAssessmentSchema = z9.enum([
|
|
2714
2742
|
"fully_overlapping",
|
|
2715
2743
|
"partially_overlapping",
|
|
2716
2744
|
"non_overlapping",
|
|
2717
2745
|
"unknown"
|
|
2718
2746
|
]);
|
|
2719
|
-
ContradictionDetectorSchema =
|
|
2720
|
-
ContradictionStatusSchema =
|
|
2747
|
+
ContradictionDetectorSchema = z9.enum(["heuristic", "ollama-intern"]);
|
|
2748
|
+
ContradictionStatusSchema = z9.enum([
|
|
2721
2749
|
"unresolved",
|
|
2722
2750
|
"reconciled",
|
|
2723
2751
|
"preserved_deliberately",
|
|
2724
2752
|
"rejected"
|
|
2725
2753
|
]);
|
|
2726
|
-
ContradictionConfidenceSchema =
|
|
2727
|
-
ContradictionSchema =
|
|
2728
|
-
contradiction_id:
|
|
2729
|
-
section_id:
|
|
2730
|
-
claim_ids:
|
|
2731
|
-
source_ids:
|
|
2754
|
+
ContradictionConfidenceSchema = z9.enum(["low", "medium", "high"]);
|
|
2755
|
+
ContradictionSchema = z9.object({
|
|
2756
|
+
contradiction_id: z9.string().regex(/^cnt_[a-f0-9]{12}_(heuristic|ollama_intern)$/),
|
|
2757
|
+
section_id: z9.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
2758
|
+
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"),
|
|
2759
|
+
source_ids: z9.array(z9.string().regex(/^src_[a-f0-9]{12}$/)).min(1),
|
|
2732
2760
|
type: ContradictionTypeSchema,
|
|
2733
|
-
summary:
|
|
2734
|
-
scope_analysis:
|
|
2761
|
+
summary: z9.string().min(1),
|
|
2762
|
+
scope_analysis: z9.string(),
|
|
2735
2763
|
overlap_assessment: OverlapAssessmentSchema,
|
|
2736
2764
|
severity: SeveritySchema,
|
|
2737
2765
|
confidence: ContradictionConfidenceSchema,
|
|
2738
2766
|
detector: ContradictionDetectorSchema,
|
|
2739
|
-
detection_method:
|
|
2740
|
-
evidence:
|
|
2767
|
+
detection_method: z9.string().min(1),
|
|
2768
|
+
evidence: z9.string(),
|
|
2741
2769
|
status: ContradictionStatusSchema,
|
|
2742
|
-
created_at:
|
|
2770
|
+
created_at: z9.string()
|
|
2743
2771
|
});
|
|
2744
2772
|
}
|
|
2745
2773
|
});
|
|
@@ -3181,12 +3209,12 @@ var init_markdown = __esm({
|
|
|
3181
3209
|
});
|
|
3182
3210
|
|
|
3183
3211
|
// src/triage/schema.ts
|
|
3184
|
-
import { z as
|
|
3212
|
+
import { z as z10 } from "zod";
|
|
3185
3213
|
var TriageDecisionSchema, ClaimTriageSchema, TriageSummarySchema;
|
|
3186
3214
|
var init_schema8 = __esm({
|
|
3187
3215
|
"src/triage/schema.ts"() {
|
|
3188
3216
|
"use strict";
|
|
3189
|
-
TriageDecisionSchema =
|
|
3217
|
+
TriageDecisionSchema = z10.enum([
|
|
3190
3218
|
// Passes triage and is forwarded to review.
|
|
3191
3219
|
"selected_for_review",
|
|
3192
3220
|
// Parked: kept on the canonical ledger as research truth, but not advanced.
|
|
@@ -3198,36 +3226,36 @@ var init_schema8 = __esm({
|
|
|
3198
3226
|
"needs_scope_repair",
|
|
3199
3227
|
"needs_human_review"
|
|
3200
3228
|
]);
|
|
3201
|
-
ClaimTriageSchema =
|
|
3202
|
-
triage_id:
|
|
3203
|
-
claim_id:
|
|
3204
|
-
section_id:
|
|
3229
|
+
ClaimTriageSchema = z10.object({
|
|
3230
|
+
triage_id: z10.string().regex(/^tri_[a-f0-9]{12}$/),
|
|
3231
|
+
claim_id: z10.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
|
|
3232
|
+
section_id: z10.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
3205
3233
|
decision: TriageDecisionSchema,
|
|
3206
|
-
reason:
|
|
3234
|
+
reason: z10.string().min(1),
|
|
3207
3235
|
// Rank among selected_for_review claims (1 = highest priority). null for
|
|
3208
3236
|
// any non-selected decision.
|
|
3209
|
-
rank:
|
|
3237
|
+
rank: z10.number().int().positive().nullable(),
|
|
3210
3238
|
// Quality score [0..1] used to sort. Stable. Higher = better.
|
|
3211
|
-
quality_score:
|
|
3212
|
-
triage_method:
|
|
3213
|
-
created_at:
|
|
3214
|
-
});
|
|
3215
|
-
TriageSummarySchema =
|
|
3216
|
-
summary_id:
|
|
3217
|
-
section_id:
|
|
3218
|
-
triaged_at:
|
|
3219
|
-
research_os_version:
|
|
3220
|
-
triage_method:
|
|
3221
|
-
candidate_claims:
|
|
3222
|
-
decisions:
|
|
3223
|
-
per_source_cap:
|
|
3224
|
-
duplicate_clusters_collapsed:
|
|
3225
|
-
selected_count:
|
|
3226
|
-
selected_per_source:
|
|
3227
|
-
|
|
3228
|
-
source_id:
|
|
3229
|
-
selected:
|
|
3230
|
-
total:
|
|
3239
|
+
quality_score: z10.number().min(0).max(1),
|
|
3240
|
+
triage_method: z10.string().min(1),
|
|
3241
|
+
created_at: z10.string()
|
|
3242
|
+
});
|
|
3243
|
+
TriageSummarySchema = z10.object({
|
|
3244
|
+
summary_id: z10.string().regex(/^tris_[0-9]+_[a-z0-9-]+$/),
|
|
3245
|
+
section_id: z10.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
3246
|
+
triaged_at: z10.string(),
|
|
3247
|
+
research_os_version: z10.string(),
|
|
3248
|
+
triage_method: z10.string(),
|
|
3249
|
+
candidate_claims: z10.number().int().nonnegative(),
|
|
3250
|
+
decisions: z10.record(TriageDecisionSchema, z10.number().int().nonnegative()),
|
|
3251
|
+
per_source_cap: z10.number().int().positive(),
|
|
3252
|
+
duplicate_clusters_collapsed: z10.number().int().nonnegative(),
|
|
3253
|
+
selected_count: z10.number().int().nonnegative(),
|
|
3254
|
+
selected_per_source: z10.array(
|
|
3255
|
+
z10.object({
|
|
3256
|
+
source_id: z10.string().regex(/^src_[a-f0-9]{12}$/),
|
|
3257
|
+
selected: z10.number().int().nonnegative(),
|
|
3258
|
+
total: z10.number().int().nonnegative()
|
|
3231
3259
|
})
|
|
3232
3260
|
)
|
|
3233
3261
|
});
|
|
@@ -3724,23 +3752,23 @@ var init_map = __esm({
|
|
|
3724
3752
|
});
|
|
3725
3753
|
|
|
3726
3754
|
// src/contradictions/resolution-schema.ts
|
|
3727
|
-
import { z as
|
|
3755
|
+
import { z as z11 } from "zod";
|
|
3728
3756
|
var ResolutionStatusSchema, ContradictionResolutionSchema;
|
|
3729
3757
|
var init_resolution_schema = __esm({
|
|
3730
3758
|
"src/contradictions/resolution-schema.ts"() {
|
|
3731
3759
|
"use strict";
|
|
3732
|
-
ResolutionStatusSchema =
|
|
3760
|
+
ResolutionStatusSchema = z11.enum([
|
|
3733
3761
|
"unresolved",
|
|
3734
3762
|
"resolved",
|
|
3735
3763
|
"preserved",
|
|
3736
3764
|
"rejected"
|
|
3737
3765
|
]);
|
|
3738
|
-
ContradictionResolutionSchema =
|
|
3739
|
-
contradiction_id:
|
|
3766
|
+
ContradictionResolutionSchema = z11.object({
|
|
3767
|
+
contradiction_id: z11.string().min(1),
|
|
3740
3768
|
status: ResolutionStatusSchema,
|
|
3741
|
-
reason:
|
|
3742
|
-
resolved_at:
|
|
3743
|
-
resolved_by:
|
|
3769
|
+
reason: z11.string().min(4),
|
|
3770
|
+
resolved_at: z11.string().min(1),
|
|
3771
|
+
resolved_by: z11.string().min(1)
|
|
3744
3772
|
});
|
|
3745
3773
|
}
|
|
3746
3774
|
});
|
|
@@ -3857,12 +3885,13 @@ var init_contradictions = __esm({
|
|
|
3857
3885
|
});
|
|
3858
3886
|
|
|
3859
3887
|
// src/review/schema.ts
|
|
3860
|
-
import { z as
|
|
3888
|
+
import { z as z12 } from "zod";
|
|
3861
3889
|
var FindingCategorySchema, FindingSeveritySchema, ReviewerNameSchema, ReviewDecisionSchema, ReviewConfidenceSchema, ReviewFindingSchema, ClaimReviewSchema, ReviewSnapshotSchema;
|
|
3862
3890
|
var init_schema9 = __esm({
|
|
3863
3891
|
"src/review/schema.ts"() {
|
|
3864
3892
|
"use strict";
|
|
3865
|
-
|
|
3893
|
+
init_reviewer_options_schema();
|
|
3894
|
+
FindingCategorySchema = z12.enum([
|
|
3866
3895
|
"unsupported_claim",
|
|
3867
3896
|
"ungrounded_excerpt",
|
|
3868
3897
|
"stale_claim",
|
|
@@ -3889,9 +3918,9 @@ var init_schema9 = __esm({
|
|
|
3889
3918
|
// a low-value claim can appear in a perfectly-sized section.
|
|
3890
3919
|
"valid_but_low_value"
|
|
3891
3920
|
]);
|
|
3892
|
-
FindingSeveritySchema =
|
|
3893
|
-
ReviewerNameSchema =
|
|
3894
|
-
ReviewDecisionSchema =
|
|
3921
|
+
FindingSeveritySchema = z12.enum(["info", "warn", "block"]);
|
|
3922
|
+
ReviewerNameSchema = z12.enum(["heuristic", "ollama-intern"]);
|
|
3923
|
+
ReviewDecisionSchema = z12.enum([
|
|
3895
3924
|
"accepted_for_synthesis",
|
|
3896
3925
|
"rejected",
|
|
3897
3926
|
"needs_scope_repair",
|
|
@@ -3899,47 +3928,48 @@ var init_schema9 = __esm({
|
|
|
3899
3928
|
"needs_contradiction_mapping",
|
|
3900
3929
|
"needs_human_review"
|
|
3901
3930
|
]);
|
|
3902
|
-
ReviewConfidenceSchema =
|
|
3903
|
-
ReviewFindingSchema =
|
|
3904
|
-
finding_id:
|
|
3905
|
-
section_id:
|
|
3906
|
-
claim_ids:
|
|
3907
|
-
source_ids:
|
|
3931
|
+
ReviewConfidenceSchema = z12.enum(["low", "medium", "high"]);
|
|
3932
|
+
ReviewFindingSchema = z12.object({
|
|
3933
|
+
finding_id: z12.string().regex(/^fnd_[a-f0-9]{12}$/),
|
|
3934
|
+
section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
3935
|
+
claim_ids: z12.array(z12.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/)),
|
|
3936
|
+
source_ids: z12.array(z12.string().regex(/^src_[a-f0-9]{12}$/)),
|
|
3908
3937
|
category: FindingCategorySchema,
|
|
3909
3938
|
severity: FindingSeveritySchema,
|
|
3910
|
-
summary:
|
|
3911
|
-
evidence:
|
|
3912
|
-
required_action:
|
|
3939
|
+
summary: z12.string().min(1),
|
|
3940
|
+
evidence: z12.string(),
|
|
3941
|
+
required_action: z12.string(),
|
|
3913
3942
|
reviewer: ReviewerNameSchema,
|
|
3914
|
-
review_method:
|
|
3943
|
+
review_method: z12.string().min(1),
|
|
3915
3944
|
confidence: ReviewConfidenceSchema,
|
|
3916
|
-
created_at:
|
|
3945
|
+
created_at: z12.string()
|
|
3917
3946
|
});
|
|
3918
|
-
ClaimReviewSchema =
|
|
3919
|
-
claim_id:
|
|
3947
|
+
ClaimReviewSchema = z12.object({
|
|
3948
|
+
claim_id: z12.string().regex(/^clm_[a-f0-9]{12}_(heuristic|ollama_intern)_\d+$/),
|
|
3920
3949
|
decision: ReviewDecisionSchema,
|
|
3921
|
-
reason:
|
|
3922
|
-
finding_ids:
|
|
3950
|
+
reason: z12.string().min(1),
|
|
3951
|
+
finding_ids: z12.array(z12.string()),
|
|
3923
3952
|
reviewer: ReviewerNameSchema,
|
|
3924
|
-
review_method:
|
|
3925
|
-
created_at:
|
|
3953
|
+
review_method: z12.string().min(1),
|
|
3954
|
+
created_at: z12.string(),
|
|
3926
3955
|
// v0.5: optional profile lineage. Additive-optional — pre-v0.5 records
|
|
3927
3956
|
// without this field parse cleanly. Frozen packs unaffected (Zod .optional()
|
|
3928
3957
|
// with no .default() leaves absent keys absent on round-trip).
|
|
3929
|
-
profile:
|
|
3958
|
+
profile: z12.string().optional()
|
|
3930
3959
|
});
|
|
3931
|
-
ReviewSnapshotSchema =
|
|
3932
|
-
section_id:
|
|
3960
|
+
ReviewSnapshotSchema = z12.object({
|
|
3961
|
+
section_id: z12.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
3933
3962
|
reviewer: ReviewerNameSchema,
|
|
3934
|
-
review_method:
|
|
3935
|
-
reviewed_at:
|
|
3936
|
-
candidate_claims:
|
|
3937
|
-
findings:
|
|
3938
|
-
claim_reviews:
|
|
3939
|
-
decision_counts:
|
|
3940
|
-
severity_counts:
|
|
3941
|
-
llm_findings_rejected_ungrounded:
|
|
3942
|
-
promoted_to_reviewed:
|
|
3963
|
+
review_method: z12.string(),
|
|
3964
|
+
reviewed_at: z12.string(),
|
|
3965
|
+
candidate_claims: z12.number().int().nonnegative(),
|
|
3966
|
+
findings: z12.array(ReviewFindingSchema),
|
|
3967
|
+
claim_reviews: z12.array(ClaimReviewSchema),
|
|
3968
|
+
decision_counts: z12.record(ReviewDecisionSchema, z12.number().int().nonnegative()),
|
|
3969
|
+
severity_counts: z12.record(FindingSeveritySchema, z12.number().int().nonnegative()),
|
|
3970
|
+
llm_findings_rejected_ungrounded: z12.number().int().nonnegative(),
|
|
3971
|
+
promoted_to_reviewed: z12.boolean(),
|
|
3972
|
+
reviewer_options: ReviewerOptionsSchema.optional()
|
|
3943
3973
|
});
|
|
3944
3974
|
}
|
|
3945
3975
|
});
|
|
@@ -4827,12 +4857,12 @@ var init_markdown2 = __esm({
|
|
|
4827
4857
|
});
|
|
4828
4858
|
|
|
4829
4859
|
// src/gates/schema.ts
|
|
4830
|
-
import { z as
|
|
4860
|
+
import { z as z13 } from "zod";
|
|
4831
4861
|
var GateFamilySchema, GateCheckStatusSchema, VerdictSchema, GateCheckResultSchema, WaiverApplicationSchema, SectionGateResultSchema;
|
|
4832
4862
|
var init_schema10 = __esm({
|
|
4833
4863
|
"src/gates/schema.ts"() {
|
|
4834
4864
|
"use strict";
|
|
4835
|
-
GateFamilySchema =
|
|
4865
|
+
GateFamilySchema = z13.enum([
|
|
4836
4866
|
"source_floor",
|
|
4837
4867
|
"claim_integrity",
|
|
4838
4868
|
"scope_integrity",
|
|
@@ -4842,85 +4872,85 @@ var init_schema10 = __esm({
|
|
|
4842
4872
|
"waivers",
|
|
4843
4873
|
"accepted_claim_floor"
|
|
4844
4874
|
]);
|
|
4845
|
-
GateCheckStatusSchema =
|
|
4875
|
+
GateCheckStatusSchema = z13.enum([
|
|
4846
4876
|
"pass",
|
|
4847
4877
|
"warn",
|
|
4848
4878
|
"fail",
|
|
4849
4879
|
"pass_with_waiver",
|
|
4850
4880
|
"warn_with_waiver"
|
|
4851
4881
|
]);
|
|
4852
|
-
VerdictSchema =
|
|
4853
|
-
GateCheckResultSchema =
|
|
4882
|
+
VerdictSchema = z13.enum(["pass", "warn", "fail", "blocked"]);
|
|
4883
|
+
GateCheckResultSchema = z13.object({
|
|
4854
4884
|
family: GateFamilySchema,
|
|
4855
|
-
check:
|
|
4885
|
+
check: z13.string().min(1),
|
|
4856
4886
|
status: GateCheckStatusSchema,
|
|
4857
|
-
detail:
|
|
4858
|
-
evidence:
|
|
4859
|
-
blocks_synthesis:
|
|
4887
|
+
detail: z13.string(),
|
|
4888
|
+
evidence: z13.array(z13.string()),
|
|
4889
|
+
blocks_synthesis: z13.boolean()
|
|
4860
4890
|
});
|
|
4861
|
-
WaiverApplicationSchema =
|
|
4891
|
+
WaiverApplicationSchema = z13.object({
|
|
4862
4892
|
family: GateFamilySchema,
|
|
4863
|
-
check:
|
|
4864
|
-
reason:
|
|
4865
|
-
compensating_controls:
|
|
4893
|
+
check: z13.string().min(1),
|
|
4894
|
+
reason: z13.string().min(1),
|
|
4895
|
+
compensating_controls: z13.array(z13.string()),
|
|
4866
4896
|
original_status: GateCheckStatusSchema,
|
|
4867
4897
|
new_status: GateCheckStatusSchema
|
|
4868
4898
|
});
|
|
4869
|
-
SectionGateResultSchema =
|
|
4870
|
-
section_id:
|
|
4899
|
+
SectionGateResultSchema = z13.object({
|
|
4900
|
+
section_id: z13.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
4871
4901
|
verdict: VerdictSchema,
|
|
4872
|
-
summary:
|
|
4873
|
-
checked_at:
|
|
4874
|
-
synthesis_eligible:
|
|
4875
|
-
gate_results:
|
|
4876
|
-
failures:
|
|
4877
|
-
warnings:
|
|
4878
|
-
waivers_applied:
|
|
4879
|
-
blocking_reasons:
|
|
4880
|
-
claim_counts:
|
|
4881
|
-
total:
|
|
4882
|
-
candidate:
|
|
4883
|
-
with_evidence_excerpt:
|
|
4884
|
-
with_source_hashes:
|
|
4885
|
-
with_scope:
|
|
4886
|
-
with_not:
|
|
4887
|
-
universal_scope_null:
|
|
4888
|
-
orphans:
|
|
4902
|
+
summary: z13.string(),
|
|
4903
|
+
checked_at: z13.string(),
|
|
4904
|
+
synthesis_eligible: z13.boolean(),
|
|
4905
|
+
gate_results: z13.array(GateCheckResultSchema),
|
|
4906
|
+
failures: z13.array(GateCheckResultSchema),
|
|
4907
|
+
warnings: z13.array(GateCheckResultSchema),
|
|
4908
|
+
waivers_applied: z13.array(WaiverApplicationSchema),
|
|
4909
|
+
blocking_reasons: z13.array(z13.string()),
|
|
4910
|
+
claim_counts: z13.object({
|
|
4911
|
+
total: z13.number().int().nonnegative(),
|
|
4912
|
+
candidate: z13.number().int().nonnegative(),
|
|
4913
|
+
with_evidence_excerpt: z13.number().int().nonnegative(),
|
|
4914
|
+
with_source_hashes: z13.number().int().nonnegative(),
|
|
4915
|
+
with_scope: z13.number().int().nonnegative(),
|
|
4916
|
+
with_not: z13.number().int().nonnegative(),
|
|
4917
|
+
universal_scope_null: z13.number().int().nonnegative(),
|
|
4918
|
+
orphans: z13.number().int().nonnegative()
|
|
4889
4919
|
}),
|
|
4890
|
-
source_counts:
|
|
4891
|
-
total:
|
|
4892
|
-
primary:
|
|
4893
|
-
secondary:
|
|
4894
|
-
forum:
|
|
4895
|
-
benchmark:
|
|
4896
|
-
docs:
|
|
4897
|
-
unknown:
|
|
4898
|
-
independent_publishers:
|
|
4899
|
-
failed_fetches:
|
|
4900
|
-
section_primary:
|
|
4901
|
-
section_independent_publishers:
|
|
4920
|
+
source_counts: z13.object({
|
|
4921
|
+
total: z13.number().int().nonnegative(),
|
|
4922
|
+
primary: z13.number().int().nonnegative(),
|
|
4923
|
+
secondary: z13.number().int().nonnegative(),
|
|
4924
|
+
forum: z13.number().int().nonnegative(),
|
|
4925
|
+
benchmark: z13.number().int().nonnegative(),
|
|
4926
|
+
docs: z13.number().int().nonnegative(),
|
|
4927
|
+
unknown: z13.number().int().nonnegative(),
|
|
4928
|
+
independent_publishers: z13.number().int().nonnegative(),
|
|
4929
|
+
failed_fetches: z13.number().int().nonnegative(),
|
|
4930
|
+
section_primary: z13.number().int().nonnegative().optional().default(0),
|
|
4931
|
+
section_independent_publishers: z13.number().int().nonnegative().optional().default(0)
|
|
4902
4932
|
}),
|
|
4903
|
-
contradiction_counts:
|
|
4904
|
-
total:
|
|
4905
|
-
unresolved:
|
|
4906
|
-
blocking:
|
|
4907
|
-
by_type:
|
|
4933
|
+
contradiction_counts: z13.object({
|
|
4934
|
+
total: z13.number().int().nonnegative(),
|
|
4935
|
+
unresolved: z13.number().int().nonnegative(),
|
|
4936
|
+
blocking: z13.number().int().nonnegative(),
|
|
4937
|
+
by_type: z13.record(z13.string(), z13.number().int().nonnegative())
|
|
4908
4938
|
}),
|
|
4909
|
-
freshness_summary:
|
|
4910
|
-
policy_required:
|
|
4911
|
-
max_source_age_months:
|
|
4912
|
-
stale_source_policy:
|
|
4913
|
-
stale_count:
|
|
4914
|
-
unknown_date_count:
|
|
4939
|
+
freshness_summary: z13.object({
|
|
4940
|
+
policy_required: z13.boolean(),
|
|
4941
|
+
max_source_age_months: z13.number().int().nullable(),
|
|
4942
|
+
stale_source_policy: z13.enum(["warn", "fail"]),
|
|
4943
|
+
stale_count: z13.number().int().nonnegative(),
|
|
4944
|
+
unknown_date_count: z13.number().int().nonnegative()
|
|
4915
4945
|
}),
|
|
4916
|
-
scope_integrity_summary:
|
|
4917
|
-
universal_claims:
|
|
4918
|
-
scoped_claims:
|
|
4919
|
-
with_not_constraint:
|
|
4920
|
-
overgen_risks_total:
|
|
4921
|
-
overgen_risks_blocking:
|
|
4946
|
+
scope_integrity_summary: z13.object({
|
|
4947
|
+
universal_claims: z13.number().int().nonnegative(),
|
|
4948
|
+
scoped_claims: z13.number().int().nonnegative(),
|
|
4949
|
+
with_not_constraint: z13.number().int().nonnegative(),
|
|
4950
|
+
overgen_risks_total: z13.number().int().nonnegative(),
|
|
4951
|
+
overgen_risks_blocking: z13.number().int().nonnegative()
|
|
4922
4952
|
}),
|
|
4923
|
-
next_actions:
|
|
4953
|
+
next_actions: z13.array(z13.string())
|
|
4924
4954
|
});
|
|
4925
4955
|
}
|
|
4926
4956
|
});
|
|
@@ -5257,7 +5287,7 @@ var init_gates = __esm({
|
|
|
5257
5287
|
import { existsSync as existsSync13 } from "fs";
|
|
5258
5288
|
import { mkdir as mkdir11, readFile as readFile13, writeFile as writeFile11 } from "fs/promises";
|
|
5259
5289
|
import { join as join14 } from "path";
|
|
5260
|
-
import { z as
|
|
5290
|
+
import { z as z14 } from "zod";
|
|
5261
5291
|
function reviewActivePath(packPath, sectionId) {
|
|
5262
5292
|
return join14(packPath, "sections", sectionId, "review-active.json");
|
|
5263
5293
|
}
|
|
@@ -5287,22 +5317,22 @@ var init_profiles = __esm({
|
|
|
5287
5317
|
"src/review/profiles.ts"() {
|
|
5288
5318
|
"use strict";
|
|
5289
5319
|
DEFAULT_PROFILE = "default";
|
|
5290
|
-
PromotionCalibrationSummarySchema =
|
|
5291
|
-
fixture:
|
|
5292
|
-
good_false_positive_rate:
|
|
5293
|
-
bad_any_flag_recall:
|
|
5294
|
-
strict_category_recall:
|
|
5295
|
-
unsupported_claim_recall:
|
|
5296
|
-
notes:
|
|
5297
|
-
});
|
|
5298
|
-
ReviewActiveSchema =
|
|
5299
|
-
active_profile:
|
|
5300
|
-
promoted_at:
|
|
5301
|
-
promoted_method:
|
|
5302
|
-
promoted_reviewer:
|
|
5320
|
+
PromotionCalibrationSummarySchema = z14.object({
|
|
5321
|
+
fixture: z14.string().nullable().default(null),
|
|
5322
|
+
good_false_positive_rate: z14.string().nullable().default(null),
|
|
5323
|
+
bad_any_flag_recall: z14.string().nullable().default(null),
|
|
5324
|
+
strict_category_recall: z14.string().nullable().default(null),
|
|
5325
|
+
unsupported_claim_recall: z14.string().nullable().default(null),
|
|
5326
|
+
notes: z14.string().nullable().default(null)
|
|
5327
|
+
});
|
|
5328
|
+
ReviewActiveSchema = z14.object({
|
|
5329
|
+
active_profile: z14.string().min(1),
|
|
5330
|
+
promoted_at: z14.string(),
|
|
5331
|
+
promoted_method: z14.string(),
|
|
5332
|
+
promoted_reviewer: z14.string(),
|
|
5303
5333
|
// Free-text reason the profile was promoted. Recorded once at promotion
|
|
5304
5334
|
// time; not derived from artifacts. Required.
|
|
5305
|
-
promotion_reason:
|
|
5335
|
+
promotion_reason: z14.string().min(8).default("promoted via review-promote without an explicit reason"),
|
|
5306
5336
|
// Optional calibration evidence captured at promotion time so downstream
|
|
5307
5337
|
// consumers can see WHY the reviewer was trusted.
|
|
5308
5338
|
calibration_summary: PromotionCalibrationSummarySchema.nullable().default(null)
|
|
@@ -5650,6 +5680,7 @@ var init_ollama_intern4 = __esm({
|
|
|
5650
5680
|
"src/review/reviewers/ollama-intern.ts"() {
|
|
5651
5681
|
"use strict";
|
|
5652
5682
|
init_ollama_intern();
|
|
5683
|
+
init_reviewer_options_schema();
|
|
5653
5684
|
DEFAULT_HOST4 = "http://localhost:11434";
|
|
5654
5685
|
DEFAULT_MODEL4 = "hermes3:8b";
|
|
5655
5686
|
DEFAULT_TIMEOUT_MS3 = 18e4;
|
|
@@ -5738,6 +5769,7 @@ Return ONE JSON object: {"findings": [...]}.`;
|
|
|
5738
5769
|
timeoutMs;
|
|
5739
5770
|
claimsPerWindow;
|
|
5740
5771
|
fetchImpl;
|
|
5772
|
+
reviewerOptions;
|
|
5741
5773
|
constructor(config = {}) {
|
|
5742
5774
|
this.host = normalizeOllamaHost(config.host ?? process.env.OLLAMA_HOST ?? DEFAULT_HOST4);
|
|
5743
5775
|
this.model = config.model ?? process.env.OLLAMA_INTERN_MODEL ?? DEFAULT_MODEL4;
|
|
@@ -5746,6 +5778,7 @@ Return ONE JSON object: {"findings": [...]}.`;
|
|
|
5746
5778
|
const envWindow = process.env.OLLAMA_INTERN_REVIEW_WINDOW;
|
|
5747
5779
|
this.claimsPerWindow = config.claimsPerWindow ?? (envWindow ? parseInt(envWindow, 10) || DEFAULT_CLAIMS_PER_WINDOW : DEFAULT_CLAIMS_PER_WINDOW);
|
|
5748
5780
|
this.fetchImpl = config.fetchImpl ?? globalThis.fetch;
|
|
5781
|
+
this.reviewerOptions = config.reviewer_options ? ReviewerOptionsSchema.parse(config.reviewer_options) : void 0;
|
|
5749
5782
|
}
|
|
5750
5783
|
async available() {
|
|
5751
5784
|
try {
|
|
@@ -5798,7 +5831,17 @@ ${claimsBlock}`;
|
|
|
5798
5831
|
// native window; review prompts with 20+ claims exceed that and
|
|
5799
5832
|
// get silently truncated, which drops claim_ids and confuses the
|
|
5800
5833
|
// model. Explicitly request 8K so paged windows fit cleanly.
|
|
5801
|
-
|
|
5834
|
+
// Additional sampling params (temperature, seed, etc.) are merged
|
|
5835
|
+
// from reviewerOptions when set. Use !== undefined throughout —
|
|
5836
|
+
// temperature: 0 is valid and must not be dropped by truthiness.
|
|
5837
|
+
options: {
|
|
5838
|
+
num_ctx: this.reviewerOptions?.num_ctx ?? 8192,
|
|
5839
|
+
...this.reviewerOptions?.temperature !== void 0 && { temperature: this.reviewerOptions.temperature },
|
|
5840
|
+
...this.reviewerOptions?.seed !== void 0 && { seed: this.reviewerOptions.seed },
|
|
5841
|
+
...this.reviewerOptions?.top_p !== void 0 && { top_p: this.reviewerOptions.top_p },
|
|
5842
|
+
...this.reviewerOptions?.top_k !== void 0 && { top_k: this.reviewerOptions.top_k },
|
|
5843
|
+
...this.reviewerOptions?.repeat_penalty !== void 0 && { repeat_penalty: this.reviewerOptions.repeat_penalty }
|
|
5844
|
+
},
|
|
5802
5845
|
messages: [
|
|
5803
5846
|
{
|
|
5804
5847
|
role: "system",
|
|
@@ -6049,6 +6092,16 @@ function renderReviewMarkdown(snapshot) {
|
|
|
6049
6092
|
lines.push("");
|
|
6050
6093
|
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.");
|
|
6051
6094
|
lines.push("");
|
|
6095
|
+
const opts = snapshot.reviewer_options;
|
|
6096
|
+
if (opts && Object.keys(opts).length > 0) {
|
|
6097
|
+
lines.push("## Reviewer options");
|
|
6098
|
+
lines.push("");
|
|
6099
|
+
const KEY_ORDER = ["num_ctx", "temperature", "seed", "top_p", "top_k", "repeat_penalty"];
|
|
6100
|
+
for (const key of KEY_ORDER) {
|
|
6101
|
+
if (opts[key] !== void 0) lines.push(`- ${key}: ${opts[key]}`);
|
|
6102
|
+
}
|
|
6103
|
+
lines.push("");
|
|
6104
|
+
}
|
|
6052
6105
|
lines.push("## Effective decisions");
|
|
6053
6106
|
lines.push("");
|
|
6054
6107
|
const decisions = snapshot.decision_counts;
|
|
@@ -6416,7 +6469,8 @@ async function runMultiPassReview(args) {
|
|
|
6416
6469
|
drafts: merged,
|
|
6417
6470
|
llmFindingsRejected,
|
|
6418
6471
|
profile: args.options.profile ?? DEFAULT_PROFILE,
|
|
6419
|
-
research: args.research
|
|
6472
|
+
research: args.research,
|
|
6473
|
+
reviewer_options: args.options.reviewer_options
|
|
6420
6474
|
});
|
|
6421
6475
|
}
|
|
6422
6476
|
async function reviewWithSpecificReviewer(args) {
|
|
@@ -6445,7 +6499,8 @@ async function reviewWithSpecificReviewer(args) {
|
|
|
6445
6499
|
drafts: result.drafts,
|
|
6446
6500
|
llmFindingsRejected: 0,
|
|
6447
6501
|
profile: args.options.profile ?? DEFAULT_PROFILE,
|
|
6448
|
-
research: args.research
|
|
6502
|
+
research: args.research,
|
|
6503
|
+
reviewer_options: args.options.reviewer_options
|
|
6449
6504
|
});
|
|
6450
6505
|
}
|
|
6451
6506
|
async function finalizeReview(args) {
|
|
@@ -6505,7 +6560,8 @@ async function finalizeReview(args) {
|
|
|
6505
6560
|
decision_counts: decisionCounts,
|
|
6506
6561
|
severity_counts: severityCounts,
|
|
6507
6562
|
llm_findings_rejected_ungrounded: args.llmFindingsRejected,
|
|
6508
|
-
promoted_to_reviewed: promoted
|
|
6563
|
+
promoted_to_reviewed: promoted,
|
|
6564
|
+
reviewer_options: args.reviewer_options
|
|
6509
6565
|
});
|
|
6510
6566
|
const profDir = profileDir(args.packPath, args.sectionId, args.profile);
|
|
6511
6567
|
await mkdir12(profDir, { recursive: true });
|
|
@@ -7591,26 +7647,26 @@ var init_indexer = __esm({
|
|
|
7591
7647
|
});
|
|
7592
7648
|
|
|
7593
7649
|
// src/dispositions/schema.ts
|
|
7594
|
-
import { z as
|
|
7650
|
+
import { z as z15 } from "zod";
|
|
7595
7651
|
var ClaimSynthesisDispositionStatusSchema, ClaimSynthesisDispositionSchema;
|
|
7596
7652
|
var init_schema12 = __esm({
|
|
7597
7653
|
"src/dispositions/schema.ts"() {
|
|
7598
7654
|
"use strict";
|
|
7599
|
-
ClaimSynthesisDispositionStatusSchema =
|
|
7655
|
+
ClaimSynthesisDispositionStatusSchema = z15.enum([
|
|
7600
7656
|
"parked_not_for_synthesis",
|
|
7601
7657
|
"preserved_for_human_note",
|
|
7602
7658
|
"needs_human_review_excluded",
|
|
7603
7659
|
"out_of_bounds_regression_fixture"
|
|
7604
7660
|
]);
|
|
7605
|
-
ClaimSynthesisDispositionSchema =
|
|
7606
|
-
claim_id:
|
|
7607
|
-
section_id:
|
|
7661
|
+
ClaimSynthesisDispositionSchema = z15.object({
|
|
7662
|
+
claim_id: z15.string().min(1),
|
|
7663
|
+
section_id: z15.string().min(1),
|
|
7608
7664
|
status: ClaimSynthesisDispositionStatusSchema,
|
|
7609
|
-
reason:
|
|
7610
|
-
decided_by:
|
|
7611
|
-
authorized_by:
|
|
7612
|
-
source:
|
|
7613
|
-
created_at:
|
|
7665
|
+
reason: z15.string().min(4),
|
|
7666
|
+
decided_by: z15.string().min(1),
|
|
7667
|
+
authorized_by: z15.string().min(1),
|
|
7668
|
+
source: z15.string().min(1),
|
|
7669
|
+
created_at: z15.string().min(1)
|
|
7614
7670
|
});
|
|
7615
7671
|
}
|
|
7616
7672
|
});
|
|
@@ -7941,91 +7997,91 @@ var init_derive = __esm({
|
|
|
7941
7997
|
});
|
|
7942
7998
|
|
|
7943
7999
|
// src/cowork/schema.ts
|
|
7944
|
-
import { z as
|
|
8000
|
+
import { z as z16 } from "zod";
|
|
7945
8001
|
var HandoffModeSchema, IndexStatusSchema, ProvenanceSummarySchema, SectionStateSchema, WaiverEntrySchema, GateVerdictEntrySchema, ReviewDecisionCountSchema, CoworkHandoffPayloadSchema;
|
|
7946
8002
|
var init_schema13 = __esm({
|
|
7947
8003
|
"src/cowork/schema.ts"() {
|
|
7948
8004
|
"use strict";
|
|
7949
|
-
HandoffModeSchema =
|
|
8005
|
+
HandoffModeSchema = z16.enum([
|
|
7950
8006
|
"repair_required",
|
|
7951
8007
|
"synthesis_ready",
|
|
7952
8008
|
"human_review_required"
|
|
7953
8009
|
]);
|
|
7954
|
-
IndexStatusSchema =
|
|
7955
|
-
ProvenanceSummarySchema =
|
|
7956
|
-
accepted_count:
|
|
7957
|
-
rejected_count:
|
|
7958
|
-
triage_parked_count:
|
|
7959
|
-
needs_review_undispositioned_count:
|
|
7960
|
-
dispositioned_count:
|
|
7961
|
-
dispositioned_breakdown:
|
|
7962
|
-
parked_not_for_synthesis:
|
|
7963
|
-
preserved_for_human_note:
|
|
7964
|
-
needs_human_review_excluded:
|
|
7965
|
-
out_of_bounds_regression_fixture:
|
|
8010
|
+
IndexStatusSchema = z16.enum(["present", "missing"]);
|
|
8011
|
+
ProvenanceSummarySchema = z16.object({
|
|
8012
|
+
accepted_count: z16.number().int().nonnegative(),
|
|
8013
|
+
rejected_count: z16.number().int().nonnegative(),
|
|
8014
|
+
triage_parked_count: z16.number().int().nonnegative(),
|
|
8015
|
+
needs_review_undispositioned_count: z16.number().int().nonnegative(),
|
|
8016
|
+
dispositioned_count: z16.number().int().nonnegative(),
|
|
8017
|
+
dispositioned_breakdown: z16.object({
|
|
8018
|
+
parked_not_for_synthesis: z16.number().int().nonnegative(),
|
|
8019
|
+
preserved_for_human_note: z16.number().int().nonnegative(),
|
|
8020
|
+
needs_human_review_excluded: z16.number().int().nonnegative(),
|
|
8021
|
+
out_of_bounds_regression_fixture: z16.number().int().nonnegative()
|
|
7966
8022
|
}),
|
|
7967
|
-
active_repair_blockers:
|
|
7968
|
-
active_unresolved_contradictions:
|
|
7969
|
-
waivers_active:
|
|
7970
|
-
overrides_applied_count:
|
|
7971
|
-
});
|
|
7972
|
-
SectionStateSchema =
|
|
7973
|
-
section_id:
|
|
7974
|
-
purpose:
|
|
7975
|
-
status:
|
|
7976
|
-
has_gate_run:
|
|
7977
|
-
has_review_run:
|
|
7978
|
-
gate_verdict:
|
|
7979
|
-
synthesis_eligible:
|
|
7980
|
-
accepted_claim_ids:
|
|
7981
|
-
repair_claim_ids:
|
|
7982
|
-
rejected_claim_ids:
|
|
7983
|
-
dispositioned_claim_ids:
|
|
7984
|
-
candidate_claims_total:
|
|
7985
|
-
unresolved_contradiction_ids:
|
|
7986
|
-
blocking_reasons:
|
|
7987
|
-
active_blockers:
|
|
7988
|
-
blocking_contradictions_unresolved:
|
|
8023
|
+
active_repair_blockers: z16.number().int().nonnegative(),
|
|
8024
|
+
active_unresolved_contradictions: z16.number().int().nonnegative(),
|
|
8025
|
+
waivers_active: z16.array(z16.string()),
|
|
8026
|
+
overrides_applied_count: z16.number().int().nonnegative()
|
|
8027
|
+
});
|
|
8028
|
+
SectionStateSchema = z16.object({
|
|
8029
|
+
section_id: z16.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
8030
|
+
purpose: z16.string(),
|
|
8031
|
+
status: z16.string(),
|
|
8032
|
+
has_gate_run: z16.boolean(),
|
|
8033
|
+
has_review_run: z16.boolean(),
|
|
8034
|
+
gate_verdict: z16.string().nullable(),
|
|
8035
|
+
synthesis_eligible: z16.boolean(),
|
|
8036
|
+
accepted_claim_ids: z16.array(z16.string()),
|
|
8037
|
+
repair_claim_ids: z16.array(z16.string()),
|
|
8038
|
+
rejected_claim_ids: z16.array(z16.string()),
|
|
8039
|
+
dispositioned_claim_ids: z16.array(z16.string()).default([]),
|
|
8040
|
+
candidate_claims_total: z16.number().int().nonnegative(),
|
|
8041
|
+
unresolved_contradiction_ids: z16.array(z16.string()),
|
|
8042
|
+
blocking_reasons: z16.array(z16.string()),
|
|
8043
|
+
active_blockers: z16.array(z16.string()).default([]),
|
|
8044
|
+
blocking_contradictions_unresolved: z16.number().int().nonnegative(),
|
|
7989
8045
|
provenance_summary: ProvenanceSummarySchema.optional()
|
|
7990
8046
|
});
|
|
7991
|
-
WaiverEntrySchema =
|
|
7992
|
-
scope:
|
|
7993
|
-
family:
|
|
7994
|
-
reason:
|
|
7995
|
-
compensating_controls:
|
|
7996
|
-
applied_to:
|
|
7997
|
-
});
|
|
7998
|
-
GateVerdictEntrySchema =
|
|
7999
|
-
section_id:
|
|
8000
|
-
verdict:
|
|
8001
|
-
synthesis_eligible:
|
|
8002
|
-
});
|
|
8003
|
-
ReviewDecisionCountSchema =
|
|
8004
|
-
section_id:
|
|
8005
|
-
decision:
|
|
8006
|
-
count:
|
|
8007
|
-
});
|
|
8008
|
-
CoworkHandoffPayloadSchema =
|
|
8009
|
-
pack_id:
|
|
8010
|
-
pack_topic:
|
|
8011
|
-
generated_at:
|
|
8047
|
+
WaiverEntrySchema = z16.object({
|
|
8048
|
+
scope: z16.enum(["pack", "gate"]),
|
|
8049
|
+
family: z16.string(),
|
|
8050
|
+
reason: z16.string(),
|
|
8051
|
+
compensating_controls: z16.array(z16.string()),
|
|
8052
|
+
applied_to: z16.string()
|
|
8053
|
+
});
|
|
8054
|
+
GateVerdictEntrySchema = z16.object({
|
|
8055
|
+
section_id: z16.string(),
|
|
8056
|
+
verdict: z16.string(),
|
|
8057
|
+
synthesis_eligible: z16.boolean()
|
|
8058
|
+
});
|
|
8059
|
+
ReviewDecisionCountSchema = z16.object({
|
|
8060
|
+
section_id: z16.string(),
|
|
8061
|
+
decision: z16.string(),
|
|
8062
|
+
count: z16.number().int().nonnegative()
|
|
8063
|
+
});
|
|
8064
|
+
CoworkHandoffPayloadSchema = z16.object({
|
|
8065
|
+
pack_id: z16.string(),
|
|
8066
|
+
pack_topic: z16.string(),
|
|
8067
|
+
generated_at: z16.string(),
|
|
8012
8068
|
mode: HandoffModeSchema,
|
|
8013
|
-
synthesis_allowed:
|
|
8014
|
-
summary:
|
|
8015
|
-
sections:
|
|
8016
|
-
accepted_claim_ids:
|
|
8017
|
-
repair_claim_ids:
|
|
8018
|
-
blocked_claim_ids:
|
|
8019
|
-
dispositioned_claim_ids:
|
|
8020
|
-
unresolved_contradiction_ids:
|
|
8021
|
-
waivers:
|
|
8022
|
-
gate_verdicts:
|
|
8023
|
-
review_decisions:
|
|
8024
|
-
recommended_next_actions:
|
|
8025
|
-
allowed_write_paths:
|
|
8026
|
-
forbidden_actions:
|
|
8069
|
+
synthesis_allowed: z16.boolean(),
|
|
8070
|
+
summary: z16.string(),
|
|
8071
|
+
sections: z16.array(SectionStateSchema),
|
|
8072
|
+
accepted_claim_ids: z16.array(z16.string()),
|
|
8073
|
+
repair_claim_ids: z16.array(z16.string()),
|
|
8074
|
+
blocked_claim_ids: z16.array(z16.string()),
|
|
8075
|
+
dispositioned_claim_ids: z16.array(z16.string()).default([]),
|
|
8076
|
+
unresolved_contradiction_ids: z16.array(z16.string()),
|
|
8077
|
+
waivers: z16.array(WaiverEntrySchema),
|
|
8078
|
+
gate_verdicts: z16.array(GateVerdictEntrySchema),
|
|
8079
|
+
review_decisions: z16.array(ReviewDecisionCountSchema),
|
|
8080
|
+
recommended_next_actions: z16.array(z16.string()),
|
|
8081
|
+
allowed_write_paths: z16.array(z16.string()),
|
|
8082
|
+
forbidden_actions: z16.array(z16.string()),
|
|
8027
8083
|
index_status: IndexStatusSchema,
|
|
8028
|
-
warnings:
|
|
8084
|
+
warnings: z16.array(z16.string())
|
|
8029
8085
|
});
|
|
8030
8086
|
}
|
|
8031
8087
|
});
|
|
@@ -8575,86 +8631,86 @@ var init_derive2 = __esm({
|
|
|
8575
8631
|
});
|
|
8576
8632
|
|
|
8577
8633
|
// src/synth/schema.ts
|
|
8578
|
-
import { z as
|
|
8634
|
+
import { z as z17 } from "zod";
|
|
8579
8635
|
var SectionAcceptedSummarySchema, ClaimClusterSchema, SharedSourceSchema, ScopeOverlapSchema, CrossSectionContradictionRefSchema, WaiverDependencySchema, AllowedSynthesisInputSchema, ForbiddenInputSchema, CrossSectionMapSchema;
|
|
8580
8636
|
var init_schema14 = __esm({
|
|
8581
8637
|
"src/synth/schema.ts"() {
|
|
8582
8638
|
"use strict";
|
|
8583
|
-
SectionAcceptedSummarySchema =
|
|
8584
|
-
section_id:
|
|
8585
|
-
purpose:
|
|
8586
|
-
status:
|
|
8587
|
-
accepted_claim_ids:
|
|
8588
|
-
excluded_reason:
|
|
8589
|
-
});
|
|
8590
|
-
ClaimClusterSchema = z16.object({
|
|
8591
|
-
cluster_id: z16.string(),
|
|
8592
|
-
shared_source_ids: z16.array(z16.string()),
|
|
8593
|
-
member_claim_ids: z16.array(z16.string()).min(1),
|
|
8594
|
-
spans_sections: z16.array(z16.string())
|
|
8595
|
-
});
|
|
8596
|
-
SharedSourceSchema = z16.object({
|
|
8597
|
-
source_id: z16.string(),
|
|
8598
|
-
publisher: z16.string().nullable(),
|
|
8599
|
-
source_type: z16.string(),
|
|
8600
|
-
used_by_claim_ids: z16.array(z16.string()),
|
|
8601
|
-
spans_sections: z16.array(z16.string())
|
|
8602
|
-
});
|
|
8603
|
-
ScopeOverlapSchema = z16.object({
|
|
8604
|
-
claim_a: z16.string(),
|
|
8605
|
-
claim_b: z16.string(),
|
|
8606
|
-
scope_a: z16.string().nullable(),
|
|
8607
|
-
scope_b: z16.string().nullable(),
|
|
8608
|
-
jaccard: z16.number().min(0).max(1),
|
|
8609
|
-
cross_section: z16.boolean(),
|
|
8610
|
-
warning: z16.string()
|
|
8611
|
-
});
|
|
8612
|
-
CrossSectionContradictionRefSchema = z16.object({
|
|
8613
|
-
contradiction_id: z16.string(),
|
|
8614
|
-
claim_ids: z16.array(z16.string()),
|
|
8615
|
-
sections: z16.array(z16.string()),
|
|
8616
|
-
type: z16.string(),
|
|
8617
|
-
severity: z16.string(),
|
|
8618
|
-
status: z16.string()
|
|
8619
|
-
});
|
|
8620
|
-
WaiverDependencySchema = z16.object({
|
|
8621
|
-
scope: z16.enum(["pack", "gate"]),
|
|
8622
|
-
family: z16.string(),
|
|
8623
|
-
reason: z16.string(),
|
|
8624
|
-
compensating_controls: z16.array(z16.string()),
|
|
8625
|
-
applied_to: z16.string(),
|
|
8626
|
-
must_disclose_in: z16.enum(["decision-brief.md", "final-report.md", "both"])
|
|
8639
|
+
SectionAcceptedSummarySchema = z17.object({
|
|
8640
|
+
section_id: z17.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
8641
|
+
purpose: z17.string(),
|
|
8642
|
+
status: z17.string(),
|
|
8643
|
+
accepted_claim_ids: z17.array(z17.string()),
|
|
8644
|
+
excluded_reason: z17.string().nullable()
|
|
8627
8645
|
});
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
scope: z16.string().nullable(),
|
|
8634
|
-
not: z16.string().nullable(),
|
|
8635
|
-
source_ids: z16.array(z16.string())
|
|
8636
|
-
});
|
|
8637
|
-
ForbiddenInputSchema = z16.object({
|
|
8638
|
-
claim_id: z16.string(),
|
|
8639
|
-
section_id: z16.string(),
|
|
8640
|
-
decision: z16.string(),
|
|
8641
|
-
reason: z16.string()
|
|
8646
|
+
ClaimClusterSchema = z17.object({
|
|
8647
|
+
cluster_id: z17.string(),
|
|
8648
|
+
shared_source_ids: z17.array(z17.string()),
|
|
8649
|
+
member_claim_ids: z17.array(z17.string()).min(1),
|
|
8650
|
+
spans_sections: z17.array(z17.string())
|
|
8642
8651
|
});
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8652
|
+
SharedSourceSchema = z17.object({
|
|
8653
|
+
source_id: z17.string(),
|
|
8654
|
+
publisher: z17.string().nullable(),
|
|
8655
|
+
source_type: z17.string(),
|
|
8656
|
+
used_by_claim_ids: z17.array(z17.string()),
|
|
8657
|
+
spans_sections: z17.array(z17.string())
|
|
8658
|
+
});
|
|
8659
|
+
ScopeOverlapSchema = z17.object({
|
|
8660
|
+
claim_a: z17.string(),
|
|
8661
|
+
claim_b: z17.string(),
|
|
8662
|
+
scope_a: z17.string().nullable(),
|
|
8663
|
+
scope_b: z17.string().nullable(),
|
|
8664
|
+
jaccard: z17.number().min(0).max(1),
|
|
8665
|
+
cross_section: z17.boolean(),
|
|
8666
|
+
warning: z17.string()
|
|
8667
|
+
});
|
|
8668
|
+
CrossSectionContradictionRefSchema = z17.object({
|
|
8669
|
+
contradiction_id: z17.string(),
|
|
8670
|
+
claim_ids: z17.array(z17.string()),
|
|
8671
|
+
sections: z17.array(z17.string()),
|
|
8672
|
+
type: z17.string(),
|
|
8673
|
+
severity: z17.string(),
|
|
8674
|
+
status: z17.string()
|
|
8675
|
+
});
|
|
8676
|
+
WaiverDependencySchema = z17.object({
|
|
8677
|
+
scope: z17.enum(["pack", "gate"]),
|
|
8678
|
+
family: z17.string(),
|
|
8679
|
+
reason: z17.string(),
|
|
8680
|
+
compensating_controls: z17.array(z17.string()),
|
|
8681
|
+
applied_to: z17.string(),
|
|
8682
|
+
must_disclose_in: z17.enum(["decision-brief.md", "final-report.md", "both"])
|
|
8683
|
+
});
|
|
8684
|
+
AllowedSynthesisInputSchema = z17.object({
|
|
8685
|
+
claim_id: z17.string(),
|
|
8686
|
+
section_id: z17.string(),
|
|
8687
|
+
artifact_path: z17.string(),
|
|
8688
|
+
asserts: z17.string(),
|
|
8689
|
+
scope: z17.string().nullable(),
|
|
8690
|
+
not: z17.string().nullable(),
|
|
8691
|
+
source_ids: z17.array(z17.string())
|
|
8692
|
+
});
|
|
8693
|
+
ForbiddenInputSchema = z17.object({
|
|
8694
|
+
claim_id: z17.string(),
|
|
8695
|
+
section_id: z17.string(),
|
|
8696
|
+
decision: z17.string(),
|
|
8697
|
+
reason: z17.string()
|
|
8698
|
+
});
|
|
8699
|
+
CrossSectionMapSchema = z17.object({
|
|
8700
|
+
pack_id: z17.string(),
|
|
8701
|
+
pack_topic: z17.string(),
|
|
8702
|
+
pack_decision: z17.string(),
|
|
8703
|
+
generated_at: z17.string(),
|
|
8704
|
+
accepted_claim_ids: z17.array(z17.string()),
|
|
8705
|
+
sections: z17.array(SectionAcceptedSummarySchema),
|
|
8706
|
+
claim_clusters: z17.array(ClaimClusterSchema),
|
|
8707
|
+
shared_sources: z17.array(SharedSourceSchema),
|
|
8708
|
+
scope_overlaps: z17.array(ScopeOverlapSchema),
|
|
8709
|
+
cross_section_contradictions: z17.array(CrossSectionContradictionRefSchema),
|
|
8710
|
+
waiver_dependencies: z17.array(WaiverDependencySchema),
|
|
8711
|
+
open_questions: z17.array(z17.string()),
|
|
8712
|
+
allowed_synthesis_inputs: z17.array(AllowedSynthesisInputSchema),
|
|
8713
|
+
forbidden_inputs: z17.array(ForbiddenInputSchema)
|
|
8658
8714
|
});
|
|
8659
8715
|
}
|
|
8660
8716
|
});
|
|
@@ -9822,179 +9878,179 @@ var init_aggregate = __esm({
|
|
|
9822
9878
|
});
|
|
9823
9879
|
|
|
9824
9880
|
// src/audit/schema.ts
|
|
9825
|
-
import { z as
|
|
9881
|
+
import { z as z18 } from "zod";
|
|
9826
9882
|
var PackVerdictSchema, HandoffModeSchema2, OrphanClaimRowSchema, StaleSourceRowSchema, WeakSourceRowSchema, UnresolvedContradictionRowSchema, ScopeWideningRiskRowSchema, SourceDiversityGapRowSchema, SynthesisReadinessRowSchema, PackAuditPayloadSchema;
|
|
9827
9883
|
var init_schema15 = __esm({
|
|
9828
9884
|
"src/audit/schema.ts"() {
|
|
9829
9885
|
"use strict";
|
|
9830
|
-
PackVerdictSchema =
|
|
9886
|
+
PackVerdictSchema = z18.enum([
|
|
9831
9887
|
"ready_for_synthesis",
|
|
9832
9888
|
"repair_required",
|
|
9833
9889
|
"human_review_required",
|
|
9834
9890
|
"blocked"
|
|
9835
9891
|
]);
|
|
9836
|
-
HandoffModeSchema2 =
|
|
9892
|
+
HandoffModeSchema2 = z18.enum([
|
|
9837
9893
|
"repair_required",
|
|
9838
9894
|
"synthesis_ready",
|
|
9839
9895
|
"human_review_required",
|
|
9840
9896
|
"unknown"
|
|
9841
9897
|
]);
|
|
9842
|
-
OrphanClaimRowSchema =
|
|
9843
|
-
claim_id:
|
|
9844
|
-
section_id:
|
|
9845
|
-
reason:
|
|
9898
|
+
OrphanClaimRowSchema = z18.object({
|
|
9899
|
+
claim_id: z18.string(),
|
|
9900
|
+
section_id: z18.string(),
|
|
9901
|
+
reason: z18.enum([
|
|
9846
9902
|
"missing_source_card",
|
|
9847
9903
|
"missing_source_hash",
|
|
9848
9904
|
"missing_evidence_excerpt",
|
|
9849
9905
|
"unresolvable_source_id"
|
|
9850
9906
|
]),
|
|
9851
|
-
details:
|
|
9852
|
-
artifact_path:
|
|
9853
|
-
});
|
|
9854
|
-
StaleSourceRowSchema =
|
|
9855
|
-
source_id:
|
|
9856
|
-
section_id:
|
|
9857
|
-
publisher:
|
|
9858
|
-
reason:
|
|
9859
|
-
details:
|
|
9860
|
-
artifact_path:
|
|
9861
|
-
policy:
|
|
9862
|
-
required:
|
|
9863
|
-
max_source_age_months:
|
|
9864
|
-
stale_source_policy:
|
|
9907
|
+
details: z18.string(),
|
|
9908
|
+
artifact_path: z18.string()
|
|
9909
|
+
});
|
|
9910
|
+
StaleSourceRowSchema = z18.object({
|
|
9911
|
+
source_id: z18.string(),
|
|
9912
|
+
section_id: z18.string(),
|
|
9913
|
+
publisher: z18.string().nullable(),
|
|
9914
|
+
reason: z18.enum(["too_old", "missing_date", "unparseable_date"]),
|
|
9915
|
+
details: z18.string(),
|
|
9916
|
+
artifact_path: z18.string(),
|
|
9917
|
+
policy: z18.object({
|
|
9918
|
+
required: z18.boolean(),
|
|
9919
|
+
max_source_age_months: z18.number().int().nullable(),
|
|
9920
|
+
stale_source_policy: z18.enum(["warn", "fail"])
|
|
9865
9921
|
})
|
|
9866
9922
|
});
|
|
9867
|
-
WeakSourceRowSchema =
|
|
9868
|
-
reason:
|
|
9923
|
+
WeakSourceRowSchema = z18.object({
|
|
9924
|
+
reason: z18.enum([
|
|
9869
9925
|
"source_cluster_monopoly",
|
|
9870
9926
|
"low_independent_publishers",
|
|
9871
9927
|
"missing_primary_source",
|
|
9872
9928
|
"excessive_type_imbalance",
|
|
9873
9929
|
"failed_fetches_reducing_floor"
|
|
9874
9930
|
]),
|
|
9875
|
-
section_id:
|
|
9876
|
-
details:
|
|
9877
|
-
evidence_ids:
|
|
9878
|
-
artifact_path:
|
|
9879
|
-
});
|
|
9880
|
-
UnresolvedContradictionRowSchema =
|
|
9881
|
-
contradiction_id:
|
|
9882
|
-
section_id:
|
|
9883
|
-
type:
|
|
9884
|
-
severity:
|
|
9885
|
-
status:
|
|
9886
|
-
claim_ids:
|
|
9887
|
-
artifact_path:
|
|
9888
|
-
});
|
|
9889
|
-
ScopeWideningRiskRowSchema =
|
|
9890
|
-
reason:
|
|
9931
|
+
section_id: z18.string(),
|
|
9932
|
+
details: z18.string(),
|
|
9933
|
+
evidence_ids: z18.array(z18.string()),
|
|
9934
|
+
artifact_path: z18.string()
|
|
9935
|
+
});
|
|
9936
|
+
UnresolvedContradictionRowSchema = z18.object({
|
|
9937
|
+
contradiction_id: z18.string(),
|
|
9938
|
+
section_id: z18.string(),
|
|
9939
|
+
type: z18.string(),
|
|
9940
|
+
severity: z18.string(),
|
|
9941
|
+
status: z18.string(),
|
|
9942
|
+
claim_ids: z18.array(z18.string()),
|
|
9943
|
+
artifact_path: z18.string()
|
|
9944
|
+
});
|
|
9945
|
+
ScopeWideningRiskRowSchema = z18.object({
|
|
9946
|
+
reason: z18.enum([
|
|
9891
9947
|
"overgeneralization_finding",
|
|
9892
9948
|
"scope_null_in_use",
|
|
9893
9949
|
"missing_not_flagged",
|
|
9894
9950
|
"contextual_to_universal_risk"
|
|
9895
9951
|
]),
|
|
9896
|
-
claim_id:
|
|
9897
|
-
section_id:
|
|
9898
|
-
details:
|
|
9899
|
-
artifact_path:
|
|
9952
|
+
claim_id: z18.string(),
|
|
9953
|
+
section_id: z18.string(),
|
|
9954
|
+
details: z18.string(),
|
|
9955
|
+
artifact_path: z18.string()
|
|
9900
9956
|
});
|
|
9901
|
-
SourceDiversityGapRowSchema =
|
|
9902
|
-
reason:
|
|
9957
|
+
SourceDiversityGapRowSchema = z18.object({
|
|
9958
|
+
reason: z18.enum([
|
|
9903
9959
|
"section_publisher_monopoly",
|
|
9904
9960
|
"low_section_publisher_count",
|
|
9905
9961
|
"cross_section_publisher_overlap",
|
|
9906
9962
|
"section_has_no_sources"
|
|
9907
9963
|
]),
|
|
9908
|
-
section_id:
|
|
9909
|
-
details:
|
|
9910
|
-
evidence_ids:
|
|
9911
|
-
});
|
|
9912
|
-
SynthesisReadinessRowSchema =
|
|
9913
|
-
section_id:
|
|
9914
|
-
purpose:
|
|
9915
|
-
status:
|
|
9916
|
-
has_gate_run:
|
|
9917
|
-
has_review_run:
|
|
9918
|
-
gate_verdict:
|
|
9919
|
-
synthesis_eligible:
|
|
9920
|
-
candidate_claims:
|
|
9921
|
-
accepted_claims:
|
|
9922
|
-
repair_claims:
|
|
9923
|
-
rejected_claims:
|
|
9924
|
-
dispositioned_claims:
|
|
9925
|
-
blocking_reasons:
|
|
9964
|
+
section_id: z18.string(),
|
|
9965
|
+
details: z18.string(),
|
|
9966
|
+
evidence_ids: z18.array(z18.string())
|
|
9967
|
+
});
|
|
9968
|
+
SynthesisReadinessRowSchema = z18.object({
|
|
9969
|
+
section_id: z18.string(),
|
|
9970
|
+
purpose: z18.string(),
|
|
9971
|
+
status: z18.string(),
|
|
9972
|
+
has_gate_run: z18.boolean(),
|
|
9973
|
+
has_review_run: z18.boolean(),
|
|
9974
|
+
gate_verdict: z18.string().nullable(),
|
|
9975
|
+
synthesis_eligible: z18.boolean(),
|
|
9976
|
+
candidate_claims: z18.number().int().nonnegative(),
|
|
9977
|
+
accepted_claims: z18.number().int().nonnegative(),
|
|
9978
|
+
repair_claims: z18.number().int().nonnegative(),
|
|
9979
|
+
rejected_claims: z18.number().int().nonnegative(),
|
|
9980
|
+
dispositioned_claims: z18.number().int().nonnegative(),
|
|
9981
|
+
blocking_reasons: z18.array(z18.string()),
|
|
9926
9982
|
cowork_handoff_mode: HandoffModeSchema2,
|
|
9927
|
-
workspace_allowed:
|
|
9983
|
+
workspace_allowed: z18.boolean()
|
|
9928
9984
|
});
|
|
9929
|
-
PackAuditPayloadSchema =
|
|
9930
|
-
pack_id:
|
|
9931
|
-
pack_topic:
|
|
9932
|
-
generated_at:
|
|
9985
|
+
PackAuditPayloadSchema = z18.object({
|
|
9986
|
+
pack_id: z18.string(),
|
|
9987
|
+
pack_topic: z18.string(),
|
|
9988
|
+
generated_at: z18.string(),
|
|
9933
9989
|
verdict: PackVerdictSchema,
|
|
9934
|
-
synthesis_allowed:
|
|
9935
|
-
section_summaries:
|
|
9936
|
-
claim_summary:
|
|
9937
|
-
total:
|
|
9938
|
-
candidate:
|
|
9939
|
-
accepted_for_synthesis:
|
|
9940
|
-
rejected:
|
|
9941
|
-
needs_repair:
|
|
9942
|
-
dispositioned:
|
|
9943
|
-
no_review:
|
|
9944
|
-
with_evidence_excerpt:
|
|
9945
|
-
with_source_hashes:
|
|
9946
|
-
scope_null:
|
|
9947
|
-
not_null:
|
|
9948
|
-
orphans:
|
|
9990
|
+
synthesis_allowed: z18.boolean(),
|
|
9991
|
+
section_summaries: z18.array(SynthesisReadinessRowSchema),
|
|
9992
|
+
claim_summary: z18.object({
|
|
9993
|
+
total: z18.number().int().nonnegative(),
|
|
9994
|
+
candidate: z18.number().int().nonnegative(),
|
|
9995
|
+
accepted_for_synthesis: z18.number().int().nonnegative(),
|
|
9996
|
+
rejected: z18.number().int().nonnegative(),
|
|
9997
|
+
needs_repair: z18.number().int().nonnegative(),
|
|
9998
|
+
dispositioned: z18.number().int().nonnegative(),
|
|
9999
|
+
no_review: z18.number().int().nonnegative(),
|
|
10000
|
+
with_evidence_excerpt: z18.number().int().nonnegative(),
|
|
10001
|
+
with_source_hashes: z18.number().int().nonnegative(),
|
|
10002
|
+
scope_null: z18.number().int().nonnegative(),
|
|
10003
|
+
not_null: z18.number().int().nonnegative(),
|
|
10004
|
+
orphans: z18.number().int().nonnegative()
|
|
9949
10005
|
}),
|
|
9950
|
-
source_summary:
|
|
9951
|
-
total:
|
|
9952
|
-
primary:
|
|
9953
|
-
secondary:
|
|
9954
|
-
forum:
|
|
9955
|
-
benchmark:
|
|
9956
|
-
docs:
|
|
9957
|
-
unknown:
|
|
9958
|
-
independent_publishers:
|
|
9959
|
-
failed_fetches:
|
|
9960
|
-
sections_with_sources:
|
|
9961
|
-
sections_without_sources:
|
|
10006
|
+
source_summary: z18.object({
|
|
10007
|
+
total: z18.number().int().nonnegative(),
|
|
10008
|
+
primary: z18.number().int().nonnegative(),
|
|
10009
|
+
secondary: z18.number().int().nonnegative(),
|
|
10010
|
+
forum: z18.number().int().nonnegative(),
|
|
10011
|
+
benchmark: z18.number().int().nonnegative(),
|
|
10012
|
+
docs: z18.number().int().nonnegative(),
|
|
10013
|
+
unknown: z18.number().int().nonnegative(),
|
|
10014
|
+
independent_publishers: z18.number().int().nonnegative(),
|
|
10015
|
+
failed_fetches: z18.number().int().nonnegative(),
|
|
10016
|
+
sections_with_sources: z18.number().int().nonnegative(),
|
|
10017
|
+
sections_without_sources: z18.number().int().nonnegative()
|
|
9962
10018
|
}),
|
|
9963
|
-
contradiction_summary:
|
|
9964
|
-
total:
|
|
9965
|
-
unresolved:
|
|
9966
|
-
blocking:
|
|
9967
|
-
reconciled:
|
|
9968
|
-
preserved_deliberately:
|
|
9969
|
-
rejected:
|
|
9970
|
-
by_type:
|
|
9971
|
-
sections_with_clean_ledger:
|
|
10019
|
+
contradiction_summary: z18.object({
|
|
10020
|
+
total: z18.number().int().nonnegative(),
|
|
10021
|
+
unresolved: z18.number().int().nonnegative(),
|
|
10022
|
+
blocking: z18.number().int().nonnegative(),
|
|
10023
|
+
reconciled: z18.number().int().nonnegative(),
|
|
10024
|
+
preserved_deliberately: z18.number().int().nonnegative(),
|
|
10025
|
+
rejected: z18.number().int().nonnegative(),
|
|
10026
|
+
by_type: z18.record(z18.string(), z18.number().int().nonnegative()),
|
|
10027
|
+
sections_with_clean_ledger: z18.number().int().nonnegative()
|
|
9972
10028
|
}),
|
|
9973
|
-
review_summary:
|
|
9974
|
-
sections_with_review_run:
|
|
9975
|
-
sections_without_review_run:
|
|
9976
|
-
decision_counts:
|
|
9977
|
-
blocking_findings:
|
|
10029
|
+
review_summary: z18.object({
|
|
10030
|
+
sections_with_review_run: z18.number().int().nonnegative(),
|
|
10031
|
+
sections_without_review_run: z18.number().int().nonnegative(),
|
|
10032
|
+
decision_counts: z18.record(z18.string(), z18.number().int().nonnegative()),
|
|
10033
|
+
blocking_findings: z18.number().int().nonnegative()
|
|
9978
10034
|
}),
|
|
9979
|
-
waiver_summary:
|
|
9980
|
-
total:
|
|
9981
|
-
invalid:
|
|
9982
|
-
by_family:
|
|
10035
|
+
waiver_summary: z18.object({
|
|
10036
|
+
total: z18.number().int().nonnegative(),
|
|
10037
|
+
invalid: z18.number().int().nonnegative(),
|
|
10038
|
+
by_family: z18.record(z18.string(), z18.number().int().nonnegative())
|
|
9983
10039
|
}),
|
|
9984
|
-
readiness_summary:
|
|
9985
|
-
total_sections:
|
|
9986
|
-
ready_sections:
|
|
9987
|
-
repair_sections:
|
|
9988
|
-
blocked_sections:
|
|
9989
|
-
no_gate_sections:
|
|
9990
|
-
no_review_sections:
|
|
10040
|
+
readiness_summary: z18.object({
|
|
10041
|
+
total_sections: z18.number().int().nonnegative(),
|
|
10042
|
+
ready_sections: z18.number().int().nonnegative(),
|
|
10043
|
+
repair_sections: z18.number().int().nonnegative(),
|
|
10044
|
+
blocked_sections: z18.number().int().nonnegative(),
|
|
10045
|
+
no_gate_sections: z18.number().int().nonnegative(),
|
|
10046
|
+
no_review_sections: z18.number().int().nonnegative(),
|
|
9991
10047
|
cowork_handoff_mode: HandoffModeSchema2,
|
|
9992
|
-
workspace_allowed:
|
|
10048
|
+
workspace_allowed: z18.boolean()
|
|
9993
10049
|
}),
|
|
9994
|
-
audit_files:
|
|
9995
|
-
blocking_reasons:
|
|
9996
|
-
warnings:
|
|
9997
|
-
next_actions:
|
|
10050
|
+
audit_files: z18.array(z18.string()),
|
|
10051
|
+
blocking_reasons: z18.array(z18.string()),
|
|
10052
|
+
warnings: z18.array(z18.string()),
|
|
10053
|
+
next_actions: z18.array(z18.string())
|
|
9998
10054
|
});
|
|
9999
10055
|
}
|
|
10000
10056
|
});
|
|
@@ -10661,79 +10717,79 @@ var init_markdown7 = __esm({
|
|
|
10661
10717
|
});
|
|
10662
10718
|
|
|
10663
10719
|
// src/freeze/schema.ts
|
|
10664
|
-
import { z as
|
|
10720
|
+
import { z as z19 } from "zod";
|
|
10665
10721
|
var ArtifactHashSchema, IntegrityCheckSchema, FreezeReceiptPayloadSchema, FreezeRefusalPayloadSchema;
|
|
10666
10722
|
var init_schema16 = __esm({
|
|
10667
10723
|
"src/freeze/schema.ts"() {
|
|
10668
10724
|
"use strict";
|
|
10669
|
-
ArtifactHashSchema =
|
|
10670
|
-
path:
|
|
10671
|
-
sha256:
|
|
10672
|
-
bytes:
|
|
10673
|
-
});
|
|
10674
|
-
IntegrityCheckSchema =
|
|
10675
|
-
name:
|
|
10676
|
-
passed:
|
|
10677
|
-
detail:
|
|
10678
|
-
});
|
|
10679
|
-
FreezeReceiptPayloadSchema =
|
|
10680
|
-
pack_id:
|
|
10681
|
-
pack_topic:
|
|
10682
|
-
frozen_at:
|
|
10683
|
-
verdict:
|
|
10684
|
-
pack_audit_hash:
|
|
10685
|
-
handoff_hash:
|
|
10686
|
-
synthesis_hashes:
|
|
10687
|
-
canonical_artifact_hashes:
|
|
10688
|
-
accepted_claim_ids:
|
|
10689
|
-
cited_claim_ids:
|
|
10690
|
-
uncited_accepted_claim_ids:
|
|
10691
|
-
unresolved_contradictions:
|
|
10692
|
-
|
|
10693
|
-
contradiction_id:
|
|
10694
|
-
section_id:
|
|
10695
|
-
type:
|
|
10696
|
-
severity:
|
|
10697
|
-
status:
|
|
10698
|
-
disclosed_in:
|
|
10725
|
+
ArtifactHashSchema = z19.object({
|
|
10726
|
+
path: z19.string(),
|
|
10727
|
+
sha256: z19.string().regex(/^[a-f0-9]{64}$/),
|
|
10728
|
+
bytes: z19.number().int().nonnegative()
|
|
10729
|
+
});
|
|
10730
|
+
IntegrityCheckSchema = z19.object({
|
|
10731
|
+
name: z19.string().min(1),
|
|
10732
|
+
passed: z19.boolean(),
|
|
10733
|
+
detail: z19.string()
|
|
10734
|
+
});
|
|
10735
|
+
FreezeReceiptPayloadSchema = z19.object({
|
|
10736
|
+
pack_id: z19.string(),
|
|
10737
|
+
pack_topic: z19.string(),
|
|
10738
|
+
frozen_at: z19.string(),
|
|
10739
|
+
verdict: z19.literal("frozen"),
|
|
10740
|
+
pack_audit_hash: z19.string().regex(/^[a-f0-9]{64}$/),
|
|
10741
|
+
handoff_hash: z19.string().regex(/^[a-f0-9]{64}$/),
|
|
10742
|
+
synthesis_hashes: z19.array(ArtifactHashSchema),
|
|
10743
|
+
canonical_artifact_hashes: z19.array(ArtifactHashSchema),
|
|
10744
|
+
accepted_claim_ids: z19.array(z19.string()),
|
|
10745
|
+
cited_claim_ids: z19.array(z19.string()),
|
|
10746
|
+
uncited_accepted_claim_ids: z19.array(z19.string()),
|
|
10747
|
+
unresolved_contradictions: z19.array(
|
|
10748
|
+
z19.object({
|
|
10749
|
+
contradiction_id: z19.string(),
|
|
10750
|
+
section_id: z19.string(),
|
|
10751
|
+
type: z19.string(),
|
|
10752
|
+
severity: z19.string(),
|
|
10753
|
+
status: z19.string(),
|
|
10754
|
+
disclosed_in: z19.array(z19.string())
|
|
10699
10755
|
})
|
|
10700
10756
|
),
|
|
10701
|
-
waivers_disclosed:
|
|
10702
|
-
|
|
10703
|
-
family:
|
|
10704
|
-
applied_to:
|
|
10705
|
-
reason:
|
|
10706
|
-
compensating_controls:
|
|
10707
|
-
disclosed_in:
|
|
10757
|
+
waivers_disclosed: z19.array(
|
|
10758
|
+
z19.object({
|
|
10759
|
+
family: z19.string(),
|
|
10760
|
+
applied_to: z19.string(),
|
|
10761
|
+
reason: z19.string(),
|
|
10762
|
+
compensating_controls: z19.array(z19.string()),
|
|
10763
|
+
disclosed_in: z19.array(z19.string())
|
|
10708
10764
|
})
|
|
10709
10765
|
),
|
|
10710
|
-
sections:
|
|
10711
|
-
|
|
10712
|
-
section_id:
|
|
10713
|
-
status:
|
|
10714
|
-
accepted_claims:
|
|
10715
|
-
sources:
|
|
10716
|
-
contradictions:
|
|
10766
|
+
sections: z19.array(
|
|
10767
|
+
z19.object({
|
|
10768
|
+
section_id: z19.string(),
|
|
10769
|
+
status: z19.string(),
|
|
10770
|
+
accepted_claims: z19.number().int().nonnegative(),
|
|
10771
|
+
sources: z19.number().int().nonnegative(),
|
|
10772
|
+
contradictions: z19.number().int().nonnegative()
|
|
10717
10773
|
})
|
|
10718
10774
|
),
|
|
10719
|
-
source_count:
|
|
10720
|
-
claim_count:
|
|
10721
|
-
contradiction_count:
|
|
10722
|
-
review_finding_count:
|
|
10723
|
-
gate_result_count:
|
|
10724
|
-
integrity_checks:
|
|
10725
|
-
});
|
|
10726
|
-
FreezeRefusalPayloadSchema =
|
|
10727
|
-
pack_id:
|
|
10728
|
-
pack_topic:
|
|
10729
|
-
checked_at:
|
|
10730
|
-
verdict:
|
|
10731
|
-
reasons:
|
|
10732
|
-
blocking_reasons:
|
|
10733
|
-
missing_artifacts:
|
|
10734
|
-
invalid_artifacts:
|
|
10735
|
-
next_actions:
|
|
10736
|
-
would_freeze:
|
|
10775
|
+
source_count: z19.number().int().nonnegative(),
|
|
10776
|
+
claim_count: z19.number().int().nonnegative(),
|
|
10777
|
+
contradiction_count: z19.number().int().nonnegative(),
|
|
10778
|
+
review_finding_count: z19.number().int().nonnegative(),
|
|
10779
|
+
gate_result_count: z19.number().int().nonnegative(),
|
|
10780
|
+
integrity_checks: z19.array(IntegrityCheckSchema)
|
|
10781
|
+
});
|
|
10782
|
+
FreezeRefusalPayloadSchema = z19.object({
|
|
10783
|
+
pack_id: z19.string(),
|
|
10784
|
+
pack_topic: z19.string(),
|
|
10785
|
+
checked_at: z19.string(),
|
|
10786
|
+
verdict: z19.literal("refused"),
|
|
10787
|
+
reasons: z19.array(z19.string()),
|
|
10788
|
+
blocking_reasons: z19.array(z19.string()),
|
|
10789
|
+
missing_artifacts: z19.array(z19.string()),
|
|
10790
|
+
invalid_artifacts: z19.array(z19.object({ path: z19.string(), error: z19.string() })),
|
|
10791
|
+
next_actions: z19.array(z19.string()),
|
|
10792
|
+
would_freeze: z19.literal(false)
|
|
10737
10793
|
});
|
|
10738
10794
|
}
|
|
10739
10795
|
});
|
|
@@ -11207,35 +11263,35 @@ var init_freeze = __esm({
|
|
|
11207
11263
|
});
|
|
11208
11264
|
|
|
11209
11265
|
// src/invalidate/schema.ts
|
|
11210
|
-
import { z as
|
|
11266
|
+
import { z as z20 } from "zod";
|
|
11211
11267
|
var ArchivedArtifactSchema, SectionStatusChangeSchema, InvalidationReceiptSchema;
|
|
11212
11268
|
var init_schema17 = __esm({
|
|
11213
11269
|
"src/invalidate/schema.ts"() {
|
|
11214
11270
|
"use strict";
|
|
11215
|
-
ArchivedArtifactSchema =
|
|
11216
|
-
src:
|
|
11271
|
+
ArchivedArtifactSchema = z20.object({
|
|
11272
|
+
src: z20.string(),
|
|
11217
11273
|
// path relative to packPath, before archival
|
|
11218
|
-
dst:
|
|
11274
|
+
dst: z20.string()
|
|
11219
11275
|
// path relative to packPath, after archival
|
|
11220
11276
|
});
|
|
11221
|
-
SectionStatusChangeSchema =
|
|
11222
|
-
section_id:
|
|
11223
|
-
before:
|
|
11224
|
-
after:
|
|
11277
|
+
SectionStatusChangeSchema = z20.object({
|
|
11278
|
+
section_id: z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
11279
|
+
before: z20.string(),
|
|
11280
|
+
after: z20.string()
|
|
11225
11281
|
});
|
|
11226
|
-
InvalidationReceiptSchema =
|
|
11227
|
-
receipt_id:
|
|
11228
|
-
contract_label:
|
|
11229
|
-
superseded_contract:
|
|
11230
|
-
new_contract:
|
|
11231
|
-
reason:
|
|
11232
|
-
invalidated_at:
|
|
11233
|
-
research_os_version:
|
|
11234
|
-
affected_sections:
|
|
11235
|
-
archived_artifacts:
|
|
11236
|
-
section_status_changes:
|
|
11237
|
-
frozen_at_cleared:
|
|
11238
|
-
notes:
|
|
11282
|
+
InvalidationReceiptSchema = z20.object({
|
|
11283
|
+
receipt_id: z20.string().regex(/^inv_[0-9]+_[a-z0-9-]+$/),
|
|
11284
|
+
contract_label: z20.string().min(1),
|
|
11285
|
+
superseded_contract: z20.string().min(1).nullable(),
|
|
11286
|
+
new_contract: z20.string().min(1),
|
|
11287
|
+
reason: z20.string().min(8),
|
|
11288
|
+
invalidated_at: z20.string(),
|
|
11289
|
+
research_os_version: z20.string(),
|
|
11290
|
+
affected_sections: z20.array(z20.string().regex(/^[0-9]{2}-[a-z0-9-]+$/)),
|
|
11291
|
+
archived_artifacts: z20.array(ArchivedArtifactSchema),
|
|
11292
|
+
section_status_changes: z20.array(SectionStatusChangeSchema),
|
|
11293
|
+
frozen_at_cleared: z20.boolean(),
|
|
11294
|
+
notes: z20.string().nullable()
|
|
11239
11295
|
});
|
|
11240
11296
|
}
|
|
11241
11297
|
});
|
|
@@ -11501,7 +11557,7 @@ var init_run9 = __esm({
|
|
|
11501
11557
|
import { existsSync as existsSync26 } from "fs";
|
|
11502
11558
|
import { mkdir as mkdir20, rename as rename2, writeFile as writeFile20 } from "fs/promises";
|
|
11503
11559
|
import { dirname as dirname7, join as join26, posix as posix2, relative as relative4, resolve as resolve21, sep as sep2 } from "path";
|
|
11504
|
-
import { z as
|
|
11560
|
+
import { z as z21 } from "zod";
|
|
11505
11561
|
function posixify2(p) {
|
|
11506
11562
|
return p.split(sep2).join("/");
|
|
11507
11563
|
}
|
|
@@ -11633,15 +11689,15 @@ var init_review2 = __esm({
|
|
|
11633
11689
|
init_errors();
|
|
11634
11690
|
init_src();
|
|
11635
11691
|
init_schema17();
|
|
11636
|
-
ReviewInvalidationReceiptSchema =
|
|
11637
|
-
receipt_id:
|
|
11638
|
-
section_id:
|
|
11639
|
-
contract_label:
|
|
11640
|
-
reason:
|
|
11641
|
-
invalidated_at:
|
|
11642
|
-
research_os_version:
|
|
11643
|
-
archived_artifacts:
|
|
11644
|
-
notes:
|
|
11692
|
+
ReviewInvalidationReceiptSchema = z21.object({
|
|
11693
|
+
receipt_id: z21.string().regex(/^invr_[0-9]+_[a-z0-9-]+$/),
|
|
11694
|
+
section_id: z21.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
11695
|
+
contract_label: z21.string().min(1),
|
|
11696
|
+
reason: z21.string().min(8),
|
|
11697
|
+
invalidated_at: z21.string(),
|
|
11698
|
+
research_os_version: z21.string(),
|
|
11699
|
+
archived_artifacts: z21.array(ArchivedArtifactSchema),
|
|
11700
|
+
notes: z21.string().nullable()
|
|
11645
11701
|
});
|
|
11646
11702
|
}
|
|
11647
11703
|
});
|
|
@@ -11666,17 +11722,17 @@ var init_triage = __esm({
|
|
|
11666
11722
|
});
|
|
11667
11723
|
|
|
11668
11724
|
// src/discover/schema.ts
|
|
11669
|
-
import { z as
|
|
11725
|
+
import { z as z22 } from "zod";
|
|
11670
11726
|
var DiscoveryCandidateStatusSchema, SourceTypeGuessSchema, DiscoveryCandidateSchema, DiscoverySummarySchema;
|
|
11671
11727
|
var init_schema18 = __esm({
|
|
11672
11728
|
"src/discover/schema.ts"() {
|
|
11673
11729
|
"use strict";
|
|
11674
|
-
DiscoveryCandidateStatusSchema =
|
|
11730
|
+
DiscoveryCandidateStatusSchema = z22.enum([
|
|
11675
11731
|
"candidate",
|
|
11676
11732
|
"approved",
|
|
11677
11733
|
"rejected"
|
|
11678
11734
|
]);
|
|
11679
|
-
SourceTypeGuessSchema =
|
|
11735
|
+
SourceTypeGuessSchema = z22.enum([
|
|
11680
11736
|
"primary",
|
|
11681
11737
|
"docs",
|
|
11682
11738
|
"paper",
|
|
@@ -11686,36 +11742,36 @@ var init_schema18 = __esm({
|
|
|
11686
11742
|
"benchmark",
|
|
11687
11743
|
"unknown"
|
|
11688
11744
|
]);
|
|
11689
|
-
DiscoveryCandidateSchema =
|
|
11690
|
-
candidate_id:
|
|
11691
|
-
section_id:
|
|
11692
|
-
url:
|
|
11693
|
-
title:
|
|
11694
|
-
publisher:
|
|
11745
|
+
DiscoveryCandidateSchema = z22.object({
|
|
11746
|
+
candidate_id: z22.string().regex(/^disc_[a-f0-9]{12}$/),
|
|
11747
|
+
section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
11748
|
+
url: z22.string().url(),
|
|
11749
|
+
title: z22.string().min(1),
|
|
11750
|
+
publisher: z22.string().nullable(),
|
|
11695
11751
|
source_type_guess: SourceTypeGuessSchema,
|
|
11696
|
-
why_relevant:
|
|
11752
|
+
why_relevant: z22.string().min(1),
|
|
11697
11753
|
// The free-text query that produced this candidate (for traceability).
|
|
11698
|
-
query:
|
|
11754
|
+
query: z22.string().min(1),
|
|
11699
11755
|
// Lower rank = more central. Stable per-(query, provider) ordering.
|
|
11700
|
-
rank:
|
|
11701
|
-
discovered_at:
|
|
11756
|
+
rank: z22.number().int().positive(),
|
|
11757
|
+
discovered_at: z22.string(),
|
|
11702
11758
|
// 'candidate' | 'approved' | 'rejected'. Append-only: new entries with
|
|
11703
11759
|
// same candidate_id supersede older ones; the latest entry's status wins.
|
|
11704
11760
|
status: DiscoveryCandidateStatusSchema,
|
|
11705
|
-
discovered_by:
|
|
11706
|
-
reason:
|
|
11761
|
+
discovered_by: z22.string().min(1),
|
|
11762
|
+
reason: z22.string().nullable().default(null)
|
|
11707
11763
|
});
|
|
11708
|
-
DiscoverySummarySchema =
|
|
11709
|
-
summary_id:
|
|
11710
|
-
section_id:
|
|
11711
|
-
ran_at:
|
|
11712
|
-
research_os_version:
|
|
11713
|
-
query:
|
|
11714
|
-
provider:
|
|
11715
|
-
candidates_proposed:
|
|
11716
|
-
candidates_validated:
|
|
11717
|
-
candidates_rejected_invalid_url:
|
|
11718
|
-
warnings:
|
|
11764
|
+
DiscoverySummarySchema = z22.object({
|
|
11765
|
+
summary_id: z22.string().regex(/^disum_[0-9]+_[a-z0-9-]+$/),
|
|
11766
|
+
section_id: z22.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
11767
|
+
ran_at: z22.string(),
|
|
11768
|
+
research_os_version: z22.string(),
|
|
11769
|
+
query: z22.string().min(1),
|
|
11770
|
+
provider: z22.string().min(1),
|
|
11771
|
+
candidates_proposed: z22.number().int().nonnegative(),
|
|
11772
|
+
candidates_validated: z22.number().int().nonnegative(),
|
|
11773
|
+
candidates_rejected_invalid_url: z22.number().int().nonnegative(),
|
|
11774
|
+
warnings: z22.array(z22.string())
|
|
11719
11775
|
});
|
|
11720
11776
|
}
|
|
11721
11777
|
});
|
|
@@ -12199,88 +12255,88 @@ var init_src = __esm({
|
|
|
12199
12255
|
init_triage();
|
|
12200
12256
|
init_discover();
|
|
12201
12257
|
init_errors();
|
|
12202
|
-
RESEARCH_OS_VERSION = "0.
|
|
12258
|
+
RESEARCH_OS_VERSION = "0.6.0";
|
|
12203
12259
|
}
|
|
12204
12260
|
});
|
|
12205
12261
|
|
|
12206
12262
|
// src/section_report/schema.ts
|
|
12207
|
-
import { z as
|
|
12263
|
+
import { z as z23 } from "zod";
|
|
12208
12264
|
var SectionReportSourcesSchema, SectionReportExtractionSchema, SectionReportContradictionsSchema, SectionReportReviewSchema, SectionReportAcceptanceSchema, SectionReportSchema;
|
|
12209
12265
|
var init_schema19 = __esm({
|
|
12210
12266
|
"src/section_report/schema.ts"() {
|
|
12211
12267
|
"use strict";
|
|
12212
|
-
SectionReportSourcesSchema =
|
|
12213
|
-
fetched_ok:
|
|
12214
|
-
source_cards:
|
|
12215
|
-
publishers:
|
|
12216
|
-
primary_source_waiver:
|
|
12217
|
-
status:
|
|
12218
|
-
reason:
|
|
12219
|
-
compensating_controls:
|
|
12268
|
+
SectionReportSourcesSchema = z23.object({
|
|
12269
|
+
fetched_ok: z23.number().int().nonnegative(),
|
|
12270
|
+
source_cards: z23.number().int().nonnegative(),
|
|
12271
|
+
publishers: z23.array(z23.string()),
|
|
12272
|
+
primary_source_waiver: z23.object({
|
|
12273
|
+
status: z23.enum(["none", "requested", "granted"]),
|
|
12274
|
+
reason: z23.string().nullable(),
|
|
12275
|
+
compensating_controls: z23.array(z23.string())
|
|
12220
12276
|
})
|
|
12221
12277
|
});
|
|
12222
|
-
SectionReportExtractionSchema =
|
|
12223
|
-
candidate_claims:
|
|
12224
|
-
claims_per_source:
|
|
12225
|
-
|
|
12226
|
-
source_id:
|
|
12227
|
-
claims:
|
|
12278
|
+
SectionReportExtractionSchema = z23.object({
|
|
12279
|
+
candidate_claims: z23.number().int().nonnegative(),
|
|
12280
|
+
claims_per_source: z23.array(
|
|
12281
|
+
z23.object({
|
|
12282
|
+
source_id: z23.string(),
|
|
12283
|
+
claims: z23.number().int().nonnegative()
|
|
12228
12284
|
})
|
|
12229
12285
|
),
|
|
12230
|
-
claims_per_1k_words:
|
|
12231
|
-
excerpt_pages_processed:
|
|
12232
|
-
excerpt_id_failures:
|
|
12233
|
-
malformed_extractor_outputs:
|
|
12234
|
-
near_duplicate_clusters:
|
|
12235
|
-
weak_scope_count:
|
|
12236
|
-
generic_scope_count:
|
|
12237
|
-
density_flags:
|
|
12238
|
-
});
|
|
12239
|
-
SectionReportContradictionsSchema =
|
|
12240
|
-
pairs_compared:
|
|
12241
|
-
contradiction_candidates:
|
|
12242
|
-
overgeneralization_risks:
|
|
12243
|
-
});
|
|
12244
|
-
SectionReportReviewSchema =
|
|
12245
|
-
reviewed:
|
|
12246
|
-
accepted_for_synthesis:
|
|
12247
|
-
needs_scope_repair:
|
|
12248
|
-
needs_source_repair:
|
|
12249
|
-
needs_contradiction_mapping:
|
|
12250
|
-
rejected:
|
|
12251
|
-
needs_human_review:
|
|
12252
|
-
rejection_or_repair_by_category:
|
|
12253
|
-
|
|
12254
|
-
category:
|
|
12255
|
-
count:
|
|
12286
|
+
claims_per_1k_words: z23.number(),
|
|
12287
|
+
excerpt_pages_processed: z23.number().int().nonnegative().nullable(),
|
|
12288
|
+
excerpt_id_failures: z23.number().int().nonnegative().nullable(),
|
|
12289
|
+
malformed_extractor_outputs: z23.number().int().nonnegative().nullable(),
|
|
12290
|
+
near_duplicate_clusters: z23.number().int().nonnegative(),
|
|
12291
|
+
weak_scope_count: z23.number().int().nonnegative(),
|
|
12292
|
+
generic_scope_count: z23.number().int().nonnegative(),
|
|
12293
|
+
density_flags: z23.number().int().nonnegative()
|
|
12294
|
+
});
|
|
12295
|
+
SectionReportContradictionsSchema = z23.object({
|
|
12296
|
+
pairs_compared: z23.number().int().nonnegative().nullable(),
|
|
12297
|
+
contradiction_candidates: z23.number().int().nonnegative(),
|
|
12298
|
+
overgeneralization_risks: z23.number().int().nonnegative()
|
|
12299
|
+
});
|
|
12300
|
+
SectionReportReviewSchema = z23.object({
|
|
12301
|
+
reviewed: z23.boolean(),
|
|
12302
|
+
accepted_for_synthesis: z23.number().int().nonnegative(),
|
|
12303
|
+
needs_scope_repair: z23.number().int().nonnegative(),
|
|
12304
|
+
needs_source_repair: z23.number().int().nonnegative(),
|
|
12305
|
+
needs_contradiction_mapping: z23.number().int().nonnegative(),
|
|
12306
|
+
rejected: z23.number().int().nonnegative(),
|
|
12307
|
+
needs_human_review: z23.number().int().nonnegative(),
|
|
12308
|
+
rejection_or_repair_by_category: z23.array(
|
|
12309
|
+
z23.object({
|
|
12310
|
+
category: z23.string(),
|
|
12311
|
+
count: z23.number().int().nonnegative()
|
|
12256
12312
|
})
|
|
12257
12313
|
)
|
|
12258
12314
|
});
|
|
12259
|
-
SectionReportAcceptanceSchema =
|
|
12260
|
-
candidate_claims:
|
|
12261
|
-
accepted_for_synthesis:
|
|
12262
|
-
acceptance_ratio:
|
|
12315
|
+
SectionReportAcceptanceSchema = z23.object({
|
|
12316
|
+
candidate_claims: z23.number().int().nonnegative(),
|
|
12317
|
+
accepted_for_synthesis: z23.number().int().nonnegative(),
|
|
12318
|
+
acceptance_ratio: z23.number(),
|
|
12263
12319
|
// 0..1
|
|
12264
|
-
accepted_per_source:
|
|
12320
|
+
accepted_per_source: z23.number(),
|
|
12265
12321
|
// accepted / source_count, 0 if no sources
|
|
12266
|
-
accepted_per_1k_words:
|
|
12267
|
-
top_rejection_category:
|
|
12268
|
-
claim_overproduction_fired:
|
|
12269
|
-
synthesis_ready:
|
|
12270
|
-
});
|
|
12271
|
-
SectionReportSchema =
|
|
12272
|
-
report_id:
|
|
12273
|
-
section_id:
|
|
12274
|
-
reported_at:
|
|
12275
|
-
research_os_version:
|
|
12276
|
-
status:
|
|
12322
|
+
accepted_per_1k_words: z23.number(),
|
|
12323
|
+
top_rejection_category: z23.string().nullable(),
|
|
12324
|
+
claim_overproduction_fired: z23.boolean(),
|
|
12325
|
+
synthesis_ready: z23.boolean()
|
|
12326
|
+
});
|
|
12327
|
+
SectionReportSchema = z23.object({
|
|
12328
|
+
report_id: z23.string().regex(/^secrep_[0-9]+_[a-z0-9-]+$/),
|
|
12329
|
+
section_id: z23.string().regex(/^[0-9]{2}-[a-z0-9-]+$/),
|
|
12330
|
+
reported_at: z23.string(),
|
|
12331
|
+
research_os_version: z23.string(),
|
|
12332
|
+
status: z23.string(),
|
|
12277
12333
|
sources: SectionReportSourcesSchema,
|
|
12278
12334
|
extraction: SectionReportExtractionSchema,
|
|
12279
12335
|
contradictions: SectionReportContradictionsSchema,
|
|
12280
12336
|
review: SectionReportReviewSchema,
|
|
12281
12337
|
acceptance: SectionReportAcceptanceSchema,
|
|
12282
|
-
gate_verdict:
|
|
12283
|
-
gate_synthesis_eligible:
|
|
12338
|
+
gate_verdict: z23.string().nullable(),
|
|
12339
|
+
gate_synthesis_eligible: z23.boolean().nullable()
|
|
12284
12340
|
});
|
|
12285
12341
|
}
|
|
12286
12342
|
});
|
|
@@ -12643,7 +12699,7 @@ import { createHash as createHash11 } from "crypto";
|
|
|
12643
12699
|
import { readFileSync, existsSync as existsSync29 } from "fs";
|
|
12644
12700
|
import { join as join29 } from "path";
|
|
12645
12701
|
import { parse as parseYaml } from "yaml";
|
|
12646
|
-
import { z as
|
|
12702
|
+
import { z as z25 } from "zod";
|
|
12647
12703
|
|
|
12648
12704
|
// src/closure-ledger/effective-accepted.ts
|
|
12649
12705
|
function getEffectiveDecisionMap(reviews) {
|
|
@@ -12688,38 +12744,38 @@ function findIncompatibleDecisions(reviews) {
|
|
|
12688
12744
|
}
|
|
12689
12745
|
|
|
12690
12746
|
// src/pack/publish/schema.ts
|
|
12691
|
-
import { z as
|
|
12692
|
-
var SectionSummarySchema =
|
|
12693
|
-
id:
|
|
12694
|
-
accepted_claims:
|
|
12695
|
-
gate:
|
|
12696
|
-
synthesis_eligible:
|
|
12697
|
-
});
|
|
12698
|
-
var TotalsSchema =
|
|
12699
|
-
sections:
|
|
12700
|
-
accepted_claims:
|
|
12701
|
-
dispositioned:
|
|
12702
|
-
unresolved_contradictions:
|
|
12703
|
-
preserved_contradiction_records:
|
|
12704
|
-
});
|
|
12705
|
-
var PackManifestSchema =
|
|
12706
|
-
name:
|
|
12707
|
-
topic:
|
|
12708
|
-
frozen_at:
|
|
12709
|
-
research_os_version:
|
|
12710
|
-
sections:
|
|
12747
|
+
import { z as z24 } from "zod";
|
|
12748
|
+
var SectionSummarySchema = z24.object({
|
|
12749
|
+
id: z24.string().min(1),
|
|
12750
|
+
accepted_claims: z24.number().int().min(0),
|
|
12751
|
+
gate: z24.enum(["pass", "warn", "fail", "blocked", "pass_with_waiver"]),
|
|
12752
|
+
synthesis_eligible: z24.boolean()
|
|
12753
|
+
});
|
|
12754
|
+
var TotalsSchema = z24.object({
|
|
12755
|
+
sections: z24.number().int().min(1),
|
|
12756
|
+
accepted_claims: z24.number().int().min(0),
|
|
12757
|
+
dispositioned: z24.number().int().min(0),
|
|
12758
|
+
unresolved_contradictions: z24.number().int().min(0),
|
|
12759
|
+
preserved_contradiction_records: z24.number().int().min(0).optional()
|
|
12760
|
+
});
|
|
12761
|
+
var PackManifestSchema = z24.object({
|
|
12762
|
+
name: z24.string().min(1),
|
|
12763
|
+
topic: z24.string().min(1),
|
|
12764
|
+
frozen_at: z24.string().datetime(),
|
|
12765
|
+
research_os_version: z24.string().min(1),
|
|
12766
|
+
sections: z24.array(SectionSummarySchema).min(1),
|
|
12711
12767
|
totals: TotalsSchema,
|
|
12712
|
-
freeze_receipt_sha256:
|
|
12713
|
-
operator_notes:
|
|
12768
|
+
freeze_receipt_sha256: z24.string().regex(/^[a-f0-9]{64}$/, "Must be a 64-char hex sha256"),
|
|
12769
|
+
operator_notes: z24.string().default("")
|
|
12714
12770
|
});
|
|
12715
12771
|
|
|
12716
12772
|
// src/pack/publish/manifest.ts
|
|
12717
12773
|
init_src();
|
|
12718
|
-
var GateResultMinimalSchema =
|
|
12719
|
-
verdict:
|
|
12720
|
-
synthesis_eligible:
|
|
12774
|
+
var GateResultMinimalSchema = z25.object({
|
|
12775
|
+
verdict: z25.enum(["pass", "warn", "fail", "blocked"]),
|
|
12776
|
+
synthesis_eligible: z25.boolean()
|
|
12721
12777
|
});
|
|
12722
|
-
var ClaimIdOnlySchema =
|
|
12778
|
+
var ClaimIdOnlySchema = z25.object({ claim_id: z25.string() });
|
|
12723
12779
|
function sha256Bytes(buf) {
|
|
12724
12780
|
return createHash11("sha256").update(buf).digest("hex");
|
|
12725
12781
|
}
|
|
@@ -13420,62 +13476,64 @@ import { readFile as readFile26 } from "fs/promises";
|
|
|
13420
13476
|
import { join as join34 } from "path";
|
|
13421
13477
|
|
|
13422
13478
|
// src/calibration/receipt-schema.ts
|
|
13423
|
-
|
|
13424
|
-
|
|
13479
|
+
init_reviewer_options_schema();
|
|
13480
|
+
import { z as z26 } from "zod";
|
|
13481
|
+
var StatusLabelSchema = z26.enum([
|
|
13425
13482
|
"trusted_baseline",
|
|
13426
13483
|
"conditional_pass",
|
|
13427
13484
|
"failed",
|
|
13428
13485
|
"comparison_only"
|
|
13429
13486
|
]);
|
|
13430
|
-
var ArchitectureSchema =
|
|
13431
|
-
var RecallSchema =
|
|
13432
|
-
matched:
|
|
13433
|
-
total:
|
|
13434
|
-
ratio:
|
|
13435
|
-
});
|
|
13436
|
-
var PerCategoryRecallSchema =
|
|
13437
|
-
var PassFailSchema =
|
|
13438
|
-
fp_ceiling:
|
|
13439
|
-
any_flag_recall_floor:
|
|
13440
|
-
per_category_any_flag_floor:
|
|
13441
|
-
strict_recall_floor:
|
|
13442
|
-
decision_vocab_completeness:
|
|
13443
|
-
latency_soft:
|
|
13444
|
-
latency_hard:
|
|
13445
|
-
empty_or_malformed:
|
|
13446
|
-
overall:
|
|
13447
|
-
});
|
|
13448
|
-
var DecisionVocabBarSchema =
|
|
13487
|
+
var ArchitectureSchema = z26.enum(["single-pass", "two-pass"]);
|
|
13488
|
+
var RecallSchema = z26.object({
|
|
13489
|
+
matched: z26.number().int().nonnegative(),
|
|
13490
|
+
total: z26.number().int().nonnegative(),
|
|
13491
|
+
ratio: z26.number().min(0).max(1)
|
|
13492
|
+
});
|
|
13493
|
+
var PerCategoryRecallSchema = z26.record(z26.string(), RecallSchema);
|
|
13494
|
+
var PassFailSchema = z26.object({
|
|
13495
|
+
fp_ceiling: z26.enum(["PASS", "FAIL"]),
|
|
13496
|
+
any_flag_recall_floor: z26.enum(["PASS", "FAIL"]),
|
|
13497
|
+
per_category_any_flag_floor: z26.enum(["PASS", "FAIL"]),
|
|
13498
|
+
strict_recall_floor: z26.enum(["PASS", "FAIL"]),
|
|
13499
|
+
decision_vocab_completeness: z26.enum(["PASS", "FAIL"]),
|
|
13500
|
+
latency_soft: z26.enum(["PASS", "WARN"]),
|
|
13501
|
+
latency_hard: z26.enum(["PASS", "FAIL"]),
|
|
13502
|
+
empty_or_malformed: z26.enum(["PASS", "FAIL"]),
|
|
13503
|
+
overall: z26.enum(["PASS", "FAIL"])
|
|
13504
|
+
});
|
|
13505
|
+
var DecisionVocabBarSchema = z26.object({
|
|
13449
13506
|
architecture: ArchitectureSchema,
|
|
13450
|
-
required:
|
|
13451
|
-
produced:
|
|
13452
|
-
passed:
|
|
13507
|
+
required: z26.number().int().positive(),
|
|
13508
|
+
produced: z26.number().int().nonnegative(),
|
|
13509
|
+
passed: z26.boolean()
|
|
13453
13510
|
});
|
|
13454
|
-
var CalibrationReceiptSchema =
|
|
13455
|
-
schema_version:
|
|
13456
|
-
profile_name:
|
|
13511
|
+
var CalibrationReceiptSchema = z26.object({
|
|
13512
|
+
schema_version: z26.literal(1),
|
|
13513
|
+
profile_name: z26.string(),
|
|
13457
13514
|
status: StatusLabelSchema,
|
|
13458
|
-
model:
|
|
13515
|
+
model: z26.string(),
|
|
13459
13516
|
architecture: ArchitectureSchema,
|
|
13460
|
-
fixture:
|
|
13461
|
-
fixture_total_claims:
|
|
13462
|
-
fixture_good_claims:
|
|
13463
|
-
fixture_bad_claims:
|
|
13464
|
-
calibrated_at:
|
|
13465
|
-
research_os_version:
|
|
13466
|
-
runtime_ms:
|
|
13467
|
-
good_fp_count:
|
|
13517
|
+
fixture: z26.string(),
|
|
13518
|
+
fixture_total_claims: z26.number().int().positive(),
|
|
13519
|
+
fixture_good_claims: z26.number().int().nonnegative(),
|
|
13520
|
+
fixture_bad_claims: z26.number().int().nonnegative(),
|
|
13521
|
+
calibrated_at: z26.string(),
|
|
13522
|
+
research_os_version: z26.string(),
|
|
13523
|
+
runtime_ms: z26.number().int().nonnegative(),
|
|
13524
|
+
good_fp_count: z26.number().int().nonnegative(),
|
|
13468
13525
|
any_flag_recall: RecallSchema,
|
|
13469
13526
|
strict_recall: RecallSchema,
|
|
13470
13527
|
per_category_any_flag: PerCategoryRecallSchema,
|
|
13471
13528
|
per_category_strict: PerCategoryRecallSchema,
|
|
13472
|
-
decision_vocabulary:
|
|
13473
|
-
decisions_produced_count:
|
|
13529
|
+
decision_vocabulary: z26.record(z26.string(), z26.number().int().nonnegative()),
|
|
13530
|
+
decisions_produced_count: z26.number().int().nonnegative(),
|
|
13474
13531
|
decision_vocab_bar: DecisionVocabBarSchema,
|
|
13475
|
-
unreachable_decisions:
|
|
13476
|
-
empty_or_malformed_responses:
|
|
13532
|
+
unreachable_decisions: z26.array(z26.string()),
|
|
13533
|
+
empty_or_malformed_responses: z26.number().int().nonnegative(),
|
|
13477
13534
|
pass_fail: PassFailSchema,
|
|
13478
|
-
notes:
|
|
13535
|
+
notes: z26.array(z26.string()),
|
|
13536
|
+
reviewer_options: ReviewerOptionsSchema.optional()
|
|
13479
13537
|
});
|
|
13480
13538
|
|
|
13481
13539
|
// src/calibration/receipt.ts
|
|
@@ -14136,22 +14194,26 @@ program.command("review").description("Run the adversarial reviewer pass; emits
|
|
|
14136
14194
|
const criticModel = opts.criticModel ?? baseModel ?? preset?.critic_model ?? void 0;
|
|
14137
14195
|
const reviewWindow = opts.reviewWindow ?? preset?.review_window ?? void 0;
|
|
14138
14196
|
const twoPass = Boolean(opts.twoPassLlm) || (preset?.mode === "two_pass" ? true : false);
|
|
14197
|
+
const reviewerOptions = preset?.reviewer_options ?? void 0;
|
|
14139
14198
|
const reviewers = opts.heuristicOnly ? [new HeuristicReviewer()] : twoPass ? [
|
|
14140
14199
|
new OllamaInternReviewer({
|
|
14141
14200
|
mode: "general",
|
|
14142
14201
|
model: generalModel ?? void 0,
|
|
14143
|
-
claimsPerWindow: reviewWindow
|
|
14202
|
+
claimsPerWindow: reviewWindow,
|
|
14203
|
+
reviewer_options: reviewerOptions
|
|
14144
14204
|
}),
|
|
14145
14205
|
new OllamaInternReviewer({
|
|
14146
14206
|
mode: "narrow_critic",
|
|
14147
14207
|
model: criticModel ?? void 0,
|
|
14148
|
-
claimsPerWindow: reviewWindow
|
|
14208
|
+
claimsPerWindow: reviewWindow,
|
|
14209
|
+
reviewer_options: reviewerOptions
|
|
14149
14210
|
}),
|
|
14150
14211
|
new HeuristicReviewer()
|
|
14151
14212
|
] : reviewWindow || opts.llmPaged || baseModel || generalModel ? [
|
|
14152
14213
|
new OllamaInternReviewer({
|
|
14153
14214
|
model: generalModel ?? void 0,
|
|
14154
|
-
claimsPerWindow: reviewWindow
|
|
14215
|
+
claimsPerWindow: reviewWindow,
|
|
14216
|
+
reviewer_options: reviewerOptions
|
|
14155
14217
|
}),
|
|
14156
14218
|
new HeuristicReviewer()
|
|
14157
14219
|
] : void 0;
|
|
@@ -14161,7 +14223,8 @@ program.command("review").description("Run the adversarial reviewer pass; emits
|
|
|
14161
14223
|
reviewers,
|
|
14162
14224
|
triagedOnly: opts.triagedOnly,
|
|
14163
14225
|
multiPass: twoPass,
|
|
14164
|
-
profile: opts.profile
|
|
14226
|
+
profile: opts.profile,
|
|
14227
|
+
reviewer_options: reviewerOptions
|
|
14165
14228
|
});
|
|
14166
14229
|
process.stdout.write(`review complete
|
|
14167
14230
|
`);
|