Introducing a new way to review your PRs.

Read the announcement

koala73 / worldmonitor

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

View on GitHub

29 documents · Updated Nov 20, 2026

docs / api-platform

API platform

The API platform gives browsers, desktop clients, agents, and integrations one HTTP surface for World Monitor intelligence and account services. It joins typed domain reads with bootstrap data, account flows, briefs, notifications, backend relays, and agent protocols while keeping identity, access, freshness, cache, and error rules consistent.

Platform shape

The platform separates public data reads from account actions and agent protocol access. Versioned domain routes expose monitoring data. Focused routes serve bootstrap data, sessions, briefs, notifications, commerce, embeds, webhooks, health, and discovery.

Requests move from a public URL through a route family and shared admission rules. The request then reaches a domain handler, crosses a controlled backend boundary, or returns a protocol response.

This diagram shows the main caller paths and the point where shared protections apply.

flowchart LR
    C[Browser, desktop, integration, or agent] --> S[HTTP surface]
    S --> D[Versioned domain API]
    S --> A[Bootstrap, account, brief, embed, or webhook route]
    S --> P[Agent protocol surface]
    D --> G[Shared request gateway]
    G --> H[Domain service handler]
    A --> R[Backend state, relay, or rendered brief]
    P --> M[MCP, OAuth, A2A, NLWeb, or content response]
    H --> O[Seeded data, live provider, or service state]
    R --> O

Public HTTP surfaces

The public surface supports typed JSON data, bounded bootstrap bundles, health and discovery documents, feed and content views, HTML pages, rendered brief media, and agent responses. New JSON data APIs use the generated domain contract path. External protocols, binary responses, HTML, upstream proxies, and operator routes remain explicit exceptions because their wire shapes come from a client or operator contract. The exception manifest is the reviewed escape hatch for these routes. (api/api-route-exceptions.json• L1-4, api/api-route-exceptions.json• L69-80)

Browser routes allow approved World Monitor hosts, trusted previews, supported desktop origins, and local development origins. The allowlist also supports the controlled Google Translate form of an app host and normalizes a trailing DNS dot for matching. Production does not trust bare localhost, and previews trust only the deployment URLs owned by the current preview. Refused origins receive a readable refusal response, including on preflight. Caller-invariant public data can use wildcard CORS only after the origin check has run. The CORS contract exposes retry, billing-verification, rate, lifecycle, poll-location, bounding, and upstream-timeout headers that clients use to act on a response. (api/_cors.js• L1-27, api/_cors.js• L91-175, api/_cors.js• L177-225)

Markdown URL twins give page URLs a bounded text/markdown companion for agent-readiness tools. Site-page twins fetch the same-origin page. API twins dispatch the sibling in-process through the domain gateway and pass only network identity and origin. This keeps the twin's access, rate, cache, and status rules aligned with the direct route. (api/_md-url-twin.ts• L1-25, api/_md-url-twin.ts• L459-525, server/gateway.ts• L1085-1101, server/gateway.ts• L2935-2972)

Host-derived agent metadata accepts only the World Monitor apex or an allowed subdomain. An untrusted Host value falls back to the apex. The published auth.md skill link always points to the canonical apex copy, so metadata discovered on a subdomain does not advertise a mismatched issuer or walkthrough URL. This keeps OAuth issuers, endpoint links, and readiness guidance self-consistent without reflecting an attacker-controlled origin. (api/_agent-metadata.ts• L1-52, api/oauth-authorization-server.ts• L45-103)

The news surface also protects third-party feed access as a product contract. RSS-backed views use a reviewed source set, preserve publisher attribution, and keep source coverage separate from named outlet provenance. The MCP get_sources tool exposes those two populations separately so clients do not infer licensing or editorial trust from a false join. The reviewed host set is shared with the feed path rather than inferred from caller input. (api/_rss-allowed-domains.js• L1-4, api/…/_source-providers.generated.json• L1, api/…/source-tools.ts• L1-24, api/…/source-tools.ts• L127-159)

References: api/_cors.js• L1-27 api/_cors.js• L91-225 api/_md-url-twin.ts• L1-25 api/_md-url-twin.ts• L459-525 server/gateway.ts• L1085-1101 server/gateway.ts• L2935-2972 api/api-route-exceptions.json• L1-10 api/_agent-metadata.ts• L22-52 api/…/_source-providers.generated.json• L1 api/…/source-tools.ts• L1-24 api/…/source-tools.ts• L127-159

Route families

The route families reflect the product areas that World Monitor exposes. The Domain API routes page describes domain services and route-level contracts. The Backend gateway routing page describes the shared routing path.

Versioned monitoring routes

Versioned routes serve structured monitoring and decision-support data. Their common shape is /api/<domain>/v1/<operation>. Some partner contracts use another version family, such as /api/v2/shipping.

The domains cover markets, economics, conflict, military activity, aviation, supply chains, displacement, climate, health, news, intelligence, forecasts, resilience, sanctions, and trade. The current surface also includes source search, delivered-alert history, monthly SITC trade, food-price observations, country product profiles, and orbital observation. Orbital Watch is exposed through /api/orbital/v1/<rpc> only when its feature flag is enabled; while dark, its RPCs return an uncached 404 rather than exposing a partial public surface. (server/…/handler.ts• L1-34, server/…/search-headlines.ts• L32-79, server/…/get-point-passes.ts• L102-173, server/…/get-monthly-sitc-trade.ts• L101-136, server/…/food-prices.ts• L37-97, api/…/_orbital.ts• L165-179)

Domain responses keep source state visible. A missing, stale, partial, or failed source does not become a confirmed empty result. Clients must read availability, freshness, coverage, and error fields before they interpret a value. This applies to seeded food prices, monthly trade, supply-chain products, orbital archives, and country sections. (server/…/food-prices.ts• L73-97, server/…/get-monthly-sitc-trade.ts• L94-135, api/…/country-view.ts• L352-361)

References: server/…/handler.ts• L1-34 server/…/search-headlines.ts• L32-79 server/…/get-point-passes.ts• L102-173 server/…/get-monthly-sitc-trade.ts• L101-136 server/…/food-prices.ts• L37-97 server/…/get-country-products.ts• L222-390 api/…/_orbital.ts• L165-179 api/…/country-view.ts• L352-361

Browser and account routes

Standalone routes handle work that is not a public domain read. They provide bootstrap hydration, browser sessions, API-key and embed-key issuance, briefs and share links, notification channels, customer and billing actions, desktop sign-in, embeds, and partner webhooks. These routes keep private state and side effects behind account or key checks.

Brief delivery has three related reader surfaces. An authenticated Pro client asks /api/latest-brief for a preview and a freshly signed magazine URL. The signed URL renders a private HTML magazine and may expose a public share pointer. The public hash route renders a redacted, no-index mirror for up to seven days. A matching carousel route produces short-lived social preview images. The routes distinguish an expired or missing brief from an unavailable store and never cache error pages as successful content. (api/latest-brief.ts• L1-24, api/…/[issueDate].ts• L1-19, api/…/[hash].ts• L1-19, api/…/[page].ts• L1-29, server/…/brief-render.d.ts• L4-22)

The magazine and its image teasers use one validated brief envelope. Private readers may select a matching localized sibling. Public readers remove personal fields and keep a generic subscription path. The carousel is a bounded teaser, not a replacement for the full magazine; render failure returns a retryable no-store response rather than a blank cached image. (server/…/brief-render.js• L101-166, server/…/brief-render.js• L411-445, server/…/brief-carousel-render.ts• L570-676)

Bootstrap data is grouped into fast, slow, and on-demand shapes. Public tier reads can use shared caching after origin admission. Credentialed reads and the legacy anonymous weather URL remain no-store. A public store failure returns a retryable 503 instead of an empty successful bundle. Bootstrap accepts public tier reads, anonymous weather reads, browser sessions, API keys, and desktop keys. (api/bootstrap.js• L349-455, api/bootstrap.js• L469-535, api/bootstrap.js• L541-659)

User API keys and desktop keys represent different access paths. A desktop key is checked against its owner and desktop entitlement before it can serve shared dashboard data. The desktop-key status route gives a self-hosted sidecar a non-premium verdict of active, invalid, not_desktop_key, over_cap, or lapsed; an unavailable validation remains 503. It does not reveal owner identifiers or spend the desktop data meter. (api/…/status.ts• L1-43, api/…/status.ts• L104-213)

Browser sessions move legacy readable keys into short-lived HttpOnly cookies and issue signed anonymous session tokens. Status reads and token minting have separate limits. Session responses are no-store, and a body or key that cannot be read is not treated as a valid credential. Header-only browser signals do not authenticate a request. A valid anonymous wms_ session remains a session principal and cannot satisfy a premium forceKey check; a valid protected cookie can take precedence when both are present. (api/wm-session.js• L1-39, api/wm-session.js• L171-250, api/_api-key.test.mjs• L23-42, api/_api-key.test.mjs• L60-75, api/_api-key.test.mjs• L166-201)

Notification management is an authenticated settings surface. It lets an account read and change channels, alert rules, quiet hours, digest settings, country and ticker scopes, chokepoint scopes, watched-site scopes, and reservoir alerts. Writes pass through plan capability checks, bounded per-user limits, idempotency, safe webhook or push destinations, encrypted secret storage, and a relay-owned welcome path. (api/notification-channels.ts• L1-10, api/notification-channels.ts• L441-555, api/notification-channels.ts• L703-792, api/notification-channels.ts• L821-979)

Account mutations use authenticated relay boundaries. Checkout and customer-portal actions use Clerk identity, idempotency, and fail-closed limits before they ask the billing backend to create or return a session. Notification channel writes follow the same separation. MCP's start_upgrade tool uses the checkout boundary and returns a browser URL rather than handling payment details. (api/…/checkout.ts• L1-11, api/…/checkout.ts• L107-171, api/create-checkout.ts• L106-177, api/customer-portal.ts• L53-147, api/notification-channels.ts• L441-555)

Notification publishing is a bounded internal event-write surface. It accepts authenticated Pro callers, removes relay-controlled scoring fields, validates delivery-facing text and links, and places the event on the shared queue. Notification links are safe for each delivery channel, and the anonymous suppression read lets a service worker stop navigation to an operator-blocked URL. (api/notify.ts• L40-79, api/notify.ts• L124-184, server/…/notify-fields.ts• L261-321, api/notification-suppressions.js• L1-24)

References: api/latest-brief.ts• L1-24 api/latest-brief.ts• L180-340 api/…/[issueDate].ts• L156-319 api/…/[hash].ts• L104-219 api/…/[page].ts• L86-225 server/…/brief-render.d.ts• L4-22 server/…/brief-carousel-render.ts• L570-676 api/bootstrap.js• L349-659 api/…/status.ts• L1-43 api/wm-session.js• L1-39 api/_api-key.test.mjs• L23-42 api/_api-key.test.mjs• L166-201 api/notification-channels.ts• L441-979 server/…/notify-fields.ts• L261-321 api/notification-suppressions.js• L186-252

Published open-data routes

The open-data route exposes the CC BY 4.0 chokepoint status dataset as dated JSON and CSV files. Clients can request the latest or an allowed historical file through /data/v1/chokepoints/; the daily publisher owns the archive and index. This file contract is a reviewed exception to the generated JSON API shape. (api/open-data-chokepoints.js• L5-14, api/open-data-chokepoints.js• L51-81, api/api-route-exceptions.json• L27-31)

The route bounds dates before storage access and uses longer cache life for published files than for misses or store errors. This lets integrations cache stable files without caching a temporary absence or outage. (api/open-data-chokepoints.js• L15-45)

References: api/open-data-chokepoints.js• L5-14 api/open-data-chokepoints.js• L15-45 api/open-data-chokepoints.js• L51-81 api/api-route-exceptions.json• L27-31

Agent protocol routes

MCP is the main agent interface. It publishes tools, resources, prompts, skills, and interactive app views through JSON-RPC over Streamable HTTP. Discovery methods expose public metadata. Data calls use the caller's credential, entitlement, allowance, and freshness path. Anonymous callers can use metadata, public resources, get_sources, and tools explicitly marked as free. The transport also serves a generated server card, guide, and setup page from the deployed bundle, so discovery does not depend on a request back to the deployment's own static origin. (api/…/handler.ts• L85-149, api/…/handler.ts• L696-830, api/…/discovery-documents.generated.ts• L1-10, api/…/server-card-tools.ts• L5-30)

The tool catalog groups capabilities into markets and economy, energy, geopolitical security, movement and infrastructure, environment, health, displacement, intelligence, trade, and meta services. The category map is the source for discovery summaries and server-card categories. Country views can open an interactive panel or read one structured section. Section results use ready, locked, and unavailable states so a missing source is not read as zero. (api/…/domains.ts• L1-44, api/…/server-card-tools.ts• L18-30, api/…/country-view.ts• L162-229, api/…/country-view.ts• L263-361)

MCP arguments are checked against the advertised schema before paid admission. Paid panel reads open a bounded reader scope before they fetch or reuse a panel result. Free tools use an explicit free context and remain limited to the tools marked for that path. Results retain freshness, source-unavailable, output-budget, projection, and attribution signals. Analysis tools combine several seeded sources only when the required inputs are present; missing inputs remain explicit unavailable state rather than a quiet result. Cache tools declare their freshness checks and public API paths, which keeps the MCP view aligned with REST coverage. (api/…/cache-tools.ts• L102-132, api/…/types.ts• L301-350, api/…/analysis-tools.ts• L146-235, api/…/dispatch.ts• L604-720, api/…/dispatch.ts• L730-945)

MCP tool metadata makes access class, cost, output shape, and interactive UI links visible to clients. Anonymous-free, authenticated-free-account, and subscription tools are distinct access classes. A tool's output schema, annotations, attribution extraction, and byte budget are part of its advertised contract. (api/…/types.ts• L101-196, api/…/types.ts• L245-252, api/…/types.ts• L389-468)

Freshness uses the same source-age and content-age rules as health. Missing metadata, source errors, too few records, stale observations, and an unread activation marker do not earn deployment grace. The result reports cached_at, stale, and a bounded content-freshness pending deadline when a producer has not published for the first time. (api/…/freshness.ts• L16-23, api/…/freshness.ts• L40-120)

Orbital tools follow the launch state of the REST surface. When published, point-pass results expose evidence tiers, counts, and archive completeness rather than implying that every satellite pass produced an image. Country imagery evidence reports confirmed change flags only when the evidence rules support them. (api/…/_orbital.ts• L30-97, api/…/_orbital.ts• L181-267)

The server negotiates MCP versions during initialize. It supports the legacy versions together and can serve a separate modern per-request era when enabled. The default published protocol set includes the 2025-11-25 revision, while the modern 2026-07-28 era remains an explicit switch. (api/…/constants.ts• L1-85, api/…/handler.ts• L897-1102)

OAuth gives MCP clients authorization-code and refresh-token grants. Registration bounds client metadata and redirect URIs. Authorization binds consent to a World Monitor browser origin and a one-use nonce. The consent flow accepts a user API key or operator key, stores only a hashed key reference in the authorization code, and returns the code to the registered redirect. The issuer is captured from the validated World Monitor host, and the nonce is bound to the browser so a forwarded consent link cannot be redeemed from another browser. (api/…/register.js• L13-20, api/…/register.js• L104-190, api/…/authorize.js• L25-47, api/…/authorize.js• L339-455)

The outbound MCP proxy is a separate integration surface. It permits only HTTPS targets, resolves and classifies DNS answers, pins the approved address for the connection, bounds response bodies and redirects, and does not expose blocked addresses to callers. (api/mcp-proxy.ts• L314-440)

References: api/…/handler.ts• L85-149 api/…/handler.ts• L696-830 api/…/handler.ts• L897-1102 api/…/discovery-documents.generated.ts• L1-10 api/…/server-card-tools.ts• L5-30 api/…/domains.ts• L1-44 api/…/country-view.ts• L162-361 api/…/cache-tools.ts• L102-132 api/…/types.ts• L101-196 api/…/types.ts• L301-350 api/…/types.ts• L389-468 api/…/freshness.ts• L16-120 api/…/constants.ts• L1-85 api/…/authorize.js• L279-487 api/mcp-proxy.ts• L314-440

Operational and internal routes

Operational routes show whether the platform can serve trustworthy data. Health surfaces distinguish producer activity, source coverage, content age, activation, and compatibility. They use bounded, no-store results so a slow sweep does not become a client cache entry or a false outage.

The public health form is /api/health?compact=1. It returns the platform status, a separate strict dataStatus, summary counts, and only problem or pending entries. Detailed checks and failure history require an operator or enterprise API key. The compact and full snapshots come from one sweep, while HTTP responses remain no-store. (api/health.js• L6009-6115, api/health.js• L6134-6238)

Health can serve a bounded last-known verdict while another request owns the refresh lease. It returns retryable 503 only when no usable verdict exists or Redis cannot provide one. Source incidents are recorded separately from the public availability verdict, so contained data warnings remain visible without turning every warning into a platform outage. Scheduled government food-price releases receive a long incident-reporting grace period when their content is late; the health status and stale label still change at the normal content limit. (api/health.js• L5756-5888, api/health.js• L5911-5933, api/health.js• L6002-6024, api/health.js• L6724-6740)

The operator seed-health route checks seed freshness, activation, coverage, and data probes with an enterprise key. It is a diagnostic view for producers and does not replace the public health contract. (api/seed-health.js• L625-648, api/seed-health.js• L657-787)

Internal routes support controlled cache invalidation, brief enrichment, grant context, producer calls, analytics health, notification publishing, and contract probes. Analytics health accepts only bounded aggregate counters and compares a cohort with its own baseline. These routes are operator or service plumbing, not general product data APIs. (api/analytics-health.js• L1-19, api/analytics-health.js• L89-155, api/…/brief-why-matters.ts• L1-34, api/notify.ts• L1-8)

References: api/health.js• L5756-5888 api/health.js• L5911-5933 api/health.js• L6002-6024 api/health.js• L6009-6115 api/health.js• L6134-6238 api/health.js• L6724-6740 api/seed-health.js• L625-648 api/seed-health.js• L657-787 api/analytics-health.js• L1-19 api/notify.ts• L1-8

Request protections

Shared protections form the security and availability boundary around HTTP work. They identify the caller, check origin and method, enforce access and usage rules, validate request shape, limit untrusted network work, and choose a cache policy before a result reaches a client.

Origin and method controls

Browser-capable routes allow only approved origins. Preflight requests advertise supported methods and headers. Wrong methods return 405 with Allow. Unknown paths return structured errors. MCP origins accept secure hosts and local development clients only. (server/gateway.ts• L1189-1244, api/…/handler.ts• L897-903)

Disallowed browser origins use a refusal-specific CORS response so the browser can read the 403 instead of seeing a network failure. Preflight requests use the same readable refusal path. Successful responses use the allowlist or wildcard public CORS policy only in the matching public-read case. (api/_cors.js• L145-225, api/wm-session.js• L179-197)

Headers are part of the client contract. Clients use authentication challenges, retry timing, idempotency markers, billing state, rate limits, degradation state, lifecycle links, and upstream-timeout markers to decide what to do next. (api/_cors.js• L29-89, server/…/rate-limit.ts• L238-310, api/mcp-proxy.ts• L1126-1137)

References: api/_cors.js• L29-89 api/_cors.js• L145-225 api/wm-session.js• L179-197 server/gateway.ts• L1189-1244 api/…/handler.ts• L897-903 server/…/rate-limit.ts• L238-310

Identity and entitlement checks

The platform accepts Clerk bearer sessions, user-owned wm_ API keys, enterprise keys, anonymous browser session tokens, partner credentials, embed wme_ keys, and OAuth bearer records. Identity answers who is calling. Entitlement answers whether that caller may use the requested capability. A valid credential alone does not prove an active plan.

User API keys carry a known kind. API keys use account API access, while desktop keys use the desktop entitlement and may be limited by the owner's active-key rank. Embed keys work only on RPC paths declared for paid embed panels. The platform keeps key validation, ownership, entitlement, and billing verification as separate decisions. Static operator keys are checked before user-key fallback, including when an operator key happens to use the wm_ prefix. (api/_user-api-key.js• L17-23, api/_user-api-key.js• L87-135, server/gateway.ts• L1741-1818, server/gateway.ts• L1854-1945, api/_api-key.test.mjs• L332-388)

Account-private routes use the authenticated session as the account identity. The gateway strips client copies of trusted identity and rate-limit markers, then stamps verified values after authentication. A key beside a session cannot select a different user's private data. The sent-alert history route is the current example: it requires a signed-in Pro session, reads only that session's seven-day delivery history, and uses no shared cache. (server/gateway.ts• L605-627, server/gateway.ts• L907-954, server/…/list-sent-alerts.ts• L22-71, server/…/gateway-list-sent-alerts.test.ts• L163-235)

Validation failures stay distinct from backend uncertainty. An invalid key is a caller error. An unavailable key or entitlement service is a retryable 503 with no false authentication or upgrade claim. (api/_user-api-key.js• L162-197, server/…/entitlement-check.ts• L851-921)

References: api/_user-api-key.js• L17-23 api/_user-api-key.js• L87-135 api/_user-api-key.js• L162-197 api/_api-key.test.mjs• L332-388 server/gateway.ts• L605-627 server/gateway.ts• L907-954 server/gateway.ts• L1741-1818 server/…/list-sent-alerts.ts• L22-71 server/…/gateway-list-sent-alerts.test.ts• L163-315 server/…/entitlement-check.ts• L851-921

Limits and replay protection

Rate limits protect shared reads, authentication, free data, provider fan-out, model work, checkout, and side-effecting operations. General traffic can prefer availability during a Redis problem. Routes where the limit is the abuse defence fail closed with a retryable 503. IP-scoped limits require a trusted Cloudflare edge proof when a forwarded client IP is present; an unproven value returns a distinct 403. (api/_rate-limit.js• L152-210, api/_rate-limit.js• L224-269, server/…/rate-limit.ts• L238-322)

The limiter can charge a trusted account principal instead of a shared public IP. Server fan-out charges the initiating caller before it dispatches a sub-request. If the original request has neither a trusted principal nor a usable caller IP, the fan-out is refused rather than charged to the platform egress address. This prevents one backend egress bucket from hiding caller load. (server/…/rate-limit.ts• L313-393, server/…/rate-limit.ts• L459-585)

API plans have per-account burst limits and daily usage meters. API Starter and API Business share a REST and MCP daily allowance, while their burst limits differ. Product facts and server meters come from the generated catalog. Clients must treat these facts as account policy and must not infer access only from a route or tool's existence. (api/_product-catalog.generated.js• L347-405, api/_product-catalog.generated.js• L445-452)

Desktop-key traffic has a separate owner-level daily ceiling and per-minute burst bucket. It fails closed when Redis cannot prove the counter window, rolls back rejected charges, and uses one denial body and header contract across the gateway, bootstrap, MCP proxy, and other desktop-key edges. (api/_desktop-key-meter.js• L117-205, api/_desktop-key-meter.js• L230-302)

Idempotency protects selected mutations from duplicate side effects. A completed replay is returned before a new limit or quota charge, and the scope binds the key to the resolved caller. Checkout, customer-portal actions, and notification writes apply the same principle before they call a backend relay. OAuth refresh rotation uses a short client-bound grace record for a lost response, but later or cross-client reuse still revokes the family. (api/create-checkout.ts• L137-207, api/customer-portal.ts• L87-115, api/notification-channels.ts• L571-589, api/…/token.ts• L635-888)

MCP uses separate admission for discovery, free calls, panel reads, and paid tool calls. A call can cost more than one REST unit when it fans out. Free contexts cannot sign credentialed downstream calls, so an incorrectly marked free tool fails closed. (api/…/auth.ts• L150-199, api/…/dispatch.ts• L637-694, api/…/quota.ts• L258-390)

References: api/_rate-limit.js• L152-269 server/…/rate-limit.ts• L238-322 server/…/rate-limit.ts• L313-393 server/…/rate-limit.ts• L459-585 api/_product-catalog.generated.js• L347-405 api/_desktop-key-meter.js• L117-302 api/create-checkout.ts• L137-207 api/notification-channels.ts• L571-589 api/…/token.ts• L635-888 api/…/auth.ts• L150-199 api/…/quota.ts• L258-390

Cache and destination safety

Cache policy follows identity and freshness. Caller-invariant public reads may use shared caches. Credentialed reads, premium responses, health results, authentication failures, billing failures, and infrastructure errors use private or no-store behavior. A response can mark itself stale, degraded, retryable, or unserved so the platform does not store a false healthy result. (server/gateway.ts• L2609-2672, server/…/cache-contract.ts• L26-48, api/bootstrap.js• L590-655)

News and search routes apply this rule to time-sensitive content. Feed digests can use a short public cache and durable last-good fallback. Headline search is no-store because operator revocations are checked on each request. All readers of digest content apply the shared revocation set, including cached country intelligence and analyst context; a successful revocation read is memoized briefly, while an unreadable control is not treated as empty. Delivered-alert history is account-private and no-store. (server/…/list-feed-digest.ts• L262-381, server/…/_lastgood.ts• L302-321, server/…/search-headlines.ts• L32-70, server/…/digest-revocations.ts• L1-27, server/…/digest-revocations.ts• L62-114, server/gateway.ts• L450-473)

Request-varying results use keys that include the inputs that affect the result. This prevents a shared response from crossing caller, country, language, framework, source, or provider boundaries. AI routing policy is customer-specific and fails closed to an empty provider list if the policy lookup fails. (server/…/get-country-intel-brief.ts• L353-433, server/…/ai-routing-policy.ts• L8-22, server/…/ai-routing-policy.ts• L54-125)

External destinations receive bounded treatment. OAuth client metadata, skill imports, feed paths, MCP proxies, notification webhooks, push endpoints, and partner callbacks use allowlists, size and time limits, HTTPS rules, DNS checks, or pinned connections. Relay responses normalize non-JSON upstream errors into small JSON envelopes and distinguish transport failure from an upstream response. (api/_relay.js• L27-55, api/_relay.js• L93-137, api/notification-channels.ts• L755-792, api/mcp-proxy.ts• L314-440)

References: server/gateway.ts• L2609-2672 server/…/cache-contract.ts• L26-48 server/…/list-feed-digest.ts• L262-381 server/…/_lastgood.ts• L302-321 server/…/search-headlines.ts• L32-70 server/…/digest-revocations.ts• L1-27 server/…/digest-revocations.ts• L62-114 server/…/get-country-intel-brief.ts• L353-433 server/…/ai-routing-policy.ts• L8-125 api/_relay.js• L27-137 api/notification-channels.ts• L755-792 api/mcp-proxy.ts• L314-440

Backend gateway

The backend gateway is the shared boundary between public domain URLs and World Monitor service handlers. It provides common matching, request validation, identity, entitlement, rate, cache, error, compatibility, usage, and projection behavior. The Backend gateway routing page is the detailed child page for this flow.

Domain request dispatch

Each versioned domain entry point supplies a route set and a handler to the gateway. The gateway normalizes the path, matches the method, validates the request, applies compatibility behavior, and invokes the selected operation. A bounded POST-to-GET form preserves older clients without accepting nested or unbounded query values. Unknown paths and unsupported methods keep separate 404 and 405 contracts. (server/gateway.ts• L624-729, server/gateway.ts• L687-740, server/gateway.ts• L2150-2165)

API Markdown twins use the same gateway boundary as direct domain calls. The twin renderer may ask only for a route served by that gateway, and the in-process sibling request receives network identity and origin without credentials. (server/gateway.ts• L1085-1101, server/gateway.ts• L2935-2972, api/_md-url-twin.ts• L489-575)

The gateway applies optional JMESPath response projection to JSON GET responses. REST and MCP use the same bounded expression and output model. Attribution stays beside a reduced response so a projection cannot remove the source context that permits reuse. (server/…/response-projection.ts• L4-17, server/gateway.ts• L2771-2829, api/…/structured-content.ts• L121-137)

Handlers can return response-side signals for no-store, retryable, unserved model work, status overrides, and diagnostic headers. The gateway merges those signals with CORS and cache rules. (server/gateway.ts• L2659-2700)

References: server/gateway.ts• L624-740 server/gateway.ts• L1085-1101 server/gateway.ts• L2150-2165 server/gateway.ts• L2659-2700 server/gateway.ts• L2935-2972 api/_md-url-twin.ts• L489-575 server/…/response-projection.ts• L4-17 server/gateway.ts• L2771-2829

Backend relay boundaries

Some routes are thin edges over Convex, Clerk, payment, feed, model, or specialist services. The edge verifies the caller, sends only the needed identity and request data, and translates the backend result into a client response. Durable state and external provider actions therefore stay behind a controlled boundary.

Account actions use this relay pattern. Checkout, customer-portal, Pro Business upgrade, notification settings, and lead capture edges own session checks, request validation, caller limits, idempotency, and safe client errors. The backend owns durable records and provider actions. Relay transport failures remain retryable service errors and do not become invalid-request or invalid-credential responses. (api/create-checkout.ts• L127-145, api/create-checkout.ts• L217-297, api/customer-portal.ts• L117-147, api/notification-channels.ts• L264-283, server/…/submit-contact.ts• L178-231)

MCP downstream calls preserve one caller identity across the agent edge and gateway. A user context uses a signed internal request so the gateway does not meter the same paid work a second time. An environment API key uses the normal API-key path. (api/…/auth.ts• L150-220, api/…/downstream.ts• L132-165)

The gateway accepts that internal MCP path only after it verifies the signature, request time, user, and one-use nonce. It then rechecks the user's MCP entitlement before it adds trusted identity markers for the downstream handler. A failed replay-cache check is unavailable rather than an access grant, so a captured request cannot be reused when replay protection is uncertain. (server/gateway.ts• L1405-1580)

The generic relay boundary adds a shared secret, a bounded deadline, optional public cache rules, and a parseable response envelope. It reports routine connection drops and timeouts at lower severity than persistent connection defects. (api/_relay.js• L8-24, api/_relay.js• L27-55, api/_relay.js• L93-137, api/_relay-failure-level.js• L11-43)

References: api/create-checkout.ts• L127-145 api/create-checkout.ts• L217-297 api/customer-portal.ts• L117-147 api/notification-channels.ts• L264-283 server/…/submit-contact.ts• L178-231 api/…/auth.ts• L150-220 api/…/downstream.ts• L132-165 server/gateway.ts• L1405-1580 api/_relay.js• L8-137 api/_relay-failure-level.js• L11-43

Client contracts

Clients depend on response bodies and the surrounding HTTP behavior. Status codes, headers, freshness fields, authentication challenges, cache rules, protocol envelopes, and event order are all part of the contract consumed by browsers, desktop clients, agents, monitors, and integrations.

Response and error contracts

Generated request rules reject invalid types, enums, required fields, and bounds before business work. Shared error mapping separates client mistakes from unavailable sources and unknown server faults. Error responses stay small and parseable. They do not expose provider pages, stack traces, relay details, or callback secrets. (server/request-validator.ts• L95-125, server/error-mapper.ts• L89-169)

Data responses preserve uncertainty. A source failure uses an unavailable or degraded state. Retained old data uses a stale marker. A model route can return a typed unavailable envelope. A successful empty result is meaningful only when source availability is also clear. News feeds add coverage counts and last-good state; country sections, food prices, trade series, and supply-chain products use the same distinction. (server/…/cache-contract.ts• L26-48, server/…/list-feed-digest.ts• L385-451, api/…/country-view.ts• L220-259, server/…/get-monthly-sitc-trade.ts• L94-135)

Clients should use status and headers together. Retry-After marks retryable limits and service states. WWW-Authenticate starts OAuth discovery. Billing, validation, cache, rate-limit, idempotency, and lifecycle headers explain access and retry decisions. Billing verification uses a separate exposed marker so browser clients can distinguish a temporary verification problem from a terminal lapse. (server/…/rate-limit.ts• L238-310, api/_cors.js• L45-89, server/…/entitlement-check.ts• L835-977)

MCP clients also use typed denial data. The reason, nextStep, plan, allowance, and request ID fields let an agent choose between sign-in, retry, waiting, reporting, or plan information without parsing private server detail. ChatGPT receives the same machine-readable states with checkout hints removed. (api/…/upgrade.ts• L75-102, api/…/request-id.ts• L17-59, api/…/host-policy.ts• L61-86)

References: server/request-validator.ts• L95-125 server/error-mapper.ts• L89-169 server/…/cache-contract.ts• L26-48 server/…/list-feed-digest.ts• L385-451 api/…/country-view.ts• L220-259 server/…/get-monthly-sitc-trade.ts• L94-135 server/…/rate-limit.ts• L238-310 api/_cors.js• L45-89 server/…/entitlement-check.ts• L835-977 api/…/upgrade.ts• L75-102 api/…/request-id.ts• L17-59

Discovery and transport contracts

OpenAPI describes REST operations. MCP server cards, tool catalogs, resources, prompts, UI resources, and skills describe the agent surface. The served server card projects the same registry used by the live catalog, while generated discovery documents keep the guide and setup page local to the deployment. OAuth metadata points clients to the correct authorization server. A2A, NLWeb, and Markdown twins provide bounded discovery and content views. The open-data index and dated files provide a separate published-file contract. (api/…/server-card-tools.ts• L5-30, api/…/discovery-documents.generated.ts• L1-10, api/open-data-chokepoints.js• L5-14)

Transport behavior is also a contract. MCP uses JSON-RPC over Streamable HTTP and negotiates supported protocol versions during initialization. The current default includes the 2025-11-25 protocol while older clients remain supported. The modern 2026-07-28 form is per-request and stays disabled unless explicitly enabled. OAuth uses authorization code plus PKCE and refresh tokens. (api/…/handler.ts• L688-805, api/…/handler.ts• L1030-1082, api/…/constants.ts• L1-85, api/oauth-authorization-server.ts• L55-85)

MCP results have parallel client views. content[0].text keeps the established JSON text. structuredContent and the advertised outputSchema describe normal results, projections, attribution riders, bounded-error envelopes, deprecation notices, and spoken responses for strict clients. (api/…/types.ts• L179-196, api/…/index.ts• L110-218, api/…/structured-content.ts• L26-137)

Streaming consumers have an ordered event contract. The analyst stream sends source metadata first, then optional UI actions, then text deltas, and finally a terminal event or an error. It is Pro-only, validates the query and history before spending the direct model allowance, and returns a CORS-correct 503 when identity or model dependencies are unavailable. MCP Streamable HTTP can frame a completed JSON-RPC result as SSE. Replay is optional, bounded, and bound to the owning authenticated session. (api/chat-analyst.ts• L4-13, api/chat-analyst.ts• L147-227, api/chat-analyst.ts• L265-379, api/…/handler.ts• L490-653)

Analyst context is scoped to the caller's question. It uses country and region phrases, demonyms, digest regions, and topic terms to select relevant headlines. Feed-derived text is treated as untrusted data before it reaches the model. A degraded context remains visible to the client instead of becoming an unsupported confident answer. (server/…/chat-analyst-geo-scope.ts• L196-296, server/…/chat-analyst-context.ts• L789-976)

Product plans and usage facts come from the generated product catalog. API Starter and API Business plans share REST and MCP daily allowance accounting, while burst limits and desktop-key access vary by plan. API Business and Enterprise include travel risk assessment capability; clients must treat these facts as account policy. (api/_product-catalog.generated.js• L97-174, api/_product-catalog.generated.js• L347-443)

References: api/…/server-card-tools.ts• L5-30 api/…/discovery-documents.generated.ts• L1-10 api/open-data-chokepoints.js• L5-14 api/…/handler.ts• L688-805 api/…/handler.ts• L1030-1082 api/…/constants.ts• L1-85 api/…/types.ts• L179-196 api/…/index.ts• L110-218 api/…/structured-content.ts• L26-137 api/chat-analyst.ts• L147-379 server/…/chat-analyst-geo-scope.ts• L196-296 server/…/chat-analyst-context.ts• L789-976 api/_product-catalog.generated.js• L97-174 api/_product-catalog.generated.js• L347-443

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep generated routes, handler names, OpenAPI operations, aliases, cache tiers, and MCP projections aligned. A reachable path can still have a broken generated contract.
  • Treat api/api-route-exceptions.json as the reviewed list of non-generated JSON, protocol, file, proxy, operator, and internal-helper contracts. A new JSON data API should not silently bypass the generated route contract.
  • When access changes, review entitlement checks, CORS, cache policy, quota accounting, MCP exposure, API-key ownership, desktop-key scope, and embed credential rules together.
  • Preserve the Orbital Watch flag and dark 404 contract until the feature is ready for public traffic. When the route becomes active, keep its generated RPC contract, MCP catalog gate, and gateway entry point aligned.
  • When a response gains or loses a field, update generated validation, REST schemas, MCP schemas, UI projections, spoken narrators, and freshness or unavailable states together.
  • Preserve the meaning of stale, unavailable, degraded, unknown, quiet, partial, and not-covered states. Do not replace missing evidence with a valid empty result.
  • Keep product facts, checkout products, burst limits, daily meters, desktop-key limits, and REST/MCP shared-budget claims generated from one catalog.
  • When changing bootstrap tiers or key ownership, keep the publisher, public URL classifier, reader namespace, cache tier, and health probe aligned.
  • When changing MCP discovery or protocol support, keep protocol negotiation, header/body matching, tool aliases, access metadata, output schemas, structuredContent, resource templates, prompts, skills, server cards, generated discovery documents, UI metadata, and anonymous method rules consistent.
  • When changing MCP tool categories or access metadata, update the domain map, server-card projection, generated discovery text, live tools/list, and client-facing access class together.
  • When changing MCP freshness, keep REST health rules, seed metadata, activation markers, content-age rules, cached_at, stale, and pending-grace semantics aligned.
  • When changing MCP streamed responses, keep session ownership, replay eligibility, SSE framing, direct-model quota reservation, and no-store behavior aligned. Do not add replay for data that the product does not retain.
  • When changing OAuth or agent metadata, preserve host validation, canonical auth.md skill URL, issuer alignment, PKCE binding, one-time state, browser binding, refresh-family replay evidence, redirect allowlists, and WWW-Authenticate links.
  • When changing relay behavior, preserve bounded timeouts, parseable errors, credential-aware caching, SSRF checks, redirect rules, and the distinction between source failure and transport churn.
  • When changing rate limits or quotas, update endpoint policies, fail-closed declarations, client headers, API-key meters, desktop-key meters, MCP meters, panel read budgets, direct-model reservations, and server fan-out attribution together.
  • When changing server fan-out, preserve the trusted principal marker, caller-IP fallback, unattributed refusal, and the rule that platform egress must never become the shared caller bucket.
  • When changing AI routing or analyst retrieval, preserve the fail-closed provider allowlist, prompt-boundary sanitization, geo-scope limits, and routing decision in every cache key for caller-supplied model output.
  • When changing seed envelopes or health, keep sampled storage shape, public boundary checks, seed-meta handling, freshness budgets, activation markers, last-known fallback, compact projection, retryable probe status, source-specific grace, and delayed incident reporting aligned.
  • When changing brief envelopes or readers, keep the signer inputs, seven-day TTL, localized sibling checks, public redaction, share-pointer lifetime, carousel cache policy, font coverage, and no-store error behavior aligned.
  • When changing news feeds or search, keep the RSS allowlist, feed catalog fingerprint, last-good acceptance, shared digest revocation reads, headline-history retention, revocation freshness, delivered-alert retention, and cache tier aligned.
  • When changing notification channels or event fields, preserve plan capability mapping, push and webhook destination rules, encryption, idempotency scope, queue limits, suppression matching, and the distinction between first-party and publisher links.
  • When changing country or trade sections, preserve country identity binding, panel admission, source attribution, requested coverage, and explicit unavailable or not-covered states.
  • When changing internal MCP gateway requests, keep body bounds, signature checks, timestamp and nonce replay protection, entitlement re-checks, trusted-marker injection, and single-charge usage attribution aligned.

Important failure modes

TriggerConsequenceGuard
A credentialed response receives a public shared-cache policyOne caller can receive another caller's account or integration dataCredentialed and premium responses use private or no-store policy.
A client sends a forged trusted user or rate-limit headerA handler can read another account's data or charge the wrong budgetThe gateway strips client copies and stamps only verified identity and limiter markers.
Header-only browser signals are treated as authenticationAn attacker can turn a same-origin-looking request into an authenticated requestAPI-key validation requires a real credential; origin, referer, and fetch metadata alone are rejected.
A public bootstrap store read fails and is returned as an empty 200Clients stamp an outage as a fresh empty bundlePublic bootstrap failures return no-store 503 with Retry-After.
A feed fetch returns an HTML challenge with HTTP 200The digest caches an empty parse and reports no newsFeed transport sniffs the body and uses the relay or short negative cache.
A digest rebuild is much narrower than the accepted snapshotA transient feed failure replaces a useful digestThe last-good gate checks category breadth, item depth, freshness, catalog identity, and current revocations.
A digest reader assumes an unreadable revocation set is emptyAn operator-revoked story can remain in one serving pathAll digest readers use the shared revocation reader and distinguish unreadable from an empty set.
Headline history or suppression storage is unreadableSearch can return an unchecked empty or blocked linkSearch returns unavailable; delivered-alert history does not return an unchecked list.
A client reads list-sent-alerts with a wm_ key for another userPrivate alert history can leak across accountsThe gateway uses only the authenticated session identity, stamps it, and applies no-store.
A client treats a missing food-price row, trade series, or country section as zeroA source outage becomes a false market or country claimDomain and MCP responses carry explicit unavailable, stale, partial, or not-covered state.
A rate-limit store is unavailable on checkout, session minting, OAuth registration, token exchange, or model workAbuse protection disappears from a spend-bearing or credential-minting routeThese routes fail closed with 503, Retry-After, and degraded-rate headers.
A server fan-out has no trusted principal or usable caller IPWork is charged to shared platform egress or runs without caller attributionThe fan-out refuses with unattributed-sub-request instead of using the egress bucket.
A desktop key is used after its owner's desktop entitlement or key rank is no longer validA key can keep using desktop-only work outside the owner's planKey kind, owner entitlement, active-key rank, and owner-level meter are checked before work.
The desktop-key status route treats unavailable validation as invalidA self-hosted sidecar can lock out a valid paying user during a backend outageKnown verdicts use 200; validation uncertainty uses 503 without a verdict.
An Orbital Watch RPC or MCP tool is exposed while its launch state is offA not-yet-launched capability becomes visible or a client caches a false successREST returns an uncached JSON 404 and the catalog gate hides the tools until launch.
An MCP free tool creates a signed downstream requestAnonymous work can run as a trusted user and bypass account controlsFree auth contexts cannot build credentialed downstream headers.
A modern MCP body and headers disagreeThe client and server can apply different method or version rulesModern requests require matching protocol and request metadata.
A generated server card and live tool registry driftDiscovery advertises tools or categories that the live server cannot describe consistentlyThe server card projects the registry and the build checks category coverage.
Freshness metadata or an activation marker cannot be readA client may receive a false fresh or grace-period resultMCP freshness marks unknown metadata stale and grants grace only after a confirmed never-published marker.
A refresh token is replayed after the grace window or by another clientThe OAuth family can be abused or remain active after theftReplay evidence is client-bound; real reuse revokes the refresh family.
A signed MCP downstream request is accepted without a fresh nonce or entitlement re-checkA captured request can replay paid work or retain access after plan lossThe gateway verifies the HMAC, claims a one-use Redis nonce, and checks current MCP access before trusting the request.
A brief envelope fails validation or a carousel font is missingA reader may show a broken page or a social client may cache a blank imageEnvelope validation rejects the brief; image rendering reads the full PNG and returns a no-store 503 on failure.
A public brief mirror is indexed or falls back to personalized fieldsA shared link can disclose recipient data or remain searchablePublic mode redacts personal fields, uses noindex, and never falls back to private lead text.
A notification link or push endpoint is accepted without destination checksA trusted alert can become a phishing or server-request pathLinks are shaped by channel, push hosts are allowlisted, webhook URLs are checked, and secrets are encrypted.
A client treats a partial orbital archive or stale catalog as complete evidenceA future pass or incomplete archive can be read as a confirmed imageResponses expose tier, stale, archive status, failed sources, and unanswered profiles.
Product catalog limits drift from gateway metersClients see one allowance while the server enforces anotherProduct facts, entitlement limits, REST meters, desktop meters, and MCP meters use the generated catalog contract.

Key files

FileWhy to read it
server/gateway.tsShared request lifecycle for origin checks, identity, entitlement, limits, cache, projection, errors, compatibility, usage, account-private paths, and API Markdown twins.
server/router.tsCommon method and path matching for domain route sets.
server/request-validator.tsRuntime enforcement of generated request contracts.
api/api-route-exceptions.jsonReviewed boundary between generated JSON APIs and external-protocol, file, proxy, operator, or internal-helper routes.
api/_cors.jsBrowser origin policy and client-visible response headers.
api/_api-key.test.mjsAuthentication precedence and the distinction between anonymous session tokens, protected cookies, user keys, and operator keys.
api/_rate-limit.jsShared IP limits, Cloudflare edge-proof admission, fail-closed behavior, and rate headers.
server/…/rate-limit.tsGateway and handler rate policy, trusted principals, fan-out charging, and degraded responses.
server/…/entitlement-check.tsEndpoint tiers, billing verification states, and entitlement failure semantics.
api/_product-catalog.generated.jsPublished plan facts, API limits, desktop limits, travel-risk capability, and REST/MCP allowance definitions.
api/bootstrap.jsPublic, session, API-key, and desktop-key bootstrap hydration contracts.
api/latest-brief.tsAuthenticated brief preview, latest-slot lookup, and signed magazine URL contract.
api/…/[issueDate].tsPrivate signed magazine reader and its expiry, localization, share, and fallback behavior.
api/…/[hash].tsRedacted public brief mirror, referral handling, and no-index contract.
api/…/[page].tsSigned social-image reader, page contract, and cache-safe render failure behavior.
server/…/brief-render.jsShared brief envelope validation, localization selection, public redaction, and HTML rendering model.
server/…/brief-carousel-render.tsBounded image teaser output and font coverage contract.
api/health.jsPublic compact and operator health verdicts, freshness, source coverage, bounded refresh, last-known fallback, and source incident reporting.
api/seed-health.jsOperator seed freshness, activation, coverage, and data-probe view.
api/…/handler.tsMCP discovery, anonymous and protected method admission, transport, sessions, replay ownership, and response shaping.
api/…/discovery-documents.generated.tsBundled server card, guide, and setup documents served by MCP discovery.
api/…/server-card-tools.tsProjection that keeps the generated server card and live discovery tool metadata aligned.
api/…/domains.tsMCP domain categories and the discovery summary used by the server card.
api/…/freshness.tsShared MCP freshness result and content-freshness grace rules.
api/…/types.tsMCP auth contexts, tool access classes, schemas, budgets, freshness checks, and handler contracts.
api/…/auth.tsMCP identity, entitlement, billing denial, rate, and downstream credential paths.
api/…/dispatch.tsTool validation, free and paid admission, panel reads, quota charging, source state, filtering, projection, and result errors.
api/…/cache-tools.tsCache-backed MCP data views, freshness declarations, filters, output bounds, and REST parity links.
api/…/country-view.tsInteractive country panel admission and structured country-section states.
api/…/source-tools.tsSource inventory, attribution, licensing, outlet provenance, and free discovery contract.
api/…/_source-providers.generated.jsonGenerated provider coverage and licensing state used by source discovery.
api/…/_orbital.tsOrbital tool publication gate, evidence tiers, output bounds, and archive status.
api/mcp-proxy.tsAuthenticated external MCP relay, DNS pinning, and SSRF controls.
api/…/authorize.jsBrowser-bound OAuth consent, client validation, API-key authorization, browser binding, and code issuance.
api/…/register.jsDynamic client registration limits and redirect allowlist.
api/…/token.tsAuthorization-code, refresh-token, and legacy token exchange contracts.
server/…/digest-revocations.tsShared operator URL revocation state for every digest reader.
server/…/list-feed-digest.tsFeed-backed news response, coverage, revocation filtering, and last-good serving.
server/…/_feeds.tsServer feed catalog, language reachability, and digest catalog identity.
server/…/_headline-history.tsHeadline retention, search windows, revocation-aware reads, and caller read budgets.
server/…/search-headlines.tsFree and Pro headline search windows and no-store behavior.
server/…/list-sent-alerts.tsAccount-private delivered-alert history and suppression behavior.
server/…/sent-alert-history.tsShared alert-history key, retention, cap, and record shape.
api/notification-channels.tsNotification settings, plan capability ladder, relay, idempotency, and destination safety.
server/…/notify-fields.tsCross-channel notification text and link safety contract.
api/notification-suppressions.jsAnonymous service-worker suppression snapshot and fail-open navigation behavior.
server/…/food-prices.tsFood-price source freshness, survey baselines, context status, and attribution.
server/…/get-monthly-sitc-trade.tsSeed-backed monthly trade coverage, slicing, and unavailable reasons.
server/…/get-country-products.tsCountry product profile, paid access, lazy recovery, coverage, and preserved stale data.
server/…/get-point-passes.tsPoint-pass time window, catalog freshness, archive evidence, and no-store fallback.
api/chat-analyst.tsPro analyst stream, caller limits, direct-model quota, event order, and failure contract.
server/…/chat-analyst-context.tsSeeded context assembly, feed safety, headline selection, and degraded context.
server/…/chat-analyst-geo-scope.tsCountry, region, demonym, and digest-category scope for analyst retrieval.
server/…/submit-contact.tsAnonymous lead contract, bot checks, corporate-email rule, backend relay, and notification email.