feat(offers): the customer is offered a supplier's release and answers it (#1028) #1064

Merged
sharang merged 3 commits from feat/sbom-offers into main 2026-11-19 13:10:21 +00:00
3 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 7bd2d784e9 fix(offers): the release check reads as clippy 1.94 wants it (#1028)
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 5m14s
CI / Check (pull_request) Successful in 22m34s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-19 13:46:53 +01:00
Sharang ParnerkarandClaude Opus 5.5 79dd08977d fix(offers): claim before creating, live releases, entitled peers, deletes on both sides (#1028)
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 5m54s
CI / Check (pull_request) Failing after 7m23s
- accepting claims the offer first (offered -> accepted, atomically) and
  only then creates the component, giving the claim back when that fails;
  an end that lands in between removes the still-empty component; of two
  acceptances into one component neither keeps it (`target_taken`), and
  the id is compared canonically;
- an offer is acceptable only while the supplier's release still exists
  and has not ended, besides the connection joining the two;
- a release is refused (`peer_not_entitled`) when the other workspace does
  not hold Prüfwerk or is halted or archived, so no database is created for
  it;
- deleting a target ends its releases at their customers and ends offers
  accepted into it, with `ended` as the answer the supplier sees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-19 13:36:45 +01:00
Sharang ParnerkarandClaude Opus 5.5 4ee36f7c5a feat(offers): the customer is offered a supplier's release and answers it (#1028)
The first half of phase 4's customer side (step 5 of the plan on #1028):

- releasing a target (#1063) now writes an offer into the customer's
  database, right after the registry confirms the connection joins exactly
  the two workspaces (`ConnectionState::peer_of`, #1062); without the offer
  the release is taken back;
- `GET /api/v1/sbom-offers`: the workspace's offers, open first, naming the
  supplier and its product only;
- `POST /api/v1/sbom-offers/{id}/accept`: into an existing supplier
  component, or a new one (named after the product unless named, in the
  given projects); the connection is checked again first, and an ended one
  ends the offer and creates nothing; a new component goes through the same
  insert as `POST /api/v1/targets` (`insert_target`), so it is counted;
- `POST /api/v1/sbom-offers/{id}/decline`;
- the answer is written back to the supplier's release (`answer`); ending a
  release ends the customer's offer; accepting and declining are audited.

Delivering published versions to accepted offers is the second half.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-19 13:36:45 +01:00