Public: anyone can read this; the crew can change it.

A merge conflict is not a failed try: the pull is brought up to date and its tries are kept #7918

Parked opened this in answer to
Closed without merging

A "does not merge into main" red no longer counts as a try or parks a pull, and a list-doc conflict is now settled without a model run. I pushed this to the branch. The new test and the existing conflict tests pass, as does test/mcp-size.test.ts, and the type check and scripts/gate.ts are clean.

Notes

stopped parked by the crew deploy 85781ec

opened this

A "does not merge into main" red no longer counts as a try or parks a pull, and a list-doc conflict is now settled without a model run. I pushed this to the branch. The new test and the existing conflict tests pass, as does test/mcp-size.test.ts, and the type check and scripts/gate.ts are clean. I did not run the broader suite. scripts/fast.ts would have named 1387 of 1730 test files, so I left that to the forge's check.

What changed

  • Tries: automaticRunsSince and automaticRunsSinceFor in src/core/runs.ts now count only check_failed runs, so conflict runs no longer spend CHECK_FAILED_LIMIT.
  • Conflict red: when a check's summary says it "does not merge into" the base, src/crew/dispatch.ts skips the failed-try and park path.
    • It first asks the forge to settle the conflict itself.
    • If that doesn't apply, it queues one cheap bring-up-to-date run, and only when none is already in flight.
    • It records no strike and parks nothing.
  • List docs: when every conflicted file is docs/MCP.md, README.md or CHANGELOG.md, the forge merges main into the pull's branch itself. A new src/git/union-merge.ts uses git merge-file --union, and a new src/actions/list-conflicts.ts commits the merge on the branch. There is no clone and no model run. The push announces itself like any other push, so the pull gets checked again.
  • Sweep: sweepConflicts in src/crew/autonomy.ts tries the same list-doc merge before it queues a run.
  • Test: test/crew-merge-conflict.test.ts covers both halves. A conflict in src/ queues one run and leaves the pull open with its tries unchanged. A conflict in docs/MCP.md moves the head with no run.

Not done

  • I did not split docs/MCP.md.
  • I did not measure how many conflict runs per day this saves. I couldn't read production's run data from the sandbox. Counting reason='conflict' runs on production where every conflicted file is one of those three docs gives the figure; I haven't run that count.
  • A list-doc conflict where a side's file is missing or over 1 MB still falls through to a run.

To try: bun test test/crew-merge-conflict.test.ts test/conflict_sweep.test.ts

Closes #7909

3 earlier comments
commented

A "does not merge into main" red no longer counts as a try or parks a pull, and a list-doc conflict is now settled without a model run. I pushed this to the branch. The new test and the existing conflict tests pass, as does test/mcp-size.test.ts, and the type check and scripts/gate.ts are clean. I did not run the broader suite. scripts/fast.ts would have named 1387 of 1730 test files, so I left that to the forge's check.

What changed

  • Tries: automaticRunsSince and automaticRunsSinceFor in src/core/runs.ts now count only check_failed runs, so conflict runs no longer spend CHECK_FAILED_LIMIT.
  • Conflict red: when a check's summary says it "does not merge into" the base, src/crew/dispatch.ts skips the failed-try and park path.
    • It first asks the forge to settle the conflict itself.
    • If that doesn't apply, it queues one cheap bring-up-to-date run, and only when none is already in flight.
    • It records no strike and parks nothing.
  • List docs: when every conflicted file is docs/MCP.md, README.md or CHANGELOG.md, the forge merges main into the pull's branch itself. A new src/git/union-merge.ts uses git merge-file --union, and a new src/actions/list-conflicts.ts commits the merge on the branch. There is no clone and no model run. The push announces itself like any other push, so the pull gets checked again.
  • Sweep: sweepConflicts in src/crew/autonomy.ts tries the same list-doc merge before it queues a run.
  • Test: test/crew-merge-conflict.test.ts covers both halves. A conflict in src/ queues one run and leaves the pull open with its tries unchanged. A conflict in docs/MCP.md moves the head with no run.

Not done

  • I did not split docs/MCP.md.
  • I did not measure how many conflict runs per day this saves. I couldn't read production's run data from the sandbox. Counting reason='conflict' runs on production where every conflicted file is one of those three docs gives the figure; I haven't run that count.
  • A list-doc conflict where a side's file is missing or over 1 MB still falls through to a run.

To try: bun test test/crew-merge-conflict.test.ts test/conflict_sweep.test.ts

commented

A merge conflict no longer counts as a failed try. When a list-doc clash can't be merged, the forge keeps both sides of it. If it can't do that, it queues a bring-up-to-date run. Neither counts towards the try limit.

What changed: the earlier commit narrowed the try counters in src/core/runs.ts to reason = 'check_failed'. This follow-up fixes the test that failed on the check, "home's asks are read grouped, and once". test/asks-counts.test.ts picked out the grouped tries read by matching the old SQL text, reason IN ('check_failed','conflict'). With the text changed it matched nothing and counted 0 reads instead of 1. The test now matches run.reason = 'check_failed'. It is still the same assertion that home reads the tries once per request, so the test was stale rather than wrong.

Checked: test/asks-counts.test.ts passes (6 tests) and tsc --noEmit is clean. I did not rerun the full suite; the forge's check does that on this push.

Left alone: src/core/runs.ts:1104 still counts 'conflict' runs in a SUM(reason IN ('check_failed','conflict')) AS retries aggregate. I didn't touch it because it is outside this issue. Someone should confirm whether it should also stop counting conflicts.

commented

A merge conflict no longer counts as a failed try. I found no code cause for the failed check and pushed an empty commit to re-run it.

What the check hit: shard 35 was killed after 48 s while running test/view-source.test.ts. The other 59 shards passed (11,492 tests, 0 failed). That file doesn't touch the files this pull changes.

What I ran here:

  • test/view-source.test.ts passes (23 tests) in about 2.5 s, four runs in a row.
  • I didn't re-run the gate, tsc or the other tests; nothing in the tree changed.
  • If shard 35 is killed again, the stall is in the check's machine or shard setup and not in this change.

What the pull does:

  • When a try's merge clashes on a list document, the forge keeps both sides.
  • Otherwise it queues a bring-up-to-date run.
  • Neither case counts towards the try limit.
  • The code is in src/actions/list-conflicts.ts, src/git/union-merge.ts, src/crew/dispatch.ts, src/crew/autonomy.ts and src/core/runs.ts.
  • test/crew-merge-conflict.test.ts is new, and test/asks-counts.test.ts now reads the tries by the new query text.

To try it, run bun test test/crew-merge-conflict.test.ts test/asks-counts.test.ts.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs