99c145df11c04f80820690fd67e9499f296b4d7d
braney
  Sat Aug 1 12:58:39 2026 -0700
harvesters: resolve #defines per file, not pooled refs #37923 refs #37925 refs #37838

The first nightly run reported a new URL parameter, hggw_term, that had been in
the tree since the hgGateway redesign.  It was not new; the harvester had been
answering the question differently in two checkouts of the same commit.

SEARCH_TERM is "hggw_term" in hgGateway and "hgcd_term" in hgChooseDb.  The
#define table was pooled across the whole tree with setdefault, so the winner
was whichever file the filesystem walk reached first, and hgGateway's reads came
out as hgcd_term in my working tree and hggw_term in a fresh clone.  For a
nightly cron that means mail whenever a directory listing changes order, which
is worse than no cron.

So a name a file defines itself now wins, and a name the tree defines
inconsistently resolves to {NAME} instead of to a guess.  This is the call
bdc473369e1 already made for char * constants, for the same reason and with the
same tradeoff written up in the CONST_RE comment: an honest {ident} beats a
confident wrong answer.  Verified by harvesting both trees and diffing.

Twelve names leave the URL baseline as a result, the gisaidTable and hgg_
prefix families, which were pooled values from sibling CGIs rather than reads
in the file they were attributed to.  Recovering those properly means following
the #include chain to the header that defines them, which is not done here.

The URL catalog carried hgt_tSearch twice, once correctly as the track search
variable and once as hgGateway's search term, which was this bug showing up in
the curated half.  --check did not catch the duplicate because it only looks
within a section.  hgGateway now has hggw_term and hgChooseDb hgcd_term, both
confirmed at their call sites and in their CGI's excludeVars.

diff --git src/hg/utils/urlCommandCatalog/urlNamesNotCataloged.txt src/hg/utils/urlCommandCatalog/urlNamesNotCataloged.txt
index b72343a9731..ee18dae29ca 100644
--- src/hg/utils/urlCommandCatalog/urlNamesNotCataloged.txt
+++ src/hg/utils/urlCommandCatalog/urlNamesNotCataloged.txt
@@ -115,39 +115,31 @@
 exe                                # hg/sim4big/sim4big.c
 ext                                # hg/pslCat/pslCat.c
 faFile                             # hg/altSplice/altSplice/spliceStats.c
 fasta                              # hg/hgc/pubs.c
 file                               # hg/secure/secure.c
 fileList                           # hg/encode3/encodeDataWarehouse/edwWebDeprecate/edwWebDeprecate.c
 fixMembers                         # hg/hgLogin/hgLogin.c
 foot                               # hg/hgc/interactClick.c
 fpcChrom                           # hg/gigAssembler/ooLiftSpec/ooLiftSpec.c
 fromProg                           # hg/gisaid/gisaidTable/gisaidTable.c
 gapOpenCost                        # hg/pslFilterBadCdna/pslFilterBadCdna.c
 gapSizeLogMod                      # hg/pslFilterBadCdna/pslFilterBadCdna.c
 gene                               # hg/hgGtexApi/hgGtexApi.c
 geneName                           # hg/gigAssembler/ooGreedy/getgene/getgene.c
 genomeInput                        # hg/hubApi/list.c
-gisaidTable.as.                    # hg/gisaid/gisaidTable/advFilter.c
-gisaidTable.asi.                   # hg/gisaid/gisaidTable/advFilter.c
-gisaidTable.col.                   # hg/gisaid/gisaidTable/configure.c
-gisaidTable.colOrder               # hg/gisaid/gisaidTable/configure.c
 gisaidTable.do.                    # hg/gisaid/gisaidTable/gisaidTable.c
-gisaidTable.do.keyClear.           # hg/gisaid/gisaidTable/advFilter.c
-gisaidTable.do.keyPaste.           # hg/gisaid/gisaidTable/advFilter.c
-gisaidTable.do.keyPasted.          # hg/gisaid/gisaidTable/advFilter.c
-gisaidTable.do.keyUp.              # hg/gisaid/gisaidTable/advFilter.c
 goldName                           # hg/gigAssembler/ooLiftSpec/ooLiftSpec.c
 gpFile                             # hg/affyTransciptome/samplesForCoordinates.c
 gsToken                            # hg/hgTables/genomeSpace.c
 gsidM_newPassword                  # hg/gsid/gsidMember/gsidMember.c
 gsidM_password                     # hg/gsid/gsidMember/gsidMember.c
 gsidMember.do.                     # hg/gsid/gsidMember/gsidMember.c
 gsidTable.do.                      # hg/gsid/gsidTable/gsidTable.c
 haplotypes_distMinor               # hg/hgGene/alleles.c
 hc_one_url                         # hg/hgHubConnect/hgHubConnect.c
 hgLogin.do.                        # hg/hgLogin/hgLogin.c
 hgLogin_changeRequired             # hg/hgLogin/hgLogin.c
 hgLogin_email                      # hg/hgLogin/hgLogin.c
 hgLogin_email2                     # hg/hgLogin/hgLogin.c
 hgLogin_helpWith                   # hg/hgLogin/hgLogin.c
 hgLogin_newPassword1               # hg/hgLogin/hgLogin.c
@@ -184,40 +176,36 @@
 hgSeq.promoter                     # hg/cgilib/hgSeq.c
 hgSeq.promoterSize                 # hg/cgilib/hgSeq.c
 hgSeq.repMasking                   # hg/cgilib/hgSeq.c
 hgSeq.revComp                      # hg/cgilib/hgSeq.c
 hgSeq.splitCDSUTR                  # hg/cgilib/hgSeq.c
 hgSeq.utrExon3                     # hg/cgilib/hgSeq.c
 hgSeq.utrExon5                     # hg/cgilib/hgSeq.c
 hgTest                             # hg/hgCoordConv/hgCoordConv.c
 hgTrackUi_op                       # hg/hgTrackUi/hgTrackUi.c
 hgb.pasteKeys                      # hg/hgBatch/hgBatch.c
 hgb.showPasteResults               # hg/hgBatch/hgBatch.c
 hgb.showUploadResults              # hg/hgBatch/hgBatch.c
 hgb.uploadKeys                     # hg/hgBatch/hgBatch.c
 hgb.userKeys                       # hg/hgBatch/hgBatch.c
 hgbi_do                            # hg/bioImage/hgBioImage/hgBioImage.c
-hgcd_term                          # hg/hgChooseDb/hgChooseDb.c
 hgct_                              # hg/hgCustom/hgCustom.c
 hgct_docFile__binary               # hg/lib/customTrack.c
 hgdbTestDb                         # hg/affyTransciptome/samplesForCoordinates.c
 hgdbTestTable                      # hg/affyTransciptome/bulkChr2XRegression.c
 hgfs_Search                        # hg/hgFileSearch/hgFileSearch.c
-hgg_do                             # hg/hgGenome/hgGenome.c
-hgg_doPsOutput                     # hg/hgGenome/hgGenome.c
 hgg_do_                            # hg/hgGene/hgGene.c
-hgg_uploadFile                     # hg/hgGenome/upload.c
 hglft_fromDb                       # hg/hgLiftOver/hgLiftOver.c
 hgp_do                             # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgp_doDownload                     # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgp_id                             # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgp_listSpec                       # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgp_ss                             # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgp_startAt                        # hg/visiGene/hgVisiGene/hgVisiGene.c
 hgpp_serverCommand                 # hg/hgPhyloPlace/hgPhyloPlace.c
 hgpp_serverComment                 # hg/hgPhyloPlace/hgPhyloPlace.c
 hgpp_serverPlain                   # hg/hgPhyloPlace/hgPhyloPlace.c
 hgpp_serverSalty                   # hg/hgPhyloPlace/hgPhyloPlace.c
 hgs_sample                         # hg/gisaid/gisaidSample/gisaidSample.c
 hgs_subj                           # hg/gisaid/gisaidSubj/gisaidSubj.c
 hgself                             # hg/oneShot/testCart/cart.c
 hgt.customFile__binary             # hg/lib/customTrack.c