Skip to content

Pennyfarthing: add stash gate to prevent stale/lost code #86

@slabgorb

Description

@slabgorb

Problem

Stashes accumulate silently during story work — verify-phase refactors, branch switches, interrupted work. There's no gate or warning, so code gets stashed and forgotten. When it's finally discovered, it no longer applies cleanly and the refactor has to be redone (or is lost entirely).

Proposal

Add a stash gate to Pennyfarthing that:

  1. On story finish: Warns if any stashes exist that were created on the current feature branch. Block finish until they're applied or explicitly dropped.
  2. On story start: Warns if stashes exist from previous stories (staleness check). Show the stash list with ages.
  3. On branch switch: If switching away from a branch with uncommitted changes, prefer committing over stashing. If stashing is unavoidable, log it visibly.

Context

We lost a clean mixer refactor (_clamp_volume, _verify_channel DRY helpers, dead code removal) that sat in a stash for weeks. By the time it was found, the files had diverged and it couldn't apply cleanly. The refactor had to be manually reapplied.

This is a recurring pattern — verify-phase simplify fixes get stashed instead of committed, then lost.

Acceptance Criteria

  • pf sprint story finish checks for stashes from the current branch
  • pf sprint work shows stale stash warnings on startup
  • Stash age > 7 days triggers a warning in pf sprint status

Labels: pennyfarthing, enhancement

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