Skip to content

fix: resolve silent data corruption bugs (P1)#337

Merged
ajianaz merged 1 commit into
developfrom
fix/p1-silent-data-corruption
Jul 2, 2026
Merged

fix: resolve silent data corruption bugs (P1)#337
ajianaz merged 1 commit into
developfrom
fix/p1-silent-data-corruption

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes 8 silent data corruption bugs that produce wrong output without any crash or error. All bugs are high-severity because they silently produce incorrect results.

Refs #333

Fixes

# Bug File Impact
#42 Severity sort inverted src/engine/rules/mod.rs max_findings truncation dropped the MOST important findings
#45 Security findings dropped on LLM failure src/engine/review.rs Security findings silently lost when LLM call fails
#52 HashMap nondeterministic hash src/engine/debt_tracker.rs Same snapshot content produced different filenames across runs
#53 Debt score trend wrong src/engine/debt_tracker.rs Quality score change computed against overall avg instead of recent period
#54 Category trend change inflated src/engine/debt_tracker.rs Per-category delta included previous period, inflating totals
#92 Config precedence inverted src/config/loader.rs Auto-detected provider preset overrode explicit config values
#93 context_chain config ignored src/config/schema.rs context_chain setting in .cora.yaml had no effect
#96 Hook install overwrites existing hooks src/hook/install.rs Existing pre-commit hooks silently replaced without backup

Testing

  • All 609 tests pass
  • cargo clippy -- -D warnings clean
  • cargo fmt applied

Fixes:
- #42 Severity sort inverted: sort descending (Critical first) so max_findings truncation drops least important findings
- #45 Security findings dropped on LLM failure: include security_findings in fallback condition and summary
- #52 HashMap nondeterministic hash: sort HashMap entries by key before hashing for deterministic filenames
- #53 Debt score trend wrong: compute recent_avg_quality from recent slice instead of overall average
- #54 Category trend change inflated: build recent_category_counts from recent slice for accurate delta
- #92 Config precedence inverted: env vars > config > auto-detect > defaults
- #93 context_chain config ignored: copy context_chain from ReviewSection in merge_into
- #96 Hook install overwrites existing hooks: use sentinel marker, backup non-cora hooks, compose wrapper

Refs #333
@ajianaz ajianaz merged commit 72c0f7a into develop Jul 2, 2026
10 checks passed
@ajianaz ajianaz deleted the fix/p1-silent-data-corruption branch July 2, 2026 04:59
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