Skip to content

feat: record when each lint, setting, redirect and phrase arrived - #211

Merged
webern merged 6 commits into
m/deslag-vermovefrom
m/deslag-arrival
Oct 26, 2026
Merged

webern merged 6 commits into
m/deslag-vermovefrom
m/deslag-arrival

Conversation

@webern

@webern webern commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Human Summary

This changes the way upgrade instructions are organized and discovered. The old method was causing some confusion in the coding agents as to what needed to be documented, what should be immutable, etc. This redesign should make it more straightforward to maintain.

Summary

When an agent upgrades deslag in another repository, deslag instructions update tells it what arrived after the config's deslag_version: the new lints, the new settings, the settings that were renamed or removed, and the new catalogue phrases. This PR changes where that comes from. Each of those things now records the release it arrived in, its since, right where it is defined, and the update topic selects by since alone.

How the agent is told, and how it is selected.

  • A setting has #[schemars(extend("since" = "..."))] beside its doc comment, so the JSON schema carries a since keyword on every property (deslag instructions config-schema prints it). The schema walk (src/config/paths.rs) gives each path the latest since of itself and the tables above it.
  • A lint's since is the since of its field of Lints, read by Lint::since.
  • A redirect has a since field, and a catalogue phrase already had one.
  • News (src/news.rs) takes everything whose since is after the stamp, up to the running release. A setting is a topmost new path, so a new table is one setting, not one per key. A key under the table of a lint that is itself new is left to that lint's page; a key added later to an older lint is a setting. The new path of a rename shows under its redirect only. next is in no range that ends at a release.
  • The text prints, in order: ## Renamed or removed settings (the message check gives for each), ## New lints (the page deslag instructions lints prints for each, with "This config already has a <lint> table." when it does), ## New settings (each doc comment, in path order; paths with the same doc comment share one heading, at the first path, with the latest since), ## New phrases, and ## Finish. --format json gives one item per redirect, lint, setting and phrase in the same order, each with version, kind, id and text, plus already_set for a lint, new for a redirect (null for a removal) and group for a phrase.
  • The note that check prints and the hold of a bare deslag update ask the same News, so they cannot disagree.

Worked example. A config stamped 0.0.1 with only [md.lints.density], read by the release that ships what is next today, 0.0.2 (run with a build made by deslag-release prep 0.0.2, below):

# What is new in deslag 0.0.2, since 0.0.1

## New lints

### `not_at_all` (0.0.2)

`not_at_all` fails a negation padded with "at all", such as `it does not parse at all`, `no
examples at all` or `it is not at all clear`; this repo writes "it does not parse". The padding adds
stress and nothing else, and in a review it reads as dismissal. The fix is to delete "at all".

It passes a question (`does it work at all?`), `whole or not at all`, a lone `Not at all.` with or
without a label such as `A:`, `at all times` and its kin, and `hardly`, `barely` and `scarcely`.
For text that is not English, scope it with `globs`. Ask the human before turning it off or
scoping it.

```toml
[md.lints.not_at_all]
message = "..."  # optional; replaces the advice
```

## New settings

### `cpp.allow`, `md.allow`, `rust.allow`, `toml.allow` (0.0.2)

The sentences of these files that stay as written, each exempted from one lint. Only a
human writes an entry. `deslag instructions lints` says how to write one.

### `cpp.exclude` (0.0.2)

Files `globs` match that this section leaves out, such as generated code. A pattern is
written as in `globs`, from the repo root with a `/`, else by file name, and not needing a C
or C++ extension. A file the walk skips stays skipped, and nothing re-includes one. Only a
human adds an exclude; never add one to make a check pass.

### `cpp.overrides[].exclude`, `md.overrides[].exclude`, `rust.overrides[].exclude`, `toml.overrides[].exclude` (0.0.2)

Files `globs` match that this override leaves alone, so they get the section's settings.
Written as `globs` are, from the repo root with a `/`, else by file name, and needing no
extension. Nothing re-includes a file. Only a human adds an exclude; never add one to make
a check pass.

### `md.exclude` (0.0.2)

Files `globs` match that this section leaves out, such as generated code. A pattern is
written as in `globs`, from the repo root with a `/`, else by file name, and needing no
extension. A file the walk skips stays skipped, and nothing re-includes one. Only a human
adds an exclude; never add one to make a check pass.

### `rust.exclude` (0.0.2)

Files `globs` match that this section leaves out, such as generated code. A pattern is
written as in `globs`, from the repo root with a `/`, else by file name, and not needing to
end in `.rs`. A file the walk skips stays skipped, and nothing re-includes one. Only a human
adds an exclude; never add one to make a check pass.

### `toml.exclude` (0.0.2)

Files `globs` match that this section leaves out, such as generated code. A pattern is
written as in `globs`, from the repo root with a `/`, else by file name, and not needing to
end in `.toml`. A file the walk skips stays skipped, and nothing re-includes one. Only a
human adds an exclude; never add one to make a check pass.

## Finish

Moving `deslag_version` to 0.0.2 turns on no phrase in this config. Nothing else `check` finds depends on `deslag_version`, so there is nothing to compare. Only the note that the config is behind goes.

Offer each new lint and phrase to the person, with what it fails. Add the table of each lint they
choose, and keep off each phrase they want off, as its section says: a phrase is on once the
version moves. A new setting keeps its default until the config sets it; name it to the person,
and set it only if they ask.

Once they have chosen, run `deslag update --to 0.0.2`, adding your `--config-path` if any. It sets
`deslag_version` to "0.0.2", ending this list, and edits renamed or removed settings. If the person
cannot be asked now, change nothing, not even `deslag_version`, and tell them what is new.

What was deleted and why. src/changelog/ is gone, with its 48 entries, its README, the listing in build.rs, tests/changelog.rs and deslag-release's entry reader. The entries served two readers at once and did neither well; release notes come from GitHub, instructions from the lint pages, compatibility from the schema.

What prep does now. deslag-release prep <version> keeps its version checks, clean-tree check and crate version edits. It sets "next" to the version in three exact forms and no other text: since = "next" in src/lint/banned_phrases.toml, extend("since" = "next") in src/**/*.rs, and since: "next" in src/config/redirect.rs. Every release then writes tests/configs/<version>/ whole: the frozen config in TOML, YAML and JSON, and schema.json, the config schema with each next set to the version. A setting the newest frozen config leaves out takes the schema default, else its value in the new tests/configs/fill.toml, else prep stops before any write, naming the setting and the file. tests/configs/0.0.1/schema.json is the deslag instructions config-schema output of a v0.0.1 build, and its hash joins tests/configs/hashes. make check-release now runs the ignored tests of tests/since.rs and tests/frozen.rs, with --no-fail-fast so one run names every check left.

The skill. .agents/skills/deslag-upgrade-instructions/SKILL.md, listed in AGENTS.md, says what a change writes: a new lint gets its page and the since attribute on its Lints field; a new setting gets a doc comment and the attribute; a renamed or removed setting gets a redirect with since: "next"; a new phrase gets since = "next". Nothing else is written for the upgrading agent. tests/since.rs fails on a schema property without a since and names the attribute to add. /deslag-release now expects the next rewrites and a new frozen directory of four files.

Other changes. News takes every since, lints included, from the schema it is handed, so a unit test with a schema of its own sees no real arrival, before or after a release. Closing in src/instructions/update.md says a new setting keeps its default until the config sets it, and is split into two paragraphs to stay under the density limit; its budget rises to 1585 bytes. The allow doc comment of each section points at deslag instructions lints. no_arrival_names_next applies prep's rewrite to src/ in memory and fails on any form the rewrite would leave, so it holds between releases and still catches a form written where prep does not look.

Testing

  • make ci-fast: exit 0

  • The network-free targets of make ci (preflight check build test-exam test-product test-tools): each exit 0. test-blobs and test-scanners were not run: they need the network, test-blobs to fetch the corpus's big tier and test-scanners to fetch the crates it sweeps.

  • make check-release: exit 2, failing exactly the_newest_frozen_configs_name_every_setting (tests/frozen.rs) and nothing_arrives_in_next (tests/since.rs). Both are expected on main between releases: 15 schema fields are next, and the newest frozen config, 0.0.1, does not name them. no_frozen_directory_is_above_the_crate_version, the_crate_version_is_a_release, no_since_is_above_the_crate_version and no_arrival_names_next pass.

  • A real release, in a fresh scratch clone of the branch: deslag-release prep 0.0.2, then make ci-fast, then make check-release, then the frozen and since tests. prep printed:

    Cargo.toml and Cargo.lock: version 0.0.2
    src/lint/banned_phrases.toml: 0 of `since = "next"` set to 0.0.2
    src/**/*.rs: 15 of `extend("since" = "next")` set to 0.0.2
    src/config/redirect.rs: 0 of `since: "next"` set to 0.0.2
    tests/configs/0.0.2: config.toml, config.yaml, config.json and schema.json written, with their hash lines
    

    It changed Cargo.toml, Cargo.lock, seven files under src/config/ and tests/configs/hashes (four new lines), and wrote tests/configs/0.0.2/config.toml, config.yaml, config.json and schema.json. The dump holds "0.0.2" 15 times and "next" none; no form of next is left under src/. Then, in the clone:

    • make ci-fast: exit 0.
    • make check-release: exit 0. tests/frozen.rs: 2 passed; tests/since.rs: 4 passed.
    • cargo test --test frozen: 8 passed, 2 ignored. cargo test --test since -- --ignored: 4 passed.

    This is the run bump-version.yml makes. The clone was then deleted.

  • The worked example above, diffed against the design's text: identical except that the closing paragraph is two paragraphs. With this branch's own build, at 0.0.1, the same repo prints Nothing is new in deslag 0.0.1 since 0.0.1: the config is current., since next is in no range; the library with to = next prints the same text with next for 0.0.2.

  • grep -rni changelog over src tests tools scripts Makefile .github .agents build.rs README.md AGENTS.md, without tests/corpus, tests/gold, tests/golden and tools/exam: only the places that name other projects' changelog files remain: src/glob/select.rs, src/tag/weights.txt, scripts/llm-detection/collect.py, tools/corpus/tests/golden.rs and tools/corpus/tests/golden/summary.json.

  • git diff --stat against the base, over tests/cases: empty.

References

Every property of the config schema now carries a `since` keyword,
written with `#[schemars(extend("since" = ...))]` beside its doc
comment, and `deslag instructions config-schema` prints it. Fifteen
are "next": `allow` and `exclude` in each section, the four fields of
an `allow` entry, an override's `exclude`, the `not_at_all` table and
its `message`. The other seventy are "0.0.1".

The schema walk reads them. `SchemaPaths` gains `since`, the release
of each path, the latest of its own and those above it, keeping the
earliest where a section's `lints` and an override's fold onto one
path; `descriptions`, each property's doc comment; and `unsinced`,
the properties with none.

`Lint::since` reads the `since` of the lint's field of `Lints`, so a
lint records its release in one place, and `deslag instructions lints`
prints its "Since" line from it. `Redirect` gains `since` too.

`tests/since.rs` fails on a property without a `since`, naming the
attribute to add, and holds every arrival at or above the baseline.
`News` now selects what is new by `since` alone. It holds four lists,
each what arrived after the stamp up to the running release: the
lints, by the `since` of their table; the settings, the topmost new
paths of the schema; the redirects; and the catalogue phrases. A path
under the table of a lint that is new is no setting, since the lint's
page covers it, and neither is the new path of a redirect in the
range. `Known` bundles the three records it reads, and
`News::embedded` reads those of this build.

`deslag instructions update` prints, in order, the settings renamed
or removed, with the message `check` gives for each; the new lints,
each as the page `deslag instructions lints` prints for it, with the
mark when the config already has its table; the new settings, each
as its doc comment, with settings that share a doc comment under one
heading; the new phrases; and the closing. The JSON gives an item per
redirect, lint, setting and phrase in the same order, each with its
`kind`, `id`, `version` and `text`.

`deslag update` holds a bare update on the same news, and the closing
of the topic says a new setting keeps its default until the config
sets it. The `allow` doc comment of each section points at
`deslag instructions lints`, which says how to write an entry.
`deslag-release prep` now sets `"next"` to the version in three exact
forms and in no other text: `since = "next"` in the phrase catalogue,
`extend("since" = "next")` in any Rust file under `src/`, and
`since: "next"` in the redirects. `arrival::left` names a form the
rewrite would miss, and the ignored test `no_arrival_names_next`
fails on one.

Every release writes `tests/configs/<version>/` whole: the config in
each language and `schema.json`, the config schema with each `next`
set to the version, as `deslag instructions config-schema` prints it
at that release. A setting the newest config leaves out takes the
schema's default, else its value in `tests/configs/fill.toml`, else
`prep` stops before any write, naming the setting and the file.
`tests/configs/0.0.1/schema.json` is the schema of 0.0.1, and its
hash joins the others.

`frozen::repo` builds the repo a frozen config runs in, with a file
for each section holding the sentence the `allow` entries of the fill
exempt. `tests/frozen.rs` holds each directory to four files, a leaf
to the config of each release from its `since` on, and the fill to
the settings with no default.

`make check-release` runs the ignored tests of `tests/since.rs` and
`tests/frozen.rs`: nothing arrives in `next`, no `since` is above the
crate version, the crate version is a release, no frozen directory is
above it, and the newest names every setting.
The entries served two readers at once and did neither well. The
release notes come from GitHub, what an upgrading agent is told comes
from the lint pages and the doc comments of the schema, and what a
config may hold comes from the schema. So `src/changelog/` goes whole,
its 48 entries and its README with it, and so do the listing in
`build.rs` and `tests/changelog.rs`.

Of the tests that read no entry, `lints_turned_on_reads_every_section`
moves to `tests/instructions.rs`, and the check that the repo's own
text holds no phrase a later stamp turns on moves to `tests/phrases.rs`,
reading the repo's files only. `tests/instructions.rs` gains a test
that the update topic prints the page of each lint after the stamp.

The skill `deslag-upgrade-instructions` says what a change that adds,
renames or removes a lint or a setting writes, and `AGENTS.md` points
to it. The repo's config no longer selects or excludes the entries.
`make check-release` runs the ignored tests of two files. Cargo stops
at the first file with a failure, so a run named only the checks of
`tests/frozen.rs`. With `--no-fail-fast` it runs both and names each
check the release change has left to do.
@webern webern added ai Primarily authored by AI (whether PR, Issue, Whatever) area/config Has to do with deslag configuration (deslag.yaml, etc.) labels Oct 25, 2026
@webern
webern added this pull request to stack #212 October 25, 2026 20:19
@webern
webern marked this pull request as ready for review October 26, 2026 06:20
@webern
webern merged commit 27a4786 into main Oct 26, 2026
9 checks passed
@webern
webern deleted the m/deslag-arrival branch October 26, 2026 06:23
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/config Has to do with deslag configuration (deslag.yaml, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant