feat: smart risk engine for PR change analysis#14
Merged
Conversation
- Updated the risk scoring system to include detailed per-file risk tiers (SAFE, REVIEW, TEST, CRITICAL) and narratives. - Introduced new slash commands `/pr-risk` and `/pr-fix` for AI-assisted PR reviews, providing actionable insights based on risk assessments. - Enhanced documentation to reflect changes in risk triage, scoring formulas, and command usage. - Added tests for risk triage formatting and evidence gating logic to ensure accurate risk reporting. This update improves the clarity and usability of the risk analysis tools within the project.
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
analyze-change, combining change status, structural factors (importer count, co-change frequency, fragility, mutual deps, cycles), and test coverage adjustments--compact) producing token-optimized text summaries (~60–75% fewer tokens than JSON), optimized for LLM consumption--fail-on criticaloption for gating PRs on risk triage tiers/pr-risk(human-friendly risk review) and/pr-fix(ordered fix plan for every issue found)contextception setupnow installs MCP server config, PreToolUse hooks, and slash commands with--dry-runand--uninstallsupportTest plan
make testpasses (new tests for risk scoring, compact output, percentile, graph, model, schema, CLI, MCP)contextception analyze-change --jsonreturns risk_score, risk_tier, risk_factors, risk_narrative per filecontextception analyze-change --compactproduces token-optimized text outputcontextception analyze-change --ci --fail-on criticalexits non-zero only when CRITICAL files presentcontextception setup --dry-runshows planned changes without writingcontextception setup --uninstallcleanly removes configuration