Repository navigation
Slim down agent rules: drop lint-enforced, stale and generic rules - #7884
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
Automated review at bf7874a. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR halves the agent rules (~66 KB → ~33 KB) by removing lint-enforced, stale, wrong, and generic guidance while keeping the rules that came from real agent failures. The removals are well-motivated and the description is thorough. One small functional change — dropping the git fetch from the rebase recipe — appears unintentional and should be restored.
|
|
||
| ```sh | ||
| GIT_EDITOR=true GIT_SEQUENCE_EDITOR=true VISUAL=true GIT_PAGER=cat git fetch origin main && | ||
| GIT_EDITOR=true GIT_SEQUENCE_EDITOR=true VISUAL=true GIT_PAGER=cat git rebase origin/main |
There was a problem hiding this comment.
[nice to have] The base recipe chained git fetch origin main && before the rebase (base line 54). Without the fetch, the agent rebases on whatever origin/main it last fetched locally, which can be arbitrarily stale. The PR description doesn't list this as an intentional removal. Re-add the fetch line before the rebase command.
There was a problem hiding this comment.
Restored in b11be8d, thanks — the drop was unintentional.
Co-authored-by: Isaac <no-reply@databricks.com>
❌ Integration test reportCommit: 8f27fc4
34 interesting tests: 24 RECOVERED, 9 flaky, 1 FAIL
Top 50 slowest tests (at least 2 minutes):
|
Changes
Halve the agent rules: 66 KB → 33 KB of AGENTS.md +
.agents/rules/. The rules that are always loaded or loaded on every Go edit shrink the most:.gofile (+ style-guide-go, comments)_test.gofile (+ testing)Skills are unchanged: they load only when invoked.
What was removed, and why:
./task lint(the agent gets the same message from the linter):range, builtinmin/max(modernize)os.Getenv,sync.Once(forbidigo)context.Background()(gorules)t.Context()in tests (usetesting)log(depguard)%wwrapping (errorlint)config.Config(govet copylocks)errors.Aswas recommended, but forbidigo bans it (the tree has 0errors.Ascalls vs 231errors.AsType).isResourceGonedoesn't exist.libs/structpathhas moved tolibs/structs/structpath.out.test.tomlold-format migration rule is dead: 0 files are left in that format.python/, which supports>=3.10.databricks_template_schema.json"reference" was an outdated copy of dbt-sql's schema. It described a description convention the real file no longer uses, and it had a typo. It is replaced by pointers to the real templates and tolibs/jsonschema/extension.go._testsuffix": 1050 test files use the internal package and 231 use_test. The rule led to an invented_internal_test.goconvention that the author rejected: ssh: default serverless CPU to environment version 5 #7847 (comment).databrickstoIgnore":acceptance/script.cleanupalready removes it. This produced a wrong[blocking]comment: acc: add bind test for a resource that references an undeployed one #7846 (comment)databricks aitools install#6204 (comment), filer: switch workspace upload from import-file to /workspace/import #6149 (comment)).switchvsif/elseCloud = trueruns locally too: this was explained 5 times and is now explained once in AGENTS.md and once in testing.md.integration/is deprecated: stated 4 times.print_requests.py/jqguidance was 3 overlapping rules and is now 1.Clarified:
os.Exit: the rule now says howTestMainshould exit. The bot had suggestedos.Exit(m.Run()), against this same rule: Add and remove agent MCP entries through agent CLIs, except Codex #7595 (comment)Why
The rules were mostly mined from review history in #5078. That PR's follow-up promised a slim-down that never came (#4882), and token cost had already come up in review (#6584). Every byte of AGENTS.md and the Go/test rules is paid on most turns, and rules that are wrong or that the linter already enforces either crowd out the useful ones or become review noise. I checked the 98 comments from review-oss-bot and the human pushback since 2026: the rules that went wrong are the ones removed above. The acceptance-test rules that came from real agent failures (
Cloud,EnvMatrix, TOML dotted keys,musterr/errcode,print_requests.py, testserver over[[Server]], GET-response projection) are kept, just shorter.Tests
./task check-agents-setupand./task checkspass. Every path, helper, task and identifier still mentioned was checked against the tree.This pull request and its description were written by Isaac.