Skip to content

Build-system-aware cross-repo validation (Bazel, Nix) #21

@avrabe

Description

@avrabe

Context

Cross-repo traceability validation (REQ-020) currently requires manually declaring externals in rivet.yaml. But projects using Bazel or Nix already have a dependency graph with pinned revisions — rivet should be able to read it directly.

Eclipse SCORE pins 75+ repos via known_good.json → auto-generated MODULE.bazel with git_override(). Nix flakes pin inputs in flake.lock. Both contain exactly the information rivet needs: which repos, at what commits.

Problem

Maintaining a parallel dependency declaration in rivet.yaml:

  1. Drifts from the build system's source of truth
  2. Requires manual updates when repos are added/removed
  3. Forces teams to learn rivet-specific config when they already express this in Bazel/Nix

Proposed approach

Build system discovery

Rivet auto-discovers cross-repo dependencies from build system manifests:

# rivet.yaml
externals:
  discovery: bazel  # or: nix, known-good-json, manual (default)
  # Optional overrides still allowed
  overrides:
    score-baselibs:
      artifacts-path: docs/requirements

Bazel provider: Parse MODULE.bazel for bazel_dep() + git_override() entries. Resolve workspace paths via bazel info output_base or read MODULE.bazel.lock.

Nix provider: Parse flake.lock for input entries with locked.rev and locked.url.

known-good-json provider: Parse SCORE-style known_good.json with repo names, commit SHAs, and code roots.

Rivet as a Bazel rule / Nix derivation

Additionally, rivet itself should be consumable as:

  • rules_rivet: Bazel module with a rivet_validate() rule that runs validation as a bazel test target
  • Nix flake: nix run github:pulseengine/rivet -- validate
  • Both distribute the single static binary without pulling LLVM/JDK/Python

Rivet artifacts

  • REQ-027
  • DD-022
  • FEAT-044, FEAT-045

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions