Give every API value with a unit as a number (closes #199) #207

Merged
clawbot merged 1 commits from issue-199-numeric-api-values into next 2026-10-27 20:19:01 +01:00
Collaborator

Every JSON value that carried its unit inside a string is now a number, with the unit at the end of its field name, as the vendored API_POLICIES.md requires (#199).

Changed:

  • @meta.execution_time ("12 ms") is now execution_time_ms, on every JSON answer
  • uptime ("1h18m34s") is now uptime_seconds, in /status.json and /api/v1/stats
  • memory_usage ("1.1 GB") is now memory_usage_bytes, in both
  • whois_stats.current_interval ("18.2s") is now whois_stats.current_interval_seconds, in both; it can have a fractional part
  • connection_duration is now connection_duration_seconds, in /api/v1/stats; it is null where it used to read "disconnected"

Checked and kept:

  • times in RFC 3339: oldest_route, newest_route, first_seen, last_seen, last_updated, updated, timestamp, and the WHOIS dates of /api/v1/as
  • plain words: status, @meta.time_zone, and the health check's checks values
  • names, addresses and text: go_version, handler name, prefix, netblock, peer_ip, next_hop, query, ptr, handles, descriptions, the WHOIS details, errors, error.msg
  • numbers whose names already give their unit: the _bytes, _ms and _per_sec fields, route_churn_per_min, fresh_percent

The status page formats the new numbers itself. REPO_POLICIES.md is re-vendored, unchanged, from the same sneak/prompts commit as API_POLICIES.md.

Judgement call: the health check keeps checks.ris_live: "disconnected". It is a status word, like ok and error, not a value with a unit.

Model: opus-5-5

Every JSON value that carried its unit inside a string is now a number, with the unit at the end of its field name, as the vendored `API_POLICIES.md` requires (https://git.eeqj.de/sneak/routewatch/issues/199). Changed: - `@meta.execution_time` ("12 ms") is now `execution_time_ms`, on every JSON answer - `uptime` ("1h18m34s") is now `uptime_seconds`, in `/status.json` and `/api/v1/stats` - `memory_usage` ("1.1 GB") is now `memory_usage_bytes`, in both - `whois_stats.current_interval` ("18.2s") is now `whois_stats.current_interval_seconds`, in both; it can have a fractional part - `connection_duration` is now `connection_duration_seconds`, in `/api/v1/stats`; it is null where it used to read "disconnected" Checked and kept: - times in RFC 3339: `oldest_route`, `newest_route`, `first_seen`, `last_seen`, `last_updated`, `updated`, `timestamp`, and the WHOIS dates of `/api/v1/as` - plain words: `status`, `@meta.time_zone`, and the health check's `checks` values - names, addresses and text: `go_version`, handler `name`, `prefix`, `netblock`, `peer_ip`, `next_hop`, `query`, `ptr`, handles, descriptions, the WHOIS details, `errors`, `error.msg` - numbers whose names already give their unit: the `_bytes`, `_ms` and `_per_sec` fields, `route_churn_per_min`, `fresh_percent` The status page formats the new numbers itself. `REPO_POLICIES.md` is re-vendored, unchanged, from the same `sneak/prompts` commit as `API_POLICIES.md`. Judgement call: the health check keeps `checks.ris_live: "disconnected"`. It is a status word, like `ok` and `error`, not a value with a unit. Model: opus-5-5
clawbot added the needs-review label 2026-10-27 20:06:22 +01:00
clawbot self-assigned this 2026-10-27 20:06:23 +01:00
clawbot added 1 commit 2026-10-27 20:06:23 +01:00
A value with a unit is now a number, and its field name ends in the
unit, as the vendored API_POLICIES.md requires. @meta.execution_time
becomes execution_time_ms. In the stats answers, uptime,
connection_duration, memory_usage and whois_stats.current_interval
become uptime_seconds, connection_duration_seconds, memory_usage_bytes
and whois_stats.current_interval_seconds. connection_duration_seconds
is null while the feed is not connected. The status page formats the
numbers itself. REPO_POLICIES.md is re-vendored from the same
sneak/prompts commit.

Model: opus-5-5
Author
Collaborator

PASS: this change meets #199 and its plan, and I found no defects.

Judgement call: I accept the health check's checks.ris_live value disconnected as a status word, like ok and error, not a value with a unit.
Unverified: I did not open the status page in a browser; I ran its new formatting code on its own.

Model: opus-5-5

PASS: this change meets https://git.eeqj.de/sneak/routewatch/issues/199 and its plan, and I found no defects. Judgement call: I accept the health check's `checks.ris_live` value `disconnected` as a status word, like `ok` and `error`, not a value with a unit. Unverified: I did not open the status page in a browser; I ran its new formatting code on its own. Model: opus-5-5
clawbot merged commit e8d04f1304 into next 2026-10-27 20:19:01 +01:00
clawbot deleted branch issue-199-numeric-api-values 2026-10-27 20:19:02 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#207