Repository navigation
build: improve test segmentation and instructions - #202
Merged
Merged
Conversation
The design docs directory had become an LLM-written mess, so it has been cleared.
Create a mechanism that instructs LLMs when a skill is not to be edited.
The owner added an anti-pattern to the skill on 2026-10-24, and the lint cannot exempt one item. The lint is to be revisited.
The test doctrine's Avoid Brittle Tests section names these shapes: tests that check repo files against each other rather than what deslag does. - tests/ci_jobs.rs: checked that ci.yml runs the lines of `make ci`; a test that GitHub YAML matches the Makefile. - tests/asbuilt.rs: checked that each src/ module is named in a design doc, and a byte budget on each lint's doc comment; design docs against module layout. - phrases.rs the_catalogue_is_measured_on_the_pinned_image: checked the catalogue's measured_on against blobs.lock; project state that moves on every image publish. - frozen.rs typos_leaves_the_hash_lines_alone: ran the typos tool on _typos.toml; tests typos, which make check-typos already runs. AGENTS.md drops the sentence about tests/ci_jobs.rs.
cases.rs, corpus.rs, diff.rs and update.rs move to tests/slow/, as modules of one binary, tests/slow/main.rs, which holds `common`. Each spawns deslag per case or builds a repository per test. Cargo.toml declares the binary `test = false`, so `cargo test -p deslag` does not build or run it; `cargo test --test slow` does. The tests are not changed. --all-targets leaves out a `test = false` target, and so does --tests, so check-clippy and fix-clippy name the slow binary on a line of their own. fix-test-output runs `--test slow -- cases::`, which selects the three tests of the cases module. Comments that named tests/corpus.rs name tests/slow/corpus.rs.
Each target runs in the fast profile, and the at-once runs go through scripts/test-at-once.sh, which now takes the cargo target flags from the caller in place of a list of binaries to skip. FAST_SKIP is gone. Seconds are warm, the second of two runs, on a 16-core laptop. - test-fast (9 s): deslag's unit tests and every test binary but the slow one, `-p deslag`. Run after each edit to product code. - test-product (30 s): `-p deslag --lib --bins --test '*'`, which is test-fast's binaries and the slow one in one build, then deslag's doctests. `--all-targets --test slow` does not work: --all-targets and --tests leave out a `test = false` target and win over --test. - test-tools (52 s): the tests of deslag-corpus, deslag-exam and deslag-release at once, their doctests, then the sweep's tests. Not a product tier, so not in test-fast, test-product or ci-fast. - test-exam (2 s): the gates and the owner score, now in the fast profile. The golden binary left it; it is part of test-fast. - test (83 s): test-exam, test-product and test-tools. - ci-fast (41 s): preflight, check, test-exam and test-product. ci keeps its parts. fix-golden and fix-test-output use the fast profile, so they share a build with the tiers.
The tests moved into tiers and the owner emptied docs/design/. The instructions still named files that are gone and still called `make test` the developer workflow. - AGENTS.md: add a table of which make target to run and when; drop the docs/design/ layout line and the rule on *.desired.md. - tests/AGENTS.md: list slow/ in place of cases.rs and corpus.rs; say which targets run these tests. - tools/AGENTS.md: name `make test-tools` in place of the as-built docs. - README.md: name test-fast, ci-fast, test and ci in the Build section; say the design docs were retired. - .github/pull_request_template.md: `make ci` becomes `make ci-fast`. - .agents/deslag.toml: remove the globs and budget overrides for the files under docs/design/. No byte budget was raised.
Split the old test job, which ran make test, and move the timing check out of ci.yml. The jobs now: - check (Linux, macOS): check, build and test-scanners, unchanged. - test (Linux, macOS): test-exam and test-product, the product tiers. - tools (Linux): test-tools, the tooling suite. Not a required check. - blobs (Linux): test-silver and test-tier, now on Linux only. - time, in the new time.yml (Linux): test-time, alone on its runner. time.yml runs on every push to main. On a pull request it runs only when the tagger, the reader, the timer, scripts/blobstore, the manifests, the toolchain, the Makefile or time.yml change. tests/ci_jobs.rs is gone, so the ci.yml header comment is now the record of which job runs which part of make ci. Together, ci.yml and time.yml still run every part.
Two Makefile comments and the Build section of AGENTS.md still said the ci workflow runs the timing check in a job of its own.
webern
marked this pull request as ready for review
October 24, 2026 13:12
This was referenced Oct 25, 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 PR introduces a hand written test doctrine and reorganizes tests. It also deletes the stale and useless asbuilt design docs.
Summary
The test doctrine,
/deslag-test-doctrine, asks for a standard set of product tests that runs in seconds, a progressive depth any agent can see, and tests that pin behaviour rather than the shape of the repository. This change makes the repository match it.Tests are tiered with cargo, not with file lists in the Makefile.
make test-fastiscargo test -p deslagin the fast profile: the library's unit tests and every integration binary undertests/except one. The four product tests that spawn deslag per case or build a git repository per test (cases,corpus,diff,update) are now one binary undertests/slow/, declaredtest = falsein Cargo.toml, so a plaincargo testskips it and--test slowruns it.make test-productruns tier 0 and the slow binary in one cargo build, then the doctests; it is what CI'stestjob runs. The crates undertools/are not product tests:make test-toolsruns them, with the sweep's tests, beside the product tiers and never inside them.make testruns exam, product and tools.make ci-fast, the pre-push gate, runs check, exam and product.Four tests pinned repository policy rather than behaviour and are removed:
tests/ci_jobs.rs, which mirrored the CI workflow line by line;tests/asbuilt.rs, which required every module to be named in a design doc, and the design docs are retired on this branch; the catalogue's pin to the big-tier image digest intests/phrases.rs; and the check intests/frozen.rsthat ran the typos tool.CI: the
testjob runstest-exam test-producton both OSes in the fast profile. A newtoolsjob runs the tooling suite on ubuntu; it shows on every run and is not a gate.blobsruns on ubuntu. The timing check moves to its own workflow,time.yml, which runs on every push to main and on a pull request only when the tagger, the reader, the timer or the big tier's scripts change. The header ofci.ymlrecords which job runs which part ofmake ci, now that no test does.AGENTS.mdgains a four-row table of which target to run when.tests/AGENTS.md,tools/AGENTS.md, the README, the PR template and the repository's own lint config lose their references to the retired design docs.Measured warm on a 16-core machine, second of two runs:
make test-fast8.6 s,make test-product29.6 s,make test-tools51.5 s,make test-exam1.9 s,make ci-fast41 s,make test83 s. Before this changemake ci-fasttook 49 s andmake test226 s, and both were red becausetests/asbuilt.rsread the deleted design docs.The branch also carries the owner's own commits: the test doctrine skill, the build doctrine deferring to it, the
llm_editmarks on the skills, the deletion ofdocs/design/, and the open-pr skill's new anti-pattern.Testing
make ci-fast: exit 0make test: exit 0make check: exit 0 after each commit,check-deslagagainstorigin/mainincludedciworkflow finished in 3m29s wall (check 1m40s and 2m25s, test 2m11s and 3m27s, tools 2m05s, blobs 2m05s), against about 6m50s for a run on main before this change;time.ymlran because the Makefile and Cargo.toml changed and passed in 6m00s on its ownReferences