Artifact f273e97bcbc2d819c0b01e92000a4dc8b87c8a2e593434a9f14c95ac29ed8ddf:
- File
internal/index/tktcheck_test.go
— part of check-in
[9ac012f7f2]
at
2026-08-17 00:57:10
on branch trunk
— tickets: display them the way fossil models them
The page dumped every folded field into one table, which read as noise and lost most of the ticket. Fossil's model has three parts and quarry was collapsing all of them into one:
- Scalar state (status, priority, resolution…) folds last-write-wins. - A leading + is the APPEND form: 'J +comment more' grows the field rather than replacing it. quarry stored a separate field literally named '+comment' — sqlite's tickets use it 255 times. - icomment belongs to the CHANGE, never to the ticket. Folding it left one comment standing where a conversation was: the busiest tcl ticket showed 1 of its 84.
Per-change plumbing (icomment, mimetype, login, username) no longer appears as ticket state. The page now leads with the title, shows fossil's header order, renders the description and every comment through their own recorded mimetype, and attributes each — including fossil's 'claiming to be' when the typed name differs from the login, which on an open tracker it may.
Verified on tcl 408840ff: 11 clean fields, 84 comments, 5 attachments. (user: dmestas, size: 1134) [annotate] [blame] [check-ins using]
package index import ( "os" "testing" ) // A scratch inspector for a real corpus, run by hand: // // QUARRY_TKT_DB=… QUARRY_TKT_ID=… go test ./internal/index -run TicketShape -v func TestTicketShapeAgainstCorpus(t *testing.T) { db, id := os.Getenv("QUARRY_TKT_DB"), os.Getenv("QUARRY_TKT_ID") if db == "" || id == "" { t.Skip("set QUARRY_TKT_DB and QUARRY_TKT_ID") } ix, err := Open(db) if err != nil { t.Fatal(err) } defer ix.Close() tk, ok, err := ix.TicketByPrefix(id) if err != nil || !ok { t.Fatalf("lookup: ok=%v err=%v", ok, err) } t.Logf("id=%.12s created=%s updated=%s", tk.ID, tk.Created, tk.Updated) t.Logf("description: %d bytes, mimetype=%q", len(tk.Description), tk.DescriptionMimetype) t.Logf("scalar fields (%d):", len(tk.Fields)) for _, f := range tk.Fields { v := f.Value if len(v) > 46 { v = v[:46] + "…" } t.Logf(" %-12s %s", f.Name, v) } t.Logf("comments: %d", len(tk.Comments)) for i, c := range tk.Comments { if i >= 3 { break } b := c.Body if len(b) > 46 { b = b[:46] + "…" } t.Logf(" %s by %s (%s): %s", c.Date, c.Login, c.Mimetype, b) } }