feat: replicate thread membership and record merges #46
Reference in New Issue
Block a user
Delete Branch "feat/thread-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second half of #41. Threads replicate (#45), but arrived without their members — the replica could list a thread and not summarise it. 292 links on the server against 1,764 on the laptop.
Why membership was node-local
Two mechanisms, neither portable:
thread_observationsobservation_idprovenance_linksThreadFP(int thread id)The replicated fact is therefore the entry-level edge:
(thread_uid, entry_fingerprint), because entry fingerprints are already stable across nodes. Both local forms are materialised from it on arrival.Details
LinkDoc{thread_uid, entry_fp, relation, relevance, removed}, fingerprintsha256("thread_link:"+uid|fp|relation).knox thread emit-allnow backfills membership as well (1,764 edges on this index).Merges
MergeThreadssetssuperseded_by = successor uidand replicates both threads, so a peer resolves the merge instead of restoring the absorbed one.ThreadDoc.superseded_byround-trips through the log.Deadlock fixed
MergeThreadsresolved the successor uid inside its transaction. The pool is pinned to one connection, so that query waited on the transaction holding it — a hang, not an error, which is why the test run timed out rather than failed. Moved beforeBegin.Verification
go test ./...green: link survives a wipe-and-reproject; merge records the successor pointer and survives a rebuild from the logNot yet verified live: the post-deploy reprojection on dhg.lol — that needs the backfill pushed after CI lands the binary.