Přeskočit na obsah

Tato stránka byla automaticky přeložena z angličtiny, jediného jazyka, ve kterém se tento web píše. Číst originál.

Bring a branch current by the cheapest safe strategy

Decide, from the integration engine's own assessment, whether a branch needs nothing, master merged in, a repair by its owner, a fresh branch from master or to wait, and carry out only that, with every rewrite preceded by a rescue ref and every push a fast-forward.

majordomus://skill/rebaser aktivní verze 1integracemergerepairrescueworktrees

pracovník potřebuje

  • one branch or pull request, a train, or the whole open queue, named by number or branch
  • the last recorded forge observation (`majordomus prs refresh` makes a new one)
  • a checkout with git history, the peer board and the derived-merge driver configured

zanechá postup

  • for each candidate, the strategy chosen, the disposition and relation it was chosen from, and the command that carried it out or the reason it was left
  • a rescue ref for any head that was rewritten, proven on the remote before the rewrite
  • the head pushed, the run of the required check it started, and the queue read again afterwards

Účel

A branch falls behind master many times a day here, and most of the time the only conflict is over merge=derived files that a regeneration settles. The expensive mistakes are the opposite ones: rewriting a branch that did not need it, which throws away the verdict CI spent four hours on, or "resolving" an authored conflict by taking one side.

So this skill never starts from "rebase". It starts from what the integration engine (majordomus prs, ADR 0101, docs/INTEGRATION.md) has already decided about the branch, picks the strategy that disposition allows and that costs least, and does nothing else. The strategy is a consequence of the evidence; the skill is named for the job, not for the git command.

It is not a lander: it never moves master (that is integrator, under the landing seat), and it never decides a semantic conflict.

Kdy použít

  • A pull request reads needs_refresh, conflicting or needs_repair in prs status.
  • Before handing a head to the landing seat, to know it contains master.
  • A train link turned behind after a lower link landed.
  • A branch's own checkout is stale against master and you are about to continue work in it.

Not this skill: landing (integrator); closing what is already on master (prs cleanup, or assess-before-deleting for local refs and worktrees).

Postup

1. Read the assessment, do not compute it

majordomus prs refresh            # the one read that reaches the network
majordomus prs explain <n>        # disposition, relation to master, evidence, rank
majordomus prs trains             # when <n> is a link of a stack

An observation older than the last landing is not evidence about the current master: refresh first. The disposition and the relation are the inputs of step 2; never re-derive them by hand with git rebase dry runs.

2. Choose the strategy from the assessment

Posouzení říkáStrategyAct
relation up_to_date or carries_master; ready; waiting_for_checksnicnone — a head that contains master keeps its verdict
redundant, superseded, relation contained, patch_ids_upstreamnothing herecleanup's lane: majordomus prs cleanup lists it, --apply closes it
needs_refresh, relation behind (conflicts, if any, only on merge=derived paths)merge master inmajordomus prs repair <n> reads; majordomus prs repair <n> --apply acts, or let prs drain --refresh take the queue's first
conflicting (an authored path conflicts)repair by the ownerthe owner merges master into its own branch in its canonical worktree, resolves each authored file with evidence (tests of both sides' intent), derives, commits with hooks, pushes a fast-forward
waiting_for_dependency, other_base, link above an unlanded linkwaitland the lower link first; a stacked head is refreshed only after its base lands
blocked, draft, unsafe, waiting_for_review, unknownwaitthe table's own next step in docs/INTEGRATION.md (a label, a review, prs refresh)
unpublished local commits only (no remote ref, no pull request)rebase allowedgit rebase origin/master in the branch's own worktree — nothing anyone else holds is rewritten
a published branch whose history must change (a member's fix that cannot be merged, a split)fresh branch from masterrescue ref first (step 4), then a new branch from origin/master carrying the commits, and a new pull request that declares it supersedes the old one

Two rules decide every row:

  • A published branch is never rewritten in place. Bringing master in is a merge commit pushed as a fast-forward (project.land-and-publish, never force-push); a forced push is not a strategy here.
  • A head that already contains master is never touched. Every new commit starts the required check again (about four hours at the 2026-11-01 median), so a needless refresh costs more than any conflict it avoids.

3. Respect who owns the branch

Read the peer board before acting on a branch you did not create (majordomus mesh peers --full, scripts/collision-check --new <paths>). A branch another session claims is theirs to merge into; tell them the strategy instead. The landing seat merges master only into train tops and repair lanes it holds (project.the-cooperation-model-is-the-owners-word). Work in the branch's canonical worktree (majordomus worktree, docs/WORKTREES.md), or in a scratch worktree as prs repair --apply does — never in somebody else's checkout.

4. Before any rewrite, a rescue ref you have proven

git branch rescue/<branch>-<yyyymmdd> <old head>
git push origin refs/heads/rescue/<branch>-<yyyymmdd>
git ls-remote origin refs/heads/rescue/<branch>-<yyyymmdd>   # must print the old head

The convention for a stale checkout brought current is refs/rescue/ (see project.worktree-topology); either way, the ref is proven on the remote in the same step that is about to rewrite, as assess-before-deleting requires.

5. Act, then read the queue again

After a push, the head has a new required-check run and every assessment above it is stale. majordomus prs refresh and majordomus prs explain <n> again: the expected answer is waiting_for_checks. Anything else is the next round of step 2, not a retry of the same act.

A refresh that has to happen twice for the same pull request because master moved under it is starvation, not bad luck: prs status lists a pull request passed over three times as starving. Bring it to the landing seat as a train member rather than refreshing it a third time.

Výstup

One row per candidate:

pull request / branchdisposition, relationstrategyact and its exitrescue ref (proven)queue afterwards

followed by the heads pushed with their check runs, and every candidate left alone with the reason. Report each row with the states of report-verification-state: a pushed refresh whose check has not reported is PARTIAL, never done.

Příklady

Čte se z examples/ vedle dovednosti; titulek je první nadpis každého souboru.

A link behind master

.ai/repo/skills/rebaser/examples/a-link-behind-master.md

Train 13c landed and every open pull request went CONFLICTING on the forge within minutes. Bring the next train's members current without spending a check run on any head that does not need one: refresh the observation, read each member's disposition and relation, merge master into the needs_refresh ones whose conflicts are only derived files with prs repair <n> --apply, leave the heads that already contain master alone, hand the one conflicting member back to its owner naming its authored files, and wait for the stacked link until its base lands. Report each member with the strategy, the head pushed and the check run it started.

Související dovednosti

Odkud to pochází

kanonický soubor
.ai/repo/skills/rebaser/SKILL.md
hash obsahu
f0aef975a88083e702abab84e51c69a96f262aa48540cd74787196af355b94b9
kontrakt
share/schemas/majordomus/skill/skill.v1.schema.json
dostupné také jako
Zdroj MCP majordomus://skill/rebaser · majordomus skills show rebaser

Tato stránka je vygenerována z výše uvedeného souboru pomocí scripts/generate-site-data; úprava stránky nic nezmění, úprava souboru změní všechny povrchy.

Prohledává názvy a popisy všech stránek, které tento web publikuje.