There is no way to delete a run for good, and run branches are never deleted: let the operator delete runs, branches and all, and drop a branch once its PR merges #167
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
During development the ledger fills with garbage runs. Archive only hides a run: its events stay in
osf.db, which is 1.2 GB with about 228,000 events on production. Its branch is kept forever too, asrefs/osf/archive/<run>in osfd's repository copy and asosf/run_…orfeature/run_…on Forgejo. Braid also never deletes a branch after merging its PR.On production on 2026-10-09: 54 runs and 21 run folders. The repository copies hold 31
refs/osf/archive/*refs plus the runs'osf/*andfeature/run_*heads (soundcheck 19 refs, scratch 21, openspec-flow 9). Forgejo hasosf/*branches on soundcheck andfeature/run_*on scratch.Want (decided with the operator)
run,step,attempt,gate,operation,checkpoint,external_effect,budget_ledger,ci_run,lease), soosfd rebuild --verifystill agrees;refs/osf/archive/<run>and the run's branch in osfd's repository copy;#N, or the number of runs, before deleting. No settings switch.git.pr.mergemerges a run's PR, the branch goes from Forgejo, as with Forgejo's "Delete branch after merge". A PR merged on Forgejo by a person gets the same.Live runs can't be deleted; they have to be stopped first, as for archive. Deleting doesn't wait to measure the files (#154).
Shipped in the
delete-runschange (archived asopenspec/changes/archive/2026-10-09-delete-runs); production is on1829e9f.Delete. Any finished run can be deleted, from its run bar (or
D), or by selecting runs on the ledger (Select, archived runs included when they're shown). The confirmation asks for the run's number, or for how many runs. Deleting a run removes:A tombstone event,
osf.run.deleted, keeps its place in the numbering, so the other runs keep theirs. A run the forge refuses is named with the reason, and the others go ahead.A branch is deleted after its merge.
git.pr.mergeasks Forgejo to delete the branch when it merges. If the pull request was merged on the forge with its branch kept, the step deletes it.merged.jsonrecords which happened. The simulated runs now check that no run branch is left.Used on production to delete all 54 runs:
osfd rebuild --verifyon a copy of the database reproduced the projections exactly;Found and fixed while doing it:
1af5261).7256440).secure_deleteon: purging a run whose events held 580 MB wrote 587 MB to the WAL and held the writer for 54 s, past the write timeout. Every connection now usessecure_delete = FAST: 0.65 s and 2 MB (375300d).cmoriarty/openspec-flow, nowcmoriarty/braid, with a 301, which the client reported as a rejected token. A run of a renamed repository is now deleted under the repository's new name (60df832).d9415d6).