This commit is contained in:
Raven Scott
2026-05-20 22:56:32 -04:00
parent b8c335adee
commit dd384eb944
321 changed files with 7484 additions and 3793 deletions
@@ -1,15 +1,25 @@
# hyper-p2p-inverted-index architecture
# Architecture: hyper-p2p-inverted-index
**Tier:** scaffold · **Category:** `indexes-search`
**Category:** indexes-search
## Role
```mermaid
flowchart LR
App[Application] --> Mod[HyperP2PInvertedIndex]
Mod --> Mux[Protomux inverted-index/v1]
Mux --> Swarm[Hyperswarm]
```
Inverted index (local + gossip).
## Wire messages
| type | fields | behavior |
|------|--------|----------|
| `term-index-sync` | `op`, `term`, `docId`, `peer`, `at` | Merge add/remove postings |
## State model
- `_terms`: `Map<term, Set<docId>>`
- `_docs`: `Map<docId, Set<term>>` for efficient removal
## Composition
Uses `../../_shared/p2p-bare.js` for Hyperswarm + Protomux when implemented. Does **not** duplicate Holepunch core storage/transport.
## Holepunch boundary
Inspiration: n/a
Uses `../../_shared/p2p-bare.js` (`initModuleSwarm`, `gossipSend`).