Repo RulesRequirements that stay in the repo

FastAPI: Perch rule pack

3 saved requirements for FastAPI. Inspect the selectors and adapt the example paths to your repository.

- name: tenant-scoped-update
  where: "orders.py"
  ensure: >-
    The cancellation UPDATE must constrain tenant_id to actor.tenant_id before changing the order. An id-only or owner-only update breaks this requirement.

- name: outbox-no-early-commit
  where: "confirmation.py"
  ensure: >-
    The order update and outbox insertion stay in the same transaction. The function must not explicitly commit inside the session.begin block before it finishes successfully.

- name: discount-limit
  where: "main.py"
  ensure: >-
    The discount percentage accepted by the checkout endpoint must be constrained to the inclusive range 0 to 20 before a total is calculated.

Download the rule pack ZIP · Download YAML · Agent repair task · Implementation, integration requirements and captured checks

Install the rule without replacing your configuration

npm install -g @lakeday/perch
perch login
curl -fL 'https://reporules.fyi/fastapi/rule-pack.zip' -o 'perch-guide-fastapi.zip'
unzip -n 'perch-guide-fastapi.zip'

Keep your existing perch.yaml. Extraction preserves existing files and adds .perch/rules/perch-guide-fastapi.yaml. Review each where selector before running a check on your application.

Configure your coding agent

perch setup claude-code
perch setup codex
perch setup cursor
perch setup pi

Choose the setup command for the agent you use.

Check the edit, fix the finding, check again

perch check orders.py --rules tenant-scoped-update --json
perch check confirmation.py --rules outbox-no-early-commit --json
perch check main.py --rules discount-limit --json

Run the check after an agent edit. Read the finding and affected code, repair the implementation, and repeat the identical command. Keep the application regression tests as separate gates.

Exit 3 means a finding. Exit 1 or 2 means the check did not complete. A pass does not prove application correctness. Fresh judgments can vary; unchanged requests reuse cached answers. Relevant source is sent to the configured model service.

Pack manifest and SHA-256 hash · Pack README