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.
- package/README.md +239 -10
- package/README.ru.md +240 -10
- package/agents/en/context-lint.md +90 -0
- package/agents/en/orchestrator.md +10 -0
- package/agents/ru/context-lint.md +90 -0
- package/agents/ru/orchestrator.md +10 -0
- package/docs/en/context-efficiency.md +196 -0
- package/docs/en/root-runbook.md +2 -0
- package/docs/en/session-discipline.md +230 -0
- package/docs/ru/context-efficiency.md +196 -0
- package/docs/ru/root-runbook.md +2 -0
- package/docs/ru/session-discipline.md +225 -0
- package/index.ts +45 -7
- package/lib/commands.ts +204 -0
- package/lib/context-lint.ts +2482 -0
- package/lib/report-schema.ts +36 -0
- package/lib/session-budget.ts +1236 -0
- package/lib/tools.ts +276 -9
- package/package.json +1 -1
- package/schemas/context-lint-failure.v1.json +29 -0
- package/schemas/context-lint.v1.json +58 -0
package/lib/report-schema.ts
CHANGED
|
@@ -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
|
|