Skip to main content
Contributions to Hivenet Router are welcome, including bug reports, feature proposals, documentation improvements, tests, and code changes. The repository’s root CONTRIBUTING.md file is the canonical contribution guide. This page summarizes the workflow and provides additional context for common changes. By participating in the project, you agree to follow the Code of conduct.

Report a bug

Share a reproducible problem with the affected version, configuration, and relevant logs.

Propose a feature

Describe the use case and expected behavior before investing in a substantial implementation.

Improve the documentation

Correct stale commands, clarify behavior, improve examples, or add missing troubleshooting guidance.

Open a pull request

Submit a focused change with tests, verification details, and a clear explanation of the problem it solves.

Development requirements

Hivenet Router is one Go module. The current go.mod requires:
Use Go 1.25.5 or a compatible later release. Check the installed version:
Clone the repository:
Build the complete module:
Build the router and agent binaries:
The generated binaries are placed under:
which is excluded from Git.

Repository structure

The main implementation areas are: Most tests live under test/ and use external packages such as:
This exercises exported behavior without depending on internal implementation details. A small number of focused white-box tests live beside the implementation when they need access to an unexported helper.

Run the tests

Run the complete test suite:
Force a fresh run without cached test results:
Run with coverage across the internal and protobuf packages:
Run one package:
Run one test by name:
Use verbose output while diagnosing a failure:

Add tests with a change

A behavior change should normally include tests covering:
  • the expected path
  • invalid input
  • boundary conditions
  • failure behavior
  • relevant precedence rules
  • regression scenarios
Prefer table-driven tests when several inputs should produce related outcomes:
Keep each test focused on behavior that would help a future contributor understand why the case matters. Use a white-box test only when testing an unexported behavior directly is clearer than expanding the production API solely for testing.

Format and check the code

Before opening a pull request, run:
go fmt ./... updates Go source files in place. Review the resulting diff:
Check for accidental changes:
Match the surrounding code’s:
  • naming
  • error handling
  • comment density
  • logging style
  • package boundaries
  • concurrency patterns
Keep the change focused. Move unrelated cleanup or refactoring into a separate pull request.

Update dependencies carefully

After intentionally changing module dependencies:
Review both:
Do not run go mod tidy as unrelated cleanup in a pull request that does not change dependencies. A dependency change should explain:
  • why the dependency is needed
  • why the selected version is appropriate
  • whether it changes compatibility or runtime behavior
  • whether it introduces a security or licensing concern

Regenerate protobuf code

The generated files are:
Do not edit them manually. Edit the source definition instead:
Install:
  • protoc
  • protoc-gen-go
  • protoc-gen-go-grpc
Then regenerate:
Run formatting and tests afterward:
Review the generated diff carefully. Generated output can change when contributors use different protobuf compiler or plugin versions. Avoid unrelated generated-file churn.
Do not change only the generated *.pb.go files.Those edits will be overwritten the next time proto/auth.proto is regenerated.

Improve the documentation

Documentation lives under:
Useful documentation contributions include:
  • correcting behavior that changed in the implementation
  • replacing stale commands or defaults
  • clarifying API and configuration boundaries
  • documenting edge cases
  • improving navigation
  • adding verified troubleshooting steps
  • fixing broken links
  • correcting examples that no longer match the code
When editing an existing technical page:
  1. Treat the current implementation as the source of truth.
  2. Preserve exact commands, flags, endpoints, schemas, and units.
  3. Distinguish verified behavior from guidance or interpretation.
  4. Do not add product claims that the repository does not support.
  5. Update related pages when one behavior affects several guides.
  6. Check internal links and sidebar placement.
When documentation and code disagree, verify the relevant implementation before deciding which one needs to change.

Report a bug

Open a GitHub issue and include:
  • the Hivenet Router release or commit
  • operating system and deployment method
  • whether the problem affects the router, agent, or both
  • inference engine and version
  • exact model ID and capability
  • relevant configuration with secrets removed
  • clear reproduction steps
  • expected behavior
  • actual behavior
  • relevant logs
  • X-Request-ID when one request demonstrates the problem
A useful report separates:
  • client behavior
  • router behavior
  • agent behavior
  • inference-backend behavior
This makes it easier to identify the failing layer.
Remove secrets and sensitive data before attaching configuration or logs.Do not include:
  • client API keys
  • administrator keys
  • agent JWT secrets
  • provider credentials
  • private prompts
  • customer data

Propose a feature

Open an issue before beginning a substantial feature. Describe:
  • the user or operator problem
  • the intended use case
  • current behavior
  • expected behavior
  • API or configuration changes
  • persistence implications
  • authentication and security implications
  • compatibility concerns
  • operational trade-offs
A proposal is more useful when it explains the problem rather than presenting one implementation as the only acceptable solution. Discussing the approach first reduces the risk of building a large change that conflicts with the project’s architecture or scope.

Create a branch

Fork the repository, then create a topic branch from the current main branch.
Use a prefix that reflects the change:
Examples:
Keep one coherent change on each branch.

Prepare the pull request

Before opening the pull request:
Then update the branch with the latest main when necessary. A useful pull request description explains:
  • what changed
  • why the change is needed
  • how the behavior works
  • how it was tested
  • any compatibility or migration impact
  • any remaining limitation
  • related issues
For example:
Include screenshots only when they help explain:
  • documentation rendering
  • dashboards
  • user-interface integrations
  • another visual change
Do not use screenshots as the only evidence for API or routing behavior.

Review feedback

Review may ask for:
  • clearer behavior boundaries
  • additional tests
  • smaller changes
  • compatibility handling
  • documentation updates
  • removal of unrelated refactoring
Respond to feedback directly and update the branch rather than opening a replacement pull request for the same work. When you disagree with a suggestion, explain the technical trade-off and provide supporting evidence.

Report a security issue privately

Do not open a public GitHub issue for a suspected vulnerability.
Email:
Include:
  • affected component and version
  • reproduction steps
  • expected security boundary
  • observed behavior
  • potential impact
  • any temporary mitigation
Do not include production credentials unless the maintainers explicitly request them through an appropriate secure channel. The maintainers will coordinate investigation, remediation, and disclosure.

License for contributions

Hivenet Router is licensed under the Apache License 2.0. By contributing, you agree that your contribution will be licensed under the same terms. Read the complete License before submitting a contribution.

Contribution checklist

Before submitting:
  • the change has one clear purpose
  • new behavior has appropriate tests
  • existing tests pass
  • Go source is formatted
  • go vet ./... passes
  • the complete module builds
  • generated files were updated from their source
  • documentation reflects externally visible changes
  • secrets and sensitive data were removed
  • the pull request explains the reason and verification
  • the branch is based on a current main

Next steps

Canonical contribution guide

Read the authoritative repository version of the contribution instructions.

Code of conduct

Review the standards applying to project participation.

License

Review the Apache License 2.0 terms applying to contributions.

GitHub issues

Report bugs and discuss feature proposals.

Pull requests

Review current work or submit a focused change.

Detailed architecture

Understand the components and request paths affected by a code change.