Skip to content

refactor: remove the list_growth lint - #207

Merged
webern merged 1 commit into
mainfrom
m/deslag-rmgrowth
Oct 25, 2026
Merged

webern merged 1 commit into
mainfrom
m/deslag-rmgrowth

Conversation

@webern

@webern webern commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Human Summary

Removes a badly conceived and badly implemented lint.

Summary

list_growth was a lint that judged a change rather than a file. With a base such as --base origin/main, it counted every list item of a file, at every depth, at the merge base and on disk, and failed the file if the count went up by even one. Moving or rewording an item was free; adding one was not, whoever added it and why. Its only exemption was to take the whole file out of the override that turned it on, and an allow entry for it was refused. It was broken by design, and this PR takes it out of deslag as if it had never existed. No other lint's output changes.

What was removed

  • The lint: src/lint/list_growth.rs, its Lint and Violation variants, its ListGrowth settings table, its arm in the allow refusal, its instructions page, and its 0.0.1 record entry src/changelog/releases/0.0.1/lint.list_growth.toml. No changelog entry of any kind is written for the removal.
  • The plumbing only it used: Error::NoBase (the exit 2 for a run with no base), Lint::reads_change, lint::Before, Change::base_text, Change::commit, change::File::adds, and the Need::Structure need ("needs the blocks of Markdown"), with the section argument of Stack::asks that only its message read. check_text now takes the phrase stamp directly in place of the Judging struct, whose other field was the change. fix::fix no longer takes a change.
  • Text that named it: the setup guide, the lints page intro, README.md, the [cpp] and [toml] schema docs, and the 0.0.1 entries feature.cpp, feature.rust, feature.toml, setting.cpp.surfaces and setting.rust.surfaces. The guide and README.md also lose the warning that --base HEAD judges only uncommitted work, which was there because the lint passed under it. Comments that described the base as what lints judge a change from now say what reads it: ci.yml's fetch depth, the .base directory of a case in tests/slow/cases.rs, tools/corpus/report.toml, and the JSON schema descriptions of base.
  • The repo's own .agents/deslag.toml: the list_growth = {} lines, the override that existed only to turn it on for two skills, and the comments about it. The byte budgets are unchanged except the guide's, which falls from 5065 to its new size, 4847.
  • Tests: tests/growth.rs, tests/cases/list_growth/, the tests/golden/list_growth.txt writer in tests/blobs.rs and the file itself. Elsewhere only the lint was taken out: a test that used it as a sample lint now uses not_at_all. tests/frozen.rs and tests/output.rs no longer put their repos under git and pass --base HEAD, which they did only because of this lint; no assertion read the base. In tests/slow/update.rs, the frozen-config probe ran check --base HEAD in a repo that is not under git, so before and after the update it compared two exit 2s. It now runs a plain check, asserts that every probe exits 0 before the update so the comparison is not inert, and asserts that check after the update exits 0 and warns of no removed setting. The frozen 0.0.1 configs lose their list_growth key, and tests/configs/hashes gets their new hashes.
  • The corpus tool: deslag-corpus lints no longer re-reads the config to strip the lints that judge a change, so it no longer depends on serde-saphyr (one line less in Cargo.lock). Its test for that stripping is gone; a small test, lints_read_the_config_deslag_finds_when_given_none, keeps the check that the default config is .agents/deslag.toml.
  • Build: with the golden file gone, make fix-blobs was the same recipe as make fix-catalog, so it is gone and fix-catalog, which already fetches the image first, is the one target. scripts/blobstore/remeasure.sh runs it and no longer reports or lists the golden file; publish-blobs.yml, batches.md, blobs.md and the help text name fix-catalog.

What --base became

It stays on check and fix, as it was. Without the lint, two things still read the change it gives: the deslag: notice: line for each allow entry the change adds or changes (src/lint/mod.rs, check_repo calls allow::mark_added), which check and the check after fix both print, and the base object of the JSON report. The next/ entries for allow already document deslag check --base for that notice. Its help text now says it gives that notice in place of "for the lints that compare a file with what it was". fix --base still reads the base before writing anything, so a bad base still exits 2 with nothing written. make check-deslag keeps check --base origin/main, for the same notice, and its comment now says so.

--diff is unchanged.

Testing

  • make ci-fast: exit 0
  • make CARGO_FLAGS=--locked preflight check build test: exit 0. These are the targets of make ci except test-blobs and test-scanners, which were skipped: test-blobs fetches the corpus image and test-scanners vendors crates with fetch-crates, and both need the network. The ignored test removed from tests/blobs.rs was the only part of test-blobs that read the lint.
  • python3 -m unittest discover -b -s scripts/blobstore -p 'test_*.py': 110 tests, OK. make test-python refused to run because its preflight wants Python 3.13 and this machine has 3.14.
  • make test-product, which runs tests/slow/ with every other product test, passed after the changes to tests/slow/update.rs, tests/output.rs and tests/slow/cases.rs: exit 0.
  • make test-tools: exit 0.
  • make fix-test-output changed nothing under tests/cases. git diff --stat origin/main -- tests/cases shows only the 35 deletions under tests/cases/list_growth/: 35 files changed, 218 deletions(-).
  • make fix-golden changed nothing under tests/golden/. In the corpus tool's goldens, the lints report and its JSON list repo_layout alone as left out, where main also listed list_growth. The scope line also drops "and no base", the reason given for leaving list_growth out; no lint row moved.
  • grep -rni "list.growth\|listgrowth" --exclude-dir=target --exclude-dir=.git --exclude-dir=.blobs . prints nothing.
  • make check-deslag: exit 0.

References

The list_growth lint counted every list item of a file, at every
depth, and failed the file when a change left it with more items than
it had at the merge base. It was broken by design: any growth failed,
whoever added the item and why, and the only way to exempt one item was
to take the whole file off the lint. It is removed as if it had never
existed.

The lint module, its settings table, its violation, its case
directory, its tests, its instructions page and its 0.0.1 record entry
are gone. So is the plumbing that only it used: the error for a run
with no base, the base text of a changed file, the commit field of a
change, the Markdown blocks need of a lint, and the corpus tool's
stripping of change lints from a config. The corpus tool no longer
depends on serde-saphyr. No changelog entry is written.

--base stays on check and fix. The notice for an allow entry that a
change adds or changes reads the change, and so does the base in the
JSON report. Its help text now says that. make check-deslag keeps
--base origin/main for the same notice.

The repo's own config loses the list_growth overrides and the comments
about them. The setup guide is 4847 bytes and its budget falls to
match. The frozen 0.0.1 configs lose their list_growth key, and their
hashes are updated. The golden file of the lint and its writer in
tests/blobs.rs are gone, and make fix-blobs, which rewrote it beside
the catalogue, folds into fix-catalog. Tests that passed --base HEAD
for this lint alone no longer do. No case under tests/cases outside
the lint's own changed.
@webern webern added ai Primarily authored by AI (whether PR, Issue, Whatever) area/lint Deals with the linting algorithms themselves, how they work. labels Oct 25, 2026
@webern
webern marked this pull request as ready for review October 25, 2026 14:04
@webern
webern merged commit d0cdff6 into main Oct 25, 2026
11 checks passed
@webern
webern deleted the m/deslag-rmgrowth branch October 25, 2026 14:11
@webern webern mentioned this pull request Oct 25, 2026
webern added a commit that referenced this pull request Nov 29, 2026
…erride (#273)

## Human Summary

This gives the user the ability to exempt a single lint case.

## Summary

Issue #68 asked for two things. The first is a way to exempt one
violation, keyed to its place and not to the whole file. The second is a
way for a narrower override to turn off a lint that a broader override
turned on.

Much of the first already exists. `[[<section>.allow]]` entries (#199,
#251) exempt one sentence, they require a reason, a tally of them prints
on every run, and a stale entry fails the check. `list_growth`, the lint
behind #67, was removed in #207, so there was no list count to rebase.
What was still missing:

- `density` could not be exempted. An `allow` entry for `density` now
quotes one whole paragraph or list item, folded the same way a sentence
quote is. Any edit to that block makes the entry stale, and the block is
judged again. So a paragraph that grows has to be re-exempted by a
human, and an entry does not last forever. A failed entry reports
`no_such_block`, `two_blocks` or `no_finding`. `deslag fix` leaves a
quoted block as it is. A `line` on a `density` entry is refused.
- An override can now say `off = ["<lint>", ...]`. This sets each named
lint back to unset for the files the override matches. A later override
that sets the lint's table turns it back on, with only the settings that
table sets. Loading the config (exit 2) refuses an unknown lint, a lint
named twice, a lint the same override both turns off and sets, and an
`off` for a lint that no table in the section turns on. `deslag explain`
shows `# <lint>: off, by override N`. The field is marked `since =
"next"` with a default of `[]`, so it needs no schema version bump.

Exemptions stay in the config, with no in-file marker. That keeps to the
existing rule that there is one way to exempt a finding.

`guide.md` and `lints/allow.md` no longer say that an override cannot
turn a lint off, or that an entry only exempts a sentence. They keep the
rule that an agent proposes an entry or an `off` and a human writes it.
The summary line, the SARIF rule text and the docs for entries now say
"text" rather than "sentence", since an entry can name a paragraph.

`.agents/deslag.toml` is unchanged. The #67 workaround was already
removed along with `list_growth`.

## Testing

- [x] `make ci-fast`: exit 0, including `check-deslag` on the repo
itself
- [x] `make test-tools`: exit 0
- [x] New `density` cases: `override_off`, `allow_applied`,
`allow_fails` (covering `no_such_block` and `no_finding`), `allow_rust`
and `allow_fix_held`
- [x] Unit tests for the `off` load errors, the merge order and
`two_blocks`, plus a new `deslag explain` test
- [x] Expected outputs regenerated with `make fix-test-output`, and the
diff checked. Existing `density` cases changed only by the added advice
sentence and the sentence-to-text wording.

## References

- Closes #68
- Related: #67, #199, #207, #251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Primarily authored by AI (whether PR, Issue, Whatever) area/lint Deals with the linting algorithms themselves, how they work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant