Public: anyone can read this; the crew can change it.
Sentinel: The guard parked 20 runs in a private repository (01m5th8bwh248hrnezwstf9fff) in a day #17325
Merged 40h 30m ago, live in production
mason/forge:mason/17234-sentinel-the-guard-parked-20-runs-in-a-p → main 0 commits fork
2 files
changed +13
−3
src/crew/guard.ts +10 −2
| @@ -42,6 +42,14 @@ export function runCapOf( | ||
| 42 | 42 | : (caps.issueRunCap ?? ISSUE_RUN_CAP); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | /** | |
| 46 | * Run reasons that are not an agent going round on one issue: a reviewer's run, a | |
| 47 | * bring-up to a moved main, an answer to a red check, and the two a follow or a | |
| 48 | * proposal starts at someone's ask (`resolve`, `converge`), which the follow's own | |
| 49 | * conflict bound holds (#17234). | |
| 50 | */ | |
| 51 | const NOT_GOING_ROUND = "('review', 'conflict', 'check_failed', 'resolve', 'converge')"; | |
| 52 | ||
| 45 | 53 | /** What a skipped follow-up records, and what its run says when one was already queued. */ |
| 46 | 54 | export const SKIP_SUMMARY = "skipped: nothing new to act on since the last run"; |
| 47 | 55 | |
| @@ -159,7 +167,7 @@ export function capReached( | ||
| 159 | 167 | `SELECT COUNT(*) AS n FROM run |
| 160 | 168 | WHERE issue_id = ?1 AND kind = 'agent' AND created_at > ?2 |
| 161 | 169 | AND attempt = 0 |
| 162 | AND reason NOT IN ('review', 'conflict', 'check_failed') | |
| 170 | AND reason NOT IN ${NOT_GOING_ROUND} | |
| 163 | 171 | AND summary NOT LIKE 'interrupted: %' |
| 164 | 172 | AND summary NOT LIKE 'skipped: %'`, |
| 165 | 173 | ) |
| @@ -611,7 +619,7 @@ export function capReachedFor( | ||
| 611 | 619 | `SELECT issue_id, created_at FROM run INDEXED BY run_agent_issue_latest |
| 612 | 620 | WHERE issue_id IN (${marks}) AND kind = 'agent' AND created_at > ?1 |
| 613 | 621 | AND attempt = 0 |
| 614 | AND reason NOT IN ('review', 'conflict', 'check_failed') | |
| 622 | AND reason NOT IN ${NOT_GOING_ROUND} | |
| 615 | 623 | AND summary NOT LIKE 'interrupted: %' |
| 616 | 624 | AND summary NOT LIKE 'skipped: %'`, |
| 617 | 625 | ) |
test/crew-guard-cap.test.ts +3 −1
| @@ -138,12 +138,14 @@ describe("capReached", () => { | ||
| 138 | 138 | expect(reached(issue, at(CAP_WINDOW_MS + HOUR))).toBe(false); |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | test("a check-failure run, a conflict, a review, a retry, an interrupted and a skipped run are not starts", () => { | |
| 141 | test("a check-failure run, a conflict, a review, a resolve, a converge, a retry, an interrupted and a skipped run are not starts", () => { | |
| 142 | 142 | const issue = issueOf(); |
| 143 | 143 | run(issue, 0); |
| 144 | 144 | run(issue, 1, "check_failed"); |
| 145 | 145 | run(issue, 2, "conflict"); |
| 146 | 146 | run(issue, 3, "review"); |
| 147 | run(issue, 6, "resolve"); | |
| 148 | run(issue, 7, "converge"); | |
| 147 | 149 | run(issue, 4, "assigned", "interrupted: restart"); |
| 148 | 150 | run(issue, 5, "assigned", "skipped: nothing new"); |
| 149 | 151 | createRun(app.db, { |
new above
offline