Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/id/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions pkgs/id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ world = [
"dep:rmp-serde",
"id-core/world",
]
ssh = ["world", "dep:russh"]
ssh = ["world", "id-worlds/ssh"]
web = [
"world",
"dep:axum",
Expand Down Expand Up @@ -181,7 +181,8 @@ scrypt = { version = "0.12", optional = true }
subtle = { version = "2", optional = true }
# wasmtime moved to id-worlds in step 5b of the crate split (#4408):
# the `sandbox` feature above forwards to `id-worlds/sandbox`.
russh = { version = "=0.65.0", optional = true }
# russh moved to id-worlds in step 5c of the crate split (#4408):
# the `ssh` feature above forwards to `id-worlds/ssh`.

[dev-dependencies]
# Paused-time session-driver tests. Dev only.
Expand All @@ -204,7 +205,11 @@ id-sync = { path = "crates/id-sync", default-features = false, features = [
rusqlite = { version = "0.32", features = ["bundled"] }
wat = "=1.261.0"
tokio-tungstenite = "0.29"
vt100 = "=0.16.2"
# vt100 moved to id-worlds (dev) with world_ssh in step 5c (#4408).
# The CLI integration tests drive an SSH client against the world SSH
# server; the server side (and its russh) lives in id-worlds since
# step 5c, so the facade keeps russh for its tests only.
russh = "=0.65.0"
proptest = "1.12"
# Interop vectors for the canonical CBOR of event headers. Dev only.
dcbor = "=0.25.2"
Expand Down
8 changes: 8 additions & 0 deletions pkgs/id/crates/id-worlds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ license = "MIT OR Apache-2.0"
#
# Step 5a brought the leaves, seam 6's cross-world bridge
# (`groups::worlds`) and the blob gate's `FoldedWorlds` adapter.
# Step 5b brought the runtime core, and step 5c the remainder
# (`world_dev`, `world_doctor`, `world_ssh`, `world_replication_net`).
#
# Step 5b brings the runtime core: `world`, `world_session`, the
# sandbox and its compile/fixture/native paths, the hub, net and
# store, `world_records` and `shell_contract` — and, with them, the
Expand All @@ -37,6 +40,9 @@ default = []
# The wasmtime dependency lives inside id-worlds (design feature
# mapping); the facade's `sandbox` feature forwards here.
sandbox = ["dep:wasmtime", "id-caps/sandbox", "id-core/sandbox"]
# The russh dependency lives inside id-worlds (design feature
# mapping); the facade `ssh` feature forwards here.
ssh = ["dep:russh"]

[dependencies]
anyhow = "1"
Expand All @@ -60,6 +66,7 @@ libc = "0.2"
p2panda-core = { git = "https://github.com/p2panda/p2panda", rev = "da80c05b95269926bf58121cf6a2d3dd5ca41dfc" }
postcard = { version = "1", features = ["alloc"] }
rand = "0.10"
russh = { version = "=0.65.0", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.11"
Expand All @@ -86,6 +93,7 @@ id-sync = { path = "../id-sync", default-features = false, features = [
proptest = "1.12"
tokio = { version = "1", features = ["test-util"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
vt100 = "=0.16.2"
wat = "=1.261.0"

[lints.rust]
Expand Down
6 changes: 6 additions & 0 deletions pkgs/id/crates/id-worlds/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ pub mod sandbox;
mod session_host;
pub mod shell_contract;
pub mod world;
#[cfg(feature = "sandbox")]
pub mod world_dev;
pub mod world_doctor;
pub mod world_cache;
pub mod world_compile;
pub mod world_fixture;
Expand All @@ -57,7 +60,10 @@ pub mod world_line;
pub mod world_native;
pub mod world_net;
pub mod world_records;
pub mod world_replication_net;
pub mod world_session;
#[cfg(feature = "ssh")]
pub mod world_ssh;
pub mod world_store;
pub mod world_terminal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ mod tests {
// start at the compiled program's initial state, apply inputs
// through the actor, and leave nothing behind for the next
// launch (disposability / no remote side effects).
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let world = DevScratchWorld::launch(wasm, 7).await.unwrap();
assert!(
world
Expand Down Expand Up @@ -1957,7 +1957,7 @@ mod tests {
// Oracle: the fixture's recorded expectation is the live
// counter world's records after the same inputs; a candidate
// that replays to those records matches and does not block.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let (fixture, _) =
counter_fixture(wasm, Some(crate::world_session::module_hash(wasm))).await;
let gate = fixture_gate(wasm, 7, "counter.jsonl", &fixture).unwrap();
Expand All @@ -1973,7 +1973,7 @@ mod tests {
// Oracle: the same fixture with a tampered expectation — the
// replayed records cannot equal it, so the gate mismatches
// and blocks promotion (the design's promotion-gate case).
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let (mut fixture, _) =
counter_fixture(wasm, Some(crate::world_session::module_hash(wasm))).await;
fixture
Expand All @@ -1994,7 +1994,7 @@ mod tests {
// dev (ordinary replay/verify refuse via check_module), the
// gate reports the cross-module fact, and the comparison
// itself still decides promotion.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let other = crate::world_session::module_hash(b"a different module entirely");
let (fixture, _) = counter_fixture(wasm, Some(other)).await;
let gate = fixture_gate(wasm, 7, "counter.jsonl", &fixture).unwrap();
Expand All @@ -2008,7 +2008,7 @@ mod tests {
// Oracle: a fixture that records no expected records has
// nothing to compare — the gate must say not_compared with
// the reason instead of passing silently, and must not block.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let (mut fixture, _) =
counter_fixture(wasm, Some(crate::world_session::module_hash(wasm))).await;
fixture.header.records = None;
Expand Down Expand Up @@ -2375,7 +2375,7 @@ mod fuzz_tests {
// counts cannot break within one case (a case applies at
// most MAX_FUZZ_SEQUENCE inputs, so count <= 64 < 1000):
// the campaign must run the whole budget and find nothing.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let decl = counter_decl(vec![
FuzzInvariant::NoTrap,
FuzzInvariant::RecordsValidJson,
Expand Down Expand Up @@ -2451,7 +2451,7 @@ mod fuzz_tests {
// the reported counterexample must replay to the violation:
// applying the reported inputs to a fresh world reaches
// count = 3, the first value above the bound.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let decl = counter_decl(vec![FuzzInvariant::NumericBounds {
key: "count".to_owned(),
min: Some(serde_json::Number::from(0)),
Expand Down Expand Up @@ -2576,7 +2576,7 @@ mod watch_tests {
// built from the current snapshot must promote, bump the
// F12.9 version, and keep count=2 live — a restart-from-zero
// (count=0) would prove the swap discarded the state.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let mut session = DevSession::launch(wasm, 7, "snap-a".to_owned())
.await
.unwrap();
Expand Down Expand Up @@ -2611,7 +2611,7 @@ mod watch_tests {
// while the sources already sit at snap-c is discarded
// without touching the active world, and the discard is
// recorded in the last-good diagnostics.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let mut session = DevSession::launch(wasm, 7, "snap-a".to_owned())
.await
.unwrap();
Expand All @@ -2635,7 +2635,7 @@ mod watch_tests {
// whose recorded expectation the candidate cannot reproduce
// blocks the swap; the active world keeps its records and
// version.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let mut session = DevSession::launch(wasm, 7, "snap-a".to_owned())
.await
.unwrap();
Expand Down Expand Up @@ -2680,7 +2680,7 @@ mod watch_tests {
async fn promote_keeps_last_good_when_the_candidate_cannot_launch() {
// Oracle: invariant 3 for the launch stage — module bytes
// the sandbox refuses never become the active program.
let wasm = include_bytes!("../examples/roc-counter/counter.wasm");
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm");
let mut session = DevSession::launch(wasm, 7, "snap-a".to_owned())
.await
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3655,7 +3655,7 @@ mod tests {
let blobs: iroh_blobs::api::Store = MemStore::new().into();
let world = WorldHandle::spawn(WorldCore::new("lobby", WorldLimits::default()).unwrap());
let service = WorldService::new(world, Some("admin".to_owned())).with_blob_store(blobs);
let wasm = include_bytes!("../examples/roc-counter/counter.wasm").to_vec();
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm").to_vec();
let hash = crate::world_session::module_hash(&wasm);
service
.install_wasm(Some("admin"), wasm, 99, &hash)
Expand Down Expand Up @@ -3771,7 +3771,7 @@ mod tests {
let blobs: iroh_blobs::api::Store = MemStore::new().into();
let world = WorldHandle::spawn(WorldCore::new("lobby", WorldLimits::default()).unwrap());
let service = WorldService::new(world, Some("admin".to_owned())).with_blob_store(blobs);
let wasm = include_bytes!("../examples/roc-counter/counter.wasm").to_vec();
let wasm = include_bytes!("../../../examples/roc-counter/counter.wasm").to_vec();
let hash = crate::world_session::module_hash(&wasm);
service
.install_wasm(Some("admin"), wasm, 99, &hash)
Expand Down
8 changes: 4 additions & 4 deletions pkgs/id/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ pub mod repl;
#[cfg(feature = "sandbox")]
pub use id_worlds::sandbox;
#[cfg(feature = "sandbox")]
pub mod world_dev;
pub use id_worlds::world_dev;
pub use id_store::search;
#[cfg(feature = "world")]
pub mod seitan;
Expand Down Expand Up @@ -263,7 +263,7 @@ pub use id_caps::world_caps;
pub use id_worlds::world_cache;
pub use id_worlds::world_compile;
#[cfg(feature = "world")]
pub mod world_doctor;
pub use id_worlds::world_doctor;
#[cfg(feature = "world")]
pub use id_worlds::world_fixture;

Expand All @@ -278,15 +278,15 @@ pub use id_worlds::world_native;
#[cfg(feature = "world")]
pub use id_worlds::world_net;
#[cfg(feature = "world")]
pub mod world_replication_net;
pub use id_worlds::world_replication_net;
#[cfg(feature = "world")]
pub use id_core::world_presentation;
#[cfg(feature = "world")]
pub use id_worlds::world_records;
#[cfg(feature = "world")]
pub use id_worlds::world_session;
#[cfg(feature = "ssh")]
pub mod world_ssh;
pub use id_worlds::world_ssh;
#[cfg(feature = "world")]
pub use id_worlds::world_store;
#[cfg(feature = "world")]
Expand Down