Skip to content

rig 3.27.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 15:31
2695432

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 rewrites work.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> and rig ticket --remove <key>. Both rewrite the record and the Tickets: 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 --replaces keeps 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 close comments 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 PR body (#178): rig pr --refresh. Rewrites each repo's open work-branch PR from the current record, title and body, through the same renderer rig pr opens 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 next offers it when an open PR's title or body differs from what rig pr would render now, the way it offers rig plan --refresh. A new gh adapter method, editPr, with its in-memory fake; prForBranch carries title and body so the comparison costs no extra call.
  • Stages (#146): rig stage <branch> --dropped "reason" and rig stage <branch> --replaced-by <branch>. Recorded on the stage as droppedAt + reason, or replacedAt + replacedBy, never deleted, like abandonedAt at the work level. --replaced-by names another declared stage of this work. rig stage, rig next and the stage table (PR body and rollout plan, one renderer) show it as dropped or replaced, never as "not started", and rig next never 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 by rig pr, rig pr --refresh, rig next's staleness check and the rollout plan, so dropping a stage makes rig next offer the refresh.

Not in this work: renaming the branch, renaming the id, and a "referred to, not delivered" ticket kind.

Planned stages

  1. feat/save-title-corrects-the-work-title — #145, rig save --title.
  2. feat/ticket-replaces-and-remove — #198, rig ticket --replaces / --remove.
  3. feat/pr-refresh-rewrites-the-open-pr — #178, rig pr --refresh, the editPr adapter, the rig next offer.
  4. 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