feat(supply-chain): the supply chain as a graph (#1051) #1055

Merged
sharang merged 1 commits from feat/supply-chain-graph into main 2026-11-19 08:59:46 +00:00
Owner

Closes #1051 (epic #1050). This is the data behind the Lieferkette page. The page itself is #1053, and the saved arrangement is #1052.

What it adds

GET /api/v1/supply-chain returns data: { nodes, edges }.

Node Key Carries
Supplier supplier:<name> the name target.supplier gives, trimmed, listed once
Component (target, not archived) target:<id> target_type, bought, open (its open CVEs)
Product project project:<id> level (family, product, component), open (summed over the distinct components beneath it)
Edge From → to Carries
supplies supplier → component delivery: how (invite for an active link from #1027, upload, or missing), version, at
part_of component → each product project in its project_ids
part_of project → its parent_id
  • A DAG: a component in two products has an edge to each. A project's counts include the components of its assemblies, and each component counts once, however many paths lead to it. A cycle in the parents ends.
  • Project model: it now reads the registry's level and parent_id (tenant-registry 0020). An empty parent_id (detached) is read as none. Topics are not part of the graph.
  • Without a registry (dev): every project id a target names shows as a product named by its id, as the machine page names it.
  • Releases: deliveries over a connection (#1028) will add a release kind when they exist.

Tests

  • Unit:
    • suppliers are named once, trimmed and sorted;
    • delivery is upload, invite or missing, with version and time;
    • the edges include assemblies and shared components, and leave out topics and unknown projects;
    • project sums count each component once, through assemblies;
    • a cycle of parents ends;
    • the dev fallback names projects by id.
  • Integration: suppliers, components and projects come back over the API, with the archived target left out, CVE counts on components and projects, delivery, and three part_of edges.
  • Checks: the OpenAPI and route gates pass, and clippy is clean on core, agent and both dashboard builds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Closes #1051 (epic #1050). This is the data behind the Lieferkette page. The page itself is #1053, and the saved arrangement is #1052. ## What it adds `GET /api/v1/supply-chain` returns `data: { nodes, edges }`. | Node | Key | Carries | |---|---|---| | Supplier | `supplier:<name>` | the name `target.supplier` gives, trimmed, listed once | | Component (target, not archived) | `target:<id>` | `target_type`, `bought`, `open` (its open CVEs) | | Product project | `project:<id>` | `level` (`family`, `product`, `component`), `open` (summed over the distinct components beneath it) | | Edge | From → to | Carries | |---|---|---| | `supplies` | supplier → component | `delivery`: `how` (`invite` for an active link from #1027, `upload`, or `missing`), `version`, `at` | | `part_of` | component → each product project in its `project_ids` | | | `part_of` | project → its `parent_id` | | - **A DAG:** a component in two products has an edge to each. A project's counts include the components of its assemblies, and each component counts once, however many paths lead to it. A cycle in the parents ends. - **`Project` model:** it now reads the registry's `level` and `parent_id` (tenant-registry 0020). An empty `parent_id` (detached) is read as none. Topics are not part of the graph. - **Without a registry (dev):** every project id a target names shows as a product named by its id, as the machine page names it. - **Releases:** deliveries over a connection (#1028) will add a `release` kind when they exist. ## Tests - **Unit:** - suppliers are named once, trimmed and sorted; - delivery is upload, invite or missing, with version and time; - the edges include assemblies and shared components, and leave out topics and unknown projects; - project sums count each component once, through assemblies; - a cycle of parents ends; - the dev fallback names projects by id. - **Integration:** suppliers, components and projects come back over the API, with the archived target left out, CVE counts on components and projects, delivery, and three `part_of` edges. - **Checks:** the OpenAPI and route gates pass, and clippy is clean on core, agent and both dashboard builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-19 08:38:52 +00:00
feat(supply-chain): the supply chain as a graph (#1051)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m43s
CI / Check (pull_request) Successful in 20m32s
fdd94a9b49
`GET /api/v1/supply-chain` returns what the workspace's products are made
of, as nodes and edges for the Lieferkette page (#1050):

- nodes: suppliers (by the name a target gives), components (targets, not
  archived) and product projects (family, product, assembly), each with a
  stable key (`supplier:<name>`, `target:<id>`, `project:<id>`);
- edges: supplier to component with how its SBOM arrives (an active invite,
  an upload, or none yet) and the version and time; component to every
  product project it is part of, so a shared component makes a DAG; project
  to the project above it;
- open CVEs on each component, and on each project the sum over the distinct
  components beneath it, through assemblies, each counted once.

`Project` now reads the registry's `level` and `parent_id` (tenant-registry
0020); an empty parent is none. Topics are left out. Without a registry
(dev) projects are named by their id, as on the machine page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit 240c4d734a into main 2026-11-19 08:59:46 +00:00
sharang deleted branch feat/supply-chain-graph 2026-11-19 08:59:47 +00:00
Sign in to join this conversation.