diff --git a/AGENTS.md b/AGENTS.md index dcf05d56..a43f7d0a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,7 @@ # AGENTS.md -Mandatory rules for AI coding agents. Violations will result in rejected PRs. +Mandatory rules and context for AI coding agents. +**Human contributors: Please refer to the [Contributing Guide](docs/contributing/contributing.md).** --- @@ -50,48 +51,9 @@ W&B auto-disabled in tests. `DummyDatastore` used; example data downloaded from --- -## Rules +## Mandate for AI Agents -### Issues - -1. **Search before creating.** Use any of: GitHub UI search, `gh issue list --state all --search ""`, or `curl "https://api.github.com/search/issues?q=+repo:mllam/neural-lam+type:issue"`. Duplicate issues will be closed. -2. **Every PR requires an issue.** No exceptions. Open one first if none exists. -3. **Include minimal example.** Each issue should include a minimal, reproducible example on how to easily recreate a bug, including all necessary module imports and data. Include full traceback if it is a bug-report. - -### Pull Requests - -1. **Search before creating.** Use any of: GitHub UI search, `gh pr list --state all --search ""`, or `curl "https://api.github.com/search/issues?q=+repo:mllam/neural-lam+type:pr"`. If a PR exists for the same issue, contribute there. -2. **Link the issue.** PR body must contain `closes #` or `refs #`. Unlinked PRs will be - rejected. -3. **Use the PR template.** Fill in every section of `.github/pull_request_template.md`. Do not - delete or skip sections. -4. **Read the full issue thread before writing code.** Rejected approaches and prior decisions are - there. Ignoring them wastes everyone's time. -5. **Run pre-commit hooks locally.** Linting needs to be done locally before each new commit with e.g. `uvx pre-commit run --all` -6. **Testing Mandate.** Run `pytests tests/` before opening a PR and if tests fail do not open the PR , fix the failure first. - -### Communication - -- **Terse.** One sentence per point. No preamble. No summaries of visible diffs. -- **No filler.** Ban list: "Great question", "As mentioned above", "I hope this helps", "Let me know - if you have questions", "Happy to help". -- **No obvious narration.** Do not explain what self-explanatory code does. -- **PR descriptions: what changed and why.** Nothing else. -- **One question at a time.** No shotgun lists of open-ended questions. - -### Context - -- **Re-read the entire thread** before every comment and every push. No exceptions. -- **After a context gap**, reload the full thread (GitHub UI, `gh issue view ` / `gh pr view `, or `curl "https://api.github.com/repos/mllam/neural-lam/issues/"`) before acting. -- **Never repeat** a question already answered or an approach already rejected in the thread. - -### Commits - -- Imperative form, matching existing `git log` style. -- One concern per PR. No unrelated changes. -- AI attribution of tool names is mandatory if used and should be mentioned in the commit message trailer as `Co-authored-by ` - -### Changelog - -Every PR must add a line to `CHANGELOG.md` in the section matching the change type (`Added` / `Changed` / `Fixed` / `Maintenance`). -`maintenance`). +1. **Follow Contributing Guide.** AI agents must adhere to the rules in [CONTRIBUTING.md](docs/contributing/contributing.md) (Issues, PRs, Communication style). +2. **AI Attribution.** Mandatory `Co-authored-by ` in commit trailers when AI tools are used. +3. **Context Gap.** Reload the full thread (GitHub UI or `gh` CLI) after a context gap before acting. +4. **No Placeholders.** Do not use placeholders in code or documentation. diff --git a/CHANGELOG.md b/CHANGELOG.md index fe66d213..446809c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Split `AGENTS.md` into a technical overview for AI agents and a comprehensive human-facing contributing guide in `docs/contributing/contributing.md` ([#516](https://github.com/mllam/neural-lam/issues/516)) @[yourusername] +- Replace remaining `print()` calls with `loguru` `logger.info()` in `compute_standardization_stats.py` for structured and consistent logging @[yourusername] - Change the default ensemble-loading behavior in `WeatherDataset` / `WeatherDataModule` to use all ensemble members as independent samples for ensemble datastores (with matching ensemble-member selection for forcing when available); single-member behavior now requires explicitly opting in via `--load_single_member` [\#332](https://github.com/mllam/neural-lam/pull/332) @kshirajahere - Refactor graph loading: move zero-indexing out of the model and update plotting to prepare using the research-branch graph I/O [\#184](https://github.com/mllam/neural-lam/pull/184) @zweihuehner - Replace `print()`-based `rank_zero_print` with `loguru` `logger.info()` for structured log-level control ([#33](https://github.com/mllam/neural-lam/issues/33)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..414a9d61 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# Contributing Guidelines + +Mandatory rules for contributing to Neural-LAM. Follow these guidelines to ensure your Pull Requests are accepted. + +--- + +## Issues + +1. **Search before creating.** Use any of: GitHub UI search, `gh issue list --state all --search ""`, or `curl "https://api.github.com/search/issues?q=+repo:mllam/neural-lam+type:issue"`. Duplicate issues will be closed. +2. **Every PR requires an issue.** No exceptions. Open one first if none exists. +3. **Include minimal example.** Each issue should include a minimal, reproducible example on how to easily recreate a bug, including all necessary module imports and data. Include full traceback if it is a bug-report. + +## Pull Requests + +1. **Search before creating.** Use any of: GitHub UI search, `gh pr list --state all --search ""`, or `curl "https://api.github.com/search/issues?q=+repo:mllam/neural-lam+type:pr"`. If a PR exists for the same issue, contribute there. +2. **Link the issue.** PR body must contain `closes #` or `refs #`. Unlinked PRs will be + rejected. +3. **Use the PR template.** Fill in every section of `.github/pull_request_template.md`. Do not + delete or skip sections. +4. **Read the full issue thread before writing code.** Rejected approaches and prior decisions are + there. Ignoring them wastes everyone's time. +5. **Run pre-commit hooks locally.** Linting needs to be done locally before each new commit with e.g. `uvx pre-commit run --all` +6. **Testing Mandate.** Run `pytests tests/` before opening a PR and if tests fail do not open the PR , fix the failure first. + +## Communication + +- **Terse.** One sentence per point. No preamble. No summaries of visible diffs. +- **No filler.** Ban list: "Great question", "As mentioned above", "I hope this helps", "Let me know + if you have questions", "Happy to help". +- **No obvious narration.** Do not explain what self-explanatory code does. +- **PR descriptions: what changed and why.** Nothing else. +- **One question at a time.** No shotgun lists of open-ended questions. + +## Context + +- **Re-read the entire thread** before every comment and every push. No exceptions. +- **After a context gap**, reload the full thread (GitHub UI, `gh issue view ` / `gh pr view `, or `curl "https://api.github.com/repos/mllam/neural-lam/issues/"`) before acting. +- **Never repeat** a question already answered or an approach already rejected in the thread. + +## Commits & Changelog + +- **Commit Format.** Imperative form, matching existing `git log` style. +- **One Concern per PR.** No unrelated changes. +- **AI Attribution.** Mandatory `Co-authored-by ` in commit trailers if AI tools are used. +- **CHANGELOG.** Every PR must add a line to `CHANGELOG.md` in the section matching the change type (`Added` / `Changed` / `Fixed` / `Maintenance`). + +--- +*For a technical overview intended for AI agents, see [AGENTS.md](AGENTS.md).* diff --git a/neural_lam/datastore/npyfilesmeps/compute_standardization_stats.py b/neural_lam/datastore/npyfilesmeps/compute_standardization_stats.py index 7dbcc7ef..d4b7e1ee 100644 --- a/neural_lam/datastore/npyfilesmeps/compute_standardization_stats.py +++ b/neural_lam/datastore/npyfilesmeps/compute_standardization_stats.py @@ -424,4 +424,4 @@ def cli(): if __name__ == "__main__": - cli() + cli() \ No newline at end of file