From cd8480d494d0a96000e37db9d382dc77afe62de5 Mon Sep 17 00:00:00 2001 From: bougyman's bot Date: Sun, 27 Sep 2026 20:46:44 -0400 Subject: [PATCH 1/2] fix(stokowski): never rewrite a pushed branch in before_run The hook rebased every clean branch onto origin/main. On a PR branch that already contains a merge from main (EXT-68's PR #286 after "Update branch"), that dropped the merge commit and replayed the feature commits, leaving the workspace "ahead 5, behind 6" of the PR on every dispatch. A branch with an upstream (main, or a pushed PR branch) is now only fast-forwarded to that upstream with `git pull --ff-only`. Only an unpushed local branch still rebases onto origin/main. Co-Authored-By: Claude Opus 5.5 --- workflow.glean.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/workflow.glean.yaml b/workflow.glean.yaml index 13d3343..f5482e5 100644 --- a/workflow.glean.yaml +++ b/workflow.glean.yaml @@ -41,6 +41,16 @@ hooks: echo "before_run: preserving uncommitted workspace changes; skipping rebase" exit 0 fi + # A branch that tracks a remote branch (main, or a pushed PR branch) is + # shared history: fast-forward it to its own upstream and never rewrite + # it. Rebasing a PR branch onto main drops its merge commits and leaves + # the workspace diverged from the PR. Only an unpushed branch rebases. + if git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}' >/dev/null 2>&1; then + if ! git pull --ff-only; then + echo "before_run: cannot fast-forward to the upstream branch; leaving it as is" >&2 + fi + exit 0 + fi if ! git rebase origin/main; then echo "before_run: rebase onto origin/main failed; aborting it" >&2 if ! git rebase --abort; then From f1d0c01222e03867178fb0b1d57ec432868bf2e4 Mon Sep 17 00:00:00 2001 From: bougyman's bot Date: Sun, 27 Sep 2026 20:46:50 -0400 Subject: [PATCH 2/2] fix(stokowski): accept "Accept" as a follow-up approval EXT-68's approval read "Accepted: G1, G2, and G3". It has no "Approve", so under the prompt's own rule nothing should have been created, yet improvement created all three: the outcome was right but the agent broke its rule to get there. The rule now accepts a word starting with "Approve" or "Accept", and the report must quote the approval comment it used, so a reviewer can check the match. Co-Authored-By: Claude Opus 5.5 --- .ai/prompts/glean.md | 4 ++-- .ai/prompts/improvement.md | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.ai/prompts/glean.md b/.ai/prompts/glean.md index 0b486ee..26f6977 100644 --- a/.ai/prompts/glean.md +++ b/.ai/prompts/glean.md @@ -104,8 +104,8 @@ future enhancement. or an explicit statement that nothing new should be filed. - `key_points` — three to five evidence-backed takeaways. - `next_steps` — when there are follow-ups, the first step is exactly: - "Approve with a comment containing `Approve` and the ids to create, for - example `Approve G1, G2`." When there are none, state "No follow-ups + "Approve with a comment containing `Approve` or `Accept` and the ids to + create, for example `Approve G1, G2`." When there are none, state "No follow-ups proposed." 6. Do not create the proposed Linear issues in this stage. The report is the diff --git a/.ai/prompts/improvement.md b/.ai/prompts/improvement.md index af1847b..129ad7d 100644 --- a/.ai/prompts/improvement.md +++ b/.ai/prompts/improvement.md @@ -11,10 +11,11 @@ run the project's setup or quality commands. Do not change the source issue. ## 1. Find the approved ids Look only at the comments under **Recent Activity** in the lifecycle section -below. An approval is a comment that contains the word `Approve` (any case). -Its approved ids are every `G` that appears after that word, such as -`Approve G1, G3` or `Approve follow-ups: G2 G4`. If more than one comment is an -approval, use the latest one. +below. An approval is a comment that contains a word starting with `Approve` +or `Accept` (any case). Its approved ids are every `G` that appears +after that word, such as `Approve G1, G3`, `Approved: G2 G4` or +`Accepted: G1, G2, and G3`. If more than one comment is an approval, use the +latest one. That is the only rule. Do not infer approval from any other comment, however it is worded. @@ -80,8 +81,10 @@ Write `.stokowski/report.json`: - `next` — when `blocked`, say why: the PR's `mergeStateStatus` and `reviewDecision`, and any ids that failed. The issue then waits at the merge-review gate. -- `claims` — one entry for each approved id, with the created identifier or - the error, and one entry for the PR check with the `gh` output. +- `claims` — first, one entry quoting the approval comment you used, word for + word, with its author and time, or stating that there was none. Then one + entry for each approved id, with the created identifier or the error, and + one entry for the PR check with the `gh` output. - `summary` — when any proposed follow-up in `.stokowski/follow-ups.json` was not created (not approved, or failed), say so plainly: list each one as "**Not created:** `` — ". Then end with this paragraph, verbatim: