Skip to content

OW5k: a client finds the relay's world document in a world pack - #1470

Merged
transfix merged 1 commit into
feat/one-world-ow5jfrom
feat/one-world-ow5k
Nov 23, 2026
Merged

transfix merged 1 commit into
feat/one-world-ow5jfrom
feat/one-world-ow5k

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW5's eleventh slice and AD1's first (ARIADNE_WORLDS.md §12, §18.5). A client that doesn't ship the relay's world document can now build the relay's world from a world pack it was pointed at. Until now only a client that resolved the room's URI to the same bytes could; any other fell back to the room scene's statics. Stacked on #1469.

What changed

  • cvc::ariadne::world_pack (new, world_pack.h): a pack as a directory, with an index at its root, world-pack.index.
    • One line per file: <sha256> <size> <path>, the path relative to the root.
    • find(sha256) gives the file with that content. verify() checks every listed file's size and SHA-256.
    • The index is refused if a path leaves the pack, a hash is malformed, or a path is listed twice.
    • write_world_pack_index(dir) writes the index for every file under a directory.
  • Pointing a client at packs: CVC_WORLD_PACKS (directories, separated as PATH's are) when a world_replica is made, then world_replica::add_pack.
  • world_replica: when the room's URI doesn't resolve to the relay's bytes, it looks up the SHA-256 the room names (room_world_source) in its packs, in order.
    • It loads the document from the first pack that lists it and whose files all match the index. The document's assets resolve inside that pack.
    • A pack with a file that differs from its index is refused, so it can't substitute content. The replica's status names that file.

Tests

  • AriadneOneWorld.AClientFindsTheRelaysDocumentInAWorldPack:
    • A pack written by write_world_pack_index lists its files sorted, with their hashes and sizes, and find works in either case.
    • A replica whose room names a document it doesn't ship isn't ready ("not here"). With the pack added (after a directory that isn't a pack, which it passes over), it builds the dome from the pack.
    • With one of the pack's files edited, the pack is refused, and the status names the file.
    • An index with a path out of the pack, or a bad hash, is refused, and so is a directory with no index.
    • CVC_WORLD_PACKS is read as PATH is.
  • Locally, these suites pass: scene world 125, holon sync 39, holon 54, room scene 21, room intrinsics 21. arigl builds.

Not done yet (the rest of §12)

  • Packs from a cvcpkg package or an archive at a URL.
  • Packs named in a viewer document or by a command-line flag.
  • The relay deployed with a pack.
  • The manifest's priorities.
  • Fetching what no pack has from the relay.

There's no command-line tool yet to write an index; write_world_pack_index is the function.

Not verified

  • Hashing reads each file whole, once per source change. I haven't measured this on a large pack (a DEM, many meshes).
  • I haven't run it live. arigl's replica (world_replica_ in src/arigl/main.cpp) reads CVC_WORLD_PACKS when it is made, so CVC_WORLD_PACKS=<dir> arigl ... should build the relay's world from a pack, but I haven't tried it against a relay.

ARIADNE_WORLDS.md sections 12 and 18.5, AD1's first slice. world_pack (world_pack.h) is a
directory with an index, world-pack.index: one "<sha256> <size> <path>" line per file.
write_world_pack_index writes one. world_replica looks in the packs it is pointed at
(CVC_WORLD_PACKS, add_pack) when the room's document URI does not give the relay's bytes here. It
finds the document by the room's SHA-256, in the first pack that lists it and whose files all
match the index, and builds the world from there. A pack with a file that differs from its index
is refused, and the status says which.
@transfix
transfix merged commit e91f7cc into feat/one-world-ow5j Nov 23, 2026
6 checks passed
@transfix
transfix deleted the feat/one-world-ow5k branch November 23, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant