Split NATS modules: splitter, WORM bloom archive, aggregator, docs-master
Some checks are pending
offline / test (push) Waiting to run

Each module has SUMMARY.md and NATS.md (who sends/receives, subject
addresses, payload). Tests: splitter 3, worm 3, aggregator 2.
Forgejo repos pushed separately; this commit keeps them in the monorepo.
This commit is contained in:
George Lambert 2026-09-11 12:33:40 -04:00
parent ca693366dc
commit 8f9707a3b7
39 changed files with 893 additions and 0 deletions

View file

@ -0,0 +1,11 @@
# verae-activate (Zapier Platform app)
**Job:** Private Zapier integration you push first. Actions run in Zapier cloud.
**Expects:** User connection (API key optional).
**Sends:** nothing if fields blank (Add Numbers / Echo / SHA256 / Create Timestamp local mock). If `api_base` + `api_key`, HTTPS to zappier-edge.
**Does not** speak NATS.
**Test:** `npm test`; `zapier-platform validate`.

View file

@ -0,0 +1,8 @@
# NATS — verae-archive-aggregator
| Direction | Address | Peer | Body |
|-----------|---------|------|------|
| OUT | `verae.archive.query` | all WORM | `{ correlationId, sha256, tenantId, kinds[], traceId }` |
| IN | `verae.archive.reply.<correlationId>` | WORM hits | `{ archiveId, sha256, records[] }` |
Stop collecting at `WAIT_ARCHIVE_MS`. Silent archives are listed in `silent[]`, not errors.

View file

@ -0,0 +1,11 @@
# verae-archive-aggregator
**Job:** If `includeAttached`, fan out archive query and merge replies into the job JSON.
**Expects:** wait-path flag from middleware-http; replies on `verae.archive.reply.<correlationId>`.
**Sends:** `verae.archive.query` to all WORM nodes.
**Timeout:** missing archives omit slices; chain receipt still succeeds.
**Test:** `npm test` — one silent bloom miss + one hit; merge seal + metadata-attach.

View file

@ -0,0 +1,9 @@
# NATS — verae-archive-worm
| Direction | Address | From / to | Body |
|-----------|---------|-----------|------|
| IN | `verae.archive.put` | splitter | `{ sha256, tenantId, kind, record, traceId }` |
| IN | `verae.archive.query` | aggregator (broadcast) | `{ correlationId, sha256, tenantId, kinds[], traceId }` |
| OUT | `verae.archive.reply.<correlationId>` | aggregator | `{ archiveId, sha256, records[], traceId }` **only if bloom.mightHave(sha256)** |
Subscribe to query **without** a shared queue group so every archive sees every query.

View file

@ -0,0 +1,14 @@
# verae-archive-worm
**Job:** Append-only WORM store of metadata and files. Bloom filter: miss → stay silent on NATS.
**Expects:**
- `verae.archive.put` — append record, add sha256 to bloom
- `verae.archive.query``{ correlationId, sha256, tenantId, kinds[] }` (every node sees this; **not** a shared queue group)
**Sends:**
- `verae.archive.reply.<correlationId>` **only on bloom hit**`{ archiveId, sha256, records[] }`
**Does not** write to the blockchain.
**Test:** `npm test` — miss is `null`; put then query returns records.

View file

@ -0,0 +1,8 @@
# NATS — verae-request-splitter
| Direction | Address | To | Body |
|-----------|---------|-----|------|
| OUT | `verae.archive.put` | each WORM | one message per publicMeta / privateMeta / file |
| OUT | (in-process) chain | middleware | `{ sha256, hashAlg, data? }` |
No inbound NATS in the in-process embedding.

View file

@ -0,0 +1,13 @@
# verae-request-splitter
**Job:** Peel a request into (1) chain hash and (2) off-chain archive puts.
**Expects messages from:** middleware-http (in-process call today; later NATS `verae.splitter.in` if split out).
**Sends messages to:**
- Chain path: `{ sha256, hashAlg, data? }`
- `verae.archive.put` for each `publicMeta` / `privateMeta` / `file`
**Does not talk to Zapier or NATS job poller.**
**Test:** `npm test` — hash-only has zero puts; two files + public meta → 3 puts.

View file

@ -0,0 +1,9 @@
# NATS — verae-middleware
| Direction | Address | Peer | Body |
|-----------|---------|------|------|
| OUT | `verae.zapier.jobs.watch` | job-poller | job watch payload |
| IN | `verae.zapier.jobs.events` | waiter | terminal status |
| OUT | (via aggregator) `verae.archive.query` | WORM | attached lookup |
HTTP remains the only Zapier-facing surface.

View file

@ -0,0 +1,15 @@
# verae-middleware (HTTP edge)
**Job:** Public `/zapier/v1/*`. Auth, entitlements, timestamp/wait, hash lookup, objects, receipts. Publishes NATS jobs; waits on events.
**Expects HTTPS from:** zappier-edge (or Zapier if pointed here).
**Sends:**
- HTTPS to verae-chain-client (`/api/timestamp`, `/api/status`, `/api/verify`)
- `verae.zapier.jobs.watch` after create
- waits `verae.zapier.jobs.events`
- splitter + aggregator when attachments / `includeAttached`
**Returns to requestor:** 202 `{ jobId }` or wait JSON (completed / pending+jobId).
**NATS:** never exposed to Zapier.

View file

@ -0,0 +1,9 @@
# verae-zapier-app
**Job:** Full Zapier CLI app: timestamp, wait, verify, batch, job status, hash lookup, REST Hook.
**Expects:** `zmw_` middleware key (today) or zappier key after composition.
**Sends:** HTTPS to middleware `/zapier/v1/*`.
**Does not** speak NATS.

View file

@ -0,0 +1,11 @@
# zappier-edge
**Job:** Metered commercial API, portal, admin, Stripe. Zapiers only public HTTPS hop.
**Expects:** Zapier Platform app with `x-api-key`.
**Sends:** HTTPS to middleware `/zapier/v1/*` (or local mock `/v1/timestamp`, `/v1/add`, `/v1/hashes`, `/v1/receipts`).
**Does not** speak NATS or `api.veraetime.net`.
**Test:** `npm test` (Jest, 177+).