Diagnostics and exit behavior

Authoring errors provide:

TypeScript
type WomlDiagnostic = {
  code: string;
  phase: "parse" | "validation" | "compile" | "runtime";
  message: string;
  file: string;
  location: {
    start: { line: number; column: number; offset: number };
    end?: { line: number; column: number; offset: number };
  };
  hint?: string;
};

Line/column are one-based; byte offset is zero-based. Locations point into the original .woml, including translated script locations when available. Diagnostics may include several sorted errors, with one primary diagnostic.

Representative codes:

CodeMeaning
WOML_UNKNOWN_ELEMENT, WOML_UNKNOWN_ATTRIBUTEUnsupported or misplaced syntax.
WOML_DUPLICATE_IDStructural identity collision.
WOML_INVALID_REFERENCE, WOML_UNKNOWN_REFERENCEMalformed or unknown declarative reference.
WOML_REFERENCE_NOT_DOMINATINGOutput is not guaranteed before the consumer.
WOML_REFERENCE_NOT_AVAILABLERuntime nested property is missing.
WOML_BRANCH_TEST_NOT_BOOLEAN<when> resolved to a non-boolean.
WOML_SWITCH_VALUE_INVALIDSwitch input is not a string.
WOML_TRIGGER_SCHEMA_INVALIDIngress payload failed its JSON Schema.
WOML_TRIGGER_IDEMPOTENCY_CONFLICTSame occurrence ID reused with different data.
WOML_POLICY_QUEUE_FULLDurable policy queue reached capacity.
WOML_WORKFLOW_TIMED_OUTTotal workflow deadline won.
WOML_WORKFLOW_TARGET_NOT_FOUNDCalled/started workflow is not actively owned.
WOML_WORKFLOW_CALL_CYCLECall lineage would cycle.
WOML_WORKFLOW_CALL_WAIT_UNSUPPORTEDSynchronous call target contains approval.

A non-zero CLI exit means the requested finite operation failed. Long-lived run, inspect, and log-follow commands normally end through Ctrl+C or an explicit stop.