Files
bare-operating-system/packages/bare-os-protocol
Raven Scott de176addd9 feat(bare-os): kernel wave 3 — bits3, seed RPCs, policy, proc, CI schemas
Add third capability word (STOCK_V3) and word2 tail bits; seed RPCs
snapshot_hints and peer_firewall_stats; /proc mirrors (snapshot_hints,
pear_trust, rlimits, hdms_health, initd_graph) and /proc/net/udp; boot
policy v3 (requireFeatureBits2/3, Pear IPC allowlist, VFS deny prefixes,
initd restart cap); VFS enforcement for boot-policy path denies; delegate
in-flight caps; gated shell local/declare; initd path conditions, ordered
suspend/resume, OnInactiveSec timers; vfs.watch swarm/replication;
validate-example-schemas.mjs + ajv in pretest; extend verify-ctx for V3;
bump ctx API to 1.12.0; ADR 001, protocol, handbook, dev-guide, and
reference docs; seeder/kernel parity and booter tests.

Chore: Prettier table alignment in CHANGELOG and READMEs; compact
bareOsRequestPearReload signature in bare-os-ctx.d.ts.
2026-04-04 02:34:21 -04:00
..
2026-04-02 21:38:07 -04:00
2026-04-04 01:20:57 -04:00
2026-04-02 21:38:07 -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.

What it provides

Export (from index.js) Role
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 bits/bits2/bits3, bare_os.replication_status, bare_os.replication_queue, bare_os.capability_attestation, bare_os.mbr_layout, bare_os.manifest_hints, bare_os.peer_health, bare_os.staging_slot, bare_os.snapshot_hints, bare_os.peer_firewall_stats, 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 STOCK_V1 / STOCK_V2 / STOCK_V3; surfaced in /proc/bare_os_features and /proc/bare_os/), 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