These instructions apply to this repository — a root Rust workspace with
sources under crates/. The binding design contract is docs/DESIGN.md;
when this file and DESIGN.md disagree, DESIGN.md wins.
Run commands from the repository root:
cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo clippy -p jirakeep --features gen --all-targets -- -D warnings
cargo test --workspace --all-targets --locked
cargo deny checkUse the toolchain pinned in rust-toolchain.toml (repo root, currently
1.97.0). The workspace MSRV is declared once in Cargo.toml
(rust-version = "1.88"); do not introduce APIs or dependencies which
require a newer compiler without deliberately updating both the pin and the
MSRV policy. CI and reproducible local checks use the committed
Cargo.lock, so use --locked for verification.
jirakeep-coreis the portable domain layer: the guard policy engine (policy,guard) and the async Jira Cloud REST client (client). It MUST NOT depend onrmcp,axum,clap, or any MCP/transport crate.jirakeepis the binary: clap CLI parsing, the rmcp MCP server, and the stdio / streamable-HTTP transports. It must not duplicate guard or client logic.- Keep the dependency direction acyclic:
jirakeep -> jirakeep-core, never the reverse. - Both crates inherit
[workspace.package]metadata and[workspace.lints]([lints] workspace = truein each crate manifest). - jirakeep is a sibling of bugwarden, not a shared-crate consumer. Do not add a path dependency on bugwarden without an explicit design change recorded in DESIGN.md.
The security guards are defined in docs/DESIGN.md as invariants
I1–I15. They are normative: reviewers verify them, and CI failures are
never a reason to relax them.
- NEVER weaken a guard to fix a build or test. In particular, do not
turn fail-closed behavior into fail-open (I4), do not vary the uniform
denial text
Issue {key} is not accessible through this serverbetween denied and nonexistent issues (I2), and do not surface filtered/dropped result counts to the client (I3). If a guard blocks a test, fix the test or the design — not the guard. - Never map “no security level” to public. That fail-open hazard is called out in DESIGN.md; absent security level is unknown unless the operator declared the project public.
- The guard policy comes only from the operator's TOML file at startup and is immutable at runtime (I1). The policy file must never become readable or writable through MCP.
- CLI/env flags may only tighten policy, never loosen it (I9).
- The Jira API token must never appear in logs, error messages, or tool
results; sanitize reqwest errors with
.without_url()(I12). - In read-only mode, and for
global.disabled_tools, write tools are removed from the tool listing (ToolRouter::remove_route), not merely made to error (I13).
docs/DESIGN.md is the sole design authority. It records decisions that may look like accidents but are deliberate; convenience, precedent, or other implementations are never a justification for undoing them.
- Follow
rustfmt; use idiomatic ownership and borrowing rather than cloning to resolve a lifetime issue by default. - Public items need rustdoc that explains purpose, relevant errors, and behavioral constraints. Keep crate documentation accurate.
- Return errors with actionable context (
anyhowwith context). Do not useunwrap,expect, or panics in recoverable production paths. - Keep
unsafeforbidden. Do not weaken workspace lint configuration merely to silence a new warning. - Prefer small, focused functions and exhaustive
matchexpressions for externally meaningful enums (Capability,Action,Access).
- Do not block Tokio worker threads with synchronous I/O, sleeps, or process calls. Bound network operations with the client's configured timeout.
- Tracing goes to stderr always — stdout belongs to the stdio transport.
- Add focused unit tests alongside changed modules; use wiremock for
HTTP-level integration tests in
crates/jirakeep-core/tests/as the client grows. - A dependency change must update
Cargo.lock, preserve the MSRV, and passcargo deny check. Prefer the smallest compatible version change; do not run a broadcargo updateas part of an unrelated change. typosruns as its own workflow;typos.tomlis an allowlist of deliberate spellings, never a mask for a real typo.
- One logical, self-contained change per pull request.
- Commit subjects follow Conventional Commits:
type(scope): imperative lowercase subject, no trailing period, at most ~72 characters. Types in use:feat,fix,docs,test,refactor,chore,ci; Dependabot ownsbuild(deps). Scope is the crate or area (core,server,policy,release, …). maintakes rebase merges only; every commit must build and pass the workspace verification commands on its own.- PR titles equal the primary commit subject. Security-relevant changes name the DESIGN.md invariants they touch.
A release is one push of an annotated tag; nothing is released by hand.
- The tag is the bare version, no
vprefix (0.1.0), and must equal[workspace.package] version. .github/workflows/release.ymlbuilds x86_64-unknown-linux-gnu and aarch64-apple-darwin, creates a GitHub release, then publishesjirakeep-corebeforejirakeepvia crates.io Trusted Publishing (OIDC; no registry credential in the repo).