feat: enforce reproduce_cmd invariant for every Finding via add_layer#52
Merged
thefourcraft merged 1 commit intoproductionfrom May 4, 2026
Merged
Conversation
Every Finding in a final report must carry a reproduce_cmd so agents can always re-run a finding without guessing. - add_layer now normalises incoming findings before storing them: if reproduce_cmd is None or blank, it is filled with 'barzel run --layer <name> --json' for the four known layers, or 'barzel run --json' for any other layer name. - Existing runner-specific reproduce_cmd values are left unchanged. - RUNNER_UNAVAILABLE, CACHED, and RUNNER_FAILED findings (which used ..Default::default()) are covered automatically because all paths flow through add_layer.
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.
Summary
BarzelReport::add_layernow normalises each incomingFindingbefore storing it: ifreproduce_cmdisNoneor blank it is filled with a deterministic fallback (barzel run --layer <name> --jsonfor the four known layers;barzel run --jsonotherwise)reproduce_cmdvalues are left unchangedRUNNER_UNAVAILABLE,CACHED, andRUNNER_FAILEDfindings — which all used..Default::default()— are covered automatically because every path flows throughadd_layerreproduce_cmdremainsOption<String>in this PRTest plan
src/report.rsadd_layer_fills_missing_reproduce_cmd—Nonereproduce_cmd is filled with layer-specific fallbackadd_layer_fills_blank_reproduce_cmd— whitespace-only reproduce_cmd is overwrittenadd_layer_preserves_existing_reproduce_cmd— non-empty reproduce_cmd is unchangedadd_layer_unknown_layer_name_uses_generic_fallback— unknown layer name falls back tobarzel run --jsonsrc/orchestrator.rsrunner_failed_finding_has_reproduce_cmd—RUNNER_FAILEDfinding has non-empty reproduce_cmdrunner_unavailable_finding_has_reproduce_cmd—RUNNER_UNAVAILABLEfinding has non-empty reproduce_cmdcached_finding_has_reproduce_cmd—CACHEDfinding has non-empty reproduce_cmdAll 736 tests pass
cargo clippy --bin barzel -- -D warningscleangit diff --check production..HEADclean