Skip to content

[Refactor] mcp: centralize RISK_THRESHOLD constant and deduplicate cleanup helper #192

Description

@CharmingGroot

Follow-up from @rng1995's review on #36:
#36 (review)

"The cleanup block duplicates the private _cleanup_result helper … RISK_THRESHOLD = 50 is duplicated from the CLI's inline 50"

Two small code-quality issues surfaced during review of #36:

  1. RISK_THRESHOLD = 50 is duplicated between cli.py (inline) and mcp_server.py (module constant). If the threshold changes, both must be updated in sync.
  2. The temp-dir cleanup finally block in mcp_server.py reimplements what _cleanup_result() in cli.py already does. The two can drift independently.

Proposed Fix

  1. Extract RISK_THRESHOLD to a shared module (e.g. skillspector/constants.py) and import it in both files.
  2. Move _cleanup_result to a shared utility module and import it in both places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions