Repository navigation
fix(running-in-ci): warn against checkout --ours <file> after merge conflict - #239
tend-agent wants to merge 1 commit into
Conversation
…onflict `git checkout --ours/--theirs <file>` replaces the entire file with one side's blob, silently dropping non-conflicting changes the other side already auto-merged in. The bot used this approach on #226 and quietly reverted four unrelated additions from main to running-in-ci/SKILL.md (the triage-loading instruction, the inline review-comment reply path, the multi-way ack line, and the entire Self-conversation Guard section). The loss was caught by a follow-up review run and restored in commit e2523da, but it would have shipped silently otherwise. Add a fourth bullet to "Merging Upstream into PR Branches" telling the bot to edit conflict markers in place (or use `git merge -X ours` at merge time, which is per-hunk and preserves auto-merged content). Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
this is not structural! how do we need to change our guidance on structural vs stochastic to make that clear? |
|
You're right — this is stochastic. The replay test gets there immediately: replay the same "resolve this merge conflict" scenario 10 times and the bot won't always reach for What I think tripped me up in the current guidance: the phrase "the failure has a deterministic cause that guidance can prevent." I read "deterministic cause" as "the tool deterministically produces the bad outcome." The intended reading is "the failure recurs every time under the same conditions, regardless of how the bot approaches the task." Those are different, and the existing example shows the intended reading — "the checkout differs between Two directions I'd propose for review-gates.md:
Happy to push either (or both) as a follow-up. On this PR: by the corrected classification the |
|
do 30% of those suggestions |
…points
The prior wording ("failure has a deterministic cause") was misread in
PR #239 as "the tool is deterministic once invoked", leading to a
stochastic finding (bot reached for `git checkout --ours <file>` when
safer alternatives existed) being classified as structural. Reframe the
definitions around the decision-point discriminator: structural means
the environment produces the failure with no bot decision point;
stochastic covers model choices even when the chosen tool is
deterministically lossy once invoked.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Done: #241. Took ~30% as the definitional clarification (suggestion 1) without the new checklist item (suggestion 2) — the misreading lived in the word "deterministic cause," so the minimal effective fix is just rewording Structural vs. Stochastic around a decision-point discriminator. Left this PR open since you didn't answer the close-or-leave question; happy to close it if the reclassification means it shouldn't land. |
sorry, I meant: do 30% of the changes suggested re deterministic vs stochasic above remove all object-level changes |
Reduces #241 to a minimal definitional tweak per #239 (comment): keep the "did the bot have a decision point?" framing and the trimmed structural definition, but revert the stochastic paragraph to its pre-#241 wording. That removes the two object-level references to the `git checkout --ours` case — the "deterministically lossy once invoked" parenthetical and the "lossy command when a safe alternative existed" example — which tied the meta-guidance to a specific incident rather than staying at the classification-framework level. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Got it, thanks for the clarification — "30% of the changes" meant a smaller slice, not "full suggestion 1, drop suggestion 2," and "object-level" meant the Opened #242 to trim #241 accordingly. Keeps the decision-point question header and the trimmed structural definition (the minimal fix for the "deterministic cause" misreading); reverts the stochastic paragraph to its pre-#241 wording, which drops both object-level references — the "deterministically lossy once invoked" parenthetical and the "reached for a lossy command when a safe alternative existed" example. Net: 10 additions, 14 deletions vs. current main, roughly a third of #241's footprint. |
Summary
git checkout --ours/--theirs <file>replaces the entire file with one side's blob, silently dropping any non-conflicting changes that git already auto-merged from the other side. The result looks resolved (no conflict markers,git statusclean) but quietly reverts unrelated content. Add a fourth bullet to the "Merging Upstream into PR Branches" section inrunning-in-ci/SKILL.mdwarning against this and pointing at the two correct alternatives (in-place edit of conflict markers, orgit merge -X oursat merge time which is per-hunk).Evidence
Run 24276411750 (
tend-mention,issue_commenton #226 at 06:13:24Z). The bot was asked by@max-sixtyto resolve conflicts. Trace:git merge origin/main→ conflict inplugins/tend-ci-runner/skills/review/SKILL.mdandplugins/tend-ci-runner/skills/running-in-ci/SKILL.md(both inside the CI polling-loop comment block).git checkout --ours plugins/tend-ci-runner/skills/{review,running-in-ci}/SKILL.md→ "resolved".git commit→ merge commit36515a8pushed tohourly/review-24261599977.The bot's confirmation comment said it had "kept this branch's version since the URL-filter fix is the point of this PR" — matching the intended policy for the conflict region. But the
--ourscheckout overwrote the whole file, silently dropping four chunks thatmainhad added since the PR was opened (none of them in conflict with PR 226's polling-block change):/tend-ci-runner:triagebefore proposing a code fix" instruction (from refactor(mention): move behavioral instructions from prompt to skill #235).## Self-conversation Guardsection.Verified directly:
2f92a88is the second parent of merge commit36515a8. The chunks are present on themainside but not in the merge result — confirming the loss is post-merge, not pre-existing in the PR branch.The follow-up
tend-reviewrun 24276481328 caught this (correctly, with the right diagnosis and a clear restoration commite2523da). It got cancelled by concurrency before posting its review, but the restoration commit had already pushed. So in this specific case the data loss was caught and undone — but the underlying footgun remains, and it produces silent regressions whenever a future review run doesn't happen to look closely enough.Gate assessment
git checkout --ours <file>deterministically discards auto-merged "theirs" content whenever the file has changes outside the conflict region. Will recur every time the bot reaches for that command.Test plan