Skip to content

fix(auto-ticket): sync the branch with its base before config, resolve conflicts at the CI wait, name the parking step (3.30.0) - #124

Merged
devondragon merged 7 commits into
mainfrom
fix/auto-ticket-base-sync
Nov 21, 2026
Merged

devondragon merged 7 commits into
mainfrom
fix/auto-ticket-base-sync

Conversation

@devondragon

Copy link
Copy Markdown
Owner

Fixes two /ccmagic:auto-ticket failures seen on 2026-11-21 when Reeve dispatched cclens tickets to Cyrus, which reuses a ticket's existing worktree.

  • CCL-20: the checkout predated the commit that added .claude/ccmagic.local.md with merge_owner: reeve, so the run used merge_owner: self, tried gh pr merge, and parked on the hook's refusal although the PR was clean.
  • CCL-39: the branch was 2 commits behind main and the PR conflicted with it. The run parked at the CI wait, and every entry in the run record's steps said done, so Reeve could not tell it was a merge conflict.

Changes

  • bin/ccm-base-sync (new): sync merges origin/{base} into the branch when its history lacks it (merge only, never rebase or force push; fast-forward only on the base branch itself) and aborts a conflicting merge so the tree is unchanged. begin leaves a conflicting merge in progress for a fix pass. conclude commits it after checking MERGE_HEAD matches, no conflict marker lines remain, and no untracked file was added. Also push (never forced) and abort.
  • bin/ccm-lib.sh: with no project config in the checkout, config is read from the base ref's copy (local refs only). This covers ccm-context, the PreToolUse merge guard, and every script that reads config.
  • bin/ccm-context: --config-ref REF and a project_config output key. The base branch is now resolved before config.
  • skills/auto-ticket/SKILL.md: Step 0 item 0 runs the sync before ccm-context. A new Step 0b handles a conflict at the start of the run. Step 4c's conflicting now merges the base once (with one conflict fix pass, a validate, and a push when the merge conflicts), waits for CI again, and the moved head gets the 4f re-review. A park the orchestrator decides adds a step entry to the record.
  • skills/auto-ticket/base-sync.md (new): the conflict procedures and the run record entries.
  • skills/auto-ticket/autonomous-contract.md: fix_source: conflict, a §4 table of step names for orchestrator-decided parks (ci-wait for the CI wait), updated parked-record examples, and a new invariant.
  • skills/work-ticket/base-conflict.md (new), plus pointers in skills/work-ticket/SKILL.md and agents/auto-work.md: the conflict fix pass rules.
  • bin/ccm-finish-guard: comment only. base-sync entries match no rule. A conflict fix pass is a work-ticket entry, so a validate is still required after it.
  • Tests in tests/run.sh cover ccm-base-sync, the config fallback, the guard reading the base's merge_owner, finish-guard entries, and the skill wiring. tests/every-ticket-since-baseline.diff is regenerated.
  • docs/cyrus-deployment.md grants Bash(ccm-base-sync *). README and CHANGELOG are updated, and the version is now 3.30.0.

Verification

bash tests/run.sh: 531 passed, 0 failed locally. The openspec-CLI tests were skipped because the CLI is not installed locally (CI installs it). shellcheck -x passes on every file CI checks.

For review

  • At the start of a run, a conflicting merge is aborted, config is read from origin/{base}, and then one conflict fix pass runs before the work step (Step 0b). If that pass fails, the merge is aborted and the run parks.
  • A clean merge of the base at the CI wait gets no local validate before its push. It is covered by CI on the merged head and the 4f re-review.
  • The scripted merge commit goes through the orchestrator's script, not the push step. The push step's grouped commits cannot commit a merge in progress.

…ct at the CI wait, and name the parking step in the run record (3.30.0)
… base branch's copy; one base-branch resolver
…over merge and stops on a foreign one, --push pushes an unpushed merge, binary conflicts stay unresolved until changed
…ver a merge in progress, push a Step 0 merge, validate after every base merge, base-only merge keys
@devondragon
devondragon merged commit 48ba56d into main Nov 21, 2026
2 checks passed
@devondragon
devondragon deleted the fix/auto-ticket-base-sync branch November 21, 2026 05:41
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