Skip to content

docs(agents): refine AGENTS.md#2308

Merged
Borda merged 11 commits into
developfrom
docs/agents.md
Jun 10, 2026
Merged

docs(agents): refine AGENTS.md#2308
Borda merged 11 commits into
developfrom
docs/agents.md

Conversation

@Borda

@Borda Borda commented Jun 10, 2026

Copy link
Copy Markdown
Member

This pull request significantly expands and clarifies the AGENTS.md guidelines for contributors and AI agents, bringing them into closer alignment with the project's architecture and conventions. The updates introduce detailed descriptions of the repository structure, coding and testing standards, and explicit rules for extending, deprecating, and testing APIs. The document now provides a comprehensive, structured reference for both human and AI contributors.

Key improvements and additions:

Repository Structure and Design Patterns

  • Added a detailed table and descriptions of all core modules in src/supervision/, including the purpose of each, and clarified the use of Detections as the central data structure. Key design patterns (e.g., vectorization, extensibility, stateless functions) are now explicitly documented.

Coding Standards and Dependencies

  • Updated conventions for formatting, linting, and type hints: pre-commit hooks are now listed explicitly, and mypy is enforced. Provided a list of required runtime dependencies and clarified lazy-import rules for heavy frameworks.
  • Clarified function/class promotion rules and docstring requirements, emphasizing Google-style docstrings with usage examples and deterministic doctests.

Testing and Doctest Conventions

  • Introduced a comprehensive section on test conventions, including the AAA structure, class grouping, parametrization, and docstring requirements for tests. Added detailed doctest rules to ensure deterministic and reproducible examples.

Feature Implementation and API Extension

  • Added step-by-step instructions for extending Detections with new metadata, including the use of constants from config.py. Provided a template for adding new model connectors and clarified where VLM connectors should reside.

Deprecation and Refactoring

  • Added explicit deprecation guidelines, including mechanisms for module-level, parameter, and public API deprecation, with required version annotations. Clarified the process for refactoring, emphasizing the use of deprecation machinery when changing public APIs. [1] [2]

Test Baseline and Pre-Commit Process

  • Improved instructions for pre-commit and test verification: contributors are now required to capture a baseline of test results before making changes and must ensure no new test failures are introduced.

…on guidance

- Add §2 Repository Architecture: full core module table and key design patterns
- Add §4 Test Conventions (promoted from §3a): AAA, class grouping, parametrize, doctest rules
- Add §6 Deprecated Module Aliases: keypoint → key_points migration guide
- Add §7 Deprecating APIs: mechanism table (warn_deprecated, deprecated_parameter, @deprecated)
- Add Extending Detections and Adding Model Connector subsections to §5
- Add Runtime Dependencies section with lazy-import rule
- Add baseline/diff workflow to §10 Before You Commit
- Add CONTRIBUTING.md conflict-resolution rule at top
- mypy now noted as enforced by pre-commit (not just encouraged)
- Section numbers renumbered throughout (old 3→new 3, 3a→4, 4→8, 5→9, 6→10)

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80%. Comparing base (8a40630) to head (9b851ce).

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #2308   +/-   ##
=======================================
  Coverage       80%     80%           
=======================================
  Files           66      66           
  Lines         8787    8787           
=======================================
  Hits          7046    7046           
  Misses        1741    1741           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Borda and others added 2 commits June 10, 2026 20:22
Replace module and deprecation tables with bullet lists; merge bugs/refactoring sections; trim filler prose. All technical substance preserved.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Fenced ASCII tree makes filesystem hierarchy explicit and more token-efficient for LLM consumers.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@Borda Borda marked this pull request as ready for review June 10, 2026 18:35
@Borda Borda requested a review from SkalskiP as a code owner June 10, 2026 18:35
Copilot AI review requested due to automatic review settings June 10, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands AGENTS.md into a more comprehensive contributor/agent reference, documenting repository architecture, coding conventions, testing expectations, and API extension/deprecation patterns to better align day-to-day contributions with the supervision codebase structure.

Changes:

  • Adds a detailed repository architecture/module map and highlights key design patterns centered around Detections.
  • Codifies conventions for formatting, typing, dependencies, doctests, and test structure.
  • Documents guidance for extending Detections, adding model/VLM connectors, and deprecating/refactoring public APIs.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Borda and others added 4 commits June 10, 2026 20:42
…TING.md

AGENTS.md: drop redundant sections already in CONTRIBUTING.md (branching,
full code style, full test structure, perf prose); keep agent-failure-mode
rules absent from CONTRIBUTING.md (heading depth, mypy enforcement, doctest
determinism, lazy-import pattern).

CONTRIBUTING.md: fix stale "no mypy" claim (mypy is enforced by pre-commit);
add Performance section; add deprecated keypoint alias note.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
AAA structure, class grouping, parametrize shape, and test docstring rules
were derived from observed bad agent behaviour and belong in AGENTS.md,
not delegated to CONTRIBUTING.md.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
CONTRIBUTING.md owns the content; AGENTS.md flags the agent-failure-mode
and links directly to the section rather than duplicating the rules.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Remove obvious import example (§4) and constants block (§6 Detections);
fold into prose. Connector template and warn_deprecated call are
repo-specific — kept.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Comment thread AGENTS.md Outdated
Borda and others added 4 commits June 10, 2026 21:35
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
…eprecate

deprecated_parameter handles old→new param renaming only; pydeprecate
@deprecated still required on the function when function itself is deprecated.
Expand third bullet to include methods.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…d placement

- Fix LineZone listed under detection/tools/ — lives in detection/line_zone.py; add as separate tree entry
- Fix unsafe git stash baseline: save refs/stash before push, only pop if ref changed after
- Clarify warn_deprecated goes in deprecated module's own __init__.py, not supervision/__init__.py
- Item #4 (style: commit type) already addressed: commit type list removed; CONTRIBUTING.md cross-ref covers it

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@Borda Borda merged commit b8ebc14 into develop Jun 10, 2026
29 checks passed
@Borda Borda deleted the docs/agents.md branch June 10, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants