Skip to content

chore(arch): crate kinds and a crate-level dependency matrix check - #1255

Merged
ajianaz merged 1 commit into
developfrom
chore/arch-kinds-check
Nov 26, 2026
Merged

ajianaz merged 1 commit into
developfrom
chore/arch-kinds-check

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Every workspace crate declares a kind ([package.metadata.tole] kind), and scripts/arch-check.sh checks 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 existing Check job, so no required check name changes.

Why

Closes #1250 (first child of #1249). Module layering inside tole-core and tole-cli is 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 (mode kinds, Python 3.8+, standard library only): pure functions over cargo metadata --no-deps --offline; fails closed (exit 2) when it cannot finish. scripts/arch-check.sh wraps 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).
  • kind in the six crates: tole-core core, tole-client integration, tole-tui ui, tole-desktop-model app, tole-desktop bin, tole-cli bin.
  • .github/workflows/ci.yml: the self-test and the check, in the Check job.
  • Docs in the same PR: AGENTS.md (sections 1, 3, 6), CONTRIBUTING.md, docs/architecture.md ("Crate kinds").
  • No change in any crate's code or public API.

Testing

Run on the branch head 0b991ff in 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.sh passes; scripts/desktop-check.sh passes (after cargo fetch; its literals warnings are advisory and were there before). The new kind key does not trip it.
  • cargo test --workspace --no-fail-fast: 4,520 tests pass, 6 fail, all in crates/tole-cli/tests/assemble_golden.rs (the golden tool roster lacks gh in the cloud container used for this run). The same 6 fail on an untouched develop (cb0bf63) in the same container, so they are not caused by this PR; CI is the check for them.
  • Not run: cora review --staged and scripts/review-local.sh (no Cora binary or LLM key in this container). The CI Cora Review job is the gate.
  • The negative check of AC2 (adding crossterm to tole-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.

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
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 9ebeea3 into develop Nov 26, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: crate kinds and a crate-level dependency matrix (standard rules L1 to L3)

1 participant