Skip to content

fix(update): refill function blame for all files on a full git walk - #5226

Open
Aschenbath wants to merge 1 commit into
repowise-dev:mainfrom
Aschenbath:fix/update-full-git-function-blame
Open

Aschenbath wants to merge 1 commit into
repowise-dev:mainfrom
Aschenbath:fix/update-full-git-function-blame

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Summary

  • When update re-reads the whole git history (force_full_git, e.g. a GIT_HISTORY_VERSION bump), git_meta_map holds every file's blame index, but git_function_blame was only written for the changed files. run_partial_analysis now takes full_git_history and, when it is set, builds the rollup over every file the way init does (HealthAnalyzer.function_blame_rows; unchanged sources come out of the walk cache). With no changed file it returns a blame-only HealthReport.
  • persist_partial_health upserts those rows, also in its early return for a report with no analysed path, so a forced walk with nothing to re-score still refills the table. The CLI update and the workspace update both pass full_git_history=bool(full_git_summaries). The rows are written by the health persist, where the update path already writes them, rather than with the git tables as my claim comment said, because they need the walked function bounds.
  • Unchanged: blame stays FULL-tier only (rows come only from blame indexes), and an ordinary update still re-blames the changed files alone.

Related Issues

Fixes #5216

Test Plan

  • New tests in tests/unit/cli/test_update_git_history_stamp.py: with a stale stamp and an emptied git_function_blame, update writes back exactly what init wrote (symbol_id -> mod_count) with the analyzer stamp current and stale (re-score), and through update_single_repo_index; an ESSENTIAL-tier repo stays empty; an ordinary update re-blames only the changed file. Without the fix the three refill cases fail and the two guards pass.

  • tests/unit/{health,pipeline,workspace,persistence,cli,dead_code,ingestion} and test_function_blame_rollup.py locally on Windows: 22706 passed, 4 failed. Two fail on main here too (a GBK decode in test_migration_fts_frozen; the pytest tmp dir sits inside a git work tree for test_hook_default_on), and two timing tests pass when rerun alone.

  • ruff check on the changed files

  • The issue's repro on cobra (adbc881): init --no-prose writes 519 blame rows; then empty the four git tables, set git_history_version: 3 and run update --index-only:

    main this branch
    analyzer stamp current 0 519, identical to init
    health_analyzer_version: 43 (re-score) 166 519, identical to init

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass (the 4 local failures above are environment or timing; CI will confirm)
  • I have updated documentation if needed (none needed; the changelog is generated from commits)

🤖 Generated with Claude Code

A forced full git walk (a GIT_HISTORY_VERSION bump) leaves a blame index
for every file in git_meta_map, but only the partial health pass turned
blame into git_function_blame rows, and it walks the changed files alone.
An emptied or partial rollup therefore stayed that way until the next
init.

When the walk re-read the whole history, the partial analysis now builds
the rollup over every file, as init builds it, and the health persist
upserts it, also when no file changed. Blame stays FULL-tier only, and an
ordinary update still re-blames the changed files alone.

Fixes repowise-dev#5216
@repowise-bot

repowise-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Looks safe to merge: no open points, no breaking contract change found, a test imports every changed code file.

Reviewed the whole diff: nothing to fix.

➖ Health of changed files: 3.63 → 3.62 (-0.01; structure -0.02) Average full file score (structure and history) of 7 changed code files, weighted by size before this PR; not the repository score.

👀 Suggested reviewers RaghavChamadiya


View on Repowise
Plain markdown for agents · Reviews (1) · Last reviewed commit: fix(update): refill function blame for all files on a full git walk

Settings and updates

Silence one PR with [skip repowise] in the title · Bot settings
/repowise recheck reviews the current head again
/repowise review deep runs the deep review on it
/repowise remember <text> tells the reviewer what to leave out next time (reply on a finding to scope it to that file)
/repowise help lists the commands
⭐ Star Repowise · 📥 Install on another repo

This branch has not been deployed

No deployments
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.

[Bug] update does not refill git_function_blame when it re-walks the full history

1 participant