Skip to main content

Change Risk Analysis CLI - Find impacted files and notify owners

Project description

Blame Router

Two CLI tools that reduce the social friction of asking questions about code.

The Problem

The pain isn't finding "Dave." The pain is that Dave is busy, the code is old, and you—the new engineer—don't know what to ask. These tools automate the transaction cost of context.

Tools

ask.py - The Blame Router

Point at a confusing line of code. Get a smart question auto-generated and routed to the author.

python ask.py <file_path> <line_number>

Example:

python ask.py src/billing.py 42

Output:

📧 Author: dave@company.com
💬 Commit: "tax rate update"

✨ Magic Question:
"Hey, I'm reviewing `billing.py`. I see a 5% tax rate hardcoded on line 42.
Is this derived from the 2023 CA Regulatory update, or is it a placeholder?"

📨 SLACK MESSAGE (simulated)
TO: dave@company.com

crisk.py - Change Risk Checker

Before you push, find files semantically related to your changes and identify their owners.

python crisk.py check [--draft]

Example:

git add src/client.py
python crisk.py check --draft

Output:

⚠️  Your changes may impact:

1. __init__.py (relevance: 0.82)
   → Owner: jonathan@company.com

2. auth.py (relevance: 0.78)
   → Owner: jonathan@company.com

DRAFT MESSAGE:
"Hey, I'm updating client.py to support new API key formats.
This might impact auth.py and __init__.py. Any concerns?"

📬 Recipients:
   • jonathan@company.com (8 files)

Quick Start (Cloud Version)

Install

pip install git+https://github.com/rohankatakam/fasho.ski.git

Or with uv:

uv pip install git+https://github.com/rohankatakam/fasho.ski.git

Login

crisk login

This opens your browser to authenticate with coderisk.dev. Once logged in, you're ready to go.

Use

git add src/client.py
crisk check --draft

Local Setup (Self-hosted)

If you want to run everything locally with your own API keys:

1. Install dependencies

pip install google-genai python-dotenv requests

2. Create .env file

cp .env.example .env

Add your API keys:

GEMINI_API_KEY=your_gemini_api_key
RELACE_API_KEY=your_relace_api_key

3. Run from a git repository

Both tools require being run from within a git repository.

How It Works

ask.py

  1. Archaeologist: Runs git blame to find who wrote the line and their commit message
  2. Investigator: Sends context to Gemini to generate a hypothesis-driven question
  3. Router: Outputs the message (Slack integration simulated)

crisk.py

  1. Gets your staged diff (git diff --cached)
  2. Sends codebase to Relace semantic search API
  3. Finds files semantically related to your changes
  4. Runs git blame to identify owners of related files
  5. Uses Gemini to draft a notification message

The Pitch

"Everyone else is building tools to search code. I built a tool that talks to the people who wrote it. It turns a 30-minute 'Zoom?' interruption into a 30-second Slack reply."

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crisk-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crisk-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file crisk-0.1.0.tar.gz.

File metadata

  • Download URL: crisk-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for crisk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cb12ddf560ce516f81be8155fba6db00e5b33381301ca38dba0222b34b432628
MD5 17c10dacc4d96ca4b047ffd7ca40ae29
BLAKE2b-256 6fc6b84d414f041b504f4bbc8198b101a9e8371feb7f297555c589c6695e8257

See more details on using hashes here.

File details

Details for the file crisk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crisk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for crisk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47b8e06fb790fa5034dc2e4d26b30dd7c2a8861bdd7b804bbb640271b6705b0f
MD5 275a5432ecd9cd08758ce7312a718a3e
BLAKE2b-256 a82f05820464e88cadf4b6b0200829f1eef628b8acdb33f10c3da556a92b6995

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page