Skip to content

feat: renumber verb to reassign an item's ID (#12) - #22

Merged
budhash merged 1 commit into
mainfrom
feat/renumber
Jul 13, 2026
Merged

budhash merged 1 commit into
mainfrom
feat/renumber

Conversation

@budhash

@budhash budhash commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Closes #12.

What

renumber OLD (NEW | --next) [--refs] — reassign an item's ID without hand-editing TASKS.md. The one command that replaces the incident's entire cleanup (sed on the file + manual reference hunt).

In-file (always): renames the primary line and every @shadow copy (features), repoints all @deps=/@rel= lists containing the old ID, renames the ## <OLD> header in # Notes, and prints a summary of what moved. Reference edits go through the anchored tag-region helpers — prose mentions in titles are never rewritten (per the #9 rules).

--refs (opt-in, read-only): scans git-tracked files for remaining mentions (canonical and short forms — T-12 for T-0012, without matching T-00123) and prints file:line: excerpt. It never modifies files — repointing external references is deliberately the operator's/agent's job (per the design discussion). Outside a git repo it prints a skip note.

Guards: occupied target (suggests --next) · cross-kind (T-↔F-) · missing source · OLD == NEW · NEW + --next together. No --force — safest semantics, and a brand-new verb so nothing existing changes.

Design

Approved interactively; recorded in docs/superpowers/specs/2026-07-13-renumber-design.md. Pairs with #13 (allocation prevents collisions) and #14 (ref-integrity detects fallout); this verb fixes the ones that slip through.

Verification

  • New e2e scenarios 51–52 (20 assertions): rename + @deps/@rel/notes repoint, show/validate after, all five guards, --next (including deps following), feature rename with @shadow sync (2 lines new ID / 0 old), --refs report + byte-identical proof the referenced file wasn't modified, and the not-a-git-repo skip.
  • make check green: 285 assertions, 0 failures; smoke OK; 3.8-safe; single file, zero deps.

Minor version: 1.2.0 → 1.3.0.

There was no way to change an item's ID: resolving a multi-branch ID collision
meant sed on TASKS.md (the documented anti-pattern) plus manually repointing
every reference.

Add `renumber OLD (NEW | --next) [--refs]`:

- Renames the primary line and every @shadow copy (features), repoints all
  @deps=/@rel= lists containing the old ID (tag region only — prose mentions
  stay untouched per the #9 rules; short-form hand-written deps normalize),
  and renames the `## <OLD>` header in # Notes.
- Refuses an occupied target (suggesting --next), cross-kind moves, no-ops,
  and NEW+--next together. `--next` moves to the next free ID of the same kind.
- `--refs` prints a read-only report of remaining mentions across git-tracked
  files, matching canonical and short forms (T-12 for T-0012) without longer
  numbers; repointing externals is deliberately the operator's job. Outside a
  git repo it prints a skip note.

Design doc: docs/superpowers/specs/2026-07-13-renumber-design.md.
New e2e scenarios 51-52 (20 assertions): rename + deps/rel/notes repoint,
all guards, --next, feature shadow sync, --refs report + read-only proof,
and the no-git skip. version 1.2.0 -> 1.3.0.
@budhash
budhash merged commit 0c586c0 into main Jul 13, 2026
5 checks passed
@budhash
budhash deleted the feat/renumber branch July 13, 2026 22:42
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.

Feature: renumber verb — reassign a task's ID (+ repoint references)

1 participant