Architecture
This is the reasoning behind the product, kept as one document in the repository and rendered here from that same file, so the site and the source can never disagree. It covers the one decision everything else follows from, how the code is split so the logic that matters is testable, and why endpoint liveness, answer correctness and the legality of a field are three separate guarantees, each proven on its own surface: liveness on status, correctness on benchmarks, legality in the atlas itself.
On this page 8 sections
- A lookupan address
- resolves the address to a county
- The atlas indexPermanently stored: URLs, field names, labels, sample queries, contact info. Not stored: parcel records.
- queries that county's own server at request time
- The county's own serverthe system of record
- and returns its answer
This is a working note on how UrbanKit Studio is built and why, written for someone who might have to operate it. It is organized around the decisions that were hard, not around the directory tree. Where a decision turned out to be wrong, the wrong version is here too.
1. What it is#
UrbanKit Studio indexes the public ArcGIS REST endpoints that US counties run for their parcel data: 568 counties across 50 states and DC, 539 endpoints, with each county record carrying the layer URL, its searchable field names and human labels, a working sample query, contact details and license (public/data/atlas/index.json, version 0.3.0). An endpoint can also declare what its layer refuses: attributeSearch: "unsupported" for a layer that cannot take a where-clause search, and supportsPagination: false with its maxRecordCount for a layer that answers any resultRecordCount or resultOffset with "Pagination is not supported." Each flag has one reader (offersAttributeSearch, offersPagination) in src/lib/capability-core.ts, a twin in the SDK, and validate-atlas checks every registration of one layer URL carries the same pagination keys. That registry is served through four surfaces that share one implementation: a website with a page per county, a metered REST API described by public/openapi.json, an offline npm SDK (@urbankitstudio/atlas, 0.9.16), and an MCP server exposing ten tools to agents (hosted at POST /api/mcp, plus a stdio build as @urbankitstudio/mcp-atlas, 0.4.10). Since 2026-09-21 neither package publishes from this repository: npm attaches a provenance attestation only on an OIDC publish from a public repo and this one is private, so each publishes from its own public repo. mcp-atlas also moved its source there; atlas is still authored here, because its data/ is generated from the parcel registry, and is mirrored out by .github/workflows/atlas-sync-push.yml. Nobody scraped these endpoints; each one was found and queried by hand, which is the reason the registry is 568 counties and not 3,000.
Rough map of the code:
| Path | What lives there |
|---|---|
public/data/atlas/*.json | The registry. Source of truth for everything else. 52 files, 2594 KB. |
src/lib/*-core.ts | Pure logic: no I/O, no clock, no network. Vitest covers it. |
api/_lib/*.ts | The impure half: Supabase, Upstash, Census, county ArcGIS servers. |
api/atlas/*.ts | The six REST handlers. |
api/cron/liveness.ts | The endpoint prober. No shared imports. |
packages/atlas | The npm SDK. Its data is generated from the registry above, which is why it still lives here. The MCP server's package moved out to urbankitstudio/mcp-atlas, where it publishes itself. |
scripts/validate-atlas.mjs | The registry's schema and content gate, run in CI. |
public/data/benchmarks/*.json | Correctness reference parcels and the last run's observations. |
public/data/city-property/*.json, public/data/city-zoning/*.json | The two city registries: code-violation and building-permit datasets, and zoning-case dockets, one file per city. Loaded by src/lib/city-property.ts and src/lib/city-zoning.ts; gated by scripts/validate-registries.mjs. |
src/lib/city-query-core.ts | Pure: the exact upstream URL the site sends for a city dataset and a typed street, and the descriptor an agent reads. Copied verbatim into the npm package. |
The city registries are the second registry, built on the same rule as the first. Each city file names a public open-data endpoint (Socrata, ArcGIS, CKAN or CARTO), the column an address search runs against, the date column, any filter that is part of the dataset's definition, and a field map onto the names the site renders; the site queries the city's server from the browser, so every registered source answers with CORS and nothing is proxied or stored. src/lib/city-query-core.ts is the one place that turns a record and a street into a URL. The Property Report and Zoning Cases pages call it, the npm package ships a copy of it (packages/atlas/src/cities.ts, pinned identical by atlas-package-city-parity.test.ts), and the hosted MCP tool get_city_datasets describes each dataset with it and hands the agent the same URL the page would send. That tool is free and unmetered: it returns registry metadata the site already serves at /data/city-*/ with Access-Control-Allow-Origin: *, runs no upstream query and no owner lookup, and the agent fetches the city's server itself.
2. The core decision: index metadata, proxy the query#
The atlas stores what a county's endpoint *is*, not what it *says*. Permanently stored: URLs, field names, labels, sample queries, contact info. Not stored: parcel records. A lookup resolves an address to a county, then queries that county's own server at request time and returns its answer.
The alternative was the obvious one: crawl 568 counties nightly into Postgres and serve from there. That is what a parcel data company normally does, and it would have made everything below section 4 unnecessary.
What indexing buys:
- No data broker exposure. There is no owner name database to breach, subpoena, or accidentally resell. The compliance surface is a list of URLs.
- No staleness by construction. Cook County reassesses on a three year triad cycle and updates its layer when it updates it. A proxy always returns whatever the county has right now, so "how old is this" is the county's answer, not ours.
- The county stays the system of record, which is the position that survives a county changing its mind about publishing.
What it costs:
- Availability is inherited. If Prince William County's MapServer is slow, the product is slow for Prince William County. There is no local copy to fall back on.
- Latency is a round trip to a government server that was not built for this.
- There is no history. I cannot answer "who owned this in 2019" because I never kept 2019. A crawler would have that asset and I traded it away.
The marketing version of this claim is not true. The paid paths do route through our servers and do cache the county's response: 1 day fresh with a 7 day serve-stale window for parcel results, 7 days and 30 days for geocodes (api/_lib/enrich.ts, api/_lib/radius-query.ts). On those paid owner paths a fresh cache hit saves a county round trip, but a stale entry served because the live call failed is withheld: the stage reports the refundable unavailable code and a refund is attempted (the radius HIGH-3 rule, applied to enrichment by #916). The settlement fields say whether that refund landed: bulk refunded, MCP plan_quota.refund, radius charged. The cache also lets metered usage be reconciled. It is operational and short lived, and it is never compiled into profiles. In the free browser lookup the parcel query itself does not pass through our servers: the browser contacts the county's layer directly, and only the Census geocode is proxied (api/geocode.ts), plus, in a county with a notice-list entry (or, for a statewide layer, while an entry exists in its state, and for a layer the atlas does not know, while any entry exists), a check of the parcel numbers of the results the page is about to show, never a name or an address, not stored or logged (section 4).
3. Pure core, impure glue#
Every file named *-core.ts under src/lib/ is pure. No fetch, no clock, no environment, no edge globals. The I/O sits in api/_lib/ and imports it.
src/lib/ratelimit-core.tsowns window math, IP parsing, and result shaping.api/_lib/ratelimit.tsowns the Upstash pipeline call and the Lua.src/lib/enrich-core.tsowns field classification, address parsing and match scoring.api/_lib/enrich.tsowns the Census call and the county spatial query.src/lib/capability-core.tsowns per field capability. Nothing in it does I/O.src/lib/radius-core.tsowns request parsing and the geometry.api/_lib/radius-query.tsandapi/_lib/radius-charge.tsown the rest.
The reason is narrower than "testability" in general. Vitest is configured over src/, and the money path decisions are exactly the ones I need to test without a network: whether a reservation clamps to remaining quota, whether a row counts as sellable, whether a missing column means the law forbids something. clampReservation in ratelimit-core.ts is the clearest case. It is nine lines. It is shared by POST /api/atlas/radius and the MCP radius_owners tool, and it lives in one place because the previous version was duplicated clamp arithmetic at two call sites, which is how a defect shipped on one radius surface while the other looked fine.
4. The three guarantees#
Most data products collapse three different questions into one green checkmark. They are not the same question, they fail independently, and two of them cannot be answered by a machine at all.
- Liveness. Does this endpoint answer right now?
- Correctness. Is the answer right?
- Legality. Are we allowed to serve this field for this county?
4.1 Liveness#
api/cron/liveness.ts probes every county with a public endpoint twice: a metadata read (?f=json) and a real single row query. It compares the layer's live field list against the registry's declared searchFields, so a county silently dropping a column registers as field-drift rather than as success.
The cadence is scheduled by pg_cron jobs inside the Supabase database (migration 20260816120000_atlas_liveness_pg_cron.sql, applied by hand alongside an atlas_cron_secret Vault entry), which call the same endpoint through pg_net with the bearer read from Vault at call time. A full sweep every two hours, split into four shards via ?shard=i-of-4 a minute apart, because the single call full sweep rode the function's 60 second maxDuration and tipped over it on a slow morning. The shard split is a deterministic modulo, so the union of the four is exactly the full set and slow hosts spread across shards instead of clustering by file order. Separately, at :15 and :45, ?only=degraded re-probes only counties whose stored status is currently non-ok, so a failure gets rechecked every 30 minutes while healthy counties keep the polite two hour cadence. Roughly 2,100 requests a day total. Vercel's own daily cron at 08:00 UTC fires shard-less as an independent backstop, and the old GitHub Actions scheduler (.github/workflows/atlas-liveness.yml) stays as a manual dispatch only. It moved because GitHub bills each Actions job as a full minute, so sixty sub-minute pings a day were most of a free account's monthly allowance, and when that allowance ran out on 2026-08-15 the probes simply stopped; a trigger that lives next to the data it writes has no such failure mode.
Most of that file handles the ways a probe can be wrong about a healthy server:
returnCountOnly=trueforces a full layer scan. Pinellas FL took 22.6 seconds on the count path and under 0.4 seconds on aresultRecordCount=1field query. Three healthy counties were chronically flaggedquery-timeoutby our own probe shape.- Some ArcGIS Enterprise instances reject a tautological
where=1=1with a 400 while the county's real search works fine (Charleston SC).resolveQueryPredicateprefers the endpoint's own declaredsampleQuerypredicate, falling back to1=1, and refuses asampleQuerypointing at a different host. - Orleans Parish LA and Hinds County MS reject the identical query when
outFieldsis a named field or omitted, and accept it withoutFields=*. - Shelby County TN requires legacy TLS renegotiation, which Node refuses by default. It gets a
node:httpsclient withSSL_OP_LEGACY_SERVER_CONNECT, scoped to an exact hostname allowlist. - Orleans Parish sends an incomplete certificate chain. curl succeeds because it fetches the missing intermediate via AIA; Node does not do AIA fetching. The fix pins that one Sectigo intermediate alongside
tls.rootCertificates, per request, on a dedicated client. Not by weakening verification. - Three statewide shared layers (NY, NJ, Prince William VA) are genuinely slow while fully correct, so they get a per host 15 second budget instead of the 5 second default. Per host, never a blanket bump, or the budget stops detecting anything.
- A layer flagged
supportsPagination: falsein the registry (the two Mississippi statewide layers) answers anyresultRecordCountorresultOffsetwith HTTP 200 and an error 400 "Pagination is not supported." body, and an unpaged1=1returns its whole 2,000 row cap. Its probe sends the record's declared, county-scoped predicate withreturnCountOnly=trueand nothing else, on a 30 second budget, because the first call after hours of idle takes 8 to 25 seconds. One timeout there is recorded ascold-startand left out of the failure streak until the next run agrees. A flagged record with no declared predicate isprobe-predicate-missing; the probe never falls back to1=1on such a layer.
Failures retry up to three attempts with a 400 ms delay, but only when transient: a 4xx or a field drift is a real failure and burns no retry budget. The whole retry budget is capped at 40 seconds of wall clock so a bad morning cannot push the run past maxDuration.
Two statuses describe the registry rather than the server. field-drift is a column the record declares and the layer no longer carries. pagination-refused is the pagination error above on a record the registry still says pages: the server is up and answering, so autoheal proposes supportsPagination: false plus the layer's own maxRecordCount on the record (a surgical pull request, or an issue carrying the same proposal when the file cannot be edited safely), never a URL swap and never a dead-endpoint issue. The same layers are kept warm by api/cron/ms-keepwarm.ts, a Vercel cron every 15 minutes that sends each one a single FID = <known id> AND <county> query, because nothing decays inside 40 minutes of idle and the cold start is what every free-tool and MCP timeout would otherwise meet.
Results land in two Supabase tables. endpoint_status is upserted per county and holds only the current state. endpoint_status_history is append only, one immutable row per county per run, roughly 57k rows a year, with RLS on and no public policy. It is not backfillable: the value is the length of the series, so it accrues or it does not exist. Auto remediation opens a GitHub issue after three consecutive failures and closes it after three sustained ok observations, and the close path reads the history table rather than adding a counter column, because the signal is already there.
Two design rules matter more than any of the above.
The registry's `status` field is not health. It is a curation stamp with a date on it, set whenever a human last touched that entry. On 2026-08-04 the REST API and the MCP server both reported Will County IL as status: "live", lastVerified: "2026-06-27" while the cron had it down with three consecutive failures that same afternoon. A five week old assertion was being served as current fact, on the exact surface whose selling point is that endpoints are verified. The probe results had existed the whole time. Nothing read them. api/_lib/endpoint-health.ts exists because of that, and every served response now carries both, labelled, never merged.
A null observation never means healthy. loadEndpointHealth() returns an empty map when the table is unreachable, never a throw and never a guess, and callers must read "absent" as "unknown". Three places enforce that, and each was a real bug:
- The health cache treats zero rows as failure, not as an empty atlas.
{}is truthy, so an earlierrows ?check cached a PostgREST200 []as a success. That is reachable: an RLS policy flipped tousing (false)with the GRANT intact answers200 [], where a revoked GRANT answers 401. loadEndpointHealthBounded(800)caps the caller's wait on the billed lookup and county paths, where health is additive rather than the point of the call. Giving up yields an empty map, which reads downstream as no observation. A read I abandoned tells me nothing about the endpoint.- The published contract says so.
openapi-schemas.test.tsasserts that theObservedHealthschema is nullable and that its description matches/never means healthy/i, because a client that reads null as healthy has the original defect back with extra steps.
/api/atlas/status is ungated, cached 60 seconds with a 240 second stale window. Putting "is your data actually up right now" behind an API key would undermine the answer it gives.
POST /api/atlas/request (and the MCP request_county tool) is ungated and free: asking for a county we do not cover should never cost a key. It writes to county_requests, which can hold an email the requester chose to give, so that table is service-role only and kept apart from the identity-free demand tallies.
4.2 Correctness#
This is the weak one and I would rather say so plainly than let the liveness work imply coverage it does not have.
Liveness proves an endpoint answered. It does not prove the answer is right. Nothing in this system currently checks that the owner name returned for a given address is the owner of record, that the parcel the buffered spatial query picked is the correct parcel, or that the APN matches the assessor's. Those are three separate failure modes and all three are unmeasured today.
The disambiguation logic is where correctness lives. The Census geocoder returns a street interpolated point sitting in the road right of way, so a naive point in polygon query against a parcel layer misses. enrich-core.ts buffers 30 meters, asks for 40 candidates (and for the whole buffer when the server cut that page, so a tie outside the first 40 is seen), then scores each candidate's site address against the geocoded address by house number and street tokens, returning a confidence of exact, house-only, ambiguous or none. house-only exists for layers that publish no street name at all (Travis County's "Situs Address" field holds the house number alone): the match rests on a house number unique within the buffer, and the value is kept distinct from exact so a caller needing street-level proof can refuse it. An "Owner Address" field was once classified as the site address and the match ran against it, returning a wrong owner, so SITE_EXCLUDE now bars any field matching mail|owner|own[_\s]|grantor from being read as the situs address.
Ground truth now exists, in one county. public/data/benchmarks/ground-truth.json holds a seed of hand-sourced reference parcels, each recording the address, the parcel identifier an independent county source publishes for it, a URL that returns that identifier, and the exact layer the row grades. scripts/run-benchmarks.mjs runs every row through the production picker on the first 40-candidate page of the 30 m buffer and records what came back; it scores nothing. Since atlas 0.9.12 production also asks for the whole buffer when the county server cuts that page, and the replay does not yet; the published run (2026-11-16) predates that change. src/lib/benchmarks-core.ts is the scoring, pure and unit tested, and /benchmarks publishes the result. The split matters: the observations ship next to the page, so the published numbers are arithmetic anyone can redo over evidence they can read.
Three rules are enforced rather than described. A metric with an empty denominator is null, never zero, because zero is a measurement and absence is not. A row whose parcel identifier was only ever established by the endpoint it grades is excluded from every comparison against that identifier, not flagged and counted anyway. And every metric carries the rows it could not measure and why, because a score computed over the easy remainder with the hard cases dropped in silence reads as coverage.
What that buys is narrow and the page says so. The seed is almost entirely Cook County IL, so a pooled percentage is a Cook County percentage; owner name correctness is unmeasured on purpose, since holding a file of owner names to check against would be the owner database this product does not keep; and 233 of the 240 monitored counties have no reference rows at all. CI replays the recorded observations on every push rather than hammering county servers, through validate-ground-truth, which fails when an observation drifts from the row it measured. The live re-run is scheduled weekly and watched by a staleness check that goes red past ten days; both were merged on 2026-08-18. The weekly re-run opens each new snapshot as a pull request, which a person reviews and merges.
The declined column in that table is the part worth reading twice. A county can score zero by refusing every row, which is not the same failure as answering every row wrongly, and only one of the two puts a stranger's parcel in front of somebody about to serve a legal notice. Across the scored rows the pipeline has never named a wrong parcel. Where it cannot verify a candidate against a published site address it returns nothing, and some of that is structural, because a county whose layer publishes no site address gives it nothing to check against.
4.3 Legality#
This is the part I got wrong.
A trial user subscribed, ran Los Angeles County for owner data, and got nothing back. The endpoint was healthy the entire time and the atlas correctly said so. What the data model could not express was that the field he paid for was never going to arrive. The registry tracked availability. It did not track permission. He cancelled seven minutes after subscribing, and there was no request log to reconstruct what he had called, so the reason had to be worked out by hand from the registry.
Auditing that turned up something worse. Six California county records asserted in prose that California Government Code 7928.205 was the reason their layer had no owner column, and Los Angeles County's note claimed the section "broadly restricts owner name and mailing address from public REST endpoints across California". Reading the section at primary source: 7928.205 protects the home address of elected and appointed officials. It is not a general bar on assessor owner data. That claim had shipped through the SDK, the REST API, and every MCP response carrying notes, and nothing in CI could see it, because it was prose.
Our own registry disproves it three ways, inside one state, under one statute:
| County | Behaviour | What that is |
|---|---|---|
| San Diego | Publishes OWN_NAME1, OWN_ADDR1 and real names on a public keyless layer | The statute does not bar owner data |
| San Bernardino | Publishes an OwnerName column where every row's value is the literal string Protected Per CA Gov Code 7928.205 | The county's own over-broad reading, applied server side |
| Los Angeles | Publishes no owner column at all | A publication choice, not a legal one |
One statute, three behaviours. A state level rule would have been wrong about all three counties.
So src/lib/capability-core.ts splits the answer into seven fields (apn, owner_name, owner_mailing_address, situs_address, geometry, land_use, zoning) and four statuses, and the statuses are not shades of one idea. They are different claims with different evidence and different durability:
not_publishedis a fact about a service. The field is absent from the layer's documented field list. Derived mechanically, recomputed whenever the registry changes, cheap to be wrong about and cheap to fix. Where a county keeps its owner rows in a table joined to the parcel layer (ownerJoin; Sussex County, Delaware is the first), the list is the layer's columns and then the table's, read through one function (effectiveFields) that the paid radius join reads too.county_cited_statuteis the county's claim, attributed to the county. San Bernardino cites 7928.205; we report that it does, we do not adopt it. The schema enforces the attribution:basis.type = "county_cited_statute"withoutattributedTofailsvalidate-atlas. Without that rule, "San Bernardino cites 7928.205" decays into "7928.205 says", which is precisely how a narrow statute became a statewide bar in our own shipped copy.restrictedis a legal claim we are making ourselves. Entered by a human, carrying a citation that human has read. Never derived, never inferred from an empty response, never copied from a neighboring county's label.status: "restricted"with neither a citation nor an attribution fails validation, because a legal claim with no source is an opinion.permission_pendingis the one restriction that is not a legal claim: a claim we make about ourselves. The county publishes the field; we have asked it for permission to use it and withhold the field until it answers. It says nothing about the law or the county's policy, so it names no one else (attributedTofails validation), carries thesourceUrlwhere the county publishes the field, and is valid only withstatus: "restricted"on a field the layer documents (validate-atlasandcapability-basis-audit.test.ts). When the county says yes, the override is deleted and the field isavailableagain.availablemeans the field is in the documented list so a query can ask for it. It is not a promise that every row is populated.
The invariant that holds all of this up is one line in a test:
deriveFieldStatusescan never return"restricted", asserted across all 568 counties in the shipped registry (src/lib/__tests__/capability-core.test.ts:52).
A machine reading a list of column names cannot read a statute. The day it starts guessing is the day the product tells a paying customer the law forbids something when the county chose not to publish it. That is the mistake that started this, encoded so it cannot recur silently.
The obvious fix for the six California counties was wrong. The obvious fix was to author six capabilityOverrides records. That would have encoded a legal claim no verified statute supports. The derived answer we already produce, not_published from each endpoint's own field list, is factually correct for all six. So the prose was corrected to state only the fact, and the explanation of why California counties differ now lives once, on the state page, instead of as six copies drifting apart. The reviewed overrides, the ones a human entered with a citation (basis.type of statute or county_cited_statute; the mechanical endpoint_schema ones are derived and do not count), are few: the twelve Kentucky counties whose owner and mailing columns are available by statute, and the restrictions: San Bernardino and Fresno (California Government Code, as the counties cite it) and all six New Jersey counties, which restrict owner name and owner mailing address under Daniel's Law (Bergen and Essex also carry NJOGIS's own service-description citation). Hamilton IN joins them since atlas 0.7.2: owner name and owner mailing address are county_cited_statute (Hamilton County Ordinance 11-26-07-B, as the county cites it), because its GIS office answered on 2026-11-02 that county data may not be used behind a pay service. Two more counties are restricted on a permission_pending basis, not law: York SC (owner name and mailing address, asked under S.C. Code 30-2-50, on 2026-11-01) and Boone IN (Boone County Code 34.24(F), asked on 2026-11-02). Nevada CA was a third until 2026-11-02, when its GIS Division said yes and its mailing address was switched on (atlas 0.7.2). That sentence stops being true the day either county answers, so the runbook below ends with correcting it. That number should stay small. A model whose exception table is growing is a model that has become a lookup table.
A withheld layer has one known gap, and a switch-on has a fixed list of edits. The gap: the free tools recognise York's layer by its own URL and, for a copy elsewhere, by a fingerprint of columns only York has (src/lib/registered-layer.ts), and a county that restricts one role would get no fingerprint (Nevada, which did, is served since 0.7.2). A copy of a withheld layer on another host and service name, without the fingerprint columns, therefore opens unrestricted in Parcel Lookup and the GeoJSON exporter. Enrichment and radius never fall back to another layer, so the paid paths and the hosted API cannot be pointed at a copy.
To switch owner data on when a permission_pending county says yes (York's or Boone's owner name and mailing address; Nevada's mailing address was switched on this way in 0.7.2), in one change set:
- Data (
public/data/atlas/): delete the county'scapabilityOverridesentries for the answered roles; for York also deleteownerFieldNote; drop the withholding sentences fromnotes(a county that keeps another role restricted or unpublished keeps itsownerFieldNote, reworded as Nevada's was); set the withheld columnssearchable: trueagain (York'sOwner1andMailAddr1; Nevada's mailing columns stayedsearchable: false), and restore a sample query only if it should search them. If the county asks for a disclaimer, it goes verbatim intocredit(and after "Credit:" innotes);CREDIT_MAXinscripts/atlas-rules.mjsbounds it. Thevalidate-atlaswithheld-role rule fails if a column of a still-restricted role is left searchable. src/lib/__tests__/liveness-self-contained.test.ts: remove the county from the list of allow-listed counties (permittedOutFieldsis null once no role is restricted).src/lib/__tests__/owner-unusable.test.ts: remove York from the list of counties whoseownerFieldNotethe test pins (the note is deleted).src/lib/__tests__/york-owner-withheld.test.ts(and Boone's): the expectations flip, so the county moves to the open counties' tests or the file is deleted. Nevada's, nownevada-mailing-served.test.ts, is the shape of that flip.- Owner-search count: York starts advertising an owner search (
countyAdvertisesOwnerSearch), so the count in README.md and every count-claim test move by one (owner-rule-unification.test.tsreads README's "N of those M"). Nevada publishes no owner name, so its count does not move. src/lib/__tests__/capability-basis-audit.test.ts: it pins the exactpermission_pendingset and edits York's override in itsvalidate-atlasruns, and the two throw or fail once both counties are on. Keep a case: add a synthetic county fixture that carries apermission_pendingoverride, so the audit and the validate-atlas schema half still have one to check.packages/atlas/test/capability.test.ts: update the expectedpermission_pendingid set and York'sreviewedCapabilityassertion.- Package: the data moved, so
packages/atlastakes a 0.7.x release (version and CHANGELOG entry; the CI stepagent-first-parity.mjsrejects data moving without both). The@urbankitstudio/atlaspublish happens from the public mirror repo; thenmcp-atlasbumps its@urbankitstudio/atlasdependency and releases. - Outreach status: until the outreach table ships,
api/_lib/county-outreach.tson main is where a county's outreach status lives; once the outreach table ships, set the county'scounty_outreachrow instead. - This section: correct the "Two more counties" sentence above.
Switching Nevada on (0.7.2) changed the meter. A Nevada row now carries mailing_address while the layer still has no owner name, so the note keeps owner_data_available false and the row bills as mailing-only (mailingOnlyCharges, src/lib/billing-decision.ts lines 123 and 403 to 410). While the mailing address was withheld those rows were free; they are billable now.
Two protections sit beneath the capability model and apply to every row on every surface (bulk, radius, hosted MCP, the free tools). The pure rules are src/lib/withhold-core.ts; the notice list is looked up only in api/_lib/suppressed-parcels.ts. They change the served view only: the billing decision, refund and meter read the raw row first. On bulk and enrich_address every county-redacted row bills alike: a row the county redacted with a MARKER and a row the county's own confidential-owner FLAG withholds are each served as the parcel id alone and bill 0, as an owner-unavailable parcel-only row does (parcel-only-owner-unavailable, call 2; for a flagged row the site address goes too, since the home address is what §25.025 protects). The decision reads the reason the serving code reads (withheldReason), so the two cannot disagree; a row whose owner cell is merely blank is not withheld and bills as any row does: 1 when it delivers a mailing address, 0 when it delivers neither an owner name nor a mailing address (parcel-only-owner-blank, call 12). On radius, which bills one unit per returned row that carries an owner name or mailing address, a county-redacted row is served with neither and so bills 0 (isSellableRow judges the served view). A notice-suppressed row is not billable (Leo, 2026-10-09). The server flags the raw row with the same lookup (withNoticeFlag) before billableOutcome reads it, which answers notice-suppressed, so bulk credits the unit back, radius settles the row at 0 and MCP enrich_address credits the plan unit back or never meters PAYG. Each credit is best-effort, and refunded, charged or plan_quota says whether it landed. (1) When a county publishes a redaction marker in the owner, mailing or situs value, the row carries withheld: "county-redacted". A marker is a value, after NFKC, invisible characters removed, whitespace collapsed and outer punctuation stripped, made only of the words CONFIDENTIAL, REDACTED, WITHHELD, PROTECTED, SUPPRESSED, RESTRICTED, NOT, DISCLOSED, OWNER, NAME, INFORMATION, INFO, PER, KRS, STATUTE, REQUEST, BY, SEE, PVA, RECORD, AND, the Texas statute words TX, TAX, CODE, SEC, SECTION, GOV, GOVT ("CONFIDENTIAL PER TX TAX CODE 25.025") and section numbers (61.878(1)(a) and 61.878 (1)(a) included; a plural "(S)" belongs to its word, so OWNER(S) is OWNER), with at least one of CONFIDENTIAL / REDACTED / WITHHELD / PROTECTED / SUPPRESSED / RESTRICTED / "NOT DISCLOSED", and a NOT just before one of the six single words negates it ("NOT RESTRICTED" and "NOT CONFIDENTIAL" are not markers). So "RESTRICTED", "RESTRICTED OWNER" and "RESTRICTED PER 132-1.2" are markers; "CONFIDENTIAL INVESTMENTS LLC", "SEE BROTHERS LLC", "RESTRICTED ACCESS LLC" and "RESTRICTED INDIAN LAND 1234" are names and are served. One function (carriesRedactionMarker) does the scan for the paid rows and the free tools, over the same columns: owner, mailing and situs (a sale price "NOT DISCLOSED" withholds nothing). A county that publishes the owner but marks the record confidential in a column of its own (Texas Tax Code §25.025: Harris's confidential_flag "Y", Collin's GIS_DBO_AD_Entity_confidential_ "T") carries that column on its endpoint record as confidentialFlag; every path asks for the column beside the role columns, reads it off the raw attributes (isConfidentialFlagged: the column by its registry spelling or any spelling differing in case only, failing closed, with one warning per column name, on a row that lacks it) and withholds a flagged row with the same withheld: "county-redacted". The flag itself is never served. The free tools find the record under any spelling of the layer URL (findRegisteredLayer falls back to the owner-withhold's guardKey, so /MapServer/00, /%30 and a trailing-dot host are the layer), and the GeoJSON converter drops a county-redacted feature's geometry as it drops a notice-suppressed one's (the outline locates the home). The free tools also run two column rules on every row before it is rendered or exported, both through one wrapper (src/lib/protected-columns.ts, which every such page calls): the age rule drops every column that indicates an owner's age (any column whose name or alias reads "exempt", an exemption list carrying OV65; Texas Tax Code §25.027(a)(2); a cell carrying an over-65 code such as OV65 is dropped from its row; src/lib/age-fields.ts), and the exemption-status rule drops every column that says an owner is disabled, a veteran, a senior, widowed or blind, the homestead columns where only such owners qualify (Ohio, Kentucky, South Carolina, West Virginia) and DC's homestead code, and, on every layer, exemption codes, flags, values and totals: Spokane WA's exmp_code carries the three income tiers of Washington's senior and disabled exemption (RCW 84.36.381), with no other column saying so (src/lib/sensitive-fields.ts). Where a layer carries any exemption column either rule hides, the exemption-status rule hides its taxable and net-of-exemption values too (taxable_amt, Net_Value): the gross value less the net one is the hidden amount. It hides the tax bills there as well (net_tax_total, TAXES, and what the account was billed, owes or paid): a bill comes after the exemptions, and the rate is public. The gross value and the rate stay, and so do a taxable value and a bill on a layer with no such column. Other columns were measured, by count-only reads, to give a hidden amount or personal status back. Each goes as a pair, only on a layer that holds the column it is paired with (the exemption column it gives back; on Hennepin MN the homestead exclusion the veterans' exclusion is read from; on St. Mary's MD the exemption class that marks Maryland's layer, since its land use gives back an exemption no column records), matched by the layer's own column names and not its address: DC's assessment caps, penalties and interest beside HSTDCODE; Baltimore City's TAXBASE, ARTAXBAS and FULLCASH, its current and base-year full cash values (CURRLAND, CURRIMPR, BFCVLAND, BFCVIMPR) and its land use code group (USEGROUP) beside EXMPLAND or EXMPIMPR; Hennepin's net tax capacity and homestead exclusions beside VET_EXCL1 or HMS_EXCL1, which so hides itself. The cost: on those layers the free tools neither show nor filter on any of these columns, so Baltimore City's loses every assessed value and its land use group (a filter on use, such as USEGROUP = 'E', is refused there). St. Mary's MD, on Maryland's statewide layer, loses its land use code and description (LU, DESCLU) beside EXCLASS or DESCEXCL, and a filter on either is refused there too. Dooly GA loses its state homestead value (statehsval) beside homeexempt the same way, and a filter on it is refused. A named exemption of a category that says nothing about the person (homestead outside those states, agricultural, homeowner) stays. A row key is matched to the layer's metadata in any case. A column either rule hides by its name or alias cannot be searched or filtered on: Parcel Lookup's search and the converter's WHERE filter both pass protectedWhereRefusal, which refuses a filter that names one (however qualified, cased or written in look-alike letters). Where a layer hides a column, it also refuses a non-ASCII character outside a string literal, which keeps the names from being read. On every layer it refuses a backslash, a control character, U& or UESCAPE anywhere in the filter, literals included, since each can spell a name or a value the other tests would not see. For these character faults the tools say so in plain words, not with the hidden-column message. The converter looks for names inside its filter's literals too. Parcel Lookup builds its search's literal itself, quotes doubled, so it reads names with the typed value left out: a street named Homestead can be searched where a HOMESTEAD column is hidden. A column the age rule hides only for its cells can still be named in a filter; there the guard refuses a filter or search that carries an over-65 code itself (a whole token, so fragments such as LIKE '%V65%', '%OV_5%', a concatenation, CONCAT, a range or a SUBSTRING still pass). On a layer whose hidden column name no plain identifier can spell, every filter but 1=1 is refused. On a layer where the exemption-status rule hides a column, Parcel Lookup and the converter, which read the layer's metadata anyway, name every other column instead of * where that list fits in 1,800 characters and the service takes named fields; Find My Parcel Number, which reads no metadata, asks for *, and every page drops the columns from the rows in the browser. A mailing value that is wholly masked (after NFKC and the invisible characters removed: only asterisks and separators, at least one asterisk, at most a trailing ZIP or ZIP+4, or a run of three or more "#"; src/lib/mailing-mask.ts) names no one. The paid rows (enrich, bulk, MCP enrich, radius) carry it as null, so the row billing reads already has it as null; the free tools null it in a mailing column, one whose name or label contains "mail" or the registry's mailing field. It does not withhold the row. A withheld row keeps an ALLOWLIST: on a paid row the request metadata and (unless notice-suppressed) the parcel id, except that an MCP replay whose stored county cannot be established (county-unresolved, or county-redacted when the fresh lookup is withheld too) keeps neither its parcel id nor its county fields; on a free-tool row numeric value, acreage and area columns, land-use / class / zoning columns and (unless notice-suppressed, or a value the check would refuse to send, such as "PO BOX 12") the primary parcel id. Everything else is null, including situs columns the classifier does not know, alternate ids, OBJECTID and a GeoJSON feature's id and bbox. (2) A notice-suppression list, src/data/suppressed-parcels.json, names parcels by county FIPS and normalized parcel id; a match serves nothing identifying. It is the takedown path for the written-notice laws we honor. KRS 14.304 and KRS 61.7991 in Kentucky and R.I. Gen. Laws 8-15-12 in Rhode Island feed it. A written request from a Rhode Island justice, judge or magistrate, a federal judge who lives in Rhode Island, or their immediate family must be answered within ten business days, and the privacy page promises 72 hours. The process is: a written notice arrives at contact@urbankitstudio.com -> a human verifies it and adds { countyFips, column, parcelId, basis, received } -> node scripts/gen-suppressed-parcels.mjs (also run by prebuild) regenerates api/_lib/suppressed-parcels-data.ts -> deploy. An entry must be the value of the county's parcel-id column, the one the paid classifier reads on EVERY endpoint the county answers from (the primary one and each with an owner, a mailing or a parcel-id column: the radius and enrich answer from any of them and fail over between them) (Boone's PIDN, not its PIN), and column names it: an entry copied from another id column is matched nowhere, so validate-atlas and the generator both reject it (listEntryErrors). Notice entries are not accepted for these counties until their endpoints agree on one id column: Broward, Duval, Hillsborough, Lee, Manatee, Miami-Dade, Palm Beach, Pasco, Pinellas and Sarasota FL (the county's own id beside the statewide layer's PARCEL_ID). No Kentucky or Maine county is among them: Cumberland, Kennebec and York ME write entries in STATE_ID, the parcel_id the radius serves (atlas 0.9.13), though for now they take none (the per-town gate, below). Their joins run per town (ownerJoin.places), so an entry names its town in place and its id opens with that town's code and "_", with a parcel after it (placeEntryErrors). In the five towns whose polygons build the key from MAP_BK_LOT (Freeport, South Portland, Kennebunk, Acton, Alfred) it is the built key, not the polygon's own STATE_ID, which in Alfred opens with Arundel's code; an id holding a character the town's form consumes and never writes (Freeport's "/", the "-" of South Portland and Kennebunk) or a lot written twice (Acton's own form) is refused, since the radius never serves it. A polygon whose key cannot be built is served with no parcel_id. One entry hides the free row and the radius row only where the free tools know the county and its join: the county route (ParcelLookupPage.tsx, on the county's own endpoint) and FindMyParcelNumber send the same built key for those towns' polygons, and a polygon whose key cannot be built fails closed (servedIdCheck in withhold-client.ts). Elsewhere it does not, by design: the generic ?endpoint= route and the GeoJSON converter place the statewide layer in no county (three counties register it, each under a scope), and with no county a row that names no owner (no layer-10 polygon names one) is never checked (unknownCountyRowNeedsCheck). Enrich serves a key-form town's polygon under the polygon's own STATE_ID, not the built key, with no owner, no mailing address and no charge (enrich-owner-join-guard.test.ts), so an entry in the radius's form never matches that row and nothing it would hide is served there. For now the list takes no entry in a county whose join has places (placeCountyGateErrors, part of listEntryErrors, so validate-atlas and the generator both refuse it), for two reasons: the list matches ids with every character that is not a letter or a digit removed, so one entry would also withhold a different parcel whose id differs from it only in punctuation, and Cumberland's and York's served ids hold such twins; and enrich serves a key-form town's polygon under the polygon's own id, not the built key, so an entry would miss that row. The message names both reasons and never the id. Until the follow-up that matches these ids without merging twins and has enrich read the built key, a notice from an owner in these counties cannot be listed. The place checks above stay, tested on their own, so lifting the gate needs no new rule. J12's county half asks only whether the record could hold an entry (the list's column checks), so the gate, a hold on the list, does not fail it. A county whose radius serves owners through a join must be able to hold an entry in its join key column, by these same checks, or validate-atlas fails the record (J12's county half). A test pins the generated file to the JSON, and validate-atlas checks the file's shape.
The list is SERVER-ONLY. It lives outside public/, and nothing a browser bundle includes may reach it: a list in the browser bundle, hashed or not, is a public list of protected parcels (parcel ids are public and enumerable, so a hash does not hide them). suppressed-parcels-boundary.test.ts walks the import graph from every HTML entry (the site and the app workspace), page and component, reading static, dynamic (any quote), import.meta.glob, new URL(..., import.meta.url) and ?raw imports, and fails if any of them reaches it. The paid surfaces (Edge) call the lookup directly. The free tools query the county from the browser. The same generator writes one client-safe module, src/generated/notice-list-counties.ts: the FIPS of counties with at least one entry and whether any entry exists, never an id (Leo accepted that county-level presence is public; the boundary test names it as the one allowed module). A free tool asks the server ONLY where the list can matter: rows from a county in that set, rows from a statewide layer while a county in its state is in that set, or rows from a layer the atlas does not know while any entry exists. A pasted or converter URL is first looked up in the atlas (resolveLayerCounty, keyed by guardKey, the key the owner-withhold uses: host and path case, a trailing slash or /query, the query string, any port, //, /./, http/https, percent-encoding and a padded, signed, hex, octal, binary or exponent layer number do not matter, and for the county, its credit and the county access switch neither does MapServer for FeatureServer under the same service path, sourceKeys; a URL that routes to the layer through a proxy, with the layer's host and path after the proxy's, with or without a second scheme, percent-encoded or nested, is keyed by its upstream, resolveUpstream, so the proxy's host never stands in for the county's, and a proxy form whose upstream cannot be established, or that carries it in the query string, is refused before anything is asked): a layer that one county registers, with no scope, is that county's, so an unlisted county's layer makes no call. An unregistered layer of a SERVICE that one county alone registers (findServiceCounty, keyed by serviceKey: PASDA's BerksCounty MapServer/5 beside Berks' registered MapServer/6) is that county's too, under its credit, so the switch and the owner-withhold see it; a service several counties register, a scoped one, a statewide one or one whose endpoint carries sharedService: true (one county registers it, but its record says the service covers other counties: Vermont's VCGI, Hawaii's ParcelsZoning, Denver's and Anchorage's statewide composites; validate-atlas requires the marker then) places nothing, though for a marked service the free tools' county access check still asks about every county registered on it (switchCounties, sharedServiceCounties: a pause on Chittenden holds VCGI's other layers; fail closed). A layer registered under a scope or by several counties (NC1Map, Nebraska's, New York's and Florida's statewide layers) also holds counties the atlas does not register on it, so it has no county. It does have a state: each of the 17 such layers is registered within one, so it is checked only while a county in that state is listed (a Kentucky entry never touches a Florida or North Carolina layer). Massachusetts registers its two with no county FIPS, so like a URL outside the atlas they are checked while any entry exists. Everywhere else it makes no call and shows the county's rows as published; the county's own marker still applies. With the list empty, as it ships, the free tools make no call at all. Where it does ask, after fetching rows it POSTs { countyFips | null, parcelIds[] } for the rows on screen that need it (each distinct id once) to /api/atlas/withhold-check (src/lib/withhold-client.ts), which answers with the INDEXES to withhold and nothing else; the page applies the pure rules. In a known county a row needs it when it carries an owner, mailing or situs value; with no county, only a parcel row does (an owner or mailing value backed by a parcel id, a mailing line or a situs), so address points, schools, hydrants, polling places and roads are never withheld for the notice reason. An owner column is read in its compact spellings too (OWNNAME, OWN_NAME, OWNNM1, O_NAME, NAMEREAL, BILLNAME); a FIRST_NAME or LASTNAME, like a bare NAME, names the owner only beside a parcel id and a filled situs or mailing column on a layer with no county (by the column name alone), and a FULLNAME (a road, a school) never does by its name alone (a registry label or role can still mark it). Which ids a row CARRIES (recognition) is decided apart from which may LEAVE (transmission), and a row that carries an id which was not sent can never be cleared: it FAILS CLOSED, whatever the sent ids answered (parcelIdCheck's unsent). Recognition is broad: the registry's id column, every column named an id, and every parcel-like column (ParcelJoin, CleanParcelID, GISLINK, HCAD_NUM, PARCEL_REF; Philadelphia's brt_id, "BRT Account Number") that is not a type, size, use, status, date, count, class, link, deed or plat folio, lot, block, row id or address, and the map, PVA, GIS, roll and assessor numbers no rule sends (MAP_ID, MAPNO, MAP_NUMBER, PVA_ID, TAXMAP, GIS_ID, UNIQUE_ID, LRSN, ASSESSOR_ID, ROLL_NO...; PVANUM left this set in atlas 0.6.37, when Fayette KY's registry record made it a parcel-id column, so a column of that name is now sent like every registry id name). Transmission is narrow. On a layer the atlas registers, the id sent is the registry's parcel-id column (the one the server classifies), and the registry's owner, mailing and situs columns (by the paid classifier) count as identity too; on any other layer, every column whose NAME says it holds an id is sent and a match on any one withholds the row (isIdNamedColumn: the atlas registries' own id column names, generated at build time into src/generated/registry-id-columns.ts, so a mirror of Bradford's layer still sends ParcelJoin; TMS, TAXLOT, REID, AIN, UPI, PCN, MBL, MAPBLOCKLOT; and isIdShapedColumn, an allowlist grammar read in one linear pass: PIN, APN, PIDN, PAN, PARCEL_ID, PARCELNO, ACCOUNT, ACCT_NUM, BBL, TAXKEY, PROP_ID, GEO_ID, LOC_ID, PRINT_KEY, SWIS_SBL_ID, MAPTAXLOT, CAD_REFERENCE_NUMBER...; never PARCEL_TYPE, PARCEL_SIZE, a depth or width, a use code, a status, a date, a count, a class, a URL, PARCEL_BLOCK or PARCEL_SUB, never ACCT_LAST, ACCT_TENANT, PARCEL_STR or PARCEL_PRIMARY, and never a house number such as LOCNUM or PROPLOC_NUM). An alias that reads as a name, an address, a mailing line or a situs ("Mailing Address" on a PIN) keeps even a real id's name from being sent; the column is still recognised, so the row fails closed. The one exception is the county's own id column on its registered layer. On a statewide layer both are sent: a list entry is keyed on its county's own endpoint id, so NC1Map sends parno and altparno and Nebraska's layer Parcel_ID and State_PID. A match there depends on the statewide layer carrying the county's id in the format the county publishes; where it does not, the entry protects nobody on that layer. Polk OR's AcctTable_OBJECTID and AcctTable_In_Care_Of are not ids; AcctTable_Account_ID is. No value over 120 characters, none without a digit, none that starts like a street address ("100 OAK ST", "1234 N 5TH ST", "12-14 OAK ST", "1ST AVE", "12TH AV", "N123W12345 MAIN ST") or a grid address ("1234 E 5600 S", "350 S 200 E"), none with a street suffix after a number ("12 OAK DR"), none with a rural route or box word ("RR 2", "HC 61 BX 12"), none starting with "#", and none with a word of three letters or more that is not an id word (LOT, BLK, BLOCK, MAP, SEC, TWP, RNG, SSL, PAR, PCL; "_" separates words) is sent: "MAP 12 LOT 34" is sent, "SMITH 2", "UNIT 12", "P.O. Box 12" and Orleans Parish's address-built PARIDs ("622-SALEXANDERST") are not, and those rows fail closed. NO column that is an owner, mailing or situs column, whose name or label (with or without a join prefix) reads as an address, a place, a mailing line, a care-of or attention line, an agent, a holder or a name, or that is a legal description or a measure (isSendableIdColumn: PARCEL_ADDR, PARCELADDRESSCITY, AcctTable_MailZip, AcctTable_In_Care_Of, ACCT_HOLDER, a FLD7 aliased "Parcel Owner Name", NC1Map's parcellgl, Acct_Acres) is ever sent, the registry's id column included; the real ids LOC_ID, LOCATOR, PIN, PARCELID, PARCEL_ID, BBL, TAXKEY, PROP_ID, ACCOUNT and ACCT_NUM are kept. That is what makes "names and addresses are never sent" true. That endpoint requires our Origin (a request without one is refused), takes at most 500 ids and 64 KB (a bounded byte read), needs no key, is never billed and is not in the public OpenAPI. It logs no request content: no id, no county, no count. A 5xx answer (503 when the limiter is unreachable) writes the route, status and error code to the server-error log; the limiter keeps a per-IP id count in Upstash for its window; the platform's own request log records path, status and client IP, never the body. It FAILS CLOSED on the page, per chunk of 500 ids: rows with an id in a chunk the server did not answer, or a row naming someone with no parcel id to check, are shown without owner, mailing or situs, the rows from answered chunks are kept, and the page says owner details are unavailable and for how long. Pages with no county match the id in any county, which can only over-withhold. validate-atlas fails a notice-list entry whose county is not an atlas county, one where an endpoint the county answers from has no classifier parcel-id column (NYC's BBL, Waukesha's TAXKEY: the paid surfaces could never match it), one whose classifier parcel-id column reads as an address or a name (Onondaga, Suffolk and Westchester's PARCEL_ADDR: the free tools never send it), and one whose parcel id, as written, the free tools would never send ("SMITH 2", no digit, a street start, a PO box, over 120 characters). A row whose id column holds a value with a digit that the check refuses to send is still a parcel row: it fails closed, not served, even when another of its ids was sent and came back unmatched.
The endpoint is a per-id oracle by nature: anyone may ask whether a given id is listed. It is rate-limited PER ID, not per call (1,000 ids a minute and 3,000 an hour per IP), and it FAILS CLOSED: when its limiter store is unreachable it answers 503 and the page withholds. On a 429 the page waits for the window the server names (retry-after, up to 65 s, so the per-minute burst) and retries once. A longer wait (the hourly budget) is remembered for the whole tab (refusedUntilMs): until it passes, no page and no later lookup asks again; the rows that need the check are withheld with the time left shown, and rows that do not need it are untouched. The converter's cost, only on a layer in a listed county, a statewide or shared layer in a listed county's state, or a layer outside the atlas: one id per distinct id-column value on rows that need the check, so a 1,000-row page with one id column is 1,000 ids. The first page goes at once; the second, third and fourth each wait out the minute's burst (about a minute each), and the fourth is then refused for the hour (3,000 ids). From there on pages make no call and wait for nothing, their rows withheld with the hour's remaining wait shown. Measured with the real handler and limiter: a 20-page conversion keeps 3,000 rows in about 3.5 minutes (11 minutes before the refusal was remembered), a 50-page one keeps 3,000 rows in about 4.3 minutes (26 before), and a layer from an unlisted county makes no call at all. On a layer whose county is unknown, a row is in scope only when it has a non-blank owner or mailing value AND a parcel-id candidate, a mailing column or a situs column; a bare NAME counts as the owner only beside a parcel id AND a filled situs or mailing column (Kentucky's main PVA schema: NAME, LOCATION, ADDRESS1 on McCracken, Shelby, Franklin and others). A park, a school, a building, a permit or a subdivision with a NAME and a parcel column but no situs or mailing column makes no call: a road centerline with OWNER "STATE" has no location for a person and is never withheld, while owner + id, owner + situs and owner + mailing rows still fail closed. The protection is about where a person lives. Residual risk, Leo's to accept: someone holding the county's own data can compare it with a withheld row on our surfaces and learn that the parcel is listed; withholding cannot hide the fact that it withheld. The list ships empty, and geometry is withheld only where a surface returns it (the free GeoJSON converter and Parcel Lookup); no paid surface returns geometry.
5. Billing and metering#
The principle is one sentence: a customer is never charged for a field the county cannot provide. A plan key's unit is drawn before the lookup and credited back best-effort. Bulk, MCP enrich_address, radius, and lookup's no-endpoint, paused and county-down answers say when that credit did not land; on lookup's other exits a failed credit can leave the unit counted without the response saying so. When the usage meter is unavailable at the draw, bulk and MCP enrich_address answer that the service is temporarily unavailable, attempt no credit, and the unit may still count.
Quotas are per user, keyed on the immutable user_id, never on api_keys.id, because keying on the key let a user reset their counter by revoking and reissuing. The window is tier aware: the Individual plan is sold per calendar month, free and pro are per UTC day, and one function (quotaWindow) decides which.
Bulk enrichment charges one unit per address up front (keyQuota with cost = addresses.length) and refunds after. Whether an outcome is chargeable is answered in one place for every product and every tier: billableOutcome in src/lib/billing-decision.ts, a pure function with no tier argument. The tier only picks the mechanism that carries the answer out: a plan refund or a reservation settle, or the pay-as-you-go meter. REST bulk, the MCP enrich_address tool, lookup, radius and county all call it, and every exit on each of them settles through one step that reads the same decision for both tiers. On enrichment a plan key is refunded exactly when a pay-as-you-go key is not metered. Lookup is the deliberate exception. Its plan and free draw is a per-call rate limit, so it stays spent on every exit but four. A county we cannot serve, an outage on our side, a paused county, and a county whose own server the liveness probe reads as down each credit it back, best-effort, while the pay-as-you-go meter follows the decision. Those free exits are bounded per account: a keyed lookup that charged nothing counts toward a never-refunded cap per UTC day. A charged call never counts, nor does an upstream outage (a 502, 503 or 504; a 500 counts), a pay-as-you-go answer for a served county from a stale cached geocode, or a pay-as-you-go 402 usage_not_recorded other than one whose op token was minted for another address or another tool. The cap equals the account's daily limit, at most 10,000 (unbilledExitDailyCap in api/_lib/atlas-gate.ts); the counter is read before the gate draws, and at the cap the account's lookups get a 429 unbilled-limit until midnight UTC. MCP enrich_address counts into the same counter by the same rule. Radius owner lists (REST radius and MCP radius_owners) keep a counter of their own with the same cap: every radius exit that did the upstream work and charged nothing counts, a geocoder or atlas outage never does (radiusExitCountsAsUnbilled in api/_lib/radius-charge.ts). Before billableOutcome existed the same question had four inline answers, and they disagreed: pay-as-you-go metered a parcel-number-only row that plan refunded, and metered a source-updating row because its predicate never read the error.
The policy lives in one table at the top of that file, one constant per pricing call. The decision does not charge caller negatives (no geocode match, no parcel, an ambiguous match), a parcel-number-only row from a county that cannot publish owner names, one from a county that does whose owner and mailing cells are blank or a placeholder (Leo, 2026-11-01), or an unindexed county. So on every product a row bills only when it delivers an owner name or a mailing address. Pay-as-you-go never meters those rows. On bulk and MCP enrich_address a plan key's unit is drawn before the lookup and credited back, best-effort, and refunded (bulk) or plan_quota (MCP) says what was kept; radius settles its reservation to the rows that bill, and charged says what was kept. A stale cached geocode is served and not metered for pay-as-you-go, while a plan lookup keeps its per-call draw. County metadata draws no unit on any tier. A mailing-address-only row is billed. That last one is load bearing: Pima AZ and Riverside CA return mailing addresses without owner names, and refunding those gave the product away free. Radius bills one unit per returned parcel that carries an owner name or a mailing address, but it runs only where a layer has an owner-name field: a county that publishes mailing addresses and no owner names (Pima AZ, Riverside CA) is not radius-covered, because radius returns one mailing line per parcel and a notice list built from line 1 alone may be unmailable. Covering those two is a separate constant that stays off until Leo decides it. Flipping a constant moves every product and every tier together; a test flips each constant through the real handlers, and a wiring test fails if a call site stops asking.
The radius product is harder, because the parcel count is not known until after the query, and the query is the expensive part. The shape is reserve, query, settle (api/_lib/radius-charge.ts):
- Reserve up front, before the county call, so no billable unit is handed out uncounted. The reservation is sized by
clampReservation(cap, peek), which ismin(cap, max(1, remaining)). Without it, an Individual subscriber got roughly one radius query a month: the flat reservation is 500 and the monthly quota is 500, sobefore + 500 <= 500holds only atbefore === 0. - Every non billable exit settles the operation to zero before returning: over quota, no geocode, county not covered, our own failure.
- A covered answer settles down to the rows actually served, then releases the data.
A layer that refuses pagination (supportsPagination: false, section 1) changes the query and not the billing. Both billed paths read the record before they build the request (resultRecordCountFor in api/_lib/arcgis-quirks.ts returns null for a flagged layer, whatever the caller asked), so the request carries no cap and the server returns at most its declared maxRecordCount rows, 2,000 on the Mississippi statewide layers, with exceededTransferLimit set when more matched. A ring the server cut is billed exactly as any truncated ring, one unit per served sellable row, and carries a note saying that a larger max_parcels cannot complete it (the count_only preview carries the same note), and on MCP two fields an agent can branch on without parsing prose, server_cut: true and server_cap, the server's row ceiling; a 30 m enrichment buffer the server cut is the refundable source-incomplete, never a pick from an arbitrary subset. The over-fetch is our cost, and two things bound it: the floored-endpoint guard, which now also counts every query against a flagged layer toward the same 30 per hour per account, and a 12 MB cap on the body of any billed county response, above which the ring is unavailable and refunded in full rather than parsed in part. The guard's bucket is the account, or the key id when the key row carries no account; a row with neither is refused on a flagged layer (the limiter's 503, refunded) rather than let through uncounted. The guard's refusal is not a county outage on either surface, with one shared sentence naming the budget and the wait: on REST it is a 429 whose code is layer-scan-rate-limited, the x-ratelimit-* headers carry the plan quota exactly as a 200 does (never the scan limiter's figures, which a client read as its plan spent), and Retry-After is the limiter's; on MCP it is, like every tool failure, a tool error inside an HTTP 200 (isError). On a flagged layer the guard fails closed, so a limiter that cannot answer refuses the uncapped scan (a 503 naming the limiter, refunded) instead of letting it through uncounted, while every other layer keeps the fail-open it had; the MCP count_only preview, whose bound is its own preview limiter rather than a per-account bucket, fails closed the same way when that limiter is degraded (preview-limiter-unavailable). Two behaviours the guard changed on a paging layer where the floor binds (Florida under 501 rows) are kept by decision: an account with a key but no user id is counted under its key id, where before it passed the guard uncounted under an empty bucket, and a count_only preview with neither id counts under the shared empty preview bucket, bounded at ten an hour. The cap bounds what is parsed and billed, not what is cached: Upstash takes about 10 MB per request, so a body between those two figures is served and billed while its cache write is dropped and logged as the key's namespace, a hash of the key, the byte size and the type of the store's answer, never the key (it carries the layer URL and the ring's centre), the value or the store's text.
Every failure the ring can end in says what it was. A timeout, a 5xx or a connection reset on a flagged layer carries the cold-start note; an oversized body carries its own note (a smaller radius or a GeoJSON upload, no retry will complete it) on any layer; a 429 from the county server, as an HTTP status or in an ArcGIS error body, carries its own (retry in a minute) and is not retried; an ArcGIS error body with any other 4xx code, whether the code is a number or a numeric string, is the server refusing this request, so it is not retried and carries no note, and a 400 naming pagination is logged as a registry defect with the endpoint URL for the liveness cron to act on. A 5xx body is retried once as the cold start; one with no readable code is retried once too but is not a cold start and carries no cold note, and so is a 200 whose body is not JSON, while a 200 whose body was cut off before it ended is the transport's failure (a timeout or a reset, with the cold note on a flagged layer), not malformed JSON. A stale cache entry refused for billing carries no note of its own.
The two Mississippi layers also carry a radius-only quirk, maxAllowableOffset=0.00001 (about one metre), because their parcel polygons are vertex-dense enough that a downtown half-mile ring came back as 9.5 MB and timed out; with the server generalising the geometry it is 1.5 MB with the identical row set. The tolerance is a statement about the ring edge: a parcel whose boundary lies within about one metre of the circle can be classified either way, and that is inside the metre-scale error the Census geocode and the buffer already carry. It is symmetric, it never changes which rows a query that clears the edge returns, and it is keyed to the exact layer URL (trimmed, no trailing slash), not to the pagination flag, because vertex density is a property of the layer and not of its paging; a sibling layer on the same server never inherits it. Only the radius path sends it; the 30 m enrichment buffer returns a handful of parcels and keeps the full geometry. A flagged layer is also slow to wake (8 to 25 seconds on the first call after an idle period, measured), so the radius query gives it 15 seconds instead of 8 and the enrichment lookup 10 instead of 6; a cold start that still misses is refunded. A radius answer (REST and MCP radius_owners) says so with a note to retry in about 30 seconds; an enrichment row (REST bulk within its row deadline, MCP enrich_address within the request deadline described below) carries county-unavailable and no note.
Those windows are per attempt, and nothing in them may stack past the platform. A radius request carries one deadline from the handler's first line, 21 seconds, through the charge into the query, and every stage is clamped to it, not only the county attempt: the Census geocode and its cache read and write, the atlas state load (3 seconds at most), the scan limiter call, the parcel cache, each county attempt (a retry runs on the remainder of the 15 seconds, never a fresh 15, and the back-off re-reads the clock so no attempt starts with under 50 milliseconds) and the failover budget. A cache call with under 50 milliseconds left is skipped rather than started, a limiter call that could not finish by the deadline is refused as request-deadline, and a query that reaches the deadline ends unavailable and refunded with 4 seconds left for settlement (two store attempts of 1.5 seconds and a quarter-second usage row, 3.25 at worst) before the Edge runtime's 25 second cut, which would otherwise skip the refund. The last thing a REST 5xx does, the server-error audit row, is given what remains of those 25 seconds less 250 milliseconds, headroom for platform timers that fire late (the route hands the wrapper its budget), and is skipped with one warning when that leaves under 50, so its timer is set to fire by 24.75 seconds and a late timer still has a quarter second before the cut; on MCP the capability lookup that follows a not-covered settlement carries the same deadline with a 3 second cap. A county-not-indexed answer on either surface also records county demand; that write is handed to waitUntil and holds nothing. Where no request context offers waitUntil the write is awaited, so it carries a deadline of 24.5 seconds, is clamped to what remains less 50 milliseconds, and is skipped with one warning (demand-write-skipped) naming only the county code when under 50 remain. Where waitUntil exists but throws, the write has already started at its own 3 seconds; it is then awaited only until the same deadline less 50 milliseconds, and if the deadline wins it is left in flight, unawaited, with one warning (demand-write-abandoned) naming only the county code. Nothing after settlement is unbounded on either surface. The reservation itself is taken only while those 4 seconds still fit: a request whose authentication or metering has already spent more than 17 of the 21 seconds reserves nothing and is refused, on REST as a 503 request-deadline, on MCP as an HTTP 200 tool result with isError: true and a sentence saying so (no structured error code). MCP enrich_address runs on the same arithmetic: it draws nothing once fewer than 4 of the 21 seconds remain, neither a plan unit nor a pay-as-you-go key's safety-ceiling count (the same refusal, no meter, ledger or replay call), the lookup carries the 21 second deadline into every stage below, so a flagged county that stays cold ends county-unavailable and the unit is refunded (one 1.5 second store call) with the usage row after it, and the owner-capability lookup and the county-demand write that can follow carry the 24.5 second deadline of the radius tool's not-covered answer. Bulk hands each row's deadline into the enrichment the same way, half a second before its own race timer, and the geocode, its cache and the county fetch are all clamped to it, so a live geocode cannot push the county fetch past the row cut: the attempt is clamped to the remainder, the in-flight request is aborted there, a cache write that no longer fits is skipped, and the row comes back county-unavailable (refunded) through the lookup rather than timed-out through the backstop, with nothing still querying the county after the cut.
One more thing REST and the MCP tools now agree on: a layer whose attribute search is unsupported publishes an empty searchable_fields on both, with search_note saying why; REST used to list the columns beside a note saying a typed query against them does not finish.
Settlement is a Lua script with a per operation marker written before the INCRBY, so an indeterminate reserve can always be reconciled: a settlement sees the marker if and only if the reservation reached the mutation. Retries are idempotent. Every completed call leaves an s: marker, including exact cap calls that refund nothing, because short circuiting the zero refund case parked those at r:<n> forever and made them replayable.
I wrote one trade into that file explicitly. If Redis is reachable at reserve and unreachable across both settle attempts, the rows are still released. A review flagged withholding them as a blocking defect: the reservation is already confirmed and greater than or equal to the amount billed, so the customer has already paid, and refusing the data charges them for nothing. The reported charge falls back to the full reservation with zero credited. The accepted cost is that a retry during that outage window can re-serve data the caller already paid for, plus one extra upstream county call. That is the right side of the trade against billing someone for a response they never receive.
Limits are layered by what they protect. bulk puts a 60 requests per minute per IP cap *in front of* API key validation, because the gate's failure path performs an awaited service role INSERT into usage_events, so credentialless spam would otherwise convert directly into unbounded database writes. That limiter fails open, and when it degrades the endpoint tag is dropped so the gate's insert does not fire at all: the denied attempt observability is sacrificed to keep the bound. Everything else fails open, because these are abuse prevention on public endpoints and not a security control. The one exception is the metered bulk path, which fails closed with a 503 when the limiter is degraded, because you must never hand out billable units you cannot count.
6. Guard integrity#
The recurring failure in this codebase is the check that stopped checking and stayed green. Three examples.
The contract test that pinned two schemas and not the third. src/lib/__tests__/openapi-schemas.test.ts asserts that public/openapi.json documents exactly the county fields the handler returns, no more and no fewer, in both directions, by shaping a real county through shapeCounty and diffing the key sets. The same rule existed for Endpoint. It did not exist for ParcelRow, which drifted to documenting 7 of its 15 fields. Among the eight missing was owner_data_available, which is what a caller branches on to know whether owner data is possible at all, and what plan quota refunds keyed off at the time. A paying integrator reading the published spec could not discover the field that determines both what they get and what they are charged. A contract test that covers every schema except the one on the money path looks complete and is not.
That file also carries vacuity guards for itself. On an OpenAPI parameter, pattern sits under schema while example sits one level up beside it, so a walker looking for both in the same object finds zero pairs and passes green. The test asserts a minimum count of pairs found, so that specific emptiness fails loudly. The defect that prompted it: the FIPS pattern shipped as ^d{5}$ after a lost backslash, so the published contract rejected 17089 and accepted ddddd, the exact inverse of the handler, and every existing test passed the whole time because none of them ran a value through a pattern.
An exemption list that could only shrink. I added a rule to validate-atlas.mjs: prose citing law must be backed by a structured, validatable record, since structured records are checked and prose is not. Six counties already violated it, so the rule shipped with a PENDING_LEGAL_REVIEW allowlist that could only shrink: a county left by gaining a reviewed record, and a *new* county citing law failed immediately rather than joining the queue. When those six were corrected the list reached zero and the allowlist was deleted, making the rule unconditional. It is gone because it emptied, not because it was waived. Sabotage verified by injecting a law citation into Sonoma, a formerly exempt county, and watching it fail.
A detector for the class of bug that makes a rule go quiet. The commit correcting those six county notes used a regex ending in [^.]*\. and 7928.205 contains a period, so each replacement stopped at 7928. and left 205 restricts owner and mailing-address data from public REST endpoints. dangling in five counties. Sonoma's fragment resurrected almost the entire debunked claim. validate-atlas stayed silent, because its law-in-prose rule anchors on the citation phrase, and the botched replace had removed exactly that phrase. The rule went quiet because the edit was broken. A passing check on mutated content proves the check no longer matches, not that the content is right. The independent signal added is that county prose may not contain a close paren immediately followed by a digit, which is the precise signature of a replacement that stopped inside a citation. The first version allowed whitespace and false-positived on a phone number in Stark County OH, so it was tightened to the no-whitespace form and confirmed at zero matches across all 155 counties in the registry at the time.
The same instinct runs through CI (.github/workflows/ci.yml). tsc --noEmit exits 0 just as happily over an empty file list, so the step that typechecks the test suite is followed by a step that counts how many test files the program actually loaded and fails under 100. That guard exists because tsconfig.app.json excludes src/**/__tests__/**, so the main typecheck had never looked at a single test file and exited 0 with 15 real type errors in the suite, including 10 fixtures missing a field production code had added. Lint is a ratchet against a recorded baseline of 92 rather than a gate at zero, because a gate that must be ignored on every pull request teaches people to ignore gates, and the ratchet fails loudly if it cannot parse its own metric.
Current state on main: typecheck clean, 3,132 tests, lint at baseline, validate-atlas passing 568 counties / 539 endpoints.
7. Surfaces and consistency#
Four surfaces, one registry. The things that keep them from drifting:
- One classification, one biller. The SDK exposes
reviewedCapabilityandisReviewedUnservable, which read the human entered override. It does not derive the mechanical half fromsearchFields, even though it ships the data to do so. A second implementation of that classification would drift from the one the API bills against, and a consumer would have no way to tell which was right. The SDK says to readendpoints[].searchFields(andownerJoin.fieldson a joined record) for the mechanical answer and treat a reviewed entry as outranking it. - One copy for one refusal.
radiusNotCoveredMessageinradius-charge.tsreturns the not-covered explanation used by both the REST handler and the MCP tool. The handlers differ only in shape: REST maps outcome kinds onto HTTP statuses and headers, MCP maps the same kinds onto sentences an agent can read. - Derived counts, never typed ones.
COUNTY_COUNT,ENDPOINT_COUNTandPOPULATED_STATE_COUNTinsrc/lib/atlas-data.tscome fromatlasIndex.totals, after an audit found hardcoded 117 and 128 counts drifting across/developersand/mcp. - Derived artifacts rebuilt on push.
.github/workflows/atlas-artifact-sync.ymlregenerates the npm package's bundled data, the download directory,llms.txt, the search index, sitemaps and the prerender route list wheneverpublic/data/atlas/**changes on main. Vercel rebuilds the site from source every deploy, so the site was always current, but the npm package is built from the committed copy, which is how@urbankitstudio/atlas@0.5.1shipped Montana pointing at a host that had stopped resolving. - The published health URL is a value, not a string in a doc. The SDK exports
LIVE_STATUS_URLso consumers do not hardcode it, and the bundledstatusfield is documented as a publish-time claim with a pointer to where to ask what is true now. - One reader for "does this layer page".
offersPaginationsays no only on the literalsupportsPagination: false, and every surface that builds a query asks it: the API's radius and enrich paths, the liveness probe (an inline copy held equal by test, since the cron is import-free), the free tools (one request withoutresultRecordCount, the first rows taken client-side, the server's cut shown as a cap with no page 2), the MCP and the CLI. The CLI sends no ArcGIS query itself;uks countyanduks lookupcarrypaginationandmax_record_countper endpoint and end thesearch_notewith the same sentences the hosted tools write, held equal by a parity test, so an agent reading either is told to send one request and narrow it. A static guard (pagination-wiring-guard.test.ts) fails when a file writes either paging parameter without asking the reader first.
8. What I would do next, and what I would do differently#
Correctness benchmarks now exist, and cover one county. This was the largest gap and section 4.2 says how far it has closed. /benchmarks publishes a real measured number per metric, with the sample size on every one, which is enough to stop the liveness work implying a guarantee it does not make. It is not enough to speak for the atlas: the seed is concentrated in Cook County IL, and owner name correctness has no number at all. Recorded fixtures now replay in CI, the weekly re-run opens each new snapshot as a pull request, and a daily staleness check fails past ten days. What is still missing is reference rows in more states, so a pooled figure means something beyond Cook County, and a fix for the rows where a site address exists and the match still could not be made.
The atlas is statically bundled into the client, and that caps growth. src/lib/atlas-data.ts imports 52 JSON files synchronously so react-snap prerenders real per county content instead of a loading state. That is the right call for SEO and for a page per county at 568 counties and 2594 KB. It is the wrong call at 1,500 counties. The fix is a per state code split or a data route with the prerender reading from disk, and it should happen before the next large county batch, not after.
The usage ledger now records every keyed surface, and for a while it did not. logUsageEvent was first called only from api/atlas/bulk.ts and from the gate's rejection path, so api/admin/usage.ts, which aggregates that table into a 30 day chart, showed an empty chart for any customer who was not using bulk. That was the direct descendant of the incident in 4.3: the whole reason usage-log.ts was written is that a cancelled trial could not be explained. Radius (REST and the MCP radius_owners tool), lookup (free, plan, anonymous, and the PAYG single lookup) and the MCP enrich_address tool now write one row per gated request, placed after the billing outcome is final and derived from the same variables the response reports. Units mean one thing on every surface: what the caller's meter was debited for the service delivered, after refunds. A PAYG answer is one metered unit; a keyed free or plan answer is the quota-window allowance units it drew (per day on free and pro, per month on individual; one for a lookup, the parcel count for a ring); an anonymous answer under the per-IP throttle is zero, because that throttle is not an allowance anyone holds, and so is a keyed answer the gate let through under a degraded limiter, where the draw is indeterminate rather than absent (the increment can commit before the reply fails), so that row claims nothing and carries its own reason, ok-unenforced, to stay countable instead of passing as a confirmed no-draw answer. A PAYG replay records not-billed rather than a second billed unit. A settlement that cannot be confirmed records refund-failed: with the full reservation as units when a ring was served, since the caller may really be short that many, and with zero units when the settle-to-zero of a failed request did not confirm, since the true figure is unknown and phantom units would overstate the chart during the incident it should explain. A plain refund (lookup, bulk, enrich) records refund-failed only when the quota store refuses the credit, and refund-unknown with zero units when no answer confirms it, since it may have landed; an exit owing back a draw that a degraded limiter could not confirm records draw-unknown with zero units and is never credited blind. county writes one not-billed, zero-unit row per answer: it is a metadata read of our own index, never charged on any tier, so a keyed call draws no allowance unit and is bounded by a separate per-key daily ceiling instead, the key's own daily limit or the pay-as-you-go safety ceiling, whichever is lower. A plan lookup's row says what happened to its unit: the per-call draw is kept on every exit, a stale geocode included, so the row is billed, except for a county we cannot serve, an outage on our side, a paused county and a county whose own server the probe reads as down, whose draw is credited back, best-effort, and recorded as refunded when the credit lands. The admin read that draws the chart orders newest first under its 20,000-row cap and reports truncated when it hits it, and a window made only of zero-unit discovery rows counts as data, not as an empty chart. With those in place the chart can carry a pricing decision.
What I would do differently. I would have modeled capability as more than a boolean at the start. The registry answered "does this county have an owner field" from day one, and every downstream feature (billing, refunds, the radius not-covered message, the SDK surface) was built on that answer before anyone asked what the field's absence *meant*. Retrofitting a four state model with typed evidence through four surfaces and a billing path cost far more than getting it right once would have, and the trial user paid the tuition. The general lesson is narrower than "model things carefully": when a field's absence has more than one possible cause, and the causes have different consequences, the type has to carry the cause. A boolean that collapses "the county did not publish it" and "the law forbids it" will eventually be read as the second when it meant the first, and it will be read that way by a customer.
The build checks this page against the repository's ARCHITECTURE.md on every deploy and fails on any difference.