Skip to content

Rewrite as canonical Holochain 0.6 client#4

Open
synchwire wants to merge 4 commits into
mainfrom
rewrite-holochain-0.6
Open

Rewrite as canonical Holochain 0.6 client#4
synchwire wants to merge 4 commits into
mainfrom
rewrite-holochain-0.6

Conversation

@synchwire
Copy link
Copy Markdown
Collaborator

Rewrites the client from scratch for Holochain 0.6.1. The previous code was 0.2-era and non-functional against current conductors.

What changed

Client (holochain_client/, async-only):

  • Direct conductor wire protocol — msgpack framing, the {type, value} request/response envelope, and the required Origin handshake header.
  • A type-driven serde layer (serde.py) mirroring serde's adjacent ({type, value}), internal ({type, …fields}, e.g. Action), and external ({Variant: …}, e.g. RecordEntry) enum tagging, plus struct-as-map encoding.
  • HoloHash byte types (DnaHash/AgentPubKey/ActionHash/…) and fully-typed admin/app request & response models (AppInfo, CellInfo, capability grants, …).
  • Zome-call signing done in-language (msgpack + hashlib.sha512 + PyNaCl ed25519), dropping the archived native holochain-serialization dependency.
  • Typed Record/Action/Entry models with decode_record() / decode_records() for zome-call results.

Scope: stable endpoints only. Countersigning and DNA migration are behind unstable cargo features (absent from the release binary) and are intentionally not covered yet. DnaDef and AppManifest are returned as decoded structures rather than bespoke types.

Fixture: upgraded to hdk 0.6.1 / hdi 0.7.1 and the current DNA/app manifest format (manifest_version: "0", zome path, getrandom_backend="custom").

Tooling: Python 3.10+, PyNaCl, Holonix main-0.6 flake. Stale flake.lock/poetry.lock removed to regenerate.

Wire-protocol fixes (root causes of the old breakage)

  • Inner envelope key is value, not data.
  • The websocket data field must be msgpack bin (serde_bytes), not an int array.
  • The conductor returns HTTP 400 without an Origin header.

Tests

Unit tests (serde / signing / record — no conductor) plus admin and app integration tests covering install, signing, zome calls, Record decoding, and signals. The suite passes against a live Holochain 0.6.1 conductor. Set HC_ADMIN_PORT to run against an already-running conductor instead of spawning one.

🤖 Generated with Claude Code

Rewrite the client from scratch for Holochain 0.6.1. The previous code was
0.2-era and non-functional against current conductors (wrong request
envelope, wrong websocket framing, signing via an archived native crate, no
working response deserialization).

Client (async-only):
- Direct conductor wire protocol: msgpack framing, the {type, value}
  envelope, Origin-header handshake.
- Type-driven serde layer mirroring serde's adjacent/internal/external enum
  tagging and struct-as-map encoding.
- HoloHash byte types, typed admin/app request and response models.
- Zome-call signing in-language (msgpack + SHA-512 + ed25519 via PyNaCl),
  dropping the native holochain-serialization dependency.
- Typed Record/Action/Entry models with decode_record() for zome results.

Stable endpoints only; countersigning and DNA migration (unstable cargo
features, absent from the release binary) are intentionally not covered.

Fixture upgraded to hdk 0.6.1 / hdi 0.7.1 and the current DNA/app manifest
format. Tooling moved to Python 3.10+, PyNaCl, and the Holonix main-0.6 flake.

Tests: serde/signing/record unit tests plus admin and app integration tests
covering install, signing, zome calls, Record decoding, and signals. Set
HC_ADMIN_PORT to run the suite against an already-running conductor.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Warning

Review limit reached

@synchwire, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 21 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e0f0f54d-79e1-4979-bfca-50574cbeb80a

📥 Commits

Reviewing files that changed from the base of the PR and between 66233aa and a999d7e.

⛔ Files ignored due to path filters (3)
  • fixture/Cargo.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (59)
  • .github/workflows/test.yaml
  • CHANGELOG.md
  • HANDOFF-python-client-zome-call-signing.md
  • README.md
  • fixture/Cargo.toml
  • fixture/dnas/fixture/workdir/dna.yaml
  • fixture/dnas/fixture/zomes/coordinator/fixture/Cargo.toml
  • fixture/dnas/fixture/zomes/coordinator/fixture/src/all_fixtures.rs
  • fixture/dnas/fixture/zomes/coordinator/fixture/src/fixture.rs
  • fixture/dnas/fixture/zomes/coordinator/fixture/src/lib.rs
  • fixture/dnas/fixture/zomes/integrity/fixture/Cargo.toml
  • fixture/dnas/fixture/zomes/integrity/fixture/src/fixture.rs
  • fixture/dnas/fixture/zomes/integrity/fixture/src/lib.rs
  • fixture/package.json
  • fixture/workdir/happ.yaml
  • fixture/workdir/web-happ.yaml
  • flake.nix
  • holochain_client/__init__.py
  • holochain_client/_api.py
  • holochain_client/_transport.py
  • holochain_client/admin/__init__.py
  • holochain_client/admin/client.py
  • holochain_client/admin/types.py
  • holochain_client/api/admin/client.py
  • holochain_client/api/admin/types.py
  • holochain_client/api/app/client.py
  • holochain_client/api/app/types.py
  • holochain_client/api/common/__init__.py
  • holochain_client/api/common/pending_request_pool.py
  • holochain_client/api/common/request.py
  • holochain_client/api/common/signing.py
  • holochain_client/api/common/types.py
  • holochain_client/app/__init__.py
  • holochain_client/app/client.py
  • holochain_client/app/types.py
  • holochain_client/hash.py
  • holochain_client/serde.py
  • holochain_client/signing.py
  • holochain_client/types/__init__.py
  • holochain_client/types/app.py
  • holochain_client/types/capability.py
  • holochain_client/types/cell.py
  • holochain_client/types/common.py
  • holochain_client/types/record.py
  • pyproject.toml
  • tests/admin/__init__.py
  • tests/admin/test_admin.py
  • tests/api/__init__.py
  • tests/api/admin/__init__.py
  • tests/api/admin/client_test.py
  • tests/api/admin/signing_test.py
  • tests/api/app/client_test.py
  • tests/app/__init__.py
  • tests/app/test_zome_call.py
  • tests/conftest.py
  • tests/harness.py
  • tests/test_record.py
  • tests/test_serde.py
  • tests/test_signing.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rewrite-holochain-0.6

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

Comment @coderabbitai help to get the list of available commands and usage tips.

ThetaSinner and others added 3 commits June 3, 2026 14:25
The top-level websockets.connect resolves to the legacy client on
websockets 13.x, which rejects additional_headers (it uses extra_headers).
Import websockets.asyncio.client.connect explicitly so the Origin header
works across websockets 13-16.
The pinned install-nix-action@v25 (nix 2.20.1) fails to provision the Nix
store volume on current macos-latest runners (eDSRecordAlreadyExists).
Newer installer reuses the existing volume.
@cocogitto-bot
Copy link
Copy Markdown

cocogitto-bot Bot commented Jun 3, 2026

✔️ 42da24c...a999d7e - Conventional commits check succeeded.

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.

2 participants