rig 3.27.0
A work's record can be corrected after the fact (#235)
A work's record can be corrected after the fact
Tickets: #145, #198, #178, #146
Direction
Every fact rig writes into a work's record gets a way to be corrected in place, with the views of it (the context doc's header, the generated AGENTS.md and the PR body) rewritten from the record rather than hand-edited. Nothing new is stored except what a correction needs; nothing is deleted that a reader would want a year later.
- The title (#145):
rig save --title "...". The title is prose, like the context doc, so it rides on the command that already commits hand-made prose. It rewriteswork.json, the context doc's# <id> — <title>heading and the generated AGENTS.md. Never the branch (renaming it breaks the stack) and never the id (it names a folder and a record across every root). The heading is rewritten only by this flag, never by every save, so a heading edited by hand is not silently reverted. - Tickets (#198):
rig ticket <new> --replaces <old>andrig ticket --remove <key>. Both rewrite the record and theTickets:line, and neither tells the tracker anything. A key is corrected wherever the record holds it: the work's tickets and any stage's own--key. A transferred issue has a new number whichever list named it, so one command covers both, and--replaceskeeps the new key in the place the old one held. A key the record does not hold is refused.- The shared-ticket close (#154) is not what remove is for. Remove says the record was wrong about a ticket. A work that did part of a ticket was right to name it; what it wants is a ticket the work refers to without delivering, which
rig closecomments on and never closes. Removing works as a stopgap, at the cost of the close comment and the header naming the ticket. The real answer is its own change, left for Hugo to ticket.
- The shared-ticket close (#154) is not what remove is for. Remove says the record was wrong about a ticket. A work that did part of a ticket was right to name it; what it wants is a ticket the work refers to without delivering, which
- The PR body (#178):
rig pr --refresh. Rewrites each repo's open work-branch PR from the current record, title and body, through the same rendererrig propens it with, so the two cannot drift. Idempotent: an unchanged PR is reported as up to date and not edited. With no open PR it says so and opens nothing.rig nextoffers it when an open PR's title or body differs from whatrig prwould render now, the way it offersrig plan --refresh. A newghadapter method,editPr, with its in-memory fake;prForBranchcarriestitleandbodyso the comparison costs no extra call. - Stages (#146):
rig stage <branch> --dropped "reason"andrig stage <branch> --replaced-by <branch>. Recorded on the stage asdroppedAt+reason, orreplacedAt+replacedBy, never deleted, likeabandonedAtat the work level.--replaced-bynames another declared stage of this work.rig stage,rig nextand the stage table (PR body and rollout plan, one renderer) show it as dropped or replaced, never as "not started", andrig nextnever offers it as the next stage. A stage that has landed cannot be dropped. - Stages 3 and 4 share one renderer. The stage table is
stageTable, used byrig pr,rig pr --refresh,rig next's staleness check and the rollout plan, so dropping a stage makesrig nextoffer the refresh.
Not in this work: renaming the branch, renaming the id, and a "referred to, not delivered" ticket kind.
Planned stages
feat/save-title-corrects-the-work-title— #145,rig save --title.feat/ticket-replaces-and-remove— #198,rig ticket --replaces/--remove.feat/pr-refresh-rewrites-the-open-pr— #178,rig pr --refresh, theeditPradapter, therig nextoffer.feat/a-stage-can-be-dropped-or-replaced— #146,rig stage --dropped/--replaced-by.
DESIGN decisions 123–126, one per stage, in that order.
Stages
| Order | Stage | Delivers | Repos | PR | State |
|---|---|---|---|---|---|
| 1 | feat/save-title-corrects-the-work-title |
rig save --title corrects the work's title | rig | #230 | landed |
| 2 | feat/ticket-replaces-and-remove |
rig ticket --replaces and --remove correct the record's tickets | rig | #231 | landed |
| 3 | feat/pr-refresh-rewrites-the-open-pr |
rig pr --refresh rewrites each open PR from the record, and rig next offers it | rig | #232 | landed |
| 4 | feat/a-stage-can-be-dropped-or-replaced |
a declared stage can be dropped or marked replaced, and says so | rig | #233 | landed |
Context doc: https://github.com/hugoforte/rig-data/blob/main/work/record-fidelity/context.md
Full changelog: v3.26.1...v3.27.0