Repository navigation
chore: move every crate into its ADR-0009 directory (crates-layout PR 3) - #221
Merged
Merged
Conversation
Each of the 19 workspace members moves with git mv, and nothing else
changes in this commit, so review and git log --follow see 359 renames
at 100 % similarity. Package names do not change.
adapters/{cloudflare,memory,oidc,postgres,selfhosted}
api/core (thrust-api), api/v1, api/compat-plane, api/plane-types
core/ports, core/types (thrust-contracts), core/usecases (thrust-core)
editor/doc, spikes/editor-worker
testing/suites/api (thrust-contract-tests),
testing/fixtures/oracle (thrust-oracle-fixture)
edge, server, worker
thrust-edge (#211) arrived after the plan was written. ADR-0009 had
already reserved crates/edge/ for it.
The workspace does not build at this commit: the next one edits the
paths that name these directories.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit moved the crates; this one edits what names their directories, so the workspace builds again. - Root Cargo.toml: members and [workspace.dependencies]. Since PR 2 (#212) it is the only manifest that names a crate's directory. - crates/spikes/editor-worker/wrangler.toml calls ../../../scripts/rs: it is the one crate now three levels down that climbs out with a relative path. The worker's and the edge's configs stay at ../../ (depth 2). - Every other file that wrote crates/thrust-<x>: CI actions and workflows, the deploy and check scripts, the probes, tools/compat-record, tools/spike-0006, the docs. Matched on a whole name, so thrust-api never matched inside thrust-api-v1. Also the comments and docs that wrote a crate path without crates/ (thrust-core/tests/operator.rs): they now name the real path. - The ones that fail silently when missed: deploy.yml's paths filter (crates/worker/wrangler.deploy.toml), .cargo/mutants.toml's exclude globs (the contract suite, the edge's runtime.rs) and .gitignore. - check-deps.sh: the proof-minting guard's literal paths, including the regex alternation that exempts the composition roots. - tools/measure-zxcvbn/patches: regenerated (applied to the moved tree, diffed, reverted). Their hunks are unchanged; their headers name crates/core/usecases, at today's line numbers. - test_plan_ci.py: ADR-0009's layout is now the default for the real graph and the flat one only the "before" of the check that moving a crate changes no plan. It also checks that this repository keeps REAL_GRAPH's crates where ADR_0009 says. - docs/src/contributing/crates.md: "Adding a crate" starts by choosing the group (or the top level, for a program); "Not part of the product graph" puts the editor Worker in spikes/ and says thrust-editor-doc is product code now, and adds crates/testing/. - ARCHITECTURE §2a redrawn from ADR-0009, with all 19 crates and the two planned ones (the M4 core API, the collab root). - The plan: thrust-edge's row in the mapping, the recount, the status. Not edited: .agents/plans/** other than the two above (dated records) and CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ADR-0009 rule 1: a directory under crates/ is a crate or a group, and a group has a README.md that names its members and says what belongs in it. One for crates/ (the groups, the programs and the names reserved for programs), and one each for adapters/, api/, core/, editor/, spikes/ (when a spike goes here and when in probes/) and testing/ (what goes there, and where each kind of test that is not a crate lives). The two groups inside testing/, suites/ and fixtures/, get short ones too, so the rule holds for every group and PR 4's guard can check it without an exception. plan-ci.py gives a group's README.md, inside no crate, no job. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its description began "Spike 0006". The crate is product code now: thrust-api-v1 and thrust-compat-plane use its sanitiser, which is why ADR-0009 puts it in editor/ and only the spike's measurement Worker in spikes/. The description says that, and that it began as spike 0006. This is the only change to package metadata in PR 3; the cargo metadata comparison of the move ran before it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 16, 2026
#221 moved every crate (crates/thrust-core is crates/core/usecases, and so on), so this branch conflicted with main. - The 11 files this branch adds under an old directory go to the new one, where git's directory-rename detection put them (login_code.rs and its tests, magic.rs and its tests, the X12 and X13 fixtures, migration 0018, the memory adapter's login_codes.rs). - The 3 content conflicts (docs/src/testing/status.md, docs/src/testing/techniques/mutation.md, tools/compat-record/gen-acceptance.py) take this branch's side, whose only difference from main's was main's path rewrite. Then the same rewrite #221 used gives those lines, and two comments this branch added (crates/adapters/memory/tests/login_codes.rs, crates/api/compat-plane/tests/common/mod.rs), the new paths. Checks: - No file outside .agents/plans and CHANGELOG.md names crates/thrust-. - status.md: every one of main's 60 rows is byte-identical to main's, and G-42 is the only row added. - Against main, this branch now changes the same 47 files as before the merge, at their new paths, with the same line counts. The 48th, the Cargo.lock line for thrust-edge 0.2.0, is already on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 16, 2026
…se tag pattern, and check both ends (#222) release-pr has failed on main since #211: `cannot find package "thrust-edge" in workspace`. Every crate finds its previous version from the one tag v<version>; release-plz 0.4.3 then rebuilds that tag's workspace and looks the crate up in it (next_ver.rs, process_git_only_package), and thrust-edge is not in v0.2.0. A crate is treated as a first release only when no tag matches its pattern. - release-plz.toml: thrust-edge gets git_tag_name = "thrust-edge-v{{ version }}", which matches no tag. The header says why, and that the pattern goes once a release contains the crate. - check-release-plz.py: a git_tag_name may only be the entry's own first-release pattern, and never on the tagger. New --first-release, against the highest v<major>.<minor>.<patch> tag, comparing package names (a moved crate is not new): - `required`: every crate the tag lacks has its pattern. Run by ci.yml's deps job, whose checkout now fetches the tags. - `exact`: and no crate the tag has keeps one. Run by release-plz.yml's release-pr job before release-plz. It is not run in deps, where from the tag of a release to the pattern's removal it would fail every pull request, and main's run of the release commit. - cicd.md: "A new crate", and how it was verified. Verified with release-plz 0.4.3 on clones of main: - at #218: release-plz update exits 1 with the CI error on main's config; with this one it exits 0 and proposes 0.2.1 with #211's feature in the changelog. The candidate's Cargo.lock passes cargo metadata --locked. A first release's own commits do not set the bump (a feature alone proposed the patch). - at #221 (every crate moved, ADR-0009): the same error on main's config. With this one, exit 0 and nothing to propose: release-plz counts a crate's commits by its current directory, so #211's feature (made under crates/thrust-edge) no longer counts and the move is a chore. #211's feature reaches a changelog only through a release made by hand. - then a fix(edge) commit proposes 0.2.1. With v0.2.1 tagged and a second fix: with the pattern kept, 0.2.2's section lists the first fix (and the move) again, and --first-release exact refuses it; with it removed, only the second fix, and exact passes. - on this repository: --first-release required refuses main's release-plz.toml (thrust-edge only: the moved crates are found in v0.2.0 by name) and passes with this one; exact passes. - test_check_release_plz.py: 151 passed, over generated git histories for every crate. Nine hand mutants of the checker (name-order or pre-release tags as the last release, exact never or always refusing, any pattern value accepted, the tagger's pattern allowed, no tag passing, crates compared by directory, a patterned crate still required) each fail it. - lint-all-workflows.sh, actionlint, test-lint-all-workflows.sh, test-lint-workflow.sh, test-required-contexts.sh and test_plan_ci.py (5013) pass. Not verified: actions/checkout with fetch-tags at depth 1 on the runner. Its source at the pinned commit adds +refs/tags/*:refs/tags/* to the fetch; this pull request's deps job is the check. Refs: #195 Co-authored-by: Claude Opus 5.5 <[email protected]>
Merged
aRustyDev
added a commit
that referenced
this pull request
Nov 16, 2026
#226) * ci: guard ADR-0009's crate layout in the deps job (scripts/check-layout.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: the layout guard, and the plan's status after the move - 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]> --------- 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 3 of the crates-layout plan (
.agents/plans/crates-layout/, ADR-0009): the move. Every crate goes to its ADR-0009 directory, and no package is renamed.thrust-adapters-{cloudflare,memory,oidc,postgres,selfhosted}adapters/{cloudflare,memory,oidc,postgres,selfhosted}thrust-api,thrust-api-v1,thrust-compat-plane,thrust-plane-typesapi/core,api/v1,api/compat-plane,api/plane-typesthrust-contracts,thrust-ports,thrust-corecore/types,core/ports,core/usecasesthrust-editor-doc/thrust-editor-workereditor/doc/spikes/editor-workerthrust-contract-tests/thrust-oracle-fixturetesting/suites/api/testing/fixtures/oraclethrust-server,thrust-worker,thrust-edgeserver,worker,edgethrust-edge(#211) was added after the plan was written. ADR-0009 had already reservedcrates/edge/for it.Commits
git mvat 100 % similarity, so review andgit log --followsee nothing else. The workspace does not build at this commit.Cargo.toml, which since build: crate paths that work at any directory depth (crates-layout PR 2) #212 is the only manifest that names one.wrangler.tomlnow calls../../../scripts/rs. It is the only crate, now three levels down, that climbs out with a relative path.crates/thrust-<x>: CI actions and workflows, the scripts, the probes, the tools and the docs. These are matched on a whole name, sothrust-apinever matched insidethrust-api-v1.crates/now name the real path.test_plan_ci.pynow uses ADR-0009's layout for the real graph.docs/src/contributing/crates.md: "Adding a crate" now starts by choosing a group.README.mdforcrates/and for each group (ADR-0009 rule 1). That includestesting/suites/andtesting/fixtures/, so PR 4's guard can check the rule without an exception.thrust-editor-doc's description no longer begins "Spike 0006". It is product code:api-v1andcompat-planeuse its sanitiser.Evidence
Every check has a control that makes it fail (AGENTS.md rule 8).
cargo metadata --no-depsbefore and after, every path replaced by the package it namesdefault-features, a dependency pointed at another crate, a dependency pointed outside, a kind, a target's source file, a package in the wrong directory, a dropped dependency, a dropped member, a features table, a target-specific dependencygit grep 'crates/thrust-' -- . ':!.agents/plans' ':!CHANGELOG.md'Cargo.lockcargo nextest run --profile ci --workspacecargo test --doc --workspace,cargo clippy --workspace --all-targets -- -D warningsscripts/contract.sh native-memory mainscripts/mutants.sh(the contract suite's mutation controls)depsandci-scriptsjobs, shell scripts under dashtest_plan_ci.pypassed=5,013, bad=0plan-ci.py: first two segments bad=2,401; shortest prefix bad=123; no segment boundary bad=1check-placement.sh,check-topology.shdefault tocrates/workerdeploy.yml'spaths:filtersgit ls-files --error-unmatch)crates/thrust-worker/wrangler.deploy.toml: exit 1.cargo/mutants.tomlexclude globscargo mutants --list-files --workspacelists 81 files, none in the suite and not the edge'sruntime.rsruntime.rsworker-buildfrom each Worker's own directory, with itswrangler.tomlcommandworker,spikes/editor-workerandedgebuild../../scripts/rs: exit 127cargo fmt --all --checkSUMMARY.mdis unchangedNot run here:
mdbook-mermaidis not installed, socheck-book.shstops on it. The book was built with that preprocessor marked optional; CI'sdocsjob runs the full check.oraclenextest profile, becausetools/spike-0006/gen-all.sh's output (Node) is not generated here, as in build: crate paths that work at any directory depth (crates-layout PR 2) #212.On the no-segment-boundary control: the case that catches it is now
crates/core/types-gonebeside the cratecrates/core/types. The flatcrates/thrust-core-gonecase went with the flat layout.Branches alive across the move
#220 is open and touches
crates/. It merges cleanly intomaintoday. Merged after this PR, it would see:docs/src/testing/status.md,docs/src/testing/techniques/mutation.md,tools/compat-record/gen-acceptance.py), where both branches edit the same lines.crates/thrust-paths in its own new text.If #220 merges first, I'll merge
maininto this branch and redo the same steps here.Not edited:
.agents/plans/**other than ARCHITECTURE §2a and this plan's own files (dated records), andCHANGELOG.md.After merge, GitNexus is re-indexed from the canonical checkout of
main.Cargo.tomlchanged, so CI runs everything.🤖 Generated with Claude Code