Skip to content

Add local history and SZZ index - #7

Merged
EhsanAzish80 merged 4 commits into
mainfrom
engine/index-szz
Dec 4, 2026
Merged

EhsanAzish80 merged 4 commits into
mainfrom
engine/index-szz

Conversation

@EhsanAzish80

@EhsanAzish80 EhsanAzish80 commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add an offline Git subprocess reader and versioned SQLite cache outside repositories
  • incrementally index commits, file changes, co-change evidence, and SZZ bug-introduction records
  • prune commits that age out of rolling windows while retaining bug evidence until its fix ages out
  • invalidate incompatible caches with ENGINE_VERSION = 2; reserve other full rebuilds for explicit requests and history rewrites
  • honor .git-blame-ignore-revs with a safe retry without it, reject mass-change intro commits, batch file hunks into one blame call, and use rename-aware diffs
  • batch commit metadata and numstat reads, including missing intro commits
  • add devscope index with safe rebuild and history-window controls

Verification

  • uv run ruff check src tests
  • uv run mypy src
  • uv run pytest -q (194 passed)
  • incremental sliding-window fixtures compare complete bug_intro and cochange rows with fresh cold indexes from separate cache directories
  • parity is checked while an intro commit has aged out but its fix remains, and again after the fix ages out
  • fixtures also cover engine-version invalidation, ignored-revision fallback, >50-file intro commits, rename-plus-fix, multiline messages, punctuation-only lines, multi-range blame, and batched numstat parsing

Performance

Measured from signed commit 189040b on a clean detached django/django worktree containing exactly 10,000 public commits. Each run used a fresh cache.

  • default window: 2,952 commits, 50.28s, 1,130 bug-introduction records
  • forced 5,000-commit stress window: 76.94s, 1,756 bug-introduction records
  • both cold runs are below the 180s target
  • capped 40-commit rolling update: 0.29s, exactly 1 new commit, 40 total, rebuilt=False

Corpus caveat

Django is suitable for throughput measurement, but not automatically for the P3 accuracy corpus: subjects such as Fixed #N close Trac tickets that may be features. Django must be excluded or its ticket types validated before corpus approval.

Scope

This is the architecture spec P1 foundation only. The point-in-time risk feature layer will continue separately on engine/risk-v2.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Devscope Health Check

Devscope: A · Low risk · Easy onboarding · 0.61 test-file ratio · 0.04s ⚡

Updated: Fri, 04 Dec 2026 14:06:12 GMT

@codecov-commenter

codecov-commenter commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54207% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/devscope/index/git_reader.py 89.43% 13 Missing ⚠️
src/devscope/risk/features.py 90.42% 9 Missing ⚠️
src/devscope/index/incremental.py 96.64% 5 Missing ⚠️
src/devscope/index/store.py 94.44% 3 Missing ⚠️
src/devscope/cli.py 88.23% 2 Missing ⚠️
src/devscope/szz/filters.py 94.73% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@EhsanAzish80
EhsanAzish80 merged commit 69d8aa2 into main Dec 4, 2026
10 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.

2 participants