Repository navigation
ci: guard ADR-0009's crate layout in the deps job (crates-layout PR 4) - #226
Merged
Merged
Conversation
…ut.sh) The layout PR 3 (#221) made is kept by a check, run by CI's deps job with its --self-test beside it. It reads the tracked files (git ls-files) and the workspace (cargo metadata --no-deps) and refuses: 1. a workspace member outside crates/; 2. a directory under crates/ that is neither a crate nor a group; a crate inside another; a group with no README.md, with a file other than its README.md (a manifest beside it: a crate and a group at once), or whose README.md does not name a directory in it as `<name>/`; 3. a normal or build dependency on a crate in testing/ or spikes/; 4. a normal or build dependency of a crate in core/ on one outside core/. Dev-dependencies are allowed in 3 and 4: a test uses a fixture, and thrust-core's tests run against the memory adapters (the scope check-deps.sh already uses for core); 5. a stale path where nothing else would notice one: a workflow's paths:/paths-ignore: entry that names no tracked file (or a glob over a directory with none), a .cargo/mutants.toml exclude_globs or examine_globs entry likewise, and a .gitignore line under crates/ that lies inside no crate. These are the three silent traps found while planning the move. It exits 2, not 0, when there is nothing to check (no member, no tracked file under crates/). Its success line counts what it read: on this tree, 19 crates, 9 groups, 23 workflow filter entries, 5 mutants.toml globs and 9 .gitignore lines. plan-ci.py: the guard joins the deps job's guards. A group's README.md, which ran nothing, and .gitignore, which matched no rule, now run deps, because the guard reads them. test_plan_ci.py follows: passed=5016. Controls: --self-test runs 23 cases on a small world. The consistent world passes; each broken one must exit 1 with the message of the rule it breaks, not merely fail, and an empty world must exit 2. On the real tree, a tracked crates/stray.txt makes the check exit 1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- docs/src/testing/techniques/architecture-gates.md: check-layout.sh as the second architecture gate (what it reads, its rules, its control). - docs/src/testing/running.md: the deps job's row named only check-deps and check-topology; it now names every guard the job runs. - docs/src/contributing/crates.md, crates/README.md: the guard checks what "Adding a crate" asks for. crates/core/README.md: core/'s rule is on normal and build dependencies; thrust-core's dev-dependency on the memory adapters is allowed. - The plan: PR 3 merged in #221, and how #220 was brought across the move; PR 4's choices as built. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 16, 2026
PR 4 merged in #226, so the status table says so, and the plan's status reads done. What it left for later stays in PLAN.md's last section. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
PR 4, the last of the crates-layout plan (
.agents/plans/crates-layout/, ADR-0009). It adds a guard that keeps the layout #221 made.What
scripts/check-layout.shruns in CI'sdepsjob, with its--self-testbeside it. It reads the tracked files (git ls-files) and the workspace (cargo metadata --no-deps), and refuses:crates/.crates/that is neither a crate nor a group (ADR-0009 rule 1). This covers:README.md;README.md(a manifest there would make it a crate and a group at once);README.mddoes not name a directory in it as`<name>/`.testing/orspikes/.core/on a crate outsidecore/.paths:/paths-ignore:entry that names no tracked file, or a glob over a directory with none;.cargo/mutants.toml'sexclude_globsandexamine_globs;.gitignoreline undercrates/that lies inside no crate.With nothing to check it exits 2, not 0. Its success line counts what it read: on this tree, 19 crates, 9 groups, 23 workflow filter entries, 5
mutants.tomlglobs and 9.gitignorelines.One choice to look at. Rules 3 and 4 allow dev-dependencies.
thrust-core's tests run againstthrust-adapters-memoryas a dev-dependency, so "nothing incore/depends on a crate outside it", read literally, fails on today's tree. The guard checkscore/'s normal and build edges, the same scopecheck-deps.shalready uses forcore.crates/core/README.mdand the plan say so.plan-ci.py:check-layout.shis routed like the deps job's other guards.README.mdran no job, and.gitignorematched no rule. Both now rundeps, because the guard reads them.Docs:
running.md'sdepsrow now names every guard the job runs (it named two).Evidence
scripts/check-layout.sh --self-testscripts/check-layout.shon this treecrates/stray.txt: exit 1.deploy.yml's filter put back tocrates/thrust-worker/wrangler.deploy.toml: exit 1, naming itdepsandci-scriptsjobs, shell scripts under dashtest_plan_ci.pypassed=5,016, bad=0mdbook-mermaidis not installed here, so it was built with that preprocessor marked optional; CI'sdocsjob runs the full check)Not changed: ADR-0009 (accepted; the guard is its Confirmation).
🤖 Generated with Claude Code