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

A crew pull that has stayed conflicted for 3 days with no push is closed with one line, and its issue goes back to ready for a fresh run from main #5945

Parked opened this
Closed without merging

A crew pull that has stayed conflicted for 72 hours with no push is now closed once a day, and its issue goes back to ready. The new tests, the conflict-sweep test and the autonomy tests pass, and tsc is clean. I did not run the full bun test here; the forge's check runs it on this push.

Notes

stopped parked by the crew deploy cec21a7

opened this

A crew pull that has stayed conflicted for 72 hours with no push is now closed once a day, and its issue goes back to ready. The new tests, the conflict-sweep test and the autonomy tests pass, and tsc is clean. I did not run the full bun test here; the forge's check runs it on this push.

What changed

  • The new module src/crew/stale_pulls.ts is wired into the existing sweep tick in src/main.ts.
  • Watching: every tick it records when each open pull written by a crew agent first conflicted with its base. A push to the pull restarts that clock, and a pull that merges again loses it.
  • Daily close: at most once per UTC day it closes each pull that has conflicted for 72 hours or more. The comment on the pull is Closed after 3 days in conflict; #N is ready again and will be built fresh from main., posted as the repository's autonomy user. It is closed with reason parked, the same as the existing conflict release, so it counts as no strike. The linked issue is unassigned so the picker takes it again.
  • Never closed:
    • A person's pull.
    • A held pull.
    • A pull with an approval newer than the conflict.
    • A pull whose body names no open issue, since there is nothing to rebuild from.
    • A pull in a repository with no autonomy user, since there is no one to comment as.
  • Event and tick line: each close writes a pull.stale_closed event. The per-repo tick log line in src/crew/autonomy.ts shows staleClosed=N when any were closed today. I took "home's tick line" to mean that log line. If you meant a page, say so and I'll add it there.
  • Tests: test/stale_pulls.test.ts covers the following:
    • A 73-hour pull is closed, with its issue freed, the comment and an event.
    • A 71-hour pull is left alone.
    • A person's pull, a held pull and a pull approved after the conflict are left alone, while one approved before the conflict is closed.
    • The pass runs once a day.
    • A real git conflict is picked up by the watch.

Left out

  • The conflict clock is held in memory, as in stale_asks.ts, so a restart gives every conflicted pull a fresh 72 hours. That only delays a close. Persisting it would need a migration.
  • It does not touch src/http/mcp.ts, src/contract/openapi.ts or docs/DESIGN.md.

To try it

  • Run bun test test/stale_pulls.test.ts.
  • On a running forge, look for the stale pull closed log line and the staleClosed field on tick.

Closes #5940

3 earlier comments
commented

A crew pull that has stayed conflicted for 72 hours with no push is now closed once a day, and its issue goes back to ready. The new tests, the conflict-sweep test and the autonomy tests pass, and tsc is clean. I did not run the full bun test here; the forge's check runs it on this push.

What changed

  • The new module src/crew/stale_pulls.ts is wired into the existing sweep tick in src/main.ts.
  • Watching: every tick it records when each open pull written by a crew agent first conflicted with its base. A push to the pull restarts that clock, and a pull that merges again loses it.
  • Daily close: at most once per UTC day it closes each pull that has conflicted for 72 hours or more. The comment on the pull is Closed after 3 days in conflict; #N is ready again and will be built fresh from main., posted as the repository's autonomy user. It is closed with reason parked, the same as the existing conflict release, so it counts as no strike. The linked issue is unassigned so the picker takes it again.
  • Never closed:
    • A person's pull.
    • A held pull.
    • A pull with an approval newer than the conflict.
    • A pull whose body names no open issue, since there is nothing to rebuild from.
    • A pull in a repository with no autonomy user, since there is no one to comment as.
  • Event and tick line: each close writes a pull.stale_closed event. The per-repo tick log line in src/crew/autonomy.ts shows staleClosed=N when any were closed today. I took "home's tick line" to mean that log line. If you meant a page, say so and I'll add it there.
  • Tests: test/stale_pulls.test.ts covers the following:
    • A 73-hour pull is closed, with its issue freed, the comment and an event.
    • A 71-hour pull is left alone.
    • A person's pull, a held pull and a pull approved after the conflict are left alone, while one approved before the conflict is closed.
    • The pass runs once a day.
    • A real git conflict is picked up by the watch.

Left out

  • The conflict clock is held in memory, as in stale_asks.ts, so a restart gives every conflicted pull a fresh 72 hours. That only delays a close. Persisting it would need a migration.
  • It does not touch src/http/mcp.ts, src/contract/openapi.ts or docs/DESIGN.md.

To try it

  • Run bun test test/stale_pulls.test.ts.
  • On a running forge, look for the stale pull closed log line and the staleClosed field on tick.
commented

I merged main into this branch and pushed it. The one conflict was in src/crew/autonomy.ts, in the tick's log fields.

My side added staleClosed (crew pulls closed after 3 days in conflict, #5940). main added ...flowVitals(app.db, now) (open, opened and landed pulls, #5935). I kept both, staleClosed first.

Checks:

  • Type check: tsc --noEmit printed nothing.
  • Targeted tests: the 20 test files for autonomy, stale pulls and flow pass (178 tests).
  • Wider crew run: bun test test/crew found no such directory, so I ran bun test on the crew tests I found. It had 4 failures and 2 errors, among them:
    • the stand-in Claude Code "failing check comes back to it" test, which hit its 15 s timeout;
    • the "young lock that blocks checkout" test, which failed with name_taken;
    • a sandbox message that ripgrep (rg) is missing and needs bun install.

    I did not check whether main fails the same way, and I did not re-run the wider set after the merge. The forge's own check will run the full suite on this push.

What changed in the pull: crew pulls that have stayed conflicted for 72 hours with no push are now closed once a day and their issue is made ready again (#5940). The tick log reports the count as staleClosed.

How to try it: bun test covers it.

commented

I merged main into the branch and pushed it, so #5945 should merge cleanly again. The type check is clean and the 34 autonomy tests pass. I did not run the full suite; the forge runs the whole check on the push.

The only conflict was in src/crew/autonomy.ts, in the tick log setup. This branch added staleToday (crew pulls closed today after 3 days in conflict). main added announceGovernor, which posts a feed item when the governor lowers the slots. The two were independent, so I kept both lines. The log still reports staleClosed and governor as before.

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