Graph Index Canonical Schema

Ownership: Graph Indexer Guild • Version 2025-11-03 (Sprint 140)
Scope: Canonical node and edge schemas, attribute dictionary, identity rules, and fixture references for the Graph Indexer foundations (GRAPH-INDEX-28-001).

1. Purpose

2. Node taxonomy

Node kindIdentity tuple (ordered)Required attributesPrimary sources
artifacttenant, artifact_digest, sbom_digestdisplay_name, artifact_digest, sbom_digest, environment, labels[], origin_registry, supply_chain_stageScanner WebService, SBOM Service
componenttenant, purl, source_typepurl, version, ecosystem, scope, license_spdx, usageSBOM Service analyzers
filetenant, artifact_digest, normalized_path, content_sha256normalized_path, content_sha256, language_hint, size_bytes, scopeSBOM layer analyzers
licensetenant, license_spdx, source_digestlicense_spdx, name, classification, notice_uriSBOM Service, Concelier
advisorytenant, advisory_source, advisory_id, content_hashadvisory_source, advisory_id, severity, published_at, content_hash, linkset_digestConcelier
vex_statementtenant, vex_source, statement_id, content_hashstatus, statement_id, justification, issued_at, expires_at, content_hashExcititor
policy_versiontenant, policy_pack_digest, effective_frompolicy_pack_digest, policy_name, effective_from, expires_at, explain_hashPolicy Engine
runtime_contexttenant, runtime_fingerprint, collector, observed_atruntime_fingerprint, collector, observed_at, cluster, namespace, workload_kind, runtime_stateSignals, Zastava
assettenant, type, source, external_idschema_version, asset_id, type, tenant_id, source, external_id, criticality, ownership, depends_on, asset_attributes, first_seen, last_seen, tombstoneGraph Asset Registry

3. Edge taxonomy

Edge kindSource → TargetIdentity tuple (ordered)Required attributesDefault validity
CONTAINSartifactcomponenttenant, artifact_node_id, component_node_id, sbom_digestdetected_by, layer_digest, scope, evidence_digestvalid_from = sbom_collected_at, valid_to = null
DEPENDS_ONcomponentcomponenttenant, component_node_id, dependency_purl, sbom_digestdependency_purl, dependency_version, relationship, evidence_digestDerived from SBOM dependency graph
DECLARED_INcomponentfiletenant, component_node_id, file_node_id, sbom_digestdetected_by, scope, evidence_digestMirrors SBOM declaration
BUILT_FROMartifactartifacttenant, parent_artifact_node_id, child_artifact_digestbuild_type, builder_id, attestation_digestDerived from provenance attestations
AFFECTED_BYcomponentadvisorytenant, component_node_id, advisory_node_id, linkset_digestevidence_digest, matched_versions, cvss, confidenceConcelier overlays
VEX_EXEMPTScomponentvex_statementtenant, component_node_id, vex_node_id, statement_hashstatus, justification, impact_statement, evidence_digestExcititor overlays
GOVERNS_WITHpolicy_versioncomponenttenant, policy_node_id, component_node_id, finding_explain_hashverdict, explain_hash, policy_rule_id, evaluation_timestampPolicy Engine overlays
OBSERVED_RUNTIMEruntime_contextcomponenttenant, runtime_node_id, component_node_id, runtime_fingerprintprocess_name, entrypoint_kind, runtime_evidence_digest, confidenceSignals/Zastava ingestion
ASSET_VERSIONasset -> assettenant, asset_id, event_type, previous_asset_hash, current_asset_hashschema_version, asset_id, event_type, previous_asset_hash, current_asset_hash, effective_at, tombstoneAsset registry lineage

4. Attribute dictionary

AttributeTypeApplies toDescription
tenantstringnodes, edgesTenant identifier (enforced on storage and query).
kindstringnodes, edgesOne of the values listed in the taxonomy tables.
canonical_keyobjectnodesOrdered tuple persisted as a JSON object matching the identity tuple components.
idstringnodes, edgesDeterministic identifier (gn: or ge: prefix + Base32-encoded SHA-256).
hashstringnodes, edgesSHA-256 of the canonical JSON representation (normalized by sorted keys).
attributesobjectnodes, edgesDomain-specific attributes (all dictionary keys kebab-case).
provenanceobjectnodes, edgesIncludes source, collected_at, sbom_digest, attestation_digest, event_offset.
valid_fromstring (ISO-8601)nodes, edgesInclusive timestamp describing when the record became effective.
valid_tostring (ISO-8601 or null)nodes, edgesExclusive timestamp; null means open-ended.
scopestringnodes, edgesScope label (e.g., runtime, build, dev-dependency).
labelsarray[string]nodesFree-form but deterministic ordering (ASCII sort).
confidencenumberedges0-1 numeric confidence score for overlay-derived edges.
evidence_digeststringedgesSHA-256 digest referencing the immutable evidence payload.
linkset_digeststringnodes, edgesSHA-256 digest to Concelier linkset documents.
explain_hashstringnodes, edgesHash of Policy Engine explain trace payload.
runtime_statestringruntime_context nodesAggregated runtime state (e.g., Running, Terminated).
asset_idstringasset nodes, ASSET_VERSION edgesDeterministic Graph node id for the asset.
typestringasset nodesOne of host, container, image, service, integration, plugin.
ownershipobjectasset nodesOpaque ownerActorRef, ownerTeamRef, and credentialRefs; no dereferenced secrets or PII.
tombstonebooleanasset nodes, ASSET_VERSION edgesTrue when an asset has been removed but retained for lineage.

5. Identity rules

  1. Node IDs (gn: prefix).
    id = "gn:" + tenant + ":" + kind + ":" + base32(sha256(identity_tuple))
    identity_tuple concatenates tuple components with | (no escaping) and lower-cases both keys and values unless the component is a hash or digest.
  2. Edge IDs (ge: prefix).
    id = "ge:" + tenant + ":" + kind + ":" + base32(sha256(identity_tuple))
    Edge tuples must include the resolved node IDs rather than only the canonical keys to ensure immutability under re-key events.
  3. Hashes.
    hash is computed by serializing the canonical document with:
    • UTF-8 JSON
    • Object keys sorted lexicographically
    • Arrays sorted where semantics allow (e.g., labels, matched_versions)
    • Timestamps normalized to UTC ISO-8601 (YYYY-MM-DDTHH:MM:SSZ)
  4. Deterministic provenance.
    provenance.source is a dotted string (scanner.sbom.v1, concelier.linkset.v1) and provenance.event_offset is a monotonic integer for replay.

6. Validity window semantics

7. Fixtures & verification

8. Change control

9. References