Runs commit their .osf/ state, so two runs on one project always conflict at the merge #224

Closed
opened 2026-10-19 19:20:08 -04:00 by cmoriarty · 1 comment
Owner

Symptom

Runs 87 and 88 on cmoriarty/aurora-links3 both failed at git.pr.merge once the other had merged: their pull requests conflicted with main in 28 files each, and every one was under .osf/ (briefs, review digests, test records, validate.json, workspace.json). Neither touched the other's source. Two runs on one project cannot both land without a person merging by hand, and braid#221's new agent.sync-resolve would be spending an agent session on run state at every merge.

Cause

The flow's commit steps stage the whole worktree (git add -A), so each run commits its own .osf/ state into its branch and the merge carries it onto the base branch. Every run writes the same file names, so any two pull requests conflict. clear_inherited_run_state already removes what an earlier run left on the base at clone (Forgejo #98), which treats the symptom after the fact and leaves main carrying a different run's state at every moment.

Wanted

A run's .osf/ state never reaches the pull request or the base branch. What a repository keeps under .osf/ on purpose (pipeline.yaml, pipelines/) still does.

  • Every staging point (the flow's commits, the CI lane's check commit, the release commit) leaves .osf/ run state out of what it commits, and takes a tracked copy of it out of the index, so a base branch that already carries some loses it with the first run to land.
  • The state stays on disk and visible to checkpoints and rollbacks, which snapshot the worktree and not the branch.
  • Prompts and briefs that list the worktree's changes do not list run state.
  • Commit steps whose completion is git-advanced still produce their commit.
  • Multiple runs on the same project land without conflicts on .osf/.

Runs 87 and 88 were rescued by hand (the conflicts merged keeping each run's own files).

## Symptom Runs 87 and 88 on cmoriarty/aurora-links3 both failed at `git.pr.merge` once the other had merged: their pull requests conflicted with `main` in 28 files each, and every one was under `.osf/` (briefs, review digests, test records, `validate.json`, `workspace.json`). Neither touched the other's source. Two runs on one project cannot both land without a person merging by hand, and braid#221's new `agent.sync-resolve` would be spending an agent session on run state at every merge. ## Cause The flow's commit steps stage the whole worktree (`git add -A`), so each run commits its own `.osf/` state into its branch and the merge carries it onto the base branch. Every run writes the same file names, so any two pull requests conflict. `clear_inherited_run_state` already removes what an earlier run left on the base at clone (Forgejo #98), which treats the symptom after the fact and leaves main carrying a different run's state at every moment. ## Wanted A run's `.osf/` state never reaches the pull request or the base branch. What a repository keeps under `.osf/` on purpose (`pipeline.yaml`, `pipelines/`) still does. - Every staging point (the flow's commits, the CI lane's check commit, the release commit) leaves `.osf/` run state out of what it commits, and takes a tracked copy of it out of the index, so a base branch that already carries some loses it with the first run to land. - The state stays on disk and visible to checkpoints and rollbacks, which snapshot the worktree and not the branch. - Prompts and briefs that list the worktree's changes do not list run state. - Commit steps whose completion is `git-advanced` still produce their commit. - Multiple runs on the same project land without conflicts on `.osf/`. Runs 87 and 88 were rescued by hand (the conflicts merged keeping each run's own files).
Author
Owner

Shipped in dca5430 (archived after it) and live on production.

  • A run's .osf/ state is no longer committed. The commit steps, the CI lane's check commit and the release commit take it out of the index and leave it on disk, so checkpoints and rollbacks see it as before. A repository's own .osf/pipeline.yaml and .osf/pipelines/ are still committed.
  • A copy of run state that the base branch already tracks (aurora-links3's main carries some) is deleted by a run's first commit, so the first run to land purges it.
  • A commit step whose only content was run state still makes its commit, so git-advanced steps still complete.
  • The sync step from braid#221 sets aside the run's own copy of a file the base tracks while it merges, so an older run's state landing on main no longer makes the merge refuse.
  • The code review's file list and a revision's touched-files list no longer show run state.

Tests: unit tests over real repositories (two runs on one project merge without conflicts; a rollback still restores the state), and three simulated runs: a base that tracks another run's state, a base that gains it mid-run, and the existing ones. The backend and simulated-run lanes pass; the browser lane passes apart from one spec that is already braid#193's known flake. Not run: the @live browser specs.

Left as is: runs that were in flight when this deployed have already committed their state, and can conflict once, as before.

Shipped in dca5430 (archived after it) and live on production. - A run's `.osf/` state is no longer committed. The commit steps, the CI lane's check commit and the release commit take it out of the index and leave it on disk, so checkpoints and rollbacks see it as before. A repository's own `.osf/pipeline.yaml` and `.osf/pipelines/` are still committed. - A copy of run state that the base branch already tracks (aurora-links3's main carries some) is deleted by a run's first commit, so the first run to land purges it. - A commit step whose only content was run state still makes its commit, so `git-advanced` steps still complete. - The sync step from braid#221 sets aside the run's own copy of a file the base tracks while it merges, so an older run's state landing on main no longer makes the merge refuse. - The code review's file list and a revision's touched-files list no longer show run state. Tests: unit tests over real repositories (two runs on one project merge without conflicts; a rollback still restores the state), and three simulated runs: a base that tracks another run's state, a base that gains it mid-run, and the existing ones. The backend and simulated-run lanes pass; the browser lane passes apart from one spec that is already braid#193's known flake. Not run: the `@live` browser specs. Left as is: runs that were in flight when this deployed have already committed their state, and can conflict once, as before.
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#224
No description provided.