JuliusBrussee/caveman · error · Error
dataset carries target-failure cases, want
Error message
${where} dataset carries ${roleCounts.target_failure} target-failure cases, want ${expectedTargets} What it means
Composition arithmetic (spec 18.2): the dataset must carry exactly min(4, number of target-failure candidates) cases with role target_failure. roleCounts tallies roles from dataset.cases; mismatch means the composed cases disagree with the manifest's target_failure_cases list.
Solutions
- Compose the dataset so exactly min(4, candidates) target_failure cases are present.
- Fix any entry.role typos so cases are counted under the correct role.
- Sync dataset.target_failure_cases with the cases actually present.
- Regenerate the dataset with the tooling.
Example fix
// before (6 target-failure cases, 5 candidates -> want 4) // after: keep first 4 by priority, demote the rest
Defensive patterns
Strategy: validation
Validate before calling
const want = Math.min(4, dataset.target_failure_cases.length);
const got = dataset.cases.filter(c => c.role === "target_failure").length;
if (got !== want) throw new Error(`target_failure count ${got}, want ${want}`); Try / catch
try {
validateContinuousImprovement(report, dataset);
} catch (e) {
if (String(e.message).includes("target-failure cases")) {
// recompose cases from dataset.target_failure_cases
}
} Prevention
- Compose cases only from the manifest's role lists via tooling.
- Keep dataset.cases and role lists in one generated artifact.
When it happens
Trigger: roleCounts.target_failure differs from Math.min(4, dataset.target_failure_cases.length) — e.g. fewer/more cases composed than candidates allow, or case roles edited by hand.
Common situations: Manually adding or removing target-failure cases; a role field typo reassigning cases; regenerating candidates without recomposing cases.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- dataset carries prior-success cases, want
- dataset carries boundary cases, want at most one
- generator disagrees with perturbation
- is a generated case whose id does not name its generator…
- names source unit that is not an analysis unit of this…
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/ceec37b430c58036.
Report an issue: GitHub.
Appendix: source
Thrown at packages/shared/contracts/scripts/validate-continuous-improvement.mjs:303
//
// The boundary and stale-input generators perturb the localization evidence
// a confidence guard reads. A ChangeSet whose applicability never reads that
// evidence has no threshold to sit beside, so those two cases must NOT be
// generated for it — a "boundary" case against a guard that does not exist
// tests nothing while counting as adversarial coverage.
const confidenceGuard = item.change_set.applicability.all.some((condition) =>
condition === "failure_location_confidence >= 0.90" ||
condition === "symbol_resolution == unique" ||
condition === "targeted_test_reproduces == true");
const perturbations = new Set(dataset.cases.map((entry) => entry.perturbation));
for (const [perturbation, label] of [["guard_threshold_boundary", "boundary"], ["stale_input", "stale-input"]]) {
if (perturbations.has(perturbation) !== confidenceGuard) {
throw new Error(`${where} ${confidenceGuard ? "omits" : "generated"} a ${label} case ${confidenceGuard ? "for" : "against"} a change set that ${confidenceGuard ? "declares" : "declares no"} confidence guard`);
}
}
const expectedTargets = Math.min(4, dataset.target_failure_cases.length);
const expectedPriors = Math.min(2, dataset.prior_success_cases.length);
if (roleCounts.target_failure !== expectedTargets) throw new Error(`${where} dataset carries ${roleCounts.target_failure} target-failure cases, want ${expectedTargets}`);
if (roleCounts.prior_success !== expectedPriors) throw new Error(`${where} dataset carries ${roleCounts.prior_success} prior-success cases, want ${expectedPriors}`);
if (roleCounts.boundary > 1) throw new Error(`${where} dataset carries ${roleCounts.boundary} boundary cases, want at most one`);
if (roleCounts.adversarial > (confidenceGuard ? 2 : 1)) throw new Error(`${where} dataset carries ${roleCounts.adversarial} adversarial cases`);
if (roleCounts.boundary !== dataset.boundary_cases.length) throw new Error(`${where} boundary case list disagrees with the composed dataset`);
if (roleCounts.adversarial !== dataset.generated_cases.length) throw new Error(`${where} generated case list disagrees with the composed dataset`);
const composed = roleCounts.target_failure + roleCounts.prior_success + roleCounts.boundary + roleCounts.adversarial;
if (composed !== dataset.cases.length) throw new Error(`${where} dataset roles (${composed}) do not account for its ${dataset.cases.length} cases`);
if (dataset.replay_case_ids.length !== datasetCaseIDs.size) throw new Error(`${where} replay manifest carries ${dataset.replay_case_ids.length} ids for ${datasetCaseIDs.size} dataset cases`);
for (const datasetCaseID of dataset.replay_case_ids) {
if (!datasetCaseIDs.has(datasetCaseID)) throw new Error(`${where} replay manifest case ${datasetCaseID} is not a composed dataset case`);
}
// The guard grader exists exactly when there is a perturbed case to catch a
// candidate on; a required grader with no case behind it is decoration.
const perturbed = dataset.cases.some((entry) => entry.perturbation !== "none");
if (perturbed !== item.eval_pack.graders.includes("guard_respected")) {
throw new Error(`${where} guard_respected grader ${perturbed ? "missing for" : "declared without"} perturbed dataset cases`);
}View on GitHub (pinned to 3ee70a1026)