JuliusBrussee/caveman · error

recordOutcome: source is required and must be one of ci|envi

Error message

recordOutcome: source is required and must be one of ci|environment|database|business_event|human

What it means

Error "recordOutcome: source is required and must be one of ci|environment|database|business_event|human" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/mastra/src/index.ts:679

      throw new Error(`recordOutcome: evidence.${key} must be a finite number`);
    }
    const ref = `${key}:${String(value)}`;
    if (!ref.slice(key.length + 1)) throw new Error(`recordOutcome: evidence.${key} must be non-empty`);
    return ref;
  });
  if (evidenceRefs.length === 0) {
    throw new Error("recordOutcome: evidence must contain at least one reference");
  }
  if (evidenceRefs.length > MAX_EVIDENCE_REFS) {
    throw new Error(`recordOutcome: evidence must contain at most ${MAX_EVIDENCE_REFS} references`);
  }

  const confidence = input.confidence;
  if (typeof confidence !== "number" || !Number.isFinite(confidence) || confidence < 0 || confidence > 1) {
    throw new Error("recordOutcome: confidence is required and must be a number within [0,1]");
  }
  if (typeof input.source !== "string" || !OUTCOME_SOURCES.has(input.source)) {
    throw new Error("recordOutcome: source is required and must be one of ci|environment|database|business_event|human");
  }

  const occurredAt = input.occurredAt === undefined ? new Date() : new Date(input.occurredAt);
  if (Number.isNaN(occurredAt.getTime())) {
    throw new Error("recordOutcome: occurredAt must be a valid date");
  }

  const body = JSON.stringify({
    correlation_kind: "task",
    correlation_id: taskId,
    source: input.source,
    observed_outcome: `${contract} ${stableStringify(input.values, "values")}`,
    confidence,
    evidence_refs: evidenceRefs,
    occurred_at: occurredAt.toISOString(),
  });

  const doFetch: FetchLike = client.fetch ?? ((url, init) => globalFetch(url, init));

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Pass source as one of ci, environment, database, business_event, or human.

When it happens

Trigger: Thrown at packages/mastra/src/index.ts:679 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/1a4582d494cebe95. Report an issue: GitHub.