I2863 — A derive does not run while a merge is uncommitted
scripts/derive refuses to run while the worktree holds an uncommitted merge (MERGE_HEAD present), and names the commit to make first, so no derived file is computed from the history of a HEAD the commit is about to leave.
READY wave 0 · p1 · implementation profile · parallel safe
Part of derived-data-integrity — A committed derivation describes something it can be a projection of.
Ready. Every dependency is done, so majordomus plan start I2863 will be accepted.
Objective
scripts/derive refuses to run while the worktree holds an uncommitted merge (MERGE_HEAD present), and names the commit to make first, so no derived file is computed from the history of a HEAD the commit is about to leave.
Why
On 2026-10-21, #1753 (I2845) merged master 573df967bb5 and was derived before the merge was committed. Several derived values read history from HEAD. The released_in rule (lib/project.sh mj_pj_m_released_in, and released_in in apps/majordomus-cli/src/plan.rs) runs `git log -S <completed_at>` and `git log --merges --grep`. HEAD was still the branch's old base 05e17a5c4a8, so idd-workspace's completion commit c2b6d98cd8c was outside it, and the fallback matched an older merge. The milestone was committed as released in v0.30.0, where master and CI compute unreleased. CI's site job reported roadmap.json and roadmap-graph.json STALE, and its fail-fast cancelled the other eight jobs of validate run 39534292871 after 40 minutes. The same trap is recorded from an earlier session, so a habit does not prevent it; the tool must.
Current state
scripts/derive runs with MERGE_HEAD present and writes derived data computed from the pre-merge HEAD's history. The pre-commit gate then accepts that data, because it compares it with a derive run in the same state.
Desired state
scripts/derive exits non-zero before any stage when the git directory holds MERGE_HEAD (also CHERRY_PICK_HEAD or REVERT_HEAD), saying to commit the merge and derive again. The message names that HEAD and the commit it would merge.
Scope
- scripts/derive
- .ai/repo/project/issues/I2863.yaml
Out of scope
- Making the released_in rule independent of HEAD's history; it reads the commit, which is correct once the commit exists
- Refusing a derive during a rebase, which has no such ambiguity once each commit is applied
Dependencies
None. This issue is a root of the graph.
Acceptance criteria
- scripts/derive in a worktree with MERGE_HEAD present exits non-zero before stage A and names MERGE_HEAD
- The same derive after the merge is committed runs as before
Validation
- bin/majordomus plan validate
Evidence required
- a_derive_refuses_mid_merge_case
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Timeline
- started
- —
- verified
- —
- completed
- —
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I2863.yaml. Read it back with majordomus plan show I2863.