Skip to content

feat: cross-repository artifact linking#8

Open
avrabe wants to merge 24 commits intomainfrom
feat/cross-repo-linking
Open

feat: cross-repository artifact linking#8
avrabe wants to merge 24 commits intomainfrom
feat/cross-repo-linking

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 10, 2026

Summary

  • Add externals config block in rivet.yaml for declaring cross-repo dependencies (git URL or local path)
  • Prefixed ID syntax (rivet:REQ-001) for cross-repo artifact references
  • rivet sync — fetch/clone external repos into .rivet/repos/ cache (symlinks for local paths)
  • rivet lock — pin externals to exact commit SHAs in rivet.lock
  • rivet validate — cross-repo link validation, bidirectional backlink detection, circular dependency warnings, version conflict detection, V-model lifecycle completeness checks
  • rivet baseline verify <name> / rivet baseline list — distributed baselining via baseline/* convention tags
  • embed-wasm feature flag for single-binary WASM/JS asset embedding
  • Built-in docs: cross-repo topic, STPA/ASPICE/cybersecurity methodology references
  • Dogfood artifacts: REQ-020/021/022, DD-014–017, FEAT-033–039

Architecture

Mesh topology — any rivet repo can link to any other. No central authority. Bidirectional links stored on one side, backlinks computed at analysis time (OSLC model). Transitive dependency discovery. Distributed baselines via git tags.

New modules

  • rivet-core/src/externals.rs (1361 lines) — sync, load, validate, lockfile, baseline, backlinks, cycle/conflict detection
  • rivet-core/src/lifecycle.rs (218 lines) — V-model traceability completeness checks

Test plan

  • 30 new tests (24 externals, 4 lifecycle, 2 config integration)
  • 194 total tests passing
  • Clippy clean with -D warnings
  • Manual: rivet sync with a real external repo
  • Manual: rivet baseline verify with tagged repos
  • Manual: rivet validate with cross-repo links in meld

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

avrabe and others added 24 commits March 9, 2026 19:55
Comprehensive audit covering source-ref integrity (20 refs, 1 fixed),
test coverage (151 tests across 6 levels), benchmark coverage (19 cases
in 7 groups), fuzz/mutation testing status (not yet implemented), and
traceability (85 artifacts, 0 broken links, 0 orphans).

Fix DD-002 source-ref from non-existent graph.rs to links.rs.

Overall quality score: 73% — strong foundation with gaps in fuzz
testing, mutation testing, and benchmark coverage for newer modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 fuzz targets (cargo-fuzz/libfuzzer) for untrusted-input boundaries:
- fuzz_yaml_artifact: YAML artifact deserialization
- fuzz_schema_merge: schema parsing and merge operations
- fuzz_reqif_import: ReqIF XML import parsing
- fuzz_document_parse: markdown frontmatter parsing

Add 3 new benchmark groups (9 cases) to core_benchmarks.rs:
- diff: ArtifactDiff::compute at 100/1000/10000 scale
- query: query::execute filtering at 100/1000/10000 scale
- document_parse: Document::parse at 10/100/1000 sections

Update pre-commit hooks:
- rivet validate --strict (dogfood on artifact/schema changes)
- cargo bench --no-run (compile check, pre-push)
- cargo mutants smoke run (pre-push)

Add CI jobs:
- mutants: cargo-mutants on rivet-core (informational, non-blocking)
- fuzz: 30s per target on push to main (informational, non-blocking)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s, ReqIF.ForeignID)

StrictDoc's ReqIF output uses patterns rivet didn't handle:
- ATTRIBUTE-DEFINITION-ENUMERATION interleaved with STRING defs
  (quick-xml failed with "duplicate field"). Fixed by enabling the
  overlapped-lists feature.
- ATTRIBUTE-VALUE-ENUMERATION for enum fields (e.g. TYPE=Functional).
  Added enum value resolution via DATATYPE-DEFINITION-ENUMERATION.
- ReqIF.ForeignID as the human-readable UID (ZEP-SRS-18-1), with
  the XML IDENTIFIER being a UUID. Now used as artifact ID.
- ReqIF.Name / ReqIF.ChapterName as title, ReqIF.Text as description.
- SPECIFICATION-TYPE elements (parsed but ignored).
- Duplicate ATTRIBUTE-DEFINITION-STRING tolerance (first wins).
- UUID-to-resolved-ID mapping for SPEC-RELATION link targets.

Tested with Zephyr RTOS reqmgmt export: 256 artifacts, 223
requirements with ZEP-* IDs, 132 parent links preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support remapping artifact types during ReqIF import via source config:

  sources:
    - path: upstream.reqif
      format: reqif
      config:
        type-map.requirement: sw-req
        type-map.section: documentation

Keys are matched case-insensitively against the resolved artifact type.
Unmapped types pass through unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…fooding

Adds `rivet commits` and `rivet commit-msg-check` commands for tracing
git commits to artifacts. Includes trace-exempt-artifacts config for
pre-existing artifacts, pre-commit hook setup, and built-in documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…L access

Eliminates /?goto= redirect pattern that caused race conditions, lost
query params and hash fragments. Non-HTMX requests now get full page
layout wrapped around the partial content inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… analyses

Bumps spar to rev 5073591, syncs WIT with analyze function and
analysis-diagnostic record, registers 12 new analysis passes
(flow/mode/binding/property rules, EMV2, ARINC653, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Design covers mesh topology, prefixed IDs, externals config, cache/sync,
distributed baselining, and WASM embedding. 12-task implementation plan
with TDD steps. Also includes commit traceability design/plan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ExternalProject struct and optional externals field to ProjectConfig,
supporting both git URL and local path sources with prefix-based
cross-linking. This is the foundation for cross-repo artifact tracing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-033

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements sync_external (symlink for path, clone/fetch for git),
sync_all (batch sync), and ensure_gitignore (.rivet/ cache entry).

Implements: FEAT-034

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-035

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-034, FEAT-035

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Checks that artifacts with "done"/"implemented" status have complete
downstream traceability chains (requirement → architecture → design → test).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-037

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trace: skip

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements: FEAT-036

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trace: skip

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix clippy for_kv_map warnings: use `.values()` when only value is needed
- Extract `resolve_external_dir` helper to deduplicate path resolution
  across 6 call sites in externals.rs and 1 in main.rs
- Wire `read_lockfile` into `cmd_sync` to warn about version drift
- Print a note when `--update` flag is passed to `cmd_lock`
- Replace `unwrap_or(".")` with proper error propagation in git clone

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 86.17933% with 242 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/externals.rs 87.07% 117 Missing ⚠️
rivet-core/src/reqif.rs 69.60% 62 Missing ⚠️
rivet-core/src/commits.rs 92.29% 37 Missing ⚠️
rivet-core/src/formats/aadl.rs 0.00% 20 Missing ⚠️
rivet-core/src/model.rs 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

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