Skip to content

test(e2e): one Deliver click merges a needs-qa PR past a missing review - #106

Merged
jtomaszewski merged 8 commits into
mainfrom
test/one-click-merges
Nov 28, 2026
Merged

jtomaszewski merged 8 commits into
mainfrom
test/one-click-merges

Conversation

@jtomaszewski

@jtomaszewski jtomaszewski commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

A regression test for "the owner had to say merge twice", and for deliver's Next moves block, which the asks plugin turns into buttons.

The bug

In a client repo, a PR was green, carried needs-qa with self-QA evidence posted on its head, and waited only for a review (REVIEW_REQUIRED). The owner, an admin, clicked "Merge with --admin". The agent refused because qa-approved was missing and opened a second ask, so the owner had to approve the same merge twice. fullstackhouse/skills#98 changes deliver so that the owner's Deliver click is the QA sign-off: the agent adds qa-approved and merges. Every deliver report now ends with a Next moves block (Now: plus the moves), which is the contract between deliver and this plugin.

What the test does

e2e/deliver.e2e.ts runs a real Paseo daemon and a Sonnet agent with deliver loaded from fullstackhouse/skills at a pinned commit (b4ece6a, #98).

  • Fixture repo: the agent's checkout, with a bare origin. CI runs on pull_request and there is no deploy workflow, so the only level is merged. review-loop's state.json says the local review converged on the head.
  • Fake gh (e2e/fake-gh/), first on the agents' PATH. It answers two PRs: open, REVIEW_REQUIRED, mergeStateStatus: BLOCKED, viewer is admin, needs-qa, CI green, and a QA comment naming the head. It logs every call and flags the mutating ones. A merge without --admin fails the way GitHub's does. A repos//… path (an unset $SLUG) gets GitHub's 404.

Case 1 (PR #7): an agent offers the "Deliver to merged" ask a host makes from deliver's Next moves (label "Deliver to merged", prompt the move's exact instruction). The test presses it through /act and the agent settles. Asserted:

  • qa-approved is added before exactly one gh pr merge, and that merge uses --admin;
  • no review is requested and no workflow is dispatched; the PR ends MERGED;
  • no second ask is created, and the agent is not nudged;
  • the final message ends with a Next moves block whose Now: names merged, with no moves.

Case 2 (PR #8, also do-not-merge): the same click produces no merge and no pr edit, and the agent's reply names do-not-merge. Also asserted:

  • the final message ends with a Next moves block whose Now: says blocked and names do-not-merge;
  • a hard stop lists no moves;
  • nothing asks the owner for what the move already does: no "add qa-approved", "you need to add qa-approved", "get QA signed off", "QA sign-off is still needed" or "once QA is signed off", and the Now: line doesn't say qa-approved is missing. Saying what deliver will do ("the click would add qa-approved") passes.

The block checks are loose on wording and markdown (a "Next moves" line, then a Now: line), strict on shape.

Why Sonnet

deliver runs on the session's model, and that is never Haiku. On Haiku the agent skipped the Next moves block in most runs across four skill revisions, even with the block spelled out in the skill. On Sonnet, 3 of 3 recordings at b4ece6a met the contract. Only this test uses Sonnet (Sandbox.start(…, { claudeModel: "sonnet" })); every other test stays on Haiku. A recording costs roughly 3x a Haiku one (about $0.60 against $0.20 in tokens) and takes about the same time (130–180 s).

Recorded Next moves at b4ece6a:

Next moves — PR #7: Greets the visitor by name on the home page.
Now: on merged
Next moves — PR #8: adds a sale banner.
Now: blocked (`do-not-merge`). Once the label is removed, run deliver again for new moves.

Main vs #98

  • deliver at feat(summary): name the owning agent on each Your move entry #98 (b4ece6a), Sonnet: both cases pass. 3 of 3 recordings passed every assertion; the kept cassette is the third. Replay: the deliver test passed 4 of 4 local replays and the full e2e suite passed in CI on 7ee19b6. Locally the other e2e files timed out starting their daemons on a machine at load ~40, which is unrelated to this change.
  • Earlier feat(summary): name the owning agent on each Your move entry #98 revisions on Haiku (c3b89a9, 1b1728a, 25b82e1, b4ece6a): the merge assertions passed, but the reports left out the Next moves block, or listed a move on a hard stop, or asked for QA sign-off. That is what the new assertions catch.
  • deliver at skills main (39bd4d2), recorded into a throwaway cassette: case 1 fails with exactly one gh pr merge: expected [] to have a length of 1. The agent read PR fix(service): tell agents to offer human-only moves as send actions #7, merged nothing, and left the ask open for another click. Case 2 fails as a knock-on of that count.

Harness changes

  • Sandbox.start(name, { path, skills, claudeModel }) puts extra directories first on the agents' PATH, installs user-scope skills, and sets the Claude model (Haiku by default). The proxy already routes sonnet to OpenRouter's latest Sonnet.
  • pinnedSkill(repo, sha, path) downloads a skill at a commit once into e2e/node_modules/.skills. E2E_DELIVER_SHA runs another commit into its own cassette.
  • act() takes an optional workspaceId. Ask ids are per workspace, so a second agent's ask is also A1; looking it up by id alone sometimes pressed the first agent's ask.
  • Replays on Linux as recorded on macOS. The proxy's match key normalizes bash syntax errors, whose wording and exit code differ between bash 3.2 (macOS) and bash 5 (CI), and the offending line bash echoes after one. It already does the same for ls -l. It now also drops the process id from Node's warnings ((node:57894) [MODULE_TYPELESS_PACKAGE_JSON] …), which changed on every run. The fake gh prints a fixed message when a --jq expression fails, because jq words its errors differently per version.
  • The daemon gets 90 s instead of 30 s to start, for a loaded machine.

Worth knowing

  • The cassette re-records whenever deliver's text changes. The skill text is part of what the model sees, so bumping DELIVER_SHA means running npm run e2e:record -- deliver. The cassette is 1.0 MB.
  • Sonnet output still varies between recordings. Re-record a few times when bumping the pin, and keep a run only if every run passes.
  • The plugin's own gh reads don't see the fake. findGh() only tries absolute paths. In the sandbox those reads run unauthenticated and fail, and no assertion depends on them. Only the agent's shell uses the fake.
  • A first run needs network to fetch the pinned skill from GitHub, like fsh-host.mjs does.

Related: fullstackhouse/skills#98, #104.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

jtomaszewski and others added 3 commits November 27, 2026 14:02
A pressed "Deliver to merged" on a green, REVIEW_REQUIRED, needs-qa PR with QA
evidence on its head must add qa-approved and merge once with --admin, with no
second ask and no nudge; the same click on a do-not-merge PR must stop and say so.

- e2e/fake-gh: a gh stand-in on the agents' PATH answering two fixture PRs and
  logging every call, mutating ones flagged.
- harness: Sandbox.start options for extra PATH dirs and user-scope skills,
  pinnedSkill() fetching a skill at a commit, act() taking a workspace (ask ids
  are per workspace).
- deliver is fullstackhouse/skills at 642811a (#98); on skills main the test
  fails (no merge, the ask is left for a second click).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first take caught a mis-quoted command whose error text differs between
macOS bash 3.2 and CI's bash 5, so CI missed the cassette. Note the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acOS

CI missed the cassette on tool output that differs by platform: jq's error
text (the fake gh now prints a fixed message, and keeps jq's stderr out) and
bash's syntax-error wording and exit code (bash 3.2 vs 5), which the proxy now
normalizes in the match key like it does `ls -l`. Re-recorded; the daemon gets
90 s to start on a loaded machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtomaszewski

Copy link
Copy Markdown
Contributor Author

@maxidragon could you review this as part of the delivery redesign (SPEC-051)? The spec is at https://app.notion.com/p/4254d59f776b813ea176f58107e69059 (Notion, FSH Internal) and explains why. The four PRs are the implementation and its end-to-end proof: fullstackhouse/skills#98, #104, #106 and fullstackhouse/paseo#297. paseo-asks#104 narrows your #85 check to buttons that cannot work, so your view there matters most (spec open question 3).

jtomaszewski and others added 5 commits November 28, 2026 02:20
deliver now ends its report with host-neutral Next moves instead of
driving the asks tool. Bump the pinned deliver commit from 642811a to
c3b89a9 and re-record on the current main. The seeded ask already
matches the move deliver lists ("Deliver to merged", its exact
instruction), and every assertion is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a syntax error, bash echoes the offending line, numbered 0 by
bash 3.2 (macOS) and 1 by bash 5 (CI), so the deliver replay missed in
CI. Fold that line into the syntax-error marker and re-key the
cassette entries it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin deliver at skills b4ece6a and assert the Next moves block that the
asks plugin turns into buttons: PR #7 ends with `Now:` on merged and no
moves; PR #8 ends blocked on do-not-merge, lists no moves, and never asks
the owner to add qa-approved or get QA signed off.

Run this test on Sonnet via a new Sandbox claudeModel option (Haiku stays
the default): deliver runs on the session's model, and on Haiku it skipped
the block in most runs. 3 of 3 Sonnet recordings passed.

Also: the proxy drops Node's warning pid from match keys, and the fake gh
answers a `repos//...` path (unset $SLUG) with GitHub's 404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtomaszewski
jtomaszewski marked this pull request as ready for review November 28, 2026 23:49
@jtomaszewski
jtomaszewski merged commit fbd702f into main Nov 28, 2026
5 checks passed
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