Skip to content

build: improve test segmentation and instructions - #202

Merged
webern merged 16 commits into
mainfrom
owner-edits
Oct 24, 2026
Merged

webern merged 16 commits into
mainfrom
owner-edits

Conversation

@webern

@webern webern commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

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-fast is cargo test -p deslag in the fast profile: the library's unit tests and every integration binary under tests/ 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 under tests/slow/, declared test = false in Cargo.toml, so a plain cargo test skips it and --test slow runs it. make test-product runs tier 0 and the slow binary in one cargo build, then the doctests; it is what CI's test job runs. The crates under tools/ are not product tests: make test-tools runs them, with the sweep's tests, beside the product tiers and never inside them. make test runs 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 in tests/phrases.rs; and the check in tests/frozen.rs that ran the typos tool.

CI: the test job runs test-exam test-product on both OSes in the fast profile. A new tools job runs the tooling suite on ubuntu; it shows on every run and is not a gate. blobs runs 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 of ci.yml records which job runs which part of make ci, now that no test does.

AGENTS.md gains 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-fast 8.6 s, make test-product 29.6 s, make test-tools 51.5 s, make test-exam 1.9 s, make ci-fast 41 s, make test 83 s. Before this change make ci-fast took 49 s and make test 226 s, and both were red because tests/asbuilt.rs read 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_edit marks on the skills, the deletion of docs/design/, and the open-pr skill's new anti-pattern.

Testing

  • make ci-fast: exit 0
  • make test: exit 0
  • make check: exit 0 after each commit, check-deslag against origin/main included
  • CI on this pull request: the ci workflow 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.yml ran because the Makefile and Cargo.toml changed and passed in 6m00s on its own

References

  • No open issue closes or progresses with this change.

webern added 16 commits October 24, 2026 11:03
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 webern added docs Documentation including agent instructions, readmes, code comments, etc. ai Primarily authored by AI (whether PR, Issue, Whatever) area/build Deals with deslag build, scripts, ci, cd. design An issue or PR that requires design work, usually with a human. labels Oct 24, 2026
@webern webern changed the title build: product test tiers by cargo target, tooling and timing apart build: inprove test seg Oct 24, 2026
@webern webern changed the title build: inprove test seg build: inprove test segmentation and instructions Oct 24, 2026
@webern webern changed the title build: inprove test segmentation and instructions build: improve test segmentation and instructions Oct 24, 2026
@webern
webern marked this pull request as ready for review October 24, 2026 13:12
@webern
webern merged commit 582e6ea into main Oct 24, 2026
9 checks passed
@webern
webern deleted the owner-edits branch October 24, 2026 13:12
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/build Deals with deslag build, scripts, ci, cd. design An issue or PR that requires design work, usually with a human. docs Documentation including agent instructions, readmes, code comments, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant