For the technical audience

Decisions ADR-181 to ADR-190

Every architecture decision record (ADR) behind TelltaleDNS: what we knew, what we chose, and what it costs. This page is built from the specification on every change, so it's always the current record.

ADR-181 Routers from the UI: API-managed [[router]] entries, keys pasted and saved as private files on the node that took the writeProposedAPICLUT8.2, ADR-080 (community request 2026-11-17; PR #66, contributed by Carlos Talbot).

Context

T8.2, ADR-080 (community request 2026-11-17; PR #66, contributed by Carlos Talbot). Routers ([[router]], UniFi and OPNsense) could be set only in telltale.toml, with each credential in a file created on the host, and a change needed a restart. Users who run TelltaleDNS from the UI (Docker on a NAS) want to add their console there and paste its API key. A router holds a credential and says where it is sent, so who may set one, and which file may be sent where, follow ADR-179. The first version was revised after a review on the PR (any file could be named as a credential, a saved key was reused for a new address, the key in use was replaced before the change applied, files the API hadn't written could be deleted). A review on 2026-11-19 found more: a router could name another router's key file and send it to its own address; a key saved but not applied was removed; key paths were listed to viewers; an administrator's agent token could set keys; old key files stayed on nodes that didn't take the write; and backups were said to hold the keys, which they don't. A second round of review on the branch (2026-11-20) asked for the folders for secrets to count on every node (the owner chose that over re-entering keys after a failover), a pasted key with an unchecked certificate to go only to an address, pin diffs without key paths for those below admin, the audit entry of a change whose client went away, and a keyed hash in the idempotency record. A third round (2026-11-20) asked for pin and unpin answers without key paths below admin, a retry that can't make a change twice, a bound on the changes running at once, the folder rule bound to the files' router where this node's files define one, and wording that says what the code does. A fourth round (2026-11-20) found that binding a regression (a replica with a stale copy of the primary's [[router]], or a pinned controller, stopped polling a mounted key) and moved the check to where the API's entries are merged, so every node is covered. Decision (proposed):

  • Managed like the other named kinds (ADR-069). PUT/DELETE /api/v1/routers/{name} with the [[router]] fields; an API entry overrides or hides the files' entry of that name; dry run, If-Match, idempotency, audit, Keep it in Git, forwarding from replicas; listed by GET /api/v1/config/entries?kind=router. No MCP tool: an agent isn't handed a credential to paste.
  • Who. Only an administrator writes a router, PUT or DELETE, dry runs too: an admin's own sign-in (a session or HTTP Basic) or an admin API token, never an agent token, as ADR-179's by_admin. There is no agent scope for routers. Anyone else gets 403. The check runs where the write is planned, on the node that applies it, before the body's keys are looked at, so a dry run, a replica's forwarded write and an MCP client calling the REST route are covered; a forwarded write from a node that doesn't send by_admin is refused.
  • Paste only. A body may carry api_key, api_secret or password, never a path: api_key_file, api_secret_file and password_file in a body are refused (422, hint "Paste the key; the node saves it") unless the value is the file the router already has (in the config files plus the API's entries, as the write is planned) and its endpoint (type, url, site, tls_ca, tls_server_name, tls_insecure_skip_verify) is unchanged. With a pasted value, the file the body names for that credential is never looked at: the new file replaces it (after a failover the planned router may not have the file the page last saw). The UI sends no *_file field at all; a credential the body leaves out keeps the router's own file. A change of endpoint needs each key pasted again. A key in a file elsewhere (a Docker or Kubernetes secret) is named in the config file.
  • Over https. A pasted key goes only to an https:// address, or to a loopback one written as an address (127.0.0.0/8, ::1); http:// to anything else, localhost included, is refused with 422: on http:// the key can be read on the way, and on a node whose own resolver is TelltaleDNS a local name can change where a host name resolves (ADR-179, Not covered). For the same reason a pasted key with tls_insecure_skip_verify goes only to a router whose url is an address, not a host name (422, hint "use the address, or tls_ca and tls_server_name"): with the certificate unchecked, nothing else ties the key to the router. A router's url holds no { or }; site goes into the request's path only, as one percent-encoded segment. Routers in the config files keep the http:// and unchecked-certificate rules they had.
  • Where keys live. Each pasted value is written to a new file, <data_dir>/secrets/router-<name>.<credential>.<16 hex digits> (an unsafe or long name made safe and shortened, with a hash), created exclusively with mode 0600 in a folder made 0700, and synced with its folder, after the change is checked (never on a dry run). secrets/.written (0600; written to a temporary file, synced, renamed) records each file with its router, credential and endpoint, before the file is made; the temporary file has a fresh random name and is created exclusively. A key is pasted only on a node whose node.data_dir is written as a plain absolute path (no ., .. or empty parts), the form the use-time rule and the sweep recognise; otherwise 422. A file is kept once the entry naming it is stored, in the same blocking step as the store (so a runtime that shuts down after the store can't remove it), even if the reload then fails; a change that fails before that removes what it wrote. Every configuration change made through the write path (the PUT and DELETE routes of the configuration: devices, names, forwards, quick rules and every managed kind) that isn't a dry run runs to its end in a task of its own together with its audit entry and its Idempotency-Key record, so a client that goes away doesn't stop it half way or leave it unaudited. That is the same work in the same order as before; what changes is only that it is no longer cut short where the client left (each change is one bounded unit under config_writes). A retry with the same Idempotency-Key gets the first answer once the first request has finished; while the first is still running, the retry gets 409 with Retry-After and isn't made a second time (the key is claimed, and the stored answer looked up, in one step). At most 32 such changes run at once; one more gets 503 with Retry-After; dry runs aren't counted, and a change gives its place back when its task ends. A change whose task fails (a panic) answers a fixed 500, and the server log says why. Other changes (promotion, users, tokens, blocking, acknowledgements) run and are audited in their request, as before. state.db, the configuration, the API's answers, the audit log, the replicated configuration and Keep it in Git hold the path only; the idempotency record holds each pasted value as a BLAKE3 hash keyed with this node's request key, 32 random bytes in <data_dir>/secrets/.request-key (0600, made on the first start), which is outside state.db and outside backups, so a copy of state.db can't be used to test guesses of a key.
  • Use time. A router in effect that names a key file is polled only if one of these holds for each of its key files: this node's own config files (and, on a node that takes the cluster's configuration from Git, the commit in use) define that router with that file at the same endpoint; or the file lies in a folder a platform fills with secrets, /run/secrets/ (Docker, Compose) or /etc/telltale-secrets/ (the Helm chart's secretMounts), by ADR-179's folder rule without the data directory (compared by components, as written and with links followed, never /run/secrets/kubernetes.io/, eks.amazonaws.com/ or azure/: secret_path::in_folders), on any node; or the file is recorded in this node's .written for that router, credential and endpoint and lies in this node's <data_dir>/secrets/ (the same rule, limited to that folder: secret_path::in_data_secrets). The folder counts whatever this node's own files say, so a replica whose own file still holds an older copy of the primary's [[router]] (ignored, CLU-006) and a pinned controller whose files changed since the pin keep polling. Otherwise the router isn't polled and keeps no names, and the node logs why once per router and reason (a warning, on a replica too, whose Routers page shows the primary's status; information on a Helm resolver pod, which has no keys by design), with what to do: define the router in this node's config file, or put the key under /etc/telltale-secrets/ or /run/secrets/, or, for a router made in the UI, enter the key again on the node that takes configuration changes. No API body can name a new file in those folders for a router (paste only: a body may only keep the router's own file at the same endpoint), so a router that uses one there came from whoever writes a config file or Git repository a node takes routers from, or from an administrator who kept the files' folder key in an override. Such an override stays in effect only while the files vouch for it. Where the API's entries are merged (managed::merge, on the node that applies them: a standalone node or the primary, never a node that follows another), an entry made through the API for a router is left out when it names, for some credential, a key file outside this node's <data_dir>/secrets/ that the files' router of the same name doesn't name for that credential at the same endpoint; a router the files don't define counts as not matching. On a primary promoted after a failover, the files are the configuration it was promoted with (the last version it applied, applied.json, under its own node settings). So an API router entry may name only a file under <data_dir>/secrets/ or the very file and address the config files give that router. A file under <data_dir>/secrets/ passes the merge whatever it is (the test doesn't ask whether the key was pasted): an entry naming one there that this node didn't save for it (an alert's token file, say, or a key file of another router, in an entry restored or edited in state.db) is not left out. It stays in the configuration in effect, in place of the files' router of that name, and is published; the use-time rule holds it on every node whose .written doesn't record that file for that router, credential and endpoint (the third case above): not polled, logged once as a warning with why, its status not_used (missing when there is no file). The test is made on the path as written, in normal form and by components, with nothing looked up on the filesystem, so it fails closed: a mounted key that is a link out of the folder on the merging node, or a folder it can't search, can't keep a stale override in (review round 4, final review M2). That covers an override kept from before the files moved or removed the router, whatever folder its key is in, and an entry restored or edited in state.db. There are no stored router entries from a release: the router kind is new with this change. The node logs one warning per entry left out (as ADR-180 does for plugin entries), saying why and how to fix it (edit the router in the UI to save it for the files' address, or remove the entry); the files' router, if any, is the one in effect, and the configuration the primary publishes never carries the left-out entry, so no replica, and no primary promoted after a failover, sees it. Routers are named by nothing else in the configuration, so the merge stays valid. A key pasted in the UI (in <data_dir>/secrets/) is unaffected: its .written record vouches for it. The rule holds what this node can't vouch for: an entry stored by an earlier build, restored from a backup, edited in state.db, or replicated from another node, whose key file is outside the two folders or in this node's secrets/ without its record. An entry made through the API that names a file in the two folders is left out by the merge unless the files give that router that file at that address (above); a router in the shared configuration that names one is polled on every node. If the check can't run, no router with a key file is polled.
  • Status. GET /api/v1/config/entries gives each router a credentials status per key, as the node that answered sees it (on a replica, the primary, or the replica itself while the primary can't be reached): saved, missing (no file there, and it is one the node saves when a key is pasted: enter it again), file_missing (no file there, and it is one a platform mounts or a config file names: put the file there) or not_used (there, but not one that node sends for it). It is read without the secret (whether a file is there, and the rule above), and the UI shows "key saved", "key missing: enter it again", "key file missing: put the file there, or paste the key" or "key not used: enter it again". What a replica itself does is in its log (above). The Routers editor shows a warning when the page itself was opened over plain HTTP from another machine ("You are on a plain-HTTP page: a key you paste crosses the network unencrypted. Open this page over https first."); the server can't tell, behind a proxy, so it is a notice only.
  • What others see. A router's key-file paths and username are shown to an administrator only; viewers, operators, agent tokens and MCP resource reads get the definition without them, and the status. The redaction is made where the answer leaves the node, so a replica's copy of the primary's entries is redacted too. The same fields read "(hidden)" in a pinned cluster's diff for those callers: in GET /api/v1/cluster/rollout (a viewer's read), in the 409 cluster_pinned a write gets, and in the answer of a pin or an unpin (an agent's with cluster:admin, and so in an MCP plan's preview, which every operator reads through GET /api/v1/plans). Those diffs showed them before this change for routers in the config files too.
  • Removal, on each node. A node removes a file recorded in its .written once no router names it, and only a file it makes: a direct child of its <data_dir>/secrets/ named router-<name>.<credential>.<16 hex digits> (the name made safe), a regular file (not a link), lying in that folder with links followed. A record for any other name is kept, and its file left alone, with a warning (once); if a stored router entry can't be read (a row that isn't a JSON object), it removes no key file at all (it can't tell what is named) and logs a warning at each try, which doesn't name the row (Consequences, known limit). It removes a file not in the configuration in effect, not in its config files, not in its own stored entries (the last two keep a key while a reload has fallen back to the config files, the cluster is pinned, or a demoted primary may be promoted again). It also removes the temporary files a crash left behind (.written.<16 hex digits>.tmp, which hold paths only, and .request-key.<16 hex digits>.tmp, which is either a key never put in place or, after a crash between linking the key in place and removing the temporary name, a second name for the key in use, harmless in the 0700 folder; regular files only, once ten minutes old, whether or not the stored entries can be read). It sweeps at start, once the state database is open (the router task starts before the API opens it; until then the sweep is tried again every 5 seconds without polling anything again), after every change of the routers in effect and after a router write. Apart from those temporary files (.written.<16 hex digits>.tmp and .request-key.<16 hex digits>.tmp, regular files at least ten minutes old), it never removes a file that isn't on that list, nor anything but a name it makes in secrets/ itself; each removal is logged at info.
  • Backups and snapshots. telltale backup never includes secrets/: it copies a fixed list (the config files, state.db, rollups.db, anomaly.json, the query log on request). After a restore on another machine a router made in the UI shows "key missing" until its key is entered again. A copy of the data directory, a volume snapshot or a Kubernetes PVC snapshot does carry the keys in plaintext: keep the folder and files at their modes (0700 and 0600), keep such copies private, and encrypt the volume or the snapshot storage.
  • Failover. Keys pasted in the UI stay on the node that took the write, the primary. The router is shared configuration, so every node has its entry, but only that node has the files. After a failover the new primary has the router and not its key: it shows "key missing" and doesn't poll it until an administrator enters the key again there. While the node that has the key runs, the names it reads reach every node (ADR-125). A router whose key is in /run/secrets/ or /etc/telltale-secrets/ on every node is polled by whichever node is primary, with no re-entry. A replicated, encrypted secret store with write-only references would remove the re-entry step for pasted keys; it is a follow-up.
  • No restart. The router task compares the routers in effect every 5 seconds between its rounds of reads: a router added or changed is read within 5 seconds after the reads in progress end (a read of a slow router is bounded by its request timeouts), and a removed router's names go after the next round. A change to a router in the config files applies the same way after a reload (SIGHUP). A router's device names are dropped when it is removed or points at another device (type, address, site).
  • REQ: T8.2, API-002, in router_secrets.rs (prepare, UseCheck, sweep), api_backend::router_guard, routers::run, and config_entries's redaction (telltale-api).

Not covered

a user of the host who can write the data directory (they can read or replace the files, .written and the request key; and with a data directory placed under /run/secrets/ or /etc/telltale-secrets/, every file in it counts as a mounted one, so a router entry edited into state.db there could make the node send, say, its secrets/.request-key to the entry's address: keep the data directory outside those folders); an administrator (trusted with the node's secrets already, and still able to set a router's address and paste a key for it); routers in the config files, the Helm values or Git, which keep any path (whoever writes those controls the node), apart from the use-time rule's view of them on a node whose own files don't define them, and which may still send a key with tls_insecure_skip_verify to a host name; keys on more than one node (none are copied); what a node receives in the cluster's shared configuration: the manifest doesn't say which routers the primary made through the API, so a replica, or a primary promoted after a failover, holds every router with a key file that its own files (or the Git commit it uses) don't define and that isn't in /run/secrets/ or /etc/telltale-secrets/, one from the primary's config files included, unless the key was saved on that node for it. Who can make a node send a key from those two folders, and where: whoever writes the primary's config files or its Git repository (ADR-179). A page of the UI opened over plain HTTP from another machine: the key crosses the network as typed (the editor says so; serving the UI over https is the operator's).

Consequences

  • Routers can be set up from Clients → Discovered → Routers, UniFi and OPNsense, without touching the host.
  • An administrator can no longer write routers with an agent token, name a key file through the API (only send back the router's own at the same endpoint), or paste a key for an http:// address other than a loopback one.
  • The cost of the use-time rule: a node that follows another (a native replica, a primary promoted after a failover) polls a router that only the primary's config files define when its key files are in /run/secrets/ or /etc/telltale-secrets/ there, as before this change; with a key file anywhere else (/etc/telltale/opn-secret, say) it no longer polls it, logs why, and says what to do. Defining the router the same way in that node's own config file keeps it polled there, but on a replica the configuration file's [[router]] section is then also reported by CLU-006's warning ("this node's configuration file sets shared settings that the cluster's primary replaces; they're ignored"): the shared routers still come from the primary, and the file's copy only vouches for the key file; moving the key under /etc/telltale-secrets/ is the cleaner way. With the Helm chart every pod mounts the same ConfigMap and the controller mounts secretMounts, so nothing changes; resolver pods have no secretMounts and log the failed read as info, as before (ADR-120).
  • Native clusters: router key files outside /etc/telltale-secrets/ or /run/secrets/ are no longer read on replicas or on a primary promoted after a failover, unless that node's own config file (or the Git commit it uses) defines the same router with the same key file and address, or the key was pasted in the UI on that node (release-note line). A key in those folders is read on every node, whatever the node's own file says.
  • Upgrading: upgrade every node before writing routers through the API. An older primary doesn't know the router kind and refuses a replica's forwarded router write ("bad write"), and an older replica passes the primary's router entries to its viewers without the redaction. A router saved with the PR's build before this change (its .written lines hold paths only) shows "key not used" until its key is entered again. Two smaller changes for routers in the config files: site is now percent-encoded as one path segment (a site ID with /, @ or % is sent escaped), and {site} written inside url is no longer replaced (a url from the API may not hold { or }). An idempotency record written before this change holds an unkeyed hash, so a retry of such a router write with the same key gets 409 instead of a replay; records are short-lived.
  • The task wakes every 5 seconds to compare a short list, and sweeps when the list changes: no cost worth measuring, and nothing on the DNS path.
  • Follow-up: label left-out overrides on the page. A left-out entry is told only by the log's warning. When the files moved the router, the Routers page lists the files' router, still labelled "overrides the file"; when they removed it, the entry has no row at all, and the only remedy is DELETE /api/v1/routers/{name}, which the warning names. If the files later bring the router back with the same file and address, the old override applies again, with its own settings (interval, offline days).
  • Known limit: a sweep that can't run doesn't name the row that stops it. A stored router entry that isn't a JSON object (a hand edit of state.db can make one; the API stores objects only) stops the removal of key files on that node: each try (at start, after each change of the routers in effect, after each router write) logs "router keys: the sweep of key files no router names didn't run" with "the entries made through the API couldn't be read", without saying which entry. Key files no router names then stay (0600, in the 0700 folder) until the row is fixed or removed; the old temporary files still go. Naming the row is a follow-up.
  • Follow-up: test nodes left running after a CI timeout. The tests that start a node as a subprocess (tests/startup_signals.rs, like the other subprocess tests) stop it when the test ends, a failed one included, but a test process killed outright (a CI job's timeout) can't, and its node keeps running on its loopback ports (one started to join, which isn't ephemeral, gives up after two minutes and runs standalone). On the self-hosted build VM it stays until it is stopped by hand. Stopping leftover test nodes before a run is a follow-up.

Verification

api_002_only_an_admin_writes_a_router (operator, viewer, an operator's agent token with every write area, an admin's agent token holding the scope an earlier build gave routers; PUT, DELETE, dry runs; an admin's session and token may) and api_002_a_forwarded_router_write_needs_an_admin (forward::apply, with and without by_admin), api_002_agents_never_write_routers; api_002_router_cannot_name_another_routers_key and api_002_router_credential_paths_are_refused (.., absolute, relative, a link inside secrets/, a file put in secrets/, another router's file, for each key field; the router's own file at a new address), api_002_a_pasted_key_goes_only_over_https, with the unit tests api_002_pasted_router_secrets_become_new_files and api_002_router_bodies_name_no_key_file; api_002_a_stored_router_naming_another_routers_key_is_not_polled (the router task against a loopback console: another router's key with another site, a file outside secrets/; the files' router, a stored override keeping its file and endpoint, and a pasted key are polled), api_002_a_key_file_is_used_only_for_the_router_it_was_saved_for, api_002_a_router_key_is_in_the_data_directorys_secrets_folder, api_002_a_held_router_is_logged_once_per_reason; api_002_a_router_whose_key_file_is_gone_says_key_missing; api_002_router_key_kept_when_saved_but_not_applied and api_002_router_key_kept_when_the_client_goes_away; api_002_router_key_files_are_private_recorded_and_undone; api_002_orphaned_router_key_files_removed and api_002_a_key_its_own_stored_entry_names_is_kept; api_002_router_definitions_redacted_for_viewers (by kind and not, an MCP resources/read); api_002_keep_in_git_names_a_secret_mount_for_a_router_key; api_007_a_backup_never_holds_router_keys; deploy/routers-ui-e2e.sh and deploy/routers-e2e.sh (CI); the Playwright test api_002 routers are added and changed in the UI. Second round: api_002_a_shared_router_with_its_key_in_a_secrets_folder_is_polled_on_any_node (a replica polls with the key under the mount folder and holds it with the hint elsewhere; a promoted primary the same), api_002_a_pasted_key_replaces_a_file_the_planned_router_lacks, api_002_the_start_sweep_waits_for_the_state_database, api_002_an_unchecked_certificate_needs_an_address_for_a_pasted_key, api_002_a_pin_diff_names_no_router_key_file (telltale-api), api_002_router_key_kept_when_the_client_goes_away (now with the audit entry and the replay), api_002_a_pasted_key_is_kept_for_a_retry_only_as_a_keyed_hash, api_002_the_request_key_is_private_and_kept_across_restarts, api_002_the_request_key_is_made_whole_or_not_at_all, api_002_a_router_write_replays_for_its_idempotency_key, api_002_a_routers_site_stays_in_the_path, api_002_a_key_is_pasted_only_into_a_normal_data_directory, api_002_a_pasted_value_never_shows_in_debug_output, api_002_keep_in_git_uses_a_safe_folder_name, api_002_the_sweep_never_follows_a_link_out, api_002_the_use_rule_without_files_and_with_a_git_commit, and the Playwright test api_002 the plain-HTTP notice is for a page reached over the network. Third round: api_002_a_pin_command_diff_names_no_router_key_file_below_admin, api_002_configuration_changes_running_at_once_are_bounded and api_002_a_change_whose_task_fails_answers_a_fixed_500 (telltale-api); api_002_a_retry_while_the_first_change_runs_is_not_made_twice, api_002_a_backend_write_whose_caller_goes_away_runs_to_its_end, api_002_the_router_task_sweeps_after_the_routers_change, api_002_a_router_without_its_key_asks_for_the_key_to_be_pasted, api_002_a_missing_mounted_key_says_put_the_file_there, api_002_the_sweep_removes_old_temporary_record_files, obs_010_cloud_identity_tokens_are_no_credential_files, obs_010_an_alert_destination_names_no_router_key; the replica in api_002_a_shared_router_with_its_key_in_a_secrets_folder_is_polled_on_any_node now logs a warning. Fourth round: api_002_a_stale_override_with_a_mounted_key_is_left_out_of_the_shared_configuration (matching kept and published; moved: the files' router in effect and shared, a replica built from it has only that, one warning; removed: neither), api_002_an_override_of_a_removed_files_router_is_held (read while it matches, never asked once the files remove the router), api_002_a_replica_with_a_stale_own_copy_still_polls_a_folder_key, api_002_a_backend_write_whose_caller_goes_away_runs_to_its_end (now waiting on the configuration lock), api_002_the_sweep_removes_old_temporary_request_key_files, obs_010_feature_files_are_refused_in_any_case, agt_007_a_busy_apply_leaves_the_plan_to_apply_again (telltale-api), and, for the start-up signals, ops_007_a_stop_during_start_up_drains_and_exits_cleanly and ops_009_a_reload_during_start_up_reloads (tests/startup_signals.rs). Fifth round: api_002_a_stale_override_is_left_out_when_the_primary_cannot_resolve_the_key (a mounted key that is a link out of the folder, and a key outside every folder), api_002_the_sweep_removes_only_names_it_makes (forged records kept; an unreadable stored row stops the sweep), api_002_the_sweep_knows_every_name_it_makes, api_002_a_held_router_of_this_nodes_files_is_told_about_the_folder, and in tests/startup_signals.rs ops_007_a_stop_during_a_cluster_join_ends_the_node, ops_007_ctrl_c_during_a_cluster_join_ends_the_node and ops_009_a_reload_during_a_cluster_join_keeps_the_node (a join to a loopback port where nothing listens holds start-up open).

Requirements API-002 CLU-006

Builds on ADR-069 ADR-080 ADR-120 ADR-125 ADR-179 ADR-180

Referenced by ADR-120 ADR-179 ADR-182 ADR-183 ADR-191

ADR-182 Upgrades driven from the cluster: the node asks, a root update service installs, ctl upgrade orders the nodes, and the chart's hook runs it firstProposedAGTa community request and pull request (PR #72, Greg Pakes, 2026-11-19), changed on top before it was merged.

Context

a community request and pull request (PR #72, Greg Pakes, 2026-11-19), changed on top before it was merged. A cluster with a controller in Kubernetes and native nodes outside it (a Proxmox container, a Pi) is upgraded by hand in three steps: self-update on each native node, replicas first, then the chart bump. GitOps automates the last step and nothing does the first two, so a merged Renovate pull request upgrades the controller before its replicas, against the order spec/12 §9 and ADR-059 ask for (spec/12 says "Helm upgrades handle this via hooks", and the chart has none). Three things stood in the way. ADR-046 says the UI never updates a node, because replacing the binary needs root and the native unit runs as telltale under ProtectSystem=strict (ADR-038). self-update installs the newest build of a channel and can't be pinned, so it can't match a chart's version. And edge binaries are replaced on every build, so only the newest one can be downloaded. This is the project's first component that runs as root, and the first way for the cluster to reach one, so the boundary is stated exactly.

Decision

  • The boundary. The node asks; root verifies the signed index, binds the version to the checksum, installs only a build newer than the installed one and on the node's channel, rolls back a build that doesn't come up healthy, and records the result. Nothing else comes from the request: it holds an id, a version, a display name and a time, and no URL, mirror, key, channel, argument or environment. What root needs beyond that (the node's channel, where the health check asks) is in its own root-owned unit, written by install.sh. ADR-046's reason stands: the node's own service still never replaces its binary.
  • The channel is a setting, not the version string. install.sh writes Environment=TELLTALE_UPDATE_CHANNEL=edge|stable into the node's unit and the update service's: edge with --edge, else the channel of the version it installed (it says which). A node on the stable channel takes only releases; a node on the edge channel takes edge builds and releases newer than its version, and stays on edge after a release (the next edge build is still taken). The node (the API and the RPC), ctl's pre-flight and the update service all apply the same rule (update_api::channel_takes); without the variable (an install from before it) the version's channel is used, as before. A request never moves a stable node to edge builds.
  • The request. Asked for a version, a native node writes <data_dir>/update/request.json (in a folder of its own it makes, 0750) and nothing else, and answers with the request as it wrote it (its id is what ctl follows; never read back from the file, which the update service may have taken already). One request at a time per node: while one waits for the update service, or the last run says installing and is under 16 minutes old (the unit's limit), another gets update_in_progress (409) and the first is never overwritten (the file is created, never renamed over). A dry run makes the same checks and writes and removes nothing. A version whose new build was installed on the node and didn't come up (rolled_back, or failed after the swap: the previous binary couldn't be put back) is refused there for 24 hours from that run, as the node recorded it (update_failed_recently, 409, at the node and again by the update service, which keeps that run through later ones; the node's state shows it as held), so a hook that retries doesn't install and restart the node over and over. A run that failed before anything was installed (a network error, the downloads' deadline, a signature or checksum, an edge build moved on, a refused request) holds nothing back: one passing GitHub or DNS outage must not block a version, and every sync of the hook, for a day. The refusal names the run, when it ended, what failed, and the two ways out: self-update --to by hand on the node, or wait until the time it gives.
  • The root units. install.sh installs telltale-update.path (PathExists= on that file) and telltale-update.service (oneshot) with the node's data directory written in (from the config's effective [node] data_dir; one that isn't a plain absolute path gets no units), the channel, and Environment=TELLTALE_UPDATE_HEALTH_URL= (below), and leaves them off: install.sh --cluster-updates or systemctl enable --now telltale-update.path turns them on. --cluster-updates is refused, before anything changes on an existing install, when the binary's folder or any folder above it isn't root's alone (owned by root, not writable by group or others), when the data directory is under /home or /root, or when the data directory's parent isn't root's alone (an older Debian or Raspberry Pi OS image whose /usr/local is root:staff 2775 is refused until chmod g-w /usr/local /usr/local/bin, and the message says so), when the API is off ([api] enabled = false: nothing could prove a new build came up), and on a node that runs an edge build unless --edge (stay on edge) or --stable (move to releases) is given (a re-run without either would install the newest release, an older version); and it turns the path unit on only once the node answers 200 at the health check's address (it prints the address; with --no-start it turns it on with a warning to check it). These are environment lines, not command-line flags: install.sh fetches the units from main when it doesn't run from a checkout, and an older binary would refuse an unknown flag. The service has one capability (CAP_DAC_OVERRIDE, to read and remove the request in the node user's folder), NoNewPrivileges, and the node unit's sandbox (ProtectSystem=strict, SystemCallFilter=@system-service, ProtectProc=invisible, MemoryDenyWriteExecute, PrivateTmp, PrivateDevices, RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX, and the rest), and ReadWritePaths= for the binary's directory, <data_dir>/update/ and its own StateDirectory=telltale-update. systemd-analyze security rates it 2.0 (the node's own unit 1.6; the PR's first version 5.2). Its lines go to its journal. The sandbox is defence in depth, not the proof that root writes only update/: that folder sits in a folder the node's user owns, which systemd resolves when it builds the unit's namespace, so a node that swaps it for a link could widen what the unit may write. What keeps root's writes to fixed paths is the code (it writes only the binary's directory, its own state, and removes the request through the folder it opened without following a link). A root-owned request spool outside the data directory is the proper fix and a follow-up.
  • What the update service does, in order (telltale self-update --request, the installed binary run as root):
    1. Opens the request's folder (O_DIRECTORY|O_NOFOLLOW: a real directory, not world-writable, owned by the data directory's owner), then the request in it (O_NOFOLLOW|O_NONBLOCK|O_NOCTTY), and checks the opened file: a regular file, one link, at most 4 KiB, owned by the folder's owner. It reads it and removes whatever is at the name (a link, a FIFO, an empty directory; a directory with something in it is left: root never reaches into the node's files). One generic error goes to the world-readable result for anything that isn't a request.
    2. Refuses (recorded, exit 0): JSON of another shape or with an unknown field, a malformed id or by, a request more than an hour old or from the future, a version not written exactly as a release or edge build (padding, a newline or a leading zero included), a local build installed, an older version, an edge build on a node set to the stable channel, and a version whose build was installed there and didn't come up in the last 24 hours (by the node's record of that run).
    3. Refuses (recorded) when the host isn't set up for it: the installed binary, its folder or any folder above it isn't root's alone (install location is not root-owned), or TELLTALE_UPDATE_HEALTH_URL isn't a plain http:// URL of /readyz at an IP address and port of this host (loopback, or an address a socket can be bound to; no name, no user, no other path). Checked again before the previous binary is put back.
    4. Records installing; fetches the release's SHA256SUMS and its signature and verifies them with the release key built into the binary (no runtime override), then the signed releases.json: it must be of the version's channel, name exactly that version, and list the same SHA-256 for this binary's architecture. An edge build is fetched only while it is the newest on the edge channel; otherwise the run is unavailable. One deadline, 480 s, for all the downloads: past it the run is failed and nothing is installed (the old binary stays).
    5. Fetches the binary (at most 128 MiB, its SHA-256 checked), test-runs --version (killed after 10 s), keeps the installed one as telltale.old, and renames the new one in.
    6. Restarts the node (systemctl restart telltale, by its absolute path, waited for 60 s: twice the node unit's TimeoutStopSec=30, so the old process is gone by then). The command's own outcome is no verdict on the build: if it outlasts the wait (a long drain, a stop systemd ends with SIGKILL; the restart goes on in systemd) or exits non-zero, the run goes on to the health check, which decides, and health notes it. Then it waits up to 120 s for the node's readiness for a start (/readyz?startup=1: maintenance not counted) to pass twice in a row, 2 s apart, at TELLTALE_UPDATE_HEALTH_URL: the node's [api] listen address and port as install.sh found them (a wildcard bind asked at loopback; a unit without the variable asks http://127.0.0.1:8053). Then updated, with health: "checked at <url>". With the API off ([api] enabled = false) there is nothing to check, so the feature isn't available: install.sh --cluster-updates refuses, and a unit whose variable is empty makes the update service refuse the run before anything is fetched (refused: no health check configured). A node that needs longer than 120 s to come up (very large lists on an SD card) is rolled back.
    7. If it isn't healthy, puts telltale.old back (renamed back, after the location check again), clears the node unit's start limit (systemctl reset-failed, 10 s), restarts once more and checks again: rolled_back, with the reason. If the previous build's own check fails too, the run is still rolled_back (the previous build is back in place), with a note that the check may be what's wrong (the address, or [access] allowed_networks leaving this host out). Only when the previous binary can't be put back: failed. One attempt, no loop. The whole run takes at most 884 s (the downloads, the test run, two restarts and health windows, the reset, and the pauses of the tries a program that is "text file busy" is given), under the unit's TimeoutStartSec=960 with a minute to spare, and ctl upgrade --timeout (15 minutes by default) is at least that (node_update::run_budget_secs, checked by a test), so systemd never kills a run between the install and its check. The result, /var/lib/telltale-update/result.json (written by temporary file and rename in root's own directory), is what the node reads (GET …/update): by in it is the node's word for who asked (byVerified: false), and the journal says so ("as written by the node (unverified)").
  • rolled_back is an incident signal, not proof the build was bad. The node's own process answers /readyz, and any local user can bind the loopback port first, so the unprivileged side can make a healthy build look unhealthy (it can't make root install anything else: the rollback only puts back the binary root set aside). ctl stops at rolled_back; look at the node before asking again (it refuses the same version for a day anyway). A compromised node can do this again each day to keep a fixed version off: a rolled_back of a security release is a sign of compromise, to be resolved on the node by hand (self-update --to).
  • Who can ask. An admin (POST /api/v1/nodes/{id}/update {"to"}); an agent API token with cluster:upgrade (admin level, in no default set, made by an admin; like every agent token it must say why with X-Telltale-Reason, which ctl upgrade sends); a cluster member the registry lists that isn't ephemeral, over the RPC update (as for maintenance: the entry node sends the call to the node it names). An ephemeral member (a resolver pod), a peer the registry doesn't list, and an OAuth access token for MCP can't: the RPC gives an ephemeral or unlisted peer nothing, not even a read of the update state (which names who asked and the errors), and the scope is neither advertised in scopes_supported nor taken from an identity provider's token. The node checks again: its install type and update service (update_unsupported, update_not_enabled), the version (update_invalid, update_downgrade), the channel (update_channel), a version whose build was installed there and didn't come up in the last day (update_failed_recently), and the lock (update_in_progress). ?dryRun=true makes every check and writes nothing (AGT-002). Audited on the entry node (node.update.request, and node.update.refused for a refused admin or agent attempt) and on the target node, which names the sending node and keeps the user it states as unverified (a peer's name is cut to 200 characters before " via <node> (unverified)" is added, so the marker always shows); a request refused at the RPC gate (an ephemeral or unlisted peer, a stale call) is audited there too. It changes no configuration, so a GitOps-managed cluster takes it too.
  • An exception to "an agent token never counts as an administrator" (ADR-179, ADR-180, ADR-181). cluster:upgrade is an agent scope of admin level so that the chart's hook can hold a narrow token instead of an admin's API token in a Kubernetes Secret, which could do anything an admin can. The scope reaches this one route and nothing else; the hook's token also needs analytics:read (to read the cluster), which reads every analytics route.
  • Pinned installs. self-update --to <version> installs that version only: a release from releases/download/v<version>, an edge build from the edge release while its signed index names it; in both cases the index must be of the version's channel, name the version and list the same SHA-256 as SHA256SUMS. By hand, --to may go back; a request never does.
  • The order: telltale ctl upgrade. --to <version> or --to-self. From GET /cluster: pods and ephemeral members are the chart's, witnesses only vote and are upgraded by hand, nodes on the version, newer, or on a local build are left alone, and a member never heard from is down. Then a pre-flight: GET …/update for every planned node before any is asked; a container is left alone; a node that is up but can't take the request (its update service off, a request waiting or an update running, on the stable channel and asked for an edge build, or a version it refuses for a day) stops the run with nothing asked, the error naming each and why; a channel mismatch says what the node follows, what was asked, and how to move it. --skip-down leaves out only nodes that are down (a node set up wrong is not down). Then replicas first (by site, then ID), the primary last, one at a time, each done only when its update service has recorded updated for this request (after the health gate) and the cluster view shows it on the version, up, ready and with no configuration lag (--timeout per node, 15 minutes by default: at least the update service's longest run); a rollback inside the gate stops the run before the next node is asked. The first failure (failed, refused, rolled_back) stops it. A node that reports the edge build unavailable stops it too, unless --skip-unavailable: then that node is left on its version with a loud line, and the run goes on (the order is lost for that node in that run, and the line says so). Every request carries X-Telltale-Reason (--reason, default telltale ctl upgrade --to <version>). --dry-run prints the order and what would stop it; --node limits it; --skip-if-unreachable succeeds, with a loud line, only for a first install: the API's name doesn't resolve or nothing listens at its address. A timeout, a TLS failure, packets a policy drops, or an HTTP error (401, 403) fail the run.
  • The chart's hook. upgradeHook.enabled (off by default) renders a Job with helm.sh/hook: pre-upgrade (Argo CD runs it as PreSync, on every sync) from the chart's own image, running telltale ctl upgrade --to-self --skip-if-unreachable against the release's API Service with an agent token from upgradeHook.tokenSecret (optional: true: a missing Secret fails the run at once with "set TELLTALE_TOKEN" instead of a pod waiting for it until activeDeadlineSeconds); upgradeHook.whenUnavailable: fail|skip (default fail) passes --skip-unavailable for skip; upgradeHook.caSecret (name, key) mounts the certificate an https:// URL with a self-signed certificate is checked against (--ca-file). The Job is deleted only before the next one (before-hook-creation), so a run's log, a skip's warning included, can be read until the next sync. With --to-self, pin image.tag to a build (sha-… or a version): the chart's default tag edge with IfNotPresent can run an older cached :edge image. A NetworkPolicy with apiFrom gets a rule for the hook's pod only while the hook is on. Helm waits for a hook only --timeout (5 minutes by default): use --timeout 45m (the Job's activeDeadlineSeconds is 2700: two native nodes at 15 minutes each, the pre-flight and the pod's start; raise both for more nodes).

GitOps and Argo CD, case by case (what the code does):

  • Hook off: nothing changes; the chart's pods roll as before, and native nodes are upgraded by hand.
  • Hook on, pinned to a release: the first sync after the bump asks each native node behind it for that release, replicas first, then the pods roll. Later syncs find every node on it (or newer) and ask nothing: no request, no download. An edge node (set with install.sh --edge) stays on edge and takes the next edge pin.
  • Pinned to an edge build that is the newest: the same, for that build. A node on the stable channel stops the run at the pre-flight, said in full.
  • Pinned to an edge build main has since passed, with a native node behind it: that node's update service records unavailable (only the newest edge build can be fetched). With whenUnavailable: fail the hook fails and the sync stays blocked until the pin moves to the newest edge build or a release; with skip the node is left on its version, loudly, and the pods roll. Nodes already on the pin or newer are never asked, so a stale pin blocks only while a node is behind it.
  • A native node down: the run stops before anything is asked (the pods keep their version) unless skipDown.
  • The controller up but not ready: on some CNIs (Cilium) a Service with no ready endpoints drops the connection instead of refusing it, so the hook fails rather than skips, and the sync waits until the controller answers (intended). With the hook on and the controller dead, turn the hook off in the chart to roll a fix. For the first 90 s after the node that answers starts, a native node that hasn't connected since isn't listed at all (the view lists the registry's missing members only after giving them that long to reconnect), so a hook run then can pass without it.
  • A native node whose new build was rolled back (or couldn't be rolled back): every later sync stops at it for 24 hours from that run (update_failed_recently, the node's held, at the pre-flight) unless the pin moves on. A run that failed in the downloads holds nothing: the next sync tries again.
  • The token: it expires (expires_in_days), is revoked, or agents are turned off ([agents] enabled = false): every sync fails from then on (the hook's first read is refused), a values-only helm upgrade too. Make it without an expiry for this narrow scope, or rotate it with a reminder.
  • The first install: Helm doesn't run pre-upgrade on helm install; Argo CD maps it to PreSync, which runs before anything of the app exists, so nothing answers (the Service's name doesn't resolve, or nothing listens) and the hook succeeds with a loud line. No cluster exists yet to make the token in: keep the hook off until the token exists, or create the Secret with a placeholder (a missing Secret fails the hook at once); a PreSync hook runs before the app's own resources, so the real Secret is made outside the app (or as an ExternalSecret or SealedSecret ordered before the hook).
  • A native primary whose replicas are the chart's pods: the hook upgrades the native nodes first, so it upgrades that primary before its pod replicas; run ctl upgrade by hand in that shape.

Alternatives rejected

  • SSH from a hook into each node: the chart would hold keys to other machines and run a script only one site has.
  • Each node following the primary's version by itself (a timer that reads it): no SSH or token, but the primary goes first, against spec/12 §9, and nothing stops at a failure.
  • The node's service replacing its own binary (write access to /usr/local/bin, or a capability): it undoes ADR-038's sandbox for every install, used or not.
  • A polkit rule letting telltale start a root unit: more moving parts than a path unit, and the same trust in the end.
  • Per-commit edge binaries: a release-workflow change (assets kept per build, an index per commit). Until then an edge build is installable only while it is the newest; whenUnavailable says what a GitOps sync does about it.
  • The channel from the version string (the first version of this ADR): an edge node that took a release then refused every edge build, and the documented first steps moved an edge Pi to stable. The health address from the request, or root reading the node's config: the request carries no URL, and the config is the node's to change; install.sh writes the address into the root-owned unit instead.

What each party can make root do (and not):

  • A compromised telltale process (the node's user): write the request itself (no API, no audit), and so make root restart the node and install a signed build newer than the installed one on the node's channel (on a stable node any newer release; on an edge node the newest edge build, CI signs one on every push to main, or any newer release, after which it stays on edge), at a time it chooses; make a healthy build look unhealthy (it answers /readyz), so root puts the previous one back (rolled_back, an incident signal); switch the feature off (requests that trip systemd's start limit, or a directory with something in it at the request's name: the path unit fails until systemctl reset-failed); make root read a small file it wrote and remove names in update/; and possibly widen what the unit's sandbox lets root write (above; the code writes nothing more). It can't get an unsigned, modified or older binary run, a stable node onto edge builds, a URL, key, argument, environment or health address, or a root write the code doesn't make.
  • An admin: the same through the API, for any native node, and for several at once if it chooses (one at a time per node is enforced; ctl upgrade's order across nodes is the tool's).
  • An admin's agent token with cluster:upgrade: the same, and nothing else an admin can do.
  • A cluster member the registry lists (a replica or a primary, compromised or not): the same over the RPC, naming any user (recorded as unverified). An ephemeral member or an unlisted peer: nothing, not even a read of a node's update state.
  • The hook's token (cluster:upgrade and analytics:read): as an agent token, plus the analytics reads. Whoever controls the chart's values or image controls the controller anyway; through the hook they can move native nodes only to signed builds newer than theirs, on their channel (an edge node may be given a release).

Not covered

a root user of the host; a systemctl that fails without restarting anything (a missing binary, a refusal on the system bus): the old process still answers the health check, so the run is recorded updated while the old build runs, and the next request for that version answers up_to_date (the installed binary is the new one); comparing the node's MainPID before and after the restart is the planned follow-up; the signing pipeline (edge builds are signed in CI on every push to main, and that step runs repository code with the key in its environment); the units install.sh fetches from main when it doesn't run from a checkout (as it does the node's own unit); a root-owned request spool outside the data directory (the follow-up that makes the sandbox a proof, and lets the data directory be anywhere; until then --cluster-updates refuses one under /home or /root or in a folder that isn't root's); maintenance around the restart (a native node restarts without a maintenance window, so node_down alerts can fire: a follow-up, which would also need ops:maintenance for the hook); per-commit edge assets; an MCP tool; a button on the Cluster page; the spec/08 §4 cluster minimum-version check before an install; Idempotency-Key on the request (a follow-up; the lock already makes a retry answer update_in_progress); nodes with the API off (refused).

Consequences

  • ADR-046's "the UI never self-updates a node" now reads "never replaces the binary itself": the node asks a root service that the operator turned on (amendment pointer in ADR-046). The Settings panel's steps are unchanged.
  • The first upgrade after this lands is by hand on each native node, on its own channel: a node without the RPC answers "unknown call" (reported as node_unreachable with "upgrade it by hand this once"), and an older entry node answers a bare 404 (ctl says so). So a Pi on edge builds needs sudo telltale self-update --channel edge --restart (a node on releases: sudo telltale self-update --restart; or --to) to a build with this feature, then sudo sh install.sh --edge --cluster-updates (without --edge on a node on releases) for the units: without --edge, install.sh would install the newest release and set the stable channel, so --cluster-updates over an edge build refuses until --edge or --stable is given.
  • Mixed versions: nodes with this feature and without it can be in one cluster; ctl upgrade stops at one without it (pre-flight), with --skip-down too.
  • A transient download failure is a plain failed with the old build untouched: it holds nothing back, and the next request (the next sync) tries again.

Verification

ops_014_versions_are_checked_and_ordered, ops_014_a_node_keeps_the_channel_set_for_it, ops_014_update_routes_need_their_scope, ops_014_update_requests_over_http, ops_014_a_dry_run_reaches_the_node_as_one, ops_014_a_refused_update_request_is_audited, ops_014_an_oauth_token_never_carries_cluster_upgrade, ops_014_a_call_about_a_nodes_own_state_finds_its_node; ops_014_a_node_takes_only_newer_versions_it_can_install, ops_014_a_request_is_written_for_the_update_service_and_shown_as_pending, ops_014_the_answer_names_the_request_written_and_marks_a_peers_by, ops_014_a_second_request_waits_for_the_first, ops_014_a_dry_run_writes_nothing, ops_014_a_dry_run_leaves_a_dead_request_in_place, ops_014_an_ephemeral_member_cannot_ask_for_an_update; ops_014_the_update_service_installs_a_newer_version_once_and_records_it, ops_014_a_failed_install_is_recorded_and_does_not_restart, ops_014_the_update_service_trusts_nothing_in_the_request, ops_014_the_update_service_reads_no_symlink_or_large_file, ops_014_a_link_to_a_fifo_is_refused_without_blocking, ops_014_a_fifo_or_directory_at_the_request_is_refused_and_removed, ops_014_a_padded_or_unparseable_version_is_refused, ops_014_a_request_never_moves_a_stable_node_to_edge, ops_014_an_edge_node_that_took_a_release_stays_on_edge, ops_014_a_request_folder_that_isnt_the_nodes_is_left_alone, ops_014_the_units_watch_and_write_only_the_request_folder, ops_014_a_host_not_set_up_for_it_refuses_before_fetching, ops_014_the_health_gate_takes_only_a_plain_address_of_this_host, ops_014_the_install_location_must_be_roots_alone, ops_014_the_run_fits_in_the_units_time_limit, ops_014_a_build_that_does_not_come_up_is_rolled_back, ops_014_a_slow_or_failed_restart_command_is_left_to_the_health_check, ops_014_a_rollback_whose_check_fails_too_is_recorded_as_rolled_back, ops_014_a_failed_rollback_is_recorded_and_stops, ops_014_a_version_that_failed_is_not_asked_for_again_for_a_day, ops_014_a_failure_before_the_install_holds_nothing_back, ops_014_an_edge_build_no_longer_served_is_unavailable; ops_014_a_pinned_release_is_downloaded_from_its_own_page, ops_014_a_pinned_install_takes_only_the_version_its_signed_index_names, ops_014_an_edge_build_installs_only_while_it_is_the_newest, ops_014_a_pinned_install_takes_only_an_index_of_the_versions_channel, ops_014_downloads_that_take_too_long_install_nothing; ops_014_upgrade_order, ops_014_the_preflight_reads_each_node, ops_014_a_node_that_cant_take_the_upgrade_stops_the_run_before_any_is_asked, ops_014_ctl_upgrade_goes_one_node_at_a_time_and_stops_on_failure, ops_014_ctl_waits_for_updated_and_stops_at_a_late_rollback, ops_014_ctl_upgrade_works_with_an_agent_token, ops_014_only_a_first_install_is_skipped, ops_014_ctl_upgrade_and_an_edge_build_no_longer_served, ops_014_nodes_on_the_version_are_not_asked; deploy/helm/upgrade-hook-test.sh, deploy/systemd/update-units-test.sh, and the deploy/systemd/e2e.sh step "the update service picks a request up" (the units' channel and health address, the sandbox, a refusal, a FIFO, install.sh --cluster-updates).

Requirements AGT-002

Builds on ADR-038 ADR-046 ADR-059 ADR-179 ADR-180 ADR-181

Referenced by ADR-046

ADR-183 Named devices follow their MAC address: the routers' address-to-MAC lists join the neighbor table for identification, under rules that keep one device's rules off another; host names never identifyProposedAGTAPICLUFLTOBSGitHub issue #73 (a user's report, 2026-11-20).

Context

GitHub issue #73 (a user's report, 2026-11-20). A quick rule made from the query log was pre-filled with the name the router reported for a TV ("LGwebOSTV"), and a rule can't target that name. The user gave the address instead, and asked for rules that survive address changes: "a hostname or even better a MAC address".

Phase 0 (no ADR) fixed the form and the refusal. What remains is that a device is recognized by MAC only from the kernel's neighbor table (ADR-021). That table sees a device only with host networking on the same layer-2 network: not in a Docker bridge, a Kubernetes pod or another VLAN.

TelltaleDNS serves no DHCP (ADR-091), but the router integrations (ADR-080, ADR-166, ADR-181) already read:

  • UniFi's connected clients;
  • OPNsense's DHCP lease rows.

Each gives an IPv4 address and a MAC, and every node shares what its routers report (ADR-125). Until now these were for display only.

ADR-021 deferred host-name matching (FLT-006), and it stays deferred: this ADR doesn't build it, and FLT-006's "hostname" item is not delivered by this change (ADR-021 remains the reference; spec/01 is not edited). What it delivers is identification by MAC from the routers' lists. ADR-067 says a quick rule's devices may be given "by name, IP, or MAC, as [[client]] keys"; the code takes a device name, an IP or a CIDR. API-010 says naming creates a client object with "its IP, and the MAC when known": the dialog now offers the MAC and can store it without the IP, which is where this ADR records the difference from API-010's sentence (an IP key would name whoever holds the address next).

A review of the first design (2026-11-20) found four ways a router binding could put one device's rules on another, which are closed below:

  1. a lower source filling an address a higher one distrusts;
  2. day-long trust windows on the wall clock;
  3. older members' unchecked lists;
  4. one MAC at many addresses.

Decision (proposed):

Host names never identify a device. A DHCP host name, a UniFi alias, an mDNS name and a reverse-DNS name name a device for display only. Any device can announce any name, many devices of one model announce the same one, and a UniFi alias arrives in the same field as the DHCP name. This does not build the host-name matching ADR-021 deferred, and doesn't close that deferral: the routers' lists contribute MAC addresses, not names, to identification.

One table, three sources, in this order.

  1. The kernel's neighbor table: what this host saw on its own link.
  2. The bindings this node's routers report.
  3. Those other full cluster members' routers report.

The chain is otherwise unchanged: client ID → EDNS MAC from a trusted forwarder → this table → Kubernetes workload → exact IP → most specific CIDR → network group / default.

  • A binding identifies only a [[client]] that lists that MAC in match; it never creates a device.
  • Where the table maps an address to a named device's MAC, that device wins over a [[client]] keyed by the exact IP, as a kernel entry already does. Where the binding is withheld (below), the exact-IP device wins again.

A router binding is withheld when any of these holds:

  • Offline: the client isn't connected (ADR-166). It gives no binding and withholds nothing.
  • A MAC that can't identify: a connected client whose MAC is empty, doesn't parse, is all zero or is multicast withholds its address, as an unsure one does (a tombstone, below), on this node and, for a member's lease, on every node: otherwise a member's router could fill the address with a named device's MAC (two sites reusing a range). The node says once per router, in the log, that its rows carry such MACs and that the fallback (the device is recognized by its address or network) is by design.
  • unsure: this node marks a binding unsure when:
    • its fresh routers, or two rows of one router, give one address different MACs (compared as parsed bytes);
    • they place one MAC at two or more addresses (a range extender or bridge that shares its MAC);
    • UniFi gave a connected client's address from last_ip or fixed_ip rather than ip;
    • the router hasn't answered for 15 minutes.
  • Tombstone: an address this node withholds (unsure, or a MAC that can't identify) can't be filled by any lower source. The kernel still wins. A member's tombstone doesn't withhold an address this node binds itself (own routers come first); tombstones holds only addresses with no binding of this node's, and the count of withheld addresses (telltale_router_macs_unsure) is those plus the shared ones, each once.

Silence is counted on a monotonic clock from the node's start (never the wall clock, which can step), with saturating arithmetic. Locally administered ("private") MACs count, and the UI says they may change. Display names keep their rules (within one router the last row still names an address; between routers the order is now fixed).

Across the cluster. A node takes other members' bindings from their devices.names answers (ADR-125) only when all of these hold:

  • the answer is from a full member: a node the member registry lists and that is not ephemeral (ADR-143; a resolver pod holds no router keys, ADR-120). Nothing a peer says about itself counts: its Hello's primary flag is a claim any node with a valid certificate can make, and the rest of the cluster code refuses it too (a fix round, 2026-11-23, took out a first version of this ADR's exception for "the primary"). A replica's first round can come before its copy of the registry is written; the answer is then not used and the quick retry (below) goes on until the registry lists the answerer, a few seconds;
  • the answer carries vetted (a new field, written by this version: an answer from an older member, whose lists lack these rules, gives no bindings);
  • the member answered within the last 15 minutes.

An answer from a member that is not vetted (a member rolled back to an earlier build) also removes that member's bindings kept so far, at once.

Any member's unsure lease for an address removes that address. So does a disagreement between two members, and so does one MAC at two addresses across this node's and the members' bindings. The MAC is counted over every binding and every withheld lease, in this node's view and in the members': an address a node withholds, and an address two members disagree about, still count the MAC they gave there, so a MAC-sharing extender can't hide behind an address one node is unsure of. The one exception, and the choice (fix round 3, decision D5): the rows of a router this node has marked stale (silent for 15 minutes) never veto fresh data. They are marked unsure as they are, and also stale: on the node that reads that router their addresses stay withheld (tombstones), but their MACs are not counted at those addresses, so a device that moved while such a router stayed configured is recognized at its new address, here and on the other nodes. A member's answer carries the mark (stale, written only when true, so the wire stays additive: an older node reads the row as unsure, as before, and never identifies from it); another node of this version drops a member's stale rows altogether, so they withhold nothing there, neither their address nor their MAC. (Sending a stale router's rows as offline on the wire would have the same effect on identification, since a member's offline rows are skipped, but it would also change what the other nodes' display names say about the address (an offline row names only an address no connected row has), and an older node would then take the stale rows for ordinary offline clients; the explicit mark keeps both as they are.)

A node never passes on what it learned from others, so a stale binding lives at most one router-silence window plus one member-silence window: about 30 minutes, plus one exchange. That bound is on the age of an answer, not only on silence: a router read once an hour is never silent, yet what it said can be an hour old. So while a device is named by its MAC and router_macs is on, a node reads each of its routers at least every 10 minutes (600 s) whatever the router's interval_secs says (also when such a device appears during a longer wait): a read that fails is asked again every 15 seconds, well inside the 15 minutes after which an answer is stale. With no device named by its MAC the pace is interval_secs. Two nodes that read one router (the high-availability setup) poll out of phase, so a device that has just moved can be withheld on both until both have polled: one MAC then sits at two addresses in their combined view.

Who hears whom. A node asks only the members it has a direct stream to, and a member's answer carries only what its own routers said. Replicas dial the primary; the voters link to each other only under automatic failover (failover = auto with three or more voters: the default is manual, and then a replica has a stream to the primary alone); a resolver pod connects to the primary alone. So a router read by a replica reaches the primary, and, under automatic failover, the other voters, not the resolver pods: a pod gets the primary's own router view. A replica that refuses a configuration (invalid files, a newer schema) never writes the member list, so it keeps no member's bindings: that replica is degraded anyway. The router's key therefore belongs on the primary, and, for a failover, on the node that would be promoted. Relaying members' bindings to pods would lengthen the age bound (ephemeral members' own answers are never used), and is left for later.

The quick retry: a node asks every 5 seconds for at most 2 minutes, then once a minute as before, until an answer is kept (from a full member, vetted) and carries router leases: the empty answer of a full replica without the router's key, the primary's own answer before its first read of its router, and an answer that is not used (a registry that has not arrived, an ephemeral or unlisted node) don't end it. A cluster with no router anywhere pays about 24 small calls in those two minutes.

Lease.unsure and Names.vetted are written only when true: a node on an earlier build ignores both and reads the same form. ADR-125's display names are unchanged.

Where it runs. One task on every node, off the query path.

  • It reads the kernel table every neighbor_refresh_secs while [clients] neighbor_table is on.
  • It adds router and member bindings only while some [[client]] matches by MAC.
  • It rebuilds when an input changes (at once when the first MAC-keyed device appears), in a blocking task.
  • The table is swapped atomically, and the previous one is freed on a background thread after 2 seconds (ADR-023's retire).

On the query path: the same one atomic load and one hash lookup as before, and only while a device matches by MAC; a 7-byte entry instead of 6, and one branch on its source. No allocation, lock or I/O, and QuickRules::decide is untouched.

The setting. [clients] router_macs: default true; with false, only the kernel table and EDNS MACs.

  • It is shared configuration, because identity must be the same on every node.
  • It is not written while it is the default, so a node on an earlier build (the section refuses unknown fields) still reads the shared configuration.
  • Set to false, it makes an older replica refuse each new version with shared configuration: unknown field … (it keeps serving its last one), and an older build won't start with it in its own file. So the opt-out can be used only once every node runs this version.
  • It applies on reload, without a restart.

Rules and devices. No new scope kind, and no change to what a rule targets: a quick rule's devices takes a [[client]] name (any case), an IP or a CIDR, as before. A rule that should follow a device names a device recognized by MAC ([[client]] match = ["aa:bb:cc:dd:ee:ff"]). Validation reads the configuration alone.

Naming in the UI and for agents. GET /api/v1/clients/{address}/identity (MCP identify_device) gains recognition:

  • device: the configured device the address is recognized as now;
  • identifiedBy: how;
  • mac, macFrom (neighbor, router or peer), macShared: the MAC a device there could be named by;
  • macRandomized: the MAC is locally administered. It is kept for every caller who may read identities, with device and identifiedBy, including one who may not read MACs: one bit (the address has a made-up MAC), which names no device and no MAC.

How it is built:

  • It is the answering node's own view (set after the federated merge).
  • It is computed in the request from the table and the same withholding rules, with no kernel read in the request.
  • It is left out at query-log privacy level 2 and above.
  • mac, macFrom and macShared are given only to a caller who may read /api/v1/clients (which already shows MAC keys): signed-in users and API tokens of any role, and agent tokens with config:read not restricted to a group. Others get recognition without them. config:read is a default agent scope, so a default agent token reads the MAC of any address through identify_device and explain, while /api/v1/dhcp/leases stays closed to agents: kept on purpose, since the naming flow needs the MAC, and said in spec/13 and the agent docs.
  • Explain follows the same rule for client.mac (unless the caller gave it) and its new macFrom, and, like recognition, shows neither at query-log privacy level 2 and above (a MAC the caller gave is theirs and comes back). It reports identifiedBy: router_mac.
  • A MAC the kernel's neighbor table holds at two or more addresses (a MAC-translating extender) is macShared too, counted in the request over this node's table, off the query path: the kernel table has no shared-MAC rule for identification, and the dialog must not offer that MAC as one device's.

"Name this device…":

  • It edits the device the address is recognized as (or the one that already lists the MAC) instead of making a second one.
  • It offers its MAC address, as the default only when the MAC comes from a router (every node can use it) and isn't shared; otherwise it offers the MAC and says why.
  • With the MAC, it stores the MAC without the address: an address key would name whoever gets that address next.

Observability.

  • telltale_neighbors counts the kernel's entries.
  • telltale_router_macs{source="router"|"peer"} counts the bindings in use.
  • telltale_router_macs_unsure counts the ones withheld.
  • The log says when router bindings start and stop being used, and, once per spell and after a minute, when a device is named by its MAC and router_macs is on but no router or member binding reaches this node (whatever the kernel's table holds); on a resolver pod it says that only the primary's own router view reaches it, so the key belongs on the primary. It warns when a router with tls_insecure_skip_verify starts feeding identification.

REQ: FLT-006, FLT-005, API-010, CLU-002, CLU-010, OBS-005, AGT-004. Implemented in:

  • telltale_policy::clients (MacTable, MacFrom, IdSource::RouterMac);
  • devices.rs (eligible, router_bindings, the members' bindings, vetted);
  • routers.rs (rebuild, unsure);
  • server.rs (spawn_mac_table);
  • explain.rs, api_backend::recognize, federated::identity, the identity and explain handlers (telltale-api);
  • ClientChip.svelte.

Alternatives rejected

  • A host-name scope or host-name matching: names are client-chosen and often shared, and node-local names would make validation or matching differ between nodes.
  • A MAC in a rule's devices: it would need the MAC in decide() and a schema key an earlier node refuses.
  • Router bindings as a second identification step: a second lookup per query.
  • Storing the address with the MAC when naming: the next holder of the address is named and filtered as the device.
  • A node-local switch: a replica could identify devices differently from the primary.
  • A day-long trust window: during a controller outage, a revoked API key or a failover, a device that took a departed device's address would inherit its rules for most of a day, up to two days through a member. One hour is the alternative if router firmware updates should keep MAC-only devices recognized: still well under typical lease times.
  • Bindings from older members: their lists have none of the withholding rules.
  • One MAC at several addresses kept: a MAC-sharing extender would give one device's rules to every device behind it.

Not covered

  • MAC spoofing and forged DHCP client addresses: a device that copies a named device's MAC is that device, as with the kernel table.
  • A compromised or misconfigured router or full member, which can bind any address to any MAC.
  • IPv6 bindings from routers: a MAC-only device's IPv6 queries are recognized only through the kernel's NDP table.
  • OPNsense lease states: rows are taken as the API returns them, and conflicts are caught by unsure.
  • A per-router or per-site choice of which routers identify. In a cluster spanning sites that reuse one private range, a member at another site can bind a local address, and the protection also ends when a site's router goes silent: its stale rows are dropped on the other nodes, so another site's fresh binding for the same address fills it there (the node that reads the silent router still withholds those addresses).
  • A MAC that the kernel's table holds at several IPv6 addresses (and one IPv4 address) is one device, not a shared MAC: the dialog's "shared" counts IPv4 addresses only (decision D6), as the routers' bindings are IPv4 only.
  • A replica that refuses a configuration (invalid files, a newer schema) never writes the member list, so it keeps no member's bindings: it is degraded anyway, and its log says it.
  • An address reused within one router interval (300 s by default) before the next poll: the new holder gets the old holder's rules until the router's next answer (and a minute more on members).
  • Resolver pods and a replica's router. A node asks only the members it has a direct stream to, and a member's answer carries only what its own routers said, so a router read by a replica reaches the primary and the voters but not the resolver pods, which connect to the primary alone: a pod recognizes a MAC-only device only through the primary's own router view. The router's key belongs on the primary (and on the node a failover would promote). Relaying members' vetted bindings to pods, with their age, is a follow-up: it would lengthen the age bound to about 45 minutes, so it needs an age stamp and an owner decision.
  • Recognition by MAC in change simulations and rule-impact estimates (they identify by address, ADR-115), in anomaly mutes (a device needs an address to be muted, ADR-161), on the Clients page's device guess and in identity or rhythm reads by name, and in telltale explain on the command line (no routers there).
  • Sites beyond about 7,000 connected clients, where the devices.names answer outgrows the cluster channel's 1 MiB frame.
  • Source NAT in front of a resolver pod, rootless Docker, Podman and Docker Desktop: the address seen isn't the device's.
  • The kernel's neighbor entries in the STALE state (the host last saw the device a while ago) still beat a fresh, sure router binding for the address, and are not part of the shared-MAC count: kernel behaviour is unchanged, as the kernel's view always won.

Consequences

  • What users get. A device named by its MAC keeps its name, groups and device rules when its address changes, within one router interval plus up to a minute on the other nodes. This works with host networking, rootful Docker, Kubernetes with preserved sources (the chart's externalTrafficPolicy: Local), and across VLANs.
  • Behaviour change at the default (release note). Where a [[client]] matches by MAC (by hand, or from the Pi-hole importer's MAC clients) and a router reports that MAC at an address the kernel doesn't hold, the device now gets that [[client]]'s identity instead of IP, CIDR, network group or default. It arrives with the first upgraded node that reads a router. [clients] router_macs = false keeps the old behaviour, but only once every node is upgraded.
  • When a binding is missing or withheld: at start-up, more than 15 minutes into a router or member silence, on an older member's answer, or when the binding is shared or unsure. A block rule for the device then fails open and an allow rule fails closed, and the device takes its network's or the default group. DNS is answered throughout (CLU-004).
    • A router firmware update longer than 15 minutes moves MAC-only devices to that fallback until the router answers.
    • A device that moved while its old OPNsense lease is still listed isn't recognized by MAC until the old lease goes.
  • HA. Router-based identity survives a failover only if the router's key is on two full members, the primary and the node that would be promoted (resolver pods hear only the primary): config-file routers with the key in /etc/telltale-secrets/ or /run/secrets/ on both. While two nodes read one router, a device that has just moved can be withheld on both until both have polled (they poll out of phase); if one of them loses the router, its old rows stop counting after 15 minutes of silence and withhold nothing on the others. A key pasted in the UI stays on the node that saved it (ADR-181), so after a failover MAC-only devices fall back 15 minutes later, until the key is entered on the new primary.
  • Mixed versions (CLU-010). A node on an earlier build accepts a MAC-only [[client]] (MAC keys were always valid) but recognizes it only through its kernel table. Upgraded nodes take no bindings from an older member. So in a rolling upgrade (replicas first), MAC-only devices are recognized by router data only once the node that reads the router (usually the primary) runs this version. Nothing in the shared configuration changes for older nodes while router_macs is at its default.
  • Cost.
    • Memory: about 50 KB per 1,000 table entries (twice that during a swap).
    • About 11 bytes per binding per full member that reads a router (kept whether or not a device matches by MAC).
    • A neighbor-table read every neighbor_refresh_secs on every node with neighbor_table on: new for nodes without a MAC-keyed device.
  • Display. Past queries are named by the device that holds the address now (names resolve when read, API-010).
  • A member that restarts answers vetted with an empty router view until its first poll, which replaces its cached bindings at once: a pod can fall back for about a minute per primary restart. This is the conservative direction (a block rule fails open and an allow rule closed for that long) and is accepted.
  • Amended ADRs. ADR-067's wording is amended, ADR-021's host-name deferral stays open (pointer there), and ADR-125's exchange feeds identification (pointers in those ADRs).
  • Requirements. spec/01 is not edited (decided by the owner): FLT-006's "hostname" item is not delivered by this change; identification by MAC from the routers' lists is delivered by this ADR instead (spec/10 T27.1 names it). API-010's "IP, and the MAC when known" describes the dialog's old behaviour; the dialog now offers the MAC and can store it without the IP, for the reason above.
  • Not built: host-name matching (DHCP host names, UniFi aliases, mDNS names, reverse DNS), a MAC in a rule's devices, IPv6 or OPNsense-state parsing, a per-router or per-site trust switch, MAC mutes, "seen at" addresses for a device named only by its MAC.

Verification (planned):

  • telltale-policy: flt_006_router_mac_identifies_named_device, flt_006_kernel_entry_wins_over_router_and_peer, flt_006_router_macs_counted_by_source, flt_006_no_mac_clients_never_read_the_table, flt_006_router_macs_off_ignores_router_entries.
  • telltale-config: flt_006_router_macs_default_on_and_not_written, clu_010_router_macs_left_out_of_the_shared_part_at_its_default.
  • Routers and members:
    • flt_006_routers_disagreeing_on_an_address_mark_it_unsure
    • flt_006_unifi_client_without_a_current_address_is_unsure
    • flt_006_a_router_silent_for_15_minutes_is_unsure
    • flt_006_silence_survives_a_clock_step
    • flt_006_rebuild_is_deterministic
    • flt_006_one_mac_at_two_addresses_does_not_identify
    • flt_006_unsure_mark_is_compatible_on_the_wire
    • flt_006_offline_and_unsure_leases_never_identify
    • clu_002_peer_router_macs_come_only_from_full_members
    • clu_002_a_peers_unsure_lease_counts_as_a_disagreement
    • clu_002_peers_disagreeing_on_an_address_drop_it
    • clu_002_a_silent_member_is_dropped_after_15_minutes
    • clu_010_bindings_from_an_older_member_are_not_used
    • clu_002_names_are_asked_again_soon_until_a_full_member_answers
    • fix round 2: clu_002_a_member_is_full_only_if_the_registry_lists_it_and_it_is_not_ephemeral, clu_002_a_peer_claiming_to_be_primary_gets_no_bindings_when_the_registry_lists_it_ephemeral, clu_002_a_peer_claiming_to_be_primary_gets_no_bindings_when_the_registry_does_not_list_it, clu_002_the_quick_retry_waits_for_an_answer_that_carries_routers, clu_002_the_quick_retry_goes_on_until_the_registry_lists_the_answerer, clu_002_the_quick_retry_does_not_end_on_the_primarys_empty_answer, clu_002_an_unvetted_answer_drops_the_members_bindings, flt_006_a_mac_withheld_by_one_member_still_counts_toward_sharing, flt_006_a_mac_at_a_disagreed_address_still_counts_toward_sharing, flt_006_a_router_read_less_often_than_15_minutes_does_not_identify (the 600 s cap), flt_006_no_router_macs_are_said_once_after_a_minute, flt_006_the_no_router_macs_notice_says_what_to_do
    • fix round 3: flt_006_a_dead_routers_old_rows_do_not_withhold_a_moved_device, flt_006_a_stale_routers_rows_say_so_on_the_wire, flt_006_the_no_router_macs_notice_is_silent_where_no_router_could_exist, flt_006_rows_that_reached_this_node_are_counted_from_the_bindings_data, clu_002_a_claimed_primary_is_not_full_in_the_tasks_own_check (the task's own full_check, which run and the tests both use)
  • The table:
    • flt_006_own_unsure_address_is_not_filled_by_a_peer
    • flt_006_exact_ip_device_wins_again_when_the_binding_is_unsure
    • flt_006_router_lease_mac_identifies_named_device
    • flt_006_kernel_neighbor_wins_over_router_lease
    • flt_006_router_macs_off_keeps_ip_identification
    • flt_006_peer_router_macs_identify
    • flt_005_quick_rule_follows_mac_device_across_ip_change
    • flt_006_without_mac_clients_the_table_holds_kernel_entries_only
    • flt_006_the_old_table_is_retired
  • API: flt_013_explain_says_a_router_mac_identified_the_client, flt_013_a_given_mac_is_reported_as_given, api_010_identity_says_how_an_address_is_recognized, api_010_recognition_offers_a_router_mac_before_any_device_matches_by_mac, api_010_recognition_withholds_a_shared_or_tombstoned_mac, api_010_recognition_offers_no_router_mac_when_router_macs_is_off, api_010_recognition_is_hidden_at_privacy_level_2, agt_004_explain_mac_needs_config_read, agt_004_explain_mac_from_follows_the_mac, agt_004_recognition_mac_needs_config_read; fix round 2: api_010_recognition_flags_a_kernel_mac_at_two_addresses, agt_004_explain_mac_is_hidden_at_privacy_level_2, flt_013_explain_finds_the_mac_of_a_mapped_address.
  • Cluster reads: clu_002_identity_recognition_is_the_entry_nodes, clu_002_identity_recognition_hidden_here_stays_hidden, clu_010_identity_recognition_reads_both_ways; fix round 2: clu_002_a_peers_identity_read_carries_no_recognition.
  • Playwright: api_010 name this device offers its MAC address when the router knows it, api_010 a device named by MAC is edited, not overwritten, api_010 a MAC only this node sees is offered, not chosen, api_010 a shared or private MAC is flagged; fix round 2: api_010 an address-named device keeps its keys unless the MAC is chosen, api_010 a MAC the neighbor table holds at two addresses is flagged, api_010 a MAC key is read in every spelling the server reads, flt_013 explain says where the MAC that identified the client comes from.
  • End to end: deploy/routers-e2e.sh and deploy/cluster/router-macs-e2e.sh.
  • Benchmarks: the flt_006_identify_mac benches against the base, and make bench-smoke.

Requirements AGT-004 API-010 CLU-002 CLU-004 CLU-010 FLT-005 FLT-006 OBS-005

Builds on ADR-021 ADR-023 ADR-067 ADR-080 ADR-091 ADR-115 ADR-120 ADR-125 ADR-143 ADR-161 ADR-166 ADR-181

Referenced by ADR-021 ADR-067 ADR-125 ADR-186 ADR-187

ADR-184 The proof of an unsigned delegation is scoped to its parent zoneProposedADR-098's unsigned-zone proof (T10.9) trusts a validated answer to the DS question at a zone apex.

Context

ADR-098's unsigned-zone proof (T10.9) trusts a validated answer to the DS question at a zone apex. rough-ton's pull request #74 showed that under an NSEC3 Opt-Out parent the validation library returns that DS denial as an ordinary secure response, and added the RFC 5155 §8.6 rule (the closest encloser and an Opt-Out span). Review scoped every part of the proof to the delegation's parent zone: only the parent zone's signed records say which of its names are delegations, so the records of another zone, or a delegation's own record taken as a closest encloser (RFC 6840 §4.1), say nothing about this one.

Decision

what a DS answer proves is one pure function of it (ds_denial_verdict): signed (a secure DS), an unsigned delegation, or not proven. An unsigned delegation at a name is proven only by:

  • The parent's NSEC owned by the name, in a secure NODATA, listing NS and neither SOA nor DS.
  • NSEC3 records of the parent zone only, in a secure NODATA: every NSEC3 in the authority section is owned under one zone, a proper ancestor of the name; all validated; one hash algorithm, salt and iteration count, at most 100 iterations (RFC 9276 §3.2); no NSEC beside them; and an SOA in the section, if any, is that zone's. Hashes are compared as bytes (owner labels decoded from base32hex), names as names; each name is hashed once per proof. Then:
    • if an NSEC3 of that zone matches the name's hash, it alone decides: NS, and neither SOA nor DS (ADR-098's cut check);
    • otherwise (RFC 5155 §8.6): the NSEC3 matching the name's parent (the closest encloser) is not a delegation's (neither NS without SOA nor DNAME), and an NSEC3 with the Opt-Out bit covers the name's hash (the next closer name). A closest encloser further up, through an Opt-Out empty non-terminal, isn't accepted: not proven.
  • An answer the library calls insecure, only through an insecure record owned by an unsigned top-level domain: a one-label name, the name's own top-level domain (or the name itself when it has one label). Every zone with two or more labels above the name is a candidate of the walk, decided by the rules above.
  • A negative answer the library returns as an error with its proof proves nothing.
  • Proven zones are remembered per upstream group, for the smallest TTL of the records that proved them (the library lowers a validated record's TTL to what its signature allows), at most ADR-098's 15 minutes.

What it proves, and what it doesn't:

  • It proves that the parent zone signed a denial at the name: a cut without a DS, or an Opt-Out span below a name of the parent zone that isn't itself a cut. So the name, if it exists, can only be a delegation of the parent zone without a DS. Or it shows that the name lies below an unsigned top-level domain.
  • It doesn't prove that the delegation exists: an Opt-Out span doesn't say which delegations it covers (RFC 5155 §6), so a name inside a real span can be presented as an unsigned delegation. That is inherent to Opt-Out.
  • It can't tell a record from before a change in the zone (a span from before a delegation was signed) from a current one while that record's signature is valid: inherent to DNSSEC.

Consequences

  • validate proves unsigned zones under .com, .net, .org and other NSEC3 Opt-Out parents (ADR-098's 2026-11-21 correction).
  • A parent zone whose NSEC3 records use more than 100 iterations can't prove its unsigned child zones: in validate mode their names are answered SERVFAIL (in permissive mode they are served and counted as bogus).
  • The proof makes at most three NSEC3 hashes per DS answer (the name for the cut check; the name and its parent for the Opt-Out rule), each of at most 101 SHA-1 rounds, and only after a bogus verdict, an error or a timeout: off the DNS hot path.
  • A name queried while the resolver hasn't cached its parent zone's keys yet can fail for up to a minute, and works again after that minute (issue #77's follow-ups).
  • Tested offline only: answers built by hand for each condition, and a signed test top-level domain with NSEC3 Opt-Out (no salt, no extra iterations) and signed and unsigned delegations below it, served by a fake upstream.
  • Follow-up, not part of this decision: RFC 5155 §9.2 (a DS answer proven only by an Opt-Out span shouldn't get AD; today it does).
  • Note (2026-11-27, hickory-net 0.26.4, pull request #106): the validation library now accepts the Opt-Out proof for the next closer name (RFC 5155 §8.6) itself, and judges the answers of names below parked domains (whose servers answer an SOA for every name) insecure on its own. This decision's proof is unchanged and is reached less often; it still decides the answers the library judges bogus. The offline proof tests use old.u.t., an unsigned zone's address with a signature left over and no key, which the library still judges bogus.

Verification

dns_011_opt_out_accepts_parent_apex_and_span, dns_011_opt_out_rejects_delegation_nsec3_as_encloser, dns_011_opt_out_requires_one_parent_zone, dns_011_opt_out_rejected_when_apex_has_own_nsec3, dns_011_opt_out_closest_encloser_above_parent_is_not_proof, dns_011_cut_nsec3_must_be_in_parent_zone, dns_011_insecure_denial_needs_unsigned_tld, dns_011_nsec3_iteration_cap_is_not_proof, dns_011_ds_denial_returned_as_error_is_not_proof, dns_011_proof_hashes_each_name_once, dns_011_proven_zone_is_remembered_for_its_proof_ttl, dns_011_hash_range_covers, dns_011_nsec3_hash_rfc5155_vectors, dns_011_ds_denial_by_nsec3_opt_out; offline: dns_011_offline_opt_out_unsigned_delegation_is_insecure, dns_011_offline_cname_chain_across_opt_out_unsigned_zones_is_insecure, dns_011_offline_signed_delegation_stays_validated, dns_011_offline_hickory_opt_out_ds_denial_is_secure, dns_011_offline_insecure_zone_proof_is_per_group_and_ttl_bounded.

Builds on ADR-098

Referenced by ADR-098 ADR-187 ADR-188 ADR-195 ADR-203

ADR-186 A sweep of private reverse names is its own anomaly kind, reverse_sweep, muted on its own; the NXDOMAIN storm is judged on the other namesProposedCLUDecision (proposed):

Context

  • The report. In GitHub issue #90, from Michael Roughton, an Unraid host and an LG TV reverse-resolve every address of their private /24 about once an hour. That is 254 lookups of x.20.0.10.in-addr.arpa in a minute, 247 NXDOMAIN, 94 % of the device's queries, so each sweep raises an nxdomain_storm (ADR-073: at least 30 NXDOMAINs that are at least 50 % of the minute's queries).
  • The workaround falls short. Issue #38's answer, a per-device mute (ADR-161), works, but it also hides a real storm from that device. ignore_domains can't reach the storm count or name a reverse zone.
  • What the reporter suggested. Leave private reverse names out of the count. ADR-161 already rejected that for this pattern, together with a higher threshold and [exclusions]: "a device sweeping the same network would go unseen, which is the case the storm check exists for".
  • The owner's decision (2026-11-23, said on the issue): split the signal. A sweep of private reverse names becomes its own finding kind, judged and muted on its own, and the storm is judged on the other names.
  • Two facts shape the design:
    • The telemetry crate already has an allocation-free check for RFC 6303 private reverse names (internal::is_private_reverse, the list ADR-152 and [special] private_ptr_nxdomain use).
    • The mute table's kind mask is a u8 that seven kinds already use.

Decision (proposed):

  • What is a private reverse name. It is what telltale_telemetry::internal::is_private_reverse says, made pub(crate). Its ranges are unchanged, and it now matches the zone by labels, as the resolver's copy does (a label that only ends in the bytes of in-addr or ip6 isn't under the zone):
    • IPv4: 10/8, 172.16/12, 192.168/16, 100.64/10, 169.254/16, 127/8, 0/8.
    • IPv6: fc00::/7, fe80::/10, ::1.
    • It decides by name, whatever answered it, as for ADR-152.
    • The resolver's copy in telltale-policy/src/special.rs stays where it is (the telemetry crate doesn't depend on it). A test in crates/telltale keeps the two copies' answers equal over the range edges, upper case, and labels that only end like the zone.
    • Reverse names of public ranges, IPv6 global addresses included, stay in the storm.
  • Counting. Beside the storm's per-device minute counters, the engine counts:
    • the minute's private reverse lookups (rev_total),
    • those answered NXDOMAIN (rev_nx),
    • a 256-bit map of the names answered NXDOMAIN (FNV-1a, a bit per name, popcount as a lower bound on distinct names; names that resolve set no bit),
    • up to 5 sample names.
    • Other NXDOMAIN names keep their own samples.
    • The work runs on the aggregator thread, at most once per event. There is no allocation beyond the existing 5 samples per minute, and the query path is untouched.
  • The rules, at the minute's close:
    • The minute is a sweep when rev_nx ≥ nxdomain_per_minute, rev_nx ≥ nxdomain_percent % of rev_total, and the map has at least 16 bits set (SWEEP_MIN_NAMES): at least 16 different names answered NXDOMAIN.
    • A sweep minute's private reverse lookups leave both the storm's count and its total, and the storm is judged on the rest. In any other minute everything counts toward the storm, as before. So each lookup is judged by one detector, and padding a storm with a sweep can't dilute it.
    • The carve-out depends only on the minute being a sweep. It doesn't depend on whether the sweep is reported this hour, or on mutes. A second sweep in the hour, or a muted one, never becomes a storm.
    • Each kind is reported at most once per device per hour, on separate clocks.
    • The finding:
      • kind = reverse_sweep, domain absent, window 60 s.
      • observed = NXDOMAINs, baseline = private reverse lookups, spread 0, threshold = nxdomain_per_minute.
      • The detail gives the numbers, "at least N different names", and samples.
  • No new setting. The sweep reuses nxdomain_per_minute (30) and nxdomain_percent (50).
    • Both reported sweeps (#90: 247 of 254; #38: about 225) clear them by 7-8×.
    • Every minute that raised a storm before raises a sweep, a storm, or both. The exception is a repeat sweep in an hour that already reported one, which raises nothing (the second rule above).
    • The 16-name floor sits below what a real sweep at the 30-answer bar has, and above a DNS-SD browse (4 or 5 names) or a loop on a few names. Such a loop stays a storm, as before, also beside private names that resolve (they set no bit).
  • Counted, not informational. when = "anomaly", the badge, telltale_anomalies_total{kind} and the chart's TelltaleDNSDeviceAnomaly take it as they take storms. There is no new alert kind.
  • Mutes.
    • reverse_sweep is a mute kind like the others, per device and per group. AnomalyKind and Kind get it as their last variant, so existing ones keep their order.
    • The mask becomes u16, with a compile-time check of at most 16 kinds.
    • An existing mute that lists nxdomain_storm keeps meaning exactly that (ADR-161: "an explicit list keeps a new kind visible"), so it no longer covers the sweep.
      • Instead, a counted sweep that such a mute covers for nxdomain_storm records that mute's name (stormMute). The lookup is made once, when the finding is created.
      • The Anomalies page tells an operator what changed, offers Mute for this device… with the sweep ticked, and offers Remove for the old mute while it still lists only the storm.
      • The release notes say the same.
  • Surfaces.
    • API: GET /api/v1/analytics/anomalies gets the kind and an optional stormMute (additive). The mute PUT accepts the kind.
    • MCP: find_anomalies describes sweeps, and plan_set_anomaly_mute lists the kind.
    • Metrics: gain the label. The support package shows only counts by kind.
    • UI: the title is "Sweep of local addresses", and the card says "This device looked up the names of many addresses on your network. Network scanners do this, and so do some TVs and NAS boxes, on their own, often once an hour."
    • No new route, scope, listener, file or network call.
  • Privacy: unchanged. The engine is off at query-log privacy level 1 and above. Findings are readable where storms are, analytics:read for agents and not by display sessions. The sample names are the ones a storm already shows.

Alternatives rejected

  • Leaving private reverse names out of the storm (the reporter's suggestion), nxdomain_ignore_suffixes, ignore_domains applied to the storm, or [exclusions]. Each hides local reconnaissance from every device.
  • A higher threshold. It weakens the check for every device and is per node.
  • Always taking private reverse names out of the storm. A loop on one private name would then raise nothing.
  • Classifying by how the name was answered (Special::PrivatePtr). That would tie detection to [special] and routes.
  • An informational kind like chatty_loop. It would drop sweeps from every user's alerts by default.
  • Letting an nxdomain_storm mute also cover reverse_sweep.
    • The entry would say one thing and do another, and an agent reading it couldn't tell.
    • "Storms only" couldn't be said.
    • The reporter's problem would stay unchanged, with nothing to prompt the switch.
  • Rewriting mutes on upgrade.
    • Files and Git can't be rewritten.
    • Writing the new kind into the shared configuration while older nodes run would make them refuse it.
    • It would be a silent change.
  • A separate threshold key now. No reported case needs it.
  • Down-converting for older replicas, or a version gate on the write. ADR-059 defers per-field gating. The documented upgrade order already makes an older primary refuse the kind.

Consequences

  • For users who muted nxdomain_storm to quiet a sweep (#38, #90): after the upgrade their sweeps count again, and the mute covers only real storms. They need to switch the mute's kind. The page and the notes say how.
  • Mixed versions:
    • An older node lists a newer node's finding under the raw kind (the API carries kinds as strings), and an older primary alerts on it.
    • During a rollout one sweep can show twice, as nxdomain_storm from an older node and reverse_sweep from a newer one (the kind is part of the finding ID).
    • A shared mute naming reverse_sweep:
      • It makes an older replica refuse each new version (CLU-010). The replica keeps serving the last version it took, so DNS is unaffected (CLU-004). Until it is upgraded it logs cluster configuration not applied (will retry) with unknown variant reverse_sweep every 2 s, and its sync_errors check and telltale_cluster_sync_error show the same. It doesn't say "upgrade this node": that message is only for a newer SCHEMA or an unknown section, and this is a new value inside a known one.
      • An older build won't start with it in its own file.
      • So name it only once every node runs this version (as with [clients] router_macs, ADR-183).
      • Nothing writes the value unless a mute names it. SCHEMA and PROTOCOL are unchanged.
  • Rollback:
    • anomaly.json gains optional fields only. An older version reads it until a reverse_sweep finding is recorded; after that it can't parse the state, and devices learn again (ADR-043's rule for unreadable state).
    • A mute naming the kind made through the API is skipped by an older version with a warning. One in a file must be removed first.
  • Memory: about 64 bytes more per device, inside the 4 KiB budget, and about 64 KiB at 1,024 devices.
  • Detail: ADR-073's storm rule now reads "of the device's queries other than a sweep's". The golden fixture is unchanged (it has no NXDOMAINs).
  • Not covered:
    • sweeps slower than 30 NXDOMAINs a minute;
    • sweeps of dense networks, where most addresses have PTR records and so get few NXDOMAINs;
    • sweeps of public ranges, IPv6 global addresses included;
    • a sweep cut evenly across a minute boundary.
    • These go unseen as before. A distinct-names-per-hour rule or a user-listed range is a follow-up if asked.

Verification

  • Engine (telltale-telemetry): obs_009_a_sweep_of_254_private_reverse_names_is_a_reverse_sweep_not_a_storm, obs_009_a_storm_of_other_names_is_still_a_storm, obs_009_a_storm_padded_with_a_private_reverse_sweep_is_still_a_storm, obs_009_a_loop_on_one_private_reverse_name_stays_a_storm, obs_009_a_loop_on_one_private_name_beside_resolved_neighbours_stays_a_storm, obs_009_a_sweep_of_a_public_range_stays_a_storm, obs_009_a_partial_sweep_is_a_sweep_only_over_the_bar, obs_009_private_ipv6_reverse_names_make_a_sweep, obs_009_a_second_sweep_in_the_hour_is_neither_reported_nor_a_storm, obs_009_a_sweep_and_a_storm_in_one_hour_are_each_reported, obs_009_sweep_replay_is_deterministic, obs_013_state_saved_before_the_split_still_loads, obs_013_a_sweep_of_a_whole_16_keeps_the_state_bounded, obs_038_muting_reverse_sweep_keeps_nxdomain_storm_live, obs_038_an_nxdomain_storm_mute_leaves_a_sweep_counted_and_names_itself_on_it, obs_038_every_kind_is_muted_by_itself_alone; obs_009_counting_a_sweep_allocates_nothing_per_query and obs_009_a_repeated_sample_name_allocates_nothing (tests/alloc.rs), with obs_009_a_kept_sample_is_recognised_for_any_name; the golden file is unchanged.
  • Config and cluster: obs_038_a_mute_may_name_reverse_sweep, clu_010_the_shared_part_names_reverse_sweep_only_when_a_mute_does.
  • Cross-crate: obs_009_the_sweep_and_the_resolver_agree_on_private_reverse_names (the two private-reverse checks agree on every range edge), obs_038_config_and_engine_kinds_agree, agt_005_the_mute_tool_offers_every_finding_kind, obs_014_merged_findings_keep_the_storm_mute, obs_013_the_anomaly_rule_alerts_on_a_reverse_sweep.
  • Playwright: obs_038 a sweep is muted on its own and a storm-only mute is pointed out.
  • Unchanged: the hot-path allocation tests, and make bench-smoke against a same-binary control.
  • Sample names: obs_009_sweep_sample_names_cut_at_char_boundary (the sweep's and the storm's samples are cut at a character boundary), and obs_009_observe_query_takes_any_wire_bytes, which covers both kinds of samples.

Requirements CLU-004 CLU-010

Builds on ADR-043 ADR-059 ADR-073 ADR-152 ADR-161 ADR-183

Referenced by ADR-073 ADR-161 ADR-199

ADR-187 resolver.arpa is answered here: NOERROR with no records, never forwarded unless a route for it, or a name below it, covers itProposedDNSGitHub issue #77 (airart320): with forwarders, _dns.resolver.arpa (the name a client asks to discover an encrypted resolver, RFC 9462) was forwarded, and the upstream answered it from its own data (two unsigned SVCB records for its own endpoints, in the reporter's capture).

Context

GitHub issue #77 (airart320): with forwarders, _dns.resolver.arpa (the name a client asks to discover an encrypted resolver, RFC 9462) was forwarded, and the upstream answered it from its own data (two unsigned SVCB records for its own endpoints, in the reporter's capture). The signed arpa. zone denies resolver.arpa, so that answer can never validate: in validate mode it was SERVFAIL, in permissive mode it was served and counted as bogus. The unsigned-zone proof (ADR-098, ADR-184) rightly doesn't rescue it: the forwarder's own resolver.arpa data is not a secure denial by the parent. RFC 9462 §6.4 says a resolver MUST treat resolver.arpa as a locally served zone (RFC 6303); §4 says a resolver with no designated resolvers SHOULD answer NODATA; §6.1 says a forwarder SHOULD NOT forward it, and MAY when its operator expects that. spec/03 §3 step 4 plans DDR answers "when configured" (P1, deferred in spec/10); what to answer when it isn't configured is a gap, recorded here. The behaviour has been a known issue in every release's notes since v0.2.0.

Decision

  • resolver.arpa and every name below it (_dns.resolver.arpa, and the apex itself) are a locally served zone, a special name beside the private reverse names (ADR-014): NOERROR with no records, no AD, never cached, validated or forwarded. It is decided where the private reverse names are, at the end of the pipeline's own steps: local records and authoritative zones answer first; quick rules, lists, schedules, the group's rewrites and safe search still apply. A rewrite whose target is in it (a group's rewrite, a list's $dnsrewrite CNAME) is answered as its target is: here unless a route for resolver.arpa covers it (the CNAME and no records; HTTPS and SVCB queries get no data, as for any rewrite).
  • For a name in it asked directly, the explanation and the change simulation make the pipeline's decision: answered here, or forwarded by a route for it. A rewrite into it they report as a rewrite, as they do for any rewrite target and for private reverse names. Explain says the target "is resolved like any name" (outcome resolved), and the simulation counts the query as a rewrite (answered).
  • It is forwarded only by a [[route]] whose match_suffix is resolver.arpa or a name below it and covers the name asked (RFC 9462 §6.1: a resolver the owner chose for this zone): the suffix that chose the route must have at least resolver.arpa's two labels (compared in lower case, with or without the final dot). Every other route leaves the name answered here while it sends its devices' other names to its upstream group:
    • a route for arpa (every reverse lookup, usually to the LAN's own resolver). It covers resolver.arpa only from above, and forwarding the name with the reverse lookups would relay that resolver's or its upstream's own discovery record to the devices again: issue #77;
    • a route for .;
    • a route without a suffix, which matches every name: a [[group]] upstreams (ADR-096), a match_group or a match_qtype route.
  • A route for resolver.arpa with match_group forwards it for that group's devices only. Being the longer match, it wins over the group's own upstreams and over a route for arpa. The router reports the label count of the suffix that chose the route (Selection::suffix_labels, 0 without one). The pipeline, the explanation and the simulation all decide with one function (pipeline::resolver_arpa_answered_here).
  • The private reverse names keep their own rule (any matching route forwards them): changing it changes answers for existing configurations, so it is left for its own decision. (Decided by ADR-199, Proposed: any explicit [[route]] forwards them, a group's own upstreams doesn't.)
  • [special] resolver_arpa (default true) turns it off, as every special-name rule can be (ADR-014). It is shared by the cluster and, like [clients] router_macs (ADR-183), not written while it is on: a node one version behind refuses a [special] key it doesn't know, so at the default the primary sends exactly the keys such a node knows. It should be set to false only once every node runs a version that knows it (0.9.0 or later); an older build also refuses it in its own file.
  • The classification is one more suffix comparison in telltale_policy::classify, which runs on every query: no allocation, lock or I/O. The suffix's label count is the one the router already computes to pick the longest match: one more usize in the selection.
  • No new requirement ID: DNS-019 already covers the special names in the code and its tests.

Not done

  • Our own SVCB answer (the DDR feature, P1). It needs its own design: which listeners to advertise, certificates whose names cover the address the client used (RFC 9462 §4.2), each cluster node advertising itself, and what to answer without encrypted listeners.
  • Built-in negative trust anchors for resolver.arpa (or any zone): one switches validation off for a subtree, and for this one would relay the upstream's discovery record. [dnssec] negative_trust_anchors remains for those who want one.
  • Serving an answer the unsigned-zone proof can't finish as insecure.

Consequences

  • A client asking _dns.resolver.arpa learns that this resolver designates none and goes on asking it as before. In validate mode it gets NOERROR instead of SERVFAIL; in permissive mode the name is no longer counted as bogus. The upstream's own discovery record (its encrypted endpoints) is no longer passed to clients, and the query no longer leaves the network. This holds for devices in a group with its own upstreams too.
  • An owner who routes arpa (every reverse lookup to the LAN's resolver, say) keeps _dns.resolver.arpa answered here. To forward it as well, they add a route for resolver.arpa; docs/running.md says so.
  • The answer carries no SOA, like the other built-in NOERROR answers, so a client doesn't cache it as a negative answer; each ask is answered here again, with no upstream query.
  • Mixed versions: a node on an earlier version keeps forwarding the name until it is upgraded; a replica sees the shared switch only when it is set to false.

Verification

dns_019_resolver_arpa_is_locally_served (the apex, _dns, a deeper name, upper case on the wire, look-alike names, the switch off); dns_019_resolver_arpa_answered_locally_in_pipeline (SVCB and A for _dns.resolver.arpa and A for the apex from a validating client: NOERROR, no records, no AD, the upstream not asked; a local record answers first; a rewrite into it; forwarded with a [[route]]; forwarded with the switch off); dns_019_resolver_arpa_forwarded_only_by_a_route_for_it_or_below (a group's own upstreams, match_group, match_qtype, . and arpa routes leave it answered here while they move the device's other names; routes for Resolver.ARPA. and _dns.resolver.arpa forward it; a route for resolver.arpa with a group forwards it for that group only; a route for resolver.arpa wins over the group's own upstreams and over a route for arpa); dns_019_selection_counts_the_labels_of_the_matched_suffix (the router); dns_019_explain_says_resolver_arpa_is_answered_here, dns_019_explain_forwards_resolver_arpa_only_by_a_route_for_it_or_below and flt_013_explain_agrees_with_the_pipeline over the same kinds of route (explain); dns_019_turning_resolver_arpa_off_is_a_changed_answer and dns_019_simulation_forwards_resolver_arpa_only_by_a_route_for_it_or_below (the simulation); dns_019_resolver_arpa_default_on_and_not_written and clu_010_resolver_arpa_left_out_of_the_shared_part_at_its_default (the switch and the shared part); make bench-smoke against the base.

Requirements DNS-019

Builds on ADR-014 ADR-096 ADR-098 ADR-183 ADR-184 ADR-199

Referenced by ADR-014 ADR-192 ADR-194 ADR-199 ADR-201

ADR-188 Denials behind a CNAME are validated link by link, and a wildcard answer in a zone signed with NSEC is served only with the RFC 4035 §5.3.4 proofProposedNFRrough-ton's issue #98 and pull request #99.

Context

rough-ton's issue #98 and pull request #99. The validation library (hickory-net 0.26.3) proves an answer's NSEC or NSEC3 denial for the name that was asked, but after a CNAME the denial is about the chain's last name (RFC 4035 §3.1.3, §5.4), so a signed CNAME followed by a signed NODATA or NXDOMAIN is refused as bogus (www.paypal.com AAAA, www.icann.org TXT). In a zone signed with NSEC the library also asks for an NSEC covering the wildcard itself, which can't exist when that wildcard gave the answer, so a wildcard's answer one label below the wildcard is refused too (nasa-gov.go-vip.net A, and www.nasa.gov A through it). And a signed CNAME into an unsigned zone whose answers the library misjudges (c.pki.goog A) stays bogus as a whole, though ADR-098 and ADR-184 can prove the target's zone unsigned. The pull request added the two rules below. Review kept them and added what happens when a link gets no answer, a limit of their own, two restrictions, tests and this record.

Decision

two rules, on cache misses, in validate and permissive mode alike (the validator doesn't know the mode). Every wildcard answer in a zone signed with NSEC is checked against RFC 4035 §5.3.4 before it is served: the wildcard rule decides its NSEC verdict, and its signatures are checked by the library as for any answer. Link-by-link validation applies to an answer the library refused or returned with a bogus verdict, one the wildcard rule marked bogus included.

  • Link by link. It runs for a question of class IN whose type follows a CNAME (any type but ANY, CNAME, DS, NSEC and RRSIG; a CNAME's owner has an NSEC and signatures of its own, RFC 4035 §2.3, §2.5), when the answer has a CNAME owned by the question name and either the library refused its denial (DnsError::Nsec) and ADR-098's proof didn't show the question's zone unsigned, or the answer has a bogus verdict (the library's, or the wildcard rule's) that ADR-098's proof didn't correct. Each link is then asked again as a question of its own through the validating handle: the CNAME at the name (the target is taken from a CNAME owned by that name), then the question at the target; a target whose answer starts with a CNAME, or whose denial the library refuses behind one, is the next link, and that answer is not used. Each answer is validated by the library for its own name, so a link is never worth more than the same name asked directly.
    • A link is secure or insecure as the library says, or insecure when the library calls it bogus and ADR-184's proof shows every owner in that link's answer, and the link's name, in a zone proven unsigned. Anything else (bogus, indeterminate, an error, a CNAME owned by another name, a loop, more than 8 links) and the answer stays bogus. The verdict is the weakest link's; AD only when it is secure.
    • The answer served is made of those answers only: each link's CNAME with its signatures; of the last answer, only the records owned by the name it answers, with their signatures; its authority section and the links' NSEC and NSEC3 records. Nothing of the refused answer is used. It is cached under the question like any validated answer, and never learned as an RFC 8198 range (it has an answer section).
  • Wildcard answers in zones signed with NSEC. Every positive answer made from a wildcard (a secure signature covering fewer labels than its owner has) is checked by this rule, over the records the library validated (a refusal of its NSEC proof, DnsError::Nsec, carries them too). The rule is left out only for zones signed with NSEC3: when, for every zone that signed such a signature, the authority section has a verified NSEC3 record of that zone, owned directly below it; the rest is left to the library (RFC 5155 §8.8). The answer meets the rule when: the response code is NOERROR and the name isn't a wildcard; the answer section is the question's record set at the question name and its signatures, and nothing else, the records verified and at least one signature verified (a signature that isn't verified, such as a second key's or algorithm's during a rollover, is left out, RFC 6840 §5.4); every verified signature has the same label count, fewer than the name has, and the same signer, a zone the name is in with no more labels than that count; the authority section has no NSEC3; and it has a secure NSEC, with a secure signature by that zone, that covers the next closer name (the name cut to one label more than the count): the next closer name lies after the NSEC's owner and before its next name (or after the zone's last owner), its next name isn't below the next closer name (an empty non-terminal), and the owner isn't a delegation (NS without SOA) or a DNAME above it (RFC 6840 §4.1). An answer that the library didn't refuse, to a question for another type than CNAME, that starts with a CNAME at the question name made from a wildcard, also meets the rule when no record of another name in it is made from a wildcard and the CNAME's record set at the name meets those conditions as for a question for CNAME; the rest of the chain are records of names that exist, each validated by its own signature, and the chain ends in a record of the question's type. An answer that doesn't meet the rule has its records marked bogus and is handled as any bogus answer: ADR-098's proof (its lookups and a proof slot) may still show its zone unsigned; it is validated link by link when it starts with a CNAME owned by the question name, each link then checked by this rule for its own question; otherwise it is SERVFAIL with EDE 6 in validate. The check itself reads only the records already in the answer: no lookup.
  • Limits (NFR-004): at most 8 links; the validation's deadline (ADR-098: two query budgets for the lookup and every proof); at most 4 link-by-link validations at once, on slots of their own, apart from ADR-098's 8 proof slots (the proof a link needs takes one of those); a question whose links didn't hold, or couldn't be checked in time, isn't validated link by link again for a minute; one that ended only because no slot was free is tried again with the next question.
  • No answer in time. A link's question that times out, or that the upstream fails on, proves nothing: the answer stays bogus (SERVFAIL with EDE 6 in validate, never a stale answer; served in permissive). It is not an upstream failure.

What it doesn't change: cache hits (validation runs on misses only); the library's signature checks; the library's verdict on every other answer (one not made from a wildcard in a zone signed with NSEC, or one in a zone signed with NSEC3, left to the library as above), unless it is refused or bogus and link-by-link validation applies; ADR-184's proof and ADR-098's rules, used unchanged for each link; the minute after a cold start in which a name can fail (ADR-098, ADR-184): a question whose links failed is tried again after a minute, like a name whose proof failed; clients that set CD.

Consequences

  • These answers validate: with AD where every link is secure, without it where one is in a zone proven unsigned; in permissive mode they're no longer logged as bogus. A wildcard's answer in a zone signed with NSEC whose NSEC doesn't show that the next closer name is absent is bogus (SERVFAIL with EDE 6 in validate).
  • A record set with a second signature that isn't verified (an algorithm or key rollover, several signers) is indeterminate (served without AD), as any answer with such a signature is: the wildcard rule leaves that signature out, so a wildcard answer with one and with its proof is indeterminate, not bogus; link by link, a link with one is indeterminate, so the answer stays bogus. Answers that stay bogus: a chain through a DNAME (only CNAMEs are followed); a link that reaches the library's depth limit, which ends bogus here and not indeterminate as it does for the question itself.
  • A wildcard CNAME at the question name is checked as its own record set when the library didn't refuse the answer and the CNAME is the answer's only record made from a wildcard: secure in one lookup (not for a NODATA behind it). Otherwise (after a refusal, with another record made from a wildcard in the chain, or when the chain doesn't end in a record of the question's type) it is validated link by link, each link for its own question: that costs the walk's lookups, ends bogus while its 4 slots are busy, and isn't tried again for a minute after a link failed. An answer to a question for ANY or RRSIG made from a wildcard in a zone signed with NSEC doesn't meet the rule (it isn't the question's one record set) and is bogus.
  • Cost: nothing on cache hits; the wildcard check reads only the answer it checks, and an answer it marks bogus costs what any bogus answer does (ADR-098's proof with its lookups and a proof slot; link by link, up to two validating lookups per link, 16 at most, and the unsigned-zone proof for a link that needs one), all within the deadline.
  • If the library proves the denial for the chain's last name, link-by-link validation applies less often (it runs only after a refusal or a bogus verdict); the wildcard rule keeps checking every wildcard answer in a zone signed with NSEC.
  • Tested offline only: answers built by hand for each condition of the wildcard rule and of when it applies, and the signed test root's s.t. (signed with NSEC: CNAME chains, wildcards one and two labels up, a wildcard CNAME to another wildcard, a name below an existing one, an empty non-terminal, a second signature by another key), z3.s.t. (below it, signed with NSEC3, with a wildcard), t. (NSEC3) and the unsigned u., u.t. and v.t., served by a fake upstream.

Verification

dns_011_wildcard_answer_needs_its_proof, dns_011_nsec_covers_the_next_closer_name, dns_011_wildcard_rule_is_left_to_nsec3_only_beside_the_signers_verified_nsec3, dns_011_wildcard_cname_is_checked_as_its_own_record_set, dns_011_proofs_are_limited_and_failures_remembered; offline: dns_011_offline_denials_behind_a_cname_are_validated, dns_011_offline_links_that_do_not_hold_stay_bogus, dns_011_offline_signed_cname_into_misjudged_unsigned_zone_is_insecure, dns_011_offline_wildcard_replayed_at_an_empty_non_terminal_stays_bogus, dns_011_offline_wildcard_nodata_is_validated, dns_011_offline_wildcard_answers_with_their_proof_are_secure, dns_011_offline_wildcard_answers_with_their_proof_need_no_link_by_link_validation, dns_011_offline_wildcard_answer_needs_its_next_closer_name_to_be_absent, dns_011_offline_wildcard_rule_stays_on_beside_an_unverified_or_other_zone_nsec3, dns_011_offline_wildcard_answers_in_an_nsec3_zone_are_secure, dns_011_offline_wildcard_answer_with_a_second_signature_is_indeterminate, dns_011_offline_wildcard_cname_to_another_wildcard_record_needs_each_proof, dns_011_offline_wildcard_cname_chain_that_stops_short_is_validated_link_by_link, dns_011_offline_link_lookup_timeout_stays_bogus, dns_011_link_validation_leaves_slots_for_its_proofs, dns_011_offline_composed_answer_keeps_only_the_chain, dns_011_offline_nsec_question_does_not_follow_a_cname.

Requirements NFR-004

Builds on ADR-098 ADR-184

Referenced by ADR-195 ADR-201

ADR-189 Languages in the web UI: English in the bundle, every other language a data file fetched on demand, checked by structure and owned by a named personProposedNFRsnnh's pull request #101 added Simplified Chinese to every page of the web UI with a small translation layer of its own and no new dependency, and showed that the UI can be translated without a library.

Context

snnh's pull request #101 added Simplified Chinese to every page of the web UI with a small translation layer of its own and no new dependency, and showed that the UI can be translated without a library. The project wants languages and regions as a pattern it adopts once and hands to contributors. The constraints are the owner's priorities (performance, then footprint), the 15 MiB image (NFR-001), the strict content security policy (ADR-030), the 400 KiB budget of spec/07 §3, English text and formats that must not change for today's readers, and maintainers who can review a translation's structure but not its content. Two ways of writing a message were measured on the contributor's tree before any code was written (a key per message, or the English text as the key); with the English text as the key the core grew by 14.9 KiB gzipped and mount time and memory stayed within 10% of main, and keys did not fit the size gate, so this decision takes English as the key.

Decision

  • A translation layer of our own, no dependency. t() for a message, tn() for a count, and a <T> component for a sentence with markup inside it. Placeholders are {name}, substituted in one pass from the parameters' own properties; a missing value renders as empty. <T> splits a message on named tags and renders each piece as text or through a snippet the caller supplies: translated text never becomes markup, and {@html} stays forbidden. Its message is written as an expression (msg={'Muted by <b>{who}</b>'}), because Svelte substitutes {…} inside a quoted attribute itself.
  • English is the key. const { t, tn, m } = tr('cache') binds a file's context; t('Holds') keeps the English in the source, and there is no English catalog. With English active t() returns its literal after substitution, so English output equals the source by construction. A translation is found through a hash (FNV-1a, 32 bits) of the context, the normalized English and an optional note. A translation file holds [english, translation] pairs; a generation step that runs before the type check, the tests, the dev server and the build ships only the translations whose English is still in the source (compared as text, never by hash), without the English, and writes the table of their addresses; neither is committed. A translation of older English no longer matches and is never shown.
  • Catalogs are data. One pair file per locale in ui/src/locales/, in one canonical form (sorted by code unit). Every catalog other than English is a hashed JSON file under /assets/locales/, fetched when that language is chosen, from a table of literal addresses made at build time. It is never run as script, and the content security policy is unchanged. A catalog that is empty or cannot be read, or a load that fails, leaves the page in English. A pair file's sections are context names (or the left-over section): anything else fails, and the check prints what a file holds only as data (quoted, with line breaks and other controls escaped).
  • Locales are BCP 47 tags of the form language, optional script, optional region. A language written in more than one script names the script (zh-Hans, zh-Hant). A manifest lists each locale's owners, direction and whether it is offered. A request (the lang parameter, the stored choice, then the browser's languages in order) is matched to a catalog of the same language and script; a bare language in the browser's list takes the script of a more specific entry before it, and a catalog whose tag names no script is taken only for a request of its likely script (a yue catalog is not taken for yue-CN). A reader of Traditional Chinese is not given Simplified text. There is no catalog of English: every en-* tag is refused, since an English request is answered in English and en-XA is computed from it.
  • Regional catalogs follow one model: a catalog falls back to its parent and then to English, and holds only what differs. The manifest reserves the fields; the merge is built when a second regional catalog exists, and does not change the catalog format. Until then a regional language is a full catalog.
  • The catalog is loaded before the page is drawn, and changing the language is a deliberate step that reloads the page. t() is a plain function with no reactive state.
  • Text belongs to one source file. The context of a message names the file that shows it; a file uses only its own and a small common set. Translated text is display text only: it is never an identifier, a stored value or part of a request.
  • English output does not change. With English, dates, times and numbers keep the browser's own format, as before; the compact forms the UI writes itself (5m ago, 1.5 KiB) become messages whose English equals today's output. The plural form of a message is chosen by the language of the message, never by the browser's language. With another catalog, formatting follows the browser's variant of that language, through Intl.
  • Plural categories for the check come from a committed table (ui/src/locales/plurals.json, written once from CLDR by a maintainer command and reviewed), never from the JavaScript engine, whose CLDR data moves with Node and differs between browsers. The browser picks a form with Intl.PluralRules and falls back to the catalog's own other.
  • English never waits for a translation. npm run check:i18n fails only on what the author of the changed file controls. Missing, outdated and left-over translations are reported, never failed. A change to English alone cannot fail another language. Literal text, an Intl call or a physical CSS property in a source file fails whether or not the ratchet baseline lists the file (part A's last commit made it so for a file the baseline does not list): a new file holds none of the three, and a moved file that still holds some keeps its counts only when its baseline entries are renamed to the new path by hand: the baseline command lowers counts and lists a new file only at zero, and never raises a count.
  • A translation must agree with its English. It has the same placeholders, tags and web addresses (in any case; a scheme:// counts in any width, so a fullwidth one is not hidden from the rule). It keeps every structural token of the English (anything with ://, a path, [x], =, _, $, |, a host and port or an IP address; glossary terms such as NXDOMAIN), every number, and every word the English entry lists as to be kept verbatim (literal values a reader types, such as email or ntfy; the list is kept beside the English, so nothing changes on the page). It adds no address, host and port, path or setting (://, /x/, =, $, |) that the English does not have, also when written with fullwidth or ideographic punctuation (a second reading with the punctuation folded to ASCII, where only a dotted host and port counts and the English's own addresses are left out where each stands whole, never its words). A bare https:// followed by a letter of another script is an address in that script. A plural form other than other may leave out placeholders (a dual, or a "one" that names no number); both English forms of a plural name the same placeholders. It contains no direction overrides, format characters, default-ignorable code points (invisible fillers, every variation selector), tag characters, surrogates that are not half of a pair (added with ADR-190) or words that mix scripts. Hyphenated words, short acronyms, the other tokens a translation adds and a . between two letters of another script are reported, not failed. A maintainer may exempt a message in notes.json from the digit rule (exemptDigits, with a reason), or allow it named tokens under the added-token rule (exemptAdded, a list such as ["24:00"], for a time, ratio, date pattern or price); the allowed tokens are then reported, and any other added token still fails. The check fails a translation that does not agree, and the browser never shows one: English is shown instead. The browser re-checks every rule that needs no data file; for a catalog the build shipped it leaves out the digit and added-token rules, which the check already applied with the maintainers' exemptions, and it applies them to anything else (a catalog given by another source, never counted as built) as that source's code brings them, showing none of such a catalog without them (amended with ADR-190, so that an English reader's first load does not carry those two rules). What the rule cannot read (an address in the language's own script without a scheme, digits of another script, an address with spaces) is for the language's owner, who reads the text.
  • Context names are unique. Two source files never share one context; where two files have the same name, a committed map gives the library file a prefixed name.
  • format.ts keeps its exports. The formatters are built by a factory for one locale and installed before the page is drawn; the functions the UI already imports delegate to it.
  • A language is offered by a flag in the manifest, set by a maintainer at release time. A language under 80% of the text that existed at the previous release, at two releases in a row, is no longer offered until it catches up; it stays reachable with ?lang=. Each language has named owners in the manifest, who answer for its content; maintainers review structure. Strings marked sensitive (destructive confirmations, security warnings) need a back-translation in the pull request that changes them.
  • The choice is kept per browser (telltale.locale), like the theme, the detail level and the domain icons (ADR-167): no server state, no API, nothing in the cluster. ?lang= applies to one page load and is not stored. The setting is under Settings, Account, and on the sign-in page, and is shown only when another language is offered.
  • Budgets. The 400 KiB budget of spec/07 §3 becomes the budget of the UI with English. Each further language may take 80 KiB gzipped, and all of them together 400 KiB. npm run build prints and enforces the three figures and fails if text of another language is found outside /assets/locales/.
  • What is not translated: API problem messages, alert text, the CLI, logs, the audit log, the OpenAPI document and MCP tool descriptions, and sentences the server composes. For an error with a stable code the UI may show a translated title, and always shows the server's English detail under it. The in-app help and the documentation stay English for now and are marked as English text on a translated page.
  • A pseudo-locale (en-XA, longer accented text) is computed from English in the browser, reachable only with ?lang=en-XA, and used by the tests to find text that bypassed the layer and translated text that reached a request or storage.

Not done (considered):

  • A key per message with an English catalog: measured at about 39 KiB over main, about 24 KiB more than English as the key, over the size gate; it would give strings stable names.
  • A translation library (a store-based runtime with ICU MessageFormat; a compiler that turns messages into functions): a dependency or a build plugin for what a few hundred lines do here.
  • One UI build per language: several copies of the UI in one image, or a language fixed at install time.
  • A language setting stored with the account: a state-store change, replication and a new API operation for a display preference. It can be added later behind the one function that reads the preference.
  • Right-to-left layout (logical CSS properties, mirrored icons, isolated names and addresses, a right-to-left pseudo-locale): its own task, required before a right-to-left language is offered. Until then a check refuses new physical CSS properties.
  • Translated in-app help: a second on-demand file per language with its own budget, as a later task (it needs the image build to copy the translated topics).
  • The merge of regional catalogs (above).

Consequences

  • The layer itself (runtime, matching, the browser's agreement check, the pseudo-locale, the format factory) adds at most 4 KiB gzipped to the core; moving the English text behind t() adds about 15 KiB more (14.9 KiB measured on the contributor's tree). At the end of part A, with every page on the layer, the core measures 317.0 KiB gzipped (324,567 B), against 292.9 KiB (299,915 B) for the same tree before the layer: 24.1 KiB more in all, under the 320 KiB gate. A reader of English downloads no other language.
  • Each offered language adds about its gzipped size to the image (the binary embeds the compressed file, ADR-168): about 41 KiB for the first one, at most 0.39 MiB for all languages under the envelope.
  • A developer adds text by writing t() in the file that shows it: one file changes. Text typed straight into the markup, or into a text prop of a component (a label, a title, an empty state, a noun, a summary, a hint, a placeholder), fails the check in a file the ratchet baseline holds at zero and in a file it does not list (a new one).
  • A translation pull request touches only that language's file and, for a new language, its manifest entry (the check fails either one alone). A reviewer who cannot read it checks that, the green check, the report's sensitive and swap lines and the language owner's approval.
  • An English edit that changes the text in anything but its spacing and the form of its quotes, dashes and ellipsis (a full stop added or a capital letter changed counts) drops that string's translations until they are confirmed again (carry keeps them when the meaning is unchanged); English is shown meanwhile.
  • Strings have no stable names: tests and docs refer to the text.
  • spec/07 §3 states the three budgets; ui/README.md has the contributor guide; docs/running.md describes the setting once a language is offered.

Verification

api_012 interpolation is single pass and own-property only, api_012 a nullish parameter renders as empty, api_012 message markup becomes text and named snippets only, api_012 locale matching follows the request order and scripts, api_012 english plurals come from the catalog language, api_012 english plurals ignore the browser language (A1), api_012 a missing plural category falls back within the catalog, api_012 plural forms other than other may leave out placeholders, api_012 a plural form other than other may hold fewer placeholders, api_012 the runtime and the script hash alike, api_012 english formats match the frozen functions, api_012 catalogs are canonical, api_012 a translation keeps the placeholders tags urls and tokens of english, api_012 a translation adds no address port path or setting, api_012 a maintainer may exempt an entry from the added-token rule, api_012 an added-token exemption in notes.json reports what it lets through, api_012 the agreement rule takes linear time on any text, api_012 url and token extraction, api_012 forbidden code points, api_012 findings name the rule the token and its place, api_012 catalog entries named like object members are data, api_012 an english-only change never fails a locale, api_012 missing and outdated translations are reported not failed, api_012 sensitive changes and swaps are reported against the previous version, api_012 the check sees each mistake it is for, api_012 the tk() lint reads a name where it is declared, api_012 the shipping step reports structured findings, api_012 the job summary prints no catalog value outside a fence, api_012 the console report prints no line a file controls, api_012 prebuild writes the shipped catalogs and the url table, api_012 the pair-file parser refuses what json would lose, api_012 check and sync take plural categories from the committed table, api_012 the languages tool says which node it needs, api_012 npm runs the generation step inside its scripts, api_012 the runtime drops a translation that differs from current english, api_012 the browser re-checks digits and added tokens only where the build did not ship the catalog, api_012 the catalog step falls back to english, api_012 a file uses only its own context, api_012 migrated files hold no literal text, api_012 a new removed or renamed file leaves the ratchets green, api_012 the baseline command lowers counts and never raises one, api_012 the attributes a reader sees or hears are text, api_012 the codemod moves text and attributes behind t(), api_012 the codemod lists what it cannot move safely, api_012 the codemod output renders the same english, api_012 the codemod output passes the languages check, api_012 only format.ts formats, api_012 no new physical css properties, api_012 an english session requests only core assets, api_012 lang parameter applies to one page load and stores nothing, api_012 pseudo locale leaves no literal text: <page> (A1), api_012 pseudo text never reaches a request or storage (A1), api_012 a chosen language loads its catalog and sets lang (B), api_012 auto follows the browser list in order (B), api_012 a language is hidden by its manifest flag (B), api_012 a failed catalog request falls back to english (B); the size lines of npm run build. A test marked (A1) or (B) is written by that part.

Requirements NFR-001

Builds on ADR-030 ADR-167 ADR-168 ADR-190

Referenced by ADR-190

ADR-190 Testing a language pack in the browser: a local file checked by the build's own rules, under an English banner above every page, removed at the next load after any upgrade, after 7 days, or on request; the template comes from the buildProposedAGTAPICLUNFRADR-189 makes English the only language in the bundle, written in the source, and every other language a file of [english, translation] pairs per context.

Context

ADR-189 makes English the only language in the bundle, written in the source, and every other language a file of [english, translation] pairs per context. A translation is checked by structure, in the build and in the browser, and owned by a named person. A translator then needs to see their file on a running TelltaleDNS before opening a pull request, without a development checkout or Node tooling: on every page, at real widths, with the rules the build will apply. English exists only in the source, so the browser alone can't list the texts to translate.

The constraints are those of ADR-189: performance, then footprint; the 15 MiB image (NFR-001); the strict content security policy (ADR-030); an English reader who downloads nothing new. Add the deployments TelltaleDNS runs on: replicated and stateless pods, read-only root file systems, and clusters with one management plane, where nothing outside DNS may affect answering (CLU-004).

A label can be made to lie without breaking any structural rule. So whoever loads a file must see at all times that the labels come from it, and the next person at the same browser must not meet those labels at sign-in. Plural categories, as JavaScript engines report them, differ between engines and CLDR versions, so a file built from them in one browser can fail the repository's check in another.

Decision

  • The pack lives only in the browser.
    • It is a file the user picks or drops under Settings, Account. The card appears in the Advanced view, and in the Simple view too while a pack or a notice is active (ADR-036).
    • It is read with the browser's file API and kept, with its record, in one site-storage key for that address.
    • Nothing about it is uploaded, stored on a node, replicated, backed up, logged or audited. No API operation or MCP tool is added: like the theme, the domain icon style (ADR-167) and the language choice (ADR-189), it is a display matter in one browser.
    • It can't be loaded from an address, a link parameter or a message from another page.
  • Plural categories come from a committed table.
    • ui/src/locales/plurals.json maps each canonical language to its categories, in the order zero, one, two, few, many, other. It is generated once from CLDR and reviewed, and changed only by deliberate commits.
    • The repository's check, sync and the browser read it. The engine's plural rules are used only at runtime, to pick a category, with the fallback to other.
    • A language tag whose language isn't in the table is refused, and so is a tag the engine rewrites to another language. So are English, the pseudo-locales, qaa–qtz, mis, mul, zxx, und and private-use tags.
    • Display names from the browser name the language and decide nothing. The direction follows the script.
  • The template comes from the build.
    • The generation step that writes the shipped catalogs (ADR-189) also writes one skeleton, assets/locales/template-<hash>.json, from the same extraction sync uses. For every current English entry it holds the disambiguation note, the translator note, the sensitive tag and the verbatim words; it also holds the glossary and a copy of the plural table.
    • For the tag the translator types, the browser turns it into <tag>.json, using one module shared with sync and ordering strings by code unit. The bytes are what sync writes for a new language.
    • A companion <tag>-notes.txt carries the header (tag, name, direction, the web UI build it was made from), plain instructions, the glossary, the notes, the sensitive entries and the verbatim words. A header inside the pair file would make it differ from what sync writes.
  • The check is the build's own.
    • The browser runs the generation step's shipping function, from a module the check script shares: a pair is current when its context, normalized English and note equal an extracted entry as text, never by hash. It also runs the whole agreement rule, a module of its own apart from the runtime's first-use check, so a page's first load never carries it.
    • Only the file's current pairs are held to the rule there: a pair whose identity is not in the template is left over without it, so every English the rule reads in the browser is the build's own. In the browser, where every English the rule reads is the build's own, it reads a translation in linear time: none of its patterns backtracks over an unbounded run, its loops read through sets, and each of the English's own patterns is built once. Four times the input costs under six times as much on shapes made against it, and a whole file of 1 MiB of such pairs is checked in about a second or two under Node (0.28 to 1.57 s on files of up to 400 distinct structural English entries shaped against it; about a minute before the rule was made linear). The check script, which holds each pair to its own English half, grows with the product of the two token counts on input shaped against it (below).
    • A file is refused whole, and nothing is stored, when it is not UTF-8 JSON of the pair format within the limits (1 MiB, 10,000 pairs, 600 contexts, strings of 4,000 code units, context names), or when it repeats a key. The shared parser refuses duplicate keys for sync too.
    • An entry that breaks the agreement rule, or has other plural categories than its language, is dropped (English is shown) and listed with the rule in plain words. The card counts the texts that break a rule, each pair once, and lists every finding. Hyphenated words, short acronyms and added tokens are listed only.
    • Left-over pairs say why: a changed note, English that isn't in this build, or a pair set aside under ~leftover. Coverage per context and any difference from the canonical bytes are shown.
    • Text from the file is shown as plain text, isolated for direction, with forbidden code points as visible markers. It is never treated as message markup.
    • Download for a pull request writes what sync <tag> writes for that file at this build: canonical bytes, missing entries added empty, left-over pairs under ~leftover, translations unchanged.
    • The screen names what only the repository's check can judge: the manifest entry and owner, back-translations of sensitive entries, English changed since this build, and the bytes as committed.
  • Applying it.
    • After a confirmation that says what a pack can do, the page reloads with the pack as its language. The pack's table goes through the same installation as a fetched catalog, before the page is drawn, and the runtime checks each translation against its English the first time it shows it.
    • The record keeps the check's table, stamped with the web UI build and the file's fingerprint it was made for. A page load with that build and that file installs the kept table without the template or a new check. Any other load (no kept table, another stamp, or a kept table that is not well formed) checks the file again and keeps the new table in the same one write. When the record with its table does not fit the browser's storage, the record alone is kept, and each load checks the file.
    • ?lang= applies to one page load and pauses the pack; the banner says so. Otherwise the pack comes before the stored choice and Auto.
    • <html lang> and dir are the pack's, and the format locale follows ADR-189's rule.
    • A language the build offers under the same tag is replaced, never merged. It works when no language is offered.
  • Paused where someone else may be next, and for anyone but the user who loaded it.
    • On the sign-in page (its two-factor and recovery steps included), the setup page, the screen shown when the server can't be reached, a display link and a display session, the pack is not applied. Whether a user is signed in, and who, is read from the public sign-in status before the page is drawn.
    • A pack belongs to the user who loaded it: Use records who is signed in, and a page load pauses the pack for anyone else, with a banner line that says another user of this browser loaded it (no name is shown).
    • The banner there offers Show the test pack on this page, which applies it for the next page load only.
    • The app tells the pack's code who is signed in whenever that changes. Someone going away from a page that shows the pack reloads it: Sign out, a request that finds the session gone, or the display page reached by a change of the hash. That load is paused whatever the status says, so a status that disagrees with the app's own requests (two nodes behind one address) never makes a page reload again and again.
    • A sign-out that goes on to the provider's (an OIDC session, API-004) is not reloaded. The app's sign-out sets devpack.leaving before it asks the server: while the answer is awaited, a request that finds the session gone and the report of nobody it brings make the pack's code hold its reload back. With a provider's address in the answer the mark stays, the page leaves for the provider, and the page the provider sends back to is paused by the same flag; a reload there would cancel the provider's sign-out. Without one (a local sign-out), or when the request fails, the sign-out clears the mark in its finally and calls devpack.settled, which reloads once if a reload was held back; otherwise the report of nobody reloads as for any sign-out. One sign-out runs at a time: a call while one is under way (a second click before the answer) gets that call's promise and does nothing else, so it sends no second request and never clears the mark of a page on its way to the provider. Back to the page that left, which the browser may show again as it was from its back-forward cache, reloads it into a paused load.
    • A sign-in on a page paused for nobody or for another user reloads it, into the pack for the user who loaded it, with a flag of its own. A load that follows either reload, for a sign-in or for someone going away, does not reload for the first user the app reports. The app reports on every change of page, and only a change of who is signed in counts. So reads that disagree, in one direction or in turn from load to load, reload a page twice at most in a row, and a later sign-in on that load still reloads (after a sign-out the app's first report is nobody). "Show the test pack on this page" keeps its one load as it is.
  • The banner.
    • Every page shows an English banner first in the document, the sign-in, setup, wall and display pages included. It is set left to right, with a stacking order above every overlay of the UI (drawers, menus, popovers, the wall). Its height is passed through the CSSOM to the app's fixed and sticky layers (the header, the side menu and its scrim, the drawers, the wall), which move down by it, so nothing covers it. Two small layers are placed from their own anchors and not moved: a tip's bubble, which opens upward only when there is no room below its label, and the health panel, which opens upward from the bottom of the side menu. In a window too short to open them toward the page, they can reach under the banner, which stays on top.
    • It names the language, the file name (forbidden code points removed, at most 48 characters, isolated for direction) and a 12-hex SHA-256 fingerprint of the file, and has a button that removes the pack and reloads.
    • The banner, the confirmation, the notices, the line naming the pack in use and the card's Use, Download for a pull request and Remove buttons hold no message of the layer: their English is written as it is, under translate="no" and lang="en", so neither a pack nor a shipped catalog changes them. The text lint and the pseudo-locale rule already hold text under translate="no" as kept as written; no exemption is added.
  • Lifetime.
    • The record holds two stamps: the web UI's build identity, the content-hashed file name of the entry module (which changes with the English by construction, and which the build checks holds the template's address), read from the page's own entry module script, from this address, whatever other module scripts the page holds; and the server's build commit, read when the pack is loaded.
    • The first stamp is compared before every page is drawn. The second is compared with the build the signed-in UI already polls.
    • Any difference removes the pack, with a notice: an upgrade, a rollback or a downgrade, a server-only release included. Another web UI build removes it at the next page load, signed out too. Another server build removes it at the first page after sign-in: that page draws with the pack until the build poll's first answer, which comes as the page mounts, then reloads.
    • It is also removed 7 days after loading (loading the file again restarts the 7 days), and when its stored copy can't be read. The clock is read both ways: a record loaded after now, or meant to last longer than 7 days, is expired, and a notice dated after now goes like one 7 days old.
    • A check that throws twice in a row on the same file retires the pack. A template or checking code that can't be fetched leaves the pack for the next load.
    • A tab writes over or removes only what it read, while the key still holds the same record (fingerprint and load time), the same notice or the same damaged value: a tab left open never replaces or deletes a pack another tab loaded since. A notice takes a pack's place only after the key is emptied, and a page reloads for it only when the key no longer holds the pack, so storage that takes no write never makes a page reload into the same pack.
    • A page is never blank because of a pack. Any error or timeout gives the normal language. The pack's code, its two requests and the checking code share the catalog's limit of 4 s from the start of the language step; an import that stalls is given up then, and a pack decided after that is not applied (its banner says it could not be checked). A failure while drawing removes the pack, with a notice that says a page could not be drawn with it, and reloads once. A pack lookup never throws. A tab opened before an upgrade says the page must be reloaded.
  • Who. Any signed-in role can load a pack: it changes nothing on the server. Once loaded it applies in that browser for that address, to the user who loaded it.
  • Cost.
    • A reader who never uses it makes no extra request and loads no pack code: two storage reads in the load step, the card's heading and Open in Settings (Advanced view), one hook in the existing build poll, one call when the signed-in user changes, the sign-out's mark that it is under way (set before it asks the server, kept or cleared by the answer) with its call to the pack's code when the page does not leave for the provider, one sign-out at a time, and the stacking offsets.
    • The pack's code is lazy: the boot (pages with a pack in use), the card, and the checking code they share, which a page load with a kept table does not fetch.
    • The template is fetched only to download or check. npm run build gives it a line and a cap of its own, 64 KiB gzipped, outside the budget of the UI with English and outside the total for all languages. It fails if the template is not the one file it allows under assets/locales/, or if the entry module does not hold the template's address.
    • The gates, measured on the build machine against the language layer's base: an English reader downloads at most 1.0 KiB gzipped more for this task's own change (measured 958 B with the language-pack code of fe50d5a3: the card's sentence is in its chunk, the digit and added-token rules are in the pack's code, which gives them to the runtime, and the pack's code reads the web UI's build from the page); the core line, lazy code included, grows by at most 24 KiB (measured 22,955 B, the same way; the design's first figure was 16 KiB, revised because the pack's code is lazy, loaded only by someone who opens the card or has a pack in use, and the core stays far under the spec's 400 KiB); a pack user's boot takes at most 300 ms median at a 4x slower CPU on 2,600 pairs (measured at 1fa9c893: 47.3 ms with the kept table, which the design's own fallback for this ceiling introduced, against 48.3 ms for the same build's control; 484.1 ms when the file is checked again). The 1.0 KiB gate is this task's own: the bundle that also carries the keyed-lists fix adds more to an English first load, 1,319 B, and grows the core line by 23,501 B (measured at fe50d5a3, which is 42970ebe with the one-at-a-time sign-out).

Not done (considered):

  • A file on the server in a temporary folder: a file on one replica is not on the others, and read-only root file systems leave no temporary place but the persistent data directory. It needs an API operation with the agent rules (AGT-001 to AGT-005), audit and backup exclusion. Whatever one user stores would change the labels other users see.
  • Keeping the pack in the cluster's state: replication and a state-store change for one person's test.
  • Removing the pack only when the web UI changes: a server-only release would keep it, contrary to "removed on every upgrade". It saves about 100 bytes.
  • A new API field carrying the server's version to signed-out pages: loading needs a session, and the signed-in UI already polls the build.
  • Plural categories from the engine: engines and CLDR versions disagree, so the template, sync and the check could disagree.
  • Two storage keys: two tabs could pair one file's record with another's text.
  • A header section inside the template: it would differ from what sync writes, and every committed catalog would carry bytes that change with each build.
  • The template as a script chunk, computed from the bundle (which holds no contexts or notes), or published only with releases (offline networks and development builds would have none).
  • Merging a pack over a shipped catalog: it would hide what the pack itself holds.
  • Showing English beside sensitive strings while testing: it changes the layout the pack is meant to test.
  • A server switch to forbid packs, or a role limit: the pack changes nothing on the server, and the browser's user can already run any script in their own page.
  • A context of messages a pack may not translate (an earlier draft): a shipped catalog could still change them, and English written as it is under translate="no" needs no rule of its own.
  • Checking the file again at every page load: about half a second at a 4x slower CPU for 2,600 pairs, where the kept table takes about 50 ms.
  • Events between tabs, starting from a built language's translations, and choosing the direction by hand: not needed for the loop of template, check, use and pull request.
  • Session storage for the pack, a key per user (the record names its user), and an editor in the browser.
  • Checking a file in chunks between which the page answers: the check is one synchronous pass of the shipping function the check script shares, and its worst case is now about a second or two for 1 MiB under Node; a resumable form of it is more than that needs. A worker is not used.
  • Moving the tip's bubble and the health panel by the banner's height: inline-style code in two eager components (about 60 B gzipped), for windows too short to open them toward the page.
  • Calling the pack's user hook from the app's per-user effect, to save its own: that effect would then run on every change of page, and reread the view mode and the icon choice (with storage blocked, it would reset a mode chosen in memory).
  • Clearing the signed-in user only after the page has left for the provider's sign-out: it changes the sign-out of every user, not only with a pack, and the app would keep showing a signed-in page while it waits for a provider that may not answer.
  • A time limit on the sign-out's hold: the app's requests set none, so while an answer to Sign out never comes the mark stays, and a session that ends meanwhile draws the sign-in page with the pack's text under its banner until an answer comes or someone signs in there (Remove and signing in still work). With one sign-out at a time, a further click on Sign out, with a pack or without, waits for that same answer. A timer would add eager code for a server that takes the request and never answers it.
  • A mark of three values (waiting, leaving for the provider, neither) in place of one sign-out at a time: a second click would still send a second request, and a second answer that came first would still reload the page before the first answer comes.
  • A maintainer's exemption from the digit rule for the check's limits, in place of plural messages: the runtime's first-use check of a pack has no notes, so it would show English for a translation the card's check passed.
  • Holding {max} in every plural form of the check's limits: ADR-189's rule lets a form other than other leave a placeholder out, and an exception per message would need notes the runtime's first-use check does not have. Languages such as Russian and Polish show their many form for these limits, so a number written there in place of {max} is held to no rule. The notes for translators say to keep {max} in every form of a limit.

Consequences

  • A translator without tooling can produce, check and see a language, and send the downloaded file as a pull request unchanged. Developers with a checkout keep sync, a manifest entry with offered: false, and ?lang=<tag>.
  • For this task's own change, an English reader downloads 958 B more and makes no new request (1,319 B with the keyed-lists fix of the same bundle). Its core line grows by 22,955 B, nearly all of it the pack's lazy code (the card about 10 KiB, the checking code about 5 KiB, the boot and its banner about 4 KiB, the record's code with the digit and added-token rules about 2 KiB). The template takes 29.4 KiB on its own line; in the image both are about their gzipped size (ADR-168).
  • A pack user's page load does one more public status request; with the kept table it fetches nothing else for the pack. Use asks for the server's build and for the public status (who is signed in). The record with its table is about 1.5 times the file's text (a 2,600-pair German pack: 383,588 characters, under 0.8 MB as the browser stores it).
  • With a pack in use, a sign-out that goes on to the provider draws the sign-in page with the pack's text until the browser leaves for the provider (T29.3's AC (4) says so), and so does a session that ends while a sign-out waits for the server's answer, until that answer comes. Back to that page, shown again from the browser's back-forward cache, reloads it into a paused load; Playwright's headless shell never shows a page again from that cache, so the two Back tests launch a full Chromium where one is installed (CI's two browser jobs install it), first check that the browser they got shows a page of the app again from that cache, and skip, saying why, where it does not. A sign-in on that page, if it never left, also takes the Back listener away. If the provider's address never replaces the page, that page stays so until the next page load or sign-in: a sign-in by another user reloads it, paused, and after a sign-in by the same user a later sign-out or session end takes the pack away as any does.
  • The check's three limits (contexts, pairs, characters in a text) are plural messages whose count is the limit, with the number formatted for the language: a translator writes the noun in the form that number takes and copies no digit.
  • A pack is removed by every upgrade, including each development build of an edge install, and on each switch between builds when nodes with different builds answer behind one address.
  • The browser's check can differ from the repository's when main's English or rules have moved on since the build. The repository's check decides, and English-only changes still never fail a language (ADR-189).
  • A pack someone else wrote can show misleading labels to the person who loads it. The confirmation, the banner above everything, the pause where someone else may be next and for any other user, ?lang=en, the 7 days and the removal on any upgrade are the safeguards. The documentation advises loading other people's packs on a test installation.
  • A kept table is trusted a little more than a file: a page load installs it without the file's check, and the runtime's first-use check has no verbatim words or glossary, so a table planted in the key could drop a term the file's check would keep; planting it needs script on this origin, which could change the page anyway.
  • sync (ADR-189) keeps the first pair of an identity when a file has two, as the build ships it, and sets the later one aside under ~leftover; it kept the last and dropped the first. So the card's "only the first is used", the page, its Download for a pull request and sync agree, plurals included: the browser's check lists a later pair of a plural's identity as there twice and never shows it, whatever the first pair's categories.
  • The agreement rule also forbids a surrogate that is not half of a pair, which draws as U+FFFD (ADR-189's list, amended here; no catalog, fixture or template message held one).
  • The check script still places each finding by a search from the start of the translation, which grows faster than the text on shapes made against the rule (a few milliseconds for a pair of 4,000 units). The worst shape left is an English of thousands of structural tokens against a translation of tokens joined by a fullwidth equals sign: about 20 ms a pair there (0.4 s before). It never reaches the browser, whose English is the build's own.
  • Nothing about a pack appears in a backup, a support package, the audit log or any other browser.
  • The modules the check script shares with the browser import each other by file name (./safe.ts), as Node's own type stripping needs; ui/tsconfig.json allows such imports (allowImportingTsExtensions, with noEmit). It is a compile-time setting only: the bundle does not change.
  • ui/README.md (Languages), docs/running.md (Web UI), spec/07 §3 and the site's budget page describe it; the site's page for translators is its own task (T29.4). .gitattributes keeps ui/src/locales/*.json as LF text.

Verification

the node tests of ui/tests/e2e/7-devpack.spec.ts (api_013 the template equals what sync writes for a new language, api_013 prebuild writes the template the url table names, api_013 plural categories come from the committed table not the engine, api_013 the browser and the script write the same canonical bytes, api_013 download for a pull request is what sync writes for that file, api_013 download for a pull request keeps the first of two pairs with one identity, api_012 a catalog the build did not ship is shown only with the rules its code brings, api_013 a pack is refused whole for its structure, api_013 a limit of the check reads as the language writes numbers, api_013 a pack entry that breaks the agreement rule is dropped and named in plain words, api_013 the count of texts that break a rule counts each pair once, api_013 the first of two plurals with one identity decides, whatever its categories, api_013 report-only findings never drop an entry, api_013 a pack pair is current by text never by hash, api_013 a left-over pair says why, api_013 pack entries named like object members are data, api_013 coverage counts a plural group once and lists missing and left-over entries, api_013 the language tag is canonical and known, api_013 the agreement rule stays linear on hostile input, api_013 a whole pack of hostile pairs is checked in a few seconds, api_012 the agreement rule gives what it gave before it was made linear, api_012 a surrogate that is not half of a pair is a forbidden code point, api_013 pack text in a reason line is marked and limited, api_013 no source of the web ui holds a literal direction control or mark, line separator or byte-order mark, api_013 a displayed file name loses forbidden code points and is cut to 48, api_013 a stored pack is cleared on another build after seven days and when damaged, api_013 a kept record whose tag the card could not have stored is damaged, api_013 a check that throws twice in a row retires the pack, api_013 a kept table spares the check while the build and the fingerprint are unchanged, api_013 a kept record's size for a typical and for the largest pack, api_013 a page load pauses the pack where someone else may be next, api_013 the one-load flag is taken whatever the load decides, api_013 reads of who is signed in that disagree reload a page twice at most in a row, api_013 the back tests name why the full chromium did not start, api_013 the back tests fail when the probe cannot forget its own count, api_013 the clock is checked both ways, api_013 a tab writes over or removes only what it read, api_013 a notice that cannot be kept never leaves the pack behind, api_013 code that never arrives gives the usual language in time, api_013 a pack lookup never throws, and the api_012 tests of the shared modules); the browser tests of ui/tests/e2e/9-devpack.spec.ts (api_013 an english session loads no pack code and makes no pack request, api_013 the template downloads for a chosen tag, api_013 the card says when a language is written right to left, api_013 a loaded pack shows after apply and reload, api_013 the banner stays on top of every overlay, api_013 the pack is paused on the sign-in setup and two-factor screens, api_013 show the test pack on this page lasts one load, api_013 signing in with a paused pack reloads into the pack, api_013 signing out takes the pack off the page, api_013 signing out at the provider leaves for it with a pack in use, api_013 back after signing out at the provider never shows the pack, api_013 a provider sign-out that never leaves the page lets a later session end take the pack away, api_013 a session that ends while the sign-out waits for its answer reloads nothing before it, api_013 a second sign-out while the first waits for its answer leaves the page on its way to the provider, api_013 a session that ends takes the pack off the page, api_013 reads of who is signed in that disagree reload a page once for a sign-in, api_013 the display page from a signed-in page is drawn without the pack, api_013 show the test pack on this page keeps its load on the sign-in page, api_013 a pack is paused for anyone but the user who loaded it, api_013 the user who loaded a pack gets it back after signing in again and another user does not, api_013 the banner removes the pack from any page, api_013 a pack is cleared when the web ui build changes, api_013 the web ui build is the entry module whatever module script comes first, api_013 a pack is cleared when the server build changes, api_013 a tab left open neither removes nor replaces a newer pack, api_013 a notice that cannot be kept never makes a page reload again, api_013 a page that fails to draw with the pack loads once more without it, api_013 a pack expires after seven days, api_013 a damaged stored pack falls back without a blank page, api_013 pack code that never arrives still gives a drawn page, api_013 a card opened in a tab from before an upgrade says reload, api_013 blocked storage still checks and downloads but refuses use, api_013 a quota error on use writes nothing, api_013 use stores the file that was confirmed, api_013 a pack whose table does not fit is kept without it, api_013 lang parameter pauses the pack for one page load, api_013 pack text never reaches a request or storage, api_013 api_005 a pack that reads one word draws every page with live data and no page error, api_013 a pack never translates its own warning banner and buttons, api_013 the card's actions send nothing about the pack, api_013 the check screen shows pack text inert, api_013 a refused file says why and stores nothing, api_013 the pack card works with the keyboard and at 360 px, api_012 pseudo locale leaves no literal text: the language pack card and banner); with OIDC_E2E, the tests of ui/tests/e2e/3-oidc.spec.ts <provider>: with a test language pack in use, signing out also signs out at the provider (a real provider's sign-out page is reached, and signing in again asks for the password) and <provider>: with a test language pack in use, a session that ends while signing out still signs out at the provider, <provider>: with a test language pack in use, a second sign-out while the first waits still signs out at the provider, <provider>: with a test language pack in use, back from the provider's sign-out shows no pack; the size lines of npm run build and its template-address guard; the boot time measured on the build machine.

Requirements AGT-001 AGT-005 API-004 CLU-004 NFR-001

Builds on ADR-030 ADR-036 ADR-167 ADR-168 ADR-189

Referenced by ADR-189