Repository navigation
feat: record when each lint, setting, redirect and phrase arrived - #211
Merged
Merged
Conversation
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
commented
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 updatetells it what arrived after the config'sdeslag_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, itssince, right where it is defined, and the update topic selects bysincealone.How the agent is told, and how it is selected.
#[schemars(extend("since" = "..."))]beside its doc comment, so the JSON schema carries asincekeyword on every property (deslag instructions config-schemaprints it). The schema walk (src/config/paths.rs) gives each path the latestsinceof itself and the tables above it.sinceis thesinceof its field ofLints, read byLint::since.sincefield, and a catalogue phrase already had one.News(src/news.rs) takes everything whosesinceis 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.nextis in no range that ends at a release.## Renamed or removed settings(the messagecheckgives for each),## New lints(the pagedeslag instructions lintsprints 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 latestsince),## New phrases, and## Finish.--format jsongives one item per redirect, lint, setting and phrase in the same order, each withversion,kind,idandtext, plusalready_setfor a lint,newfor a redirect (null for a removal) andgroupfor a phrase.checkprints and the hold of a baredeslag updateask the sameNews, so they cannot disagree.Worked example. A config stamped 0.0.1 with only
[md.lints.density], read by the release that ships what isnexttoday, 0.0.2 (run with a build made bydeslag-release prep 0.0.2, below):What was deleted and why.
src/changelog/is gone, with its 48 entries, its README, the listing inbuild.rs,tests/changelog.rsanddeslag-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
prepdoes 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"insrc/lint/banned_phrases.toml,extend("since" = "next")insrc/**/*.rs, andsince: "next"insrc/config/redirect.rs. Every release then writestests/configs/<version>/whole: the frozen config in TOML, YAML and JSON, andschema.json, the config schema with eachnextset to the version. A setting the newest frozen config leaves out takes the schema default, else its value in the newtests/configs/fill.toml, elseprepstops before any write, naming the setting and the file.tests/configs/0.0.1/schema.jsonis thedeslag instructions config-schemaoutput of av0.0.1build, and its hash joinstests/configs/hashes.make check-releasenow runs the ignored tests oftests/since.rsandtests/frozen.rs, with--no-fail-fastso one run names every check left.The skill.
.agents/skills/deslag-upgrade-instructions/SKILL.md, listed inAGENTS.md, says what a change writes: a new lint gets its page and thesinceattribute on itsLintsfield; a new setting gets a doc comment and the attribute; a renamed or removed setting gets a redirect withsince: "next"; a new phrase getssince = "next". Nothing else is written for the upgrading agent.tests/since.rsfails on a schema property without asinceand names the attribute to add./deslag-releasenow expects thenextrewrites and a new frozen directory of four files.Other changes.
Newstakes everysince, 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.Closinginsrc/instructions/update.mdsays a new setting keeps its default until the config sets it, and is split into two paragraphs to stay under thedensitylimit; its budget rises to 1585 bytes. Theallowdoc comment of each section points atdeslag instructions lints.no_arrival_names_nextappliesprep's rewrite tosrc/in memory and fails on any form the rewrite would leave, so it holds between releases and still catches a form written whereprepdoes not look.Testing
make ci-fast: exit 0The network-free targets of
make ci(preflight check build test-exam test-product test-tools): each exit 0.test-blobsandtest-scannerswere not run: they need the network,test-blobsto fetch the corpus's big tier andtest-scannersto fetch the crates it sweeps.make check-release: exit 2, failing exactlythe_newest_frozen_configs_name_every_setting(tests/frozen.rs) andnothing_arrives_in_next(tests/since.rs). Both are expected onmainbetween releases: 15 schema fields arenext, 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_versionandno_arrival_names_nextpass.A real release, in a fresh scratch clone of the branch:
deslag-release prep 0.0.2, thenmake ci-fast, thenmake check-release, then the frozen and since tests.prepprinted:It changed
Cargo.toml,Cargo.lock, seven files undersrc/config/andtests/configs/hashes(four new lines), and wrotetests/configs/0.0.2/config.toml,config.yaml,config.jsonandschema.json. The dump holds"0.0.2"15 times and"next"none; no form ofnextis left undersrc/. 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.ymlmakes. 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., sincenextis in no range; the library withto = nextprints the same text withnextfor 0.0.2.grep -rni changelogoversrc tests tools scripts Makefile .github .agents build.rs README.md AGENTS.md, withouttests/corpus,tests/gold,tests/goldenandtools/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.rsandtools/corpus/tests/golden/summary.json.git diff --statagainst the base, overtests/cases: empty.References