Part of #238
Background
scripts/enforce_hygiene.sh and scripts/sanitize_readme.py already implement real hygiene checks (no committed build artifacts, correct Cargo.toml descriptions, no hardcoded testnet contract IDs in READMEs, cargo metadata sanity) used internally by maintainers, most recently in the #225 example-hygiene effort. They are not runnable by an external contributor as a discoverable, first-class command.
Objective
Expose the existing hygiene logic as cougr check, runnable by any contributor before opening a PR, with output that maps 1:1 to what CI will enforce.
References
scripts/enforce_hygiene.sh and scripts/sanitize_readme.py (the logic being exposed, not reimplemented from scratch)
EXAMPLE_STANDARD.md (the standard the check enforces for example directories)
.github/workflows/core.yml (the CI gate this command should locally approximate)
In scope
cougr check (run from a project or example root) executes the same checks as scripts/enforce_hygiene.sh: no committed target//.wasm artifacts, .gitignore present, Cargo.toml description field sanity, no hardcoded deployment identifiers in README.md.
- Decide and document the implementation approach: either port the bash/Python logic into Rust natively, or have
cougr check shell out to the existing scripts where they still make sense (state the tradeoff explicitly in the PR description; both are acceptable, but the choice must be deliberate, not incidental).
cougr check run from examples/<name>/ checks that single example against EXAMPLE_STANDARD.md; run from repo root, it checks every example.
- Exit code 0 only if every check passes; non-zero with a clear, itemized failure list otherwise.
Out of scope
- Auto-fixing violations (
cougr check --fix); v1 is diagnostic only.
- Replacing
scripts/enforce_hygiene.sh in CI; that migration, if desired, is a separate decision for maintainers once cougr check is proven equivalent.
Definition of done
Part of #238
Background
scripts/enforce_hygiene.shandscripts/sanitize_readme.pyalready implement real hygiene checks (no committed build artifacts, correctCargo.tomldescriptions, no hardcoded testnet contract IDs in READMEs,cargo metadatasanity) used internally by maintainers, most recently in the #225 example-hygiene effort. They are not runnable by an external contributor as a discoverable, first-class command.Objective
Expose the existing hygiene logic as
cougr check, runnable by any contributor before opening a PR, with output that maps 1:1 to what CI will enforce.References
scripts/enforce_hygiene.shandscripts/sanitize_readme.py(the logic being exposed, not reimplemented from scratch)EXAMPLE_STANDARD.md(the standard the check enforces for example directories).github/workflows/core.yml(the CI gate this command should locally approximate)In scope
cougr check(run from a project or example root) executes the same checks asscripts/enforce_hygiene.sh: no committedtarget//.wasmartifacts,.gitignorepresent,Cargo.tomldescriptionfield sanity, no hardcoded deployment identifiers inREADME.md.cougr checkshell out to the existing scripts where they still make sense (state the tradeoff explicitly in the PR description; both are acceptable, but the choice must be deliberate, not incidental).cougr checkrun fromexamples/<name>/checks that single example againstEXAMPLE_STANDARD.md; run from repo root, it checks every example.Out of scope
cougr check --fix); v1 is diagnostic only.scripts/enforce_hygiene.shin CI; that migration, if desired, is a separate decision for maintainers oncecougr checkis proven equivalent.Definition of done
cougr checkrun against a known-clean canonical example (e.g.examples/snake) exits 0.cougr checkrun against a deliberately broken fixture (committedtarget/, badCargo.tomldescription) fails with a specific, correct diagnostic per violation.scripts/enforce_hygiene.sh's current output.