Provable non-corruption: the foundations of syn verify (v1.0)
| Field | Value |
|---|---|
| Date finalised | 2026-06-16 |
| Author | Rômulo Febasi romulo@febasi.com.br (3 specialised research subagents, web) |
| Scope | Whitepapers, projects, and theory for reproducible, auditable, testable non-corruption: to define the v1.0-hardening issues headlined by syn verify. |
| Status | accepted |
| Inputs | 3 parallel subagents (theory/whitepapers; real-systems prior-art; eval/testability), all web-enabled + repo-grounded. |
| Out of scope | Implementation (this brief defines the issues); multi-user/Commercial crypto (SYN-261). |
Executive summary
Every integrity system in the literature proves one of three things: (A) content integrity: this artifact is the one attested (hash/signature); (B) history integrity: the append-only log was not reordered, truncated, or rewritten (consistency proof); (C) derived-state integrity: the output was reproducibly derived from the input (deterministic rebuild). Synapse is uniquely positioned to prove all three at once, offline, per-fact, because the truth is the user’s Markdown in their git and the SQLite index is a pure function of it. A hosted competitor structurally cannot offer (C); there is no user-side source to reproduce from. syn verify operationalises the brand line “provable, not estimated” into a command that emits a signed, reproducible attestation. The governing discipline, inherited from the ADRs: borrow the invariant, refuse the engine (no servers, no heavy deps, deterministic over ML, tamper-evident not tamper-proof).
1. Theory → adoption verdict (condensed)
| Theory | Verdict | Use in Synapse |
|---|---|---|
| Merkle DAG / content-addressing (git, IPFS/IPLD) | ADOPT (have it via git) | Lean on git’s DAG (gix verify_checksum); per-fact payload_sha256 keyed to the introducing commit’s blob. Do not build a parallel Merkle tree. |
| CT / transparency-log inclusion + consistency proofs (RFC 6962/9162; Crosby–Wallach) | ADAPT the proofs, reject the network | “Is this fact in history” (inclusion) + “history B is an unmodified prefix of A” (consistency) computed over git topology. |
| Transparent logs for skeptical clients (Cox tlog; Go sumdb; Sigsum) | ADAPT | A cached signed checkpoint ({head, count, root, sig}); verify the current state extends it: “the verifier is the log operator” = the offline single-user case. |
| Reproducible builds (rebuild-and-compare; diffoscope) | ADOPT: the conceptual heart | The disposable index is a reproducible build of the Markdown: digest(reindex(md)) == digest(live). Compare a canonical logical manifest, not raw .db bytes. |
| Datomic/XTDB immutability + deterministic replay | ADOPT as invariant | “DB is a pure function of an immutable log”; supersession = invalidation-not-deletion; replay reconstructs state. |
| Property-based + metamorphic testing (beats the oracle problem) | ADOPT | No oracle for “memory is uncorrupted”, but strong oracles for “reindex twice == once” and “CLI == MCP”. |
| in-toto / SLSA / DSSE attestation | ADAPT the data model | The proof artifact = in-toto Statement shape (subject digest + predicate invariant table), signed with the existing ed25519 identity (reuse SYN-247 receipts; no new crypto). SLSA’s ladder is whitepaper framing only. |
git verify-commit + --allowed-signers | ADOPT (offline!) | Export me.synapse.json keys → .synapse/allowed_signers so git’s native verify path is Synapse’s: resolves ADR-030’s open allowlist question. |
| TLA+/Alloy/Stateright; Rekor/Fulcio; Trillian witness-nets; RDF/OWL PROV; IPFS/CID | INSPIRATION / REJECT | Single-writer (no concurrency to model-check at runtime); offline-first (no online OIDC/log server); git is already the Merkle DAG. Author invariants with them; don’t ship them. |
2. The invariants syn verify proves (the catalogue)
Each is deterministic (recomputable, no ML/judge) and contributes a line to the signed report.
- INV-1 Disposability / reindex fixpoint:
digest(reindex(markdown)) == digest(live index)over a canonical logical dump (ordered rows; rowids/FTS-internal/float-vectors excluded or pinned tomodel@precision). The keystone; the index is a reproducible build of the files. - INV-2 Content integrity: every fact’s
payload_sha256matches the Markdown blob at the commit that introduced it; no orphan facts, no orphan audit rows. - INV-3 History integrity: hash-chain (
seq/prev) + ed25519 signed checkpoint intact (Tier-2), or git DAG intact + per-author monotonic segments (Tier-1). (Shipped asaudit verify; formalise.) - INV-4 Reversibility: replaying the audit reconstructs the current store state (frontmatter-generic). (Riskiest: see §4.)
- INV-5 No silent corruption: no fact’s value changed without a recorded
x-supersedes+ an appended interval close (invalidation-not-deletion). The HaluMem <26%-auto-update failure made a provable invariant, the headline differentiator. - INV-6 Port parity: CLI ≡ MCP for every read (metamorphic; the AGENTS.md “two doors, one core” rule as a test).
- INV-7 Temporal correctness:
at <ref> -- search --as-of <date>reconstructs the state that held. (Seeded by SYN-258.) - INV-8 (opt) Round-trip:
import(export(w)) ≅ w.
Proof artifact: a signed synapse.verify-report/1 (in-toto-shaped): {subject:{workspace, git_ref, inputs_hash}, predicate:{tool_version, invariants:[{id,status,evidence}], checkpoint, witness_status, ts}, sig, pubkey}. Reproducible: anyone with the repo at git_ref re-runs syn verify and gets a bit-identical inputs_hash + the same verdicts.
3. Opportunities (white space, ranked)
- O1:
syn verify(headline). All three integrity classes, offline, exit-coded, signed report. Mostly assembly of shipped primitives (audit verify+reindex+at/--as-of) reframed as proofs → low new code, category-defining claim. - O2: Verifiable-rebuild attestation (
--rebuild). “Your memory is a reproducible build of your files; delete the index, rebuild it, get the same bits: if you can’t,syn verifytells you which fact.” Literally true, and uncopyable by a hosted store. - O3: Offline consistency proof + publishable witness (
syn audit witness+syn verify --since <ref>). Cache a signed tree-head; prove the current history is an append-only extension (git ancestry + segment-prefix hash) → catches history-rewrite locally, no remote. A published checkpoint lets a third party hold the owner to their history (recovers part of the witness property ADR-030 says only a remote gives). - O4: git as the trust root. Export identity →
.synapse/allowed_signers(git-native verify),gix verify_checksumfor the DAG. Resolves ADR-030’s open allowlist; no reinvention. - O5: The invariant harness (CI). proptest (already a dev-dep) + metamorphic + differential (CLI≡MCP) + fuzz the untrusted boundary. The “test-suite half” of SYN-253. Only new dep:
cargo-fuzz(opt-in, own ADR).
4. Critical caveats / risks (be honest)
- Honest ceiling: tamper-evident, not tamper-proof. A lone local clone cannot detect its own owner’s rewrite (no witness).
syn verifymust print the trust-root caveat (local-only vs remote-witnessed vs checkpoint-witnessed). The Memoir lesson: be specific where competitors hand-wave “cryptographically secure.” - Canonicalisation is the one real prerequisite. The index isn’t byte-deterministic (rowids, FTS internals, float vectors). Verify against a canonical logical manifest; spike it first (SYN-262).
- Replay (INV-4) rests on an unverified ADR-027 assumption (generic frontmatter reconstruction + supersession-close-as-append). Verify that before claiming
--deepreplay; else a frontmatter-generic replay refactor is needed first. - Don’t over-engineer. Reject Rekor/Fulcio/OIDC, Trillian/witness-nets, runtime model-checking, RDF/OWL, IPFS/CID. Borrow the invariant, refuse the engine.
5. Proposed v1.0 issues (next free SYN-262)
| ID | Title | AC (one line) |
|---|---|---|
| SYN-262 | core::verify engine + canonical logical-store dump (foundation + report schema ADR) | dump(ws) byte-stable across calls and a reindex --full |
| SYN-263 | syn verify runtime command + signed report (both doors): headline | clean ws exits 0 + signed report; corruption → exit 1 + offending invariant |
| SYN-264 | Port-parity differential suite (CLI ≡ MCP) | adding a door to one side without the other fails CI |
| SYN-265 | Invariant proptest suite (coherence + governance: I-1/2/3/5/7/9/10) | incremental ≡ full + round-trip over ≥256 cases |
| SYN-266 | Deterministic replay invariant + clock/identity seam (verify ADR-027 prereq first) | replay-into-empty == current store |
| SYN-267 | Stateful supersession + temporal proptest (I-8/11) | order-independence + bitemporal axis-independence |
| SYN-268 | Fuzz the untrusted boundary (proptest-first; cargo-fuzz opt-in + ADR) | arbitrary bytes never panic / never violate round-trip over ≥1024 cases |
| SYN-269 | Verifiable-rebuild attestation (syn verify --rebuild, diffoscope-style localized diff) | rebuild manifest mismatch names the diverging facts |
| SYN-270 | Witness checkpoint + offline consistency proof (syn audit witness, verify --since) | history-rewrite detected offline against a cached signed head |
Whitepaper/positioning (separate doc): “Provable non-corruption”: the invariants, the proof artifact, and a SLSA-style ladder (L1 audited → L2 hash-chained → L3 git-witnessed → L4 signed-identity).
6. Cross-check vs prior hypotheses
| Hypothesis | Status | Reason |
|---|---|---|
syn verify is genuine white space | validated | No precedent emits a signed, reproducible integrity report from a property/metamorphic harness for a local store (3 agents, web). |
| It’s mostly assembly of shipped primitives | validated | audit verify (content+chain), reindex (rebuild), at/--as-of (temporal), receipts (signing) already exist. |
| Crypto provenance is being commoditised | reinforced | Anthropic editable-Markdown-audit; Microsoft/MemLineage Ed25519+Merkle; Memoir “crypto integrity” (unspecified). Durable moat = local-first + per-fact + provable derived-state, not the primitives. |
| Replay is the hard part | validated | ADR-027’s generic-frontmatter assumption is unverified; gate SYN-266 on it. |