JuliusBrussee/caveman · error · Error

unproven adjacency -> is in fact a proven hard dependency

Error message

${where} unproven adjacency ${edge.from}->${edge.to} is in fact a proven hard dependency

What it means

Entries in slice.unproven_adjacencies are supposed to capture dependencies that are suspected but NOT proven. If `provenDependency(edge)` returns true, the edge is actually an established hard dependency, so listing it as unproven contradicts the provenance data. The validator throws to force the author to either prove the edge (move it to the hard chain) or correct the provenance.

Solutions

  1. Remove the edge from unproven_adjacencies and, if you want to assert it, add it to the hard chain.
  2. If the dependency is genuinely unproven, fix the provenance/evidence so provenDependency no longer classifies it as proven.
  3. Deduplicate the slice: check unproven_adjacencies against hard_edges before submitting the report.

Example fix

// before
"unproven_adjacencies": [{ "from": "ingest", "to": "parse", "type": "causes" }] // also a proven hard edge
// after
"unproven_adjacencies": []
Defensive patterns

Strategy: validation

Validate before calling

const proven = new Set(variant.edges.filter(e => e.strength === 'hard').map(e => `${e.from}->${e.to}`));
for (const e of slice.unproven_adjacencies) {
  if (proven.has(`${e.from}->${e.to}`)) throw new Error(`${e.from}->${e.to} is proven; remove from unproven list`);
}

Try / catch

try { validateReport(report); } catch (err) { if (String(err.message).includes('in fact a proven hard dependency')) { /* move edge to hard chain or fix provenance */ } else throw err; }

Prevention

When it happens

Trigger: Running the validator on a report where an unproven_adjacencies entry matches an edge that provenDependency() recognizes as proven — e.g. the same from/to pair is already a hard edge in the variant, or the edge is backed by recorded evidence.

Common situations: Copy-pasting an edge from the hard chain into the unproven list 'just in case'; provenance data was upgraded to prove an edge but the adjacency list was not pruned; bulk-imported slices from an older report format.

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


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/c1a83a919bc777eb. Report an issue: GitHub.

Appendix: source

Thrown at packages/shared/contracts/scripts/validate-continuous-improvement.mjs:201

      if (!sliceNodes.has(nodeID)) throw new Error(`${where} causal slice node ${nodeID} is not a node of variant ${sliceVariant.id}`);
    }
    if (slice.manifestation_node_id !== "" && !slice.node_chain.includes(slice.manifestation_node_id)) {
      throw new Error(`${where} causal slice omits its own manifestation node`);
    }
    const provenDependency = (edge) => edge.strength === "hard" && (edge.type === "data" || edge.type === "control") && edge.evidence_refs.length > 0;
    const variantEdges = new Map(sliceVariant.edges.map((edge) => [`${edge.from}${edge.to}${edge.type}`, edge]));
    for (const edge of slice.hard_edges) {
      if (!provenDependency(edge)) throw new Error(`${where} hard chain carries an unproven edge ${edge.from}->${edge.to}`);
      if (!sliceNodes.has(edge.from) || !sliceNodes.has(edge.to)) throw new Error(`${where} hard chain edge ${edge.from}->${edge.to} names a node outside variant ${sliceVariant.id}`);
      if (!slice.node_chain.includes(edge.from) || !slice.node_chain.includes(edge.to)) {
        throw new Error(`${where} hard chain edge ${edge.from}->${edge.to} is outside the slice's node chain`);
      }
      const source = variantEdges.get(`${edge.from}${edge.to}${edge.type}`);
      if (!source || source.strength !== "hard") throw new Error(`${where} hard chain edge ${edge.from}->${edge.to} is not a hard edge of variant ${sliceVariant.id}`);
    }
    for (const edge of slice.unproven_adjacencies) {
      // The whole point of the separate list: nothing in it may read as proven.
      if (provenDependency(edge)) throw new Error(`${where} unproven adjacency ${edge.from}->${edge.to} is in fact a proven hard dependency`);
      if (slice.hard_edges.some((hard) => hard.from === edge.from && hard.to === edge.to && hard.type === edge.type)) {
        throw new Error(`${where} adjacency ${edge.from}->${edge.to} appears in both the hard chain and the unproven list`);
      }
    }
    const upstream = new Set(item.diagnosis.root_cause_hypothesis.upstream_node_ids);
    for (const nodeID of upstream) {
      if (!slice.node_chain.includes(nodeID) || nodeID === slice.manifestation_node_id) {
        throw new Error(`${where} diagnosis upstream node ${nodeID} is not an upstream node of its causal slice`);
      }
    }

    // A case that proposes nothing must carry nothing: no operator, no eval
    // pack, no replay. Anything else would present an abstention as a proposal.
    if (item.status === "diagnosis_only") {
      if (item.change_set.operator_id !== "" || item.eval_pack.id !== "" || item.replay.status !== "not_run") {
        throw new Error(`${where} is diagnosis-only but carries a change set, eval pack or replay`);
      }
      continue;

View on GitHub (pinned to 3ee70a1026)