Add storage stack modules and track them in git

The modules workspace previously ignored every path matching `storage-*`,
which kept all Hypercore, Hyperbee, Hyperdrive, and Autobase packages out
of version control. Narrow .gitignore to test-artifact patterns only so
production category trees are committed.

Storage packages (23 total):
- storage-hypercore (7): replicator, seed-policy, fork-picker, merkle-sync,
  priority-fetch, bitfield-scheduler, audit-chain
- storage-hyperbee (5): batch-write, diff-follow, range-watch,
  secondary-index, tombstone-gc
- storage-hyperdrive (6): entry-catalog, gc-sweep, mirror-sync, mount-bridge,
  version-snapshot, watch-notify
- storage-autobase (5): fork-choice, view-sync, writer-lease, indexer-bus,
  light-writer

Implementation highlights:
- Shared attach/gossip helpers in _shared/storage-gossip-base.js
- P2P modules use Protomux gossip via p2p-bare; local planners omit swarm
- Recent deepen pass: priority queues, batch caps, audit export/import,
  watch/notify aliases on range-watch, fork/view lease helpers, etc.
- Per-package README, docs/api.md, docs/architecture.md, tests, examples

Also update modules/README.md doc hub links for the full storage stack
(hypercore, hyperbee, hyperdrive, autobase).

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 00:17:51 -04:00
co-authored by Cursor
parent b10507b060
commit a11e22badc
214 changed files with 57132 additions and 5 deletions
@@ -0,0 +1,40 @@
require('bare-process/global')
const test = require('brittle')
const { HyperP2PDriveEntryCatalog, PROTOCOL } = require('../index.js')
const mockDrive = { get: async () => null, readdir: async () => [] }
test('exports', (t) => {
t.ok(HyperP2PDriveEntryCatalog)
t.is(PROTOCOL, 'drive-entry-catalog/v1')
})
test('catalogEntry lookupEntry searchPrefix', async (t) => {
const m = new HyperP2PDriveEntryCatalog()
m.attach(mockDrive)
m.catalogEntry('/docs/a.txt', { size: 10 })
m.catalogEntry('/docs/b.txt', { size: 20 })
t.ok(m.lookupEntry('/docs/a.txt'))
t.is(m.searchPrefix('/docs').length, 2)
await m.close()
})
test('validation', async (t) => {
const m = new HyperP2PDriveEntryCatalog()
try { m.attach(null) } catch (e) { t.ok(e) }
try { m.catalogEntry(null) } catch (e) { t.ok(e) }
await m.close()
})
test('listEntries', async (t) => {
const m = new HyperP2PDriveEntryCatalog()
m.catalogEntry('/x', {})
t.is(m.listEntries().length, 1)
await m.close()
})
test('getStats', async (t) => {
const m = new HyperP2PDriveEntryCatalog()
t.is(m.getStats().protocol, 'drive-entry-catalog/v1')
await m.close()
})