Skip to content

Stop listing things #16

Open
Open

Description

@webern

If you look at PR #15, the diff in AGENTS.md pisses me off. STOP LISTING THINGS.

-  src/config/          <- the TOML schema; search.rs finds the file, md.rs, lints.rs
+  src/config/          <- the schema in TOML, YAML or JSON; search.rs finds the file

(Fixed in #15.)

The agent has added a list of supported config file formats because that is what it was working on.

This isn't the most egregious case because perhaps we will never add another format, but in general we shouldn't make volatile lists in AGENTS.md.

Every time a new test directory is added or a new code file, the agent adds it to a list of things and the garbage pile grows and grows.

AGENTS.md is an aid to discovery, not a list of everything that exists. When I look at a map, it doesn't tell me that the coffee shop on 5th and main has a barista named Bob.

This is a hard one and it needs some design. It probably relies on something new, in the sense that it needs to be diff based (perhaps?)

Activity

  1. added
    design
    enhancement
    area/lint
    on Sep 24, 2026
  2. webern commented on Sep 27, 2026

    @webern
    OwnerAuthor

    AI...

    A first answer to this has shipped: list_growth, in #54. It enforces the policy this issue asks for. It does not detect agents, and it does not catch this issue's own example.

    What shipped

    list_growth is deslag's first lint that judges a change instead of a file. A run needs a base, given with --base <REV> (such as --base origin/main) on check or fix. The change runs from where the base and HEAD meet to the working tree.

    A file fails when the change leaves it with more list items than it had at the base. Every item counts, at every depth, and a new list counts too. There is no allowance: letting each change add N items free lets the list grow by N with every change. A file the change added whole is not judged; its byte budget holds it.

    The report gives both counts, then this issue's advice: where the items follow a rule, write the rule once instead of the list; otherwise take out an item that matters less for each one added; and do not move the items into prose, a table or a code block, or change the settings. Then it lists each item on a line the change added.

    ERROR: deslag detected list growth!
    
    AGENTS.md has 10 list items, 2 more than the 8 it had at d502b15.
    
    ...
    
    The items on lines this change added:
      line 43: `/deslag-commit`: rules for git commits.
      line 57: The human is the author of the git commit and the PR. See...
    

    A run with no base that selects a file for list_growth exits 2, and says to add --base origin/main. deslag turns it on for its own AGENTS.md and skills, and make ci runs check --base origin/main.

    The numbers

    Measured on the corpus image v2, one row per commit that edited a file that already existed. Share of edits each rule would fail:

    Rule Agent edits of instruction files Agent edits of mixed files Human edits before 2022
    File has 1+ more list items (what shipped) 34.9% 35.0% 23.8%
    One list has 2+ more items 8.2% 4.6% 2.4%
    500+ bytes added, none removed 11.7% 12.1% 2.9%
    A heading added, none removed 14.0% 20.4% 16.4%

    The populations are 1053 edits in 140 repositories, 1495 in 201, and 2047 in 194. The built lint, run through git on each edit, gives the same verdict as the first row on every one of these 4595 edits.

    No threshold separates agents from people. People grow lists too, just less often. So list_growth is a policy the owner turns on for the files where lists should not grow, not a detector.

    Of the 14 edits to files that already existed in deslag's own AGENTS.md and skills, 3 fail: 0ace521, a2edd2f and 89e3669. Two of the items they add are volatile lists (a new skill in the index of skills, a new verb in the Makefile vocabulary). Two are new rules. The lint cannot tell a rule from an inventory; the report asks for one out for each one in either way.

    What it does not catch

    This issue's example is not caught. The #15 edit changed one line inside the fenced layout block of AGENTS.md, the schema in TOML, YAML or JSON. That is an inline series in a code block, not a Markdown list item, so no count changes. deslag does not read inline series yet (SpanKind::Series is a TODO in src/document/mod.rs), and none of the rules measured above flag that edit.

    Not yet

    • A net growth rule (bytes added with nothing removed) is next, with the numbers above. deslag's byte budgets bind first.
    • A heading rule does not separate agents from people, so it is dropped.
    • A baseline of human edits taken from the corpus image itself needs a new collection batch.

    This issue stays open for inline series, unless you would rather track that apart.

  3. webern commented on Oct 25, 2026

    @webern
    OwnerAuthor

    AI...

    The first implementation of this, the list_growth lint of #54, failed and was removed in #207.

    It counted every list item of a file at every depth and failed any change that left the file with more items than it had at the merge base. Any growth failed, whoever added the item and why, and there was no exemption short of taking the whole file off the lint. The lint also never caught the example in this issue, an inline series inside a code block. Its first two firings on this repo's own files were both deliberate human additions (#67 on 2026-10-03 and #202 on 2026-10-24), and both times the way through was to drop the file from the lint.

    The requirements were never written down before it was built. This issue stays open for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/lintdesignenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions