Skip to main content

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.

StatusMeaning
validEvery required check completed within the Verification Context, with no violations and no unresolved required parents.
invalidOne or more protocol violations were detected.
incompleteRequired parent Blocks are unavailable, with no detected violations.
resource_limit_reachedAn 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.

FieldMeaning
protocolVersion"1"
graphRootblockHash of the seed Block
validationModeclosed-world or open-world. Closed-world validation is the default.
externalParentsExternal-parent declarations, each with a hash and a boundary reason. Empty under closed-world validation.
maxDepthOptional scope in parent edges from graphRoot. A valid result covers only Blocks within that depth.
resourceLimitsOptional execution budgets: maxBlocks and maxEdges.

Status Examples​

report declares analysis as its parent, and analysis declares source.

Evaluated Blocks and contextStatus
All three Blocks, closed-worldvalid
source missing, closed-worldincomplete
source missing, open-world, source declared in externalParentsvalid; source remains unverified
source missing, open-world, source not declaredincomplete
source missing, maxDepth: 1valid for report and analysis only
All three Blocks, maxBlocks: 2resource_limit_reached
analysis content edited, maxBlocks: 2invalid; 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.