754f5637634694624fd359811c60513966f3c1a9
braney
  Sat Sep 5 07:58:46 2026 -0700
cartTrackVarCatalog: read a filename as a filename, not as a cart variable.

The harvester looks for a track-scoped name built as safef(buf, size,
"%s.%s", track, SUFFIX).  Code that builds "%s.tmp" from a filename has
exactly that shape, so every such site arrived as a name a person had to
write down in cartVarsNotCataloged.txt as not-a-cart-variable.  There were
15 of them, and they were arriving at a rate of one every few weeks: .tmp
came in on 2026-08-27 with writeMergedHubFile, _ss.ps on 2026-09-04 with
the RNA fold fix.  The docstring predicted the class from the start and
still asked for it to be thrown away by hand.

harvestCartVars.py now answers the question with fileNameLike(), which
asks whether the name's trailing dot-separated component is a file
extension.  FILE_SUFFIXES holds only the extensions the tree builds today
plus tbi beside bai: each entry is a name nobody classifies again, so a
guessed one adds a way to lose a real cart variable and buys nothing.

Two cleverer tests were tried and rejected, and the reasons are in the
docstring: the destination buffer's declaration does not decide it, since
the .bai and .link.bb sites format into a plain buf and buffer while
psName and tmpName are char[PATH_LEN]; and neither does the argument being
formatted, which is a filename at some sites, a url at others and a table
name at a third set.

The records still carry these names, because a harvest that hides what it
saw cannot be checked.  What changed is that --reconcile no longer asks a
person about them, and --update-baseline no longer writes them back.  They
are listed under --reconcile --verbose, and harvestCartVars.py --filenames
prints the rule's claims with their call sites.

Two things guard against the rule going wrong in the direction that would
matter.  --reconcile tests cataloged() before the filename rule, so a name
the catalog describes can never be suppressed by it.  And --check now fails
if any cataloged name would be read as a filename, which is the case where
the two halves of this file disagree about what a name is; verified with a
planted row that it reports rather than passing.

Baseline 70 names to 55.

refs #37838

diff --git src/hg/utils/cartTrackVarCatalog/cartVarsNotCataloged.txt src/hg/utils/cartTrackVarCatalog/cartVarsNotCataloged.txt
index a22f3e1a72e..77bbafa7415 100644
--- src/hg/utils/cartTrackVarCatalog/cartVarsNotCataloged.txt
+++ src/hg/utils/cartTrackVarCatalog/cartVarsNotCataloged.txt
@@ -1,92 +1,83 @@
 # cartVarsNotCataloged.txt - names that harvestCartVars.py finds at a
 # cart*ClosestToHome() or safef("%s.%s") call site but that cartTrackVarCatalog.py
 # does not describe as a track-scoped cart variable.  Refs #37838.
 #
 # Most are not cart variables at all: the scan cannot tell one from a table
-# name, a filename suffix or an SQL fragment, so .bai, _gold and .tbi come out
-# of it too.  Some are cart variables that simply have not been cataloged yet.
+# name or an SQL fragment, so _gold comes out of it too.  Some are cart
+# variables that simply have not been cataloged yet.
+#
+# Filenames are NOT in here.  A "%s.tmp" built from a filename has the same
+# shape as a "%s.heightPer" built from a track name, and 15 names of that kind
+# used to sit below with a new one arriving every few weeks.  The harvester now
+# reads them from the trailing extension instead: harvestCartVars.py
+# --filenames lists what that rule claims and explains it.
 #
 # cartTrackVarCatalog.py --reconcile complains about any harvested name in
 # neither the catalog nor this file, so this is what keeps a nightly run quiet
 # until something actually changes.  Regenerate with --update-baseline, then read
 # the diff before committing: a name appearing here is a decision that it is not
 # a cart variable worth cataloging, and a name disappearing means its call site
 # went away.
 #
 # The first version of this file was accepted wholesale, as a snapshot of the
 # gap on the day reconcile learned to fail.  So a name being in here is not
 # evidence that anybody has looked at it; only the ones added since, which
 # arrive a few at a time in a reviewable diff, carry that weight.
 #
 # Names are stored with the leading separator stripped, which is how reconcile
 # compares them.
 FilterLabel                        # hg/lib/hui.c
 FilterValuesDefault                # hg/lib/hui.c
 HighlightType                      # hg/hgTracks/bigBedTrack.c
 \n                                 # hg/hgc/hgc.c
 add                                # hg/lib/hui.c
 alt                                # hg/hgc/myVariantsClick.c
-bai                                # hg/cgilib/fileUi.c
 bin                                # hg/cgilib/annoStreamDb.c
 bip                                # hg/hgTracks/gvfTrack.c
 blockCount                         # hg/hgTracks/myVariantsTrack.c
 blockSizes                         # hg/hgTracks/myVariantsTrack.c
 cancel                             # hg/hgTracks/myVariantsTrack.c
-cgm                                # hg/lib/chromGraph.c
 chainSelf                          # hg/hgc/hgc.c
 chromEnd                           # hg/hgc/myVariantsClick.c
 chromStart                         # hg/hgc/myVariantsClick.c
 chromStarts                        # hg/hgTracks/myVariantsTrack.c
-circle.txt                         # hg/hgc/hgdpClick.c
 clr                                # hg/lib/hui.c
 cnvType                            # hg/hgc/myVariantsClick.c
 coloring                           # hg/hgTrackUi/hgTrackUi.c
 confSet                            # hg/hgTracks/searchTracks.c
 defaults                           # hg/hgTrackUi/hgTrackUi.c
 delAll                             # hg/hgTracks/hgTracks.c
 delete                             # hg/hgTracks/myVariantsTrack.c
 description                        # hg/hgc/myVariantsClick.c
 dispFndTrk                         # hg/hgTracks/searchTracks.c
 dnovo                              # hg/hgTracks/gvfTrack.c
 drag                               # hg/lib/vcfUi.c
-eps                                # hg/hgc/hgdpClick.c
-err                                # hg/hgTables/genomeSpace.c
 excludeDbs                         # hg/lib/jksql.c
 fileSortOrder                      # hg/cgilib/fileUi.c
 first                              # hg/lib/tablesTables.c
 germ                               # hg/hgTracks/gvfTrack.c
 gold                               # hg/lib/hdb.c
-html                               # hg/lib/trackHub.c
 id                                 # hg/hgTracks/myVariantsTrack.c
-ids                                # hg/hgc/virusClick.c
 itemRgb                            # hg/hgc/myVariantsClick.c
 kgAlias                            # hg/lib/findKGAlias.c
 kgProtAlias                        # hg/lib/findKGProtAlias.c
 knownGene                          # hg/lib/hgFind.c
 last                               # hg/lib/tablesTables.c
-link.bb                            # hg/hgTracks/chainTrack.c
-log                                # hg/hgc/virusClick.c
 mat                                # hg/hgTracks/gvfTrack.c
 minAc                              # hg/lib/vcfUi.c
 mouseover                          # hg/hgc/myVariantsClick.c
 name                               # hg/hgc/myVariantsClick.c
 next                               # hg/lib/tablesTables.c
-pdf                                # hg/hgc/hgdpClick.c
 pfamDesc                           # hg/hgc/hgc.c
-pie.txt                            # hg/hgc/hgdpClick.c
-png                                # hg/hgc/hgdpClick.c
 prev                               # hg/lib/tablesTables.c
 project                            # hg/hgc/myVariantsClick.c
 projectSelect                      # hg/hgc/myVariantsClick.c
 prot                               # hg/hgc/hgc.c
 ref                                # hg/hgc/myVariantsClick.c
 sel_id                             # hg/hgTracks/searchTracks.c
 som                                # hg/hgTracks/gvfTrack.c
-ss.ps                              # hg/hgc/rnaFoldClick.c
 thickEnd                           # hg/hgc/myVariantsClick.c
 thickStart                         # hg/hgc/myVariantsClick.c
-tmp                                # hg/lib/trackHub.c
 unip                               # hg/hgTracks/gvfTrack.c
 unk                                # hg/hgTracks/gvfTrack.c
-wig                                # hg/lib/wigDataStream.c
 wikiTrack                          # hg/hgTables/hgTables.c