--- id: INT-8 family: RT-INT level: extended profiles: [runtime] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/rt-int/int-8 specification: FlowDrop Workflow Specification 1.0 licence: CC BY 4.0 --- # INT-8 — Snapshot validation reports named errors and non-fatal warnings *RT-INT (Part II) · level: extended · profiles: runtime · added in 1.0* Validating a snapshot against a workflow definition answers with codes a caller can act on, and draws a hard line between what invalidates a snapshot and what is merely worth saying. ## The rule > **Normative.** This is the rule. > > 1. Validating a snapshot against a workflow definition MUST yield a result carrying named codes. > > 2. Each of the following errors MUST make the result invalid: a version mismatch; one unknown-node error per snapshot node absent from the definition; and one dependency-not-met error per completed node whose dependency has no recorded state or is neither completed nor skipped. > > 3. The version check MUST be skipped when the snapshot's workflow version is absent. > > 4. A version that is present MUST be compared, an empty one or a `null` included. > > 5. The following warnings MUST NOT make the result invalid: one per definition node missing from the snapshot, and one per completed injected node that has dependencies. ## What it means Validating a snapshot against a workflow definition treats two kinds of mismatch very differently. A snapshot node the definition no longer knows — the graph changed under a run that is trying to resume into it — is an error: the result is invalid and a resume cannot go ahead. A definition node the snapshot has simply not reached yet is only a warning: that is the ordinary shape of a mid-run snapshot, and a warning that flipped the result to invalid would get every resumable snapshot refused. The version check has an exception worth naming: a snapshot that carries no workflow version at all skips the comparison rather than counting as a mismatch. A snapshot built with no known version has nothing to compare, and treating "unknown" as "different" would refuse every such snapshot regardless of the definition it is checked against. An empty version is not "unknown": it is a version, the empty string, and is compared like any other. ## Example The workflow declares two nodes, `node_1` and `node_2`. Only `node_1` has completed so far. ```json title="A snapshot node the definition does not know" verdict="invalid" {"id": "unknown_node"} ``` ```json title="A definition node the snapshot has not reached yet" verdict="valid" {"id": "node_2"} ``` ```json title="What validation reports for the second case" {"code": "WARNING_ORPHAN_NODE", "nodeId": "node_2"} ``` The first case invalidates the result; the second is recorded as a warning and the result stays valid. ## Why Recorded under [OPEN-25](https://flowdrop.io/spec/rulings/open-25), [OPEN-26](https://flowdrop.io/spec/rulings/open-26). ## Fixtures Test cases whose outcome this rule decides (fixtures/README.md defines each operation): - A snapshot with no workflow version skips the version check (`validate-snapshot`): fixtures/presence/snap-version-absent-skipped.json - An empty workflow version is compared, and mismatches (`validate-snapshot`): fixtures/presence/snap-version-empty-compared.json - A null workflow version is compared, and mismatches (`validate-snapshot`): fixtures/presence/snap-version-null-compared.json ## Related rules - Names: INT-7, INT-14 - Referenced by: INT-7 --- Rule identifiers are permanent and are never renumbered. This specification carries no implementation status: each implementation publishes its own standing against these rules. Licensed CC BY 4.0.