Skip to content

chore: review workflow supports merge conflicts — Phase A0 before CI failures - #60

Merged
mhenrixon merged 2 commits into
mainfrom
chore/review-pr-merge-conflicts
Jul 10, 2026
Merged

chore: review workflow supports merge conflicts — Phase A0 before CI failures#60
mhenrixon merged 2 commits into
mainfrom
chore/review-pr-merge-conflicts

Conversation

@mhenrixon

Copy link
Copy Markdown
Collaborator

Summary

Backport of zoolutions/phlex-reactive#220.

Adds a Phase A0: merge conflicts phase to /github-review-pr that runs BEFORE the CI-failures phase, so CI is diagnosed against the post-merge reality instead of a stale base:

  • Detection: gh pr view --json mergeable,mergeStateStatus,baseRefName; on UNKNOWN, a local fallback that tests the PR's ACTUAL head (git fetch origin pull/<PR>/head + FETCH_HEAD, ref verification via git rev-parse --verify before trusting exit codes, git merge-tree --write-tree --name-only output as the work list).
  • Resolution runbook: gh pr checkout on a clean tree, MERGE never rebase (shared branch — no force-push), semantic per-file rules, verification gates before pushing, plain git push.
  • Loop-back rules: a new conflict mid-pass (base moved) loops back to A0; Phase C re-checks mergeability before reporting and reports a Phase A0 summary + end-state mergeability.
  • /github-review-failures gains a detection-only pre-flight: on CONFLICTING it stops and hands off to the orchestrator (its toolset deliberately excludes the merge machinery); on UNKNOWN it proceeds.
  • allowed-tools frontmatter in the orchestrator now covers every command the new text instructs (gh pr checkout, git status/switch/fetch/merge/merge-tree/rev-parse, bundle install, bun, cd).

Repo-specific adaptations (verified against this repo, not copied from phlex-reactive)

  • lib/docs_kit/version.rb: rake release[X.Y.Z] commits the bump directly on main (the task aborts off-main), so the "a version conflict means the branch bumped on purpose" rule holds here verbatim.
  • Lockfiles: the gem root's Gemfile.lock is gitignored (can never conflict); docs/Gemfile.lock IS tracked (deployable dogfood app) → take base + bundle install in docs/. docs/bun.lock is tracked too (CI runs bun install --frozen-lockfile) → take base + bun install.
  • No generated-artifact rules: docs-kit tracks no minified/build outputs (docs/app/assets/builds/* and tailwind.sources.css are gitignored), so phlex-reactive's min.js/vendored-twin rules were dropped. The vendored Lucide SVGs under docs/app/assets/svg/icons/** got a take-one-side-wholesale rule instead.
  • Append-only registries: docs/app/models/doc.rb's page lines and docs/config/routes.rb.
  • Verification gates match CI: bundle exec rake (the rake (Ruby 3.x) job) for gem files; cd docs && bundle exec rspec (the docs site job) plus docs' own rubocop (with explicit files — the gem's rubocop deliberately excludes docs/) for docs files.
  • Kept the failures command's existing check-type table, model pins (opus/sonnet), and repo-specific notes intact.

Backport of zoolutions/phlex-reactive#220.

mhenrixon added 2 commits July 9, 2026 10:47
…failures

Backport of zoolutions/phlex-reactive#220, adapted to docs-kit:

- /github-review-pr gains Phase A0 (merge-conflict detection via
  gh pr view --json mergeable, with a local git merge-tree fallback
  against the PR's actual head), a semantic resolution runbook with
  docs-kit-specific per-file rules (CHANGELOG Unreleased union,
  lib/docs_kit/version.rb release-on-main semantics, tracked
  docs/Gemfile.lock + docs/bun.lock regeneration, vendored Lucide
  SVGs, append-only doc.rb/routes registries), verification gates
  matching what CI actually runs, Phase C report additions, and
  loop-back rules.
- /github-review-failures gains a detection-only pre-flight that
  stops on CONFLICTING and hands off to the orchestrator.
@mhenrixon
mhenrixon merged commit 2f61298 into main Jul 10, 2026
5 checks passed
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