Repository navigation
fix(yaml): an empty link target fails validate on both paths, not only --direct - #1080
Merged
Merged
Conversation
…y --direct An explicit `target: ""` was dropped by the rowan extraction (block and flow form), so the default incremental `rivet validate` passed while `validate --direct` reported "link 'derives-from' targets '' which does not exist". Maintainer decision: both paths report it. The rowan path keeps a link whose `target:` key is present even when empty; shorthand `losses: null` / `~` still means no link. The yaml_footguns fuzzer had failed on this on every scheduled run. The fuzz oracles follow the decision: an empty target the source literally writes is preserved, not synthesised, and validation rejects it; only an empty target the source never wrote is a phantom. cli_argv also failed on every run, on a harness false positive: `-he-h-eln` is a short-flag cluster that requests help, which clap prints as text with exit 0; the short-circuit detector now covers clusters. Tests: a yaml_hir unit test for block and flow forms (each fails when its change is reverted) and a CLI test over both validate paths. Fixes: REQ-028 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
avrabe
force-pushed
the
fix/empty-link-target
branch
from
October 10, 2026 03:20
207214e to
5ddb5af
Compare
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…get check The PR-diff mutation gate left two mutants alive on the new condition. One showed the `!target.is_empty() ||` half was redundant (target is only ever set when the `target` key is present), so the condition is now `!link_type.is_empty() && target_present`. The other showed no test covered an entry missing `type:`; the unit test now checks that a typeless entry and a targetless entry are dropped while a complete one is kept. Applied by hand, `||` for `&&`, a dropped `!` and a negated `target_present` each fail it. Fixes: REQ-028 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
avrabe
added a commit
that referenced
this pull request
Oct 10, 2026
… input (#1081) With the empty-target crash fixed (#1080), yaml_footguns now stops on `target: null`: the HIR reads it as the text `null`. That is not a silent accept. The serde path cannot parse a null target, and the parse error fails `rivet validate` on both paths (the default path also reports the HIR link to `null` as broken); confirmed with a fixture for `null` and `~`. The HIR null oracle now fires only when serde accepted the document, which is when the coercion would go unreported. This narrows the oracle; it changes no product behaviour. Refs: REQ-028 Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
I found this by reading why the scheduled
fuzz.ymlhas failed on every run (12 of 12): thecli_argvandyaml_footgunsjobs.1. Real defect (yaml_footguns): the default validate falsely passed.
rivet validate(salsa)link 'derives-from' targets '' which does not existrivet validate --directThe rowan extraction dropped empty targets in both the block and the flow form. You chose contract A: both paths error. The rowan path now keeps a link whose
target:key is present even when it is empty. Shorthandlosses: nulland~still mean "no link", and those tests are unchanged.The fuzz oracle follows the same rule. An empty target the source literally writes (
target: ""/'') is preserved, not synthesised, and validation rejects it. Only an empty target the source never wrote is still a phantom-link finding.2. Harness false positive (cli_argv). The argv
list --format json -he-h-eln --format jsoncontains a short-flag cluster withh, so clap prints help text and exits 0. The harness skipped-hbut not clusters; it now treats any short cluster containinghorVas help or version. This is conservative: it may also skip a cluster wherehis a flag's value.Tests
explicit_empty_link_target_is_kept_for_validation(yaml_hir, block and flow forms). Negative controls: reverting either change givesleft: [].an_empty_link_target_fails_validate_on_both_paths(CLI, both paths, with the exact message).ldissue), so the scheduledfuzz.ymlrun after merge is the evidence.Gates run locally on Rust 1.99.0: fmt,
clippy --all-targets -D warnings, workspace tests (2668),rivet validate(this repository still passes),docs checkand yamllint.🤖 Generated with Claude Code
https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9