Skip to main content
We welcome contributions to WAX! This guide will help you get started.

Workflow compliance

All contributions must follow the established workflow rules from the hive/hive repository.

Required reading

General workflow

Claude-specific workflow rules

Git guidelines

Branching and merge requests

Contributing guide

Bug reports and enhancements

Key requirements

1

Create draft merge requests

Always create MRs as Draft until maintainer approval.
2

Build and test locally

Build and test locally before pushing changes.
3

Monitor pipeline

Monitor pipeline after push and fix failures promptly.
4

Keep commits atomic

Keep commits atomic. Use fixup commits for review feedback.
5

Rebase before merge

Follow fast-forward merge strategy - rebase before merge.
All CI jobs must pass. Marking jobs as allow_failure is not permitted.

Development setup

Prerequisites

  • Git: Version control
  • Python 3.12+: For Python development
  • Node.js 20.11+: For TypeScript development
  • Poetry 2.1.3: Python dependency management
  • pnpm: TypeScript package manager
  • Protobuf compiler: For protocol buffer generation

Clone the repository

Set up Python development

Set up TypeScript development

Making changes

Branching strategy

Create a feature branch from develop:

Code style

Python

  • Follow PEP 8 style guidelines
  • Use Ruff for linting
  • Use MyPy for type checking
  • Maximum line length: 120 characters

TypeScript

  • Follow project ESLint configuration
  • Use TypeScript strict mode
  • Document public APIs with JSDoc comments

Running tests

Always run tests before committing:

Commit messages

Write clear, descriptive commit messages:
Commit message format:
  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • test: Test additions or changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • chore: Build process or auxiliary tool changes

Submitting changes

Create a merge request

  1. Push your branch to GitLab:
  2. Create a merge request on GitLab
  3. Mark it as Draft initially
  4. Fill in the MR template with:
    • Description of changes
    • Testing performed
    • Related issues

MR checklist

1

All tests pass locally

Run full test suite and verify all tests pass.
2

Linters pass

Run linters and fix all issues.
3

Documentation updated

Update documentation for any API changes.
4

Examples work

If applicable, update examples to demonstrate new features.
5

CI pipeline passes

Monitor the CI pipeline and fix any failures.

Review process

  1. Wait for maintainer review
  2. Address review feedback
  3. Use fixup commits for review changes:
  4. Once approved, maintainer will remove Draft status
  5. Rebase and squash before merge:

Development guidelines

Architecture

Understand the codebase structure:
  • core/: Common C++ code shared by Python and TypeScript
    • Tightly integrated with hive submodule
    • Uses libraries/protocol and libraries/fc
    • Avoid deep scanning during analysis
  • python/: Python implementation
    • Cython bindings in wax/cpp_python_bridge.pyx
    • Public API in wax/__init__.py
    • Internal implementation in wax/_private/
  • ts/: TypeScript implementation
    • WASM compilation from C++
    • Minimize final NPM package size
    • Core in wasm/lib/detailed/

Protocol buffers

Protocol buffers are generated from hive/libraries/protocol/proto/:
  • TypeScript: Generated to ts/wasm/lib/proto/ via ts-proto
  • Python: Generated to python/wax/_private/proto/ via grpcio-tools
Pattern files track expected output:
  • ts/protobuf_patterns/: TypeScript patterns
  • python/protobuf_patterns/: Python patterns

Testing guidelines

Write tests for new features

  • Add unit tests for new functions/methods
  • Add integration tests for complex features
  • Ensure tests are deterministic

Use the mock server

For API-related tests, use the provided mock server:

Test coverage

Aim for high test coverage:
  • Unit tests for core functionality
  • Integration tests for API calls
  • End-to-end tests for complete workflows

Documentation

Updating documentation

When adding new features:
  1. Update API reference documentation
  2. Add usage examples
  3. Update guides if applicable
  4. Add changelog entry

Python docstrings

Use Google-style docstrings:

TypeScript JSDoc

Document public APIs:

Common contribution types

Adding a new operation

  1. Define operation in protocol buffers (if not already defined)
  2. Implement in both Python and TypeScript
  3. Add tests for the operation
  4. Add example usage
  5. Update documentation

Adding a new API endpoint

  1. Extend the API interface
  2. Implement the endpoint call
  3. Add response type definitions
  4. Add tests
  5. Document the new endpoint

Fixing a bug

  1. Write a failing test that reproduces the bug
  2. Fix the bug
  3. Verify the test passes
  4. Add regression test
  5. Document the fix in changelog

Getting help

GitLab issues

Report bugs or request features

Discussions

Ask questions and discuss ideas

Contact maintainers

For questions about contributing:
  • Open a discussion on GitLab
  • Comment on related issues
  • Tag maintainers in merge requests

License

By contributing to WAX, you agree that your contributions will be licensed under the project’s license. See LICENSE.md for details.

Next steps

Building from source

Learn how to build WAX

Running tests

Run tests and examples