Skip to content

post-fix: re-validate or disclose when the target branch advanced during the run and touched files the fix changed #1935

Open

Description

@fullsend-ai-retro

What happened

On PR #55:

  1. The fix agent (run 42790585191, agents@87a43fcb8495) started at 09:25 against main cacc0b3.
  2. It pinned @types/node to 20.11.25 because the project's TypeScript was 4.6.3. It validated that with tsc, tests, lint and build.
  3. While it ran, main advanced twice. The second advance was 88038f5 (fix(scripts): pre-commit tool auto-install silently skipped on runner #57, TypeScript 4.6.3 → 7.0.2), which changed package.json and package-lock.json, the same files the fix edited.
  4. At push time, post-fix.sh fetched and logged cacc0b3..88038f5 main -> origin/main, then logged Forge mergeability: state=MERGEABLE conflict=false.
  5. It skipped any update and pushed. The fix comment said 'tsc, tests, lint, and build pass' and recorded the conflict update as skipped.
  6. The agent itself never fetched or compared origin/main, although git branch -a already listed the pending dependabot/npm_and_yarn/typescript-7.0.2 branch.
  7. Ten minutes later, the next review (run 42791384665, $3.47) requested changes because the pin's rationale no longer held on main.
  8. The owner then fixed the PR by hand.

What could go better

agents#1518 deliberately limited target-branch reconciliation to forge-reported CONFLICTING states. That is sound for avoiding noisy rebases, but it means a clean push can carry validation results that no longer describe what would merge.

Here the result was:

  • one wasted fix iteration ($0.70),
  • one review run spent rediscovering the drift ($3.47),
  • manual human rework.

I am confident about the mechanism, which is visible in the logs. I am less sure how often it happens. It needs concurrent merges that touch the same files during a roughly 5-minute fix window. On this repo, though, Dependabot bursts make that common: 4 major bumps were merged within minutes on the same day (per the retro on #57).

The cheapest useful version is disclosure. Full re-validation is better, but it costs more runtime.

Proposed change

In post-fix.sh (and its GitLab counterpart), after the existing fetch of the target branch:

  1. Compute git diff --name-only <pre-agent merge-base>..origin/<target>.
  2. Intersect it with the files the agent changed (PRE_AGENT_HEAD..HEAD).
  3. If the intersection is non-empty, or includes dependency manifests and lockfiles even when the files differ:
    • Preferred: merge the target into the branch using the existing FIX_CONFLICT_UPDATE_STRATEGY machinery, and re-run the harness's test/validation command before pushing.
    • Minimum: append a line to the fix summary comment and the result JSON naming the stale base, the new target SHA, and the overlapping files, for example: 'validated against cacc0b3; target advanced to 88038f5 with changes to package.json, package-lock.json — re-validation needed'.
  4. Separately, add a step to the fix agent definition or skill: when a fix's rationale rests on another dependency's version, check remote branches and open PRs for pending changes to that dependency, and mention them in the decision points.

Cross-link agents#1934, which covers the PR head moving mid-run (where this proposal covers the base moving), and agents#1163.

Validation criteria

  • Replay the fix(docs-review): check related docs by name and directory, not just identifier grep #55 scenario: the target branch advances during a fix run with changes to the same manifest.
  • With the change, the fix comment either shows re-validated results on the merged tree, or carries the explicit stale-base warning naming the overlapping files.
  • Over the next 10 fix runs where the target advanced mid-run, no review requests changes solely because the fix rested on a pre-merge base.

Related issues checked

Searched: post-fix target branch advanced behind main revalidate repo:fullsend-ai/agents; stale base semantic conflict mergeable BEHIND fix agent across fullsend-ai/fullsend, fullsend-ai/agents, shairevivo/react-shopping-cart; FIX_CONFLICT_UPDATE_STRATEGY CONFLICTING only 1518
Considered: #1518, #1934, #1797, #1163, #765, #235, #409, #1666, fullsend-ai/fullsend#1653
#1518 (closed/completed) added conflict reconciliation and intentionally excluded stale or BEHIND branches; this proposal refines it for the case where the drift overlaps files the fix changed. #1934 covers the PR head being force-pushed mid-run, not the target advancing cleanly. #1797 covers preserving history on a concurrent PR-branch advance. #1163 re-checks the PR head, not the base. #765 covers CI after a rebase, which only applies when a rebase happens. #235 and fullsend#1653 are about the review side. #409 covers fetching before the force-with-lease retry. #1666 covers semantic overlap on the CONFLICTING path only.


Generated by retro agent from fullsend-ai/react-shopping-cart#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions