Skip to content

refactor: fix DRY violations across extractor, generator, parser, and CLI#3

Merged
dortort merged 9 commits intomainfrom
refactor/dry-violations
Feb 16, 2026
Merged

refactor: fix DRY violations across extractor, generator, parser, and CLI#3
dortort merged 9 commits intomainfrom
refactor/dry-violations

Conversation

@dortort
Copy link
Owner

@dortort dortort commented Feb 16, 2026

Summary

  • Add ContractAssertion::new() constructor and convert all 26 inline struct literals
  • Unify duplicate is_shell_interpreter / is_shell_name into a single path-aware function
  • Extract make_process_assertion helper to deduplicate ENTRYPOINT/CMD logic
  • Extract resolve_dest_path helper to deduplicate COPY/ADD path resolution
  • Extract make_package_assertion helper to deduplicate 5 package detector functions
  • Extract CLI helpers (load_contract, resolve_force_wait, emit_output) and fix latent bug in cmd_probe that returned exit code 2 without writing output files
  • Extract passes_confidence helper to deduplicate confidence filtering in generator
  • Extract parse_sources_and_dest helper to deduplicate COPY/ADD parser logic

Test plan

  • cargo test — all 85 tests pass (58 unit + 3 integration + 24 golden)
  • cargo clippy -- -D warnings — zero warnings
  • cargo build --release — success
  • Golden tests unchanged (byte-identical output)
  • New integration test for cmd_probe warning+output behavior
  • Zero remaining inline ContractAssertion { ... } struct literals

claude and others added 9 commits February 16, 2026 09:18
Convert the plain-text architecture diagram in the README to a Mermaid
flowchart that renders as an interactive diagram on GitHub. The diagram
accurately reflects the actual code flow: the Evidence Engine merges
findings back into the RuntimeContract, which then feeds into the Goss
Generator.

https://claude.ai/code/session_01UDZyz5H4DwwJfx4riRNwFH
… helpers

Fixes latent bug in cmd_probe that returned exit code 2 without writing
output files when warnings were present.
@dortort dortort merged commit 90a18f7 into main Feb 16, 2026
6 checks passed
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.

2 participants