|
| 1 | +# AGENTS.md — Guidelines for AI agents working on pyobjcryst |
| 2 | + |
| 3 | +## Repository overview |
| 4 | + |
| 5 | +`pyobjcryst` is a Python binding (via Boost.Python) of the ObjCryst++ C++ |
| 6 | +library. It is built and maintained with |
| 7 | +[scikit-package](https://scikit-package.github.io/scikit-package/), which |
| 8 | +provides the release scripts, CI workflows, and changelog tooling used here. |
| 9 | + |
| 10 | +The C++ bindings live under `src/extensions/`; pure-Python wrappers and |
| 11 | +utilities are in `src/pyobjcryst/`. Tests live in `tests/`. |
| 12 | + |
| 13 | +## Dependency chain |
| 14 | + |
| 15 | +``` |
| 16 | +vincefn/objcryst ← real upstream (C++ library, GUI, Fox) |
| 17 | + ↓ |
| 18 | +diffpy/libobjcryst ← repackages ObjCryst++ as a shared library for conda/pip |
| 19 | + ↓ |
| 20 | +diffpy/pyobjcryst ← Python bindings (this repo) |
| 21 | +``` |
| 22 | + |
| 23 | +**Any C++ feature or fix must flow through the full chain before it can land |
| 24 | +here:** |
| 25 | + |
| 26 | +1. Implement or fix it in [vincefn/objcryst](https://github.com/vincefn/objcryst). |
| 27 | +2. Pick it up in [diffpy/libobjcryst](https://github.com/diffpy/libobjcryst) |
| 28 | + (libobjcryst is a convenience repackaging — updating the vendored sources |
| 29 | + and cutting a release is usually all that is needed). |
| 30 | +3. Only then expose or rely on it in pyobjcryst. |
| 31 | + |
| 32 | +If a PR here is blocked on an upstream change, note the upstream issue/PR in |
| 33 | +the description and news item. |
| 34 | + |
| 35 | +## Branching and commits |
| 36 | + |
| 37 | +- Always branch from `main`. |
| 38 | +- Use [Conventional Commits](https://www.conventionalcommits.org/) prefixes: |
| 39 | + `fix:`, `feat:`, `docs:`, `refactor:`, `test:`, `chore:`, etc. |
| 40 | +- Keep commits focused and atomic. |
| 41 | +- Make sure `git config user.email` is a verified address on the author's |
| 42 | + GitHub account so commits are attributed correctly. |
| 43 | + |
| 44 | +## Coding standards |
| 45 | + |
| 46 | +1. Where possible, make the code conform to Billinge group coding |
| 47 | + standards. These can be found in the documentation of |
| 48 | + [scikit-package](https://scikit-package.github.io/scikit-package/) |
| 49 | + |
| 50 | +## Before opening a PR |
| 51 | + |
| 52 | +1. **News item** — every PR that changes user-visible behaviour must add a |
| 53 | + file `news/<PR-number>.rst` following `news/TEMPLATE.rst` (sections: |
| 54 | + `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`; leave |
| 55 | + unused sections as `* <news item>`). |
| 56 | + The `check-news-item` CI job (provided by scikit-package release scripts) |
| 57 | + enforces this. |
| 58 | +2. **Do not edit `CHANGELOG.rst` directly** — it is auto-generated from the |
| 59 | + `news/` items at release time by the scikit-package tooling. |
| 60 | +3. Run the test suite locally before pushing if possible: `pytest tests/` |
| 61 | + |
| 62 | +## CI checks on PRs |
| 63 | + |
| 64 | +| Workflow | Trigger | What it does | |
| 65 | +| ----------------- | -------- | --------------------------------------------------- | |
| 66 | +| `tests-on-pr` | every PR | Builds the C extension and runs the full test suite | |
| 67 | +| `check-news-item` | every PR | Verifies a `news/<PR-number>.rst` file exists | |
| 68 | + |
| 69 | +Both workflows are provided by `scikit-package/release-scripts`. |
| 70 | + |
| 71 | +## Merge policy — human review required |
| 72 | + |
| 73 | +**PRs must never be auto-merged.** Every PR requires at least one human |
| 74 | +review and approval before merging, regardless of CI status. |
| 75 | +Do not use `gh pr merge --auto` or any equivalent automated merge on this |
| 76 | +repository. |
| 77 | + |
| 78 | +## What agents should NOT do |
| 79 | + |
| 80 | +- Do not force-push to `main`. |
| 81 | +- Do not bypass CI or skip the news-item requirement. |
| 82 | +- Do not merge PRs autonomously — always leave them open for human review. |
| 83 | +- Do not commit secrets, credentials, or large binary files. |
| 84 | +- Do not expose a new C++ feature in pyobjcryst before it is available in a |
| 85 | + released version of diffpy/libobjcryst. |
0 commit comments