JuliusBrussee/caveman · error · Error

causal slice omits its own manifestation node

Error message

${where} causal slice omits its own manifestation node

What it means

If the slice declares a manifestation node (non-empty manifestation_node_id), that node must also appear in the slice's own node_chain; otherwise the backward slice does not actually reach the manifestation point and the report is incoherent.

Solutions

  1. Append the manifestation node id to node_chain
  2. Clear/fix manifestation_node_id if the slice intentionally has no manifestation point
  3. Fix the slice extractor to always include the manifestation node as the chain terminus

Example fix

// before
manifestation_node_id: 'node_9', node_chain: ['node_1','node_4']
// after
manifestation_node_id: 'node_9', node_chain: ['node_1','node_4','node_9']
Defensive patterns

Strategy: validation

Validate before calling

if (slice.manifestation_node_id !== '' && !slice.node_chain.includes(slice.manifestation_node_id)) throw new Error('chain omits manifestation node');

Type guard

const chainReachesManifestation = (slice) => slice.manifestation_node_id === '' || slice.node_chain.includes(slice.manifestation_node_id);

Try / catch

try { validateCase(item); } catch (e) { if (String(e.message).includes('omits its own manifestation node')) appendManifestationToChain(item); else throw e; }

Prevention

When it happens

Trigger: Validation where `slice.manifestation_node_id !== ''` and `slice.node_chain` does not include that node id.

Common situations: Chain truncated during editing; chain rebuilt from a different root than the manifestation node; slice extractor bug that drops the terminal node.

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/3031b9eaa39d39a3. Report an issue: GitHub.

Appendix: source

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

      if (count > 3) throw new Error(`${where} arm ${arm} carries ${count} representative traces, more than three`);
    }

    const slice = item.causal_slice;
    const sliceVariant = variantsByID.get(slice.variant_id);
    if (!sliceVariant) throw new Error(`${where} causal slice references a workflow variant that is not in this report`);
    if (sliceVariant.id !== armVariants.get("baseline").id) throw new Error(`${where} causal slice is not taken from the baseline arm's variant`);
    const sliceNodes = new Set(sliceVariant.nodes.map((node) => node.id));
    if (slice.manifestation_node_id !== "" && !sliceNodes.has(slice.manifestation_node_id)) {
      throw new Error(`${where} manifestation node ${slice.manifestation_node_id} is not a node of variant ${sliceVariant.id}`);
    }
    if (item.diagnosis.manifestation.node_id !== slice.manifestation_node_id) {
      throw new Error(`${where} diagnosis manifestation node disagrees with its causal slice`);
    }
    for (const nodeID of slice.node_chain) {
      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`);
      }

View on GitHub (pinned to 3ee70a1026)