Giant pass: storage API docs, trust/consensus/routing code, category guides

Complete manual documentation cleanup for the storage stack and expand
category-level guides across the library.

Documentation (23 storage modules):
- Rewrite Methods sections in all storage-hypercore, storage-hyperbee,
  storage-autobase, and storage-hyperdrive api.md files from index.js
- Remove every "module-specific (see implementation)" placeholder in storage
- Fix bitfield-scheduler, bee-batch-write, bee-range-watch, drive-gc-sweep APIs

Category READMEs (modules/):
- trust-security, consensus-coordination, routing-advanced — tables + hub links
- MODULE_CATEGORIES.md typo fix (scaffold tier description)

Code:
- hyper-p2p-trust-graph: hasEdge(), nodeCount(), getStats with protocol
- hyper-p2p-circuit-breaker: listCircuitIds(), reset()
- hyper-p2p-distributed-lock: getStats merges metrics + active lock counts

Parent workspace (not in this repo) also received doc hubs for all 29
categories in docs/README.md and MODULE_DOC_PASS.md giant-pass tracker.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 00:27:46 -04:00
co-authored by Cursor
parent e43e2e83f1
commit 7cb1612e71
27 changed files with 459 additions and 682 deletions
@@ -22,54 +22,42 @@ const mod = new HyperP2PDriveMirrorSync(opts)
## Methods
### `attach(…)`
### `attach(drive) → this`
- **Returns:** module-specific (see implementation)
Validates drive via `assertDrive`.
- **Throws:** — (none in method body)
### `queueMirror(path, srcDriveKey) → op`
### `queueMirror(…)`
Enqueues `{ path, srcDriveKey, state: 'queued', at }` and tracks progress. Gossip `mirror-queue`.
- **Returns:** module-specific (see implementation)
- **Throws:** `ValidationError` (`path is required`, `srcDriveKey is required`)
- **Throws:** — (none in method body)
### `mirrorProgress(path?) → object | null`
### `mirrorProgress(…)`
- **Returns:** progress for one path, or `Object.fromEntries(_progress)` when `path` is omitted
- **Returns:** module-specific (see implementation)
### `applyMirrorOp(op) → entry`
- **Throws:** — (none in method body)
Marks path `done` with byte count. Emits `mirrored`.
### `applyMirrorOp(…)`
- **Returns:** `{ path, srcDriveKey, state: 'done', bytes, at }`
- **Throws:** `mirror op with path required`
- **Returns:** module-specific (see implementation)
### `drainQueue(max = 8) → op[]`
- **Throws:**
- `Error: mirror op with path required`
- **Returns:** up to `max` queued mirror ops (FIFO)
### `drainQueue(…)`
### `getStats() → object`
- **Returns:** module-specific (see implementation)
`{ queued, applied, gossipIn, gossipOut, pending, tracked, protocol }`.
- **Throws:** — (none in method body)
### `async ready() → this`
### `getStats(…)`
Joins gossip when `topic` is set; inbound `mirror-queue` appends remote ops.
- **Returns:** module-specific (see implementation)
### `async close() → void`
- **Throws:** — (none in method body)
### `ready(…)`
- **Returns:** module-specific (see implementation)
- **Throws:** — (none in method body)
### `close(…)`
- **Returns:** module-specific (see implementation)
- **Throws:** — (none in method body)
Destroys swarm, clears queue; emits `closed`.
## Events