Skip to content

BUG: Git delivery: post-merge folder mismatch is not a gate on all paths (Codex F6) #449

Closed

Description

@ephico2real2

Part of #286. Found by Codex (another model family) reviewing the Git delivery layer on main b8ee59e (PRs #288, #299), 2026-11-19. Severity per Codex: High.

Location: cmapi/src/cmapi/jobs/merge.py:138–:152; jobs/pr_checks.py:59–:65; delete shortcut jobs/watch_sync.py:78.

The merge job logs a mismatched merge tree before any apply, then queues normal delivery anyway. The pr_checks hand-merge fast path skips the merge-folder read entirely. For creates/updates watch_sync has a later main-folder guard, but that checks current main rather than the actual merge tree; for deletes it reaches awaiting_prune before any such guard. A later main change could otherwise mask that this merge did not fulfill the plan.

Full fix: share _merged with pr_checks, and make a missing/mismatched merge folder become sync_failed in every route, without queueing watch_sync. Keep merge_sha and the lock for operator action. After a merge has happened, sync_failed is more accurate than pretending the merge itself did not happen. Appendix C: jobs/merge.py, jobs/pr_checks.py.

Tests: test_wrong_merge_tree_never_queues_delivery[pr_open] and test_hand_merge_during_pr_checks_uses_postmerge_check: 2 fail main; 2 pass fixed. [applied] is a passing control on both; main already enforces that case.

Evidence: workbench/cmapi/review-288b/codex-report.md (F6) and its regression test in codex-fixes.patch; Codex ran it failing on main and passing with its fix. Reviewer 2 (OB3) checks the fix and runs the PostgreSQL and SSH checks the sandbox could not, before it is applied.

Activity

  1. added
    bug
    status:open
    sev:high
    Backlog
    on Nov 19, 2026
  2. ephico2real2 commented on Nov 19, 2026

    @ephico2real2
    OwnerAuthor

    Fixed by #458 (merged, CI green), from Codex's review of the Git delivery layer with OB3's corrected fix; the coordinator ran its test failing on main and passing with the fix. GitHub closed only the first Closes line of that PR.

  3. added
    Done
    and removed
    Backlog
    on Nov 19, 2026
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

    Donebugsev:highstatus:open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions