Inspiration

Abandoned open-source Python repos rot quietly: functions nobody calls, tests that pass or fail depending on run order, and dependencies with known vulnerabilities. Picking one back up means hours of archaeology before you can change anything safely.

What it does

python -m haunted scan PATH looks at a Python repo and writes a ranked markdown resurrection plan:

  • Zombie code: functions and classes with no references (test-runner entry points like Test classes, TestCase methods, pytest hooks and fixtures are excluded so they aren't flagged).
  • Flaky tests: --flaky-runs N reruns the suite in shuffled order and lists tests whose result changes between runs.
  • Cursed dependencies: checks pinned dependencies against the OSV vulnerability database (--no-osv to skip).
  • --html PATH writes a self-contained graveyard page of the findings.
  • --open-pr commits the plan as RESURRECTION_PLAN.md and opens one PR on your own fork with gh. Dry run by default, needs --yes to act, refuses repos you don't own, never merges.

On real repos: on corn-test it flagged the randomized even-number tests (pytest and unittest variants) as order/run dependent; on box/flaky it found an unreferenced _test_flaky_doctest helper.

How we built it with Kiro

  • Spec: .kiro/specs/haunted-repo/requirements.md, design.md, tasks.md drove the build task by task.
  • Steering: .kiro/steering/product.md, tech.md, structure.md.
  • Hooks: .kiro/hooks/test-on-save.kiro.hook and flake-check.kiro.hook.
  • 32 tests, all passing.

Challenges

Keeping zombie detection from flagging test-runner entry points (pytest collects them by name, so they look unreferenced). Making flake detection reliable without being slow. Making the PR flow safe by default.

Accomplishments

Runs end to end on real third-party repos and produces a plan a maintainer can act on; the PR flow can't touch repos you don't own.

What we learned

Spec-first tasks kept each feature small and testable; most of the work in "dead code" detection is deciding what not to flag.

What's next

Support more languages, rank by git history age, and suggest fixes for the top flaky tests.

Built With

  • github-cli
  • kiro
  • osv-api
  • pytest
  • python
Share this project:

Updates

Submission history