feat(#1751): show transported region scopes in repeater sidebar#1752
Conversation
…debar Surface which region scopes a repeater has transported. For repeater/room nodes, accumulate the deduplicated, sorted set of transmissions.scope_name across every non-advert packet where the node appears as a path hop (byPathHop), expose it as `transported_scopes`, and render a "Transported scopes" row in the node-detail sidebar. - store: add StoreTx.ScopeName, populated (gated by db.hasScopeName) in all four loader paths — Load, loadChunk, IngestNewFromDB and the chunked scanAndMergeChunk. scope_name is appended as the last selected column so the conditional scan-arg order stays stable. - enrich: add RepeaterRelayInfo.TransportedScopes; accumulate in both the bulk computeRepeaterRelayInfoMap and the per-node computeRelayInfoFromEntries (threaded via relayEntry). Scope accumulation is NOT time-windowed (unlike relayCount1h/24h) and is taken before the timestamp-parse gate. - routes: emit transported_scopes on /api/nodes and node detail only when non-empty, so the field is absent for no-scope nodes and on schemas without the column (hasScopeName=false). - web: render a gated "Transported scopes" badge row in nodes.js. - test: transported_scopes_1751_test.go covers bulk dedup/sort/advert exclusion, per-node parity, and the empty-when-no-scope contract.
3c3c9c5 to
93b4a0b
Compare
🤖 Hourly PR-watch review (round 1)Verdict: APPROVE-WITH-CONCERNS — CI gated on operator workflow approval (first-time-contributor Surfaces Reviewed by: carmack (backend) + munger (semantics) + kent-beck (TDD gate) + tufte (sidebar render). Local verification
FindingsCarmack (backend)
Munger (semantics / footguns)
Kent Beck (TDD gate)
Tufte (sidebar render)
TDD verdictSame-commit test+impl is the only structural concern, and it's comment-only for a community PR per project policy. Subsequent ranking/behavior changes from this contributor would benefit from the red-then-green split. 3-axis merge gate
Operator action required
— Not auto-merging (BLOCKED). Not auto-fix-spawning (community author, no prior signal). Comment-only per watcher policy. |
…e cap, fold test, badge wrap) Follow-up to the Kpa-clawbot#1751 PR-watch review (4 MINOR / 2 NIT, none gating): - Carmack (MINOR): lazily allocate the bulk-path scopeSet on first scope hit (was unconditional per byPathHop key) — hosts without scope_name now pay nothing per key. Factored the set->sorted-slice logic into a shared sortedCappedScopes() helper so the bulk and per-node paths stay in exact parity. - Munger (MINOR): soft-cap TransportedScopes at maxTransportedScopes (32), keeping the lexicographically-first names, so a flood of distinct scope names through one repeater can't inflate the node JSON unboundedly. - Kent Beck (MINOR): add TestTransportedScopes_CrossBucketFold covering the 1-byte prefix-bucket fold (a scope seen only in the prefix bucket surfaces on the full-pubkey key; a tx in both buckets is not double-counted). Add TestTransportedScopes_Capped for the new cap. - Kent Beck (NIT): scopeTx hash now uses strconv.Itoa(id) instead of time.Duration(id).String() (which read as "1ns"/"2ns"). - Tufte (MINOR+NIT): render scope badges in a single inline-flex wrapper with gap + flex-wrap instead of a per-badge inline margin — DRYs the markup and wraps gracefully when a repeater carries many scopes.
Closes #1751.