Skip to content

feat(export): --variant applies the per-variant field overlay (REQ-265d)#728

Merged
avrabe merged 1 commit into
mainfrom
feat/req-265d-export-variant
Jul 21, 2026
Merged

feat(export): --variant applies the per-variant field overlay (REQ-265d)#728
avrabe merged 1 commit into
mainfrom
feat/req-265d-export-variant

Conversation

@avrabe

@avrabe avrabe commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

REQ-265 slice d — export --variant (completes REQ-265, v0.29.0)

rivet export gains --variant <NAME> (name or path). A variant-scoped
compliance export no longer needs hand-translation of IDs into an s-expr
--filter.

How

The variant is resolved once in cmd_export (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.
Applied after baseline scope in every export path:

  • reqif / generic-yaml (cmd_export)
  • zola
  • gherkin
  • html — the compliance-bundle path overlays state.store and rebuilds the
    link graph, so the single-page audit bundle is variant-scoped too (no silent
    drop of --variant on the format that matters most for compliance).

A None variant 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-c 80 default → 100 under industrial):
export --variant industrial bakes 100 into the top-level field; plain export
keeps 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 check
PASS. rivet-cli only — wasm seam untouched.

Implements: REQ-265 · Refs: DD-077

🤖 Generated with Claude Code

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
@github-actions

Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 0
Removed 0
Modified 1
Downstream impacted (depth ≤ 5) 0

Graph

graph 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
Loading
Modified
ID Changes
REQ-265

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-728download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@avrabe
avrabe merged commit 6a4753f into main Jul 21, 2026
29 checks passed
@avrabe
avrabe deleted the feat/req-265d-export-variant branch July 21, 2026 19:05
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant