template / tests
AGENTS.md20 starsChanged 3 months agoApache-2.0View on GitHub
The tests/ directory contains repository-wide tests for infrastructure, integrations, and behavioral contracts that cross module boundaries. scripts/audit/verify_no_mocks.py defaults to the enforced lexical gate. Exit 0 proves that prohibited mock-framework imports and calls are absent; it does not prove that every dependency is real. Run --inventory to classify pytest.monkeypatch operations. setenv, delenv, and chdir are reported as environment isolation, while setattr, setitem, and their deletion variants are conservatively reported as dependency-replacement debt. CI and pre-push enforce a zero ceiling for dependency…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository37 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- fonds/AGENTS.mdAGENTS.md
- .github/actions/AGENTS.mdAGENTS.md
- .github/actions/setup-docs-lint/AGENTS.mdAGENTS.md
- .github/actions/setup-python-env/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/ISSUE_TEMPLATE/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- infrastructure/AGENTS.mdAGENTS.md
- projects/AGENTS.mdAGENTS.md
- rules/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- advanced-evaluationSkill
- bdi-mental-statesSkill
- context-compressionSkill
- context-degradationSkill
- context-fundamentalsSkill
- context-optimizationSkill
- evaluationSkill
- filesystem-contextSkill
- harness-engineeringSkill
- hosted-agentsSkill
- latent-briefingSkill
- long-horizon-promptingSkill
- memory-systemsSkill
- multi-agent-patternsSkill
- project-developmentSkill
- self-improvement-loopsSkill
- tool-designSkill
- continual-learningSkill
- gauss-open-gauss-cliSkill
- infrastructure-overviewSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use real data and real execution paths.
- Very specific: line 10
Do not use mock frameworks (unittest.mock, MagicMock, mocker.patch) or replace the unit under test with fake behavior.
- Distinctive: line 12
Prefer subprocess calls for CLI behavior.
- Distinctive: line 13
Use temporary files and directories for filesystem behavior.
- Distinctive: line 14
Use HTTP test servers for HTTP behavior.
- Very specific: line 50
Default slug `template_test is the canonical synthetic stand-in.
- Distinctive: line 63
Keep README.md files aligned with the live test tree.
- Distinctive: line 64
Keep per-folder AGENTS.md files accurate and specific to the folder they document.
- Very specific: line 68
Canonical: Run one pytest process per projects/<name>/tests/ tree.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tests/ - Repository Test Documentation
Purpose
The tests/ directory contains repository-wide tests for infrastructure, integrations, and behavioral contracts that cross module boundaries.
Standards
- Use real data and real execution paths.
- Do not use mock frameworks (
unittest.mock,MagicMock,mocker.patch) or replace the unit under test with fake behavior. pytest.monkeypatchis acceptable for environment variables, current working directories, import paths, and test-server URLs when the test still exercises real code paths.- Prefer subprocess calls for CLI behavior.
- Use temporary files and directories for filesystem behavior.
- Use HTTP test servers for HTTP behavior.
Automated gate versus semantic inventory
scripts/audit/verify_no_mocks.py defaults to the enforced lexical gate. Exit
0 proves that prohibited mock-framework imports and calls are absent; it does
not prove that every dependency is real. Run --inventory to classify
pytest.monkeypatch operations. setenv, delenv, and chdir are reported as
environment isolation, while setattr, setitem, and their deletion variants
are conservatively reported as dependency-replacement debt. CI and pre-push
enforce a zero ceiling for dependency replacements; environment isolation is
reported separately and remains permitted.
uv run python scripts/audit/verify_no_mocks.py
uv run python scripts/audit/verify_no_mocks.py --inventory --max-dependency-replacements 0Current Subtrees
tests/_support/- shared test helpers (canonical ephemeral project scaffold factory)tests/infra_tests/- infrastructure module coveragetests/integration/- end-to-end and orchestration coveragetests/regression/- pinned-value regression tier (real exemplar projects only)
Synthetic project scaffold factory
Infrastructure and integration tests that need a minimum-valid project tree
under tmp_path should use tests/_support/projects.py:
make_project(root, name="template_test", ...)— one project underprojects/<name>/orprojects/<program>/<name>/(passprogram="templates"for qualified names liketemplates/template_test).make_repo(root, names=(...))— repository root with multiple synthetic projects.repo_layout=False— standalone project at<root>/<name>/(integration fixtures).
Default slug template_test is the canonical synthetic stand-in. Do not
create a git-tracked template_test project under projects/ — contract,
public-scope, and regression tests continue to reference the public exemplars in
docs/_generated/active_projects.md.
Coverage Expectations
- Infrastructure code is held to the repository coverage floor in
tests/infra_tests/. - Integration tests should confirm the pipeline and shell entry points remain wired correctly.
- The project pipeline uses a curated
pipeline-smokeinfrastructure subset for speed; the full infrastructure coverage gate remains explicit (scripts/pipeline/stage_01_test.py --infra-only --infra-scope full).
Documentation Expectations
- Keep
README.mdfiles aligned with the live test tree. - Keep per-folder
AGENTS.mdfiles accurate and specific to the folder they document.
Multi-project pytest and conftest.py
Canonical: Run one pytest process per projects/<name>/tests/ tree. Use
infrastructure.core.test_runner.run_per_project_pytest (from
scripts/pipeline/stage_01_test.py), or invoke
uv run pytest projects/<name>/tests/ for a single workspace. The local
--project-only --all-projects orchestrator can merge coverage with
--cov-append; CI test-project runs each public exemplar in its own matrix
job.
Unsupported: One pytest collection that spans multiple
projects/*/tests/ directories when more than one of them defines
tests/conftest.py. Pytest loads each conftest as a plugin; the shared
basename collides (ValueError: plugin already registered). The workaround is
the per-project subprocess model above, not a single mega pytest command.
References: infrastructure/core/testing/test_runner.py,
tests/infra_tests/core/test_test_runner_per_project.py,
infrastructure/core/testing/project_test_matrix.py
(bounded per-project subprocess matrix with duplicate-index rejection).
See Also
README.mdinfra_tests/AGENTS.mdintegration/AGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

