feat(export): --variant applies the per-variant field overlay (REQ-265d)#728
Merged
Conversation
Completes REQ-265 (DD-077 slice d). `rivet export` gains `--variant <NAME>` (name or path), so a variant-scoped compliance export needs no hand-translation of IDs into an s-expr `--filter`. The variant is resolved ONCE in cmd_export (via the shared resolve_variant_arg, matching list/query), and a new `apply_variant_overlay` helper — mirroring the in-place rewrite `query --variant` performs — replaces each artifact's top-level `fields` with its `fields_for_variant` merged view before export. It is applied after baseline scope in every export path: reqif / generic-yaml (cmd_export), zola, gherkin, and html (the html/compliance-bundle path overlays state.store and rebuilds the link graph, so the single-page audit bundle is variant-scoped too — no silent drop). A `None` variant is a no-op. With this, REQ-265 (variant source-linkage completeness) is fully implemented: (a) honest external source links, (b) no variant scope leak, (c) disk-verified source manifest, (d) export --variant. Confirmed on the phase2 fixture (max-temp-c 80 default → 100 under `industrial`): `export --variant industrial` bakes 100 into the top-level field, plain export keeps 80. variant_phase2 (9 passing incl the new test), export_zola/reqif regression, cli_commands (157 — clap-change guard), clippy --all-targets clean, rivet validate + docs check PASS. rivet-cli only; wasm seam untouched. Implements: REQ-265 Refs: DD-077
📐 Rivet artifact delta
Graphgraph LR
REQ_265["REQ-265"]:::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.
REQ-265 slice d —
export --variant(completes REQ-265, v0.29.0)rivet exportgains--variant <NAME>(name or path). A variant-scopedcompliance export no longer needs hand-translation of IDs into an s-expr
--filter.How
The variant is resolved once in
cmd_export(sharedresolve_variant_arg,matching
list/query), and a newapply_variant_overlayhelper — mirroringthe in-place rewrite
query --variantperforms — replaces each artifact'stop-level
fieldswith itsfields_for_variantmerged view before export.Applied after baseline scope in every export path:
reqif/generic-yaml(cmd_export)zolagherkinhtml— the compliance-bundle path overlaysstate.storeand rebuilds thelink graph, so the single-page audit bundle is variant-scoped too (no silent
drop of
--varianton the format that matters most for compliance).A
Nonevariant is a no-op.REQ-265 now fully implemented
(a) honest external source links · (b) no variant scope leak · (c) disk-verified
source manifest · (d) export --variant.
Verified
On the phase2 fixture (
max-temp-c80 default → 100 underindustrial):export --variant industrialbakes 100 into the top-level field; plain exportkeeps 80. variant_phase2 9 pass (incl. new
export_variant_applies_field_overlay),export_zola / export_reqif regression green, cli_commands 157 (clap-change
guard),
clippy --all-targets(1.97.0) clean,rivet validate+docs checkPASS. rivet-cli only — wasm seam untouched.
Implements: REQ-265 · Refs: DD-077
🤖 Generated with Claude Code