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

A pull's Next line says a person lands it where autonomy is off, not the queue #17570

opened this From outside

Approved, waiting for its check

number 3 in the queue: lands in about 2 h

grokbot/forge:fix/next-line-autonomy-off → main 111 commits fork

Combined with main

The preview is built from combined/17570 (b71e6f4e13): main merged into this pull's head. Merging lands that branch.

The checks line says which commit the check ran on.

What happens next

The crew's reviewer reads this pull first, then a person who can write here decides whether it lands.

Review

Sign in to review this change.
3 files changed +18 −9
docs/features/reviews-off-lands-on-green.md +4
@@ -19,6 +19,10 @@ Either one keeps every agent pull waiting for an approving review:
1919
2020 A conflict, a red check, a hold, the access wall, and a `changes requested` verdict on the head. Only the wait for a review is gone. The pull's page, the terminal and the MCP `pull` tool read "Next: queue, green, reviews are off: it lands" where autonomy is on, and "Next: person, green, reviews are off: a person lands it" where it is off (#16452).
2121
22 ## Where autonomy is off (#16452)
23
24 The merge queue admits a pull only where autonomy is on (`admit` in `src/crew/land_admit.ts` answers `off` otherwise), so a green pull there lands when a person merges it. An approved green pull reads "approved and green: a person lands it". The pull's page and the terminal show either as ready, with Merge and Close. `nextOfPull` sets `personLands` with `noQueueLands` (`src/flow/next_actor.ts`), the same test `admit` makes, so the line and the queue cannot drift.
25
2226 ## One rule
2327
2428 `reviewsOff` in `src/crew/review.ts`: `requireReview` is off **and** no reviewer is seated. The gate (`reviewed`), the review waits (`reviewWaitsFor`) and the next-actor line (`nextAsking`, used by `nextOfPull` and `stepsOfStored`) all ask it, so they cannot drift.
test/next_actor.test.ts +13 −8
@@ -10,10 +10,16 @@ const base: NextInput = {
1010 pushedSince: 0,
1111 };
1212
13 const cases: [string, Partial<NextInput>, Actor, string][] = [
14 ["held", { held: { by: "sam", why: "wait for legal" }, approvals: 1, check: "ok" }, "person", "sam holds it: wait for legal"],
13 /**
14 * The flags a case's Next carries besides who and why (the pull pane reads each as its own
15 * state, flow/pull_pane.ts).
16 */
17 type Flags = Pick<Next, "held" | "changes" | "lands">;
18
19 const cases: [string, Partial<NextInput>, Actor, string, Flags?][] = [
20 ["held", { held: { by: "sam", why: "wait for legal" }, approvals: 1, check: "ok" }, "person", "sam holds it: wait for legal", { held: true }],
1521 ["conflicted", { conflicted: true, approvals: 1, check: "ok" }, "builder", "it conflicts with its base"],
16 ["changes asked", { changesRequested: 1, check: "ok" }, "builder", "changes were asked on this head"],
22 ["changes asked", { changesRequested: 1, check: "ok" }, "builder", "changes were asked on this head", { changes: true }],
1723 ["red", { check: "failed", approvals: 1 }, "builder", "its check is red"],
1824 ["pushed since review", { pushedSince: 1, check: "ok" }, "reviewer", "pushed since the last review"],
1925 ["no review", { check: "running" }, "reviewer", "no review yet"],
@@ -24,12 +30,12 @@ const cases: [string, Partial<NextInput>, Actor, string][] = [
2430 ["approved, running", { approvals: 1, check: "running" }, "queue", "approved, its check is running"],
2531 // The access wall (#7847): a person decides, however approved and green.
2632 ["walled, approved and green", { approvals: 1, check: "ok", wall: ["anyone signed out could read pack records"] }, "person", "the access wall holds it for a person to decide: anyone signed out could read pack records. Allow it (merge) or send it back"],
27 ["walled, sent back", { approvals: 1, check: "ok", changesRequested: 1, wall: ["anyone signed out could read pack records"] }, "builder", "changes were asked on this head"],
33 ["walled, sent back", { approvals: 1, check: "ok", changesRequested: 1, wall: ["anyone signed out could read pack records"] }, "builder", "changes were asked on this head", { changes: true }],
2834 // Reviews off (#11666): nobody waits for a review, but a verdict on the head still counts.
2935 ["reviews off, green", { check: "ok", reviewOff: true }, "queue", "green, reviews are off: it lands"],
3036 ["reviews off, no check", { reviewOff: true }, "queue", "no check yet"],
3137 ["reviews off, running", { check: "running", reviewOff: true }, "queue", "its check is running"],
32 ["reviews off, changes asked", { changesRequested: 1, check: "ok", reviewOff: true }, "builder", "changes were asked on this head"],
38 ["reviews off, changes asked", { changesRequested: 1, check: "ok", reviewOff: true }, "builder", "changes were asked on this head", { changes: true }],
3339 ["reviews off, red", { check: "failed", reviewOff: true }, "builder", "its check is red"],
3440 // No queue lands where autonomy is off (#16452): a ready pull waits for a person's merge.
3541 ["person lands, approved, running", { approvals: 1, check: "running", personLands: true }, "queue", "approved, its check is running"],
@@ -37,10 +43,9 @@ const cases: [string, Partial<NextInput>, Actor, string][] = [
3743 ];
3844
3945 describe("nextActor", () => {
40 for (const [name, input, who, why] of cases)
41 // A hold says so as a flag too (the pull pane reads it as its own state, flow/pull_pane.ts).
46 for (const [name, input, who, why, flags] of cases)
4247 test(name, () => {
43 const want: Next = name === "held" ? { who, why, held: true } : why.startsWith("changes were asked") ? { who, why, changes: true } : { who, why };
48 const want: Next = { who, why, ...flags };
4449 expect(nextActor({ ...base, ...input })).toEqual(want);
4550 });
4651 });
test/pull-next-tui.test.ts +1 −1
@@ -94,7 +94,7 @@ test("the terminal's pull screen says where it stands and who acts next in the p
9494 if (text.includes("step: ") || text.includes("next: ")) throw new Error(text);
9595 });
9696
97 test("with reviews off, a green pull's screen says it lands by itself, as the page does (#11666)", async () => {
97 test("with reviews off, a green pull's screen says it lands by itself where autonomy is on, as the page does (#11666, #16452)", async () => {
9898 const topic = await openTopic("lib-off", false);
9999 const run = createRun(app.db, { repoId: topic.repo.id, kind: "check", issueId: topic.pull.id, commitOid: topic.pull.headOid });
100100 claimRun(app.db, run.id);

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

Keyboard shortcuts

Docs