refactor: centralize cleanup and risk threshold#227
Open
Hiten0305l wants to merge 1 commit into
Open
Conversation
Signed-off-by: Hiten <erhiten6@gmail.com>
rng1995
approved these changes
Jun 30, 2026
rng1995
left a comment
Collaborator
There was a problem hiding this comment.
This refactor preserves both threshold semantics (CLI fails above 50; MCP treats 50 and below as safe) while removing duplicate cleanup logic. The shared helper matches the prior behavior and is used by the scan, baseline, and MCP paths. I found no correctness or security blocker.
Author
|
Thanks for the review and approval! I noticed there's still a workflow awaiting maintainer approval. Please let me know if there's anything else needed from my side. Thanks! |
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
This refactor removes duplicated logic by centralizing shared functionality used by both the CLI and the MCP server. It ensures that the risk-score threshold and temporary directory cleanup logic are defined in a single place, making future maintenance easier and preventing the implementations from drifting.
Changes
RISK_THRESHOLDconstant toskillspector.constants.cli.pyandmcp_server.pyto import and use the sharedRISK_THRESHOLDinstead of maintaining duplicate values.cleanup_result()helper inskillspector.cleanupto centralize temporary directory cleanup.cli.pyandmcp_server.pywith the shared helper.This change is purely a refactor and does not modify existing functionality.
Validation
RISK_THRESHOLDis defined only once and imported where needed.uv sync --extra mcp.Fixes #192