execution_time should be execution_time_ms and not be a string but the actual value #199

Closed
opened 2026-10-27 18:28:25 +01:00 by sneak · 4 comments
Owner

Strings with labels should never be used as values in api responses. If it's a native type then put the value in the field name (e.g. _ms).

Have the SDLC top manager codify this into a policy for all APIs we build.

Strings with labels should never be used as values in api responses. If it's a native type then put the value in the field name (e.g. _ms). Have the SDLC top manager codify this into a policy for all APIs we build.
clawbot was assigned by sneak 2026-10-27 18:32:57 +01:00
Author
Owner

in the prompts repo we want an API_POLICIES.md alongside the styleguides

in the prompts repo we want an API_POLICIES.md alongside the styleguides
Collaborator

Plan: @meta.execution_time becomes execution_time_ms, a number. Every other value that carries its unit inside a string changes the same way, for example uptime and connection_duration (to uptime_seconds and connection_duration_seconds), memory_usage (to memory_usage_bytes) and the WHOIS fetcher's current_interval (to current_interval_seconds). Every response is checked, and the pages read the new fields. When the shared API_POLICIES.md lands in sneak/prompts, it is vendored here.

Model: opus-5-5

Plan: `@meta.execution_time` becomes `execution_time_ms`, a number. Every other value that carries its unit inside a string changes the same way, for example `uptime` and `connection_duration` (to `uptime_seconds` and `connection_duration_seconds`), `memory_usage` (to `memory_usage_bytes`) and the WHOIS fetcher's `current_interval` (to `current_interval_seconds`). Every response is checked, and the pages read the new fields. When the shared `API_POLICIES.md` lands in sneak/prompts, it is vendored here. Model: opus-5-5
Collaborator

API_POLICIES.md is on next of sneak/prompts in 430964ceac (file prompts/API_POLICIES.md); vendor it here.

Model: opus-5-5

`API_POLICIES.md` is on `next` of `sneak/prompts` in https://git.eeqj.de/sneak/prompts/commit/430964ceaca9c32309caf62352a658cd67e336f9 (file `prompts/API_POLICIES.md`); vendor it here. Model: opus-5-5
Collaborator

Built in #207. Every JSON value with a unit is now a number, and its field name ends in the unit: execution_time_ms, 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. API_POLICIES.md is vendored at the repo root, and REPO_POLICIES.md re-vendored from the same sneak/prompts commit.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/207. Every JSON value with a unit is now a number, and its field name ends in the unit: `execution_time_ms`, `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. `API_POLICIES.md` is vendored at the repo root, and `REPO_POLICIES.md` re-vendored from the same `sneak/prompts` commit. Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#199