Repository navigation
Publish the data archive under node_ref, not node_id - #609
Conversation
This comment has been minimized.
This comment has been minimized.
e4074e2 to
11af5bc
Compare
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
796cdd8 to
a332b89
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
779dfd4 to
da8f2ad
Compare
This comment has been minimized.
This comment has been minimized.
da8f2ad to
ddd3a28
Compare
|
This comment has been minimized.
This comment has been minimized.
ddd3a28 to
4fb47b3
Compare
This comment has been minimized.
This comment has been minimized.
/api/data/archive was the one public route still handing out the private node_id: in every listed key (year=/month=/day=/node_id=<id>/), in its node_id filter, in the download path and as the downloaded body's node_id field. The Data Explorer on app.retina.fm showed those ids as its file tree, and because its node picker is built from /api/radar/nodes, which is keyed on node_ref, every node appeared twice (16 known nodes, 32 on the timeline on prod). The store stays keyed on node_id; re-keying it is phase 2 of the archive programme plan. The route translates at the publication boundary instead, the same place every other feed does: listed keys carry node_ref=<ref> (bare <ref> for the legacy layout), the filter is node_ref, a download resolves the ref back to the stored key, and the body's node_id becomes node_ref. A node with no published identity is not listed. Only published keys download: a stored node_id= key now 404s, which also stops the route confirming a guessed id. A filter naming a private node's ref answers like an unknown one, total included. The admin Storage page reads the same listing, so it maps the refs back to node_ids through the admin-only node-refs map, keeping its file table in the id space of the per-node table beside it. Breaks any script holding an old node_id key or passing node_id=; the route is public and documented in the API reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
public_identity names a mirrored node, one whose detections arrive from another environment and which has no registry row here, by the ref that environment sends with them (#373). id_for_identity, the inverse every public path parameter resolves through, predates that and reads only the registry, so a mirrored node was published under a ref that no route would take back. It showed first in the archive: a mirrored node's files are listed under its ref, but downloading one or filtering by the ref found nothing. The same gap sits under /api/radar/analytics/{node_ref} and the custody routes, which this fixes too. The reverse scans the connected nodes, where a mirrored ref lives, and counts a match only if owner_identity names that node by the ref, so a registry row that outranks a mirrored ref on the way out does here as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner pages on app.retina.fm still put the private node_id on screen. Connect your node listed it in a Node ID column beside the Node ref one, and /api/auth/me/nodes filled an unnamed node's name with its node_id, which Tunnel and My Nodes then displayed; they also fell back to the id themselves when a node had no ref. The owner route now names a node through public_name, as the public listing does: a node with no name of its own, or one whose name is a node id, is called by its ref. The route keeps node_id for the owner's own calls (release, location privacy, the node's <id>.retnode.com site), but no page displays it: the Node ID column goes, Tunnel searches and labels by name or ref, and a node with neither shows a dash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4fb47b3 to
7431f57
Compare
|
Both fixed, each folded into the commit it belongs to:
|
|
Claude finished @Babissimo's task in 3m 49s —— View job Code Review: PR #609 — Publish the data archive under node_ref, not node_id
SummaryThis re-review checked the current HEAD against the two issues raised in the prior automated review round (unlocked
with state.connected_nodes_lock:
snapshot = list(state.connected_nodes.items())
for node_id, known in snapshot:
...This matches the snapshot-under-lock pattern used elsewhere ( Download route's body-fallback privacy check — node_id = stored[1] or body_id
if node_id in private:
raise HTTPException(status_code=404, detail="Archive file not found")
data["node_ref"] = public_identity(node_id)and this exact path is covered by Rest of the diffWent through the remaining changed surface (auth.py's Test coverage for this diff ( Confirmed cleanNo outstanding issues found. Both concerns from the previous review round are already fixed and tested on this branch. Branch: |
/api/data/archivewas the one public route still handing out the privatenode_id: in every listed key, in its filter, in the download path and in the downloaded body. The Data Explorer on app.retina.fm showed those ids as its file tree. Its node picker is built from/api/radar/nodes, which is keyed onnode_ref, so on prod every node appeared twice (16 known nodes, 32 rows on the timeline).What changes
The store stays keyed on
node_id(re-keying it is phase 2 of the archive programme plan in claude-shared). The route translates at the publication boundary, as every other public feed does:…/node_id=ret…/part-….parquet…/node_ref=nde…/part-….parquet(bare<ref>for the legacy layout)?node_id=?node_ref="node_id": "ret…""node_ref": "nde…"node_id=key now 404s, so the route no longer confirms a guessed id.totalincluded.node_ref, readsnode_reffrom the preview, and its search box says "node ref".A second commit fixes the reverse lookup for mirrored nodes. These are nodes relayed from another environment, with no registry row here, whose ref arrives with their detections (#373).
public_identitypublished them under that ref, butid_for_identitycould not resolve it back. That left their archive files listed but impossible to download or filter, and left/api/radar/analytics/{node_ref}and the custody routes unable to answer for them.#610 (the owner pages: no Node ID column, and names that fall back to the ref rather than the id) is merged into this branch as its third commit, so both ship in one deploy.
Breaking for scripts: anything holding an old
node_id=key or passing?node_id=gets 404s or an unscoped listing. The route is public and appears in the API reference.Verification
test_publication.pycover listing, filtering, both key layouts, download, stored-key refusal and private nodes. All of them fail against the old route.-m "not external" -n 4 --dist worksteal): 5078 passed. Dashboard: 1394 passed (both on the combined head, rebased on currentmain). Typecheck, eslint and pre-commit are clean.?node=scoped listing all used the ref, and noret…id appeared on the page.🤖 Generated with Claude Code