Upgrade Deno and Holochain to 0.212.0 and 0.5.2 respectively#605
Upgrade Deno and Holochain to 0.212.0 and 0.5.2 respectively#605
Conversation
WalkthroughThis update migrates the Holochain integration from DNA-based to hApp-based workflows across the codebase. It introduces hApp bundle handling, updates build scripts and configurations, upgrades Holochain and related dependencies, and refactors error handling for Rust-JS interop. The build and test pipelines, language adapters, and executor logic are all adapted to support these changes. Changes
Sequence Diagram(s)sequenceDiagram
participant BuildScript
participant Rollup
participant HolochainService
participant Executor
participant AppInstaller
BuildScript->>Rollup: Build hApp bundle (happ.js)
BuildScript->>Rollup: Build DNA bundle (dna.js)
Rollup->>Executor: Expose BUNDLE, DNA_ROLE, ZOME_NAME
Executor->>HolochainService: unPackHapp(happPath)
HolochainService->>Executor: Unpack hApp, locate bundled DNA
Executor->>HolochainService: unPackDna(dnaPath)
Executor->>Executor: Apply template data to DNA YAML
Executor->>HolochainService: packDna(workdir)
Executor->>HolochainService: packHapp(workdir)
Executor->>AppInstaller: Provide repacked hApp bundle
AppInstaller->>HolochainService: installApp({source: "bytes", file: hAppBundle})
HolochainService->>AppInstaller: hApp installed, cell info returned
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…er::bootstrap_from_options()
There was a problem hiding this comment.
Actionable comments posted: 13
🔭 Outside diff range comments (1)
bootstrap-languages/direct-message-language/rollup.config.hc-dna.js (1)
14-23:⚠️ Potential issueFix duplicate
externalproperty.The
externalproperty is defined twice (lines 14 and 23), which means the second definition overwrites the first. Remove the duplicate to avoid confusion.export default { input: "happ.js", - external: [], output: { sourcemap: true, format: "esm", name: "DirectMessageLanguage", file: "build/happ.js", interop: "esModule", globals: {}, }, external: [],🧰 Tools
🪛 Biome (1.9.4)
[error] 14-14: This property value named external is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named external(lint/suspicious/noDuplicateObjectKeys)
🧹 Nitpick comments (22)
bootstrap-languages/agent-language/hc-dna/build.ps1 (1)
3-4: Good addition of hApp packaging step.The sequence correctly packages both DNA and hApp bundles. Consider adding error handling to ensure
hc app packonly runs ifhc dna packsucceeds.For improved robustness:
-hc dna pack workdir -hc app pack workdir +hc dna pack workdir +if ($LASTEXITCODE -eq 0) { hc app pack workdir }bootstrap-languages/p-diff-sync/hc-dna/build.sh (1)
3-4: Correctly adds hApp packaging step.The sequence matches the pattern established in other build scripts. Consider adding error handling to ensure the build fails fast if DNA packaging fails.
For improved error handling:
-hc dna pack workdir -hc app pack workdir +hc dna pack workdir && hc app pack workdirbootstrap-languages/direct-message-language/.gitignore (1)
5-5: Appropriate gitignore entry for hApp artifact.The specific file path follows the established pattern for the DNA file. Note that this differs from the wildcard approach (
*.happ) used in other modules - ensure this specific approach aligns with the intended gitignore strategy across the codebase.bootstrap-languages/direct-message-language/hc-dna/build.sh (1)
3-4: Add hApp packaging step.Good catch adding
hc app pack workdirafter the DNA pack to produce full hApp bundles.You might also add at the top:
set -euo pipefailto fail fast on any build errors.
bootstrap-languages/agent-language/hc-dna/build.sh (1)
3-4: Mirror hApp packaging as in other languages.Consistent with direct-message and p-diff-sync, you’ve added
hc app pack workdir.Consider adding
set -euo pipefailat the top for safer shell execution.bootstrap-languages/p-diff-sync/.gitignore (1)
4-5: Ignore generated.happartifacts
The.happbundle files are correctly excluded. You may simplify the patterns by using a single wildcard rule (hc-dna/workdir/*.happ) to cover both lowercase and uppercase naming.hc-dna/workdir/perspective-diff-sync.dna -hc-dna/workdir/perspective-diff-sync.happ -hc-dna/workdir/Perspective-Diff-Sync.happ +hc-dna/workdir/*.happbootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/src/retriever/holochain.rs (1)
196-197: Temporary workaround for unstable Holochain API.The change from
agent_latest_pubkeytoagent_initial_pubkeyis necessary due to API instability, as noted in the TODO comment. This maintains functionality while avoiding unstable features.Consider tracking this TODO in your issue tracker to revisit when
agent_latest_pubkeybecomes stable again, as using the initial pubkey may not reflect the most current agent identity in scenarios involving key rotation.bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/src/telepresence/status.rs (1)
65-66: Track the TODO for future API update.The workaround using
agent_initial_pubkeyis appropriate given the unstable state ofagent_latest_pubkey. However, ensure this TODO is tracked for future resolution when the API stabilizes.Would you like me to open an issue to track when
agent_latest_pubkeybecomes stable again?rust-executor/src/bin/generate_snapshot.rs (1)
16-16: Consider making the output path configurable.The hardcoded snapshot path might cause issues in different build environments or when running from different directories.
Consider making the path configurable via environment variable or command line argument:
- let snapshot_path = Path::new("CUSTOM_DENO_SNAPSHOT.bin").to_path_buf(); + let snapshot_path = std::env::var("SNAPSHOT_PATH") + .unwrap_or_else(|_| "CUSTOM_DENO_SNAPSHOT.bin".to_string()); + let snapshot_path = Path::new(&snapshot_path).to_path_buf();bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message/src/lib.rs (1)
56-57: Track TODO comments as technical debt.The comments indicate temporary workarounds for the unstable
agent_latest_pubkeyAPI behind the dpki feature flag. These should be revisited when the API stabilizes.Would you like me to open an issue to track updating these workarounds when the Holochain dpki feature becomes stable?
Also applies to: 70-71, 208-209
tests/js/utils/utils.ts (1)
44-56: Consider improving parsing robustness and cleanup debug logs.The parsing logic works but has some concerns:
- Fragile parsing: The logic relies on specific log formatting (
#kitsune2_bootstrap_srv#listening#) and array indexing that could break if the format changes.- Debug logs: Multiple console.log statements appear to be debugging code that might be temporary.
Consider this more robust approach:
- if (data.includes("#kitsune2_bootstrap_srv#listening#")) { - const lines = data.split("\n") - //@ts-ignore - const portLine = lines.find(line => line.includes("#kitsune2_bootstrap_srv#listening#")); - const parts = portLine!.split('#'); - const portPart = parts[3]; // "127.0.0.1:36353" - const port = portPart.split(':')[1]; // "36353" - console.log("Port: ", port); - bootstrapUrl = `http://127.0.0.1:${port}`; - proxyUrl = `ws://127.0.0.1:${port}`; - console.log("Kitsune2 Bootstrap Server Data: ", data); - console.log("Bootstrap URL: ", bootstrapUrl); - console.log("Proxy URL: ", proxyUrl); + const match = data.match(/#kitsune2_bootstrap_srv#listening#([^#]+)#/); + if (match) { + const addressPort = match[1]; // "127.0.0.1:36353" + const port = addressPort.split(':')[1]; + if (port) { + bootstrapUrl = `http://127.0.0.1:${port}`; + proxyUrl = `ws://127.0.0.1:${port}`; + console.log("Bootstrap service ready:", { port, bootstrapUrl, proxyUrl }); + } resolve(); }This approach:
- Uses regex for more reliable parsing
- Adds validation for the port extraction
- Consolidates debug output
- Handles edge cases better
bootstrap-languages/p-diff-sync/hc-dna/workdir/happ.yaml (1)
11-11: Fix YAML formatting issues.The static analysis tools have identified formatting issues that should be addressed for clean code standards.
Apply this diff to fix the formatting:
dna: bundled: ./perspective-diff-sync.dna - +🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 11-11: no new line character at the end of file
(new-line-at-end-of-file)
[error] 11-11: trailing spaces
(trailing-spaces)
bootstrap-languages/direct-message-language/hc-dna/workdir/happ.yaml (1)
11-11: Fix YAML formatting issues.Same formatting issues as in the p-diff-sync happ.yaml file - missing newline and trailing spaces.
Apply this diff to fix the formatting:
dna: bundled: ./direct-message-language.dna - +🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 11-11: no new line character at the end of file
(new-line-at-end-of-file)
[error] 11-11: trailing spaces
(trailing-spaces)
rust-executor/src/js_core/error.rs (1)
26-36: Remove commented-out code.The commented Display and Error trait implementations are redundant due to the
#[error(transparent)]attribute, which automatically delegates to the inner error's implementations.Apply this diff to clean up the code:
-// impl std::fmt::Display for AnyhowWrapperError { -// fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { -// write!(f, "{}", self.inner) -// } -// } - -// impl std::error::Error for AnyhowWrapperError { -// fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { -// Some(&*self.inner) -// } -// }rust-executor/src/js_core/string_module_loader.rs (2)
43-53: Consider simplifying error construction.The JsError construction is verbose and could be simplified using the builder pattern or a helper function.
Consider using a more concise approach:
- Err(e) => Err(ModuleLoaderError::Core(CoreError::Js(JsError { - name: Some(e.get_class().to_string()), - message: Some(e.get_message().to_string()), - stack: None, - cause: None, - exception_message: String::new(), - frames: Vec::new(), - source_line: None, - source_line_frame_index: None, - aggregated: None, - }))), + Err(e) => Err(ModuleLoaderError::Core(CoreError::Js( + JsError::from_error_class_and_message(e.get_class(), e.get_message()) + ))),If such a helper doesn't exist, consider creating one to reduce boilerplate across the codebase.
20-55: Consider caching transpilation results for performance.The
maybe_transpilefunction generates source maps and code hashes, but transpilation results aren't cached. For frequently loaded modules, this could impact performance.Consider implementing a transpilation cache to avoid re-transpiling the same modules repeatedly. This could be particularly beneficial for large TypeScript codebases or during development with hot reloading.
executor/src/core/storage-services/Holochain/HolochainService.ts (1)
130-168: Consider using consistent camelCase naming.The method names
unPackDna,unPackHapp, andpackHappuse unconventional casing. Consider using standard camelCase:unpackDna,unpackHapp, andpackHappfor consistency with JavaScript/TypeScript conventions.🧰 Tools
🪛 Biome (1.9.4)
[error] 130-130: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead(lint/complexity/noBannedTypes)
[error] 140-140: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead(lint/complexity/noBannedTypes)
[error] 150-150: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead(lint/complexity/noBannedTypes)
[error] 160-160: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead(lint/complexity/noBannedTypes)
executor/src/core/LanguageController.ts (3)
628-710: Consider refactoring this complex method into smaller, focused functions.The current implementation performs many sequential operations (unpack hApp, read YAML, unpack DNA, template, repack) in a single method. This makes it difficult to test individual steps and handle errors granularly.
Consider breaking this down into smaller methods:
private async unpackHappBundle(happPath: string): Promise<{unpackPath: string, happYaml: any}> { // Unpack hApp and read YAML } private async templateDnaBundle(dnaBundlePath: string, templateData: object): Promise<string> { // Unpack DNA, apply template, repack } private async repackHappBundle(unpackPath: string, dnaPath: string): Promise<string> { // Copy DNA back and repack hApp }This would improve testability, error handling, and code reusability.
🧰 Tools
🪛 Biome (1.9.4)
[error] 631-631: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 646-646: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 687-687: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 696-696: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
837-842: Replace delete operator with more performant approach.The delete operator can impact performance. Since you're removing the
happproperty to prevent it from being included in the metadata, consider using object destructuring or filtering.- //@ts-ignore - delete templateData["happ"]; + // Remove happ from templateData for metadata + const { happ, ...templateDataWithoutHapp } = templateData as any; + templateData = templateDataWithoutHapp;Alternatively, you could filter the properties when constructing the metadata instead of mutating the original object.
🧰 Tools
🪛 Biome (1.9.4)
[error] 842-842: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
786-796: Clean up debugging logs and improve error context.The console.log statements appear to be debugging artifacts. Consider using proper logging with appropriate log levels or removing them entirely.
- console.log("applying happ template data...") + this.#config.debug && console.debug("LanguageController: Applying happ template data");- console.log("happIndex:", happIndex) + this.#config.debug && console.debug(`LanguageController: Found happ variable at index ${happIndex}`);rust-executor/src/js_core/wallet_extension.rs (1)
45-47: Simplify error wrapping for consistency.The explicit wrapping with
AnyhowWrapperError::from(anyhow!(...))is redundant. Sinceanyhow!already returnsanyhow::ErrorandAnyhowWrapperErrorlikely implementsFrom<anyhow::Error>, you can simplify this to match the pattern used in lines 25 and 28.- .ok_or(AnyhowWrapperError::from(anyhow!( - "main key not found. call createMainKey() first" - ))) + .ok_or(anyhow!("main key not found. call createMainKey() first"))?rust-executor/src/js_core/agent_extension.rs (1)
1-2: Consider grouping related imports.While the functionality is correct, consider organizing imports by moving the internal module import closer to other internal imports for better readability.
-use super::utils::sort_json_value; -use crate::js_core::error::AnyhowWrapperError; use crate::{ agent::{ create_signed_expression, did, did_document, sign, sign_string_hex, signing_key_id, AgentService, }, graphql::graphql_types::{Agent, AgentStatus}, + js_core::error::AnyhowWrapperError, }; +use super::utils::sort_json_value; use coasys_juniper::{FieldError, Value}; use deno_core::op2;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
Cargo.lockis excluded by!**/*.lockbootstrap-languages/agent-language/hc-dna/Cargo.lockis excluded by!**/*.lockbootstrap-languages/direct-message-language/hc-dna/Cargo.lockis excluded by!**/*.lockbootstrap-languages/file-storage/hc-dna/Cargo.lockis excluded by!**/*.lockbootstrap-languages/p-diff-sync-socket-signaling/hc-dna/Cargo.lockis excluded by!**/*.lockbootstrap-languages/p-diff-sync/hc-dna/Cargo.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (94)
.circleci/Dockerfile(1 hunks).circleci/config.yml(3 hunks).gitignore(1 hunks)bootstrap-languages/agent-language/.gitignore(1 hunks)bootstrap-languages/agent-language/adapter.ts(3 hunks)bootstrap-languages/agent-language/dna.js(0 hunks)bootstrap-languages/agent-language/happ.js(1 hunks)bootstrap-languages/agent-language/hc-dna/build.ps1(1 hunks)bootstrap-languages/agent-language/hc-dna/build.sh(1 hunks)bootstrap-languages/agent-language/hc-dna/workdir/dna.yaml(0 hunks)bootstrap-languages/agent-language/hc-dna/workdir/happ.yaml(1 hunks)bootstrap-languages/agent-language/hc-dna/zomes/agent_store/Cargo.toml(1 hunks)bootstrap-languages/agent-language/hc-dna/zomes/agent_store_integrity/Cargo.toml(1 hunks)bootstrap-languages/agent-language/index.ts(2 hunks)bootstrap-languages/agent-language/package.json(1 hunks)bootstrap-languages/agent-language/rollup.config.hc-dna.js(2 hunks)bootstrap-languages/direct-message-language/.gitignore(1 hunks)bootstrap-languages/direct-message-language/adapter.ts(6 hunks)bootstrap-languages/direct-message-language/dna.js(0 hunks)bootstrap-languages/direct-message-language/happ.js(1 hunks)bootstrap-languages/direct-message-language/hc-dna/build.ps1(1 hunks)bootstrap-languages/direct-message-language/hc-dna/build.sh(1 hunks)bootstrap-languages/direct-message-language/hc-dna/workdir/dna.yaml(0 hunks)bootstrap-languages/direct-message-language/hc-dna/workdir/happ.yaml(1 hunks)bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message-integrity/Cargo.toml(1 hunks)bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message/Cargo.toml(1 hunks)bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message/src/lib.rs(5 hunks)bootstrap-languages/direct-message-language/package.json(1 hunks)bootstrap-languages/direct-message-language/rollup.config.hc-dna.js(2 hunks)bootstrap-languages/file-storage/hc-dna/workdir/dna.yaml(0 hunks)bootstrap-languages/file-storage/hc-dna/zomes/file_storage/Cargo.toml(1 hunks)bootstrap-languages/file-storage/hc-dna/zomes/integrity/Cargo.toml(1 hunks)bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/workdir/dna.yaml(0 hunks)bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/zomes/perspective_diff_sync/Cargo.toml(1 hunks)bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/zomes/perspective_diff_sync_integrity/Cargo.toml(1 hunks)bootstrap-languages/p-diff-sync/.gitignore(1 hunks)bootstrap-languages/p-diff-sync/dna.js(0 hunks)bootstrap-languages/p-diff-sync/happ.js(1 hunks)bootstrap-languages/p-diff-sync/hc-dna/build.sh(1 hunks)bootstrap-languages/p-diff-sync/hc-dna/workdir/dna.yaml(0 hunks)bootstrap-languages/p-diff-sync/hc-dna/workdir/happ.yaml(1 hunks)bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/Cargo.toml(1 hunks)bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/src/retriever/holochain.rs(1 hunks)bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/src/telepresence/status.rs(3 hunks)bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync_integrity/Cargo.toml(1 hunks)bootstrap-languages/p-diff-sync/index.ts(3 hunks)bootstrap-languages/p-diff-sync/linksAdapter.ts(7 hunks)bootstrap-languages/p-diff-sync/package.json(1 hunks)bootstrap-languages/p-diff-sync/rollup.config.hc-dna.js(2 hunks)bootstrap-languages/p-diff-sync/telepresenceAdapter.ts(2 hunks)cli/Cargo.toml(0 hunks)cli/mainnet_seed.json(1 hunks)cli/src/ad4m.rs(0 hunks)cli/src/ad4m_executor.rs(0 hunks)cli/src/runtime.rs(1 hunks)core/src/perspectives/PerspectiveClient.ts(1 hunks)executor/src/core/LanguageController.ts(5 hunks)executor/src/core/graphQL-interface/GraphQL.ts(3 hunks)executor/src/core/storage-services/Holochain/HolochainService.ts(6 hunks)executor/src/deno.ts(1 hunks)executor/src/holochain_service_extension.d.ts(2 hunks)executor/src/holochain_types.ts(1 hunks)package.json(1 hunks)rust-executor/Cargo.toml(4 hunks)rust-executor/package.json(1 hunks)rust-executor/src/bin/generate_snapshot.rs(1 hunks)rust-executor/src/config.rs(1 hunks)rust-executor/src/entanglement_service/entanglement_service_extension.rs(3 hunks)rust-executor/src/entanglement_service/mod.rs(1 hunks)rust-executor/src/graphql/mutation_resolvers.rs(2 hunks)rust-executor/src/graphql/query_resolvers.rs(1 hunks)rust-executor/src/holochain_service/holochain_service_extension.js(2 hunks)rust-executor/src/holochain_service/holochain_service_extension.rs(3 hunks)rust-executor/src/holochain_service/interface.rs(6 hunks)rust-executor/src/holochain_service/mod.rs(11 hunks)rust-executor/src/js_core/agent_extension.rs(4 hunks)rust-executor/src/js_core/error.rs(1 hunks)rust-executor/src/js_core/futures.rs(6 hunks)rust-executor/src/js_core/mod.rs(4 hunks)rust-executor/src/js_core/options.rs(1 hunks)rust-executor/src/js_core/pubsub_extension.rs(1 hunks)rust-executor/src/js_core/signature_extension.rs(3 hunks)rust-executor/src/js_core/string_module_loader.rs(4 hunks)rust-executor/src/js_core/utils_extension.rs(2 hunks)rust-executor/src/js_core/wallet_extension.rs(8 hunks)rust-executor/src/lib.rs(3 hunks)rust-executor/src/mainnet_seed.json(1 hunks)rust-executor/src/runtime_service/mod.rs(1 hunks)rust-executor/src/runtime_service/runtime_service_extension.rs(2 hunks)tests/js/tests/agent-language.ts(1 hunks)tests/js/tests/authentication.test.ts(1 hunks)tests/js/tests/neighbourhood.ts(1 hunks)tests/js/utils/utils.ts(1 hunks)turbo.json(3 hunks)
💤 Files with no reviewable changes (11)
- bootstrap-languages/agent-language/hc-dna/workdir/dna.yaml
- cli/src/ad4m_executor.rs
- bootstrap-languages/p-diff-sync/hc-dna/workdir/dna.yaml
- bootstrap-languages/file-storage/hc-dna/workdir/dna.yaml
- cli/Cargo.toml
- bootstrap-languages/direct-message-language/hc-dna/workdir/dna.yaml
- cli/src/ad4m.rs
- bootstrap-languages/direct-message-language/dna.js
- bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/workdir/dna.yaml
- bootstrap-languages/agent-language/dna.js
- bootstrap-languages/p-diff-sync/dna.js
🧰 Additional context used
🧬 Code Graph Analysis (10)
bootstrap-languages/direct-message-language/adapter.ts (1)
bootstrap-languages/direct-message-language/happ.js (6)
BUNDLE(3-3)BUNDLE(3-3)DNA_ROLE(4-4)DNA_ROLE(4-4)ZOME_NAME(5-5)ZOME_NAME(5-5)
bootstrap-languages/p-diff-sync/linksAdapter.ts (1)
bootstrap-languages/p-diff-sync/happ.js (4)
DNA_ROLE(4-4)DNA_ROLE(4-4)ZOME_NAME(5-5)ZOME_NAME(5-5)
bootstrap-languages/agent-language/index.ts (1)
bootstrap-languages/agent-language/happ.js (6)
BUNDLE(3-3)BUNDLE(3-3)DNA_ROLE(4-4)DNA_ROLE(4-4)ZOME_NAME(5-5)ZOME_NAME(5-5)
bootstrap-languages/p-diff-sync/index.ts (1)
bootstrap-languages/p-diff-sync/happ.js (6)
BUNDLE(3-3)BUNDLE(3-3)DNA_ROLE(4-4)DNA_ROLE(4-4)ZOME_NAME(5-5)ZOME_NAME(5-5)
rust-executor/src/graphql/mutation_resolvers.rs (3)
rust-executor/src/holochain_service/interface.rs (2)
get_holochain_service(233-236)agent_infos(115-123)rust-executor/src/holochain_service/mod.rs (1)
agent_infos(561-569)rust-executor/src/holochain_service/holochain_service_extension.rs (1)
agent_infos(95-103)
rust-executor/src/js_core/pubsub_extension.rs (1)
rust-executor/src/pubsub.rs (1)
get_global_pubsub(140-142)
bootstrap-languages/agent-language/adapter.ts (1)
bootstrap-languages/agent-language/happ.js (4)
DNA_ROLE(4-4)DNA_ROLE(4-4)ZOME_NAME(5-5)ZOME_NAME(5-5)
rust-executor/src/js_core/signature_extension.rs (1)
rust-executor/src/js_core/agent_extension.rs (1)
agent(79-93)
executor/src/core/storage-services/Holochain/HolochainService.ts (1)
executor/src/holochain_types.ts (2)
InstallAppRequest(129-162)CellInfo(44-56)
rust-executor/src/holochain_service/mod.rs (3)
executor/src/core/storage-services/Holochain/HolochainService.ts (1)
HolochainService(24-299)rust-executor/src/holochain_service/holochain_service_extension.rs (4)
pack_happ(190-198)unpack_happ(202-210)agent_infos(95-103)add_agent_infos(106-116)rust-executor/src/holochain_service/interface.rs (4)
pack_happ(207-215)unpack_happ(217-225)agent_infos(115-123)add_agent_infos(125-135)
🪛 Biome (1.9.4)
bootstrap-languages/agent-language/rollup.config.hc-dna.js
[error] 15-15: This property value named external is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named external
(lint/suspicious/noDuplicateObjectKeys)
bootstrap-languages/direct-message-language/rollup.config.hc-dna.js
[error] 14-14: This property value named external is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named external
(lint/suspicious/noDuplicateObjectKeys)
executor/src/holochain_service_extension.d.ts
[error] 30-30: ';' expected'
An explicit or implicit semicolon is expected here...
(parse)
[error] 31-31: ';' expected'
An explicit or implicit semicolon is expected here...
(parse)
[error] 30-30: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
[error] 30-30: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
[error] 31-31: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
[error] 31-31: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
bootstrap-languages/p-diff-sync/rollup.config.hc-dna.js
[error] 15-15: This property value named external is later overwritten by an object member with the same name.
Overwritten with this value.
If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored.
Unsafe fix: Remove this property value named external
(lint/suspicious/noDuplicateObjectKeys)
executor/src/core/LanguageController.ts
[error] 631-631: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 646-646: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 687-687: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 696-696: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 842-842: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
executor/src/core/storage-services/Holochain/HolochainService.ts
[error] 130-130: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
[error] 150-150: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
[error] 160-160: Don't use 'String' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'string' instead
(lint/complexity/noBannedTypes)
🪛 YAMLlint (1.37.1)
bootstrap-languages/p-diff-sync/hc-dna/workdir/happ.yaml
[error] 11-11: no new line character at the end of file
(new-line-at-end-of-file)
[error] 11-11: trailing spaces
(trailing-spaces)
bootstrap-languages/agent-language/hc-dna/workdir/happ.yaml
[error] 11-11: no new line character at the end of file
(new-line-at-end-of-file)
[error] 11-11: trailing spaces
(trailing-spaces)
bootstrap-languages/direct-message-language/hc-dna/workdir/happ.yaml
[error] 11-11: no new line character at the end of file
(new-line-at-end-of-file)
[error] 11-11: trailing spaces
(trailing-spaces)
🔇 Additional comments (119)
bootstrap-languages/agent-language/package.json (1)
22-22: LGTM! Dependency update aligns with hApp migration.The change from
@perspect3vism/rollup-plugin-dnato@coasys/rollup-plugin-holochaincorrectly reflects the architectural shift from DNA bundles to hApp bundles described in the PR objectives.bootstrap-languages/direct-message-language/package.json (1)
23-23: LGTM! Consistent dependency migration across packages.The dependency update maintains consistency with other bootstrap language packages and supports the transition to hApp-based workflows.
bootstrap-languages/p-diff-sync/package.json (1)
19-19: LGTM! Dependency update completed consistently.The migration to
@coasys/rollup-plugin-holochainis applied consistently. Note that this package uses it as a regular dependency rather than devDependency, which may be intentional based on runtime requirements..gitignore (1)
61-63: LGTM! Appropriate exclusion of generated files.Adding the generated Deno snapshot binary to .gitignore follows best practices and prevents committing build artifacts to version control.
bootstrap-languages/direct-message-language/hc-dna/build.ps1 (1)
3-4:Details
✅ Verification successful
LGTM! Build script updated for hApp packaging.
The addition of
hc app pack workdiraligns with the migration from DNA to hApp bundles. Ensure that the correspondinghapp.yamlmanifest file exists in the workdir to support the app packaging step.Verify that the happ.yaml manifest file exists to support the new app packaging step:
🏁 Script executed:
#!/bin/bash # Check if happ.yaml exists in the workdir fd -t f "happ.yaml" bootstrap-languages/direct-message-language/hc-dna/Length of output: 140
Approve hApp packaging in PowerShell build script
Verified that
bootstrap-languages/direct-message-language/hc-dna/workdir/happ.yamlexists, so the addedhc app pack workdirstep is supported and no further changes are required.bootstrap-languages/agent-language/.gitignore (1)
8-8: LGTM! Appropriate gitignore pattern for hApp build artifacts.The addition of
*.happfollows best practices for excluding build artifacts and aligns with the migration to hApp-based workflows.bootstrap-languages/agent-language/hc-dna/zomes/agent_store_integrity/Cargo.toml (1)
16-18: Verify and pin Holochain dependencies precisely.You’ve bumped
hdito 0.6.2 andhdkto 0.5.2 from the0.5.2-coasysbranch, and addedholochain_serialized_bytes 0.0.56. Ensure these branches/tags align with the rest of your crates and CI pipelines. Consider pinning to a specific commit SHA to avoid unexpected drift.package.json (1)
26-26:Details
✅ Verification successful
New
build-deno-snapshotscript added.Ensure the
rust-executor/package.jsondefines a matchingbuild-deno-snapshotcommand.Run:
to confirm the script exists and is wired up correctly.
🏁 Script executed:
rg -A2 '"build-deno-snapshot"' -n rust-executor/package.jsonLength of output: 234
Confirmed build-deno-snapshot script exists
The
rust-executor/package.jsonalready defines:
- Line 11:
"build-deno-snapshot": "cargo run --release --features generate_snapshot --bin generate_snapshot"No further changes needed.
rust-executor/src/runtime_service/mod.rs (1)
3-3:Details
✅ Verification successful
Expose runtime_service_extension publicly.
Changing
pub(crate)topubaligns with other service extensions and enables external integration. Confirm there are no downstream breakages or unintended API exposures.Run:
to find all import sites and ensure they compile against the new visibility.
🏁 Script executed:
rg -n "runtime_service_extension" -n srcLength of output: 84
To locate all references across the project, let’s search from the repo root instead of
src:
🏁 Script executed:
#!/bin/bash rg -n "runtime_service_extension"Length of output: 625
Module
runtime_service_extensionIs Safely Public
I searched the entire repo (rg -n "runtime_service_extension") and only found the expected import sites and module declarations. No new or external references will break:
- rust-executor/src/bin/generate_snapshot.rs:11
- rust-executor/src/js_core/options.rs:14
- rust-executor/src/runtime_service/runtime_service_extension.rs: lines 36–37
- rust-executor/src/runtime_service/mod.rs: line 3
All existing consumers already compile against
pub mod runtime_service_extension;. No downstream breakages detected.bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message/Cargo.toml (1)
18-20: Align Holochain crate versions to 0.5.2 and add serialization support
Dependencies have been correctly upgraded from0.3.xto0.5.2, andholochain_serialized_byteswas added to ensure proper serialization. Ensure that thebranchnames in thecoasysforks are up-to-date and that the serialized bytes crate is compatible with the new HDK API..circleci/Dockerfile (2)
32-33: Update Rust toolchain to 1.86
The commands install and set Rust 1.86 as default. Confirm that all workspace crates compile under this version and that no MSRV conflicts arise.
36-39: Install Holochain CLI and Kitsune2 Bootstrap Service
Installingholochain_cli@0.5.2andkitsune2_bootstrap_srv@0.2.7viacargo installaligns with the updated dependencies. Verify that these binaries are correctly added to the PATH and that their versions match the expected release artifacts.cli/mainnet_seed.json (2)
7-7: Update knownLinkLanguages CID
The entry was updated to a new hApp bundle CID. Ensure this CID corresponds to the published hApp and has been tested in the network bootstrapping process.
9-9: Update directMessageLanguage CID
Replaced with a new hApp bundle hash. Please confirm that this value matches the new hApp snapshot and that clients can resolve and fetch language bundles successfully.rust-executor/src/entanglement_service/mod.rs (1)
7-7: Expose entanglement_service_extension publicly
Changingpub(crate)topubaligns with other executor service modules. Ensure the public API is intentional and update any documentation or re-exports to surface these extension ops cleanly.tests/js/tests/authentication.test.ts (1)
302-303: Good timing fix for test reliability.Adding the delay after subscription setup ensures the exception callback is properly registered before triggering the capability request. This prevents race conditions where the exception might be missed.
Consider using a more deterministic approach in the future, such as waiting for a subscription confirmation event rather than a fixed delay.
bootstrap-languages/p-diff-sync/telepresenceAdapter.ts (2)
2-2: LGTM - Consistent with hApp migration.The import change from
DNA_NICKtoDNA_ROLEand fromdna.jstohapp.jsaligns with the broader migration from DNA bundles to hApp bundles mentioned in the PR objectives.
13-33: LGTM - All DNA identifier references updated consistently.All method calls have been correctly updated to use
DNA_ROLEinstead ofDNA_NICK, maintaining consistency across the adapter implementation.tests/js/tests/agent-language.ts (1)
18-24: Excellent improvement for distributed system test reliability.The retry loop addresses network propagation delays in the distributed Holochain environment, ensuring the test waits for agent information to be available across nodes rather than failing immediately.
Consider extracting the retry logic into a utility function if this pattern is used elsewhere:
async function retryUntil<T>( operation: () => Promise<T>, predicate: (result: T) => boolean, maxAttempts: number = 30, delayMs: number = 1000 ): Promise<T> { let attempts = 0; let result = await operation(); while (!predicate(result) && attempts < maxAttempts) { await sleep(delayMs); result = await operation(); attempts++; } return result; }rust-executor/src/graphql/query_resolvers.rs (1)
449-449: LGTM! Serialization simplification aligns with the broader refactor.The direct JSON serialization of
infoswithout base64 encoding simplifies the data handling pipeline and aligns with the broader refactoring to treat agent infos as raw JSON strings.tests/js/tests/neighbourhood.ts (2)
205-215: LGTM! Excellent improvement to test reliability.Replacing the fixed 5-second sleep with a retry loop significantly improves test reliability for network-dependent operations. The retry parameters (20 attempts × 2 seconds = 40 seconds max) are reasonable for ensuring Alice receives Bob's links.
218-218: LGTM! Correctly removes redundant query.The commented-out query is now redundant since the same query is performed in the retry loop above.
core/src/perspectives/PerspectiveClient.ts (1)
204-206: LGTM! Excellent type safety improvement.Adding the
typeof finalResult === 'object'check prevents potential runtime errors whenfinalResultis not an object. This defensive programming practice ensures theisInitproperty is only assigned to valid objects.rust-executor/package.json (1)
9-11: LGTM! Build process restructuring looks good.The separation of snapshot generation and library build into distinct steps provides better control over the build pipeline and aligns with the Deno upgrade requirements.
bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/src/telepresence/status.rs (2)
94-95: Same API workaround as above.Consistent with the previous change - using
agent_initial_pubkeydue to API instability.
233-236: Good defensive error handling.Adding support for the
AuthenticationFailedvariant improves robustness by gracefully handling authentication failures in remote zome calls.rust-executor/src/config.rs (1)
70-73:Details
❓ Verification inconclusive
Verify the new bootstrap URLs are accessible.
The update to use
dev-test-bootstrap2.holochain.orgfor both proxy and bootstrap URLs aligns with the Holochain upgrade. Ensure these endpoints are accessible and provide the expected services.
🏁 Script executed:
#!/bin/bash # Description: Verify the new Holochain bootstrap URLs are accessible echo "Testing WebSocket proxy URL:" curl -I --connect-timeout 5 https://dev-test-bootstrap2.holochain.org || echo "HTTP endpoint test (WebSocket needs different testing)" echo -e "\nTesting bootstrap URL:" curl -I --connect-timeout 5 https://dev-test-bootstrap2.holochain.org echo -e "\nChecking DNS resolution:" nslookup dev-test-bootstrap2.holochain.orgLength of output: 1336
Endpoint Connectivity Verified
- HTTPS requests to dev-test-bootstrap2.holochain.org complete and return HTTP/2 404 at “/”, confirming the host is reachable.
- DNS lookup via
dig/getent hostsconfirms resolution of dev-test-bootstrap2.holochain.org.These checks demonstrate that the new proxy and bootstrap domains resolve and accept connections. Approving the config updates—please run an end-to-end Holochain bootstrap against these endpoints to confirm full service functionality.
bootstrap-languages/direct-message-language/rollup.config.hc-dna.js (1)
8-8: LGTM! hApp transition implemented correctly.The migration from DNA-based to hApp-based build configuration is implemented correctly:
- Import updated to use the new holochain plugin
- Input/output files renamed appropriately
- Plugin invocation updated to use
happ()Also applies to: 13-13, 19-19, 65-65
bootstrap-languages/agent-language/adapter.ts (3)
2-2: Migration to hApp bundle structure looks good.The import change from
dna.jstohapp.jsand the updated constantsDNA_ROLEandZOME_NAMEalign correctly with the hApp bundle migration.
17-22: DNA call parameters updated correctly.The migration from
DNA_NICKtoDNA_ROLEand the explicitZOME_NAMEparameter follows the new hApp bundle structure consistently.
57-62: Sharing class updated consistently.The same migration pattern is correctly applied in the
Sharingclass, maintaining consistency across the adapter implementation.bootstrap-languages/p-diff-sync/linksAdapter.ts (2)
5-5: Import migration completed correctly.The import change from
DNA_NICKtoDNA_ROLEandZOME_NAMEfrom the newhapp.jsmodule is consistent with the hApp bundle migration.
41-41: All DNA calls consistently updated.All Holochain DNA calls have been properly updated to use
DNA_ROLEinstead ofDNA_NICK, maintaining consistency across the adapter implementation.Also applies to: 48-48, 59-59, 142-142, 193-193, 213-213, 288-290
bootstrap-languages/p-diff-sync/rollup.config.hc-dna.js (1)
9-9: Build configuration successfully migrated to hApp plugin.The rollup configuration has been properly updated to use the new
@coasys/rollup-plugin-holochainwith thehappplugin, replacing the previous DNA-based build approach.Also applies to: 14-14, 20-20, 66-66
rust-executor/src/holochain_service/holochain_service_extension.js (2)
4-6: New hApp functionality imports added correctly.The addition of
pack_happandunpack_happimports extends the service capabilities for hApp bundle management, maintaining consistency with the existing DNA operations.
50-56: hApp service methods implemented consistently.The new
packHappandunPackHappmethods follow the same pattern as the existing DNA methods, providing symmetrical functionality for hApp bundle operations.bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message-integrity/Cargo.toml (2)
13-13: LGTM: Version relaxation improves flexibilityUpdating serde to "1" allows for compatible patch and minor version updates while maintaining API stability.
16-18:Details
❌ Incorrect review comment
Verify version consistency across Holochain dependencies
There's a potential version mismatch:
hdiis at version "0.6.2" whileholo_hashis at "0.5.2", both on the same "0.5.2-coasys" branch. Please verify this is intentional.
🏁 Script executed:
#!/bin/bash # Description: Check for version consistency across Holochain dependencies in all Cargo.toml files # Search for hdi, holo_hash, and hdk version patterns across the codebase echo "=== HDI versions ===" rg 'hdi.*version.*=.*"([^"]+)"' -o --replace '$1' echo "=== holo_hash versions ===" rg 'holo_hash.*version.*=.*"([^"]+)"' -o --replace '$1' echo "=== HDK versions ===" rg 'hdk.*version.*=.*"([^"]+)"' -o --replace '$1'Length of output: 2547
Ignore outdated version mismatch suggestion
The
hdi,holo_hash, andhdkdependencies in allbootstrap-languages/*/Cargo.tomlfiles (includingdirect-message-integrity) are consistently pinned to0.5.2-coasys. The original snippet showinghdi = "0.6.2"is stale. No changes are needed here.Likely an incorrect or invalid review comment.
bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/zomes/perspective_diff_sync/Cargo.toml (2)
13-16: LGTM: Consistent version relaxationThe update to use "1" for both serde and thiserror follows semantic versioning best practices and allows for compatible updates.
26-28: LGTM: Consistent Holochain dependency versionsThe Holochain dependencies are properly aligned with hdk and holo_hash both at 0.5.2 on the 0.5.2-coasys branch, showing good version consistency.
bootstrap-languages/direct-message-language/adapter.ts (3)
2-2: LGTM: Migration to hApp-based constantsThe import update properly replaces DNA-based references with hApp bundle constants, improving maintainability.
28-39: LGTM: Consistent use of dynamic constantsThe registerDNAs call now uses
BUNDLEandDNA_ROLEconstants instead of hardcoded values, and all zome calls properly referenceZOME_NAME. This ensures consistency across the DNA registration and usage.
67-67: LGTM: Systematic replacement of hardcoded identifiersAll Holochain service calls now use the dynamic
DNA_ROLEandZOME_NAMEconstants instead of hardcoded strings. This maintains functionality while improving consistency and maintainability.Also applies to: 77-77, 87-87, 102-102, 108-110
bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync_integrity/Cargo.toml (2)
13-13: LGTM: Version relaxation follows best practicesUpdating serde to "1" enables compatible version updates while maintaining stability.
16-19: Version pattern consistent with other integrity zomesThe dependency versions match the pattern seen in other integrity zomes (hdi at 0.6.2, others at 0.5.2). This appears to be an intentional versioning strategy for integrity vs coordinator zomes.
bootstrap-languages/agent-language/rollup.config.hc-dna.js (3)
9-9: LGTM: Migration to hApp-based pluginThe switch from DNA plugin to hApp plugin aligns with the broader migration to hApp-based workflows.
14-14: LGTM: File paths updated for hApp workflowInput and output file paths properly updated from dna.js to happ.js, maintaining consistency with the new hApp-based build process.
Also applies to: 20-20
66-66: LGTM: Plugin usage updatedThe hApp plugin is properly instantiated, completing the migration from DNA to hApp-based build process.
bootstrap-languages/file-storage/hc-dna/zomes/integrity/Cargo.toml (1)
14-20: LGTM! Dependency upgrades align with Holochain 0.5.2 upgrade.The dependency version upgrades are consistent with the PR objectives. Note that
holochain_serialized_bytesuses exact version pinning (=0.0.56) which ensures strict version compatibility during the upgrade.bootstrap-languages/agent-language/hc-dna/zomes/agent_store/Cargo.toml (1)
13-19: LGTM! Consistent dependency upgrades.The dependency updates follow the same pattern as other zomes in this PR, ensuring consistent Holochain 0.5.2 compatibility across the codebase.
bootstrap-languages/file-storage/hc-dna/zomes/file_storage/Cargo.toml (1)
14-23: LGTM! Dependency upgrades are consistent across all zomes.These changes maintain consistency with the Holochain ecosystem upgrade and follow the same dependency update pattern used throughout the bootstrap languages.
rust-executor/src/graphql/mutation_resolvers.rs (1)
1145-1159: LGTM! Refactored agent info handling aligns with new service interface.The change removes the dependency on
agent_infos_from_strand directly deserializes the input asVec<String>, which matches the expected type for the holochain service'sadd_agent_infosmethod. The JSON parsing loop provides useful logging for debugging while gracefully handling parse errors.bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/zomes/perspective_diff_sync_integrity/Cargo.toml (2)
13-13: LGTM: Serde version generalization improves flexibility.Changing from the exact version "1.0.198" to the general "1" version allows for better compatibility with other dependencies while maintaining major version stability.
16-19:Details
✅ Verification successful
Verify compatibility across the coordinated dependency upgrade.
The upgrade from 0.3.6-coasys to 0.5.2-coasys branch represents a significant version jump for all Holochain dependencies. The addition of
holochain_serialized_bytessuggests new serialization requirements.
🏁 Script executed:
#!/bin/bash # Description: Verify that all Holochain dependencies use consistent versions across the codebase # Search for Holochain dependency versions in Cargo.toml files echo "=== Checking Holochain dependency versions across Cargo.toml files ===" fd "Cargo.toml" --exec grep -H "coasys/holochain.git" {} \; | head -20 echo -e "\n=== Checking for holochain_serialized_bytes usage ===" fd "Cargo.toml" --exec grep -H "holochain_serialized_bytes" {} \;Length of output: 6092
All Holochain dependencies are now consistently upgraded to 0.5.2-coasys
- Every
hdi,hdk,holochain,holochain_cli_bundle,holochain_types,holo_hash, etc., across allCargo.tomlfiles points at branch0.5.2-coasys.- The
holochain_serialized_bytes = "=0.0.56"dependency has been added uniformly to each zome.- No references to the old
0.3.6-coasysbranch remain in active dependencies.No mismatches found—safe to proceed.
bootstrap-languages/p-diff-sync/index.ts (3)
4-4: LGTM: Import updated to support hApp-based workflow.The migration from
"./build/dna.js"to"./build/happ.js"aligns with the architectural shift to Holochain app bundles.
47-47: LGTM: Holochain call updated with new constants.The call to
Holochain.callcorrectly uses the newDNA_ROLEconstant instead of the oldDNA_NICK.
22-22:Details
❓ Verification inconclusive
Verify that the build system generates the expected happ.js file.
The usage of
BUNDLEandDNA_ROLEfrom the new happ.js module looks correct. Ensure that the Rollup configuration and build scripts properly generate the happ.js file with the expected exports.
🏁 Script executed:
#!/bin/bash # Description: Verify that happ.js is generated and contains expected exports echo "=== Checking for happ.js files ===" fd "happ.js" --type f echo -e "\n=== Checking Rollup configurations for happ plugin ===" fd "rollup.config" --exec grep -l "happ" {} \; echo -e "\n=== Checking for happ.yaml manifests ===" fd "happ.yaml" --type fLength of output: 708
Ensure
happ.jsIs Generated and ExportsBUNDLE&DNA_ROLEI ran a search across the repo and did not find any committed
happ.jsfile. The Rollup config atbootstrap-languages/p-diff-sync/rollup.config.hc-dna.jsdoes include a “happ” plugin, but you’ll need to run the build to produce the actual module before importing it inindex.ts.Please verify the following:
- In the
p-diff-syncpackage, run your build (npm run buildor equivalent).- Confirm that a
happ.jsfile appears in the configured output directory (e.g.bootstrap-languages/p-diff-sync/hc-dna/workdirordist/).- Open that file and check that it exports both
BUNDLEandDNA_ROLE.- If the generated filename or path differs, update the import in
bootstrap-languages/p-diff-sync/index.tsaccordingly (e.g.import { BUNDLE, DNA_ROLE } from './<correct-path>/happ.js';).rust-executor/src/js_core/pubsub_extension.rs (1)
1-3: LGTM: Improved error handling with custom wrapper.The migration from
AnyErrortoAnyhowWrapperErrorprovides better error type consistency. Separating theop2import improves code organization.cli/src/runtime.rs (1)
122-129: LGTM! Simplified agent info handling aligns with the migration goals.The removal of base64 decoding and struct deserialization simplifies the agent info handling. The new approach directly parses JSON strings and extracts relevant fields, which is more straightforward and aligns with the broader codebase changes mentioned in the PR summary.
bootstrap-languages/agent-language/happ.js (1)
1-5: Well-structured hApp bundle export implementation.The file correctly implements the migration from DNA to hApp bundles by:
- Importing the base64-encoded hApp bundle
- Converting to Buffer for runtime use
- Exporting consistent role and zome identifiers
The naming convention is appropriate with
DNA_ROLEusing kebab-case andZOME_NAMEusing snake_case, which aligns with Holochain conventions.bootstrap-languages/p-diff-sync/hc-dna/zomes/perspective_diff_sync/Cargo.toml (1)
13-13: Dependency upgrades are consistent with the Holochain migration.The version updates are well-coordinated:
- General versioning for stable Rust crates (
serde = "1",thiserror = "1")- Consistent upgrade to Holochain 0.5.2-coasys branch for all HC dependencies
- Addition of
hdiandholochain_serialized_bytessupports the new integrity/coordinator patternThese changes align with the PR's goal of upgrading to Holochain 0.5.2.
Also applies to: 16-16, 25-27
bootstrap-languages/direct-message-language/happ.js (1)
1-5: Consistent hApp migration pattern implementation.This file correctly follows the same pattern established in other language modules:
- Proper base64 hApp bundle import and Buffer conversion
- Appropriate naming for
DNA_ROLEandZOME_NAMEspecific to direct-message functionality- Consistent export structure that supports the broader DNA-to-hApp migration
The implementation maintains architectural consistency across the codebase.
executor/src/holochain_service_extension.d.ts (1)
1-1: LGTM: Import source change aligns with local type definitions.The change from importing types from
"@holochain/client"to"./holochain_types"supports the transition to local type definitions mentioned in the PR objectives.rust-executor/src/bin/generate_snapshot.rs (1)
14-33: LGTM: Snapshot generation implementation is correct.The implementation properly initializes all service extensions and creates the runtime snapshot as intended for the Deno upgrade. The extension initialization follows the expected pattern.
bootstrap-languages/direct-message-language/hc-dna/zomes/direct-message/src/lib.rs (2)
46-46: LGTM: Simplified error handling is appropriate.Removing the explicit wasm error mapping when converting raw bytes to
AgentPubKeysimplifies the code while maintaining the same functionality, as the conversion should handle errors appropriately.
107-109: LGTM: Added proper handling for AuthenticationFailed variant.The new error handling for
ZomeCallResponse::AuthenticationFailedis necessary for compatibility with the upgraded Holochain version and provides appropriate error messaging.executor/src/deno.ts (1)
62-80: LGTM: Improved console argument handling with explicit string conversion.The updated console methods provide better consistency by:
- Explicitly checking string types instead of relying on implicit
toString()- Using
JSON.stringify()for non-string arguments to provide better object representation- Applying consistent handling across all console methods
- Correctly using
JSON.stringify()for all arguments inconsole.dir()since it's intended for object inspectionThis change aligns with the improved logging and error handling mentioned in the PR objectives.
executor/src/core/graphQL-interface/GraphQL.ts (4)
23-23: LGTM! Enhanced null safety.Adding the null check on
expr.dataimproves robustness by preventing potential runtime errors when the expression exists but has no data.
231-236: LGTM! Improved error handling for Holochain initialization.The try-catch block around
core.initHolochainprovides better error handling and prevents exceptions from propagating, improving the robustness of the agent generation process.
260-264: LGTM! Consistent error handling pattern.This follows the same improved error handling pattern as in
agentGenerate, providing better stability during agent unlock operations.
266-266: LGTM! Message clarification.The updated console message from "Holo service" to "Holochain service" is more precise and consistent with the actual service being referenced.
bootstrap-languages/agent-language/index.ts (3)
6-6: LGTM! Migration to hApp bundle approach.The import change from
dna.jstohapp.jswith the new constantsBUNDLE,DNA_ROLE, andZOME_NAMEcorrectly aligns with the migration to hApp-centric workflow as described in the PR objectives.
28-28: LGTM! Updated DNA registration for hApp bundles.The change from
DNA/DNA_NICKtoBUNDLE/DNA_ROLEcorrectly reflects the new hApp bundle structure and maintains consistency with the imported constants.
30-31: LGTM! Dynamic zome name usage.Replacing the hardcoded
"agent_store"string with theZOME_NAMEvariable improves maintainability and ensures consistency with the hApp bundle configuration.tests/js/utils/utils.ts (1)
37-37: LGTM! Simplified bootstrap service execution.The change from a complex path resolution to directly executing
kitsune2-bootstrap-srvsimplifies the code and aligns with the updated bootstrap service approach described in the PR objectives.rust-executor/src/lib.rs (2)
5-5: LGTM: Module visibility changes support the refactoring.Making these modules public aligns with the broader architectural changes for Holochain and Deno upgrades.
Also applies to: 8-9, 11-11
24-24: LGTM: Crypto provider initialization is properly placed.The aws_lc_rs crypto provider initialization is correctly positioned early in the startup sequence and uses appropriate error handling for a critical dependency.
Also applies to: 82-85
rust-executor/src/js_core/error.rs (1)
1-25: LGTM: Well-designed error wrapper for Rust-JavaScript interop.The AnyhowWrapperError provides a clean bridge between Rust's anyhow errors and Deno's JavaScript error system. The use of derive macros and conversion traits follows Rust best practices.
rust-executor/src/js_core/options.rs (1)
49-55: Good architectural separation of module loader creation.The extraction of module loader creation into a separate function with reference counting improves modularity and allows for better shared ownership management.
rust-executor/src/runtime_service/runtime_service_extension.rs (2)
3-3: Consistent error handling migration.The import change from
AnyErrortoAnyhowWrapperErroraligns with the broader error handling refactor described in the PR objectives.
8-8: Function signatures properly updated for new error type.All three public functions have been consistently updated to use
AnyhowWrapperErrorinstead ofAnyError, maintaining the same logic while standardizing error handling across the codebase.Also applies to: 14-14, 23-23
turbo.json (3)
20-20: Proper integration of Rust executor into build pipeline.Adding
@coasys/rust-ad4m-executor#buildto the build-libs dependencies correctly integrates the new Rust executor build target into the overall build flow.
53-57: Well-configured build target for snapshot generation.The new
rust-ad4m-executor#buildtarget is properly configured with:
- Correct dependencies including
build-core-executor- Appropriate outputs including
CUSTOM_DENO_SNAPSHOT.bin- Cache disabled, which is appropriate for snapshot generation that needs to be fresh
The dependency chain ensures proper build order for the snapshot generation process.
60-60: Correct dependency chain for CLI build.Adding
@coasys/rust-ad4m-executor#buildas a dependency forad4m-cli#buildensures the Rust executor and its snapshot are built before the CLI, maintaining proper build order.rust-executor/src/js_core/signature_extension.rs (2)
3-3: Consistent error handling import update.The import change from
AnyErrortoAnyhowWrapperErrorfollows the same pattern established across other extension files in this PR, maintaining consistency in error handling.
20-20: Function signatures properly migrated to new error type.Both signature verification functions have been consistently updated to use
AnyhowWrapperError, completing the error handling standardization across the signature extension while preserving the existing verification logic.Also applies to: 29-29
.circleci/config.yml (2)
11-11: Docker image updates look good.The updated Docker image digests ensure reproducible builds with the latest CI environment containing the upgraded toolchain.
Also applies to: 74-74
31-37: New build steps are properly configured.The addition of core executor and deno snapshot build steps aligns with the new snapshot generation capability. The 30-minute timeout for the snapshot build is reasonable given the complexity of generating custom Deno snapshots.
rust-executor/src/js_core/futures.rs (1)
107-109: Verify the intent of commenting out error handling.This commented-out code changes the behavior from failing fast when the event loop resolves but the promise is still pending, to allowing the future to remain pending. This could potentially lead to futures that never complete.
Was this change intentional? If so, consider adding a comment explaining why this error condition is no longer relevant, or remove the commented code entirely if it's no longer needed.
rust-executor/src/js_core/string_module_loader.rs (1)
105-118: TypeScript transpilation logic is well-implemented.The code correctly checks file extensions and applies transpilation only to TypeScript files, with proper fallback for JavaScript modules. This aligns perfectly with the PR's objective to support TypeScript in Deno's module loader.
rust-executor/Cargo.toml (2)
26-35: Binary target and feature flag correctly configured.The new binary target for snapshot generation and its corresponding feature flag are properly set up for conditional compilation.
146-147: Verify the patch section configuration.The patch section appears to be patching
rusqlitewith the same crates.io version that's already specified in dependencies. This might be redundant or incorrect. Patches are typically used to override a dependency with a different source (e.g., git repository or local path).Consider removing this patch section if it's not serving a specific purpose, or clarify why it's needed in the current form.
rust-executor/src/js_core/utils_extension.rs (1)
1-77: Error handling refactoring looks good.The migration from
AnyErrortoAnyhowWrapperErroris consistently applied across all ops functions. This aligns with the broader error handling standardization effort mentioned in the PR summary.rust-executor/src/entanglement_service/entanglement_service_extension.rs (1)
1-62: Error type migration applied consistently.The transition from
AnyErrortoAnyhowWrapperErroris correctly implemented across all public functions in the entanglement service extension.executor/src/core/storage-services/Holochain/HolochainService.ts (1)
170-239: hApp bundle installation correctly implemented.The migration from DNA-based to hApp-based installation is well-executed:
- Properly uses
InstallAppRequestwith byte source- Correctly iterates over
CellInfo[]arrays for each role- Maintains signal callback registration
- Includes appropriate error handling and logging
executor/src/core/LanguageController.ts (1)
604-627: Good addition of directory cleanup before templating.The addition of directory cleanup (lines 614-616) before creating the temp directory helps prevent potential issues with stale data from previous runs. The transition from DNA to hApp bundle handling aligns well with the PR objectives.
executor/src/holochain_types.ts (1)
1-162: Well-structured type definitions for Holochain integration.The new type definitions provide comprehensive coverage for hApp-based workflows, including:
- Clear type definitions for cryptographic primitives and identifiers
- Well-modeled cell types and app lifecycle states
- Proper use of discriminated unions for type safety
- Good alignment with the PR's migration from DNA to hApp-based approaches
rust-executor/src/holochain_service/interface.rs (3)
31-31: Good simplification of agent info handling.The change from
Vec<AgentInfoSigned>toVec<String>simplifies the interface by removing the need for base64 encoding/decoding of agent info structs. This makes the API more straightforward to use.Also applies to: 48-48, 115-125
70-76: Helpful addition of error logging for app installation.Adding error logging for failed app installations will greatly help with debugging deployment issues. Good improvement for observability.
39-40: Well-implemented hApp packing/unpacking support.The new
PackHappandUnPackHappmethods follow the established pattern in the interface and properly support the migration to hApp-based workflows as outlined in the PR objectives.Also applies to: 58-59, 207-225
rust-executor/src/js_core/wallet_extension.rs (1)
18-112: Consistent error type migration looks good.The systematic replacement of
AnyErrorwithAnyhowWrapperErroracross all wallet functions is well-executed and maintains consistency with the broader Deno upgrade refactoring.rust-executor/src/js_core/mod.rs (3)
146-174: Verify the allow_all permissions configuration.The worker is initialized with
PermissionsContainer::allow_all, which grants all permissions. While this might be intentional for the AD4M executor, it's worth confirming this aligns with your security requirements.Consider if more granular permissions would be appropriate for your use case, especially if the executor runs untrusted code.
27-37: Module visibility changes align with snapshot generation.Making these modules public is consistent with the PR's objective of generating custom Deno snapshots that include these extensions. This change enables external access to the extensions for snapshot creation.
217-217: Error type update in execute_async_smart is correct.The change from
AnyErrortoCoreErrorin the Future's error type properly aligns with Deno's updated error handling patterns.rust-executor/src/js_core/agent_extension.rs (1)
15-128: Error handling migration completed successfully.The systematic replacement of
AnyErrorwithAnyhowWrapperErrorand the addition of appropriate error mapping with.map_err(AnyhowWrapperError::from)is consistent and correct throughout all agent functions.rust-executor/src/holochain_service/mod.rs (10)
8-15: Import updates align with Holochain upgrade.The import changes from
KitsuneP2pConfigtoNetworkConfigand addition ofKitsune2NetworkMetricsRequestare consistent with the Holochain 0.5.2 upgrade.
32-32: Verify the module visibility change is intentional.The visibility of
holochain_service_extensionhas been changed frompub(crate)topub, making it publicly accessible. Please confirm this expanded visibility is required.
149-149: Significant timeout increase for zome function calls.The timeout has been increased from 5 to 90 seconds. While this may accommodate slower operations, it could lead to poor user experience if functions regularly take this long. Consider if this timeout is appropriate for all zome functions or if it should be configurable.
290-315: New hApp bundle handlers implemented correctly.The
PackHappandUnPackHapprequest handlers follow the established pattern and maintain consistency with the existing DNA handlers.
336-340: Agent info handling simplified correctly.The change from base64-encoded
AgentInfoSignedto directVec<String>handling removes unnecessary encoding/decoding steps and simplifies the API. The implementation correctly uses theencode()method for serialization.Also applies to: 561-573
359-382: Network configuration updates with security considerations.The network configuration correctly implements the new
NetworkConfigstructure. Note thatsignalAllowPlainTextis enabled whenuse_local_proxyis true - ensure this is only used in development environments as it bypasses TLS encryption.
388-393: Improved passphrase security handling.The passphrase is now properly secured using
sodoken::LockedArrayand wrapped inArc<Mutex<>>for thread-safe access. This prevents the passphrase from being swapped to disk and ensures safe concurrent access.
479-479: Zome call implementation updated correctly.The changes from
role_nametocell_nameand direct use ofZomeCallParamsalign with the new Holochain API. The removal of manual signing code suggests this is now handled internally by Holochain.Also applies to: 520-538
609-621: Network metrics updated for Kitsune2.The implementation correctly uses the new
Kitsune2NetworkMetricsRequestwith appropriate defaults. The logging level change from error to info is appropriate for metrics output.
625-639: hApp bundle handling methods implemented correctly.The new
pack_happandunpack_happmethods properly utilizeholochain_cli_bundleand follow the established pattern from the DNA methods. The implementation supports the shift from DNA-based to hApp-based workflows.rust-executor/src/holochain_service/holochain_service_extension.rs (4)
1-1: Error handling improvements applied consistently.The migration from
AnyErrortoAnyhowWrapperErrorprovides better error propagation and type safety. The error conversion pattern is consistently applied across all async operations.Also applies to: 13-14, 22-27, 48-57, 61-69, 75-91, 95-103, 106-116, 119-127, 131-139, 142-150, 154-162, 166-174, 178-186, 190-210
17-17: Timeout duration matches the main module.The timeout increase to 90 seconds is consistent with the change in
mod.rs.
95-116: Agent info types updated consistently.The function signatures correctly reflect the change from
AgentInfoSignedtoVec<String>.
188-210: New hApp ops properly implemented.The
pack_happandunpack_happoperations follow the established pattern and are correctly registered in the extension. The implementation maintains consistency with the existing DNA operations.Also applies to: 215-215
| ], | ||
| "knownLinkLanguages": [ | ||
| "QmzSYwdbWZ8Y7w8ZtAb47xN8AEaTUveoUnxgnT6pxvrWdtBDMVy" | ||
| "QmzSYwdg52JkCXDLxHgUnQBbVjx9L6XrQdosfHrYSp6vGkJQeyc" |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify the new language identifier hashes.
The updated hash strings align with the migration from DNA to hApp bundles. Please ensure these new identifiers correspond to the correct updated language implementations.
Also applies to: 9-9
🏁 Script executed:
#!/bin/bash
# Description: Verify that the new hash values are valid IPFS CIDs and check if they're referenced elsewhere in the codebase.
# Test: Verify the hash format looks like valid IPFS CIDs
echo "Checking hash format..."
echo "QmzSYwdg52JkCXDLxHgUnQBbVjx9L6XrQdosfHrYSp6vGkJQeyc" | grep -E '^Qm[1-9A-HJ-NP-Za-km-z]{44}$' && echo "First hash format valid" || echo "First hash format invalid"
echo "QmzSYwdob1TwkrGs5SzpS6UF2NpNBBzd3XSy2HpmaDnRPivNcE9" | grep -E '^Qm[1-9A-HJ-NP-Za-km-z]{44}$' && echo "Second hash format valid" || echo "Second hash format invalid"
# Test: Search for any other references to these hashes in the codebase
echo "Searching for references to the new hashes..."
rg -n "QmzSYwdg52JkCXDLxHgUnQBbVjx9L6XrQdosfHrYSp6vGkJQeyc|QmzSYwdob1TwkrGs5SzpS6UF2NpNBBzd3XSy2HpmaDnRPivNcE9"Length of output: 999
Fix invalid IPFS CIDs for new language identifiers
The two new hashes in your seed files do not match the expected CID-v0 format (Qm + 44 base58 characters). They currently appear as 51-character strings and will be rejected by most IPFS tooling.
Affected locations:
- rust-executor/src/mainnet_seed.json (lines 7 and 9)
- cli/mainnet_seed.json (lines 7 and 9)
Please verify and replace these with the correct CID-v0 values for the updated hApp bundles.
🤖 Prompt for AI Agents
In rust-executor/src/mainnet_seed.json at lines 7 and 9, the new language
identifier hashes are invalid IPFS CID-v0 formats as they are 51 characters long
instead of the required 46 characters starting with 'Qm'. Verify the correct
CID-v0 hashes for the updated hApp bundles and replace the current invalid
hashes with these valid 46-character CID-v0 strings to ensure compatibility with
IPFS tooling.
| async fn publish( | ||
| #[string] topic: String, | ||
| #[string] data: String, | ||
| ) -> Result<(), AnyhowWrapperError> { |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify AnyhowWrapperError implementation and consistency.
The function signature update looks correct. Ensure that AnyhowWrapperError properly implements the necessary traits for Deno interop and error propagation.
🏁 Script executed:
#!/bin/bash
# Description: Verify AnyhowWrapperError implementation and usage consistency
echo "=== Checking AnyhowWrapperError definition ==="
rg -A 10 "struct AnyhowWrapperError" rust-executor/src/
echo -e "\n=== Checking other files using AnyhowWrapperError ==="
rg "AnyhowWrapperError" rust-executor/src/ --count
echo -e "\n=== Verifying error trait implementations ==="
rg -A 5 "impl.*AnyhowWrapperError" rust-executor/src/Length of output: 3103
Add Display and std::error::Error implementations to AnyhowWrapperError
The AnyhowWrapperError in rust-executor/src/js_core/error.rs currently only wraps AnyhowError and provides From conversions. For Deno interop and proper propagation you should:
• Derive or implement Debug, Display, and std::error::Error.
• Optionally leverage the thiserror crate to simplify:
use thiserror::Error;
#[derive(Debug, Error)]
#[error(transparent)]
pub struct AnyhowWrapperError(#[from] AnyhowError);
// Remove manual impl From<serde_json::Error> if using #[from] on the inner.• If you prefer manual impls, un-comment and update the existing blocks:
-// impl std::fmt::Display for AnyhowWrapperError {
-// fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
-// write!(f, "{}", self.inner)
-// }
-// }
+impl std::fmt::Display for AnyhowWrapperError {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ write!(f, "{}", self.inner)
+ }
+}
-// impl std::error::Error for AnyhowWrapperError {
-// fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
-// Some(&*self.inner)
-// }
-// }
+impl std::error::Error for AnyhowWrapperError {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+ Some(&*self.inner)
+ }
+}After these changes, all your Result<…, AnyhowWrapperError> signatures (e.g. in pubsub_extension.rs) will correctly propagate error messages into Deno.
🤖 Prompt for AI Agents
In rust-executor/src/js_core/pubsub_extension.rs around lines 6 to 9, the
function uses AnyhowWrapperError for error handling but this type lacks proper
trait implementations for Display and std::error::Error, which are needed for
Deno interop and error propagation. To fix this, update the AnyhowWrapperError
definition in rust-executor/src/js_core/error.rs by deriving or implementing
Debug, Display, and std::error::Error traits. You can simplify this by using the
thiserror crate with #[derive(Debug, Error)] and #[error(transparent)] on the
struct wrapping AnyhowError, removing manual From implementations if using
#[from]. This ensures that all Result signatures using AnyhowWrapperError
propagate errors correctly.
executor/src/core/storage-services/Holochain/HolochainService.ts
Outdated
Show resolved
Hide resolved
| //Unpack hApp bundle | ||
| //TODO: we need to be able to check for errors in this fn call, currently we just crudly split the result | ||
| console.log("LanguageController.readAndTemplateHolochainDNA: unpacking hApp bundle"); | ||
| let unpackHappPath = (await this.#holochainService?.unPackHapp(tempHappPath)).replace(/(\r\n|\n|\r)/gm, ""); |
There was a problem hiding this comment.
Fix unsafe optional chaining that could cause runtime errors.
The static analysis correctly identifies that these optional chaining operations could throw a TypeError if this.#holochainService is undefined. This could happen if the Holochain service fails to initialize.
- let unpackHappPath = (await this.#holochainService?.unPackHapp(tempHappPath)).replace(/(\r\n|\n|\r)/gm, "");
+ if (!this.#holochainService) {
+ throw new Error("Holochain service is not initialized");
+ }
+ let unpackHappPath = (await this.#holochainService.unPackHapp(tempHappPath)).replace(/(\r\n|\n|\r)/gm, "");Apply similar fixes to lines 646, 687, and 696.
Also applies to: 646-646, 687-687, 696-696
🧰 Tools
🪛 Biome (1.9.4)
[error] 631-631: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
🤖 Prompt for AI Agents
In executor/src/core/LanguageController.ts at lines 631, 646, 687, and 696, the
use of optional chaining with await on this.#holochainService can cause runtime
TypeErrors if the service is undefined. To fix this, add explicit checks to
confirm this.#holochainService is defined before calling its methods and
awaiting their results, avoiding unsafe optional chaining with await. This
ensures the code only attempts to call unPackHapp or other methods when the
service is properly initialized.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rust-executor/src/holochain_service/mod.rs(11 hunks)
🔇 Additional comments (11)
rust-executor/src/holochain_service/mod.rs (11)
8-16: LGTM! Import updates align with Holochain upgrade.The import changes properly reflect the new Holochain API structures needed for the upgrade, including
NetworkConfig,Kitsune2NetworkMetricsRequest, andZomeCallParams.
290-315: LGTM! New hApp pack/unpack handlers follow established patterns.The new
PackHappandUnPackHapprequest handlers are properly implemented with timeout handling and error propagation, consistent with existing handler patterns.
403-408: LGTM! Improved thread safety for passphrase handling.The change to use
Arc<Mutex<sodoken::LockedArray>>for passphrase handling improves thread safety and aligns with secure memory practices.
535-553: LGTM! Simplified zome call mechanism aligns with Holochain API changes.The change from
ZomeCallUnsignedwith manual signing to directZomeCallParamspassed tocall_zomereflects the API simplification in the new Holochain version. The commented-out signing code confirms the transition.
576-588: LGTM! Agent info methods updated consistently.The
agent_infosandadd_agent_infosmethods are properly updated to work withVec<String>instead of base64-encoded data, maintaining consistency with the earlier changes.
625-636: LGTM! Network metrics API updated for new Holochain version.The
log_network_metricsmethod properly uses the newKitsune2NetworkMetricsRequestAPI with appropriate configuration options.
640-654: LGTM! New hApp pack/unpack methods are well-implemented.The
pack_happandunpack_happmethods follow the same pattern as the existing DNA methods, with proper error handling and logging. The use ofAppManifesttype parameter is appropriate for hApp operations.
336-340:Details
✅ Verification successful
Verify agent info format change across the codebase.
The agent info handling changed from base64-decoded
AgentInfoSignedto direct JSON strings (Vec<String>). This is a breaking API change that could affect other parts of the system.
🏁 Script executed:
#!/bin/bash # Search for other uses of agent_infos to ensure compatibility rg -A 5 -B 5 "agent_infos|AgentInfoSigned" --type rustLength of output: 20812
Agent info format change is applied consistently across the codebase
I’ve verified that there are no remaining uses of the old
AgentInfoSignedtype—every module now produces and consumesVec<String>JSON payloads:
- rust-executor/src/holochain_service/mod.rs
- rust-executor/src/graphql/mutation_resolvers.rs
- rust-executor/src/graphql/query_resolvers.rs
- rust-executor/src/holochain_service/interface.rs
- rust-executor/src/holochain_service/holochain_service_extension.rs
- rust-client/src/runtime.rs
- cli/src/runtime.rs
Since all internal call sites expect and return JSON‐encoded
Vec<String>, this format change is self‐contained and does not introduce any internal breakage.
32-32:Details
✅ Verification successful
Verify the impact of changing module visibility.
Changing
holochain_service_extensionfrompub(crate)topubexpands its visibility outside the current crate. Ensure this is intentional and doesn't expose internal functionality inappropriately.
🏁 Script executed:
#!/bin/bash # Search for external usage of holochain_service_extension to verify the visibility change is needed rg -A 3 "holochain_service_extension" --type rustLength of output: 1458
Visibility change validated
src/bin/generate_snapshot.rsimports
rust_executor::holochain_service::holochain_service_extension::holochain_servicesrc/js_core/options.rsimports
crate::holochain_service::holochain_service_extension::holochain_serviceThese usages live outside the
holochain_servicemodule, sopub mod holochain_service_extensionis required. No further action needed.
494-494:Details
❌ Incorrect review comment
Verify cell lookup key simplification impact.
The cell lookup key changed from
"{app_id}-{cell_name}"to justcell_name. This simplification could break code that relies on the previous composite key format.
🏁 Script executed:
#!/bin/bash # Search for code that might depend on the old cell lookup key format rg -A 3 -B 3 "app_id.*cell_name|cell_name.*app_id" --type rustLength of output: 2190
🏁 Script executed:
#!/bin/bash # Locate AppInfo struct and its cell_info declaration to confirm key format rg -n "struct AppInfo" --type rust rg -A5 "cell_info" --type rustLength of output: 1178
Cell lookup key simplification is safe
Searches for the old composite key format (
"{app_id}-{cell_name}") and any references pairingapp_idwithcell_nameturned up no matches in the codebase. Thecell_infomap is indeed keyed bycell_nameonly, so removing the"{app_id}-"prefix has no downstream impact.Likely an incorrect or invalid review comment.
149-149:Details
❓ Verification inconclusive
Significant timeout increase needs justification.
The timeout for
CallZomeFunctionincreased from 5 to 90 seconds (18x increase). This suggests either performance degradation or more complex operations in the new Holochain version.Is this timeout increase documented in the Holochain upgrade guide? Consider if this could mask performance issues that should be addressed instead.
🌐 Web query:
Holochain 0.5.2 upgrade guide zome call timeout recommendations💡 Result:
In Holochain 0.5.2, the WebAssembly (WASM) metering has been re-enabled, increasing the limit from 10 to 100 giga-operations. This means that any zome call or callback will terminate after 100 billion WASM instructions, preventing excessive resource consumption by buggy or malicious zomes. While this limit is ten times higher than the previous one, it's important to test your code to ensure it doesn't hit this threshold. (blog.holochain.org)
To manage zome call timeouts effectively, consider the following recommendations:
Optimize Zome Functions: Ensure that your zome functions are efficient and avoid unnecessary computations or infinite loops that could lead to excessive WASM instruction counts.
Implement Timeout Handling: Design your zome functions to handle potential timeouts gracefully. This can involve setting reasonable time limits for operations and providing informative error messages when timeouts occur.
Monitor Performance: Regularly monitor the performance of your zome functions to identify and address any bottlenecks or inefficiencies that could lead to timeouts.
Test Thoroughly: Before deploying your application, conduct thorough testing to ensure that all zome functions perform within acceptable time limits and do not exceed the WASM instruction threshold.
By following these practices, you can help ensure that your Holochain applications remain responsive and efficient, even with the updated WASM metering in Holochain 0.5.2.
Citations:
CallZomeFunction timeout increased from 5s→90s needs justification
The default timeout in
rust-executor/src/holochain_service/mod.rs(line 149) was raised from 5 seconds to 90 seconds—an 18× increase. The Holochain 0.5.2 upgrade guide you referenced only covers WASM instruction metering (now 100 giga-ops) and doesn’t prescribe host-side network timeouts. Please confirm why such a large timeout is required and ensure this change isn’t simply masking performance regressions. In particular, consider:
- Optimizing any long-running zome functions
- Adding graceful timeout handling and informative errors
- Monitoring and load-testing to verify that 90 s is truly necessary
Location:
- rust-executor/src/holochain_service/mod.rs:149
Diff:
- std::time::Duration::from_secs(5), + std::time::Duration::from_secs(90),
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
rust-executor/src/holochain_service/mod.rs (1)
359-396: Network configuration modernization completedThe comprehensive network configuration updates with new bootstrap URLs, signal URLs, and WebRTC settings have been properly implemented. The previous review concerns about the Google STUN server typo and hardcoded credentials have been addressed.
🧹 Nitpick comments (1)
rust-executor/src/holochain_service/mod.rs (1)
534-552: LGTM: Zome call implementation updated for Holochain 0.5.2The change to use
ZomeCallParamsdirectly simplifies the zome call implementation and aligns with the Holochain 0.5.2 API where signing is handled internally by the conductor.Consider removing the commented-out signing code if it's no longer needed:
- //let keystore = self.conductor.keystore(); - //let signed_zome_call = ZomeCall::try_from_unsigned_zome_call(keystore, zome_call_unsigned) - // .await - // .map_err(|err| anyhow!("Could not sign zome call: {:?}", err))?;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rust-executor/src/holochain_service/mod.rs(11 hunks)
🧰 Additional context used
🧠 Learnings (1)
rust-executor/src/holochain_service/mod.rs (2)
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter that was added between versions 0.3.6 and 0.5.2. The call signature is uninstall_app(&app_id, boolean_param) in Holochain 0.5.2.
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter called "force" that was added between versions 0.3.6 and 0.5.2. The signature is uninstall_app(&app_id, force: bool). The force parameter overrides conditions that would normally prevent app uninstallation but should be used with caution as it can lead to data inconsistency.
🧬 Code Graph Analysis (1)
rust-executor/src/holochain_service/mod.rs (4)
executor/src/holochain_types.ts (3)
AppInfo(91-97)CellInfo(44-56)Timestamp(14-14)executor/src/core/storage-services/Holochain/HolochainService.ts (1)
HolochainService(24-299)rust-executor/src/holochain_service/holochain_service_extension.rs (2)
pack_happ(190-198)unpack_happ(202-210)rust-executor/src/holochain_service/interface.rs (2)
pack_happ(207-215)unpack_happ(217-225)
🔇 Additional comments (9)
rust-executor/src/holochain_service/mod.rs (9)
8-16: LGTM: Import updates align with Holochain 0.5.2 upgradeThe import changes correctly include the new types required for Holochain 0.5.2 functionality, including
NetworkConfigfor network configuration andAppManifestfor hApp bundle handling.
32-32: LGTM: Module visibility change aligns with service exposure patternThe change from
pub(crate)topubforholochain_service_extensionmatches the pattern used for other service modules and enables external access to the extension functionality.
149-149: LGTM: Timeout increase addresses Holochain 0.5.2 performance characteristicsThe increase from 5 to 90 seconds for zome call timeouts is consistent with similar changes elsewhere in the codebase and likely reflects the performance characteristics of Holochain 0.5.2.
336-340: LGTM: Agent info handling updated for Holochain 0.5.2 APIThe change from base64 decoding
AgentInfoSignedstructs to direct JSON parsing of agent info strings aligns with the Holochain 0.5.2 API changes and is consistent with similar updates in GraphQL resolvers.
402-407: LGTM: Enhanced passphrase security with locked memoryThe change to use
sodoken::LockedArraywrapped inArc<Mutex<>>provides better security by preventing the passphrase from being swapped to disk and ensures thread-safe access.
493-493: LGTM: Simplified cell info access aligns with Holochain 0.5.2 APIThe change to access
cell_infodirectly bycell_namekey simplifies the code and aligns with the updated Holochain 0.5.2 API structure.
575-586: LGTM: Agent info methods updated for consistent string-based APIThe methods now consistently work with
Vec<String>for agent info, with encoding handled internally. This aligns with the earlier agent info handling changes and provides a cleaner API interface.
290-315: LGTM: hApp bundle functionality follows established patternsThe new
PackHappandUnPackHapprequest handling and implementation methods provide essential hApp bundle support. The code follows the established patterns for timeout handling, error management, and uses the appropriateholochain_cli_bundlefunctionality withAppManifest.Also applies to: 639-653
624-634: LGTM: Network metrics updated for Kitsune2 networkingThe network metrics logging has been properly updated to use
Kitsune2NetworkMetricsRequestwith theinclude_dht_summaryparameter, providing more comprehensive network information aligned with the new networking stack.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
rust-executor/src/holochain_service/mod.rs (1)
359-396: Network configuration updates look good.The network configuration has been updated to use the new
NetworkConfigstructure with appropriate bootstrap and signal URLs. Based on previous review comments, the typo in the ICE server URL has been addressed and the configuration aligns with Holochain 0.5.2 requirements.
🧹 Nitpick comments (1)
rust-executor/src/holochain_service/mod.rs (1)
534-552: ZomeCall simplification looks correct, consider cleanup.The migration from manual signing to using
ZomeCallParamsdirectly aligns with Holochain 0.5.2 API changes where signing is handled internally. Consider removing the commented signing code to improve readability.- //let keystore = self.conductor.keystore(); - //let signed_zome_call = ZomeCall::try_from_unsigned_zome_call(keystore, zome_call_unsigned) - // .await - // .map_err(|err| anyhow!("Could not sign zome call: {:?}", err))?;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rust-executor/src/holochain_service/mod.rs(11 hunks)
🧰 Additional context used
🧠 Learnings (1)
rust-executor/src/holochain_service/mod.rs (2)
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter that was added between versions 0.3.6 and 0.5.2. The call signature is uninstall_app(&app_id, boolean_param) in Holochain 0.5.2.
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter called "force" that was added between versions 0.3.6 and 0.5.2. The signature is uninstall_app(&app_id, force: bool). The force parameter overrides conditions that would normally prevent app uninstallation but should be used with caution as it can lead to data inconsistency.
🧬 Code Graph Analysis (1)
rust-executor/src/holochain_service/mod.rs (4)
executor/src/holochain_types.ts (3)
AppInfo(91-97)CellInfo(44-56)Timestamp(14-14)executor/src/core/storage-services/Holochain/HolochainService.ts (1)
HolochainService(24-299)rust-executor/src/holochain_service/holochain_service_extension.rs (2)
pack_happ(190-198)unpack_happ(202-210)rust-executor/src/holochain_service/interface.rs (2)
pack_happ(207-215)unpack_happ(217-225)
🔇 Additional comments (8)
rust-executor/src/holochain_service/mod.rs (8)
8-16: Verify the module visibility change.The imports look appropriate for the new hApp-based functionality. However, the module visibility of
holochain_service_extensionhas been changed frompub(crate)topub, making it accessible outside the crate. Please confirm this is intentional and doesn't expose internal APIs unintentionally.Also applies to: 32-32
149-149: Timeout increase looks reasonable for complex operations.The zome call timeout has been increased from 5 to 90 seconds, which aligns with the Holochain upgrade and should accommodate more complex hApp operations. This matches similar timeout extensions mentioned in the related extension files.
290-315: Well-implemented hApp pack/unpack handlers.The new
PackHappandUnPackHapprequest handlers follow the established pattern with proper timeout handling and error management. The implementation is consistent with existing handlers.
336-340: Agent info format update aligns with Holochain upgrade.The change from base64 decoding
AgentInfoSignedto JSON parsing string arrays aligns with the broader migration to simplified agent info handling mentioned in the AI summary. The error handling for the parsing and addition operations is appropriate.
402-407: Excellent security improvement for passphrase handling.The use of
Arc<Mutex<>>wrapper aroundsodoken::LockedArrayprovides both thread safety and secure storage for the passphrase. This is a best practice for handling sensitive data in concurrent environments.
493-493: Cell info access pattern updated correctly.The change from a combined key format (like
"appId-cellName") to direct cell name access aligns with the updatedAppInfostructure in Holochain 0.5.2, as shown in the relevant TypeScript type definitions.
575-587: Agent info methods updated appropriately.The changes to return
Vec<String>and use direct encoding align with the simplified agent info handling across the codebase. The method signatures and error handling are consistent with the new API patterns.
624-634: Network metrics and hApp operations implemented correctly.The network metrics have been updated to use
Kitsune2NetworkMetricsRequestwith appropriate parameters. The new static methods for packing and unpacking hApps use theholochain_cli_bundlecrate correctly with proper error handling and logging.Also applies to: 639-653
This reverts commit d1ff811.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
rust-executor/src/holochain_service/mod.rs (1)
359-397: Network configuration updated successfully.The network configuration has been modernized with new bootstrap/signal URLs and proper WebRTC STUN server configuration. The Google STUN server URL typo mentioned in previous reviews has been corrected.
Consider uncommenting and properly configuring the relay.ad4m.dev TURN servers for production environments where NAT traversal might be challenging.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
rust-executor/src/config.rs(1 hunks)rust-executor/src/holochain_service/mod.rs(11 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- rust-executor/src/config.rs
🧰 Additional context used
🧠 Learnings (1)
rust-executor/src/holochain_service/mod.rs (2)
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter that was added between versions 0.3.6 and 0.5.2. The call signature is uninstall_app(&app_id, boolean_param) in Holochain 0.5.2.
Learnt from: lucksus
PR: coasys/ad4m#605
File: rust-executor/src/holochain_service/mod.rs:568-568
Timestamp: 2025-06-05T12:02:31.422Z
Learning: The Holochain uninstall_app API in version 0.5.2 accepts a second boolean parameter called "force" that was added between versions 0.3.6 and 0.5.2. The signature is uninstall_app(&app_id, force: bool). The force parameter overrides conditions that would normally prevent app uninstallation but should be used with caution as it can lead to data inconsistency.
🧬 Code Graph Analysis (1)
rust-executor/src/holochain_service/mod.rs (3)
executor/src/core/storage-services/Holochain/HolochainService.ts (1)
HolochainService(24-299)rust-executor/src/holochain_service/holochain_service_extension.rs (2)
pack_happ(190-198)unpack_happ(202-210)rust-executor/src/holochain_service/interface.rs (2)
pack_happ(207-215)unpack_happ(217-225)
🔇 Additional comments (12)
rust-executor/src/holochain_service/mod.rs (12)
8-15: LGTM! Import and visibility updates align with Holochain 0.5.2 upgrade.The import additions for new API types and the module visibility change are consistent with the upgrade objectives and match the patterns used in other service modules.
Also applies to: 32-32
149-149: Appropriate timeout increase for zome calls.The increase from 5 to 90 seconds provides adequate time for complex zome operations while maintaining reasonable bounds. This aligns with similar timeout adjustments throughout the codebase.
290-315: Well-implemented hApp pack/unpack request handlers.The new
PackHappandUnPackHapphandlers follow the established patterns from DNA pack/unpack operations, with appropriate timeout handling and error messages.
403-408: Excellent thread safety improvement for passphrase handling.Wrapping the passphrase in
Arc<Mutex<_>>enables safe sharing across threads while maintaining secure memory handling withsodoken::LockedArray.
494-494: Cell info access updated for new API structure.The change to access cell info by name using
get(&cell_name)aligns with Holochain 0.5.2 API evolution.
535-553: Excellent modernization of zome call handling.The migration from manual signing to
ZomeCallParamssimplifies the code significantly and aligns with Holochain 0.5.2's improved API design. The conductor now handles signing internally, reducing complexity and potential for errors.
568-568: Correct usage of uninstall_app force parameter.The second boolean parameter is correctly implemented according to Holochain 0.5.2 API changes. This
forceparameter overrides conditions that would normally prevent app uninstallation.
576-584: Agent info encoding updated for consistency.The change to return
Vec<String>and use.encode()method aligns with the overall migration from base64 to string-based agent info handling throughout the codebase.
586-586: Parameter type updated for consistency.The change to
Vec<String>parameter aligns with the agent info format standardization across the service.
625-635: Network metrics API properly updated for Holochain 0.5.2.The migration to
Kitsune2NetworkMetricsRequestwith explicit parameters provides better control over the metrics collection process.
640-654: Well-implemented hApp bundle pack/unpack methods.The new methods correctly use
holochain_cli_bundlewithAppManifesttype parameter and follow established patterns from the DNA pack/unpack methods. Error handling and logging are appropriately implemented.
336-340:Details
✅ Verification successful
Verify agent info format compatibility.
The change from base64 decoding of
AgentInfoSignedstructs to JSON parsing of string arrays represents a significant shift in data format. Please verify that theCOASYS_BOOTSTRAP_AGENT_INFOconstant contains valid JSON with string arrays compatible with this new parsing approach.
🏁 Script executed:
#!/bin/bash # Verify the bootstrap agent info format echo "Checking if COASYS_BOOTSTRAP_AGENT_INFO is valid JSON:" echo "$COASYS_BOOTSTRAP_AGENT_INFO" | jq '.'Length of output: 135
To verify the actual contents of the Rust constant (not an env var), let’s locate its definition in the codebase:
🏁 Script executed:
#!/bin/bash # Find and show context around the COASYS_BOOTSTRAP_AGENT_INFO definition rg -n -C5 "COASYS_BOOTSTRAP_AGENT_INFO" .Length of output: 2313
COASYS_BOOTSTRAP_AGENT_INFO JSON format verified
I’ve located the constant in
rust-executor/src/holochain_service/mod.rs(line 42) and confirmed it’s defined as anr#"literal containing a JSON array of base64 strings.serde_json::from_strwill successfully parse this intoVec<String>, so the new parsing approach is compatible with the existing constant.No changes needed.
Holochain & Deno upgrade
Because of overlapping Rust dependencies, Holochain and Deno have to be upgraded together.
This PR involves all necessary updates to get to green CI/test check-marks again.
Manage dependencies
Aligning dependencies happened in our forks of the various Deno and Holochain repos, in following new branches:
Holochain: https://github.com/coasys/holochain/tree/0.5.2-coasys
Holochain Wasmer: https://github.com/coasys/holochain-wasmer/tree/0.0.99-coasys
HC r2d2 sqlite: https://github.com/coasys/hc_r2d2-sqlite/tree/coasys
Lair: https://github.com/coasys/lair/tree/0.6.1-coasys
Deno: https://github.com/coasys/deno/tree/new-v8-dylib
Deno Core: https://github.com/coasys/deno_core/tree/new-v8-dylib
V8: https://github.com/coasys/rusty_v8/tree/v0.137.1-abseil-namespaced
Deno maintenance
generate_snapshot) which only instantiates a Deno runtime and writes a snapshot. Added new scriptpnpm build-deno-snapshotwhich is run in CI (and should be run as part ofpnpm build). snapshot file (rust-executor/CUSTOM_DENO_SNAPSHOT.bin) needs to be present when rust-executor is built, which is the case for cli and ui targets since, rust-executor is use there as lib.Holochain maintenance
Update doc: https://developer.holochain.org/resources/upgrade/upgrade-holochain-0.5
DNA -> hApp bundles
Install app now only accepts hApp bundles, so had go through quite a bit of changes on our end to accommodate:
packsteps:hc dna packandhc app pack).tx5 / Kitsune2 networking updates
hc run-local-servicesgot replaced forkitsune2-bootstrap-srv, changed in test utils, added to CI DockerfileSummary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores
Documentation