Skip to content

Contributing Guide

This guide covers the contribution workflow for Valter, including branch naming, commit conventions, the PR process, CI validation, and the multi-agent coordination model used in this project.

All branches follow a consistent naming pattern:

<type>/[issue-id]-[description]

Supported types:

PrefixUse
feat/New features
fix/Bug fixes
chore/Maintenance tasks (dependency updates, cleanup)
docs/Documentation changes
refactor/Code restructuring without behavior change
test/Test additions or modifications
codex/Changes made by the Codex agent

Examples:

feat/SEN-267-mcp-auth-claude
fix/SEN-301-empty-divergence-response
chore/update-neo4j-driver
docs/configuration-reference

All commits must follow the Conventional Commits specification. The format is:

<type>: <description>

Valid types: feat, fix, chore, docs, refactor, test.

Examples:

feat: add divergence detection endpoint
fix: handle empty result set in phase analysis
chore: update Neo4j driver to 5.28
docs: add MCP configuration guide
refactor: extract query builder from retriever
test: add edge case tests for graph routes

Before starting any work, check that no other agent is working on conflicting branches:

Terminal window
git branch -a
git branch -a | grep codex # Check for active Codex branches

Create your branch from main:

Terminal window
git checkout main
git pull origin main
git checkout -b feat/SEN-XXX-description-claude

Make your changes, then run the full validation suite:

Terminal window
make quality # Runs lint + mypy (scoped) + tests

If your changes touch graph-related code:

Terminal window
make validate-aura # Required for Neo4j/graph changes

Push your branch and open a PR against main. The PR must use the template from .github/pull_request_template.md, which includes:

  • Summary: description of the problem, change, and expected impact
  • Change type: checkboxes for API/Core/Stores, Graph, Migrations, Scripts, Docs
  • Validation matrix: applicable checks completed
  • Governance: branch naming and commit convention compliance

The PR template includes a validation matrix. Mark only the items applicable to your change:

Change TypeRequired Validation
API/Core/Storesmake lint + make test + relevant regression tests
Graph (Neo4j/Aura)All above + make validate-aura + graph-specific unit tests
Migrations (Alembic)alembic upgrade head in a safe environment. Test downgrade() if the migration is reversible. If irreversible, declare it in the PR and include a contingency plan.
Scripts (scripts/)Local or staging execution allowed. Production execution requires explicit approval, a prior --dry-run, and a documented rollback plan.

If your change affects the API contract (request/response format, status codes, endpoint semantics):

  • Evaluate impact on external consumers (Juca frontend, MCP clients)
  • Avoid breaking changes in /v1 endpoints, or provide a versioning/deprecation plan
  • Update integration documentation when contracts change
  • Add or update contract tests for critical endpoints

The CI pipeline runs on every pull request:

StageWhat it checks
Lintruff check and ruff format --check on src/ and tests/
Type checkmypy on scoped files (deps, ingest routes, MCP tools)
Testpytest with verbose output and short tracebacks
Aura validationFor PRs touching graph code: make validate-aura with a 15-second latency threshold

Deployment to Railway happens automatically when changes are merged to main. Each Railway service (API, Worker, MCP Remote) rebuilds from the same codebase, differentiated by the VALTER_RUNTIME environment variable.

Valter is developed by two AI coding agents working in parallel:

AgentEnvironmentBranch convention
Claude CodeLocal executionSuffix: -claude (e.g., feat/SEN-267-mcp-auth-claude)
Codex (OpenAI)Cloud executionPrefix: codex/ (e.g., codex/sen-217-missing-integras)

Never work on the same branch as the other agent. Before starting any task:

Terminal window
# Check for active Codex branches
git branch -a | grep codex
# If a codex/ branch exists touching the same files, coordinate before proceeding
  • Each agent works on separate issues and separate files when possible
  • If both agents need to modify the same file, coordinate via separate PRs merged sequentially
  • Always pull the latest main before creating a new branch

Valter is the exclusive property of Diego Sens (@sensdiego). All conception, architecture, product decisions, and intellectual property belong to the author.

When AI agents contribute to implementation, commits use this format:

Co-Authored-By (execucao): Claude Opus 4.6 <noreply@anthropic.com>

The term (execucao) indicates that the AI agent assists with code implementation. It does not imply authorship of the design or architecture.

When making decisions about implementation, resolve conflicts in this order:

  1. Correctness — especially for legal data, billing, and data integrity
  2. Simplicity and clarity — code another agent or developer understands without additional context
  3. Maintainability — easy to modify without breaking unrelated features
  4. Reversibility — prefer decisions that can be undone
  5. Performance — optimize only with evidence of a problem