Thank you for contributing to code-terminator.
Before submitting a change, make sure the work is tied to a clear problem statement and can be reproduced, reviewed, and verified by another developer.
All development work should start from an Issue. Please search existing Issues before opening a new one to avoid duplicates.
A bug report should include:
- Title:
[Bug]plus a one-line summary - Version: commit SHA, operating system, Python version, Node version if relevant
- Steps to reproduce: a minimal ordered sequence
- Expected result: what should happen
- Actual result: what happened instead
- Impact: whether it blocks a main workflow and whether a workaround exists
- Extra context: logs, screenshots, config differences, or related links
Example:
[Bug] Worker runtime fails when Docker image is unavailable
Version
- commit: abcdef1
- OS: Ubuntu 24.04
- Python: 3.11
Steps to reproduce
1. Set CODEX_WORKER_DOCKER_IMAGE to a non-existing image
2. Run uv run python scripts/dispatch_real_worker_task.py
Expected result
- The CLI returns a clear configuration error
Actual result
- The process exits with an uncaught exception
A feature request should include:
- Title:
[Feature]plus a one-line summary - Background: what is missing in the current workflow
- Goal: what the feature should improve and who benefits
- Proposal: core design, API changes, and constraints
- Alternatives: other approaches considered
- Acceptance criteria: measurable completion conditions
- Extra context: related Issues, design notes, logs, or discussions
Example:
[Feature] Add reviewer approval status to leader event stream
Background
- The UI cannot show whether a task is waiting for review
Proposal
- Add a reviewer status field in the event payload
- Persist the field in the checkpoint snapshot
Acceptance criteria
- Backend exposes reviewer status in history API
- Web UI renders the latest reviewer state
Develop on a dedicated branch. Do not commit directly to main.
Default branch prefixes:
feature/<issue-id>-<short-description>for new features and non-urgent enhancementsbugfix/<issue-id>-<short-description>for bug fixeshotfix/<issue-id>-<short-description>for urgent production fixes
Rules:
- Use lowercase letters and
kebab-case issue-idshould map to an existing Issue- Keep
short-descriptionconcise, ideally no more than five words
Examples:
feature/123-add-reviewer-status
bugfix/456-fix-history-pagination
hotfix/789-recover-worker-dispatch
For documentation-only work, maintainers may allow a branch such as docs/contributing-guide. Otherwise, use the default branch naming rules.
All Pull Requests must be linked to an Issue and reviewed before being merged into main.
Recommended workflow:
- Create or claim an Issue and confirm the acceptance criteria.
- Branch from the latest
main. - Implement code, documentation, and tests as needed.
- Review the diff locally and remove unrelated changes.
- Open a Pull Request and link the Issue, for example
Closes #123. - Wait for at least one reviewer approval before merging.
A good PR description includes:
- Background and goal
- Main implementation details
- Risks and rollback plan
- Verification commands and results
- Linked Issue number
Before opening a PR, verify:
- The PR links an Issue and includes
Closes #<id>when appropriate - The change has a focused scope
- Documentation is updated when behavior or configuration changes
- Tests are added or updated for the changed behavior
- Relevant local verification commands pass
- No secrets, tokens, personal config, or temporary debug code are committed
- Breaking changes are clearly described in the PR body
Use an Angular-style commit message:
type(scope): subject
Rules:
typeis lowercase; common values includefeat,fix,docs,refactor,test,chore, andciscopeis optional; use a module name such asapi,worker, orwebsubjectshould be concise and imperative; do not end it with a period
Examples:
feat(api): add reviewer status to history response
fix(worker): handle missing docker image gracefully
docs(readme): clarify local runtime requirements
test(app): cover invalid plan state transitions
Recommendations:
- Keep one commit focused on one clear goal
- Avoid vague messages such as
updateorfix stuff - Split large changes into reviewable commits when practical
Prefer the existing repository structure, naming style, and module boundaries.
General expectations:
- Python code should support
Python >= 3.11 - Keep functions focused and avoid unrelated refactors
- Update documentation when adding public APIs, state fields, or configuration
- Keep frontend and backend field names, types, and documentation aligned
- Avoid committing generated runtime artifacts, logs, tokens, or local-only files
Bug fixes and new features should include tests or explain why tests are not practical.
For Python changes, run:
uv run pytestFor targeted checks, run the most relevant tests, for example:
uv run pytest tests/test_leader_event_runtime.py tests/test_leader_query_set.pyFor changes touching the isolated execution / Kimi integration path, run the local integration script when applicable:
uv run --python python3.12 python scripts/run_kimi_local_integration.pyTo include the real Kimi integration pytest case, enable it explicitly:
RUN_KIMI_LOCAL_INTEGRATION=1 \
OPENAI_BASE_URL="https://your-openai-compatible-endpoint" \
OPENAI_API_KEY="your-api-key" \
uv run --python python3.12 pytest -q tests/test_kimi_local_integration.pyFor web or full-stack changes, make sure the development environment starts:
npm run devRecommended formatting and type checks:
uv run black --check src/datagov tests/bootstrap
uv run isort --check-only src/datagov tests/bootstrap
uv run mypy --strict srcUpdate documentation when a change affects:
- setup steps
- environment variables
- API request or response shapes
- runtime state files
- worker configuration
- user-facing web behavior
- operational scripts
For English documentation links, use:
Reviewers should focus on:
- correctness and regressions
- test coverage for changed behavior
- compatibility with existing runtime contracts
- security and secret handling
- failure modes and error messages
- documentation accuracy
After tests, documentation, and review requirements are satisfied, the PR can be merged according to the repository's normal workflow.