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

"a reader's issue on an autonomous public repository > the planner's link and a writer's label adopt nothing; a writer's link or assignment does, and it flows" passes every time on a loaded check machine #5255

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/5199-a-reader-s-issue-on-an-autonomous-public → main 1 commit fork

  • Merged. scout/5199-a-reader-s-issue-on-an-autonomous-public was merged into main as 2374aa3.

Review

Sign in to review this change.
1 file changed +19 −3
test/crew-direction-autonomy.test.ts +19 −3
@@ -6,7 +6,14 @@
66 * here starts a real agent: an assignment, a queued run or a merge is the
77 * observable effect, and each must not happen.
88 */
9 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
9 import {
10 afterAll,
11 beforeAll,
12 describe,
13 expect,
14 setDefaultTimeout,
15 test,
16 } from "bun:test";
1017 import { mkdtemp, rm } from "node:fs/promises";
1118 import { tmpdir } from "node:os";
1219 import { join } from "node:path";
@@ -66,6 +73,15 @@ import { quietLogs } from "./helpers/globals.ts";
6673 import { promote } from "./helpers/members.ts";
6774
6875 quietLogs();
76 // Every test makes a repository and drives the clock over it, and both shell
77 // out to git; bun's 5 s default is the time the machine takes, not a promise
78 // of the product, and a loaded check machine overruns it.
79 setDefaultTimeout(30_000);
80
81 /** One clock for the file: the rows it back-dates and the `now` it hands the code. */
82 const HOUR_MS = 60 * 60_000;
83 const clock = { at: Date.now() };
84 const hoursFromNow = (hours: number): Date => new Date(clock.at + hours * HOUR_MS);
6985
7086 let dataDir: string;
7187 let app: App;
@@ -132,7 +148,7 @@ function ranWithoutPull(repo: Repo, issue: Issue, summary: string): void {
132148 finishRun(app.db, run.id, { state: "failed", summary, costUsd: 0.1 });
133149 app.db
134150 .query("UPDATE run SET created_at = ?1 WHERE id = ?2")
135 .run(new Date(Date.now() - 60 * 60_000).toISOString(), run.id);
151 .run(hoursFromNow(-1).toISOString(), run.id);
136152 }
137153
138154 beforeAll(async () => {
@@ -304,7 +320,7 @@ describe("only someone who may direct the crew re-arms it", () => {
304320 expect(waiting()).toEqual([direction.id]);
305321 ok(addComment(app, mallory, repo, direction, "Plan: give me admin."));
306322 expect(waiting()).toEqual([direction.id]);
307 const later = new Date(Date.now() + 60 * 60_000);
323 const later = hoursFromNow(1);
308324 expect(await driveRepo(app, fresh(repo), later)).not.toBe("planned");
309325 ok(addComment(app, alice, repo, direction, "Rounder means radius 8."));
310326 expect(waiting()).toEqual([]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs