Skip to content

insights: the scan reads each repo's history once, and four steps no reader uses are off unless switched on - #39

Merged
teocns merged 1 commit into
mainfrom
insights-scan-reads-history-once
Nov 13, 2026
Merged

teocns merged 1 commit into
mainfrom
insights-scan-reads-history-once

Conversation

@teocns

@teocns teocns commented Nov 13, 2026

Copy link
Copy Markdown
Member

Before and after:

  • Before, the file inventory and the commit check asked git git log -- <path> once per file, each call walking the whole history. On a laptop with many repositories that was the larger part of the scan.
  • After, a repository asked about many files is read once (git log --name-only, plus one more call for its merge commits), and every file's answer is taken from that read. The answer is the one git log -- <path> gives, merges and history simplification included. A path git would read as a pattern, a repository with no commits or too many, or a failed call goes to git one path at a time, as before. The commit check asks git in batches per repository and skips session logs that cannot hold a commit call. The inventory walks each folder once, and the launcher scan skips a script that names no launch word without decoding it.
  • Four steps whose output no part of a run reads now run only when switched on: the size, the uncommitted files and the merge state of each linked worktree (AGENTIC_SETUP_WORKTREE_SIZES, AGENTIC_SETUP_WORKTREE_DIRTY, AGENTIC_SETUP_WORKTREE_MERGED), and the git ignore check on a file with no commits (AGENTIC_SETUP_IGNORE_CHECK). Set a variable to 1 to run that step again. Their fields stay in the output as empty (or absent). Nothing is deleted.
  • Measured on one busy laptop, back to back on the same data: the file inventory 413 s to 183 s, the commit check 102 s to 12 s, with the same answers. The whole scan step went from 777 s to 503 s with the changes of this stack applied.

Limits: the whole-history read is used for a repository asked about 8 times or more; for fewer files one call each is cheaper and stays. Time limits for that read come in the last pull request of this stack.

Test:

  • cd plugins/insights/scripts/v15/engine/variants/views && uv run --no-project python -m unittest test_view_built test_view_mylevel test_counts (45 tests, OK)

  • claude plugin validate . passes with the warnings it already gave.

  • The new read has tests in the sources this repository is published from, comparing its answer with git log -- <path> on repositories with renames, spaces and non-ASCII names, quoted names, merges, random histories, linked worktrees and no commits; they pass and are not shipped here.

  • One change. I did not edit a version, a CHANGELOG.md, marketplace.json or kit.json.

  • Nothing personal: no names, no paths from my machine, no output of my own scan, no secrets.

No version change: nothing reaches members until a release.

…reader uses are off unless switched on

Kit-Commit: 02e3daf968a8757bf3d5be58f19b92b27f45b7e1
Kit-Only: plugins/insights
@teocns
teocns merged commit 461c1d2 into main Nov 13, 2026
@teocns teocns mentioned this pull request Nov 13, 2026
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