Skip to content

Review workflow: rank what a change can break, for PRs, commit ranges and local edits - #2

Merged
mimo1999 merged 19 commits into
mainfrom
review-workflow
Dec 1, 2026
Merged

mimo1999 merged 19 commits into
mainfrom
review-workflow

Conversation

@mimo1999

@mimo1999 mimo1999 commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Flowify moves from "explore a call graph" to "know where to look in a change". It ranks every function a pull request, commit range or uncommitted edit touches by how far a mistake there can cascade, says what it could not tell, and keeps the original graph explorer as one of four options.

What a user gets

  • Add a repository by local path or git link. Local mode keeps a full clone under _store/.repos/; the sidebar shows the repo and a branch dropdown, and each branch opens in its own Flowify-managed worktree.
  • Four options:
    • Read the codebase (the graph, now with dry-run trace and a function inspector).
    • Pull requests (from GitHub, plus branches ahead of the default branch).
    • Compare commits.
    • Local changes. Agents get the same review through the new review_local_changes MCP tool, which returns a link that opens it in the UI.
  • The change analysis:
    • Changes are sorted into must check / worth a glance / skim, each with a 0-100 score made of named factors.
    • Static contract checks, incident history, and the callers the change did not update.
    • Optional Claude notes that must quote the code they are about.
    • Coverage per change: what needs a human, and what was not analysed.
    • Test runs and author notes (.flowify/review.json) for authors.

Under the hood

  • Parser call resolution fixed and measured: about 96% edge precision on click and jinja, roughly half of real calls present (docs/accuracy.md).
  • Ingest and grouping stay within 512 MB on large repos.
  • GitPython is replaced by the git CLI.
  • Review endpoints are hardened: refs are validated, git failures return a 400, CORS is narrowed in local mode, and clones time out.
  • Docs are rewritten around the new scope: README, docs/change-risk.md, CONTRIBUTING, and an MIT LICENSE.

Deploying (Render auto-deploys main)

  • Hosted demo: no config change. Every review, branch, PR, commit and local-changes endpoint returns 400 in server mode, before the graph is loaded, so the hosted UI offers only Read the codebase.
  • Image: anthropic is a new dependency and GitPython is gone. git was already installed.
  • Local CORS is narrower by default. A frontend on another origin that talks to a local backend must list that origin in FLOWIFY_CORS_ORIGINS.
  • Details are in README, "Deploying the review workflow".

Testing

  • pytest tests/ --ignore=tests/test_integration.py: 247 passed. The frontend build passes.
  • Checked by hand in the browser:
    • pallets/click (git link): PR list and the PR #3827 review, a 3-commit compare, and branch switching to stable.
    • This repository (local path): local changes via /mcp/local_changes and its UI link.
  • Not covered by automated tests: the git-link clone itself (the URL check only accepts real https hosts) and the live GitHub API (mocked in tests).

🤖 Generated with Claude Code

mimo1999 and others added 19 commits November 24, 2026 03:07
Ten phase/summary docs described code that no longer exists; flow_verifier.py had no callers. The root-level test_*.py scripts move under tests/ so pytest collects them from the project root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloner and git_updater call git through subprocess (https only, shallow single-branch clone, -- before refs). One less dependency; the same calls the rest of the code already makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CopilotProvider reuses OpenAIProvider with extra headers instead of its own copy of the request code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nested defs, unique ids for redefinitions, module-level calls, BOM handling, method lookup through the MRO, INHERITS resolved to the class, local-variable typing, last-definition-wins per file, and a cap on unconfirmed same-name callers. Includes the accuracy benchmark and its results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trace.py walks what a function calls in source order with control-flow tags; Inspector.jsx shows source, callers, calls and notes and replaces ImpactPanel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Module lanes merged to about a dozen, invocation index built once, graph not loaded twice for small lookups, prompt sizes bounded, analytics wording that does not overclaim dead code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
contract_checks compares the merge-base AST with the head file: callers that no longer bind to a changed signature, redefinitions, shadowed imports, changed defaults, parameters no longer used, new overrides, changed constants. history counts files touched by revert and hotfix commits in the last year.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
change_risk rates a changed function or module-level edit 0-100 from named factors (reach, exposure, coverage, kind, size, centrality, crossings, contract, history) with separate confidence, and groups dependents by service. pr_impact.review returns the scored chunks and the PR comment; bands calibrated on the vLLM regression replay, where the change's top 3 are always Must check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai_review sends a chunk with its callers' call sites to Claude (Haiku 5.5 by default) and keeps only notes that quote a line it was shown. Never changes a score; cached on disk; key read from the environment or the repo .env for this feature only. Includes the planted-bug eval harness for vLLM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_queue lists branches ahead of the base and estimates their risk from the loaded graph, checks branches out into at most five Flowify-owned worktrees, runs the pytest tests that reach a chunk, reads and writes .flowify/review.json, and groups changes that could be split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Includes the endpoints behind trace, node source, focus and impact that earlier commits' UI and tests use. /review gains parts, author notes and ai_available; new /review/ai, /review/tests, /review/notes, /queue, /queue/open and /queue/worktree, all limited to local checkouts with refs validated before they reach git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QueuePanel lists branches by worst change; ReviewPanel groups changes into Must check, Worth a glance and Skim with a verdict strip, leads each change with static findings and Claude notes, keeps checks by chunk hash so edited changes come back, adds flags and a finish summary, and an author mode with test runs and notes. Review and Explore are two modes in the sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New problem statement in README and PROJECT.md, the reviewer journey, the risk score and review docs, and the UX audit and plan behind them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Local mode CORS defaults to the UI's own origins: the review endpoints run tests and write into the repo
- Repository text sent to Claude has `</` escaped so it cannot close its data block
- Worktree folders carry a hash of the ref, so refs that sanitise alike no longer share one
- /review/ai and /review/tests turn git failures into a 400 like /review
- Server mode refuses review calls before loading the graph
- git clone times out after 300 s
- Grounding counts only unquoted notes as dropped; .env inline comments are ignored
- Queue status counts a checked and flagged chunk once
- System prompt gains a review procedure and checklist; its text keys the cache instead of a version number

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…human

Each change chunk carries a coverage status (flagged/scanned), the checks run,
their limits, and reasons Flowify could not tell. not_analysed lists deleted and
untracked files, lines outside any chunk and removed functions, each skipped or
needing a human. An enclosing function now counts as changed when its own lines
change, not only its nested functions'. The PR comment shows coverage too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…changes

A git link is kept as a full clone in local mode, so the sidebar can show the
repo, a branch dropdown and four modes: read the codebase, review GitHub pull
requests, compare two commits, and review local uncommitted changes.
/mcp/local_changes (MCP tool review_local_changes) ranks a checkout's uncommitted
edits and links to the same review in the UI. The review screen also shows the
new coverage and needs-a-human state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…MIT license

The README opens with the one-line positioning, badges, a screenshot of a
real pull-request review and a two-line start, and documents the four-option
journey, the review endpoints and the review_local_changes MCP tool. Adds an
MIT LICENSE and a CONTRIBUTING guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Flowify impact

479 changes ranked by risk · reaches 57 API endpoints · touches 3 other services

# Risk Change Reaches Test in chain
1 70 Critical _load_payload (backend/app/storage.py:341) 115 dependents · 52 endpoints · 2 other services yes
2 64 Critical iter_repo_files (backend/app/ingestion.py:50) 68 dependents · 12 endpoints · 1 other service yes
3 63 Critical build_function_graph (backend/app/graph_builder.py:1118) 49 dependents · 7 endpoints · 1 other service yes
4 62 Critical _local_checkout (backend/app/main.py:896) 13 dependents · 13 endpoints no
5 59 High _Visitor._emit_calls (backend/app/graph_builder.py:456) 57 dependents · 8 endpoints · 1 other service yes
6 59 High compute_analytics (backend/app/graph_analytics.py:121) 54 dependents · 16 endpoints · 1 other service yes
7 58 High _cluster (backend/app/module_abstractor.py:61) 35 dependents · 8 endpoints · 1 other service yes
8 58 High score_chunk (backend/app/change_risk.py:34) 26 dependents · 5 endpoints · 1 other service yes
9 58 High seed_terminology_from_graph (backend/app/learning.py:332) 32 dependents · 7 endpoints · 1 other service yes
10 57 High _graph_for (backend/app/main.py:1026) 7 dependents · 6 endpoints no
11 57 High _resolve_call_target (backend/app/graph_builder.py:950) 50 dependents · 7 endpoints · 1 other service yes
12 56 High _ordered_calls (backend/app/graph_builder.py:65) 58 dependents · 8 endpoints · 1 other service yes
13 56 High ⚠ update (backend/app/pipeline.py:558) 9 dependents · 7 endpoints no
14 55 High _detect_semantic_kind (backend/app/graph_builder.py:166) 58 dependents · 8 endpoints · 1 other service yes
15 55 High group_control_flow_functions (backend/app/control_flow_analyzer.py:97) 36 dependents · 8 endpoints · 1 other service yes

…and 464 more.

Why these scores
  1. _load_payload: reach +27 (115 functions depend on it), exposure +20 (reached from 52 API endpoints), kind +15 (signature line changed, so callers may now be wrong), size +1 (5 lines changed), centrality +3 (in the top 10% most central in the repo), crossings +4 (used from 2 other services)
  2. iter_repo_files: reach +24 (68 functions depend on it), exposure +20 (reached from 12 API endpoints), kind +15 (signature line changed, so callers may now be wrong), centrality +3 (in the top 17% most central in the repo), crossings +2 (used from 1 other service)
  3. build_function_graph: reach +22 (49 functions depend on it), exposure +20 (reached from 7 API endpoints), kind +5 (body edited), size +8 (74 lines changed), centrality +6 (in the top 2% most central in the repo), crossings +2 (used from 1 other service) — 1 unconfirmed caller
  4. _local_checkout: reach +15 (13 functions depend on it), exposure +20 (reached from 13 API endpoints), coverage +15 (no test in its caller chain), kind +3 (new code, nothing depended on it before), size +3 (16 lines changed), centrality +6 (in the top 1% most central in the repo)
  5. _Visitor._emit_calls: reach +23 (57 functions depend on it), exposure +20 (reached from 8 API endpoints), kind +3 (new code, nothing depended on it before), size +8 (43 lines changed), centrality +3 (in the top 17% most central in the repo), crossings +2 (used from 1 other service)

Coverage: 479 scanned · 0 flagged by a static check · 37 need a human · 70 skipped

Needs a human: Flowify could not tell

  • check_function (backend/app/contract_checks.py:156): no confirmed caller, but 1 unresolved call by this name may reach it
  • check_module (backend/app/contract_checks.py:283): no confirmed caller, but 1 unresolved call by this name may reach it
  • removed_definitions (backend/app/contract_checks.py:87): no confirmed caller, but 1 unresolved call by this name may reach it
  • Sources.base (backend/app/contract_checks.py:61): no confirmed caller, but 3 unresolved calls by this name may reach it
  • class_bases (backend/app/contract_checks.py:313): no confirmed caller, but 1 unresolved call by this name may reach it
  • merge_base (backend/app/contract_checks.py:31): no confirmed caller, but 1 unresolved call by this name may reach it
  • save (frontend/src/components/ReviewPanel.jsx:650): no confirmed caller, but 1 unresolved call by this name may reach it
  • copy (frontend/src/components/Inspector.jsx:81): no confirmed caller, but 1 unresolved call by this name may reach it
  • copy (frontend/src/components/ReviewPanel.jsx:405): no confirmed caller, but 1 unresolved call by this name may reach it
  • copy (frontend/src/components/ReviewPanel.jsx:525): no confirmed caller, but 1 unresolved call by this name may reach it
  • copy (frontend/src/components/TracePanel.jsx:140): no confirmed caller, but 1 unresolved call by this name may reach it
  • service_resolver.resolve (backend/app/change_risk.py:154): no confirmed caller, but 2 unresolved calls by this name may reach it
  • Fake.create (tests/test_ai_review.py:30): no confirmed caller, but 1 unresolved call by this name may reach it
  • .github/workflows/pr-impact.yml: not code the call graph covers (configuration, data or an unsupported language): what reads it is unknown
  • backend/app/flow_verifier.py: deleted: anything still importing or calling into it will break
  • …and 22 more.
Skipped (70)
  • CONTRIBUTING.md: documentation
  • LICENSE: documentation
  • README.md: documentation
  • backend/app/control_flow_analyzer.py:95: lines 95-96: comments, blank lines or docstrings only
  • benchmarks/accuracy/results/click.json: documentation
  • benchmarks/accuracy/results/click_before_tiers.json: documentation
  • benchmarks/accuracy/results/flask.json: documentation
  • benchmarks/accuracy/results/flask_before_tiers.json: documentation
  • benchmarks/accuracy/results/jinja.json: documentation
  • benchmarks/accuracy/results/jinja_before_tiers.json: documentation
  • benchmarks/ai_review/vllm_manifest.json: documentation
  • benchmarks/regressions/README.md: documentation
  • benchmarks/regressions/results/vllm.json: documentation
  • benchmarks/regressions/results/vllm_after.json: documentation
  • benchmarks/regressions/results/vllm_after_typed.json: documentation
  • benchmarks/regressions/results/vllm_parser_fixed.json: documentation
  • benchmarks/regressions/results/vllm_scores_2026-11.json: documentation
  • benchmarks/regressions/vllm_pairs.json: documentation
  • docs/DEPTH2_FLOW_ANALYSIS.md: documentation
  • docs/ENHANCED_DRILL_DOWN.md: documentation
  • docs/ENTRY_POINT_DETECTION_FIX.md: documentation
  • docs/LLM_INTEGRATION_SUMMARY.md: documentation
  • docs/MCP_IMPLEMENTATION_SUMMARY.md: documentation
  • docs/PROJECT.md: documentation
  • docs/UI_ACCESS.md: documentation
  • docs/accuracy.md: documentation
  • docs/architecture.md: documentation
  • docs/change-risk.md: documentation
  • docs/codex-planning-session.md: documentation
  • docs/enterprise-pitch-feedback.md: documentation

Risk is a 0-100 triage score; every point is a named factor. ⚠ = low confidence: the static call graph resolves roughly half of real calls (see docs/accuracy.md), so incomplete evidence raises a floor and a short list is a place to start, never proof of safety.

@mimo1999
mimo1999 merged commit eb62fad into main Dec 1, 2026
4 checks passed
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