Skip to content

feat(progress): add per-language progress reporting to scope-resolution phase#1813

Merged
magyargergo merged 6 commits into
mainfrom
worktree-perf-progress-reporting
May 25, 2026
Merged

feat(progress): add per-language progress reporting to scope-resolution phase#1813
magyargergo merged 6 commits into
mainfrom
worktree-perf-progress-reporting

Conversation

@magyargergo

Copy link
Copy Markdown
Collaborator

Summary

Fixes the frozen progress bar during scope resolution on large repos (#1741). The scope-resolution phase can run 74+ minutes on repos with 22K+ Java/Kotlin files, but previously emitted zero progress updates — the CLI bar sat at ~49% with a stale "Parsing code" label, making users think the tool was stuck.

Before: ████████████▒▒▒▒▒▒▒▒▒▒ 49% | Parsing code (2560s) — frozen for 74 minutes

After:

████████████▒▒▒▒▒▒▒▒▒ 54% | Resolving types (Java — extracting (5,000/10,903 files)) (15s)
████████████▒▒▒▒▒▒▒▒▒ 55% | Resolving types (Java — building scope model) (312s)
█████████████▒▒▒▒▒▒▒▒ 56% | Resolving types (Kotlin — resolving references) (89s)
█████████████▒▒▒▒▒▒▒▒ 57% | Resolving types (Kotlin — emitting edges) (45s)

Changes

  • Add scopeResolution to the PipelinePhase type union and PHASE_LABELS
  • Add onProgress callback to runScopeResolution — reports periodically during the extract loop (~50 updates per language) and at each sub-phase boundary (building scope model → resolving references → emitting edges)
  • Wire progress through scopeResolutionPhase with pre-counted file totals, per-language labels, and pipeline-wide percent mapping (90–95 internal → 54–57% display)
  • Re-allocate mro/communities/processes percent ranges to 95–100 to maintain monotonic progress after scope resolution
  • Add scopeResolution to mro's deps — latent ordering fix since mro reads EXTENDS edges that scope resolution writes via preEmitInheritanceEdges

Test plan

  • All 904 scope-resolution unit tests pass
  • All 19 pipeline runner tests pass
  • All 28 worker pool integration tests pass (17 passed, 11 skipped as expected)
  • TypeScript compiles clean (tsc --noEmit)
  • Pre-commit hooks pass (lint-staged + typecheck)
  • Manual verify on a large Java/Kotlin repo (miracleAi-new or similar) — confirm progress bar updates during scope resolution instead of freezing

…on phase (#1741)

The scope-resolution phase (which can run 74+ minutes on large Java/Kotlin
repos) previously emitted zero progress updates, causing the CLI progress bar
to freeze at ~49% with a stale "Parsing code" label — making users think
the tool was stuck.

- Add `scopeResolution` to PipelinePhase type and PHASE_LABELS
- Add `onProgress` callback to `runScopeResolution` with per-file updates
  during the extract loop and sub-phase boundary markers (building scope
  model, resolving references, emitting edges)
- Wire progress through `scopeResolutionPhase` with pre-counted file totals,
  per-language labels, and pipeline-wide percent mapping (90-95 internal)
- Bump mro/communities/processes percent ranges to 95-100 to maintain
  monotonic progress after scope resolution
- Add `scopeResolution` to mro's deps (latent ordering fix: mro reads
  EXTENDS edges that scope resolution writes via preEmitInheritanceEdges)
@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gitnexus Ready Ready Preview, Comment May 25, 2026 10:35am

Request Review

…deps JSDoc

- Clamp overallRatio to [0,1] so percent never exceeds 95 when
  readFileContents drops files (langFileCount < totalScopeFiles)
- Fire onProgress for the last file in the extract loop even when
  files.length is not divisible by progressInterval
- Update mro @deps JSDoc to include scopeResolution
- Fire initial 'extracting' event at file 0 so the sub-phase label
  appears immediately, not after progressInterval files
- Emit a completion event at percent 95 when scope resolution finishes
  so the bar definitively reaches the phase ceiling before mro starts
…ter, cleaner labels

- Format elapsed time as "5m 12s" / "1h 20m" instead of raw "(312s)"
  for all pipeline phases (CLI-wide improvement)
- Add language counter "[1/3]" to scope-resolution detail so users
  know how many languages remain and which is active
- Rename sub-phases for clarity: "building scope model" → "analyzing
  types", "emitting edges" → "linking symbols"
- Remove nested parentheses from detail strings for cleaner display
- Expand scope-resolution percent range from 5 to 8 points (90-98
  internal → 54-59% display) for more visible bar motion
- Re-allocate mro (98), communities (98-99), processes (99-100)
@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
9723 9721 0 2 600s

✅ All 9721 tests passed

2 test(s) skipped — expand for details
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 80.11% 33137/41363 N/A% 🟢 ████████████████░░░░
Branches 68.65% 21200/30881 N/A% 🟢 █████████████░░░░░░░
Functions 84.91% 3433/4043 N/A% 🟢 ████████████████░░░░
Lines 83.5% 29835/35730 N/A% 🟢 ████████████████░░░░

📋 View full run · Generated by CI

- Extract ScopeResolutionSubPhase union type with exhaustive switch
  guard so adding a sub-phase without updating phase.ts is a compile
  error
- Add scopeResolution key to en and zh-CN locale files so the web UI
  shows translated labels instead of raw message fallback
- Extract formatElapsed to its own module with 7 boundary-value tests
  (0s, 59s, 60s, 3599s, 3600s, 3661s, 7323s)
- Add runScopeResolution onProgress integration test proving sub-phase
  order (extracting → analyzing types → resolving references → linking
  symbols) and the 0-file early-return path
@magyargergo magyargergo merged commit 5e8690f into main May 25, 2026
27 checks passed
@magyargergo magyargergo deleted the worktree-perf-progress-reporting branch May 25, 2026 10:53
@magyargergo magyargergo linked an issue May 25, 2026 that may be closed by this pull request
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.

GitNexus analyze gets stuck at 49% during “Resolving calls”.

1 participant