Skip to content

fix(framework): on-before-mergeable run stays on the session branch (#560)#604

Merged
suleimansh merged 1 commit into
mainfrom
fix/on-before-mergeable-no-branch-560
Jul 16, 2026
Merged

fix(framework): on-before-mergeable run stays on the session branch (#560)#604
suleimansh merged 1 commit into
mainfrom
fix/on-before-mergeable-no-branch-560

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #560. Draft: the fix is a judgment call in a design area, flagging before it leaves draft.

The bug

The on-before-mergeable follow-up (fired after setReadyForMerge()) strands its output on a branch nothing merges:

* the-framework/surge-pricing-followup
  22be1cf  Record surge pricing decision and business knowledge   <- DECISIONS.md + KNOWLEDGE-BASE.md
  main: has neither file

So the #556 quality TODO entries and the #537 knowledge docs live only on a stranded branch. The next run branches from main and cannot read them, which defeats #537.

Why

The follow-up is spawned as a plain framework prompt child, so it gets the full #326 system prompt including the ### Session name step (commit dirty tree -> create the-framework/<name> -> checkout). It branches before writing anything, and writes its output on the new branch. That step is right for a session; the follow-up is a follow-up to one, not a session itself.

Fix

Spawn the follow-up --vanilla, which drops the built-in #326 prompt and with it the session-name step, so it stays on the session's current branch where its output rides to review and merge with the work. The follow-up prompt is self-contained (it names the TODO file and knowledge docs itself) and the always-on emit protocols remain.

Scoped to the on-before-mergeable spawn only. The maintainability/security preset spawns share spawnPromptRun but are left branching: each is a separate focused refactor that arguably wants its own branch/PR.

Alternatives / decision

  • MVP (this PR): --vanilla. One flag, drops the whole built-in prompt.
  • Targeted: drop only the ## Before starting changes section, keeping the rest of the built-in prompt. More precise, a little more plumbing. Happy to switch if you prefer keeping the rest of the System prompt #326 framing for the follow-up.

One thing to confirm: the intended landing spot is the session's current branch (so output merges with the work). Both #556 and #537 read that way; the eager-vs-after-merge setting is orthogonal (lands correctly either way on the session branch).

Tests

promptRunArgs gains a vanilla param; new test locks that the follow-up path carries --vanilla and a normal run does not. Framework suite: 542 pass / 0 fail, typecheck clean. Changeset: @gemstack/framework patch.

…560)

The follow-up fired after setReadyForMerge() was spawned as a plain
`framework prompt` child, so it inherited the #326 system prompt's
`### Session name` step and committed + branched + checked out a fresh
`the-framework/<name>` branch before writing anything. Its output (the
#556 quality TODO entries and the #537 knowledge docs) landed there,
where nothing merges it, so the next run branched from main and could
not see it.

The follow-up is a follow-up to a session, not a session of its own.
Spawn it `--vanilla` so it drops the built-in prompt (and its session-name
step) and stays on the session's current branch, where its output rides
to review and merge with the work. Scoped to the on-before-mergeable
spawn; the maintainability/security preset spawns are untouched.

Closes #560
@suleimansh suleimansh self-assigned this Jul 16, 2026
@suleimansh
suleimansh marked this pull request as ready for review July 16, 2026 17:51
@suleimansh
suleimansh merged commit 43bae91 into main Jul 16, 2026
2 checks passed
@suleimansh
suleimansh deleted the fix/on-before-mergeable-no-branch-560 branch July 16, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-merge run strands its output on its own branch

1 participant