@/.standards/CORE.md
@/.standards/AGENT.md
@~/.standards/language/rust.md
Rust CLI that reports per-author ownership (surviving meaningful code) and labor (meaningful work over all history) for a Git repository, without letting formatting or trivial edits transfer credit. Public repository: github.com/avhn/git-credit.
Read docs/PLAN.md before changing attribution behavior; it holds the algorithm
decisions and the phase plan. Keep it current when a decision changes.
- Build:
cargo build --workspace - Test:
cargo test --workspace - Lint (same flags as CI):
cargo lint - Format:
cargo fmt --all - Text policy:
tools/check-text.sh; tooling tests:tools/tests/check-commit-msg.test.sh - Hooks (once per clone):
git config core.hooksPath .githooks
Local gate before any push: cargo fmt --all --check && cargo lint && cargo test --workspace && tools/check-text.sh.
crates/credit-core: pure engine. No I/O, no clocks, no global state, no serde. Every runtime dependency needs a written justification indocs/PLAN.md(why std is not enough, license, maintenance).crates/credit-git: the only crate that touches the repository (gix).crates/git-credit: binary. Config, orchestration, output.anyhowis allowed here only.- Results go to stdout, diagnostics to stderr;
--jsonoutput shape is versioned and documented indocs/json.mdonce it exists. - Reports embed
credit_core::ALGORITHM_VERSION; bump it whenever the same history and policy could produce different credit.
- Fixture repositories are built programmatically in temp dirs with fixed identities
and dates. Disable hooks and commit signing inside fixtures
(
-c commit.gpgsign=false -c core.hooksPath=/dev/null). - Every attribution rule gets a fixture proving it: formatting commit, small edit under and over the threshold, move, rename, co-author, mailmap, deletion keeps labor.
credit-coreline coverage must stay at or above 80% (enforced in CI).
- Commit hooks are Rust-native, not Husky/commitlint/Commitizen. Owner decision
2026-11-08: no Node toolchain in a Rust repo.
.githooks/commit-msgand the CIpolicyjob runtools/check-commit-msg.shinstead;.githooks/pre-commitruns fmt and the text policy. - GitHub-hosted runners, not self-hosted containers. Public open source project;
jobs run on
ubuntu-latest,windows-latestandmacos-latestwithout a container. - Workflow checker not vendored. The Node-based workflow standard checker is not copied in; workflow headers, taxonomy names and SHA pins are maintained by hand.
- Public README badges. CI, audit and license badges are shown because this is a public open source project.
- Dependabot is enabled. Its pull requests are update notices only; changes still
land on
mainthrough the normal local flow. - Tagged CLI releases.
release.ymlruns onv*tag pushes, rather than only branch pushes: tagged releases are the norm for open source CLIs. Tag/workspace version equality, policy, static checks, tests and all target builds gate release. Only its release publication and APT/Pages deployment jobs can write repository contents. Homebrew publication uses a separate tap-scoped deploy key. - Distribution jobs are channel-named.
homebrew,apt,verify-homebrewandverify-aptdistinguish publication from public installation checks. APT and manual Pages jobs combine retained-branch preparation and deployment under one shared lock. Only those deploy jobs receive Pages and OIDC write permissions. - APT install verification uses distro containers. Debian 12 and Ubuntu 22.04 containers on hosted runners have explicit memory/swap caps; readable distro tags track security updates for these compatibility checks.
- Generated distribution commits match their channels. Tap and retained Pages
commits use the
git-credit-release[bot]identity and version-oriented messages; source commits continue to require Conventional Commits. - Badge publication is generated-only.
badges.ymlpublishes an orphan assets branch on main pushes, using an explicit branch lease and a current-main SHA check. No source commits are rewritten. The composite action uses the same publisher and allows callers to disable publication.