Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,44 @@ repos/{owner}/{repo}/milestones --jq '.[].title'`, and pick the best match.
end on clarifications unless truly blocked. Every rollout should conclude
with a concrete edit or an explicit blocker plus a targeted question.

## Test authorship markers

Use pytest markers to make the provenance of newly added unit tests explicit.
Keep this provenance system minimal: choose from only these three markers.
Place the marker immediately above each test function. A class-level marker is
acceptable only when every test method in the class has the same provenance.
Do not use module-level `pytestmark` for authorship provenance; it is too easy
to miss in large files and makes later per-test provenance changes ambiguous.

- `@pytest.mark.agent_authored(model="<model>")`: the test was authored by an
agent and has not yet been materially reviewed or rewritten by a human.
Agents must add this marker when generating new unit tests, for example:

```python
import pytest

@pytest.mark.agent_authored(model="gpt-5.5")
def test_something():
...
```

- `@pytest.mark.human_reviewed`: a human has materially reviewed or rewritten
an agent-authored test. Prefer replacing
`@pytest.mark.agent_authored(model="<model>")` with this marker instead of
keeping both.
- `@pytest.mark.human_authored`: the test was authored by a human, or
rewritten enough that the authorship is primarily human.

Use at most one authorship marker per test. Treat missing markers as legacy or
unknown provenance, not as implicit `@pytest.mark.human_authored`. Because
these are pytest markers, tests can be selected with `pytest -m`, for example
`pytest -m agent_authored`.

When an agent notices a human adding a new test or materially modifying an
existing test, suggest adding `@pytest.mark.human_authored` or replacing
`@pytest.mark.agent_authored(model="<model>")` with
`@pytest.mark.human_reviewed` as appropriate.


# Editing constraints

Expand Down
7 changes: 7 additions & 0 deletions cuda_bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ required_plugins = "pytest-benchmark"
addopts = "--benchmark-disable --showlocals"
norecursedirs = ["tests/cython", "examples"]
xfail_strict = true
# Keep this authorship marker registry in sync across all pytest config roots.
# Search for "agent_authored(model)" before editing.
markers = [
"agent_authored(model): agent-authored test not yet materially human-reviewed",
"human_reviewed: agent-authored test materially reviewed or rewritten by a human",
"human_authored: test authored primarily by a human",
]

[tool.setuptools_scm]
root = ".."
Expand Down
6 changes: 6 additions & 0 deletions cuda_core/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
[pytest]
addopts = --showlocals
norecursedirs = cython
markers =
# Keep this authorship marker registry in sync across all pytest config roots.
# Search for "agent_authored(model)" before editing.
agent_authored(model): agent-authored test not yet materially human-reviewed
human_reviewed: agent-authored test materially reviewed or rewritten by a human
human_authored: test authored primarily by a human
7 changes: 7 additions & 0 deletions cuda_pathfinder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ git_describe_command = [ "git", "describe", "--dirty", "--tags", "--long", "--ma
[tool.pytest.ini_options]
addopts = "--showlocals"
thread_unsafe_fixtures = ['mocker']
# Keep this authorship marker registry in sync across all pytest config roots.
# Search for "agent_authored(model)" before editing.
markers = [
"agent_authored(model): agent-authored test not yet materially human-reviewed",
"human_reviewed: agent-authored test materially reviewed or rewritten by a human",
"human_authored: test authored primarily by a human",
]

[tool.mypy]
# Try to keep the mypy configuration similar between the subprojects
Expand Down
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ markers =
core: tests for cuda_core
cython: cython tests
smoke: meta-level smoke tests
# Keep this authorship marker registry in sync across all pytest config roots.
# Search for "agent_authored(model)" before editing.
agent_authored(model): agent-authored test not yet materially human-reviewed
human_reviewed: agent-authored test materially reviewed or rewritten by a human
human_authored: test authored primarily by a human
flaky: mark test as flaky (provided by pytest-rerunfailures)
# pytest-run-parallel related markers
thread_unsafe: mark test as thread unsafe (provided by pytest-run-parallel)
Expand Down