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

The breaker parks a green pull over runs that correctly declined to push to a person's branch #17132

opened this in answer to

Merged 2d 0h ago, live in production

The breaker no longer counts the "only its author, a person, can push it" decline as a strike. A builder's strikes no longer park a pull that only needs review. A builder run is no longer started on a person's own pull.

Notes

opened this

The breaker no longer counts the "only its author, a person, can push it" decline as a strike. A builder's strikes no longer park a pull that only needs review. A builder run is no longer started on a person's own pull. The gate and bun x tsc --noEmit pass. The new test file and the existing crew-loop, crew-guard and crew-parks tests pass (56 tests). I did not run the full suite.

  • Deliberate declines are no strike.
    • The decline wording now lives in one module, src/crew/deliberate.ts. The runner writes it and the breaker reads it.
    • The breaker (breakerTripped in src/crew/breaker.ts) skips those runs the same way it skips interrupted ones.
    • Two declines count as deliberate: the person's-pull one, and "pull #N was closed before the run began". An agent's own declined: … still counts as a strike, as before.
  • Review is not held by a builder's strikes.
    • breakerTripped takes an optional reviewing flag, and queueAgentRun passes reason === "review".
    • A review run counts only earlier review runs, and a builder run counts only non-review runs. A green pull parked by builder failures is still sent to review. A reviewer that keeps failing is still stopped.
    • The repeat and run-cap guards already skipped reviews, so I left them alone.
  • No builder run on a person's own pull.
    • queueAgentRun returns early for any non-review run on a pull where authorsInRepoPull is true. A reassignment no longer queues a run that can only decline.
    • Reviews on such a pull still go through.
  • Tests. test/breaker-declines.test.ts covers all three behaviours, with a control that three ordinary failures still trip the breaker. Its last test only proves the review ask leaves no park note on the pull. It doesn't prove a review run is queued, because the test crew's seat isn't a reviewer.

I did not change when the breaker parks, how long its window is, or what the park note says. I did not change how the sentinel counts runs (#16356). There is no page, action, route or tool change, so the commit says No door:. bun scripts/gate.ts still prints a similarity hint between my test's ended helper and the one in test/crew-cut-short.test.ts, but it exits 0. I kept them separate because mine takes an issue and a reason.

Closes #16953

2 earlier comments
commented

The breaker no longer counts the "only its author, a person, can push it" decline as a strike. A builder's strikes no longer park a pull that only needs review. A builder run is no longer started on a person's own pull. The gate and bun x tsc --noEmit pass. The new test file and the existing crew-loop, crew-guard and crew-parks tests pass (56 tests). I did not run the full suite.

  • Deliberate declines are no strike.
    • The decline wording now lives in one module, src/crew/deliberate.ts. The runner writes it and the breaker reads it.
    • The breaker (breakerTripped in src/crew/breaker.ts) skips those runs the same way it skips interrupted ones.
    • Two declines count as deliberate: the person's-pull one, and "pull #N was closed before the run began". An agent's own declined: … still counts as a strike, as before.
  • Review is not held by a builder's strikes.
    • breakerTripped takes an optional reviewing flag, and queueAgentRun passes reason === "review".
    • A review run counts only earlier review runs, and a builder run counts only non-review runs. A green pull parked by builder failures is still sent to review. A reviewer that keeps failing is still stopped.
    • The repeat and run-cap guards already skipped reviews, so I left them alone.
  • No builder run on a person's own pull.
    • queueAgentRun returns early for any non-review run on a pull where authorsInRepoPull is true. A reassignment no longer queues a run that can only decline.
    • Reviews on such a pull still go through.
  • Tests. test/breaker-declines.test.ts covers all three behaviours, with a control that three ordinary failures still trip the breaker. Its last test only proves the review ask leaves no park note on the pull. It doesn't prove a review run is queued, because the test crew's seat isn't a reviewer.

I did not change when the breaker parks, how long its window is, or what the park note says. I did not change how the sentinel counts runs (#16356). There is no page, action, route or tool change, so the commit says No door:. bun scripts/gate.ts still prints a similarity hint between my test's ended helper and the one in test/crew-cut-short.test.ts, but it exits 0. I kept them separate because mine takes an issue and a reason.

commented

The check failures came from my own change, which these tests hadn't caught up with. The five tests I changed or ran now pass, and tsc --noEmit is clean. I did not run the whole suite.

Since #16953, queueAgentRun queues no builder run on a person's own pull from a branch of the repository itself. Three of the failing tests built exactly that pull and then expected a run:

  • test/studio-update-pull.test.ts, test/crew-red-main.test.ts: the helper pulls are now authored by the agent, so they are the crew's to rework and a run is queued as before.
  • test/crew-declines.test.ts: it used to expect a run that ended failed with the "lives in the repository itself" summary. It now asserts that no agent run is queued at all. The test itself was wrong here, because the behaviour moved on purpose.

I did not touch the "System command passes the session" test in test/tui-system.test.ts. It involves no pull or run, and it passes when run here, so I took it for a flake. I can't say what made it fail in the check.

I ran bun scripts/gate.ts --fix before committing, and its comment rewraps went into the commit. The gate still flags ended in test/breaker-declines.test.ts as 0.58 similar to failed in test/crew-cut-short.test.ts ("one implementation?"). I left it, since it is a similarity hint and not a failure.

Pushed as a9f0895a2.

commented

The breaker no longer counts a deliberate decline as a strike, and a builder's strikes no longer hold a green pull back from review. This round meets all three of juniper's points. breaker-declines.test.ts and crew-declines.test.ts pass (8 tests) and tsc --noEmit is clean. I did not rerun the whole suite.

What changed since the last push

  • Closed-before-run decline: test/breaker-declines.test.ts now has a case where three runs ending "pull #N was closed before the run began" leave breakerTripped false. Removing CLOSED_BEFORE_RUN from NOT_DELIBERATE_SQL now fails it.
  • Anchored match: NOT_DELIBERATE_SQL in src/crew/deliberate.ts no longer matches the phrases anywhere in the summary. It matches only the runner's own wording: pull #N's branch lives … only its author, a person, can push it;… and pull #N was closed before the run began. The new test checks that an agent summary which merely contains those phrases still counts as a strike.
  • Last test renamed: it is now "a review on a person's own pull is not parked by the breaker; a builder on the crew's own pull is". I renamed it rather than add a reviewer seat to the test crew, so it claims only what it asserts (the park note).

What I chose not to do

  • I did not give the test crew a reviewer seat to assert on the review run itself.

Still open

  • scripts/gate.ts still flags ended in test/breaker-declines.test.ts as 0.58 similar to failed in test/crew-cut-short.test.ts ("one implementation?"). It is a hint, not a failure, and I left it.
  • The gate also notes a comment over 100 columns in test/studio-update-pull.test.ts, which the nightly rewrap handles.

To try it: bun test test/breaker-declines.test.ts test/crew-declines.test.ts.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs