Skip to content

feat: Runtime::dump_network_stats() for unyt-on-ASR (Phase 2)#138

Open
zippy wants to merge 2 commits into
feat/tauri-direct-app-callsfrom
feat/tauri-direct-admin-calls
Open

feat: Runtime::dump_network_stats() for unyt-on-ASR (Phase 2)#138
zippy wants to merge 2 commits into
feat/tauri-direct-app-callsfrom
feat/tauri-direct-admin-calls

Conversation

@zippy

@zippy zippy commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Adds one runtime primitive needed to run unyt on ASR's unified in-process plugin: Runtime::dump_network_stats(). Stacked on #137 (direct app-call path).

This is intentionally minimal — the entire ASR-side addition for unyt's "Phase 2" is this one method. There is no admin-over-IPC, no admin websocket, and no @holochain/client change: unyt drives admin from its own in-process #[tauri::command]s calling runtime().<method>(), and multi-network is handled per-window using the existing direct app transport from #137.

What's in it

  • Runtime::dump_network_stats() -> kitsune2_api::ApiTransportStats — returns the typed struct (consumers read .transport_stats.backend). Routed through the admin DumpNetworkStatsNetworkStatsDumped path because the app-API variant returns a narrower TransportStats.
  • Plan doc: docs/tauri-direct-admin-calls-plan.md.
  • Non-change worth noting: list_apps() stays arg-less; consumers filter client-side.

Scope notes

  • The consumer of this primitive is unyt, not the ASR desktop example — so there's no new example wiring here.
  • Despite the branch name, no admin IPC ships. Earlier drafts (an admin_request IPC command, denylist, holochain:admin capability) were dropped; admin stays plain in-process Rust calls.
  • The heavier "controllable-boot" work (late passphrase, hc-auth pre-launch hook, restart-keeping-lair, agent-key/seed export) is a separate follow-up branch, not this PR.

Test plan

  • cargo build/cargo test for the runtime crate (no UI/GL needed).

zippy added 2 commits May 27, 2026 15:53
Companion to unyt's unyt-admin-access-needs.md, phased to match it.
unyt drives admin from its own in-process Rust commands and uses a
per-window multi-network UX, so the ASR-side surface is small:

- Phase 2 (now): a single add, Runtime::dump_network_stats(); keep
  list_apps() arg-less. No admin-over-IPC, no multi-app app_request,
  no client-js change.
- Phase 3 (deferred, co-design): the controllable-boot cluster (late
  passphrase, pre-launch lair hook for hc-auth material, restart-
  keeping-lair, generate_agent_pub_key, export_agent_seed).

Records why the earlier admin-IPC / trusted-multi-app-window drafts
were dropped (bundled-binary trust model; pinning is the future Case-2
boundary, not app_id).
Public wrapper over AdminRequest::DumpNetworkStats returning the typed
kitsune2_api::ApiTransportStats, so callers read transport_stats.backend
directly rather than a stringified dump (what unyt's About dialog needs).

Adds kitsune2_api as an explicit dependency, pinned to 0.4.1 — the
version holochain 0.6.1 already resolves — so it unifies to one copy.
Includes a test asserting the backend field comes back populated.
@cocogitto-bot

cocogitto-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

✔️ 23eb5d1...edc64a8 - Conventional commits check succeeded.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e80994e-d564-40bc-ad69-7c8d92d9ceb5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tauri-direct-admin-calls

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.

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