Add bw archive: move closed issues out of active consideration#135
Open
jallum wants to merge 1 commit into
Open
Add bw archive: move closed issues out of active consideration#135jallum wants to merge 1 commit into
jallum wants to merge 1 commit into
Conversation
…ork-2dx)
Adds `bw archive`, which moves closed issues into an archive/ tree on the
beadwork branch. Archived issues leave the live ID space and the
status/labels/blocks indexes — so ready, blocked, list, and ID resolution
skip them and ID-prefix matching stays uncrowded — while remaining in git
and keeping their titles in recap.
Store (internal/issue/archive.go):
- Archive(id, {Close, Detach}) moves issues/<id>.json -> archive/<id>.json,
freezes status=closed, stamps archived_at, removes status/labels/blocks
markers, and detaches the dependency graph (mirrors Delete's cleanup).
- Refuses non-closed issues (*NotClosedError) unless Close; refuses issues
with open dependents/children (*ArchiveBlockedError) unless Detach.
- ArchiveCheck (non-mutating preview), ArchivedIssue (exact-id read),
ClosedBefore(cutoff) for the date sweep. Adds Issue.ArchivedAt.
- Archived IDs are excluded from generateID and validateExplicitID, so
they are never recycled (would break recovery).
Intent (internal/intent): `archive <id> [--close] [--detach]` verb +
replayArchive, so the operation converges through bw sync conflicts. The
bulk sweep emits one concrete `archive <id>` line per ticket (never a date
expression) for deterministic replay.
Command (cmd/bw/archive.go): `bw archive <id>...` executes directly;
`bw archive --before <cutoff>` sweeps closed issues whose closed_at
precedes a past date (via resolveDateBeforeNow), previewing by default and
committing with --force, skipping issues with open work unless --detach.
Recap title lookup falls back to archive/ so historical recaps keep titles.
One-way; recovery via git history or bw import. Docs + CHANGELOG updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #134 (needs
resolveDateBeforeNow). Review/merge #134 first; this PR's base will retarget tomainonce #134 lands.What
Adds
bw archive— moves closed issues into anarchive/tree on the beadwork branch so they leave active consideration.Archived issues leave the live ID space and the
status//labels//blocks/indexes, so they no longer surface inready,blocked,list, or ID resolution (and stop crowding ID-prefix matching) — while staying in git and keeping their titles inbw recap. One-way; recover via git history orbw import.Behavior (per the design discussion)
--closehint;--closecloses it first.--detachsevers those edges (dependents lose the blocker, open children are orphaned — mirroringdelete). Closed dependents need no--detachand are cleaned up automatically.bw archive --before <cutoff>archives every closed issue whoseclosed_atprecedes a past cutoff (2026-01-01,6 weeks,last monday, …) viaresolveDateBeforeNow. Previews by default;--forcecommits; issues with open work are skipped unless--detach.generateIDand explicit---idvalidation.How it's built
internal/issue/archive.go):Archive(id, {Close, Detach}),ArchiveCheck(non-mutating preview),ArchivedIssue,ClosedBefore; typedNotClosedError/ArchiveBlockedError; newIssue.ArchivedAt.internal/intent):archive <id> [--close] [--detach]verb +replayArchive. Bulk sweep emits one concretearchive <id>line per ticket (never a date expression) for deterministic replay.storeLookup.Titlefalls back toarchive/so historical recaps keep titles.Tests (TDD)
Store, intent-replay, and command layers each got tests written first (red → green). Beyond units, verified end-to-end against a built binary: clean archive, open-dependent refusal +
--detach,--close,--beforepreview/force, recap title retention, and — the key property —bw syncconflict convergence: a second clone's localcreaterebased/replayed cleanly on top of another clone'sarchive, with the archived issue gone from the live list and the new work preserved. Full module suite +go vetgreen.Ticket: beadwork-2dx