gunk-dev/the-valley
the-valley:oc-926bd5foutcomedone

valley pending shows which ready changes conflict with each other

State
done
Created
2026-10-21 by contributor
Changes
  • valley:the-valley/qnqtqmnmusqkvkmwynnlxsvpyounylks

Body

On 2026-10-21 nine ready the-valley changes waited for approval. Ten pairs of them conflicted textually: in `bin/valley`, `docs/architecture.md`, `docs/reference.md`, `nix/` and `status/go.mod`. qxkp alone conflicted with five others. The operator couldn't see this, so the approval order was a guess. The coordinator worked it out by hand with `git merge-tree`: approve a set that doesn't conflict, rebase the rest once, and approve the hub last. That ordering needs four rebases, the fewest possible.

The valley does the mechanics: `valley pending` (and its JSON) marks each ready change's conflicts with the other ready changes, using the same merge the integrator would make.

Clients judge: the klaus dashboard, or another control panel, suggests an approval order from those conflicts. The restacker (oc-fb88d3a) makes most of this automatic once it runs. It rebases after each landing, and only real conflicts need an agent (oc-0a2e64c). The conflict marks still tell the operator which approvals will cost a rebase.

Done when `valley pending` shows each ready change's conflicts with the other ready changes, and the JSON carries them.

Comments

  1. contributor2026-11-13 21:06 UTC
    Critique of the plan (second model family), taken into the build brief:
    
    The merge base is the main correctness problem. The integrator squashes onto main, then merges the next head against that landing’s ancestry ([integrator/refs.go:408](integrator/refs.go:408)). Even freshly restacked sibling heads can share an unlanded ancestor, so mergeBase(A,B) need not be the integrator’s base. For example, that ancestor changes x from 0 to 1, A restores 0, and B changes it to 2: the proposed comparison conflicts, whereas B after A’s squash can merge cleanly. Running both directions does not fix the wrong base.
    
    The candidate definition also contradicts the queue. Moving includes unapproved failed and restack-blocked changes, and only waiting changes are collapsed into stacks ([status/queue.go:43](status/queue.go:43)). Build candidates from pendingChange, which excludes changes landed as any version, and preserve independently landing approved layers when grouping.
    
    Represent incomplete analysis explicitly in text and JSON; stderr alone makes “uncomputed” indistinguishable from “clean.” Bound the automatic work and report incompleteness: restacking every head invalidates every pair, making quadratic cold cost recur. Also, the existing cache reads at most 4 KiB, which arbitrary conflict-path lists can exceed ([rebase/cache.go:52](rebase/cache.go:52)).
    
    The single biggest improvement is to anchor the first version to captured main T: require T to be an ancestor of both heads, use carry(cg,T,A,B), and report other pairs as awaiting restack; include T in the cache key and verify the forked-stack case against the landing behavior.
  2. contributor2026-11-13 21:42 UTC
    Built at d6b1dc4, reviewed and marked ready. The forked case was checked against the integrator's merge in a test: both landing orders are clean, and no conflict is marked. On real projects with no ready change, text and JSON are byte-identical to main's build. Measured by the build on a scratch project with five ready changes: 43 processes warm (as on main), 55 cold with 10 merges; 67 ms warm, 81 ms cold. One thing to expect: right after any landing every ready change is off main's tip until the restacker has rebased it, so for that moment every pair reads "awaiting restack".
  3. contributor2026-11-13 21:49 UTC
    Change valley:the-valley/qnqtqmnmusqkvkmwynnlxsvpyounylks landed: v1 as f371ed059ef8ef1ac352ed3155cc67342ccc192f.
    
    Every change the knot links has landed and it has no active children, so klaus set it done.