Skip to content

Roll per-platform child referrers up to the index in graph queries - #221

Merged
toddysm merged 2 commits into
mainfrom
feat/rollup-platform-referrers
Aug 28, 2026
Merged

Roll per-platform child referrers up to the index in graph queries#221
toddysm merged 2 commits into
mainfrom
feat/rollup-platform-referrers

Conversation

@toddysm

@toddysm toddysm commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What

Closes the visualization gap identified in #210: per-platform attestations attach to a multi-arch index's child manifests, but promote/build lineage points at the index, so those referrers rendered as isolated satellites (8 of 9 golden/python referrers).

Building on the HAS_PLATFORM model added in #216, queries.referrers() now rolls a child's referrers up onto its index: when the subject is a multi-arch index, referrers on its per-platform children are returned as REFERS_TO edges pointing at the index, each tagged with a platform label (os/architecture[/variant]). Every attestation now attaches to the pipeline image.

Changes

  • queries.referrers — new rollup=True (default) parameter; gathers each index seed's HAS_PLATFORM children and attributes their referrer edges to the index with a platform label. rollup=False preserves the old strict behaviour. Added _platform_children / _platform_label helpers (and refactored platforms() to reuse them).
  • Renderers_edge_label surfaces the platform on cytoscape/mermaid edges and the CLI subgraph/show output.
  • Example — an application/vnd.in-toto+json attestation on the amd64 child, plus rollup + no-rollup tests.
  • DocsHAS_PLATFORM and the roll-up behaviour documented in the graph model.

53 cssc_graph tests pass; graph-service (18) and dashboard-web (25) suites unaffected.

Fixes #217

When a query subject is a multi-arch index, referrers attached to its
per-platform child manifests (e.g. per-platform attestations) are now
rolled up onto the index via HAS_PLATFORM: their REFERS_TO edges point at
the index and carry a platform label, so every attestation attaches to the
pipeline image instead of dangling off an isolated child manifest.

- queries.referrers: rollup=True (default); _platform_children/_platform_label helpers
- edge/CLI/mermaid/cytoscape renderers surface the platform label
- example: attestation on the amd64 child; rollup + no-rollup tests
- docs: HAS_PLATFORM + roll-up behavior in the graph model

Fixes #217
Copilot AI lite review requested due to automatic review settings August 15, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the supply-chain graph query/rendering layer so referrers (e.g., attestations) that are attached to per-platform child manifests can be “rolled up” and displayed as referring to the multi-arch index, closing a visualization gap for multi-arch images.

Changes:

  • Add rollup (default True) to queries.referrers() to attribute per-platform child referrers to the parent index and tag edges with a platform label.
  • Surface platform labels in Cytoscape/Mermaid exports and CLI text output.
  • Add a new example referrer record and extend tests to validate rollup vs. no-rollup behavior; document the updated graph model behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
supply-chain-graph/examples/referrer-observed-platform.yaml Adds an example ReferrerObserved record for a per-platform child attestation.
docs/architecture/observability/supply-chain-graph.md Documents HAS_PLATFORM and the referrer roll-up behavior in the graph model docs (plus formatting changes).
apps/python-app/libs/cssc_graph/tests/test_queries.py Adds tests covering rollup behavior and ensuring child nodes are not introduced by rollup.
apps/python-app/libs/cssc_graph/cssc_graph/queries.py Implements rollup logic in referrers(), refactors platform child retrieval, and adds edge labeling helper.
apps/python-app/libs/cssc_graph/cssc_graph/cli.py Updates CLI text output to include {platform} for edges/referrers when present.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/python-app/libs/cssc_graph/cssc_graph/queries.py
Comment thread docs/architecture/observability/supply-chain-graph.md Outdated
…ervice (rollup query param); fix HTTP API doc fence nesting + document referrers endpoint
@toddysm
toddysm merged commit 108122e into main Aug 28, 2026
3 checks passed
@toddysm
toddysm deleted the feat/rollup-platform-referrers branch August 28, 2026 03:50
toddysm added a commit that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roll up per-platform attestations to the image in graph queries/views

2 participants