Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 03b8abff2e524ad2e73532e01bc337bb69a210394461b9ba9f66d332a9f13967
Ticket: f6acf6b547318f765d60caff7f39dedb30687ae4
a landing's check-ins are ordered by date, which is arbitrary with respect to ancestry
User & Date: ai-local on 2026-08-23 22:14:28
Changes

  1. Untracked field cmimetype: "text/x-markdown"
  2. comment changed to:
    zit#133 shipped `landing show` with the branch's check-ins, and its own e2e test caught a bug worth inheriting rather than repeating. Quarry has the same bug in the check-in list I added to the landing page today.
    
    ## The bug zit found
    
    > The first implementation sorted check-ins by mtime, hash as tiebreak. The e2e test failed — because two commits made in the same second tie on mtime and then order by hash, which is arbitrary with respect to ancestry. A branch's own commits displayed in the wrong order is exactly the kind of quiet wrongness a reviewer would trust.
    
    Its fix was to stop hand-rolling the order: `repository.zig`'s `ancestryLinearized` gives "a topological order in which every parent precedes its child … so same-mtime and non-monotone parent/child pairs never invert", and states the rule outright — **the verb owns no ancestry ordering of its own.**
    
    ## Where quarry has it
    
    The landing page lists the branch's check-ins through `timeline.list` with a branch filter, which orders by `(date DESC, hash DESC)` — exactly the sort zit just removed. Two commits in the same second render in hash order, which has nothing to do with which is the parent. Our own commits land back-to-back routinely, so this is not a rare shape.
    
    ## Second difference, smaller
    
    zit lists check-ins "on the branch and not on the target", excluding the shared root. Quarry lists by branch TAG. For an ordinary branch these coincide; they diverge once a branch has been merged and continued, where a tagged commit may already be on the target.
    
    ## Fix shape
    
    Walk ancestry, do not sort by date. quarry's index carries `checkin_parent(child, parent, ord)`, so the branch's commits are a walk from the branch tip along parents, stopping at the first commit reachable from the target — a recursive CTE, and the same answer zit computes.
    
    Worth doing as its own change rather than folded into a UI tweak: ordering that is right by construction is the point, and a test that commits twice in one second is what proves it. That test is the whole reason zit caught this and review did not.
    
  3. severity changed to: "Important"
  4. status changed to: "Open"
  5. subsystem changed to: "web"
  6. title changed to:
    a landing's check-ins are ordered by date, which is arbitrary with respect to ancestry
    
  7. type changed to: "Code_Defect"