Repository navigation
Contributing
🌐 English · 简体中文
Thank you for your interest in contributing to Trizano. This page covers how to file issues, build and test locally, edit API contracts, follow the project's engineering and commit conventions, and keep documentation in sync. For toolchain details, Makefile internals, and release workflows, see Development Guide.
Before opening an issue, check FAQ & Troubleshooting, Project Status & Roadmap, and existing GitHub issues to see if the topic is already covered.
-
Bug reports: Include the Trizano version (Hub, Node, and client), OS and CPU architecture, which client you used (Web, Desktop, or Android), the agent CLI and version if applicable, steps to reproduce, and relevant logs (
~/.trizano/node/node.log, Hublaunchd/systemdoutput, or browser console errors). Redact private domains, hostnames, and tokens before posting. -
Feature proposals and larger changes: Open an issue to discuss the design and scope before writing a large pull request—especially if your change modifies
proto/, event synchronization, or multiple clients. -
Security vulnerabilities: Do not open a public issue. Report vulnerabilities privately via GitHub Private Vulnerability Reporting as described in
SECURITY.mdin the repository root. See also Security Model.
Make sure Go (1.27.4), Node.js (24), pnpm (12.23.0), buf (v2), protoc-gen-go, and protoc-gen-connect-go are installed and on your PATH (Android builds also require JDK 17 and the Android SDK). Full toolchain and Makefile details live in Development Guide.
# Install frontend workspace dependencies (web and packages/proto-ts)
pnpm install
# Run Hub + local Node (terminal 1) and Vite dev server on http://localhost:5733 (terminal 2)
make dev
make dev-webWhen opening the dev UI in a browser, use http://localhost:5733 (not 127.0.0.1) so WebAuthn passkeys work.
All automated tests run locally against fake agent CLIs and simulators under server/hub/testdata/—no real agent accounts or API keys are needed.
# Core test suite: go vet, GOOS=windows go vet, go test -race (with temporary sshd), and web typecheck
make testmake test does not include Web unit tests (vitest), MyGo desktop tests, or Android tests. Run the relevant suite whenever you touch those modules:
# Web unit tests
pnpm --filter @trizano/web test
# MyGo desktop client (vet across Linux, Windows, macOS + race tests)
cd desktop-go && go vet ./... && GOOS=windows go vet ./... && GOOS=darwin go vet ./... && go test -race ./...
# Android unit tests (or `make android-test` to run HubContractTest against bin/trizano-carbon)
cd android && ./gradlew :app:testDebugUnitTestTwo cross-platform details to keep in mind:
-
make testrunsGOOS=windows go vet ./.... Place Unix-only test code in*_unix_test.gowith//go:build !windows. - If you modify Node code (
server/node/orserver/cmd/trizano-h3) and test automatic build replacement locally, rebuildbin/dist/*withmake dist(ormake build).
Protobuf under proto/ (trizano.hub.v1, trizano.node.v1, trizano.roster.v1) is the single source of truth for Hub, Node, and all three clients.
- Edit
.protofiles underproto/only—never hand-edit generated code. - Run
make gen, which executesbuf lintandbuf generateto regenerateserver/gen/(Go + Connect) andpackages/proto-ts/src/gen/(TypeScript). Android generates Kotlin/Java-lite directly fromproto/at Gradle build time. - Commit both the
.protoedits and the regenerated files inserver/gen/andpackages/proto-ts/src/gen/. - Changes must satisfy
buf.yaml(STANDARDlint rules andFILE-level breaking-change checks).
Notes on contracts and compatibility:
- Because the Hub transparently proxies
/nodes/{node}/<procedure>without decoding payloads, adding a new RPC totrizano.node.v1normally requires no Hub routing changes. - Legacy
molchuanwire and storage identifiers—proto package names (molchuan.*.v1), HTTP headers (X-Trizano-*), cookie (trizano_session), signature domain strings (trizano-pair-v1, etc.), Android package ID (top.onemolchuan.code), and Desktop identifier (top.onemolchuan.code.desktop)—are intentionally preserved so existing clients and pairings keep working. Do not rename them.
Reviews and pull requests follow a concise set of engineering conventions (also summarized in CLAUDE.md and docs/tech-route.md §11, a Chinese design document):
-
No defensive coding:
- Validate once at trust boundaries: Check inputs at network entrypoints, authentication, resource-name parsing, and proto field constraints. Internal code trusts strong types and call contracts—avoid redundant nil checks and "just in case" fallback branches.
- Bubble errors explicitly: Return errors with appropriate Connect error codes all the way to the UI. Do not swallow errors, silently degrade, or mask missing state with fallback defaults.
- Single owner per mutable state: Each piece of mutable state has one owner (such as a session actor goroutine or node connection supervisor) mutated via messages rather than scattered locks.
- Keep retries in the connection layer: SSH reconnects, Reverse Node backoff, and event-stream resumption live in the connection layer with visible status—never hide implicit retries inside business RPCs.
-
Sanitize external bytes to valid UTF-8: Before placing output from external processes (SSH, agent CLIs, Git, terminal OSC sequences) into proto3
stringfields, clean it withstrings.ToValidUTF8(s, "\uFFFD")and truncate only on UTF-8 character boundaries so invalid bytes cannot break the event stream. - Probe agent capabilities at runtime: Models, reasoning effort, fast mode, and permission modes are probed from each CLI and cached by CLI version. Do not hardcode model or mode lists.
-
Preserve extension boundaries: When simplifying or refactoring, keep core interfaces such as
driver.Driverandnodes.Dialerintact. -
Keep Web and Android sync aligned:
web/src/state/sync.ts/timeline.tsand Android'sstate/Storeimplement the same event-synchronization state machine. When changing sync semantics, update both clients.
-
Commit messages: Use English Conventional Commits, such as
feat(approval): ...,fix(sync): ..., ordocs(wiki): .... - Code comments: Write code comments in English.
-
UI copy and user-facing errors: Currently written in Chinese (until UI internationalization lands; see Project Status & Roadmap). Design documents under
docs/are also written in Chinese. -
Keep bilingual public documentation in sync:
-
README.md(English) andREADME.zh-CN.md(Simplified Chinese) mirror each other section by section—update both together. - Wiki source files live in
docs/wiki/: English pages use the base filename (Page-Name.md) and Chinese pages add the-zhsuffix (Page-Name-zh.md). When changing architecture, adding features, or modifying user-visible behavior, update both language versions of the affected pages. - Keep internal links within the same language (English pages link to
Page.md; Chinese pages link toPage-zh.md) and use../assets/<file>for images underdocs/assets/.
-
Trizano is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) (see LICENSE in the repository root).
- Inbound = Outbound: By submitting a pull request or patch, you agree to license your contribution under AGPL-3.0 under the same terms as the project. No Contributor License Agreement (CLA) is required.
-
Third-party notices:
web/includes MIT-licensed code originally forked fromt3code(web/LICENSE-t3code), and bundled fonts underweb/public/fonts/retain their respective licenses. Keep all existing license notices intact.
English
Getting Started
Deployment & Networking
Architecture & Nodes
Agents
Clients & Development
Project & Community
中文文档
新手指引
部署与网络
架构与节点
智能体
客户端与开发
项目与社区