v2.0.0: claims model - signed MMUR2 votes in a truth DB, merged view in a rebuildable cache DB; POST /api/claims, claims and merge routes, unsigned writes answer 410
Build and Push Docker Image / build (push) Successful in 5m1s

This commit is contained in:
Worph
2026-10-25 17:36:00 +00:00
parent b0adefb97b
commit 84af298792
78 changed files with 7203 additions and 5617 deletions
+5 -3
View File
@@ -1,21 +1,23 @@
# search-parity
Regression check for `POST /api/metadata/search` against a running meta-core.
Since v2.0.0 it reads the merged view from the cache database
(`/meta-core/db-cache/cache.db`), which keeps the v1 `file:<rid>/<field>` layout.
- `parity.py <meta-core.db>` builds ~230 queries from real records (free text,
- `parity.py <cache.db>` builds ~230 queries from real records (free text,
short tokens, key-set and flat filters, exact/contains, multi-filter). It
computes each query's expected result by brute force: one streaming pass
over every record, using a port of the Go matchers. Then it diffs that
against the live API. Any `lost` result means the SQL candidate superset
dropped a real match.
- `timing.py [meta-core.db]` times the same query set at limit 100 and 2000.
- `timing.py [cache.db]` times the same query set at limit 100 and 2000.
Run them inside the container. It has python3 and reads the database
read-only:
```bash
docker cp tools/search-parity metacore-app:/tmp/sp
docker exec metacore-app python3 -u /tmp/sp/parity.py /meta-core/db/meta-core.db
docker exec metacore-app python3 -u /tmp/sp/parity.py /meta-core/db-cache/cache.db
docker exec metacore-app python3 -u /tmp/sp/timing.py
```
+6 -2
View File
@@ -1,6 +1,10 @@
"""Search parity check for the meta-core Redis -> SQLite cut-over.
"""Search parity check for meta-core search.
parity.py <meta-core.db>
parity.py <cache.db>
Since v2.0.0 the searchable records are the MERGED view, kept in the cache
database's kv table under the v1 layout (file:<rid>/<field>, idx:roots/<rid>):
point this at /meta-core/db-cache/cache.db, not the truth database.
Builds a query set from real records, computes the EXPECTED result of each
query by brute force — one streaming pass over every record in the database,
+1 -1
View File
@@ -1,6 +1,6 @@
import importlib.util, json, sqlite3, sys, time
spec = importlib.util.spec_from_file_location("parity", "/tmp/parity.py")
sys.argv = ["parity", "/meta-core/db/meta-core.db"]
sys.argv = ["parity", sys.argv[1] if len(sys.argv) > 1 else "/meta-core/db-cache/cache.db"]
src = open("/tmp/parity.py").read().replace("\nmain()\n", "\n")
ns = {}
exec(compile(src, "parity", "exec"), ns)