fix(validate): salsa path evaluates status-gate validation-rules (REQ-146, #355)#393
Merged
Merged
Conversation
…-146, #355) `rivet validate` runs the incremental salsa path (`db::validate_all`), which evaluated structural rules (phases 1-7) and conditional rules (phase 8) but NOT the status-gate `validation-rules` (phase 9 — the `(implies …)` V-model promotion gates). The direct `validate::validate*` path (used by `rivet check gaps-json` and `rivet validate --direct`) DID evaluate them. So the default `rivet validate` silently PASSED a project with a status-gate violation that gaps-json / --direct correctly FAILED — the divergence reported in #355 Finding 3, and a soundness gap since the default validation surface under-reported. Fix: `db::validate_all` and `validate_all_with_extras` now also call `validate::evaluate_validation_rules` against the same materialized store/schema/graph, so every validation surface agrees. Reproduced + verified: a project with an aspice `validation-rules` gate (an approved sys-verification verifying a draft system-req) previously gave salsa `FAIL (1 error)` vs direct `FAIL (2 errors)`; now both report 2 including the gate. rivet's own corpus still PASS (181→ unchanged) on both paths. New regression test `db::tests::validation_rules_evaluated_in_validate_all`; rivet-core db (24) + validation_rule (3) tests pass; clippy --all-targets + fmt clean; rivet validate + docs check PASS. Fixes: REQ-146 Refs: REQ-029, REQ-004 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📐 Rivet artifact delta
Graphgraph LR
REQ_146["REQ-146"]:::added
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
Added
Posted by |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 7849e7c | Previous: a37bda6 | Ratio |
|---|---|---|---|
store_insert/10000 |
15794735 ns/iter (± 1499225) |
12398686 ns/iter (± 372468) |
1.27 |
link_graph_build/10000 |
35848484 ns/iter (± 4597669) |
24086899 ns/iter (± 1136601) |
1.49 |
validate/10000 |
16103470 ns/iter (± 2506107) |
12815374 ns/iter (± 582007) |
1.26 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report❌ Patch coverage is
📢 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.
Addresses #355 Finding 3 ("
rivet validateandrivet check gaps-jsondisagree").Root cause (verified)
rivet validateruns the incremental salsa path (db::validate_all), which evaluated structural rules (phases 1-7) and conditional rules (phase 8) — but never evaluated the status-gatevalidation-rules(phase 9: the(implies …)V-model promotion gates). The directvalidate::validate*path — used byrivet check gaps-jsonandrivet validate --direct— did. So the defaultrivet validatesilently PASSED a project with a status-gate violation thatgaps-json/--directFAILED. That's both the reported cross-command disagreement and a soundness gap (the default surface under-reports).Reproduction (local)
A project on
common+aspicewith an approvedsys-verificationthatverifiesadraftsystem-req(violatesV-sys-verification-needs-approved-req):rivet validate(salsa)FAIL (1 error)— gate missingrivet validate --directFAIL (2 errors)— gate presentAfter the fix both report 2 errors including the gate.
Fix
db::validate_allanddb::validate_all_with_extrasnow callvalidate::evaluate_validation_rulesagainst the same materialized store/schema/graph they already build, so structural + conditional + status-gate rules are all evaluated on every surface.Verification
rivet validateand--directboth PASS, unchanged.db::tests::validation_rules_evaluated_in_validate_all(salsa path surfaces the gate).db(24) +validation_rule(3) tests pass; clippy--all-targets+ fmt clean;rivet validate+rivet docs checkPASS.Note: this is the engine-parity half of #355. Findings 1-2 (no canonical status enum; the gate hardcoding literal
approvedwith no ordered lifecycle) remain a maintainer design decision and are untouched here.Fixes: REQ-146
🤖 Generated with Claude Code