Lineage Graphs
ALX connects Blocks through declared parent relationships, forming directed derivation Graphs. Applications traverse these Graphs to inspect upstream dependencies and verify recorded lineage.
A valid derivation Graph is acyclic. Individual Blocks can pass Block validation while the surrounding Graph is incomplete or structurally invalid.
Graph Verification
validateGraph(seed, source, context) examines the seed Block and every Block reachable from it through declared parents in the supplied Block source, within a Verification Context. For each examined Block, Graph verification recomputes contentHash and blockHash and checks parent hash format, duplicate parent relationships, duplicate Block candidates, self-references, cycles, and parent availability.
Graph verification returns one of four statuses. When more than one condition applies, invalid takes precedence over resource_limit_reached, and resource_limit_reached takes precedence over incomplete. A missing parent alone never produces invalid. The result lists protocol violations in issues and unavailable required parents in missingParents.
| Status | Meaning |
|---|---|
valid | Every required check completed within the Verification Context, with no violations and no unresolved required parents. |
invalid | One or more protocol violations were detected. |
incomplete | Required parent Blocks are unavailable, with no detected violations. |
resource_limit_reached | An execution budget stopped verification before every required check completed, with no detected violations. |
Verification Context
A status applies only to the Verification Context recorded with the result. The verification context schema defines every field.
| Field | Meaning |
|---|---|
protocolVersion | "1" |
graphRoot | blockHash of the seed Block |
validationMode | closed-world or open-world. Closed-world validation is the default. |
externalParents | External-parent declarations, each with a hash and a boundary reason. Empty under closed-world validation. |
maxDepth | Optional scope in parent edges from graphRoot. A valid result covers only Blocks within that depth. |
resourceLimits | Optional execution budgets: maxBlocks and maxEdges. |
Status Examples
report declares analysis as its parent, and analysis declares source.
| Evaluated Blocks and context | Status |
|---|---|
| All three Blocks, closed-world | valid |
source missing, closed-world | incomplete |
source missing, open-world, source declared in externalParents | valid; source remains unverified |
source missing, open-world, source not declared | incomplete |
source missing, maxDepth: 1 | valid for report and analysis only |
All three Blocks, maxBlocks: 2 | resource_limit_reached |
analysis content edited, maxBlocks: 2 | invalid; the violation takes precedence over the budget |
Partial Graphs
Applications can verify a subset of a larger derivation Graph. Closed-world validation requires every declared parent Block. Open-world validation accepts parents explicitly declared in externalParents; those parents remain unverified, and any other missing parent still produces incomplete. Graph completeness describes the evaluated Block set, not the existence or availability of Blocks in other systems.
Graph Traversal
traceAttribution(rootHash, graph) follows declared parents from a selected Block and returns the reachable ancestors, edges, depths, path counts, and root Blocks. A partial Graph produces a Trace with complete: false. See Lineage and Attribution for the Trace fields.
When to Use Graph Operations
Use Graph verification and traversal to inspect declared dependencies across multiple Blocks, verify available lineage, reconstruct multi-step derivations, or retrieve prior work for subsequent operations.