Skip to content

Commit 59e565c

Browse files
mchwangclaude
andcommitted
Name a running command check in the status; real task status in its fakes (#200)
- While a pre-merge command check runs, the status reads "In review · P1 checks", as the Stop button and the ended note name it, not as if P1's own run were in progress. The docs say Stop also stops the checks. - The two check-attempt tests set the task in review, as the real server keeps it during a merge's preparation, so a failed check's note reads "The task is now in review." (thirty-seventh independent review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d59d361 commit 59e565c

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎docs/architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Writing standard: plain language, ISO 24495-1:2023
4242
- **Build state:**
4343
- **In use:** plan and linking library, SQLite store, review screen, plan display/import/authoring screen, Ask (questions to a Claude agent), guarded merge with merge-queue support, ranked Issues screen, agent isolation boundary, and the single-runner lock.
4444
- **In use for a non-demo review with a `github` block:** planning. `/api/plan/suggestions` and `/api/plan/drafts` ask Claude, through lane D, for suggestion cards or a whole next plan revision (#117, #124). Nothing becomes a revision until you apply it.
45-
- **In use with an opt-in `runner` block in `review.json`:** the whole loop after planning. `start` and `resume` on `/api/runner` run a task's plan item by item with a Claude agent (#91). They require current plan-item approvals, bind both the task state and review version, recheck approvals before each later item, and refuse when a completed prefix no longer ends at the task's current head (#107). After an out-of-scope pause, an approved amended plan can reconcile the completed prefix and resume only the unfinished suffix (#88, PR #134). When a run ends, codeboost publishes the task's pull request, a draft if the task needs a person (#103). `prepare-merge` refreshes the published PR's exact base/head, rebases through the durable F3/F4 path, recomputes attribution and approvals, pushes a rewritten head whose review is still clear over exactly the PR head it rewrote, and runs allowlisted `cmd:` checks in a credential-free read-only container bound to the resulting head (#22). The **Merge PR** button (the design's Approve & merge) merges that pull request (#121). Cancelling a task closes its pull requests (#111). The review screen has controls for these runner actions (#200): the header shows the task's status, one run action (Start, Resume, Publish PR or Close pull requests) and Retry when `GET /api/runner` says the server would admit them, Stop for the item in progress, and Cancel task while the task is open and no cancel is already stopping its work (the server refuses it while a merge is being submitted, and the screen shows that refusal); a banner shows a task that waits on a person. **Merge PR** and **Cancel merge** (which stops a running merge job without cancelling the task) run the merge.
45+
- **In use with an opt-in `runner` block in `review.json`:** the whole loop after planning. `start` and `resume` on `/api/runner` run a task's plan item by item with a Claude agent (#91). They require current plan-item approvals, bind both the task state and review version, recheck approvals before each later item, and refuse when a completed prefix no longer ends at the task's current head (#107). After an out-of-scope pause, an approved amended plan can reconcile the completed prefix and resume only the unfinished suffix (#88, PR #134). When a run ends, codeboost publishes the task's pull request, a draft if the task needs a person (#103). `prepare-merge` refreshes the published PR's exact base/head, rebases through the durable F3/F4 path, recomputes attribution and approvals, pushes a rewritten head whose review is still clear over exactly the PR head it rewrote, and runs allowlisted `cmd:` checks in a credential-free read-only container bound to the resulting head (#22). The **Merge PR** button (the design's Approve & merge) merges that pull request (#121). Cancelling a task closes its pull requests (#111). The review screen has controls for these runner actions (#200): the header shows the task's status, one run action (Start, Resume, Publish PR or Close pull requests) and Retry when `GET /api/runner` says the server would admit them, Stop for the item in progress (or its command checks, while a merge runs them), and Cancel task while the task is open and no cancel is already stopping its work (the server refuses it while a merge is being submitted, and the screen shows that refusal); a banner shows a task that waits on a person. **Merge PR** and **Cancel merge** (which stops a running merge job without cancelling the task) run the merge.
4646
- **In use for pre-merge automation (#22, closed):** the trusted local rebase engine records one-to-one commit mappings, verifies the resulting checkout byte for byte, owns its subprocesses durably, and recovers interrupted work (#22, PR #136). Its production conflict path gives a sandboxed agent only the bounded conflict files and imports only audited results for both foreign and plan-owned commits (PRs #138, #140 and #144). `prepare-merge` now invokes that path after current pull-request base/head reads, refreshes attribution and approvals, pushes the rewritten head behind a durable push marker (F6a, PR #153), and runs exact-head `cmd:` checks. With a runner, **Merge PR** runs one merge job that prepares, waits up to 30 minutes for GitHub's required checks, and hands the exact pair to the guarded merge, whose already-fixed check now covers every base commit after the task's original base (F6b, PR #161, `docs/implementation/merge-handoff.md`). `test` and `real-docker` run every offline T9 suite on every pull request, and the live Claude probes run nightly (F6c, PR #177, `docs/implementation/ci.md`).
4747
- **Not built:** review rounds, and the Queue and Learning screens. The review screen has controls for the runner actions (#200); "Review anyway", "Continue" and "Review dependency change" for tasks that wait on a person are not built (#206; the needs-approval state itself is not in use yet).
4848

‎test/browser/runner-controls.spec.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,16 +1656,18 @@ test('a first cancel on a task that needs a restart says the task closes at the
16561656
test('names a pre-merge command check\'s Stop as stopping the checks', async ({ page }) => {
16571657
let fail!: () => void;
16581658
await serve({ prepare: () => new Promise<never>((_, reject) => { fail = () => reject(new Error('no agent here')); }) });
1659-
// The real live attempt, read as a pre-merge command check (kind `check`, runner/store.ts startAttempt): the page
1660-
// reads only its kind, item, state and id.
1659+
// The real live attempt, read as a pre-merge command check (kind `check`, runner/pre-merge.ts). During a merge's
1660+
// preparation the task stays in review (runner/pre-merge.ts refuses any other status), so the fake says so too.
16611661
let asCheck = false;
1662-
await viewWith(page, view => { if (asCheck) for (const attempt of view.attempts) if (attempt.id === view.task.currentAttemptId) attempt.kind = 'check'; });
1662+
await viewWith(page, view => { if (asCheck) { view.task.status = 'in review';
1663+
for (const attempt of view.attempts) if (attempt.id === view.task.currentAttemptId) attempt.kind = 'check'; } });
16631664
await openReview(page, app.url);
16641665
await page.getByRole('button', { name: 'Start', exact: true }).click();
16651666
await expect(page.getByRole('button', { name: 'Stop P1', exact: true })).toBeVisible();
16661667
asCheck = true;
16671668
await refreshReview(page);
16681669
await expect(page.getByRole('button', { name: 'Stop P1 checks', exact: true })).toBeVisible();
1670+
await expect(status(page)).toHaveText('○ In review · P1 checks');
16691671
fail();
16701672
});
16711673

@@ -1961,9 +1963,10 @@ test('a long undeclared path in the needs-amendment banner keeps its controls wi
19611963
test('names an ended pre-merge command check as its checks, with no call to review new changes', async ({ page }) => {
19621964
let fail!: () => void;
19631965
await serve({ prepare: () => new Promise<never>((_, reject) => { fail = () => reject(new Error('no agent here')); }) });
1964-
// The real attempt, read as a pre-merge command check (kind `check`, runner/pre-merge.ts): the page reads only its
1965-
// kind, item, state and id.
1966-
await viewWith(page, view => { for (const attempt of view.attempts) attempt.kind = 'check'; });
1966+
// The real attempt, read as a pre-merge command check (kind `check`, runner/pre-merge.ts). During a merge's
1967+
// preparation the task stays in review (runner/pre-merge.ts refuses any other status), so once the attempt exists the
1968+
// fake says so too.
1969+
await viewWith(page, view => { if (view.attempts.length) view.task.status = 'in review'; for (const attempt of view.attempts) attempt.kind = 'check'; });
19671970
await page.clock.install();
19681971
await openReview(page, app.url);
19691972
await page.getByRole('button', { name: 'Start', exact: true }).click();
@@ -1974,5 +1977,5 @@ test('names an ended pre-merge command check as its checks, with no call to revi
19741977
const note = page.locator('#runner-note'), reads = Number(await note.getAttribute('data-reads'));
19751978
await page.clock.runFor(2_000);
19761979
await expect(note).toHaveAttribute('data-reads', String(reads + 1));
1977-
await expect(note).toHaveText('✕ P1 command checks failed. The task is now running.');
1980+
await expect(note).toHaveText('✕ P1 command checks failed. The task is now in review.');
19781981
});

‎web/public/app.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,7 @@ function renderRunner() {
25552555
: task.cancelRequested !== null ? " · Cancelling…"
25562556
: view.stopRequested !== null ? (view.stopRequested.saved ? " · Stopping…" : " · Stopping (not saved yet)")
25572557
: view.publish.active ? " · Publishing…"
2558-
: live ? ` · ${live.item ?? live.kind}` : "";
2558+
: live ? ` · ${live.item ?? live.kind}${live.kind === "check" && live.item ? " checks" : ""}` : "";
25592559
// As the merge step list: screen readers skip the mark and read the word (DESIGN.md). The text is rewritten only
25602560
// when it changes, so a render does not re-announce an unchanged status.
25612561
const statusText = `${mark} ${word}${suffix}`;

0 commit comments

Comments
 (0)