Skip to content
peleda-appPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

dojo

The rules of every repository of the peleda-app workspace, the scripts they share, the templates they start from, and dojo, the tool that checks a repository against the rules and keeps the shared files in sync.

What is here

  • docs/RULES.md: the rules. Every repository holds a byte-identical copy at docs/RULES.md, links it first from its AGENTS.md and imports it from its CLAUDE.md with @docs/RULES.md.
  • docs/LICENSING.md: the three license tiers (open, noncommercial, private), which tier may depend on which, and the contribution policy (DCO for open repositories, a CLA for noncommercial ones).
  • docs/CHECKS.md: every check dojo check runs, its severity and how to fix it.
  • docs/REVIEW.md: the review checklist for the rules no check can enforce.
  • registry.toml: every repository of the workspace with its tier and status.
  • shared/: check-unsafe.sh, check-fast.sh, fuzz-run.sh, siblings-refs.sh and check-ci-siblings.sh, installed into repositories by dojo sync.
  • templates/: AGENTS.md, CLAUDE.md, mise.toml (and mise-plain.toml for repositories without Rust), a CI workflow, dojo.toml, deny.toml, CLA.md and the noncommercial README section.
  • licenses/: MIT and Apache-2.0 texts with a {holder} placeholder.

The tool

dojo check [PATH] [--format text|json] [--report]   # check one repository; exit 1 on any error unless --report
dojo sync [PATH] [--dry-run]                          # write docs/RULES.md and the shared scripts (nested layers too)
dojo report <WORKSPACE> [--format text|json] [--all]  # check every registered repository found in WORKSPACE
dojo rules                                            # print the rules
dojo siblings bump [NAME...] [--allow-dirty]          # pin siblings.toml to the siblings' local HEADs
dojo siblings status                                  # pins against local HEADs, commits between, pushed or not

--registry <file> replaces the embedded registry.toml.

A repository declares itself in dojo.toml:

[repo]
name = "rinse"

[checks]
fuzz = true

[[allow]]
check = "MOD-ANYHOW"
path = "crates/foo"
reason = "why this exception is needed"

Adding the rules to a repository

  1. Add the repository to registry.toml with its tier.
  2. Copy templates/dojo.toml to the repository and set its name.
  3. Run dojo sync there, then add the lines it prints to AGENTS.md and CLAUDE.md (see templates/AGENTS.md and templates/CLAUDE.md).
  4. Add the dojo task of templates/mise.toml (templates/mise-plain.toml for a repository without Rust) and end the check task with mise run dojo; CI installs dojo as templates/ci.yml shows.

Running dojo from another repository

mise run install here puts dojo on PATH. Without it, the dojo task of the templates runs mise exec -C ../dojo -- cargo run -q -p dojo -- check "$PWD", which needs no Rust toolchain in the calling repository. mise exec -C changes the working directory, so a relative PATH would be resolved inside dojo: scripts and orchestrators always pass absolute paths ("$PWD"). dojo report lists active, merging and planned repositories; retired ones still on disk get one line, and --all checks them too.

From another repository of the workspace without an installed dojo, with that repository as the working directory:

cargo run -q --manifest-path ../dojo/Cargo.toml -p dojo -- check "$PWD"
cargo run -q --manifest-path ../dojo/Cargo.toml -p dojo -- sync "$PWD"
cargo run -q --manifest-path ../dojo/Cargo.toml -p dojo -- siblings bump [NAME...] [--allow-dirty]
cargo run -q --manifest-path ../dojo/Cargo.toml -p dojo -- siblings status

(mise exec -C ../dojo -- cargo run ... uses dojo's toolchain pin, but changes the working directory: then pass -C "$PWD" to siblings.)

Development

mise run check    # unsafe check, formatting, clippy, tests, fuzz build, dojo check on itself
mise run load     # load test over a synthetic repository
mise run fuzz     # fuzz every target
mise run report   # report over the sibling repositories
mise run deny     # cargo deny

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repository, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. Contributions need a DCO sign-off (git commit -s).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages