opencode-orchestrator-uni 0.3.1 → 0.5.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.
@@ -352,6 +352,42 @@ export function reportWarnings(schemaId: string, value: unknown): string[] {
352
352
  }
353
353
  }
354
354
 
355
+ if (schemaId === "context-lint/v1") {
356
+ const files = list("files").filter(isPlainObject)
357
+ const findings = files.flatMap((file) => (Array.isArray(file.findings) ? file.findings.filter(isPlainObject) : []))
358
+ const majorIds = findings
359
+ .filter((finding) => finding.severity === "MAJOR")
360
+ .map((finding) => finding.id)
361
+ .filter((id): id is string => typeof id === "string")
362
+ const closing = strings("closing_list")
363
+ // The verdict is a function of the findings, and `closing_list` is the set of
364
+ // MAJOR ids: a report that claims `pass` over its own MAJOR finding, or that
365
+ // lists something else, is a report whose closing_list cannot be trusted.
366
+ if (value.verdict === "pass" && majorIds.length > 0) {
367
+ warnings.push("verdict=pass with a MAJOR finding: verdict must be fail")
368
+ }
369
+ // Set equality, not just containment: a repeated id hides a missing one.
370
+ const uniqueClosing = new Set(closing)
371
+ if (
372
+ uniqueClosing.size !== closing.length ||
373
+ closing.length !== majorIds.length ||
374
+ closing.some((id) => !majorIds.includes(id))
375
+ ) {
376
+ warnings.push(`closing_list must equal the MAJOR finding ids (${majorIds.join(", ") || "none"})`)
377
+ }
378
+ if (value.verdict === "pass" && files.length === 0) {
379
+ warnings.push("verdict=pass with files=[]: no file was measured")
380
+ }
381
+ if (value.truncated === true) {
382
+ warnings.push(
383
+ "truncated=true: the finding list is capped; MAJOR findings are prioritized and a dropped MAJOR leaves a MAJOR marker, MINOR/INFO may be missing",
384
+ )
385
+ if (value.verdict === "pass") {
386
+ warnings.push("truncated=true with verdict=pass: the capped list may hide a later finding; re-run after fixes")
387
+ }
388
+ }
389
+ }
390
+
355
391
  return warnings
356
392
  }
357
393