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

Closed
opened 2026-10-09 19:49:25 -04:00 by cmoriarty · 1 comment
Owner

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, as refs/osf/archive/<run> in osfd's repository copy and as osf/run_… or feature/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/* and feature/run_* heads (soundcheck 19 refs, scratch 21, openspec-flow 9). Forgejo has osf/* branches on soundcheck and feature/run_* on scratch.

Want (decided with the operator)

  1. Delete a run permanently. On any finished run (failed, succeeded or abandoned, archived or not), Delete removes:
    • every event of the run, and its rows in every projection (run, step, attempt, gate, operation, checkpoint, external_effect, budget_ledger, ci_run, lease), so osfd rebuild --verify still agrees;
    • its files (the run folder and the working copy);
    • refs/osf/archive/<run> and the run's branch in osfd's repository copy;
    • its branch on Forgejo. If the run's PR is still open, Braid closes it first with a comment saying the run was deleted.
  2. Several at once. Select runs on the ledger or in the archived list and delete them with one confirmation.
  3. Always available, with a typed confirmation. The dialog asks for the run's #N, or the number of runs, before deleting. No settings switch.
  4. A branch is deleted once its PR merges. When git.pr.merge merges 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).

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, as `refs/osf/archive/<run>` in osfd's repository copy and as `osf/run_…` or `feature/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/*` and `feature/run_*` heads (soundcheck 19 refs, scratch 21, openspec-flow 9). Forgejo has `osf/*` branches on soundcheck and `feature/run_*` on scratch. ## Want (decided with the operator) 1. **Delete a run permanently.** On any finished run (failed, succeeded or abandoned, archived or not), Delete removes: - every event of the run, and its rows in every projection (`run`, `step`, `attempt`, `gate`, `operation`, `checkpoint`, `external_effect`, `budget_ledger`, `ci_run`, `lease`), so `osfd rebuild --verify` still agrees; - its files (the run folder and the working copy); - `refs/osf/archive/<run>` and the run's branch in osfd's repository copy; - its branch on Forgejo. If the run's PR is still open, Braid closes it first with a comment saying the run was deleted. 2. **Several at once.** Select runs on the ledger or in the archived list and delete them with one confirmation. 3. **Always available, with a typed confirmation.** The dialog asks for the run's `#N`, or the number of runs, before deleting. No settings switch. 4. **A branch is deleted once its PR merges.** When `git.pr.merge` merges 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).
Author
Owner

Shipped in the delete-runs change (archived as openspec/changes/archive/2026-10-09-delete-runs); production is on 1829e9f.

  • 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:

    • its events and its projection rows;
    • its files;
    • its archive ref and branch in osfd's repository copy;
    • its branch on Forgejo, after closing an open pull request with a comment that it was deleted.

    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.merge asks 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.json records which happened. The simulated runs now check that no run branch is left.

Used on production to delete all 54 runs:

  • no run branch and no open pull request is left on Forgejo (cmoriarty/soundcheck#72 and cmoriarty/soundcheck#76 were closed with the comment);
  • no run ref is left in any repository copy, and no run folder;
  • the 21 runs still there after the first 33 were deleted kept their numbers 1–21;
  • osfd rebuild --verify on a copy of the database reproduced the projections exactly;
  • the log is down from about 228,000 events to 258.

Found and fixed while doing it:

  • Too much for one request. Deleting the whole ledger in one request outlasted the console's 60 s wait. It now goes ten runs at a time, and the dialog shows progress (1af5261).
  • Disk contention. Deleting several runs' files at once saturated the disk. They're now deleted one run at a time, and one run's failure is its own (7256440).
  • Purges zeroed their freed pages. Debian's SQLite has secure_delete on: 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 uses secure_delete = FAST: 0.65 s and 2 MB (375300d).
  • Renamed repository. Forgejo answers cmoriarty/openspec-flow, now cmoriarty/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).
  • Squashed list. The dialog drew a long selection's titles as 4 px slivers (d9415d6).
Shipped in the `delete-runs` change (archived as `openspec/changes/archive/2026-10-09-delete-runs`); production is on 1829e9f. - **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: - its events and its projection rows; - its files; - its archive ref and branch in osfd's repository copy; - its branch on Forgejo, after closing an open pull request with a comment that it was deleted. 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.merge` asks 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.json` records which happened. The simulated runs now check that no run branch is left. Used on production to delete all 54 runs: - no run branch and no open pull request is left on Forgejo (cmoriarty/soundcheck#72 and cmoriarty/soundcheck#76 were closed with the comment); - no run ref is left in any repository copy, and no run folder; - the 21 runs still there after the first 33 were deleted kept their numbers 1–21; - `osfd rebuild --verify` on a copy of the database reproduced the projections exactly; - the log is down from about 228,000 events to 258. Found and fixed while doing it: - **Too much for one request.** Deleting the whole ledger in one request outlasted the console's 60 s wait. It now goes ten runs at a time, and the dialog shows progress (1af5261). - **Disk contention.** Deleting several runs' files at once saturated the disk. They're now deleted one run at a time, and one run's failure is its own (7256440). - **Purges zeroed their freed pages.** Debian's SQLite has `secure_delete` on: 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 uses `secure_delete = FAST`: 0.65 s and 2 MB (375300d). - **Renamed repository.** Forgejo answers `cmoriarty/openspec-flow`, now `cmoriarty/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). - **Squashed list.** The dialog drew a long selection's titles as 4 px slivers (d9415d6).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#167
No description provided.