mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-06-03 21:51:47 +00:00
0b35c7eef3
## Summary Follows the reconciliation recommendation in #916 — extracts only the NET-NEW persistence layer from that PR (which is now superseded by #1002 for the overlay UI) into a focused 6-file change against current master. **What this adds:** - `multibyte_sup_v1` migration: `multibyte_sup INTEGER NOT NULL DEFAULT 0` + `multibyte_evidence TEXT` on `nodes`/`inactive_nodes` so capability survives restart - `hasMultibyteSupCols` schema detection gates the persist/load paths - `loadMultibyteCapFromDB()`: pre-populates `mbCapSnapshot`/`mbCapIndex` at startup — cold starts serve last-known capability without waiting for the first ~15s analytics cycle - `maybePersistMultibyteCapability()` + `persistMultibyteCapability()`: after each analytics cycle; TryLock-gated (concurrent cycles coalesce); skips `sup==0` entries (data-destruction guard) - `GetMultibyteCapFor(pk)`: O(1) map lookup; both `handleNodes` and node-detail call sites updated from the O(N)-alloc `GetMultiByteCapMap()` **What this explicitly does NOT change:** - API field names (`multi_byte_status`, `multi_byte_evidence`, `multi_byte_max_hash_size`) - `EnrichNodeWithMultiByte` — unchanged - `GetMultiByteCapMap` — still present for any external callers - `public/map.js`, `public/live.css`, `Dockerfile`, `docs/` — zero frontend churn ## Test plan - [x] `TestMultibyteCapPersistRoundTrip` — confirmed values survive persist → fresh-store load - [x] `TestMultibyteCapPersistSkipsUnknown` — data-destruction guard: `sup==0` entry does not overwrite DB-confirmed value - [x] `TestMultibyteCapMaybePersistCoalesces` — TryLock coalesces 10 concurrent callers without deadlock - [x] `TestMultibyteCapGetMultibyteCapForO1` — O(1) index returns correct entry / false for unknown pubkey - [x] `TestMultibyteCapLoadFromDB` — only `sup>0` rows loaded; `sup==0` row excluded - [x] `TestSchemaMultibyteSupColumns` — migration adds columns to both tables; idempotent on second `OpenStore` - [x] All existing `TestMultiByteCapability_*` tests pass unchanged - [x] Full ingestor test suite: `ok` in 27s - [x] `go build ./cmd/server/ && go build ./cmd/ingestor/` clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: openclaw-bot <bot@openclaw>
52 lines
1.6 KiB
Modula-2
52 lines
1.6 KiB
Modula-2
module github.com/corescope/server
|
|
|
|
go 1.22
|
|
|
|
require (
|
|
github.com/gorilla/mux v1.8.1
|
|
github.com/gorilla/websocket v1.5.3
|
|
github.com/meshcore-analyzer/geofilter v0.0.0
|
|
github.com/meshcore-analyzer/sigvalidate v0.0.0
|
|
modernc.org/sqlite v1.34.5
|
|
)
|
|
|
|
replace github.com/meshcore-analyzer/geofilter => ../../internal/geofilter
|
|
|
|
replace github.com/meshcore-analyzer/sigvalidate => ../../internal/sigvalidate
|
|
|
|
require github.com/meshcore-analyzer/packetpath v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/packetpath => ../../internal/packetpath
|
|
|
|
require github.com/meshcore-analyzer/dbconfig v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/dbconfig => ../../internal/dbconfig
|
|
|
|
require github.com/meshcore-analyzer/perfio v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/perfio => ../../internal/perfio
|
|
|
|
require github.com/meshcore-analyzer/dbschema v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/dbschema => ../../internal/dbschema
|
|
|
|
require (
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/google/uuid v1.6.0 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
golang.org/x/sys v0.22.0 // indirect
|
|
modernc.org/libc v1.55.3 // indirect
|
|
modernc.org/mathutil v1.6.0 // indirect
|
|
modernc.org/memory v1.8.0 // indirect
|
|
)
|
|
|
|
require github.com/meshcore-analyzer/prunequeue v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/prunequeue => ../../internal/prunequeue
|
|
|
|
require github.com/meshcore-analyzer/mbcapqueue v0.0.0
|
|
|
|
replace github.com/meshcore-analyzer/mbcapqueue => ../../internal/mbcapqueue
|