Telemetry: clean the city demand signal + classify two new agent UAs#10
Merged
Conversation
…ignal
The 'Top cities queried' chart slugified every raw city input straight into the
queries:cities ZSET, so junk (test strings, typos, injection, emoji, uncovered
places) polluted the demand signal and 'Atlanta' vs 'atlanta-event-staffing'
counted as two markets.
track.ts now resolves each input through findCity() against the 345-market
catalog: matched inputs feed the sorted ZSET under a canonical slug (suffix
stripped, so duplicates collapse); present-but-unrecognized inputs go to a new
diagnostic HASH queries:cities:unmatched:{date} instead, mirroring the existing
ua:unclassified capture so the junk stays reviewable rather than vanishing.
query.ts ranks it (top 25); the admin dashboard surfaces it in a new
'Unrecognized city inputs (raw)' card.
Two surfaces that were landing in the unclassified bucket: OpenAI's MCP client (a real agent connection) and the MCP registry quality-scoring probe.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small, independent telemetry-accuracy fixes (one commit each).
1. Separate recognized markets from junk in the city demand signal
The Top cities queried chart was slugifying every raw
cityinput straight into thequeries:citiesZSET — so junk lookups (test strings, typos, injection attempts, emoji, places we don't cover) polluted the demand signal, andAtlantavsatlanta-event-staffingcounted as two separate markets.findCity()against the 345-market catalog. Matched → canonical slug (suffix stripped, dedupes) feeds the clean ZSET. Present-but-unrecognized → a new diagnostic HASHqueries:cities:unmatched:{date}(same TTL), mirroring the existingua:unclassifiedcapture so junk stays reviewable instead of vanishing.unmatchedCitiestoDashboardMetrics.2. Classify two new agent UAs
openai-mcp(OpenAI's MCP client — a real agent connection) andmcp-scoring-probe(the registry quality-scoring bot), both previously falling into the unclassified bucket.Verification:
tsc --noEmitpasses clean. No telemetry tests exist; lint tooling is broken repo-wide (old.eslintrcformat, unrelated to these files).