feat(ontology): add PackageFile node and package-file edges
What does this MR do and why?
Completes Phase 2 of Orbit package-registry coverage. The package-file replication tables already stream into ClickHouse, but nothing in the graph consumed them, so package files were invisible. This adds the package-file entity plus its links to the owning package and to the pipeline that produced it. That gives file-level provenance — for example, which specific artifact came out of a given pipeline — and turns already-replicated, dormant data into queryable graph entities. No change to existing graph entities.
Related Issues
Relates to gitlab-org/gitlab#601009 (closed)
Testing
mise ontology:validate passes. Full ontology + indexer suites pass (142 + 431); the new node and edges flow through the plan builder exercised by the every-plan-renders-valid-SQL test. mise schema:generate:ddl diff is limited to the new gl_package_file table plus the version-prefix bump.
Performance Analysis
Additive only: one new node table and two edges materialized from data that is already replicated. No change to any existing entity's extract or storage.
- This merge request does not introduce any performance regression.
Agent context — long-form analysis
Background
Phase 2's CDC tables (siphon_packages_package_files, siphon_packages_package_file_build_infos) merged earlier but the ontology half never shipped, so the data replicated with no consumer. This is the ontology half; it needs no Rails change because package_file is already registered in the EE redaction service (EE_RESOURCE_CLASSES), so the node returns rows rather than failing closed.
Changes
PackageFilenode (config/ontology/nodes/packages/package_file.yaml) — sourced fromsiphon_packages_package_files; propertiesfile_name,size,file_sha256,status(enum: default / pending_destruction / processing / error),created_at,project_id,traversal_path. Redactionresource_type: package_file,ability: read_package.HAS_PACKAGE_FILEedge (config/ontology/edges/has_package_file.yaml) —Package → PackageFilevia thepackage_idforeign key (an incoming FK edge on the node'setl.edges, same shape asHAS_JOB). Registered inschema.yaml.- File-level
BUILT_BY— a second variant on the existingbuilt_by.yaml(PackageFile → Pipeline), sourced from thesiphon_packages_package_file_build_infosjoin table, alongside the existingPackage → Pipelinevariant. Same verb/semantic, so no new relationship kind. PackageFileregistered underpackages.nodesinschema.yaml;SCHEMA_VERSION75 → 76;config/graph.sql/config/graph_local.sqlregenerated.
Naming
HAS_FILE was already taken by an unrelated code-review edge (MergeRequestDiff → MergeRequestDiffFile), so the package containment edge is HAS_PACKAGE_FILE to avoid overloading one relationship kind across domains.
New traversals unlocked
Package → HAS_PACKAGE_FILE → PackageFile— the files that make up a package.PackageFile → BUILT_BY → Pipeline— per-artifact (SBOM-style) provenance.PackageFile → IN_PROJECT → Project.
Files
config/ontology/nodes/packages/package_file.yaml(new)config/ontology/edges/has_package_file.yaml(new)config/ontology/edges/built_by.yaml(variant + ETL entry)config/ontology/schema.yaml(node + edge registration)config/SCHEMA_VERSION,config/graph.sql,config/graph_local.sql(regenerated)