Skip to content

feat(supplier): cross-org boundary MVP — external-anchor + 3-state coverage (#253)#286

Merged
avrabe merged 1 commit into
mainfrom
feat/cross-org-supplier-mvp
May 16, 2026
Merged

feat(supplier): cross-org boundary MVP — external-anchor + 3-state coverage (#253)#286
avrabe merged 1 commit into
mainfrom
feat/cross-org-supplier-mvp

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 16, 2026

Summary

MVP for the cross-organizational / supplier-management traceability track (docs/design/cross-org-supplier-traceability.md §6). Smallest version that demonstrates the boundary-coverage semantic — stops conflating "we missed it" with "delegated to a supplier."

What ships

  • external-anchor artifact type in schemas/common.yaml — a typed leaf marking the point where the in-house chain hands off to a supplier. Fields: source-of-truth, expected-derived-types (contract), received-status (lifecycle of the delivery), contract-reference.

  • 3-state coverage in rivet-core/src/coverage.rsCoverageEntry gains external_boundary + external_boundary_ids (additive; existing JSON contract unchanged). Sum invariant: covered + external_boundary + uncovered_ids.len() == total. Classification rule: only counts as boundary when the anchor's expected-derived-types actually covers the rule's target type — off-contract anchors do not silently absorb gaps.

  • rivet supplier list + rivet supplier check — read-only auditor surface. list shows declared anchors; check prints the 3-state breakdown filtered to rules with boundary or uncovered findings.

  • rivet coverage output extended additively. Text adds a Boundary column + summary line only when ≥1 boundary exists. JSON adds external_boundary, external_boundary_ids, accounted_percentage.

What is NOT in this PR

Deferred to Phase 2 per the design doc:

  • Structured external link target (derives-from-external with mapping target).
  • Federation handshake (rivet supplier pull for ReqIF / file).
  • Field-mapping recipes at the import boundary.
  • FederationProvenance block on imported artifacts.

The MVP describes the boundary without federating across it. That's the audit-critical step; federation is the Phase 2 follow-up.

Test plan

  • cargo test -p rivet-core --lib coverage:: — 8 pass (2 new boundary tests: chain-terminates-as-boundary; off-contract-anchor-still-uncovered).
  • cargo test --workspace --lib — green (988 → 990 after the two new tests).
  • cargo test -p rivet-cli --test cli_commands supplier — 3 pass (list text, list json, check classifies DD as boundary).
  • cargo clippy --workspace --all-targets — clean.
  • Manual smoke: rivet supplier list + rivet supplier check on a project with an external-anchor + delegating DD produce the expected text + JSON output.

🤖 Generated with Claude Code

…verage (#253)

MVP for the cross-organizational / supplier-management traceability track
(docs/design/cross-org-supplier-traceability.md §6).

- **`external-anchor` artifact type** in `schemas/common.yaml`: a typed
  leaf marking the point at which the in-house chain hands off to a
  supplier. Fields: `source-of-truth` (mapping), `expected-derived-types`
  (list of artifact types the supplier is contracted to produce),
  `received-status` (enum: not-received / received-as-reqif|pdf|oslc|
  polarion-export|arxml|other), `contract-reference` (optional, points at
  the DIA / PO).

- **3-state coverage** in `rivet-core/src/coverage.rs`:
  `CoverageEntry` gains `external_boundary: usize` +
  `external_boundary_ids: Vec<String>`. Sum invariant: `covered +
  external_boundary + uncovered_ids.len() == total`. Classification
  rule: when an unsatisfied source artifact has a forward link to an
  `external-anchor` whose `expected-derived-types` overlaps the rule's
  target types (or the rule is unrestricted), it counts as
  `external_boundary` instead of `uncovered`. Off-contract anchors do
  NOT silently absorb gaps.

- **`rivet supplier list`** + **`rivet supplier check`** CLI commands —
  read-only surface for the auditor. `list` enumerates declared
  anchors with their received-status and expected derivatives; `check`
  prints the 3-state breakdown filtered to rules with boundary or
  uncovered findings.

- **`rivet coverage`** text and JSON output extended with the new
  fields. Text output adds a Boundary column and breakdown summary
  only when at least one boundary exists, keeping the common case
  uncluttered. JSON adds `external_boundary`, `external_boundary_ids`,
  `accounted_percentage` to each rule and an `external_boundary` total
  to the overall block (additive, no schema break).

Tests:
- Unit tests for the classification rule: boundary terminates chain,
  off-contract anchor still uncovered, 3-state sum invariant.
- 3 integration tests: `supplier list` text output, `supplier list`
  JSON shape, `supplier check` classifies a delegated DD as
  external_boundary.

Out of MVP scope (deferred to Phase 2 per the design doc): structured
external link target, federation handshake / `rivet supplier pull`,
field-mapping recipes, FederationProvenance. The MVP describes the
boundary without federating across it — the audit-critical step.

Implements: REQ-010, REQ-004, REQ-007
Refs: FEAT-001

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📐 Rivet artifact delta

No artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph.

@avrabe avrabe merged commit 7c8b4ac into main May 16, 2026
18 of 38 checks passed
@avrabe avrabe deleted the feat/cross-org-supplier-mvp branch May 16, 2026 09:17
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 95.34884% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/coverage.rs 95.34% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

avrabe added a commit that referenced this pull request May 16, 2026
…290)

* release(v0.10.0): variant + supplier + AI session + TCL workstream A

Workspace version bump 0.9.0 → 0.10.0. Theme: audit-grade story —
three orthogonal features that together move rivet from "trace your
project" to "describe the boundary and defend the tool's role across
it."

Highlights (full notes in CHANGELOG.md):
- Variant-aware properties — per-variant field values (#285, #255).
- Cross-org / supplier-boundary coverage MVP (#286, #253).
- AI session provenance — schema half (#289, partially #127).
- Tool-qualification workstream A — typed claim + dossier (#289).
- rivet stats --qualification + --qualification-mode flag (#289).
- TCL/TQL numbering convention fix in dogfood STPA (#289).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(release): docs-check violations on v0.10.0 release commit

Two docs-check violations on PR #290:
- VersionConsistency: vscode-rivet/package.json bumped 0.9.0 → 0.10.0
  (it has its own version field, not workspace-inherited).
- SubcommandReferences: CHANGELOG mentioned `rivet audit` which is a
  Phase 2 future subcommand. Rephrased to "audit-side enforcement
  subcommand" so the literal `rivet audit` no longer parses as a
  current-cli reference.

Local `rivet docs check` now passes (54 files, 0 violations).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant