Skip to content

docs: add AGENTS.md covering codegen drift and the required checks - #60

Open
christian-byrne wants to merge 1 commit into
mainfrom
docs/agents-md
Open

docs: add AGENTS.md covering codegen drift and the required checks#60
christian-byrne wants to merge 1 commit into
mainfrom
docs/agents-md

Conversation

@christian-byrne

Copy link
Copy Markdown

Closes #58

Adds AGENTS.md. Every claim is sourced from .github/workflows/ci.yml, scripts/, or pyproject.toml — no generic filler, and it does not restate pyproject.toml.

The two traps it exists for

1. Hand-editing a generated file passes local review and fails codegen-drift.
src/comfy_low/models/_generated.py is committed, so it reads as ordinary source, and nothing local objects: ruff has it in extend-exclude, ruff format skips it for the same reason, and mypy lists it in exclude. scripts/check_drift.py then regenerates it and compares byte for byte, so the edit only surfaces in CI. The file names all three exclusions so the reason it slips through is explicit, and flags that spec/openapi.yaml is a one-way vendored copy — editing the spec to make drift pass is the wrong fix in the other direction.

Reviewer check: pyproject.toml [tool.ruff] extend-exclude, [tool.mypy] exclude, and the byte comparison in scripts/check_drift.py.

2. mypy is required and undiscoverable.
There is no typecheck script, no Makefile, no pre-commit config — mypy src exists only as a step in ci.yml. The file lists all four required commands in CI order and notes it is mypy src, not the whole repo.

Reviewer check: the test job steps in .github/workflows/ci.yml.

Also covered

  • Generated vs hand-written table. models/__init__.py is hand-written and codegen does not touch it, so a new schema needs its import list and __all__ updated by hand.
  • Regenerate command, including that gen_models.sh is bash — python scripts/gen_models.sh (as README.md currently suggests) does not work — and why the datamodel-code-generator ~=0.68.1 pin is load-bearing for a byte-for-byte gate.
  • uv invocations: uv run --extra dev <cmd>. Dev tools are an extra, not a dependency group, so they are outside the default sync set. Notes that CI itself uses pip install -e .[dev].
  • public-repo-hygiene: all three categories from scripts/check_public_repo_hygiene.py (ticket-shaped IDs, internal collaboration-tool links, default-deny Comfy-Org/<repo> and @Comfy-Org/<team> allowlists), plus the rule that a false positive means an allowlist entry with a comment, never a looser regex.
  • build-check: the sdist include list is explicit, so a new top-level directory silently will not ship.
  • Adding a contract operation is a four-file change — tests/test_spec_coverage.py requires OPERATION_IDS, OPERATION_METHODS, and a method on both ComfyLow and AsyncComfyLow.
  • filterwarnings promotes deprecations to errors; the suite is network-free via the conftest.py stub server; the gateway e2e test is collected but skips without COMFY_BASE_URL + COMFY_API_KEY; __version__ comes from dist metadata so it must not be hardcoded.

python3 scripts/check_public_repo_hygiene.py passes on the new file.

The two CI gates an agent is most likely to trip are both invisible from
the tree: src/comfy_low/models/_generated.py is generated but committed
and excluded from ruff and mypy, so a hand-edit passes every local check
and fails codegen-drift; and mypy is a required check with no script name
anywhere in the repo to discover it from.

Documents generated vs hand-written paths, the regenerate command, the
exact local invocation for all four required checks, the
public-repo-hygiene rule, and the spec-sync ripple into OPERATION_IDS.
@christian-byrne
christian-byrne requested review from a team as code owners August 19, 2026 00:43
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 33 minutes

Limit details: You’ve used all 3 included reviews currently available. Your 79 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 13a98df3-c60d-4332-b17b-69d7ee9ff679

📥 Commits

Reviewing files that changed from the base of the PR and between c96eb09 and 813e23a.

📒 Files selected for processing (1)
  • AGENTS.md

Comment @coderabbitai help to get the list of available commands.

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.

Add AGENTS.md

2 participants