fix(framework): on-before-mergeable run stays on the session branch (#560)#604
Merged
Merged
Conversation
…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
marked this pull request as ready for review
July 16, 2026 17:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:So the #556 quality TODO entries and the #537 knowledge docs live only on a stranded branch. The next run branches from
mainand cannot read them, which defeats #537.Why
The follow-up is spawned as a plain
framework promptchild, so it gets the full #326 system prompt including the### Session namestep (commit dirty tree -> createthe-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
spawnPromptRunbut are left branching: each is a separate focused refactor that arguably wants its own branch/PR.Alternatives / decision
--vanilla. One flag, drops the whole built-in prompt.## Before starting changessection, 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
promptRunArgsgains avanillaparam; new test locks that the follow-up path carries--vanillaand a normal run does not. Framework suite: 542 pass / 0 fail, typecheck clean. Changeset:@gemstack/frameworkpatch.