Skip to content

graph: surface referrers + deletions in the query/CLI core (part of #205) - #208

Merged
toddysm merged 2 commits into
mainfrom
feat/graph-referrers-cli
Aug 15, 2026
Merged

graph: surface referrers + deletions in the query/CLI core (part of #205)#208
toddysm merged 2 commits into
mainfrom
feat/graph-referrers-cli

Conversation

@toddysm

@toddysm toddysm commented Aug 15, 2026

Copy link
Copy Markdown
Owner

First slice of #205 — the CLI + query core (graph-service and dashboard surfacing follow separately, as agreed).

What

Referrers and deletions are indexed (from #201/#202) but the query/visualization layer only traversed MIRRORED_FROM/PROMOTED_FROM/BUILT_FROM. This exposes them:

  • queries.referrers(ref|digest, depth) — returns the REFERS_TO edges (referrer → subject) with artifactType, recursively (referrers-of-referrers, e.g. a signature on an SBOM).
  • Deletions — occurrence nodes now carry deletedAt/deleteReason; show() reports the tombstone and the subject's referrers.
  • New cssc-graph referrers command (--ref/--digest, --depth, --format text|json).
  • Export labels disambiguate occurrences by short digest and mark deleted nodes; referrer edges are labelled with their artifactType in mermaid/cytoscape and text.

Validation

  • cssc_graph suite: 47 passed (5 new — referrers query, show referrers, show marks deleted, node-label disambiguation, CLI referrers).
  • graph-service: 16 passed (shared query layer; additive node fields).
  • Verified against the live data branch: cssc-graph referrers --ref golden/python@<digest> shows the in-toto referrer edge.

Follow-up (rest of #205)

  • graph-service endpoint / include param for referrers + deletion, and the dashboard observability view.

Refs #205

Adds the CLI/query slice of #205 (graph-service + dashboard follow to
come):
- queries.referrers(ref|digest, depth): REFERS_TO edges (referrer ->
  subject) with artifactType, recursive for referrers-of-referrers.
- Occurrence nodes now carry deletedAt/deleteReason; show() reports the
  deletion tombstone and the subject's referrers.
- New cssc-graph referrers command; show/export surface deletion.
- Export labels disambiguate occurrences by short digest and mark
  deleted nodes; referrer edges label with artifactType.

47 cssc_graph + 16 graph-service tests pass; referrers verified against
the live data branch.

Refs #205
Copilot AI lite review requested due to automatic review settings August 15, 2026 02:30

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

Surfaces REFERS_TO referrer relationships and deletion tombstones in the shared cssc_graph query/export layer and CLI, so the CLI (and later graph-service/dashboard) can display referrers and deleted occurrences alongside existing supply-chain path traversal.

Changes:

  • Added queries.referrers() traversal for REFERS_TO edges (including artifactType) and surfaced referrers + deletion state in show().
  • Enhanced export labeling to disambiguate occurrences by short digest and mark deleted nodes; edge labels now include referrer artifactType.
  • Added cssc-graph referrers CLI command and expanded test coverage for referrers/deletions/labels/CLI.

Reviewed changes

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

File Description
apps/python-app/libs/cssc_graph/tests/test_queries.py Adds tests covering referrers query behavior, show() deletion/referrer surfacing, label formatting, and the new CLI command.
apps/python-app/libs/cssc_graph/cssc_graph/queries.py Implements referrers() query traversal, deletion fields in occurrence reads, and updated export labeling for nodes/edges.
apps/python-app/libs/cssc_graph/cssc_graph/cli.py Adds referrers subcommand and updates text output to display referrer artifact types and deletion tombstones.

💡 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 apps/python-app/libs/cssc_graph/cssc_graph/queries.py Outdated
Comment thread apps/python-app/libs/cssc_graph/cssc_graph/queries.py
- Key REFERS_TO edge dedup on (from, to, artifactType, observedAt) so
  distinct observations/artifact types between the same pair are kept
  (matching the indexer's append-only merge), and fix the seen_edges
  type annotation to the 4-tuple.
- referrers() now loops range(depth): depth=0 returns only the subject,
  consistent with traverse(). Add a test for it.
@toddysm
toddysm merged commit 21c6736 into main Aug 15, 2026
3 checks passed
@toddysm
toddysm deleted the feat/graph-referrers-cli branch August 15, 2026 02:43
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.

2 participants