Conversation
…le-merge; port live zenmode fix to shipped defaults
Existing installs whose zenmode.md / orchestrator instructions.md still run
`shelbi zen pr-merge` as the ordinary review->done finalize double-merge: the
command squash-merges + deletes the branch, then the workflow's own `review ->
done` `merge` action finds the branch gone and strands the card in `review`.
The live shelbi zenmode.md was already corrected to gate-then-transition; this
makes that fix reach ALL projects via the config-upgrade self-heal channel, and
ships the corrected text in the defaults so fresh inits never regress.
Deliverables:
1. `ZEN_PR_MERGE_DOUBLE_MERGE` sniffer in config_upgrade.rs, classified
NeedsJudgment (prose is user-customizable — no safe deterministic rewrite).
2. Corrected shipped `default_zenmode.md.template` + `default_orchestrator.md.template`.
3. `## Changing shipped defaults` guardrail added verbatim to AGENTS.md
(CLAUDE.md is a symlink to it, so both carry it).
Key decisions:
- The sniffer is a cross-surface, per-project whole-set pass (runs in `detect`
after `sniff_renamed_siblings`), gated on the project actually having a
handoff-category -> done-category transition whose actions include `merge`
(categories resolved from statuses.yaml, with review=handoff/done=done as the
fallback). Where no transition merges, `zen pr-merge` is the legitimate
finalize, so we never flag it.
- Detection is a conservative content-sniff, not a version check: a mention of
`zen pr-merge` that is (a) outside any `## Release` section, (b) not a
negation/warning ("do not run", "double-merge", "owns the merge"...), and
(c) imperative (a run verb in its backward window) — plus the doc must, outside
Release, also instruct moving a task to `done`. Markdown emphasis (`*`) and
code backticks are stripped and whitespace is collapsed across a small context
window so a "do **not** run `shelbi\n zen pr-merge`" that wraps across two
indented lines still reads as the negation. This keeps the corrected prose, the
Release-flow usage, and a bare CLI-reference listing all unflagged.
- Kept `zen pr-merge` documented (chose NOT to delete it): the corrected zenmode
template moves it into a new `## Release flow` section (which the sniffer
excludes), so the state crate's zenmode content-pin test still passes and the
command stays discoverable for release version-bump / tap PRs.
- No FINDINGS_SCHEMA_VERSION bump (same finding shape), per the spec.
- Verified end-to-end against the real binary: the pre-edit (deprecated)
templates produce the finding on both surfaces; the corrected templates
produce none. A regression unit test pins that the shipped defaults don't trip
the sniffer.
Note: the task card carried a "HELD until the live fix proves out" banner;
proceeded because the task was dispatched onto this branch with explicit
implement-and-mark-ready instructions, taking dispatch as the hold being lifted.
Flagging here for review in case that was not the intent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jlong
deleted the
jlong/zen-finalize-merges-via-the-review-done-transition-not-zen-pr-merge-port-live-zenmode-fix-to-shipped-defaults
branch
August 16, 2026 21:38
4 tasks
jlong
added a commit
that referenced
this pull request
Aug 25, 2026
…rdening (#584) Bump workspace version 0.8.0 -> 0.9.0. Highlights since v0.8.0: - agents: agent.yaml manifest + multi-runner resolution chain (#543), task/status launch overrides (#549), medium-agnostic reviewer (#571) - orchestrator: deadline-aware self-healing consuming event drain (#580), crash record (exit code + stderr tail) on unexpected pane exit (#560) - config-upgrade: version-agnostic validate-and-upgrade sniffer that hands needs-judgment findings to the orchestrator on boot (#550, #552, #572) - review: idempotent hub-side merge for already-integrated branches (#573), already-merged PR treated as merge success (#566), fire review->done merge at the move site, gated (#558), picker + eviction when loading a queued task onto a slot (#564), review-window pane auto-recovery (#568, #569), reject-dialog mouse support + multi-line reason (#578, #561), dispatch guard against routing dev work onto a review slot (#575) - poller: auto-reconcile review tasks whose PR was merged on GitHub (#582), robust spinner + AskUserQuestion dialog detection (#559, #555) - pr: worker-authored PR bodies from an editable per-project template (#581) - palette: three-state project status indicator with active pulse (#556, #562) - install: launchd boot-out + already-running daemon restart fixes (#570, #565, #547) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Aug 25, 2026
This was referenced Sep 6, 2026
This branch was successfully deployed
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.
HELD — do not dispatch until the live
zenmode.mdchange (applied in theshelbiproject 2026-08-16, droppingzen pr-mergefrom the review->done finalize path) has proven out over a few real Zen merges. This makes the fix reach all projects, not just new ones, via the config-upgrade self-heal channel.Problem
For a workflow whose
review -> donetransition already merges (e.g.app:actions: [merge, delete_branch],merge_strategy: squash), the Zen instructions told the orchestrator to runshelbi zen pr-mergeAND then move the card todone. That double-merges:zen pr-mergesquash-merges + deletes the branch, then the transition'smergeaction finds the branch already merged and fails ("branch not on origin" / empty-commit), stranding the card inrevieweven though the work shipped. Reported by more than one orchestrator, so it is systemic.The corrected policy (already live in this project's
zenmode.md): the workflow transition OWNS the merge. Zen gates (self-review +zen ci-watchgreen) and then triggers the transition viashelbi task move <task> --to done. It does NOT runzen pr-merge.zen pr-mergestays only for the Release flow (external bump / Homebrew tap PRs, not governed by a review->done transition).Why a config-upgrade sniffer (not just a template edit)
Shelbi copies its default
zenmode.mdand orchestratorinstructions.mdinto each project atshelbi init; after that the project owns its (user-editable, self-heal-preserved) copy. So editing the shipped template ONLY reaches NEW projects. Existing projects keep the deprecated forked text. The config-upgrade pass is the vehicle that repairs existing installs on boot.Deliverables
crates/shelbi-cli/src/commands/config_upgrade.rs, classifiedNeedsJudgment(prose is user-customizable; no safe deterministic rewrite). Surfaces are already enumerated inconfig_surfaces.rs:project.<name>.zenmode(zenmode.md) andproject.<name>.agent.orchestrator.instructions(instructions.md), bothSurfaceFormat::Markdown.zenmode.md/orchestrator-instructions surface whose merge/finalize prose instructs runningshelbi zen pr-mergeas part of the ordinary review->done finalize (i.e.zen pr-mergepresent in the merge-conditions steps together with a subsequent "move ... todone"), in a project that has a workflow whosereview -> donetransition contains amergeaction. Do NOT flag the Release-flowzen pr-mergeusage.message: explain the double-merge hazard.proposed_fix: the corrected gate-then-transition policy (dropzen pr-merge; gate viazen ci-watch; finalize viatask move --to done). The orchestrator repairs its own copy with judgment, preserving customizations, then applies via the existing--apply-finding <id>path if a targeted apply is wired.zenmode.mdtemplate and the default orchestratorinstructions.mdtemplate (crates/shelbi-state/src/default_orchestrator.md.templateand the shippedzenmode.mddefault) — replace thepr-create -> ci-watch -> pr-merge -> move-to-donesequence with the gate-then-transition sequence, keepingzen pr-mergedocumented for the Release flow.AGENTS.md(verbatim), so agents never again change a default without a matching self-heal path:Acceptance Criteria
zenmode.md(or orchestratorinstructions.md) still instructs thezen pr-merge-then-move-to-done double-merge produces aNeedsJudgmentconfig-upgrade finding on hub start /shelbi reload.proposed_fixstates the gate-then-transition policy.zen pr-mergeusage does NOT trigger a finding.zenmode.mdand orchestratorinstructions.mdtemplates carry the corrected flow, so a freshshelbi inityields no finding.## Changing shipped defaults ...section above is present in the rootAGENTS.md.cargo build/test/clippygreen; new sniffer covered by a unit test (detects deprecated text, ignores corrected text and release-flow usage).Auto-opened by Shelbi — review at: /Users/jlong/.shelbi/projects/shelbi/tasks/zen-finalize-merges-via-the-review-done-transition-not-zen-pr-merge-port-live-zenmode-fix-to-shipped-defaults.md