Assert the detection area on a node that has one - #338
Conversation
This comment has been minimized.
This comment has been minimized.
ea9a198 to
2d59685
Compare
This comment has been minimized.
This comment has been minimized.
2d59685 to
8d140c6
Compare
This comment has been minimized.
This comment has been minimized.
The per-node analytics block read REAL_NODE_ID for everything, including its four detection_area assertions. That node registers through POST /api/radar/detections carrying no config at all, which the route deliberately stores as an unpositioned canonical_config, and since 1.1.3 an unpositioned node is given no detection area: withholding it is what keeps such a node off the map. The four assertions therefore read undefined and failed against staging, gating the production deploy. They move to BULK_B_NODE_ID, which registers through the bulk route with a full geo config and so has a footprint to describe. The block now reads two nodes, which is the point: the pair is the contract. The absence on the unpositioned one is asserted directly rather than left implicit, alongside the metrics and trust that must still be there, since counted-but-unplaced is the state this feature exists to allow. n_detections is 0 here rather than 1, because BULK_B is registered with no frames; the assertion was already a non-negative check, only its comment needed correcting. Verified against staging, which carries this code: an unconfigured node returns metrics, trust, reputation and coverage_map with no detection_area, and a positioned node returns the block with all ten keys the test requires. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8d140c6 to
d5f155f
Compare
|
Claude finished @Babissimo's task in 2m 17s —— View job Reviewing PR #338 (new commits pushed)
What changed since the last reviewA dedicated This resolves the finding from the last review:
Remaining minor items (carried over, non-blocking)These were flagged in the previous review round and are unchanged by this commit:
Verification limits
CLAUDE.md complianceNo violations: only Summary: this revision resolves all four previously-blocking findings, including the newly-introduced bulk-response-contract regression. What remains are three low-severity wording/symmetry nits already on record — none block merge. |
Three review notes carried over from #338, none of which justified holding that deploy. The placed node's status test now also asserts the body's shape, matching its REAL_NODE_ID sibling: the two are a deliberate pair and read better making the same claims. The absence assertion is gated on the status. `not.toHaveProperty` holds against an error body as readily as against a correct one, so on a failed request the test would have gone green for the wrong reason. The metrics and trust assertions beside it already caught that, but by accident rather than by saying so, and an absence assertion is exactly the shape that earns an explicit guard. "legacy" leaves the title. POST /api/radar/detections is the current route for a node that registers without a config, not a deprecated one, and the word implied a dead code path a reader would go looking for and not find. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Four
detection_areaassertions in the per-node analytics block failed against staging after #278 merged, gating the production deploy. The code is correct; the tests encoded the old behaviour.Why they failed
REAL_NODE_IDregisters throughPOST /api/radar/detectionswith no config at all. That route stores it deliberately unpositioned:Since contract 1.1.3 an unpositioned node is given no detection area, and withholding it is precisely what keeps such a node off the map. Before #278 the same node had its coordinates coerced to
(0, 0)and was handed a detection area anchored on Null Island, which is the behaviour these assertions were written against.96 tests passed; the 4 that failed all read
analyticsBody.detection_area, which is nowundefined.What this changes
The four assertions move to
BULK_B_NODE_ID, which registers through the bulk route with a full geo config and therefore has a footprint to describe. The block now reads two nodes, and that pair is the point: one placed, one not.The absence on the unpositioned node is asserted directly rather than left implicit, together with the
metricsandtrustthat must still be present — counted but unplaced is the state the feature exists to allow, so it is worth pinning rather than inferring.n_detectionsreads 0 here rather than 1, becauseBULK_Bregisters with no frames. The assertion was already a non-negative check; only its comment needed correcting.Verification
tsc --noEmitcoverssrconly, and the Playwright job does not run on pull requests, so both halves were checked against staging, which already carries this code:e2e-auth-probe-check)metrics,trust,reputation,coverage_map, nodetection_arearadar3-retnode)detection_areawith all ten keys the test requires,rxcarrying lat/lon,n_detectionsnumericBoth match what the revised tests assert.
Follows #278. Ticket: 86cbauhxd.
🤖 Generated with Claude Code