Phase whygraph scan into three ordered phases with a results panel#33
Merged
Conversation
`whygraph scan` already sequenced git/GitHub before the LLM analyzer, but every crawler's progress bar was registered at construction and all five were built before any thread started, so the run *looked* fully parallel. Make the structure real and visible: - Three ordered phases — Phase 1 git + GitHub (concurrent), Phase 2 pr-origins, Phase 3 analyze (the slow LLM long pole, last and alone) — with CodeGraph a best-effort background task spanning the whole scan. - Construct each phase's crawlers when its phase starts, so bars appear per-phase instead of all at once (no Crawler render-path change). - Icon'd, numbered `console.rule` headers (numbered against the count of phases that actually run), per-phase timing + a dim completion line, and a Progress column set with M-of-N + elapsed for the LLM phase. - New closing results panel bookending the pre-scan preview: per-phase status glyph, summary, timing, and total elapsed. Fed by a single additive `Crawler.summary` attribute set by each crawler's `work()`. Sequencing analyze last is behavior-preserving: it only ever describes main-walk commits (todo is bounded by `repository.commits`), so recovered on_default_branch=0 origin commits stay on lazy backfill exactly as before. Tests: new phase-ordering / header / skip cases, a defensive results-panel unit test, per-crawler summary strings, and an origin-commits-stay-lazy behavior pin. 527 passed; ruff check + format clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
whygraph scanalready sequenced git/GitHub before the LLM analyzer, but every crawler's progress bar was registered at construction and all five were built before any thread started — so the run looked fully parallel even though it wasn't. This makes the real structure visible and sharpens it.Changes
git+github(concurrent) → Phase 2pr-origins→ Phase 3analyze(the slow, token-heavy LLM long pole, run last and alone).codegraphstays a best-effort background task started before Phase 1 and joined after Phase 3.Crawlerrender path.console.ruleheaders (numbered against the count of phases that actually run), per-phase timing + a dim✓ … (Ns)completion line, and aProgresscolumn set withMofNCompleteColumn+TimeElapsedColumnso the LLM phase reports12/45 · 0:00:31.✓/⚠/✗/— skipped), summary, timing, and total elapsed — fed by a single additiveCrawler.summaryattribute set by each crawler'swork().--no-llm-descriptionshelp text updated (no hard-coded phase number).Behavior-preserving
Sequencing
analyzelast does not change what gets described: itstodois bounded byrepository.commits(the main walk), which never includeson_default_branch=0origin rows — so recovered PR-origin commits stay on lazy backfill exactly as before. Pinned by a new test.Testing
tests/test_cli_scan_phases.py: phase-ordering (LLM strictly last), numbered-header counts (1/3,1/2,1/1), skip cases, and a defensive/total results-panel unit test.test_git_crawler.py/test_scan_analyze_crawler.py:Crawler.summarystrings + the origin-commits-stay-lazy behavior pin.ruff checkandruff format --checkclean.Notes
console(consistent with the pre-scan panel); non-TTY paths (hooks/CI/Docker) auto-degrade rich to plain lines, so automation is unaffected.