Skip to content

release(v0.12.0): multi-file feature models — REQ-083#312

Merged
avrabe merged 7 commits into
mainfrom
feat/v0.12.0-feature-model-composition
May 23, 2026
Merged

release(v0.12.0): multi-file feature models — REQ-083#312
avrabe merged 7 commits into
mainfrom
feat/v0.12.0-feature-model-composition

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 22, 2026

Summary

v0.12.0 ships multi-file feature model composition (REQ-083). A
product line can now be authored as a top-level feature model plus
per-level sub-models in their own files — vehicle → powertrain → ECU —
each file a valid, independently solvable model on its own.

  • New file kind feature-model-binding: a compose: list mounts
    standalone sub-model files onto parent features. Each mount declares
    an explicit, unique prefix:; the sub-model's features are namespaced
    under it (pwt:four-wheel), mirroring the externals: prefix:ID
    model. Composition is recursive and resolves to one tree.
  • FeatureModel::load_composed / FeatureModel::load (core);
    every rivet variant command + rivet validate --model now route
    through load, so a binding file is accepted wherever a plain model
    was.
  • The s-expr lexer accepts : in a symbol, so cross-prefix constraints
    like (implies car pwt:four-wheel) parse.
  • A broken mount — missing file, unknown or leaf mount point,
    duplicate prefix, cyclic composition — is a hard error, never a
    silent skip (F2 silent-failure class).

Composition resolves sub-model files by path relative to the binding
file, within one repository; cross-git-repo composition is tracked
separately as a follow-on.

Also files REQ-084 (the Verus CI job's Nix install fails silently on the
self-hosted runner — proven on #311).

Test plan

  • cargo test -p rivet-core -p rivet-cli green (1054 core lib + all
    integration suites, incl. 8 compose_* core tests + 3
    variant_compose CLI tests)
  • cargo clippy — no new warnings; cargo fmt clean
  • manual: rivet variant list/solve --model binding.yaml composes;
    broken mount exits non-zero
  • CI green (Rocq/Verus/Miri are continue-on-error)

🤖 Generated with Claude Code

avrabe added 4 commits May 22, 2026 06:19
…Verus CI silent-failure)

REQ-083 — multi-file feature models: each model file stays a
standalone, independently-solvable unit; a feature-model-binding file
mounts sub-models at parent features with explicit mapping + prefix
namespacing (the externals: prefix:ID model). The v0.12.0 headline.

REQ-084 — the Verus Proofs CI job's Nix install fails on the no-sudo
self-hosted runner, so `Verify Verus specs` is skipped while the
continue-on-error job stays green: a proof job verifying nothing.
Proven on PR #311 run 26246893086.

Refs: FEAT-135
Feature models can now be composed across files. A new
feature-model-binding file (`kind: feature-model-binding`) mounts
standalone sub-model files at parent features under an explicit,
unique prefix. `FeatureModel::load_composed` splices each sub-model
into its parent — prefixing feature names, child refs, the root, and
bare feature tokens in constraint strings — unions the constraint
sets, and runs the normal construction + tree validation once over
the merged result. Each model file remains independently solvable via
`from_yaml` (refactored to share `from_yaml_struct`).

A broken mount fails loudly: missing file, absent or `leaf` mount
point, duplicate prefix, or cyclic composition each return an error
rather than silently skipping (F2 silent-failure class).

`is_symbol_cont` in the s-expr lexer now accepts `:`, so a namespaced
feature reference (`prefix:feature`) lexes as a single symbol —
required for cross-prefix constraints like `(implies car pwt:four-wheel)`.

CLI wiring (`rivet variant` commands accepting a binding file) is a
follow-up.

Implements: REQ-083
…-083)

Completes REQ-083: the CLI surface for multi-file feature model
composition.

`FeatureModel::load(path)` dispatches on the file's `kind:` — a
`feature-model-binding` file is composed via `load_composed`, any other
file is parsed as a single model via `from_yaml`. The nine
`FeatureModel::from_yaml` call sites across the `rivet variant` and
`rivet validate --model` paths now route through `load`, so every
command transparently accepts a binding file wherever it accepted a
plain model.

Adds `rivet-cli/tests/variant_compose.rs` — integration tests driving
the real binary: `variant list` / `solve` over a composition, and a
broken mount failing loudly with a non-zero exit. Documents the
`feature-model-binding` compose format in docs/feature-model-schema.md.

Implements: REQ-083
Bump workspace + VS Code extension to 0.12.0 and add the CHANGELOG
section. v0.12.0 ships multi-file feature model composition: a
feature-model-binding file mounts standalone sub-model files onto
parent features under explicit, unique prefixes, resolving to one tree.
Minor version — new file kind and new rivet variant input behaviour,
no breaking schema or CLI removal.

Refs: REQ-083
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

📐 Rivet artifact delta

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

Graph

graph LR
  REQ_083["REQ-083"]:::added
  REQ_084["REQ-084"]:::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
Loading
Added
  • REQ-083
  • REQ-084

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

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 99.14347% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/feature_model.rs 99.14% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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: 3169bb9 Previous: f9ac472 Ratio
query/10000 136026 ns/iter (± 678) 93063 ns/iter (± 966) 1.46

This comment was automatically generated by workflow using github-action-benchmark.

avrabe added 3 commits May 22, 2026 19:45
RUSTSEC-2026-0149 is a high-severity advisory in wasmtime-wasi 43, a
transitive dependency behind the optional, non-default `wasm` feature —
the same class as the 13 wasmtime advisories the audit step already
ignores. The 43.x line has no fixed release; clearing it for real needs
a wasmtime 43->45 major bump, which is out of scope for this release.
Add it to the existing `--ignore` list so the audit reflects a triaged
state rather than an untriaged failure.
Add five error-path tests for feature-model composition: empty
`compose:`, a parent listed twice, multiple candidate roots, a cyclic
binding (every parent mounted), and a composition cycle deeper than the
root caught by the recursion-path guard. These exercise REQ-083's
"a broken mount is a hard error, never a silent skip" Acceptance
criterion across every detection branch.

Verifies: REQ-083
…Q-083)

An llvm-cov pass surfaced a real gap: prefix_constraint /
flush_constraint_token — the tokeniser that rewrites bare feature
names inside a sub-model's own constraint strings — had zero coverage,
because no test composed a sub-model that declared constraints.

Add five tests: a sub-model whose constraint is prefixed and proven to
still fire under the solver after composition; sub-model
attribute-schema merge; attribute-schema key collision; the
FeatureModel::load kind-dispatcher; and an unreadable/malformed binding
file. feature_model.rs line coverage 84.6% -> 87.4%; the composition
functions (load_composed, load_and_splice, splice_into) now sit at
89-100% with no CRAP-flagged anti-patterns.

Verifies: REQ-083
@avrabe avrabe merged commit 0c4d30b into main May 23, 2026
22 of 40 checks passed
@avrabe avrabe deleted the feat/v0.12.0-feature-model-composition branch May 23, 2026 04:34
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