Skip to content

rebuild: cli: a sign-in step waits for a block that starts over to look again - #1634

Merged
odgrim merged 1 commit into
rebuild/p6-classb-ci-runbook-testsfrom
rebuild/p6-classb-signin-starts-over
Dec 2, 2026
Merged

odgrim merged 1 commit into
rebuild/p6-classb-ci-runbook-testsfrom
rebuild/p6-classb-signin-starts-over

Conversation

@odgrim

@odgrim odgrim commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Stack: rebuild phase 6, rows class B skips, part 3 of 22: a sign-in step waits through a start-over. Base: #1633 (rows class B skips, part 2 of 22). Map: .more9s/rebuild.md on rebuild/main.

94 changed lines, 64 of them tests and test runbooks.

Change

  • packages/cli/src/testRun.ts: a credential step settles with settleCredential, which waits, up to the step's 30 seconds, for the block to stop running and to have a state. A block that starts over, as a form's value it pins changed, has no state and is Idle until the engine starts it again, so WaitForBlock returned at once and the step ended idle. It now looks again every 100 ms until the block has a state, the wait ends, or Ctrl-C stops the run.
  • packages/cli/src/testCommand.test.ts: a "a sign-in step" group, with a fake cloud login, and its first test: a CloudLogin pins the account a form gives it, and the test gives the form another account than its default, so the block starts over once the form's step runs. Its step, expecting success when the login reaches that account and skip when it doesn't, waits for the block to look again.
  • testing.mdx already says a sign-in step "waits up to 30 seconds for the block to settle": this makes the runner do so. No docs change.

Decisions

  • Found by running blocks/aws-auth/testdata/values "another account" against the skip rule (the next commit): the step read the block as Idle with no credential state, then within 250 ms as SignedOut (a polling probe in runBlock, deleted). The same holds for any sign-in step after a form step that changes what the block pins, success included: blocks/*/testdata's "the form's ..." cases pass only because the test gives the form's default, so nothing starts over.
  • The wait is in the runner, not the engine. The engine's view is right: a block starting over has no lifecycle state (credentials.ts restart, "it has no state until enter starts it"), and WaitForBlock's contract is "not running or awaiting approval". What a step needs, a state, is the runner's to wait for. An engine change, reporting a block starting over as Running, would change every client's view: not taken.
  • It polls GetBlock, not the session's events, as the runner's client (CaseClient, also driven over MCP by baseline/step3Fixtures.test.ts) has no events. Bounded by the step's wait.
  • The "another account" case, which expects skip, passes on today's runner only because a skip step reads nothing; the next commit makes a sign-in block's skip step look for a login.

Gaps

  • None.

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: 6348 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 test on 542a303's runner, HOME=$S/home-g76 bun test packages/cli/src/testCommand.test.ts -t "a sign-in step" (fail) runbooks test > a sign-in step > whose block starts over waits for it to look again "its account", - "passed" + "failed", + "cloud: Expected success, got idle: The block did not run." 0 pass, 1 fail
    • Probe (deleted), blocks/aws-auth/testdata/values --test "another account", RUNBOOKS_FAKE_CREDENTIALS=1, GetBlock every 250 ms from the step: PROBE 0 aws {"_tag":"Idle"} undefined PROBE 1 aws {"_tag":"Idle"} {"_tag":"SignedOut",...
    • HOME=$S/home-g76 bun test packages/cli scripts baseline: 928 pass, 0 fail
    • Mutant M5, !startingOver || made true || (no second look): bun test packages/cli/src/testCommand.test.ts: 55 pass, 1 fail, the start-over test ("its account": idle).
    • bun run lint, fmt:check, knip, bun check: exit 0 each

@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: 5868b457-15b6-4e04-9b8d-8e794ad88d66

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

…ok again

Change
- packages/cli/src/testRun.ts: a credential step settles with
  `settleCredential`, which waits, up to the step's 30 seconds, for the
  block to stop running and to have a state. A block that starts over, as
  a form's value it pins changed, has no state and is Idle until the engine
  starts it again, so WaitForBlock returned at once and the step ended
  `idle`. It now looks again every 100 ms until the block has a state, the
  wait ends, or Ctrl-C stops the run.
- packages/cli/src/testCommand.test.ts: a "a sign-in step" group, with a
  fake cloud login, and its first test: a CloudLogin pins the account a
  form gives it, and the test gives the form another account than its
  default, so the block starts over once the form's step runs. Its step,
  expecting success when the login reaches that account and skip when it
  doesn't, waits for the block to look again.
- testing.mdx already says a sign-in step "waits up to 30 seconds for the
  block to settle": this makes the runner do so. No docs change.

Decisions
- Found by running blocks/aws-auth/testdata/values "another account"
  against the skip rule (the next commit): the step read the block as Idle
  with no credential state, then within 250 ms as SignedOut (a polling
  probe in runBlock, deleted). The same holds for any sign-in step after a
  form step that changes what the block pins, `success` included:
  blocks/*/testdata's "the form's ..." cases pass only because the test
  gives the form's default, so nothing starts over.
- The wait is in the runner, not the engine. The engine's view is right:
  a block starting over has no lifecycle state (credentials.ts `restart`,
  "it has no state until `enter` starts it"), and WaitForBlock's contract
  is "not running or awaiting approval". What a step needs, a state, is
  the runner's to wait for. An engine change, reporting a block starting
  over as Running, would change every client's view: not taken.
- It polls GetBlock, not the session's events, as the runner's client
  (CaseClient, also driven over MCP by baseline/step3Fixtures.test.ts) has
  no events. Bounded by the step's wait.
- The "another account" case, which expects skip, passes on today's
  runner only because a skip step reads nothing; the next commit makes a
  sign-in block's skip step look for a login.

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: 6348 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 test on 542a303's runner,
  HOME=$S/home-g76 bun test packages/cli/src/testCommand.test.ts -t "a sign-in step"
    (fail) runbooks test > a sign-in step > whose block starts over waits for it to look again
      "its account", - "passed" + "failed",
      + "cloud: Expected success, got idle: The block did not run."
    0 pass, 1 fail
- Probe (deleted), blocks/aws-auth/testdata/values --test "another account",
  RUNBOOKS_FAKE_CREDENTIALS=1, GetBlock every 250 ms from the step:
    PROBE 0 aws {"_tag":"Idle"} undefined
    PROBE 1 aws {"_tag":"Idle"} {"_tag":"SignedOut",...
- HOME=$S/home-g76 bun test packages/cli scripts baseline: 928 pass, 0 fail
- Mutant M5, `!startingOver ||` made `true ||` (no second look):
  bun test packages/cli/src/testCommand.test.ts: 55 pass, 1 fail,
  the start-over test ("its account": idle).
- bun run lint, fmt:check, knip, bun check: exit 0 each
@odgrim
odgrim force-pushed the rebuild/p6-classb-signin-starts-over branch from b433a10 to 2f52c9f 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 089045e into rebuild/main Dec 2, 2026
26 of 27 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2f52c9f2 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