Skip to content

Commit 5948849

Browse files
committed
refine language
1 parent 8b86d64 commit 5948849

File tree

2 files changed

+93
-98
lines changed

2 files changed

+93
-98
lines changed

docs/community/contributing.md

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
# Contributing Guide
22

3-
Agent Lightning welcomes contributions of all sizes: from bug fixes to new features and documentation.
4-
This guide walks you through getting a local environment ready, following our branching strategy, and opening a high-quality pull request.
3+
Agent Lightning thrives on community improvements, whether you are polishing docs, fixing bugs, or building new features. This guide shows the shortest path from cloning the repository to shipping a polished pull request.
54

65
## Step 1. Prepare Your Environment
76

87
### Prerequisites
98

10-
- **Python**: Version 3.10 or newer (the project is tested on 3.10–3.13).
11-
- **uv**: We use [uv](https://docs.astral.sh/uv/) for dependency management and packaging speed. Install it via the instructions in the [official docs](https://docs.astral.sh/uv/getting-started/installation/).
12-
- **Git**: Ensure you have Git installed and configured with your GitHub account.
9+
- **Python** 3.10 or newer (we test on 3.10–3.13).
10+
- **uv** for dependency and virtual environment management. Install it from the [official uv docs](https://docs.astral.sh/uv/getting-started/installation/).
11+
- **Git** configured with your GitHub credentials.
1312

1413
### Clone the Repository
1514

16-
Fork the repository on GitHub, then clone your fork and add the upstream remote:
15+
Fork the repo, then clone your fork and register the upstream remote so you can stay current:
1716

1817
```bash
1918
git clone [email protected]:<your-username>/agent-lightning.git
2019
cd agent-lightning
2120
git remote add upstream https://github.com/microsoft/agent-lightning.git
2221
```
2322

24-
### Sync Dependencies
23+
### Install Dependencies
2524

26-
Install the development toolchain with uv:
25+
Install the standard development toolchain:
2726

2827
```bash
2928
uv sync --group dev
3029
```
3130

32-
Need the full experience (algorithms, examples, GPU extras)? Enable the appropriate groups in one command:
31+
Want GPU extras, example dependencies, or other optional features? Pin everything in one pass:
3332

3433
```bash
3534
uv sync --frozen \
@@ -42,92 +41,94 @@ uv sync --frozen \
4241
--no-default-groups
4342
```
4443

45-
After `uv sync`, either prefix commands with `uv run ...` (or `uv run --no-sync` if you prefer), or activate the virtual environment from `.venv/`.
44+
After `uv sync`, run commands with `uv run ...` (or `uv run --no-sync` once the environment is locked), or activate the virtual environment in `.venv/`.
4645

4746
---
4847

4948
## Step 2. Install and Run Pre-commit
5049

51-
Code style and linting are enforced via [pre-commit](https://pre-commit.com/). Install the hooks once and run them before you push:
50+
We enforce formatting and linting with [pre-commit](https://pre-commit.com/). Install the hooks once, then run them before every push:
5251

5352
```bash
5453
uv run pre-commit install
54+
55+
# The following will auto-run if you have set up the pre-commit hooks to run automatically on commit.
5556
uv run pre-commit run --all-files --show-diff-on-failure --color=always
5657
```
5758

58-
Running the hooks locally saves you from CI failures and keeps diffs clean.
59+
Running them locally saves a CI round-trip and keeps diffs tidy.
5960

6061
---
6162

6263
## Step 3. Branching Workflow
6364

64-
Always start from an up-to-date `main`:
65+
Start from a fresh `main`, then branch for your change:
6566

6667
```bash
6768
git fetch upstream
6869
git checkout main
6970
git merge upstream/main
7071
```
7172

72-
Create a topic branch using one of the naming prefixes below:
73+
Create a topic branch with one of these prefixes:
7374

74-
- `feature/<short-description>` new features
75-
- `fix/<short-description>` bug fixes
76-
- `docs/<short-description>` documentation-only updates
77-
- `chore/<short-description>` tooling or maintenance tweaks
75+
- `feature/<short-description>` for new features
76+
- `fix/<short-description>` for bug fixes
77+
- `docs/<short-description>` for documentation-only work
78+
- `chore/<short-description>` for tooling or maintenance
7879

79-
Use lowercase words separated by hyphens (e.g. `feature/async-runner-hooks`).
80+
Stick to lowercase words separated by hyphens, e.g. `feature/async-runner-hooks`.
8081

8182
---
8283

83-
## Step 4. Run Tests and Checks
84+
## Step 4. Test Your Changes
8485

85-
Most code changes should be backed by automated tests. Use the `uv run` prefix so the commands execute inside the project virtual environment.
86+
Most updates should ship with automated checks. Preface commands with `uv run` so they use the project environment.
8687

87-
**Run the full test suite:**
88+
**Full test suite**
8889

8990
```bash
9091
uv run pytest -v
9192
```
9293

93-
**Target a specific module or test:**
94+
**Targeted tests**
9495

9596
```bash
9697
uv run pytest tests/path/to/test_file.py -k test_name
9798
```
9899

99-
**Run optional tests:**
100+
**Optional/gated tests**
100101

101-
When you have a GPU or have an environment set up like `OPENAI_API_KEY`, related tests will be included and run automatically.
102+
GPU-specific suites or API-dependent tests run automatically when the required hardware or environment variables (such as `OPENAI_API_KEY`) are present.
102103

103-
**Type checking:**
104+
**Static analysis**
104105

105106
```bash
106107
uv run pyright
107108
```
108109

109-
When touching integrations located in `examples/`, review the README inside each example directory for additional smoke-test instructions.
110+
Touching code under `examples/`? Each directory includes a README with example-specific smoke tests—run those too.
110111

111112
---
112113

113-
## Step 5. Build and Validate Documentation
114+
## Step 5. Build Documentation (When Applicable)
114115

115-
If your change touches documentation, verify it builds cleanly:
116+
Doc changes should build cleanly before you push:
116117

117118
```bash
118-
uv run mkdocs serve --strict # live reload during editing
119-
uv run mkdocs build --strict # CI-equivalent check
119+
uv run mkdocs serve --strict # live reload while editing
120+
uv run mkdocs build --strict # CI-equivalent validation
120121
```
121122

122-
The `--strict` flag matches our CI settings and turns warnings into errors so you can catch issues early.
123+
`--strict` matches CI and promotes warnings to errors so you catch them early.
123124

124125
---
125126

126-
## Step 6. Before You Push
127+
## Step 6. Final Local Checks
127128

128-
- Run the pre-commit hooks (`uv run pre-commit run --all-files`). If you have installed the hooks, the Git client will run them automatically on `git commit`.
129-
- Execute the relevant tests (see the previous section for examples).
130-
- For changes affecting examples, follow the README inside each `examples/<name>/` directory to validate manually as needed.
129+
- Run `uv run pre-commit run --all-files` (hooks installed via `pre-commit install` run automatically on `git commit`, but rerun them if you amended history).
130+
- Execute the relevant test commands from Step 4.
131+
- Validate any affected examples by following the instructions in `examples/<name>/README`.
131132

132133
---
133134

@@ -137,14 +138,12 @@ The `--strict` flag matches our CI settings and turns warnings into errors so yo
137138
```bash
138139
git push origin <branch-name>
139140
```
140-
2. Open a pull request against `microsoft/agent-lightning:main`.
141-
3. Fill out the PR description with:
142-
143-
- A summary of the change.
144-
- A checklist of tests or commands you ran.
145-
- Links to related issues (use `Fixes #123` to auto-close).
146-
147-
4. Add screenshots or terminal output when they help reviewers understand the change.
148-
5. Respond to review feedback promptly; keep commits focused and consider using fixup commits (`git commit --fixup`) for clarity.
149-
150-
Thank you for contributing. Your improvements help the entire Agent Lightning community!
141+
2. Open a PR against `microsoft/agent-lightning:main`.
142+
3. Complete the PR template with:
143+
- A concise summary of the change.
144+
- The tests or commands you ran (copy from Step 4/6).
145+
- Linked issues (use `Fixes #123` to auto-close).
146+
4. Attach screenshots or terminal output when it clarifies behavior.
147+
5. Address review feedback promptly. Use focused commits, and consider `git commit --fixup` for follow-up adjustments.
148+
149+
Thanks for contributing—every improvement grows the Agent Lightning community!

docs/community/maintainers.md

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,86 @@
11
# Maintainer Guide
22

3-
This guide documents the day-to-day workflows for the Agent Lightning maintainers, including how to cut a release, interact with CI, and backport fixes.
3+
This guide describes the day-to-day responsibilities for Agent Lightning maintainershow to bump versions, run release ceremonies, interact with CI, and backport fixes safely.
44

55
## Release Workflow
66

7-
Follow this checklist throughout a release cycle.
7+
Follow this checklist throughout each release cycle.
88

9-
### After the Last Release
9+
### Immediately After Shipping
1010

11-
We start from the time when the previous release has just been out.
11+
Agent Lightning uses a **bump-first** strategy. As soon as a release is published:
1212

13-
Agent-lightning follows a **bump version first** strategy. We bump to next version immediately after a release is out. To bump the version, update the following files:
14-
15-
- `pyproject.toml`: Update the `version` field.
16-
- `agentlightning/__init__.py`: Update the `__version__` variable if present.
17-
- `uv.lock`: Run `uv lock` to update the lockfile with the new version.
18-
19-
We also bump dependency versions as needed to keep up with ecosystem changes.
20-
21-
```bash
22-
uv lock --upgrade
23-
```
24-
25-
If the last release is a new major or minor version, create a new stable branch from `main`:
13+
1. Update version metadata:
14+
- `pyproject.toml`: bump the `version`.
15+
- `agentlightning/__init__.py`: update `__version__` if it exists.
16+
- `uv.lock`: refresh the lock file after the bump.
17+
2. Refresh dependency pins as needed:
18+
```bash
19+
uv lock --upgrade
20+
```
2621

27-
```bash
28-
git checkout main
29-
git pull upstream main
30-
git checkout -b stable/v2.0.x # <-- adjust version as needed
31-
git push upstream stable/v2.0.x
32-
```
22+
3. For a new minor or major release, create a stable branch from `main`:
23+
```bash
24+
git checkout main
25+
git pull upstream main
26+
git checkout -b stable/v2.0.x # adjust to the new series
27+
git push upstream stable/v2.0.x
28+
```
3329

34-
Notice that the stable branch requires merging via pull requests once you have pushed it to the upstream remote.
30+
All future changes to the stable branch must land via pull requests.
3531

36-
### Preparing for a New Release
32+
### Preparing the Next Release
3733

38-
When it's time to prepare a new release, follow these steps below.
34+
When it is time to publish the next version:
3935

40-
1. **Prepare Release Note Draft**: Start collecting all the changes since the last release, and write the changes in `docs/changelog.md` under a new heading for the upcoming version.
41-
2. **Open a Pull Request**: Open a PR against `main` (if it's a minor/major release) or the relevant stable branch (if it's a patch release) with the draft release notes. Use the title `[Release] vX.Y.Z`.
42-
3. **Run CI checks**: Label the PR with `ci-all` and comment `/ci` to run all the tests, including GPU and example pipelines. Address any issues that arise.
43-
4. **Merge the release PR**: Once all checks pass and the release notes are finalized, merge the PR.
44-
5. **Create a tag for the release**: After merging, create a tag that matches the version:
36+
1. **Draft release notes** in `docs/changelog.md`, collecting every notable change since the previous tag.
37+
2. **Open a release PR** targeting `main` (for minor/major) or the relevant stable branch (for patch releases). Use the title `[Release] vX.Y.Z`.
38+
3. **Run extended CI** by labeling the PR with `ci-all` and commenting `/ci`. Investigate and resolve any failures.
39+
4. **Merge the release PR** once notes are final and CI is green.
40+
5. **Tag the release** from the branch you just merged into:
4541

4642
```bash
47-
git checkout main # <-- if it's a minor/major release
48-
git checkout stable/vX.Y.Z # <-- if it's a patch release
43+
git checkout main # minor/major releases
44+
git checkout stable/vX.Y.Z # patch releases
4945
5046
git pull
5147
git tag vX.Y.Z -m "Release vX.Y.Z"
5248
git push upstream vX.Y.Z
5349
```
5450

55-
Pushing the tag triggers the PyPI publish and documentation deployment workflows.
51+
Pushing the tag publishes to PyPI and deploys the documentation.
5652

57-
6. **Create the GitHub release**: Use the prepared notes from the PR to create a new GitHub release. Verify that the docs site shows the new version and the new package are available on PyPI.
53+
6. **Publish the GitHub release** using the drafted notes, and confirm the docs site and PyPI listing reflect the new version.
5854

5955
## Working with CI Labels and `/ci`
6056

61-
Long-running jobs such as GPU training or example end-to-end runs are opt-in on pull requests. To trigger them:
57+
GPU suites and example end-to-end runs are opt-in. To trigger them on a pull request:
6258

63-
1. Add one or more of the following labels to the PR before issuing the command:
64-
- `ci-all` — run every repository-dispatch aware workflow.
65-
- `ci-gpu` — run the GPU integration tests (`tests-full.yml`).
66-
- `ci-apo`, `ci-calc-x`, `ci-spider`, `ci-unsloth`, `ci-compat` — run the corresponding example pipelines.
67-
2. Comment `/ci` on the pull request. The `issue-comment` workflow will acknowledge the command and track results inline.
68-
3. Remove labels once the signal is collected to avoid accidental re-triggers.
59+
1. Apply the appropriate labels before issuing the command:
60+
- `ci-all` for every repository-dispatch workflow.
61+
- `ci-gpu` for GPU integration tests (`tests-full.yml`).
62+
- `ci-apo`, `ci-calc-x`, `ci-spider`, `ci-unsloth`, `ci-compat` for the individual example pipelines.
63+
2. Comment `/ci` on the PR. The `issue-comment` workflow acknowledges the request and tracks job results inline.
64+
3. Remove the labels once you have the signal to avoid accidental re-runs.
6965

70-
Use `/ci` whenever a change affects shared infrastructure, dependencies, or training logic that requires extra validation beyond the default PR checks.
66+
Use `/ci` whenever changes touch shared infrastructure, dependencies, or training loops that require coverage beyond the default PR checks.
7167

7268
!!! note
7369

74-
When invoking `/ci` on PR, the workflow always runs against the workflow defined on the main branch. It then checks out the PR changes within the workflow. So if you need to modify the workflow itself, push the changes to a branch on the first-party repository first, and then run:
70+
`/ci` always executes the workflow definitions on the current `main` branch, then checks out the PR diff. If you need to test workflow modifications, push the changes to a branch in the upstream repo and run:
7571

7672
```bash
7773
gh workflow run examples-xxx.yml --ref your-branch-name
7874
```
7975

8076
## Backporting Pull Requests
8177

82-
We rely on automated backports for supported stable branches.
78+
Supported stable branches rely on automated backports:
8379

84-
1. Decide which stable branch should receive the fix (for example, `stable/v0.2.x`).
85-
2. Before merging the PR into `main`, add a label matching `stable/<series>` (e.g., `stable/v0.2.x`).
86-
3. The `backport.yml` workflow creates a new PR named `backport/<original-number>/<target-branch>` authored by `agent-lightning-bot`.
87-
4. Review the generated backport PR, ensure CI passes, and merge it into the target branch.
88-
5. If conflicts arise, push manual fixes directly to the backport branch and re-run `/ci` as needed.
80+
1. Identify the target branch (for example `stable/v0.2.x`).
81+
2. Before merging the original PR into `main`, add the matching `stable/<series>` label (e.g. `stable/v0.2.x`).
82+
3. The `backport.yml` workflow opens a follow-up PR named `backport/<original-number>/<target-branch>` authored by `agent-lightning-bot`.
83+
4. Review the generated PR, ensure CI is green, and merge into the stable branch.
84+
5. Resolve conflicts by pushing manual fixes to the backport branch and re-running `/ci` if required.
8985

90-
Keep the stable branches healthy by cherry-picking only critical fixes and ensuring their documentation and example metadata stay in sync with the release lines.
86+
Keep stable branches healthy by cherry-picking only critical fixes and ensuring documentation and example metadata stay aligned with each release line.

0 commit comments

Comments
 (0)