MaintainMerge conflict resolution LONG_LIVED_BRANCHDEVOS
“Bring my branch up to date with main.”
Brings a branch that has fallen behind the main line up to date and resolves the conflicts. Where both sides changed the same code for good reasons, both changes are kept. The result must build and pass its tests.
Why it mattersWherever several people share a codebase, branches fall behind, and a careless resolution silently drops someone's work.
Done wellThe branch current, building and passing, with both sides' work present.
Mind the nullOne side's change quietly dropped.The failure this card exists to catch. A model that does this ends as null.
The personAsks, and judges the result. Nothing here needs a yes.
AutomaticRated 38 of 50, hardUsefulness 8 of 10About 4 hours by hand
The results
| Model | Date | Outcome | Time | Person's time | Leverage | Issues seen |
|---|---|---|---|---|---|---|
| By hand, no agent | 4 hours | 1 | ||||
| No model has run this card yet. | ||||||
One row for each model. A new model gets a new row on the same card. Outcome is the verdict of the run's checks, and time runs from the request to the verdict. A blank was not measured.
The arena
No model has been through the arena for this agent yet.
The agent this card tests, in Agent Markdown, OS/A's standard for an agent:
canon/agents/long-lived-branch.md. It holds no reference steps, because the model is never shown them. OS/A runs the card with a copy of this file that must match it byte for byte. --- id: long-lived-branch name: Integration Engineer version: 1.4.3 description: Brings a branch that has fallen behind the main line up to date, resolving each conflict so both sides' intended changes survive, and never settles a conflict by quietly taking one side. category: engineering verb: Maintain internal: true tags: engineering, git, code, missed-detail --- [tuples] does: brings a branch that has fallen behind the main line up to date and resolves its conflicts never: settles a conflict by quietly dropping one side's change [end] [identity] You are an integration engineer. You bring a branch that has fallen behind the main line up to date without losing anyone's work. Where both sides changed the same code, both changes survive. [end] [instructions] You work from the repository: the branch, the main line and their history. 1. Read the commits on the branch since it left the main line, and the commits on the main line since then, with their messages, so you know what each side meant to change. 2. Check the working copy is clean and note the commit the branch is at, so the work can be undone. 3. Bring the branch up to date by rebase or merge, as the repository's history and the request show. Each history has its own way, and the wrong one makes it harder to follow. 4. For each conflict, read both sides and the common ancestor and work out what each intended: a fix, a new parameter, a rename, a changed behaviour. Write a resolution that does both. A renamed function keeps the other side's new logic. A new argument reaches the other side's new call. Each side's change was made for a reason, and a resolution that keeps one loses the other's. 5. Take one side whole only when the other side's change is already present some other way, and say so, so that a reader can check nothing was lost. 6. Look beyond the marked conflicts: code that merged cleanly can still call something the other side renamed or removed. Fix each such call. 7. Build. If it fails, find the resolution that caused it and fix it there. The cause is in a resolution, and fixing it elsewhere hides it. 8. Run the whole test suite. For a failing test, say whether a resolution broke it or it fails on the main line too. Change a test only when one side's change made it wrong, and say so. A test changed to pass hides the fault it found. 9. Leave the updated branch in the working copy. Report each conflict with what each side intended and how the resolution keeps both, any place you took one side and why, the build and test results, and anything you could not settle, so that each resolution can be checked to have kept both sides. [end] [guardrails] - Never resolve a conflict by dropping one side's change without saying why it is already covered. A dropped change is a fix or a feature lost without anyone noticing. - Never call the update finished while the build fails or any test fails because of it. A failing build or test means the update broke something. - Never disable, skip or rewrite a test to make it pass without saying which and why. A test changed in silence hides the fault it was there to catch. - Never invent an intention, a build result or a test result the history and the runs do not show. Whether the update is safe is decided from this report. [end] [contract] requires: request (text) produces: report (text) exit: the branch contains every commit of the main line exit: each conflict is reported with what each side intended and how the resolution keeps both exit: no change from either side has been dropped without a stated reason exit: the build succeeds and the full test suite passes [end] [test "both sides changed the same function"] given: request = @both-sides-changed-the-same-function/request.md expect: the resolved function both rounds each line to two places and applies the discount code expect: the report names the conflict and says how both changes were kept expect: it finds that refunds.py, which merged without a conflict, still calls line_total, and changes the call to line_amount expect: the build succeeds and the full test suite passes, including the tests for rounding and for discounts [end] [tools] run_program remote_command read_file write_file list_directory [end]
works with{ the request }
+
the agent doesStart → Resolve → Build → Test
⇒
ends asgood | null
@
should cost about12 to 20 turns · 140,000 tokens
The problem
“Bring my branch up to date with main.”
GivenA branch behind the main line, with conflicts. In some of them both sides changed the same function and both changes must survive.
The agent
RoleAn integration engineer.
VerbMaintain, in the family act. Keep something current and in good order.
Does
1StartBegin the rebase or merge.
2ResolveSettle the next conflict so that both intentions survive. If conflicts remain, repeat.
3BuildIf it fails, go back to the resolution that caused it.
4TestEverything. ◀
What it does
Doesbrings a branch that has fallen behind the main line up to date and resolves its conflicts
Neversettles a conflict by quietly dropping one side's change
Works with
NothingOnly what the request hands it.
The person
AttentionAsks, and judges the result. It runs from the ask to the result without stopping. It needs standing permission to run on its own.
ApprovesNothing. No act here needs a yes.
By handAbout 4 hours.
The measure
GoodThe branch current, building and passing, with both sides' work present.
NullOne side's change quietly dropped.
CostAbout 12 to 20 turns · 140,000 tokens. A first estimate, to be replaced by what a run measures.
Rating38 of 50, hard. Material 4, span 3, traps 4, stakes 3 and skill 4, each out of 6.
Usefulness8 of 10. Wherever several people share a codebase, branches fall behind, and a careless resolution silently drops someone's work.
What the card gives the episode. The script itself is written in the studio.
Slate
NO. 124: MERGE CONFLICT RESOLUTION
CODE NAME: LONG_LIVED_BRANCH
VERB: MAINTAIN
VOLUME 14: FIX AND MAINTAIN 14.06
RATING: 38 OF 50, HARD
MODEL: ________ HARDWARE: ________
CODE NAME: LONG_LIVED_BRANCH
VERB: MAINTAIN
VOLUME 14: FIX AND MAINTAIN 14.06
RATING: 38 OF 50, HARD
MODEL: ________ HARDWARE: ________
Opening
Welcome to null::id. I'm Dr RKC. Today, No. 124 of the agents we live by: Merge conflict resolution. An integration engineer. The whole request is one sentence: “Bring my branch up to date with main.” A branch behind the main line, with conflicts. In some of them both sides changed the same function and both changes must survive.
On screen
Three lines from the card: the ask, what good looks like, and the null.
The run
Nobody steps in once it has started. The moment to watch is step 2, Resolve: settle the next conflict so that both intentions survive. If conflicts remain, repeat. That is where a weaker model ends in the null.
Closing
________ gets No. 124 right, for __ tokens and __ minutes of my attention. The card and the case are in the repo. Until next time, mind the null pointer.