docs: add AGENTS.md covering codegen drift and the required checks - #60
docs: add AGENTS.md covering codegen drift and the required checks#60christian-byrne wants to merge 1 commit into
Conversation
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.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. 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. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
Closes #58
Adds
AGENTS.md. Every claim is sourced from.github/workflows/ci.yml,scripts/, orpyproject.toml— no generic filler, and it does not restatepyproject.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.pyis committed, so it reads as ordinary source, and nothing local objects: ruff has it inextend-exclude,ruff formatskips it for the same reason, and mypy lists it inexclude.scripts/check_drift.pythen 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 thatspec/openapi.yamlis 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 inscripts/check_drift.py.2. mypy is required and undiscoverable.
There is no
typecheckscript, no Makefile, no pre-commit config —mypy srcexists only as a step inci.yml. The file lists all four required commands in CI order and notes it ismypy src, not the whole repo.Reviewer check: the
testjob steps in.github/workflows/ci.yml.Also covered
models/__init__.pyis hand-written and codegen does not touch it, so a new schema needs its import list and__all__updated by hand.gen_models.shis bash —python scripts/gen_models.sh(asREADME.mdcurrently suggests) does not work — and why thedatamodel-code-generator ~=0.68.1pin is load-bearing for a byte-for-byte gate.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 usespip install -e .[dev].public-repo-hygiene: all three categories fromscripts/check_public_repo_hygiene.py(ticket-shaped IDs, internal collaboration-tool links, default-denyComfy-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 sdistincludelist is explicit, so a new top-level directory silently will not ship.tests/test_spec_coverage.pyrequiresOPERATION_IDS,OPERATION_METHODS, and a method on bothComfyLowandAsyncComfyLow.filterwarningspromotes deprecations to errors; the suite is network-free via theconftest.pystub server; the gateway e2e test is collected but skips withoutCOMFY_BASE_URL+COMFY_API_KEY;__version__comes from dist metadata so it must not be hardcoded.python3 scripts/check_public_repo_hygiene.pypasses on the new file.