Skip to content

rebuild: cli: a pull request block's step can expect ready: it would run, and still never runs - #1649

Merged
odgrim merged 1 commit into
rebuild/p6-classb-frozen-expectsfrom
rebuild/p6-classb-pr-expect-ready
Dec 2, 2026
Merged

odgrim merged 1 commit into
rebuild/p6-classb-frozen-expectsfrom
rebuild/p6-classb-pr-expect-ready

Conversation

@odgrim

@odgrim odgrim commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Stack: rebuild phase 6, rows class B skips, part 18 of 22: a pull request step can expect ready. Base: #1648 (rows class B skips, part 17 of 22). Map: .more9s/rebuild.md on rebuild/main.

211 changed lines, 151 of them tests and test runbooks.

Change

  • packages/cli/src/contract.ts: ExpectedStatus has ready, so a --output json step reports "expected": "ready", and "actual": "ready" when the block is.
  • packages/cli/src/testFile.ts: KIND_RULES.external expects skip, blocked or ready. ready on any other block is an error at its line ("cannot be expected to be ready. Expected one of ..."). An external block's refused expect says "say expect: ready, expect: blocked, or expect: skip".
  • packages/cli/src/testRun.ts runBlock: an external block's step that doesn't skip still never calls RunBlock. It reads GetBlock (readiness): ready when the view offers run, which the engine offers once the session is trusted, nothing blocks it (dependsOn, envFrom, a sign-in, a repository, outputs it reads, an empty value it reads) and its own form is filled. Otherwise what its status says: blocked, "Waiting for ...", or fail, "Needs input: ...". A hidden one first gets showing's "hidden", naming its condition, as a task's step does.
  • Tests:
  • packages/cli/src/testFile.test.ts: an external block's step may expect ready; the refusal of any other expect names all three; ready on a Run, a Form, a sign-in or a Note is an error at its line. The test that compared KIND_RULES.external to a literal goes: the decode test asserts the same through the test file.
  • packages/cli/src/testCommand.test.ts, under "a skip step", the toy Push (Script declaring push), every case read from --output json and never run (seen.runs counts build and check only): its sign-in signed in, ready passes, expected and actual ready; no login, "Expected ready, got blocked: Waiting for cloud"; a dependsOn block not run and an {{ .inputs.tag }} left empty, blocked naming both, then ready once both are there; hidden by its showWhenBlock, "Expected ready, got hidden: It shows only when ..."; the existing blocked step on a ready Push, actual ready, was idle.
  • Docs: testing.mdx (a ready row; the skip row; Testing pull request blocks, with a with-a-token example), commands/cli-reference.mdx's expected values, blocks/git-pull-request/docs.mdx Testing.
  • blocks/git-pull-request/cli.test.ts: its refused-expect test reads the message the refusal has said since 6e564d439 ("so a test never runs it"), now with ready.

Decisions

  • expect: ready is the lead's recommendation, not a ruling. Under the alternative, runbooks test runs pull request blocks against a bare repository and a stub forge, which breaks testing.mdx's promise that they never run in tests.
  • No existing way to assert it: KIND_RULES.external allowed only skip and blocked, a step of an external block takes no keys (no assertions), and a ready block's GetBlock read ended idle, which no expect matches.
  • Ready is the view's run action, the engine's own word for "a run would start now", not a second reading of status and blockers here. It is the same for every client: an agent's run would first be asked to review the forms it reads (NeedsReview), which a view doesn't show.
  • A blocked step on a ready external block now reports actual ready, where it reported idle ("The block did not run."). It failed before and fails now; idle no longer said why. A hidden one reports hidden, also where it reported idle.
  • The JSON report's expected set grows by ready. Only a test file that writes expect: ready, refused until now, gets it, so no existing caller sees it without opting in.

Gaps

  • ready reads the block; it doesn't run the push, the forge's API or the pull request. e2e/git-pull-request.spec.ts:118 runs the block end to end against a stand-in GitHub API, and is the run coverage ready doesn't give. Index row at the next index commit.

Evidence

Local, in a scratch worktree with a scratch HOME. CI's run on this head is the gate.

    • Restacked onto rebuild/main 20cc5f0, with the skip check now near the top: bun check, lint, fmt:check and knip clean; bun test packages/cli packages/core packages/app-renderer packages/platform-node scripts baseline blocks: 6386 pass, 0 fail. The counts below were taken before the restack, on the earlier base.
    • Red first, the tests alone on today's runner: HOME=$S/home-g76 bun test packages/cli/src/testFile.test.ts packages/cli/src/testCommand.test.ts: 118 pass, 7 fail (the new and changed tests above). A refused file's message then: 'runbook_test.yml:6:9: tests[0].steps[0].expect: Expected "success" | "fail" | "warn" | "blocked" | "skip" | "hidden" | "config_error"'.
    • With the code: the same files, 125 pass, 0 fail.
    • blocks/git-pull-request/cli.test.ts: 2 pass (1 fail on the earlier base).
    • Mutants, then bun test packages/cli/src/testFile.test.ts packages/cli/src/testCommand.test.ts (125 pass unmutated):
    • MR1 readiness never says ready: 122 pass, 3 fail
    • MR2 readiness always says ready: 122 pass, 3 fail
    • MR3 no show check for an external block: 124 pass, 1 fail
    • MR4 KIND_RULES.external without ready: 119 pass, 6 fail
    • MR5 a task may expect ready: 124 pass, 1 fail
    • MR6 an external block's ready step runs it as a task's does: 123 pass, 2 fail
    • cspell 10.4.0 (docs/cspell.json) on the three pages: 0 issues
    • bun run lint, fmt:check, knip, bun check: exit 0 each
  • Placed on the skip rules, whose testCommand.test.ts moved the external block tests into "a sign-in step" and the non-sign-in skip test out of it: the ready tests went into "a sign-in step", this commit's copy of the non-sign-in skip test was dropped for theirs, and the blocked test is "that signs in fails an external block's step that expects blocked when it is ready" (actual ready, with LOGIN). testCommand.test.ts 69 pass, 0 fail.

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
runbooks Ready Ready Preview Dec 2, 2026 2:03am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad2d2928-ac94-416d-b302-34b141c0ed38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…run, and still never runs

Change
- packages/cli/src/contract.ts: ExpectedStatus has `ready`, so a
  `--output json` step reports `"expected": "ready"`, and `"actual":
  "ready"` when the block is.
- packages/cli/src/testFile.ts: KIND_RULES.external expects `skip`,
  `blocked` or `ready`. `ready` on any other block is an error at its
  line ("cannot be expected to be ready. Expected one of ..."). An
  external block's refused expect says "say expect: ready, expect:
  blocked, or expect: skip".
- packages/cli/src/testRun.ts runBlock: an external block's step that
  doesn't skip still never calls RunBlock. It reads GetBlock (`readiness`):
  `ready` when the view offers `run`, which the engine offers once the
  session is trusted, nothing blocks it (dependsOn, envFrom, a sign-in,
  a repository, outputs it reads, an empty value it reads) and its own
  form is filled. Otherwise what its status says: blocked, "Waiting for
  ...", or fail, "Needs input: ...". A hidden one first gets `showing`'s
  "hidden", naming its condition, as a task's step does.
- Tests:
  - packages/cli/src/testFile.test.ts: an external block's step may
    expect `ready`; the refusal of any other expect names all three;
    `ready` on a Run, a Form, a sign-in or a Note is an error at its
    line. The test that compared KIND_RULES.external to a literal goes:
    the decode test asserts the same through the test file.
  - packages/cli/src/testCommand.test.ts, under "a skip step", the toy
    `Push` (Script declaring push), every case read from `--output json`
    and never run (seen.runs counts build and check only): its sign-in
    signed in, `ready` passes, expected and actual `ready`; no login,
    "Expected ready, got blocked: Waiting for cloud"; a dependsOn block
    not run and an `{{ .inputs.tag }}` left empty, blocked naming both,
    then ready once both are there; hidden by its showWhenBlock,
    "Expected ready, got hidden: It shows only when ..."; the existing
    `blocked` step on a ready Push, actual `ready`, was `idle`.
- Docs: testing.mdx (a `ready` row; the `skip` row; Testing pull request
  blocks, with a with-a-token example), commands/cli-reference.mdx's
  `expected` values, blocks/git-pull-request/docs.mdx Testing.
- blocks/git-pull-request/cli.test.ts: its refused-expect test reads the
  message the refusal has said since 6e564d439 ("so a test never runs
  it", which it still expected as "so a test only skips it", so it failed
  on the base), now with `ready`.

Decisions
- `expect: ready` is the lead's recommendation, not a ruling. Under the
  alternative, `runbooks test` runs pull request blocks against a bare
  repository and a stub forge, which breaks testing.mdx's promise that
  they never run in tests.
- No existing way to assert it: KIND_RULES.external allowed only skip and
  blocked, a step of an external block takes no keys (no assertions), and
  a ready block's GetBlock read ended `idle`, which no expect matches.
- Ready is the view's `run` action, the engine's own word for "a run
  would start now", not a second reading of status and blockers here.
  It is the same for every client: an agent's run would first be asked
  to review the forms it reads (NeedsReview), which a view doesn't show.
- A `blocked` step on a ready external block now reports actual `ready`,
  where it reported `idle` ("The block did not run."). It failed before
  and fails now; `idle` no longer said why. A hidden one reports
  `hidden`, also where it reported `idle`.
- The JSON report's `expected` set grows by `ready`. Only a test file
  that writes `expect: ready`, refused until now, gets it, so no existing
  caller sees it without opting in.

Gaps
- `ready` reads the block; it doesn't run the push, the forge's API or
  the pull request. e2e/git-pull-request.spec.ts:118 runs the block end
  to end against a stand-in GitHub API, and is the run coverage `ready`
  doesn't give. Index row at the next index commit.

Evidence
- Restacked onto rebuild/main 20cc5f0, with the skip check now near
  the top: bun check, lint, fmt:check and knip clean; bun test
  packages/cli packages/core packages/app-renderer
  packages/platform-node scripts baseline blocks: 6386 pass, 0 fail.
  The counts below were taken before the restack, on the earlier
  base. A "skip only sign-in blocks" failure among them is the skip
  check, which sat below this commit then.
- Red first, the tests alone on today's runner: HOME=$S/home-g76 bun
  test packages/cli/src/testFile.test.ts
  packages/cli/src/testCommand.test.ts: 118 pass, 7 fail (the new and
  changed tests above). A refused file's message then:
  'runbook_test.yml:6:9: tests[0].steps[0].expect: Expected "success" |
  "fail" | "warn" | "blocked" | "skip" | "hidden" | "config_error"'.
- With the code: the same files, 125 pass, 0 fail.
- HOME=$S/home-g76 bun test packages/cli blocks/git-pull-request
  blocks/git-clone scripts baseline: 1064 pass, 1 fail (scripts' "skip
  only sign-in blocks", red by design on the 26 class B skips);
  blocks/git-pull-request/cli.test.ts 2 pass (1 fail on the base).
- Mutants, then bun test packages/cli/src/testFile.test.ts
  packages/cli/src/testCommand.test.ts (125 pass unmutated):
  - MR1 readiness never says ready: 122 pass, 3 fail
  - MR2 readiness always says ready: 122 pass, 3 fail
  - MR3 no show check for an external block: 124 pass, 1 fail
  - MR4 KIND_RULES.external without ready: 119 pass, 6 fail
  - MR5 a task may expect ready: 124 pass, 1 fail
  - MR6 an external block's ready step runs it as a task's does: 123
    pass, 2 fail
- cspell 10.4.0 (docs/cspell.json) on the three pages: 0 issues
- bun run lint, fmt:check, knip, bun check: exit 0 each

Placed on the skip rules, whose testCommand.test.ts moved the external
block tests into "a sign-in step" and the non-sign-in skip test out of
it: the `ready` tests went into "a sign-in step", this commit's copy of
the non-sign-in skip test was dropped for theirs, and the blocked test
is "that signs in fails an external block's step that expects blocked
when it is ready" (actual `ready`, with LOGIN). testCommand.test.ts
69 pass, 0 fail.
@odgrim
odgrim force-pushed the rebuild/p6-classb-pr-expect-ready branch from e59ba1b to c24ed5c Compare December 2, 2026 02:03
@odgrim
odgrim marked this pull request as ready for review December 2, 2026 02:20
@odgrim
odgrim requested a review from yhakbar as a code owner December 2, 2026 02:20
@odgrim
odgrim merged commit f71a15d into rebuild/main Dec 2, 2026
15 of 16 checks passed
odgrim added a commit that referenced this pull request Dec 2, 2026
… pinned (#1666)

Review of #1636.

Change
- testCommand.test.ts: a test with no steps over a runbook whose Push
  (external, as it declares push) has nothing to wait for reports publish
  as expected `skip`, actual `skip`, passed, and never runs it. everyBlock
  (testRun.ts) gives an external block `skip`; changing that default to
  `blocked` or `ready` passed every test before this one.

Decisions
1. The test uses the toy Push, as the file's other external-block tests
   do: everyBlock decides by the target's kind, "external", not by the
   pull request block. blocks/git-pull-request/cli.test.ts runs the real
   block through the CLI and has no test without steps.

Gaps
1. The three comments the review names (blocks/git-pull-request/block.ts:16,
   cli.test.ts:8, testdata/end-to-end/runbook_test.yml:16) no longer say a
   test "only skips" the block at 1832899: 815a95a (#1649) and
   3503c28 (#1650) rewrote them to "never runs it" and "checks that it
   would". No change made. Index row at the next index commit.

Evidence
- Mutants (bun test packages/cli/src/testCommand.test.ts; control 72
  pass, 0 fail):
  2a everyBlock's external default "blocked": 71 pass, 1 fail
  2b everyBlock's external default "ready": 71 pass, 1 fail
  The failing test is the new one in both.
- grep -rn -i "only skip" blocks/git-pull-request/: no match.
- bun test packages/cli: 264 pass, 0 fail
- bun run lint: exit 0; bun run fmt:check: "All matched files use the
  correct format."; bun run knip: exit 0; bun check: "No type errors in
  2,094 files across 23 projects"
odgrim added a commit that referenced this pull request Dec 2, 2026
…y its own form needs input (#1676)

Review of #1649.

Change
- packages/cli/src/testCommand.test.ts, under "a sign-in step" beside the
  other ready cases: a toy Push with a form of its own whose title is
  required, as a pull request block's, and nothing else to wait for.
  "untitled" expects ready and fails, "Expected ready, got fail: Needs
  input: title"; "titled" gives publish.title in its inputs and passes,
  actual ready. Neither runs it (seen.runs 0).
- No code change: readiness already reads the view's `run` action.

Decisions
1. The toy Push over the real GitPullRequest: the case is the own form
   alone, and the toy has nothing else (no repository, sign-in or
   plugin) that could hold it back, so the failure names only the field.
2. No docs change: testing.mdx already says a ready step needs each field
   of its own form filled.

Gaps
1. Mutant 5b, ready when the status is Idle, survives (74 pass, 0 fail).
   It is equivalent to the `run` action for every view an external block
   has in `runbooks test`: the session is trusted, the block never runs
   (never Done, Failed or Running), and a block that lacks `run` is
   Blocked, NeedsInput, Misconfigured or hidden (read first by
   `showing`). It would part from `run` only in an untrusted session or
   a block run before, which a test never has. Index row at the next
   index commit.

Evidence
- Mutants (bun test packages/cli/src/testCommand.test.ts; control 74
  pass, 0 fail):
  5a ready unless the status is Blocked (readiness by status):
     73 pass, 1 fail (the new test); without the new test: 73 pass,
     0 fail, so it survived before
  5b ready when the status is Idle: 74 pass, 0 fail (Gap 1)
- bun test packages/cli: 267 pass, 0 fail
- bun run lint: exit 0; bun run fmt:check: "All matched files use the
  correct format."; bun run knip: exit 0; bun check: "No type errors in
  2,094 files across 23 projects"

This branch was successfully deployed

1 active deployment
Preview — c24ed5ce Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant