Wires the no-vanity-metrics policy from prose-only into structural
enforcement. Without this, the next time a count creeps into a
README it stays there until I notice; with this, the PR fails.
What lands:
- scripts/check-no-vanity-metrics.sh — bash scanner, dep-free,
targets marketing/spec/governance Markdown only (per-phase
progress docs, CHANGELOGs, conformance/notes/research dirs
exempt by design). Regex is tuned to the patterns we've actually
had to fix and rejects false positives on RFC / codec / version
references. Lines that legitimately need a number opt out with
`<!-- allow-vanity: <reason> -->`.
- .github/workflows/no-vanity-metrics.yml — CI workflow runs the
scanner on every PR and `main` push that touches Markdown.
- .githooks/pre-commit — same scanner, local guard so the failure
happens before push. Activated per-clone via
`scripts/install-hooks.sh`.
- CHARTER.md — adds a "Messaging — no vanity metrics" section
documenting the policy and pointing to the scanner.
Also strips the four remaining drift sites the scanner found on
first run: a ~5 LOC stub note, a "98 crates" + "≤ 120 LOC" mention
in jouleclaw-stack/examples/AGENTS.md, and "26 crates" in the PCI
scope-map doc. The CAMT.054 ISO 20022 message-name reference is
preserved via an allow-vanity marker.
33 lines
947 B
YAML
33 lines
947 B
YAML
name: no-vanity-metrics
|
|
|
|
# Blocks reintroduction of codebase-state numbers (crate counts, test
|
|
# counts, LOC, "N+ adapters", etc.) into READMEs and other Markdown
|
|
# surfaces. Those numbers drift on every code change and create
|
|
# permanent sync debt with the websites; the open-standards posture is
|
|
# "describe the shape, not the size." See CONTRIBUTING.md for the
|
|
# rationale and the opt-out marker.
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '**/*.md'
|
|
- '.github/workflows/no-vanity-metrics.yml'
|
|
- 'scripts/check-no-vanity-metrics.sh'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**/*.md'
|
|
- '.github/workflows/no-vanity-metrics.yml'
|
|
- 'scripts/check-no-vanity-metrics.sh'
|
|
|
|
jobs:
|
|
scan:
|
|
name: Scan committed Markdown for vanity metrics
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run scanner
|
|
run: bash scripts/check-no-vanity-metrics.sh
|