Thank you for your interest in contributing! This guide covers everything you need to get started.
# Prerequisites: Rust stable toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Clone and build
git clone https://github.com/cuervo-ai/halcon-cli.git
cd halcon-cli
cargo build --workspace
# Run tests
cargo test --workspace
# Run the CLI
cargo run -p halcon-cli -- "hello"Required tools:
rustup component add rustfmt clippycrates/
├── halcon-cli/ # Main CLI binary + REPL
│ └── src/repl/ # Agent loop — organized into subdirectories:
│ ├── agent/ # Core agent loop
│ ├── bridges/ # MCP, task bridge, runtime
│ ├── context/ # Context sources (memory, vector, episodic)
│ ├── decision_engine/ # BDE pipeline
│ ├── domain/ # Strategy, convergence, termination
│ ├── git_tools/ # Git, CI, IDE integration
│ ├── hooks/ # Lifecycle hooks
│ ├── metrics/ # Reward, scorer, health
│ ├── planning/ # Planner, router, SLA
│ ├── plugins/ # Plugin system
│ ├── security/ # Auth, permissions, blacklist
│ └── servers/ # SDLC context servers
├── halcon-core/ # Shared types and traits
├── halcon-tools/ # Tool implementations (bash, file, search…)
├── halcon-context/ # Context pipeline + vector store
├── halcon-mcp/ # MCP server implementation
├── halcon-security/ # RBAC, sandboxing
├── halcon-storage/ # SQLite persistence
└── halcon-auth/ # OAuth 2.1 + PKCE
-
Fork the repository and create a branch from
main:git checkout -b feat/my-feature
-
Make changes following the code standards below.
-
Test your changes:
cargo test --workspace cargo clippy --workspace -- -D warnings cargo fmt --all -- --check -
Commit using conventional commits (see Commit Messages).
-
Open a PR against
main. Fill out the PR template completely.
| Type | Pattern | Example |
|---|---|---|
| Feature | feat/description |
feat/bedrock-provider |
| Bug fix | fix/description |
fix/context-overflow |
| Refactor | refactor/description |
refactor/repl-subdirs |
| Docs | docs/description |
docs/mcp-guide |
Every PR must pass the full test suite:
# Full workspace tests
cargo test --workspace
# Single crate (faster iteration)
cargo test -p halcon-cli --lib
# With logging
RUST_LOG=debug cargo test -p halcon-cli --lib -- test_nameTest requirements:
- New features require new tests
- Bug fixes require a regression test
- No existing tests may be broken
- Security-sensitive changes require tests in
halcon-security/
Test files: Place unit tests in the same file using #[cfg(test)] mod tests { ... }. Integration tests go in crates/halcon-cli/tests/.
cargo fmtbefore every commit — non-negotiablecargo clippy -- -D warningsmust be clean- No
unwrap()in production paths — use?or explicit error handling - No
std::sync::Mutexin async functions — usetokio::sync::Mutex - Prefer
tracing::overeprintln!/println!in library code
- No new
unsafeblocks without// SAFETY:comment and team review - Destructive tool operations require explicit user confirmation
- No credentials, API keys, or tokens in source or tests
- New tool implementations must go through the FASE-2 security gate in
executor.rs
- Implement
Tooltrait incrates/halcon-tools/src/ - Register in
halcon_tools::full_registry() - Add to
CATASTROPHIC_PATTERNScheck if the tool can delete/overwrite data - Write tests for both allowed and blocked cases
- Implement
ModelProvidertrait incrates/halcon-core/src/traits/ - Add provider config to
crates/halcon-core/src/types/config.rs - Register in
crates/halcon-cli/src/repl/provider_normalization.rs - Add integration test in
crates/halcon-cli/tests/
Report vulnerabilities privately via GitHub Security Advisories — do not open public issues for security bugs. See SECURITY.md.
Security-sensitive paths (require @cuervo-ai/security review):
crates/halcon-security/crates/halcon-auth/crates/halcon-sandbox/crates/halcon-tools/src/bash.rs(CATASTROPHIC_PATTERNS)crates/halcon-core/src/security.rs
We follow Conventional Commits:
<type>(<scope>): <short description>
[optional body]
[optional footer]
Types: feat, fix, refactor, docs, test, chore, perf, ci
Scopes: repl, tools, mcp, security, context, planning, cli, core, storage, async
Examples:
feat(mcp): add OAuth 2.1 PKCE flow for HTTP servers
fix(async): replace std::sync::Mutex with tokio in model_selector
refactor(repl): migrate planning files to planning/ subdirectory
docs(contributing): add project structure and workflow sections
test(security): add CATASTROPHIC_PATTERNS regression tests
- Open a Discussion
- Check existing Issues
- Read the architecture docs in
docs/03-architecture/