Repository navigation
chore(arch): crate kinds and a crate-level dependency matrix check - #1255
Merged
Merged
Conversation
Foundation for the architecture standard (#1249): every workspace crate declares a kind in its Cargo.toml and scripts/arch-lint.py (mode `kinds`) checks the crate-level dependency matrix over `cargo metadata`, in the style of scripts/desktop-lint.py. scripts/arch-check.sh wraps it, with 19 unit tests in scripts/test_arch_lint.py and a CI step. No new published crate: layering stays a check, as decided in #752. AGENTS.md, CONTRIBUTING.md and docs/architecture.md describe the rule. Work in progress: fmt, clippy, the workspace tests, desktop-check and cora review were not run before this push; the PR for #1250 follows. Part of #1250
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 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.
What
Every workspace crate declares a kind (
[package.metadata.tole] kind), andscripts/arch-check.shchecks the crate graph against the dependency matrix of the CodeCora modular + thin-UI standard (rules L1 to L3). It runs as two steps of the existingCheckjob, so no required check name changes.Why
Closes #1250 (first child of #1249). Module layering inside
tole-coreandtole-cliis already a test (#752); the crate level above it was convention only. No new published crate and no new Cargo dependency (#752 stands).Changes
scripts/arch-lint.py(modekinds, Python 3.8+, standard library only): pure functions overcargo metadata --no-deps --offline; fails closed (exit 2) when it cannot finish.scripts/arch-check.shwraps it.scripts/test_arch_lint.py: 19 unit tests (missing and unknown kind, upward dependency, toolkit in a core crate, dev dependency not flagged, fail-closed paths).kindin the six crates:tole-corecore,tole-clientintegration,tole-tuiui,tole-desktop-modelapp,tole-desktopbin,tole-clibin..github/workflows/ci.yml: the self-test and the check, in theCheckjob.AGENTS.md(sections 1, 3, 6),CONTRIBUTING.md,docs/architecture.md("Crate kinds").Testing
Run on the branch head
0b991ffin a clean worktree:python3 scripts/test_arch_lint.py: 19 tests pass.scripts/arch-check.sh:6 crates checked ... ok.cargo fmt --all -- --check: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.scripts/test-desktop-check.shpasses;scripts/desktop-check.shpasses (aftercargo fetch; its literals warnings are advisory and were there before). The newkindkey does not trip it.cargo test --workspace --no-fail-fast: 4,520 tests pass, 6 fail, all incrates/tole-cli/tests/assemble_golden.rs(the golden tool roster lacksghin the cloud container used for this run). The same 6 fail on an untoucheddevelop(cb0bf63) in the same container, so they are not caused by this PR; CI is the check for them.cora review --stagedandscripts/review-local.sh(no Cora binary or LLM key in this container). The CI Cora Review job is the gate.crosstermtotole-core) was run by the author of the branch, per the handoff on ci: crate kinds and a crate-level dependency matrix (standard rules L1 to L3) #1250; here it is covered by the unit tests only.