This file contains important context and knowledge that AI coding assistants should be aware of when working on this codebase.
Important: Holochain currently only implements full-arc (full-sync) DHT mode where every node gossips and stores all data. This means:
GetStrategy::Localis the correct choice for DHT lookups because all nodes will eventually have all data once gossip completesGetStrategy::Networkis NOT needed until Holochain implements actual sharding/partial-arc storage- Flaky tests related to cross-agent data visibility are gossip timing issues, not strategy issues
- The fix for such flaky tests is to add retry logic with appropriate timeouts, not to change from Local to Network strategy
When debugging cross-agent communication issues:
- First check if it's a gossip timing issue (data not yet propagated)
- Add retry logic in tests rather than changing GetStrategy
- Ensure agent info exchange is working (K2 spaces must exist before adding agent infos)
After the Holochain 0.7.0 update with PR #5550:
- K2 spaces are only created by the
joinfunction add_agent_infoswill NOT create spaces - they must exist first- If trying to add agent info for a space that doesn't exist, you'll get
K2SpaceNotFound - Retry logic should handle this by waiting for spaces to be created, then skipping if they truly don't exist (agent not in that DNA)
The integration tests are in tests/js and run with pnpm run test-main.
Sometimes an old ad4m-executor binary is still running from a previous test run, causing port conflicts. Before running tests, kill any lingering processes:
pkill -9 ad4m-executorThe integration tests use the ad4m-executor CLI binary. Depending on what code was changed, different rebuilds are required:
| What Changed | Required Rebuild |
|---|---|
Rust code in cli/ |
cargo build --release in cli/ |
Rust code in rust-executor/ |
cargo build --release in cli/ |
JS code in executor/ |
pnpm build in executor/ AND pnpm build in rust-executor/ |
| JS executor or Deno extensions | pnpm build in rust-executor/ (rebuilds Deno snapshot) |
Important: The JS package from executor/ is included/embedded in rust-executor/. If you change JS executor code:
- First build in
executor/ - Then build in
rust-executor/
Deno Snapshot: Anything that changes the content of the Deno JS engine at startup (like the JS executor or extensions) requires rebuilding the Deno snapshot. This is done with pnpm build in rust-executor/ - a mere cargo build --release in cli/ is NOT sufficient.