Files
bare-operating-system/packages/bare-os-protocol
Raven Scott 64a1270d18 - disk.os: replication_operator_sketch schema 7 + corestoreSnapshotUxHint; wire corestore into bridge
- HRPC: bare_os.pkg_index_get, route table schema 3; pkg-swarm-index list/get; pathcap-verify --trusted
- POSIX: profile 1.0.17, ctx API 1.53.0, syscalls.json schema 11 + susv4Refs; JSON schemas + matrix/dashboard
- Feature bits: BARE_OS_KERNEL_FEATURE_BITS_DOC 16; contract + verify scripts; ctx.d.ts + gen helper sync
- Ops: BARE_OS_HOLEPUNCH_DRIFT_TIER1 + tier1Repos; mktemp avoids false XXX marker; /proc boot_budget_summary test list
- Docs: contract spine, env appendix, handbook, compatibility matrix, boot budget schema, vault threat model notes

Covers bare-os P2P roadmap items 1–20 where implemented in-tree; kernel/lib/bare/README left minimal per maintainer edit.
2026-04-05 15:52:59 -04:00
..
2026-04-04 08:31:39 -04:00

bare-os-protocol

Shared wire format and constants for the Bare operating system monorepo: Hyperswarm topic, 512-byte MBR layout, and Protomux bare-os-v1 seed-channel message shapes.

Documentation: Protocol reference · Kernel extensions · Handbook ch.3.

What it provides

  • PROTOCOL_NAME, TOPIC_STRING — Protomux channel name and swarm topic input string (bare-os-v1)
  • topicKey() — 32-byte topic for swarm.join()
  • BLOCK_SIZE, MBR_MAGIC — 512-byte MBR, magic BIOS at offset 0
  • buildMbr / parseMbr — Pack/unpack primary + optional failover Hyperdrive keys
  • setupSeedChannel — Wire Protomux messages 06 for RAM block reads, gossip bitfield, manifest path search, RPC (incl. bare_os.capabilities with bitsbits11 when non-zero, typed errors for unknown RPC methods, bare_os.replication_status, bare_os.replication_queue, extended RPC short names in seed-rpc-methods.js, bare_os.gossip), and drive.replicate

Subpath exports: bare-os-protocol/constants.js, bare-os-protocol/messages (compact-encoding schemas), bare-os-protocol/kernel-feature-bits.js (documented booter capability words BARE_OS_KERNEL_FEATURES_STOCK_WORD_*; BARE_OS_KERNEL_FEATURE_BITS_DOC=14; surfaced in /proc/bare_os_features and /proc/bare_os/), bare-os-protocol/lib/seed-rpc-methods.js (authoritative bare_os.* RPC name list for kernel_info), bare-os-protocol/protocol-meta.js (BARE_OS_PROTOCOL_PACKAGE_VERSION for the seed handshake).

Consumers

  • bare-os-seeder — builds MBR, serves block 0 over the channel, replicates the system Hyperdrive.
  • bare-os-booter — parses MBR from SwarmDisk, opens system drives, uses the same channel on the client side.

Tests

npm test -w bare-os-protocol

Runs brittle-bare against test.js (topic stability, MBR roundtrip, encodings).

Dependencies

b4a, compact-encoding, hypercore-crypto (via constants/topic). No Hyperdrive or Hyperswarm here — this package stays small and testable.

See also