Commit b16bb9c
`rivet validate` globs every `*.yaml` in `artifacts/variants/` and parses each
as a flat single-variant config (which requires a top-level `name:`). When a
feature-model binding file (the natural co-location: `bindings:` map + optional
`variants:` list, the `FeatureBinding` shape) lives in that directory beside
the single-variant configs it binds, the parse fails and the CLI prints
warning: failed to load variant configs from ./artifacts/variants:
Schema error: parsing variant config ./artifacts/variants/bindings.yaml:
missing field `name` at line 18 column 1
— benign (validate still PASSes) but noise any product-line consumer that
co-locates its binding file hits.
`load_variant_configs_from_dir` now peeks each file as `serde_yaml::Value`
before the typed parse and silently skips files whose top-level shape is a
binding file (a `bindings:` key with no `name:` or `variant:` sibling — the
discriminator excludes the flat single-variant form and the `variant:`-wrapped
form `rivet variant init` writes per #514, so the wrapped form's existing parse
path still fires). Unparseable YAML still surfaces an error through the
existing parse path.
Confirmed: built the binary, reproduced the issue's exact directory layout
(sem-m3-gcc.yaml + sem-smp-x86.yaml + bindings.yaml with variants/bindings
top-level keys), and `rivet validate` now reports `Result: PASS (0 warnings)`
with no mention of bindings.yaml. Two new tests: one for the binding-file skip
on the issue's repro shape, one regression guard that the `variant:`-wrapped
form is NOT absorbed by the skip. All 57 feature_model unit tests + 8
variant_phase2 integration tests pass; `cargo clippy --all-targets -- -D warnings`
and `cargo fmt --all -- --check` clean.
Closes #532.
Fixes: REQ-004
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 01f2976 commit b16bb9c
1 file changed
Lines changed: 105 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1640 | 1640 | | |
1641 | 1641 | | |
1642 | 1642 | | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1643 | 1653 | | |
1644 | 1654 | | |
1645 | 1655 | | |
| |||
1655 | 1665 | | |
1656 | 1666 | | |
1657 | 1667 | | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1658 | 1687 | | |
1659 | 1688 | | |
1660 | 1689 | | |
| |||
2487 | 2516 | | |
2488 | 2517 | | |
2489 | 2518 | | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
2490 | 2595 | | |
2491 | 2596 | | |
2492 | 2597 | | |
| |||
0 commit comments