Skip to content

Upgrade Deno and Holochain to 0.212.0 and 0.5.2 respectively#605

Merged
lucksus merged 80 commits intodevfrom
hc-0.5.2_deno-2
Jun 6, 2025
Merged

Upgrade Deno and Holochain to 0.212.0 and 0.5.2 respectively#605
lucksus merged 80 commits intodevfrom
hc-0.5.2_deno-2

Conversation

@lucksus
Copy link
Copy Markdown
Member

@lucksus lucksus commented May 22, 2025

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

  • Handling of error types changed, had to implement a wrapper for the old AnyError (should be done better soon, but will be affected by LanguageController porting, so left for later)
  • Snapshot: Deno now loads a snapshot by default, so we have to provide our own which includes our extensions. Added a binary target to rust-executor (generate_snapshot) which only instantiates a Deno runtime and writes a snapshot. Added new script pnpm build-deno-snapshot which is run in CI (and should be run as part of pnpm 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.
  • TypeScript transpiling: Deno built-in extensions now come with TS code, so had to upgrade our module loader to tanspile TypeScript to JS (which is really great to have for Languages later on..)

Holochain maintenance

Update doc: https://developer.holochain.org/resources/upgrade/upgrade-holochain-0.5

  • Several HDK/HDI changes applied to languages

DNA -> hApp bundles

Install app now only accepts hApp bundles, so had go through quite a bit of changes on our end to accommodate:

  • Holochain powered Languages now bundle their DNA bundles into hApp hundles (2 pack steps: hc dna pack and hc app pack).
  • For that, had to update the old https://github.com/coasys/rollup-plugin-dna to now import .happ files
  • Extensive changes to the Language templating/cloning code sine we now have to run 2 unpack/pack steps (hApp -> DNA -> change properties -> DNA -> hApp)

tx5 / Kitsune2 networking updates

Summary by CodeRabbit

  • New Features

    • Added support for building and using custom Deno runtime snapshots, improving performance and reliability.
    • Introduced new methods for packing and unpacking Holochain app bundles (hApps).
    • Enhanced error handling throughout the executor and language services for clearer error messages.
  • Improvements

    • Upgraded Holochain and Deno dependencies for better compatibility and performance.
    • Switched language modules from DNA-based to hApp-based packaging and registration.
    • Simplified and improved build scripts and CI configuration.
    • Updated default bootstrap and proxy URLs for Holochain networking.
    • Improved test reliability by adding retry logic and dynamic waits.
    • Refined console logging to better handle argument serialization.
    • Enhanced module loading with TypeScript transpilation support.
    • Improved worker initialization with explicit service options and real filesystem support.
    • Modernized network configuration and passphrase handling for better security and stability.
  • Bug Fixes

    • Fixed potential runtime errors in perspective updates and agent queries.
    • Improved robustness of Holochain initialization and service handling.
    • Adjusted key comparisons and error handling in Holochain zome calls.
  • Chores

    • Updated ignore files to exclude new build artifacts.
    • Refactored and cleaned up codebase, including internal error types and module visibility.
    • Updated build pipeline configuration for new build targets and dependencies.
    • Replaced deprecated network configuration with updated settings for improved stability.
    • Cleaned up unused imports and removed commented code.
    • Changed error handling types to a unified custom wrapper error for consistency.
    • Made several internal modules and services publicly accessible for better integration.
  • Documentation

    • Added and updated manifest files for language modules to reflect new hApp structure.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 22, 2025

Walkthrough

This 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

Files / Groups Change Summary
.circleci/Dockerfile, .circleci/config.yml Rust toolchain upgraded, new Rust tools installed, Docker image digest updated, build/test steps revised, legacy hc install/caching removed, Deno snapshot build step added.
.gitignore, various bootstrap-languages/*/.gitignore Ignore patterns updated to exclude new hApp bundles and build artifacts.
bootstrap-languages/agent-language/, bootstrap-languages/direct-message-language/, bootstrap-languages/p-diff-sync/ Switched from DNA to hApp bundles: new happ.js, removed dna.js, updated imports/constants, build scripts now pack both DNA and hApp, added happ.yaml manifests, updated adapters and index files.
bootstrap-languages/*/hc-dna/zomes/*/Cargo.toml Holochain and related dependencies upgraded to 0.5.2/0.6.2, added holochain_serialized_bytes, relaxed some version constraints.
bootstrap-languages/*/hc-dna/workdir/dna.yaml Removed origin_time field from DNA manifests.
core/src/perspectives/PerspectiveClient.ts Added type check before assigning isInit property to parsed results.
executor/src/core/LanguageController.ts, executor/src/core/storage-services/Holochain/HolochainService.ts, executor/src/holochain_service_extension.d.ts, executor/src/holochain_types.ts Refactored to handle hApp bundles: unpack, template, repack hApps and contained DNAs; new TS types/interfaces for hApp lifecycle; updated install logic.
executor/src/deno.ts Console methods now stringify non-string arguments using JSON.
executor/src/core/graphQL-interface/GraphQL.ts Added error handling for Holochain initialization in agent mutations.
package.json, rust-executor/package.json, turbo.json Added scripts and pipeline steps for Deno snapshot building, updated build dependencies and outputs.
rust-executor/Cargo.toml, rust-executor/src/bin/generate_snapshot.rs Added new binary for custom Deno snapshot generation, new feature flag, upgraded dependencies, added snapshot-related crates.
rust-executor/src/config.rs Updated default Holochain proxy/bootstrap URLs.
rust-executor/src/entanglement_service/, rust-executor/src/js_core/, rust-executor/src/runtime_service/ Error handling refactored to use a custom wrapper (AnyhowWrapperError) for Rust-JS ops; module visibility adjusted for public API exposure.
rust-executor/src/js_core/string_module_loader.rs Added TypeScript transpilation for modules, improved error handling.
rust-executor/src/js_core/options.rs, rust-executor/src/js_core/mod.rs Worker initialization refactored for explicit configuration, new module loader, snapshot logic updated.
rust-executor/src/holochain_service/, rust-executor/src/holochain_service/interface.rs Refactored agent info handling (now as JSON strings), added hApp pack/unpack methods, updated network config and cell lookup, improved passphrase handling.
rust-executor/src/graphql/mutation_resolvers.rs, rust-executor/src/graphql/query_resolvers.rs Updated agent info serialization/deserialization logic to match new agent info handling.
tests/js/tests/, tests/js/utils/utils.ts Improved test reliability: added retry loops and dynamic waits for async operations, updated local Holochain service runner to use new bootstrap server.

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
Loading

Poem

In the warren, code hops anew,
Bundles of hApps, not just DNA stew!
Rust and TypeScript, in harmony sing,
Snapshots and errors, neatly in a ring.
With every test, the rabbits cheer,
For hApp-ier code is finally here!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1a66aa and e7760f8.

📒 Files selected for processing (3)
  • rust-executor/src/config.rs (1 hunks)
  • rust-executor/src/holochain_service/mod.rs (11 hunks)
  • tests/js/utils/utils.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • rust-executor/src/config.rs
  • tests/js/utils/utils.ts
  • rust-executor/src/holochain_service/mod.rs
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lucksus lucksus marked this pull request as ready for review June 4, 2025 10:13
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🔭 Outside diff range comments (1)
bootstrap-languages/direct-message-language/rollup.config.hc-dna.js (1)

14-23: ⚠️ Potential issue

Fix duplicate external property.

The external property 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 pack only runs if hc dna pack succeeds.

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 workdir
bootstrap-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 workdir after the DNA pack to produce full hApp bundles.

You might also add at the top:

set -euo pipefail

to 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 pipefail at the top for safer shell execution.

bootstrap-languages/p-diff-sync/.gitignore (1)

4-5: Ignore generated .happ artifacts
The .happ bundle 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/*.happ
bootstrap-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_pubkey to agent_initial_pubkey is 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_pubkey becomes 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_pubkey is appropriate given the unstable state of agent_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_pubkey becomes 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_pubkey API 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:

  1. Fragile parsing: The logic relies on specific log formatting (#kitsune2_bootstrap_srv#listening#) and array indexing that could break if the format changes.
  2. 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_transpile function 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, and packHapp use unconventional casing. Consider using standard camelCase: unpackDna, unpackHapp, and packHapp for 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 happ property 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. Since anyhow! already returns anyhow::Error and AnyhowWrapperError likely implements From<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

📥 Commits

Reviewing files that changed from the base of the PR and between 57d2d6c and 9c21baf.

⛔ Files ignored due to path filters (7)
  • Cargo.lock is excluded by !**/*.lock
  • bootstrap-languages/agent-language/hc-dna/Cargo.lock is excluded by !**/*.lock
  • bootstrap-languages/direct-message-language/hc-dna/Cargo.lock is excluded by !**/*.lock
  • bootstrap-languages/file-storage/hc-dna/Cargo.lock is excluded by !**/*.lock
  • bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/Cargo.lock is excluded by !**/*.lock
  • bootstrap-languages/p-diff-sync/hc-dna/Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is 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-dna to @coasys/rollup-plugin-holochain correctly 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-holochain is 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 workdir aligns with the migration from DNA to hApp bundles. Ensure that the corresponding happ.yaml manifest 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.yaml exists, so the added hc app pack workdir step 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 *.happ follows 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 hdi to 0.6.2 and hdk to 0.5.2 from the 0.5.2-coasys branch, and added holochain_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-snapshot script added.

Ensure the rust-executor/package.json defines a matching build-deno-snapshot command.

Run:

to confirm the script exists and is wired up correctly.


🏁 Script executed:

rg -A2 '"build-deno-snapshot"' -n rust-executor/package.json

Length of output: 234


Confirmed build-deno-snapshot script exists

The rust-executor/package.json already 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) to pub aligns 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 src

Length 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_extension Is 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 from 0.3.x to 0.5.2, and holochain_serialized_bytes was added to ensure proper serialization. Ensure that the branch names in the coasys forks 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
Installing holochain_cli@0.5.2 and kitsune2_bootstrap_srv@0.2.7 via cargo install aligns 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
Changing pub(crate) to pub aligns 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_NICK to DNA_ROLE and from dna.js to happ.js aligns 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_ROLE instead of DNA_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 infos without 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 when finalResult is not an object. This defensive programming practice ensures the isInit property 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_pubkey due to API instability.


233-236: Good defensive error handling.

Adding support for the AuthenticationFailed variant 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.org for 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.org

Length 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 hosts confirms 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.js to happ.js and the updated constants DNA_ROLE and ZOME_NAME align correctly with the hApp bundle migration.


17-22: DNA call parameters updated correctly.

The migration from DNA_NICK to DNA_ROLE and the explicit ZOME_NAME parameter follows the new hApp bundle structure consistently.


57-62: Sharing class updated consistently.

The same migration pattern is correctly applied in the Sharing class, 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_NICK to DNA_ROLE and ZOME_NAME from the new happ.js module 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_ROLE instead of DNA_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-holochain with the happ plugin, 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_happ and unpack_happ imports extends the service capabilities for hApp bundle management, maintaining consistency with the existing DNA operations.


50-56: hApp service methods implemented consistently.

The new packHapp and unPackHapp methods 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 flexibility

Updating 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: hdi is at version "0.6.2" while holo_hash is 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, and hdk dependencies in all bootstrap-languages/*/Cargo.toml files (including direct-message-integrity) are consistently pinned to 0.5.2-coasys. The original snippet showing hdi = "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 relaxation

The 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 versions

The 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 constants

The import update properly replaces DNA-based references with hApp bundle constants, improving maintainability.


28-39: LGTM: Consistent use of dynamic constants

The registerDNAs call now uses BUNDLE and DNA_ROLE constants instead of hardcoded values, and all zome calls properly reference ZOME_NAME. This ensures consistency across the DNA registration and usage.


67-67: LGTM: Systematic replacement of hardcoded identifiers

All Holochain service calls now use the dynamic DNA_ROLE and ZOME_NAME constants 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 practices

Updating serde to "1" enables compatible version updates while maintaining stability.


16-19: Version pattern consistent with other integrity zomes

The 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 plugin

The switch from DNA plugin to hApp plugin aligns with the broader migration to hApp-based workflows.


14-14: LGTM: File paths updated for hApp workflow

Input 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 updated

The 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_bytes uses 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_str and directly deserializes the input as Vec<String>, which matches the expected type for the holochain service's add_agent_infos method. 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_bytes suggests 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 all Cargo.toml files points at branch 0.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-coasys branch 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.call correctly uses the new DNA_ROLE constant instead of the old DNA_NICK.


22-22:

Details

❓ Verification inconclusive

Verify that the build system generates the expected happ.js file.

The usage of BUNDLE and DNA_ROLE from 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 f

Length of output: 708


Ensure happ.js Is Generated and Exports BUNDLE & DNA_ROLE

I ran a search across the repo and did not find any committed happ.js file. The Rollup config at bootstrap-languages/p-diff-sync/rollup.config.hc-dna.js does include a “happ” plugin, but you’ll need to run the build to produce the actual module before importing it in index.ts.

Please verify the following:

  • In the p-diff-sync package, run your build (npm run build or equivalent).
  • Confirm that a happ.js file appears in the configured output directory (e.g. bootstrap-languages/p-diff-sync/hc-dna/workdir or dist/).
  • Open that file and check that it exports both BUNDLE and DNA_ROLE.
  • If the generated filename or path differs, update the import in bootstrap-languages/p-diff-sync/index.ts accordingly (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 AnyError to AnyhowWrapperError provides better error type consistency. Separating the op2 import 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_ROLE using kebab-case and ZOME_NAME using 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 hdi and holochain_serialized_bytes supports the new integrity/coordinator pattern

These 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_ROLE and ZOME_NAME specific 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 AgentPubKey simplifies 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::AuthenticationFailed is 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 in console.dir() since it's intended for object inspection

This 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.data improves 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.initHolochain provides 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.js to happ.js with the new constants BUNDLE, DNA_ROLE, and ZOME_NAME correctly 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_NICK to BUNDLE/DNA_ROLE correctly 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 the ZOME_NAME variable 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-srv simplifies 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 AnyError to AnyhowWrapperError aligns 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 AnyhowWrapperError instead of AnyError, 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#build to 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#build target 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#build as a dependency for ad4m-cli#build ensures 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 AnyError to AnyhowWrapperError follows 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 rusqlite with 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 AnyError to AnyhowWrapperError is 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 AnyError to AnyhowWrapperError is 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 InstallAppRequest with 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> to Vec<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 PackHapp and UnPackHapp methods 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 AnyError with AnyhowWrapperError across 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 AnyError to CoreError in 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 AnyError with AnyhowWrapperError and 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 KitsuneP2pConfig to NetworkConfig and addition of Kitsune2NetworkMetricsRequest are consistent with the Holochain 0.5.2 upgrade.


32-32: Verify the module visibility change is intentional.

The visibility of holochain_service_extension has been changed from pub(crate) to pub, 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 PackHapp and UnPackHapp request 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 AgentInfoSigned to direct Vec<String> handling removes unnecessary encoding/decoding steps and simplifies the API. The implementation correctly uses the encode() method for serialization.

Also applies to: 561-573


359-382: Network configuration updates with security considerations.

The network configuration correctly implements the new NetworkConfig structure. Note that signalAllowPlainText is enabled when use_local_proxy is 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::LockedArray and wrapped in Arc<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_name to cell_name and direct use of ZomeCallParams align 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 Kitsune2NetworkMetricsRequest with 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_happ and unpack_happ methods properly utilize holochain_cli_bundle and 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 AnyError to AnyhowWrapperError provides 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 AgentInfoSigned to Vec<String>.


188-210: New hApp ops properly implemented.

The pack_happ and unpack_happ operations 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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

Comment on lines +6 to +9
async fn publish(
#[string] topic: String,
#[string] data: String,
) -> Result<(), AnyhowWrapperError> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

//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, "");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c97479e and 25765ab.

📒 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, and ZomeCallParams.


290-315: LGTM! New hApp pack/unpack handlers follow established patterns.

The new PackHapp and UnPackHapp request 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 ZomeCallUnsigned with manual signing to direct ZomeCallParams passed to call_zome reflects 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_infos and add_agent_infos methods are properly updated to work with Vec<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_metrics method properly uses the new Kitsune2NetworkMetricsRequest API with appropriate configuration options.


640-654: LGTM! New hApp pack/unpack methods are well-implemented.

The pack_happ and unpack_happ methods follow the same pattern as the existing DNA methods, with proper error handling and logging. The use of AppManifest type 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 AgentInfoSigned to 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 rust

Length 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 AgentInfoSigned type—every module now produces and consumes Vec<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_extension from pub(crate) to pub expands 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 rust

Length of output: 1458


Visibility change validated

  • src/bin/generate_snapshot.rs imports
    rust_executor::holochain_service::holochain_service_extension::holochain_service
  • src/js_core/options.rs imports
    crate::holochain_service::holochain_service_extension::holochain_service

These usages live outside the holochain_service module, so pub mod holochain_service_extension is 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 just cell_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 rust

Length 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 rust

Length of output: 1178


Cell lookup key simplification is safe

Searches for the old composite key format ("{app_id}-{cell_name}") and any references pairing app_id with cell_name turned up no matches in the codebase. The cell_info map is indeed keyed by cell_name only, 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 CallZomeFunction increased 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:

  1. 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.

  2. 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.

  3. Monitor Performance: Regularly monitor the performance of your zome functions to identify and address any bottlenecks or inefficiencies that could lead to timeouts.

  4. 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),

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
rust-executor/src/holochain_service/mod.rs (1)

359-396: Network configuration modernization completed

The 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.2

The change to use ZomeCallParams directly 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

📥 Commits

Reviewing files that changed from the base of the PR and between d1ff811 and 4407a10.

📒 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 upgrade

The import changes correctly include the new types required for Holochain 0.5.2 functionality, including NetworkConfig for network configuration and AppManifest for hApp bundle handling.


32-32: LGTM: Module visibility change aligns with service exposure pattern

The change from pub(crate) to pub for holochain_service_extension matches 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 characteristics

The 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 API

The change from base64 decoding AgentInfoSigned structs 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 memory

The change to use sodoken::LockedArray wrapped in Arc<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 API

The change to access cell_info directly by cell_name key 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 API

The 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 patterns

The new PackHapp and UnPackHapp request handling and implementation methods provide essential hApp bundle support. The code follows the established patterns for timeout handling, error management, and uses the appropriate holochain_cli_bundle functionality with AppManifest.

Also applies to: 639-653


624-634: LGTM: Network metrics updated for Kitsune2 networking

The network metrics logging has been properly updated to use Kitsune2NetworkMetricsRequest with the include_dht_summary parameter, providing more comprehensive network information aligned with the new networking stack.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NetworkConfig structure 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 ZomeCallParams directly 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4407a10 and 7f9e37f.

📒 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_extension has been changed from pub(crate) to pub, 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 PackHapp and UnPackHapp request 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 AgentInfoSigned to 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 around sodoken::LockedArray provides 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 updated AppInfo structure 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 Kitsune2NetworkMetricsRequest with appropriate parameters. The new static methods for packing and unpacking hApps use the holochain_cli_bundle crate correctly with proper error handling and logging.

Also applies to: 639-653

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f9e37f and 01adbf8.

📒 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 PackHapp and UnPackHapp handlers 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 with sodoken::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 ZomeCallParams simplifies 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 force parameter 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 Kitsune2NetworkMetricsRequest with 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_bundle with AppManifest type 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 AgentInfoSigned structs to JSON parsing of string arrays represents a significant shift in data format. Please verify that the COASYS_BOOTSTRAP_AGENT_INFO constant 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 an r#" literal containing a JSON array of base64 strings. serde_json::from_str will successfully parse this into Vec<String>, so the new parsing approach is compatible with the existing constant.

No changes needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant