fix(validate): validate and validate --direct produce identical output (REQ-241, #620)#638
Merged
Merged
Conversation
…output (REQ-241, #620) A user reported `rivet validate` and `rivet validate --direct` returning different results on the same project — one flagging issues the other didn't. The substantive divergence (self-satisfying links counted as closing a traceability rule) was fixed in #627; this closes the last residual difference. The default (salsa) and --direct (library) paths collect artifacts in different orders, so `check_lifecycle_completeness` returned the lifecycle gaps in different order and the `--explain <id>` hint (which used `.first()`) named a different example artifact per path. Sort the gaps by artifact id so the printed gap list AND the hint are deterministic and identical across both paths. Verified byte-identical output between the two paths on both the reporter's self-link repro and rivet's own 940-artifact project. Regression test validate_and_direct_produce_identical_output (proven to fail without the sort). Implements: REQ-241 Verifies: REQ-241 Refs: REQ-089 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📐 Rivet artifact delta
Graphgraph LR
REQ_241["REQ-241"]:::modified
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Modified
Posted by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #620 —
rivet validate(default salsa path) andrivet validate --direct(library path) now produce byte-identical output on the same project.Root cause
The substantive divergence a user reported (one path flagging issues the other didn't) was the self-link false-PASS, fixed in #627. This closes the last residual difference: the two paths collect artifacts in different orders, so
check_lifecycle_completenessreturned lifecycle gaps in different order and the--explain <id>hint (.first()) named a different example artifact per path.Fix
Sort lifecycle gaps by artifact id before printing → the gap list and the hint are deterministic and identical across both paths.
Verification
validate_and_direct_produce_identical_output, proven to fail without the sort.verified. Fullcli_commandssuite +clippy --all-targetsgreen locally.🤖 Generated with Claude Code