Contributing
Development workflow, test discipline, and the pre-commit gates for codeweb.
Repository layout
codeweb is a single Rust crate with feature-gated surfaces (cli, tui, serve, mcp, jsp, java, analyze, search-sql-v2; full combines them). There is no workspace: check which module and feature your change touches first. SQL parsing lives in the separate ogsql-parser crate.
Test discipline
The repository follows test-driven development, one behavior per loop:
- Red — write a failing behavior test first. A compile error from a not-yet-existing API counts as red.
- Green — write the minimal implementation that passes; do not widen assertions to get there.
- Refactor — only with the tests green, scoped to the change path.
Rules that reviewers enforce:
- Never delete, skip, or weaken existing tests to make changes pass.
- Test names describe behavior (
should_reject_negative_amount). - Characterization tests lock current behavior of legacy paths before changing them.
- Fix the implementation when your change breaks an existing test, unless the human who wrote it says otherwise.
Pre-commit gates
Match CI exactly:
cargo build --features fullmust compile whenever a change can affect feature-gated code (new enum variants matched in other features, for example).- The skipped tests are environment-dependent in CI by design; a bare
cargo test --features fullfailing ontest_serve_*locally is a known limitation, so confirm your change did not make it worse.
Submitting changes
- Create a feature branch from
main. - Commit with the gates green.
- Push and open a pull request.
- A maintainer reviews and merges; contributors do not merge their own pull requests.