Artifact 62b2975064ff76122ae7509b045278ec506ac9d41c42f7ce4ae3d38d525d1075:
- File
internal/web/searchkinds_test.go
— part of check-in
[24fdaa723a]
at
2026-08-25 19:05:45
on branch search-guards
— tests: the regression guards that were never added
Seven test files were written this session, reported as landed, and never committed: `zit commit` with no paths captures TRACKED files, and new files need `zit add` first. make check passed every time because they were on disk in the worktree, which proves nothing about what is in the check-in.
What was missing:
- search kinds, held in agreement across four places (the index list, two ops validators, the scope chips, hitOf). This is the guard that caught `doc` and again `file` the moment each was added; without it the validator silently refused a kind the chips offered. - technote edits collapsing to one timeline row, folded in three different orders, because a clone delivers artifacts in wire order. - wiki and technote search matching the CURRENT revision only, the "terrified" case. - Contributors(0) meaning every contributor rather than a silent 100. - the ops phase states, the stalled-store trap, and an empty fleet.
Verified by removing them and running the suite: it stays green, which is precisely the problem — trunk has been passing on their absence. (user: dmestas, size: 1286) [annotate] [blame] [check-ins using] [more...]
package web import ( "strings" "testing" "craftdesign.group/quarry/internal/index" ) // The set of searchable kinds is written down in four places: the // index's SearchKinds, the ops validator's `oneof`, this package's // scope chips, and hitOf's switch. Adding "doc" to the index left the // validator behind, so the chip existed, the rows existed, the FTS // matched — and every doc search returned nothing, because the op // refused the kind before it reached the query. // // hitOf is covered by TestEverySearchKindLinksSomewhere; this covers // the chips, which are the other half of "a reader can actually reach // this kind". func TestScopeChipsCoverEverySearchKind(t *testing.T) { have := map[string]bool{} for _, s := range searchScopes { have[s.Kind] = true } if !have[""] { t.Error(`searchScopes lost the "everything" chip`) } for _, kind := range index.SearchKinds { if !have[kind] { t.Errorf("index searches %q but no scope chip offers it — "+ "the kind is unreachable from the UI", kind) } } for kind := range have { if kind == "" { continue } if !strings.Contains(strings.Join(index.SearchKinds, ","), kind) { t.Errorf("scope chip %q is not a kind the index files — "+ "it can only ever return nothing", kind) } } }