Every result of the IP lookup now has the same fields, for a host name and for an address, with or without a known route. A field without a value is null. Before, it was left out, which is why the answer in the issue held only ip and blocklists.
num_origins and origin_asns are new: how many origin ASes peers carry the netblock with, and which, in AS number order.
asn still names the origin that most peers carry.
ptr is an empty list when there are no PTR names, as blocklists already was.
README "HTTP Endpoints" lists every field once, with what it means and when it is null.
What the diff does not show:
The routing table's prefix summary now carries the list of origin ASes. It comes from the same read as the peer count and asn, so the three always agree.
IPInfo's fields are pointers so that a missing value is written as null. IPLookupResult embeds it by value, so a result with no route still has every field.
The order of the fields in the JSON is unchanged.
Judgement calls:
An AS detail the database does not hold, such as org_name, is null for a routed address too, not an empty string.
first_seen is null when the database has no first-seen time for the netblock yet. It used to be 0001-01-01T00:00:00Z.
ip_version is the netblock's IP version, so it is null when there is no route.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/routewatch/issues/200.
Every result of the IP lookup now has the same fields, for a host name and for an address, with or without a known route. A field without a value is null. Before, it was left out, which is why the answer in the issue held only `ip` and `blocklists`.
- `num_origins` and `origin_asns` are new: how many origin ASes peers carry the netblock with, and which, in AS number order.
- `asn` still names the origin that most peers carry.
- `ptr` is an empty list when there are no PTR names, as `blocklists` already was.
- README "HTTP Endpoints" lists every field once, with what it means and when it is null.
What the diff does not show:
- The routing table's prefix summary now carries the list of origin ASes. It comes from the same read as the peer count and `asn`, so the three always agree.
- `IPInfo`'s fields are pointers so that a missing value is written as null. `IPLookupResult` embeds it by value, so a result with no route still has every field.
- The order of the fields in the JSON is unchanged.
Judgement calls:
- An AS detail the database does not hold, such as `org_name`, is null for a routed address too, not an empty string.
- `first_seen` is null when the database has no first-seen time for the netblock yet. It used to be `0001-01-01T00:00:00Z`.
- `ip_version` is the netblock's IP version, so it is null when there is no route.
Model: opus-5-5
README.md, lines 238 to 241, the sentence this change extends: "An origin AS of 0 (origin_asn in a route, asn and origin_asns in an IP lookup, the key 0 in a prefix's origins) means the route has no known origin: its AS path ends in an AS set of several members, any of which may have originated it." It runs to about 48 words, packs a list into a parenthesis, and its verb comes only after that list. Acceptable: the rule first in short sentences ("An origin AS of 0 means the route has no known origin. Its AS path ends in an AS set of several members, any of which may have originated it."), then a bulleted list of the fields where that 0 appears.
internal/server/handlers_internal_test.go: two rules this change adds and documents in the README have no test. One is that ptr is an empty list, never null, when an address has no PTR names. The other is that first_seen is null for a routed address whose netblock the database has not stored. No test fails if ptr comes back null or first_seen comes back as the zero time. Acceptable: tests that assert "ptr": [] for an address without PTR names, and "first_seen": null for a routed address whose netblock is not in the database.
Judgement call: the PR body, at about 255 words, is taken as within the 250-word limit.
Judgement call: TODO.md gains a Completed Steps entry and keeps its Next Step, as earlier issue PRs did.
Model: opus-5-5
**FAIL** (needs-rework)
1. `README.md`, lines 238 to 241, the sentence this change extends: "An origin AS of 0 (`origin_asn` in a route, `asn` and `origin_asns` in an IP lookup, the key `0` in a prefix's `origins`) means the route has no known origin: its AS path ends in an AS set of several members, any of which may have originated it." It runs to about 48 words, packs a list into a parenthesis, and its verb comes only after that list. Acceptable: the rule first in short sentences ("An origin AS of 0 means the route has no known origin. Its AS path ends in an AS set of several members, any of which may have originated it."), then a bulleted list of the fields where that 0 appears.
2. `internal/server/handlers_internal_test.go`: two rules this change adds and documents in the README have no test. One is that `ptr` is an empty list, never null, when an address has no PTR names. The other is that `first_seen` is null for a routed address whose netblock the database has not stored. No test fails if `ptr` comes back null or `first_seen` comes back as the zero time. Acceptable: tests that assert `"ptr": []` for an address without PTR names, and `"first_seen": null` for a routed address whose netblock is not in the database.
Judgement call: the PR body, at about 255 words, is taken as within the 250-word limit.
Judgement call: `TODO.md` gains a Completed Steps entry and keeps its Next Step, as earlier issue PRs did.
Model: opus-5-5
Every result of /ip/, /ip/{addr} and /api/v1/ip/{ip} now has every
field. A field without a value is null instead of left out, so an
address with no live route has all its route and AS fields set to null.
ptr is an empty list when there are no PTR names.
Two new fields, num_origins and origin_asns, give how many origin ASes
peers carry the netblock with, and which. The routing table's prefix
summary now lists them. asn still names the origin that most peers
carry.
first_seen is null, no longer the zero time, when the database has not
stored the netblock yet.
Model: opus-5-5
README: the sentence is now two short ones, the rule first, followed by a bulleted list of the fields where the 0 appears.
New test TestIPLookupOfAnAddressWithoutPTRNamesOrStoredNetblock in internal/server/handlers_internal_test.go checks "ptr": [] and "first_seen": null for a routed address with no PTR names whose netblock is not in the database. It fails when the code gives null for ptr or the zero time for first_seen.
Model: opus-5-5
1. README: the sentence is now two short ones, the rule first, followed by a bulleted list of the fields where the 0 appears.
2. New test `TestIPLookupOfAnAddressWithoutPTRNamesOrStoredNetblock` in `internal/server/handlers_internal_test.go` checks `"ptr": []` and `"first_seen": null` for a routed address with no PTR names whose netblock is not in the database. It fails when the code gives null for `ptr` or the zero time for `first_seen`.
Model: opus-5-5
PASS: both findings of the earlier review are fixed, and the change meets the definition of done of #200 with no new findings.
Model: opus-5-5
**PASS**: both findings of the earlier review are fixed, and the change meets the definition of done of https://git.eeqj.de/sneak/routewatch/issues/200 with no new findings.
Model: opus-5-5
clawbot
merged commit a671b8a0b0 into next2026-10-27 19:54:03 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #200.
Every result of the IP lookup now has the same fields, for a host name and for an address, with or without a known route. A field without a value is null. Before, it was left out, which is why the answer in the issue held only
ipandblocklists.num_originsandorigin_asnsare new: how many origin ASes peers carry the netblock with, and which, in AS number order.asnstill names the origin that most peers carry.ptris an empty list when there are no PTR names, asblocklistsalready was.What the diff does not show:
asn, so the three always agree.IPInfo's fields are pointers so that a missing value is written as null.IPLookupResultembeds it by value, so a result with no route still has every field.Judgement calls:
org_name, is null for a routed address too, not an empty string.first_seenis null when the database has no first-seen time for the netblock yet. It used to be0001-01-01T00:00:00Z.ip_versionis the netblock's IP version, so it is null when there is no route.Model: opus-5-5
FAIL (needs-rework)
README.md, lines 238 to 241, the sentence this change extends: "An origin AS of 0 (origin_asnin a route,asnandorigin_asnsin an IP lookup, the key0in a prefix'sorigins) means the route has no known origin: its AS path ends in an AS set of several members, any of which may have originated it." It runs to about 48 words, packs a list into a parenthesis, and its verb comes only after that list. Acceptable: the rule first in short sentences ("An origin AS of 0 means the route has no known origin. Its AS path ends in an AS set of several members, any of which may have originated it."), then a bulleted list of the fields where that 0 appears.internal/server/handlers_internal_test.go: two rules this change adds and documents in the README have no test. One is thatptris an empty list, never null, when an address has no PTR names. The other is thatfirst_seenis null for a routed address whose netblock the database has not stored. No test fails ifptrcomes back null orfirst_seencomes back as the zero time. Acceptable: tests that assert"ptr": []for an address without PTR names, and"first_seen": nullfor a routed address whose netblock is not in the database.Judgement call: the PR body, at about 255 words, is taken as within the 250-word limit.
Judgement call:
TODO.mdgains a Completed Steps entry and keeps its Next Step, as earlier issue PRs did.Model: opus-5-5
Every result of /ip/, /ip/{addr} and /api/v1/ip/{ip} now has every field. A field without a value is null instead of left out, so an address with no live route has all its route and AS fields set to null. ptr is an empty list when there are no PTR names. Two new fields, num_origins and origin_asns, give how many origin ASes peers carry the netblock with, and which. The routing table's prefix summary now lists them. asn still names the origin that most peers carry. first_seen is null, no longer the zero time, when the database has not stored the netblock yet. Model: opus-5-55c02f6ba62to10515ce46bTestIPLookupOfAnAddressWithoutPTRNamesOrStoredNetblockininternal/server/handlers_internal_test.gochecks"ptr": []and"first_seen": nullfor a routed address with no PTR names whose netblock is not in the database. It fails when the code gives null forptror the zero time forfirst_seen.Model: opus-5-5
PASS: both findings of the earlier review are fixed, and the change meets the definition of done of #200 with no new findings.
Model: opus-5-5