Repository navigation
OW5k: a client finds the relay's world document in a world pack - #1470
Merged
Merged
Conversation
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.
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.<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.write_world_pack_index(dir)writes the index for every file under a directory.CVC_WORLD_PACKS(directories, separated as PATH's are) when aworld_replicais made, thenworld_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.Tests
AriadneOneWorld.AClientFindsTheRelaysDocumentInAWorldPack:write_world_pack_indexlists its files sorted, with their hashes and sizes, andfindworks in either case.CVC_WORLD_PACKSis read as PATH is.Not done yet (the rest of §12)
There's no command-line tool yet to write an index;
write_world_pack_indexis the function.Not verified
world_replica_insrc/arigl/main.cpp) readsCVC_WORLD_PACKSwhen it is made, soCVC_WORLD_PACKS=<dir> arigl ...should build the relay's world from a pack, but I haven't tried it against a relay.