|
| 1 | +# Contributing to Gr0m_Mem |
| 2 | + |
| 3 | +Thanks for your interest! This file is the practical "how do I help" |
| 4 | +guide. The governance contract is in |
| 5 | +[`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) and the disclosure policy |
| 6 | +is in [`SECURITY.md`](SECURITY.md). |
| 7 | + |
| 8 | +## Before you open an issue or PR |
| 9 | + |
| 10 | +- **Security issues** — please do NOT open a public issue. Use the |
| 11 | + GitHub private vulnerability reporting button on the Security tab, |
| 12 | + or email the maintainer. See [`SECURITY.md`](SECURITY.md) for the |
| 13 | + full disclosure policy. |
| 14 | +- **Bug reports** — use the **Bug report** issue template |
| 15 | + (`.github/ISSUE_TEMPLATE/bug_report.yml`). Include: |
| 16 | + - Gr0m_Mem version (`gr0m_mem --version`) |
| 17 | + - Python version (`python --version`) |
| 18 | + - OS and arch (`uname -a` on Unix) |
| 19 | + - Backend selected (`gr0m_mem doctor`) |
| 20 | + - A minimal reproducer |
| 21 | + - The actual error or unexpected behavior |
| 22 | +- **Feature requests** — use the **Feature request** template. Tell us |
| 23 | + the problem you're trying to solve before the solution you have in |
| 24 | + mind. We're more likely to merge a small change that addresses a |
| 25 | + real pain point than a big change that adds options. |
| 26 | +- **Questions** — open a GitHub Discussion instead of an issue. |
| 27 | + |
| 28 | +## Local development setup |
| 29 | + |
| 30 | +```bash |
| 31 | +# Clone your fork |
| 32 | +git clone https://github.com/<you>/gr0m_mem.git |
| 33 | +cd gr0m_mem |
| 34 | + |
| 35 | +# Use uv (fast) — recommended |
| 36 | +uv venv --python 3.12 |
| 37 | +uv pip install -e ".[dev]" |
| 38 | + |
| 39 | +# Or use plain pip + venv |
| 40 | +python3.12 -m venv .venv |
| 41 | +source .venv/bin/activate |
| 42 | +pip install -e ".[dev]" |
| 43 | +``` |
| 44 | + |
| 45 | +## Running the checks locally |
| 46 | + |
| 47 | +The CI runs the exact same three commands, so if these pass locally |
| 48 | +the PR will pass CI: |
| 49 | + |
| 50 | +```bash |
| 51 | +.venv/bin/python -m ruff check gr0m_mem tests benchmarks |
| 52 | +.venv/bin/python -m mypy gr0m_mem benchmarks |
| 53 | +.venv/bin/python -m pytest -q |
| 54 | +``` |
| 55 | + |
| 56 | +For the loop-prevention benchmark (required to stay at 100%): |
| 57 | + |
| 58 | +```bash |
| 59 | +.venv/bin/python -m benchmarks.loop_prevention.run --strict |
| 60 | +``` |
| 61 | + |
| 62 | +## Coding conventions |
| 63 | + |
| 64 | +- **Python 3.10+**, `from __future__ import annotations` at the top of |
| 65 | + every file |
| 66 | +- **Ruff** with the lint rules in `pyproject.toml` (E, F, I, B, UP, SIM). |
| 67 | + No ignores without a comment explaining why |
| 68 | +- **Mypy `--strict`** — every function signature gets type hints, no |
| 69 | + `Any` leakage across module boundaries |
| 70 | +- **Conventional Commits** for commit messages (`feat:`, `fix:`, |
| 71 | + `docs:`, `test:`, `ci:`, `refactor:`, `perf:`, `chore:`, `sec:`, |
| 72 | + optionally scoped like `feat(store):`) |
| 73 | +- **Tests first** for any non-trivial change. Public API changes need |
| 74 | + tests in `tests/unit/` (or `tests/temporal/` for KG changes, or |
| 75 | + `tests/integration/` for CLI/hook round trips) |
| 76 | +- **No LLM calls from inside the library** — Gr0m_Mem produces context |
| 77 | + blocks, it does not reason about them. See the rationale in |
| 78 | + [`README.md`](README.md) |
| 79 | + |
| 80 | +## Pull request flow |
| 81 | + |
| 82 | +1. Open an issue first if the change is non-trivial — "non-trivial" = |
| 83 | + anything that adds or removes a public symbol, changes the on-disk |
| 84 | + format, or touches the MCP tool surface |
| 85 | +2. Fork, branch (`feat/short-topic` or `fix/short-topic`), make the |
| 86 | + change, make sure the three local checks pass |
| 87 | +3. Open the PR using the template (`.github/PULL_REQUEST_TEMPLATE.md`) |
| 88 | +4. CI runs across macOS + Ubuntu on Python 3.10, 3.11, 3.12. All three |
| 89 | + matrix cells plus the loop-prevention benchmark must be green |
| 90 | +5. The maintainer is `@MichaelAdamGroberman` and is auto-requested as |
| 91 | + a reviewer via `CODEOWNERS` |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +By contributing you agree that your contribution will be licensed |
| 96 | +under the [MIT License](LICENSE) that covers this project. |
0 commit comments