Skip to content

GizClaw Development Guidelines

GizClaw is an agent runtime and edge server for GizClaw devices, desktop clients, and browser integrations. It provides WebRTC connectivity, device and runtime management, agent workflows, AI model adapters, Admin and Public HTTP APIs, Peer RPC, telemetry, OTA, digital-content, social, and gameplay domain services. The same contracts generate Go, JavaScript, C, and Flutter SDK surfaces.

The development guides support day-to-day implementation, code review, and troubleshooting. They explain the project structure, module boundaries, request paths, code ownership, and where to begin when diagnosing connectivity, protocol, runtime, storage, or provider problems.

Code review should use these boundaries to determine whether changes are in the correct modules, whether cross-layer contracts remain consistent, and whether generated outputs and tests were updated together. Go symbol signatures and documentation remain authoritative in pkg.go.dev and Go doc; these guides provide the project structure, call relationships, development constraints, and troubleshooting paths that an API reference cannot express alone.

What does the project offer?

CapabilitiesProject Boundaries
Server and CLIStart a local or deployed GizClaw Server and manage context, configuration, resources, and connections.
Device connectivityEstablish Peer connection through Giznet/WebRTC and carry RPC, HTTP and events on DataChannel/service stream.
Edge ingressEdge Node accepts public network connections and forwards them to the authoritative Server; business resources and final authorization still belong to the Server.
Agent RuntimeWorkspace instantiates the Agent environment, workflow driver determines the running mode, and runtime manages online Agent, input and output, and stream lifecycle.
AI capabilityGenX provides unified message, stream, model, tool, generator and transformer contracts, implemented by provider adapters.
Product domainsDevice, runtime, AI, system, social and gameplay services have their own resources and business rules.
API and SDKRoot api/ stores the HTTP and Protobuf source contracts and generates Go, JavaScript, C, Flutter, and other client surfaces.
Storage and mediaStore packages provide general persistence/indexing capabilities; Audio packages provide codec, PCM, resampling, and voiceprint.
ObservabilityUse structured logs to diagnose individual requests and low-cardinality metrics to observe requests, runtimes, and device state. See Observability for fields and ownership.

The current code supports Edge ingress with a single upstream. Distributed membership, cross-server data synchronization, and global routing are not among the currently completed Server Mesh capabilities.

Runtime architecture

  • The identity and service access of Device, Client, Server and Edge-node are determined by Giznet connection and Server security policy.
  • Edge is responsible for ingress and upstream forwarding and does not become the business data owner.
  • Peer Service maps connections to Manager, RPC/HTTP surfaces and domain services.
  • Workspace is the persistence boundary of the Agent environment; Runtime has online Agent, connection and stream lifecycle.
  • GenX only provides general AI contracts and adapters, and does not have credentials, model catalogs, workspaces or Agent instances.

Repository module

text
gizclaw/
├── api/              # HTTP / Protobuf source contracts
├── cmd/              # CLI and Server process wiring
├── pkgs/
│   ├── giznet/       # transport, WebRTC, and service streams
│   ├── gizclaw/      # product server, Peer, RPC, and domain services
│   ├── gizedge/      # edge ingress and upstream forwarding
│   ├── genx/         # general multimodal AI contracts and adapters
│   ├── store/        # storage and index primitives
│   └── audio/        # codec, PCM, and signal processing
├── sdk/              # Go, JavaScript, C, and Flutter SDK surfaces
├── apps/             # desktop and application entry points
├── examples/         # standalone capability examples
├── tests/            # integration and e2e harnesses
└── guides/           # Project Guide
ModulesWhat to haveWhat not to haveGuidelines
api/HTTP, RPC, Telemetry source contract and generation rulesServer implementation, business storageAPI Overview
pkgs/giznetConnection, service, WebRTC, HTTP-over-stream transportGizClaw resource and business authorizationGiznet
pkgs/gizclawServer, Peer lifecycle, RPC/HTTP composition, domain servicesGeneral transport, provider-neutral codecGizClaw
pkgs/gizedgeEdge ingress, upstream connection and forwardingAuthoritative resource, final resource accessGizedge
pkgs/genxMessage, Stream, Generator, Transformer, Tool and adaptersAgent instance, workspace, product model resourceGenX
pkgs/storeKV, object, metrics, graph, vector and identity primitivesDomain resource schema and business rulesStores
pkgs/audioCodec, PCM, resampling, device I/O and voiceprintWebRTC connection, Agent lifecycleAudio
cmdConfiguration reading, dependency wiring, process life cycle and CLI UXReusable domain logicCorresponding package guidelines
sdkGenerate contract and client packaging for each languageIndependently define another set of wire contractsAPI generation

pkgs/agent is not currently part of the main product runtime path, so it is not a development-guide entry point yet. Its documentation should be added once the runtime consumes it and its actual boundaries are established.

Module dependency direction

Dependencies must flow in the direction of basic capabilities:

  • cmd and apps are responsible for assembling packages; reusable business logic cannot be put into the command layer in reverse.
  • pkgs/gizclaw can rely on Giznet, GenX, Store and Audio; these basic packages cannot rely on GizClaw domain services.
  • pkgs/gizedge can rely on Giznet and generate contracts, but cannot directly own Server domain store.
  • api/ contains wire-level source contracts. Generated code depends on those contracts; handwritten changes must not bypass the source schema by editing generated outputs.
  • Provider-specific code stays in the corresponding Adapter or product integration and cannot be spread into the general GenX, Audio or Store contract.

How to enter the system once connected

For specific signaling, Edge upstream, and service authorization, see the Giznet, Gizedge, and GizClaw pages.

Where to start when developing

  1. First confirm whether the change belongs to wire contract, transport, product area, AI adapter, storage/media primitive, or process wiring.
  2. When modifying api/, first update the source schema, and then regenerate the committed outputs of all affected languages.
  3. When modifying domain behavior, leave resources and business rules in the corresponding service; the Server/Peer file is only responsible for composition, connection and dispatch.
  4. When modifying basic packages such as GenX/Audio/Store, do not introduce GizClaw product resources or provider credential ownership.
  5. Run focused tests based on the risk of change; Go behavior changes ultimately require go test ./... by default, and schema changes also need to be generated and cross-language verified.

Follow Observability for log fields, metric names, labels, and instrumentation ownership.

Further entry point: