Skip to content

[Feature]: Detect when code changes make backlog tasks stale #556

@deefactorial

Description

@deefactorial

Is your feature request related to a problem? Please describe.

As code evolves, backlog tasks silently become outdated. A task references src/auth/oauth.ts but that file was deleted in a refactor. Acceptance criteria say "implement rate limiting" but it already exists. A completed task's referenced files have been modified since completion. All of a task's referenced files are gone, but the task is still open.

For AI agents consuming the backlog as context, stale tasks produce stale plans, leading to wasted tokens, confused implementations, and drift between what the backlog says and what the code actually does.

Describe the solution you'd like

A backlog drift subcommand (or similar) that detects when tasks have gone stale relative to the codebase. Two layers:

Layer 1: Structural drift (deterministic, fast, zero false positives)

  • Dead references: a task's --ref file has been deleted or renamed
  • Dependency state: a dependency task has been completed or archived
  • Stale completion: a Done task's ref was modified after completion
  • Orphaned task: all ref files deleted, task still active

Layer 2: Semantic drift (AI-powered, opt-in)

  • Description no longer matches the referenced code
  • Acceptance criteria already satisfied or invalidated by current code
  • Task is redundant with another task

Plus auto-discovery of file references from task descriptions and git history, and a pre-commit hook that flags affected tasks on every commit.

Additional context

I've built this as a standalone companion CLI called backlog-drift that reads Backlog.md's native file format. It's intentionally built with the same stack (Bun + TypeScript + Commander.js + gray-matter + Biome) and follows the same conventions, with the goal of eventually contributing it upstream as a native subcommand.

It's published on npm (npm i -g backlog-drift) and has 121 tests with ~99% coverage. Would love feedback on whether this is something that could eventually live inside Backlog.md itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions