From b17cdfa8503e7f0406aeba9bc733a2343618f8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elberte=20Pl=C3=ADnio?= Date: Sun, 6 Sep 2026 23:10:42 -0300 Subject: [PATCH] docs: streamline repository agent instructions --- AGENTS.md | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 15109bb..4211c1c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,21 +1,7 @@ -# complexity-gate +`docs/spec.md` is the contract. Explain deviations in the PR. -Rust CLI that measures per-function complexity with tree-sitter and blocks coding agents from finishing while functions they touched are over the limits. `docs/spec.md` is the contract; if you have to deviate from it, say so in the PR. +Do not lower metric limits, coverage floors or clippy thresholds to get green. Coverage is a ratchet: raise the floor to actual coverage rounded down. Changes to language tables or metric rules need a golden fixture in `tests/fixtures//expected.json`, including a negative case. -Gates, exactly as CI runs them: +`--changed` uses Git diff post-images plus untracked files, resolved against the repo root. Do not walk the current directory or let `.gitignore` filter that set. Classify syntax by tree-sitter node kinds and fields, never text prefixes or operator substrings. -``` -cargo test --workspace --locked --all-targets -cargo clippy --workspace --all-targets -- -D warnings -cargo run -- check crates -cargo llvm-cov --workspace --locked --fail-under-lines 89 -``` - -Worth knowing: - -- Don't lower a limit, the coverage floor or a clippy threshold to get green. The floor is a ratchet: raise it to the actual coverage, rounded down. -- Any change to the language tables or metric rules needs a golden fixture case in `tests/fixtures//expected.json`, including the negative case. -- `--changed` gets its files from Git itself (diff post-image plus untracked), resolved against the repo root. Don't walk the cwd, and don't let `.gitignore` filter it. -- Classify syntax by tree-sitter node kinds and fields, never by text prefixes or operator substrings. -- Loop-guard state lives in `~/.pickforge/complexity-gate/` (`COMPLEXITY_GATE_HOME` overrides). -- Bumping the workspace version also means bumping the `=x.y.z` pin on `complexity-gate-core` in `crates/cli/Cargo.toml`. +Loop-guard state lives in `~/.pickforge/complexity-gate/`; `COMPLEXITY_GATE_HOME` overrides it. A workspace version bump also needs the exact `complexity-gate-core` dependency pin in `crates/cli/Cargo.toml`.