Skip to content

fix(baseline): Hold review:claude until the ask record settles on every path - #42

Merged
mpaulosky merged 2 commits into
mainfrom
fix/40-ask-copilot-settle-wait
Nov 10, 2026
Merged

mpaulosky merged 2 commits into
mainfrom
fix/40-ask-copilot-settle-wait

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

Fixes R1, the Critical from the pre-push review of mpaulosky/TicketManager#263 (see #40).

askCopilotOnce waited out the rest of COPILOT_ASK_SETTLE_MS (#23) only when the Copilot review request failed. Two other paths returned true about one poll after the request, with the ask record seconds old: the read-back's catch, and the break when the head moved. The caller then added review:claude; Claude Review skips a record younger than 30 s and a later PR Auto-Merge run strips the label, so Claude's review waited for another event or sweep.

  • One local waitOutSettle() (the same wait: the rest of the window, capped by COPILOT_ASK_WAIT_MS) is called on all three paths. A registered request needs none, and an unregistered one already waited the whole read-back window.
  • Tests on the mock clock: the read-back error and the moved head each hold the run, and review:claude, until the record is 30 s old; a registered request ends the run early. Both new tests fail without the fix. The existing failed-request test now has an upper bound, so removing the COPILOT_ASK_WAIT_MS cap fails it (the run took 30 s); this is R6's missing bound. A record already older than the window is still untested.
  • The header no longer says a failed request counts as dropped "at once" (R4).
  • The Factory's copy of pr-automerge.yml is copied over. scripts/gate.sh passes.

Still in #40: R3, R5, R6 (the older-record case), R7, R8, R9, R19.

Rollout: pr-automerge.yml and its test are Owned files, so this reaches the Fleet by a Rollout. TicketManager's re-Apply (#263) is waiting for it and then gets one review run covering both Template fixes.

🤖 Generated with Claude Code

…ry path askCopilotOnce returns true

The settle wait of #23 covered only a failed request. A read-back that errors or finds the head moved
returned true about 5 s after the request, so review:claude could be added while Claude Review still
skipped a record that young and a later run stripped the label.

Refs #40

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The moved-head fixture lacks a valid moved commit, causing an early return before labeling and leaving the label-age assertions unexercised.

1 open issue
What changed in this PR

This PR extends the Baseline’s Copilot settle wait to read-back errors and head changes, preventing those early exits from triggering Claude fallback prematurely. It also updates the Factory’s workflow copy; Applications receive the change through a Rollout.

Changes:

  • Shares the capped settle-wait helper across all three early-exit paths.
  • Adds timing tests for read-back errors, moved heads, and registered requests, plus an upper bound on the failed-request wait.
  • Corrects the workflow header’s description of fallback timing.
File Description
.github/​workflows/​pr-automerge.yml Synchronizes the Factory’s workflow with the Template fix.
.claude/​skills/​repo-ci-baseline/​template/​owned/​.github/​workflows/​pr-automerge.yml Adds shared settle waits and updates timing documentation.
.claude/​skills/​repo-ci-baseline/​template/​owned/​.github/​scripts/​tests/​pr-automerge.test.mjs Adds head-change simulation and settle-wait timing assertions.

Review effort: Balanced

… the label

The moved head wasn't in the commit graph, so the caller stopped on the merge check and never added
review:claude; the label-age assertions checked nothing.

Refs #40

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the fallback-timing changes and associated regression tests.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@mpaulosky
mpaulosky merged commit a3fbd3a into main Nov 10, 2026
13 checks passed
@mpaulosky
mpaulosky deleted the fix/40-ask-copilot-settle-wait branch November 10, 2026 20:43
mpaulosky added a commit to mpaulosky/TicketManager that referenced this pull request Nov 10, 2026
## Why

Re-Apply the repo-ci-baseline Template so this repo carries the Template
changes from mpaulosky/Application_Factory#36,
mpaulosky/Application_Factory#37, mpaulosky/Application_Factory#38 and
mpaulosky/Application_Factory#39.

## What changed

- `f1d2468` Apply commit, `apply.sh` output alone: brings
mpaulosky/Application_Factory#36, mpaulosky/Application_Factory#37,
mpaulosky/Application_Factory#38 and mpaulosky/Application_Factory#39.
  - `.claude/rules/sandcastle-hand-off.md`
  - `.github/scripts/tests/pr-automerge.test.mjs`
  - `.github/workflows/lint-actions.yml`
  - `.github/workflows/pr-automerge.yml`
  - `.github/workflows/sandcastle.yml`
  - `.sandcastle/lib/branches.mts`
  - `.sandcastle/lib/branches.test.mts`
  - `.sandcastle/lib/review-ledger.mts`
  - `.sandcastle/lib/review-ledger.test.mts`
  - `.sandcastle/lib/role-logs.mts`
  - `.sandcastle/lib/role-logs.test.mts`
  - `scripts/check-branch-name.sh`
  - `scripts/tests/check-branch-name.test.sh`

## Verification

- The Apply commit is exactly `apply.sh`'s output on a branch up to date
with `main`.
- The pre-push gate (`scripts/gate.sh`) passed on `f1d2468`.

- `427f43e` Apply commit, `apply.sh` output alone: brings
mpaulosky/Application_Factory#36, mpaulosky/Application_Factory#37,
mpaulosky/Application_Factory#38, mpaulosky/Application_Factory#39,
mpaulosky/Application_Factory#41 and mpaulosky/Application_Factory#42.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

2 participants