> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hermesco.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> What the hosted desk does on a county click, and how that differs from the contract API.

A county click on the hosted desk reads a snapshot that a Zetaris chain already produced. The formula has already ranked the rows. A stored Nemotron draft is already attached, or the failure is already attached. The browser does not re-rank and does not call a model.

## Hosted read

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
GET /api/national
  -> web/data/national/published/catalog.json

GET /api/national?county=35013
  -> counties/35013.json.gz
  -> { phase: completed, publication.mode: published_sweep_snapshot }
```

`web/src/app/api/national/route.ts` serves that pack when it is installed. Public responses use `Cache-Control: public, max-age=60`. `POST` is refused unless the request is same-origin on loopback.

The call sheet is `web/src/components/operator.tsx`. The evidence drawer is `web/src/components/evidence-drawer.tsx`. Contact rows stay in `localStorage` on the device.

## What produced the snapshot

On the operator machine, a national job runs `engines.national_jobs` against local Zetaris. The source chain joins CMS facility rows, Census address and county coverage, CDC/ATSDR SVI, and HHS emPOWER ZIP context. Those relations share one read-only PostGIS datasource, registered as `porchlight_postgis`. Match counts are SQL counts. The sweep that the host publishes is `20261023T200048Z-78a426ba`.

Ranking then applies `national-source-screen-v1` from `data/scoring/weights.yaml`. Nemotron, through Meterless `meterless/deep`, selects source clauses for a draft. A failed draft stays on the row as `status: failed`. The UI does not fill it with computed prose and call that a model reply. The computed reason on the row is separate, and the drawer labels it that way when no model text is approved.

## Contract API

`contract/openapi.yaml` (PR #14, on main) is the shared contract: `/alerts`, `/runs`, joins, trace, check-ins, export. The generated pages under API reference describe that contract.

The shipped Next app does not mount those paths. Its routes are:

| Route | Role |
| - | - |
| `/`, `/nationwide`, `/operate`, `/watch` | Pages |
| `GET /api/national` | Catalog, published county, or local job read |
| `POST /api/national` | Local-origin catalog refresh, call script, or new run |
| `/api/weather/*` | Local weather and radar captures |

Read [API reference](https://docs.hermesco.ai/api-reference/introduction.md) before you treat a contract example as a live call.

## Country shape

US sources sit behind `contract/adapter.md` and `data/adapters/us/`. The contract types are country-agnostic. A global adapter is a stretch goal in that document. It is not operating coverage. See [Country adapters](https://docs.hermesco.ai/country-adapters.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.