master-zapier-plan-draft/packages/zapier-user-docs/09-lookup-tree-nodes.md
George Lambert f3dc0e6eee
Some checks are pending
offline / test (push) Waiting to run
Add Zapier interface simulator, tree-node Merkle lookups, and user docs
In-process trace console validates hops, faults, recoveries, and
suggested changes before zapier-platform push. User guide covers
signup through central-chain and bulk-summary tree-node hash lookup.
2026-09-11 12:58:03 -04:00

31 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 9. Look up a hash on tree-node archives
Zapier search: **Find Hash (tree nodes + central chain)**.
Middleware: `GET /zapier/v1/hashes/{sha256}?includeAttached=true&includeTree=true`.
## Sequence (you never configure this)
1. Central chain lookup (same as chapter 6).
2. If itemized, return that seal (and attached metadata if requested).
3. If miss, middleware broadcasts `verae.archive.query` with `kinds: ["tree", …]` to **every** tree-node NATS server.
4. A node whose bloom filter does not contain the hash **stays silent**.
5. A node that holds the leaf replies on `verae.archive.reply.<correlationId>` with `{ merkleRoot, proof, leafIndex, chainSealJobId }`.
6. Middleware checks the proof against the root, loads the **roots** chain seal, and returns both receipts.
## Reading the result in a Zap
- `exists: true` and `itemizedOnMainChain: false` — this hash was in a bulk summary.
- `proofOk: true` — the leaf really is under `merkleRoot`.
- `receipts` includes `kind: seal` (of the root) and `kind: tree-leaf` (the proof).
- `archiveId` tells you which tree node answered (for support).
If every node is silent, the hash is unknown **or** the archive fleet is down. The simulator flags “all archives silent” when puts were known to exist; operators should treat that as an outage, not a miss.
## Zap pattern
1. Search: Find Hash (tree nodes + central chain).
2. Filter / Paths:
- Found + itemized → treat as a first-class seal.
- Found + not itemized → store Merkle proof + root certificate.
- Not found → optionally **Create Timestamp** to itemize it now.