feat(variant): rivet variant explain for debugging solve outcomes#199
Merged
feat(variant): rivet variant explain for debugging solve outcomes#199
Conversation
Answers "why did my variant pick/skip feature X?" — a dev/debug UX gap called out in the v0.4.3 scope. Two modes: # Full audit: every effective feature + origin, unselected features, # and the constraint list rivet variant explain --model fm.yaml --variant prod.yaml # Single-feature focus: origin, attribute values, and every # constraint that mentions the feature rivet variant explain --model fm.yaml --variant prod.yaml asil-c Each effective feature carries an origin: - `selected` — user listed it under `selects:` - `mandatory` — parent group is mandatory, or is the root - `implied by <X>` — a constraint forced it in once <X> was selected - `allowed` — present but not proven mandatory `--format json` emits a structured audit for scripts (dashboard uses the same shape for the variant sidebar). Coverage: - explain_single_feature_shows_origin_and_attrs (text mode) - explain_single_feature_json_mode - explain_full_variant_audit_lists_origins_and_unselected Docs: new "Debugging" subsection in docs/getting-started.md under the variant management chapter, with an origin table. Implements: REQ-046 Refs: DD-050 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ic model Adds realistic `attributes:` to examples/variant/feature-model.yaml for every market (eu/us/cn with compliance+locale) and every ASIL level (asil-numeric + required analysis techniques). These match the worked examples in docs/getting-started.md so users can run the snippets against the shipped fixture and see the same output. New integration test `every_format_renders_realistic_example` exercises all 7 --format values against the enriched example and asserts each output contains the variant name and the asil-c marker (in whatever casing the format uses). Catches regressions that pass on toy models but break on constraint-driven inclusion, multi-attr features, or non-trivial tree depth. Implements: REQ-046 Refs: DD-050 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2730e20 to
6cf1c41
Compare
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
avrabe
added a commit
that referenced
this pull request
Apr 23, 2026
* feat(variant): rivet variant explain for debugging solve outcomes Answers "why did my variant pick/skip feature X?" — a dev/debug UX gap called out in the v0.4.3 scope. Two modes: # Full audit: every effective feature + origin, unselected features, # and the constraint list rivet variant explain --model fm.yaml --variant prod.yaml # Single-feature focus: origin, attribute values, and every # constraint that mentions the feature rivet variant explain --model fm.yaml --variant prod.yaml asil-c Each effective feature carries an origin: - `selected` — user listed it under `selects:` - `mandatory` — parent group is mandatory, or is the root - `implied by <X>` — a constraint forced it in once <X> was selected - `allowed` — present but not proven mandatory `--format json` emits a structured audit for scripts (dashboard uses the same shape for the variant sidebar). Coverage: - explain_single_feature_shows_origin_and_attrs (text mode) - explain_single_feature_json_mode - explain_full_variant_audit_lists_origins_and_unselected Docs: new "Debugging" subsection in docs/getting-started.md under the variant management chapter, with an origin table. Implements: REQ-046 Refs: DD-050 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(variant): enrich eu-adas-c example + per-format smoke on realistic model Adds realistic `attributes:` to examples/variant/feature-model.yaml for every market (eu/us/cn with compliance+locale) and every ASIL level (asil-numeric + required analysis techniques). These match the worked examples in docs/getting-started.md so users can run the snippets against the shipped fixture and see the same output. New integration test `every_format_renders_realistic_example` exercises all 7 --format values against the enriched example and asserts each output contains the variant name and the asil-c marker (in whatever casing the format uses). Catches regressions that pass on toy models but break on constraint-driven inclusion, multi-attr features, or non-trivial tree depth. Implements: REQ-046 Refs: DD-050 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(release): v0.4.3 Workspace version bump 0.4.2 → 0.4.3, CHANGELOG entry covering the v0.4.3 changes that have already landed on main: - rivet variant features/value/attr for 7 build systems (#197) - docs: variant emitter walkthrough + exit-code contract (#198) - rivet variant explain for debugging solve outcomes (#199) - test: enrich eu-adas-c example + per-format smoke (#199) - sexpr count-compare + matches parse-time regex (#196) - SCRC Phase 1 clippy restriction lint escalation (#195) - Rivet Delta SVG render for email/mobile (#193) - stamp --missing-provenance filter + warn-skip (#192) v043-artifacts.yaml gains five new entries matching the implementations: - DD-061 build-system emitters are namespaced and loud-on-failure - FEAT-130 rivet variant features/value/attr - FEAT-131 rivet variant explain - DD-062 matches regex + count-compare validated at lower time - FEAT-132 count-compare lowering + matches parse-time regex - FEAT-133 Rivet Delta SVG render for email/mobile - FEAT-134 rivet stamp filter + warn-skip All 41 test binaries green. rivet validate: only pre-existing SPAR aadl-component schema errors remain (unrelated to this release). Implements: REQ-046 Refs: REQ-004, REQ-010, DD-050, DD-058 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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: 6cf1c41 | Previous: d52e99f | Ratio |
|---|---|---|---|
traceability_matrix/1000 |
60155 ns/iter (± 460) |
43807 ns/iter (± 715) |
1.37 |
This comment was automatically generated by workflow using github-action-benchmark.
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.
Summary
Answers "why did my variant pick/skip feature X?" — the dev/debug UX gap called out for v0.4.3.
Two modes:
rivet variant explain --model M --variant V) — every effective feature + origin, unselected features, and the constraint list.rivet variant explain … FEATURE) — origin, attribute values, and every constraint that mentions the feature.Each effective feature carries an origin: `selected` / `mandatory` / `implied by ` / `allowed`.
--format jsonemits a structured audit for scripts (dashboard uses the same shape).Test plan
Docs
New "Debugging" subsection in `docs/getting-started.md` with origin table and both modes demonstrated.
Implements: REQ-046
Refs: DD-050
🤖 Generated with Claude Code