Parfii-bot
|
d04e6efe1e
|
refactor(v0.17): README counts auto-generation via markers + regen script
Eliminates README counts drift class (RULE 0.10 recurrence — 3rd
drift in one week: RUST_CRATES 23→24, SKILLS 38→39, PROFILE_FULL
36→37, PROFILE_DEV 4→10, BLOCKS 73→78).
Mechanism: HTML-comment markers wrap every auto-countable value:
<!-- count:RUST_CRATES -->24<!-- /count:RUST_CRATES -->
16 marker types cover: RUST_CRATES, RUST/SHELL/TOTAL_PRIMITIVES,
SKILLS, HOOKS, BLOCKS, AGENTS, BRIDGES, PROFILE_FULL/MCP/DEV/OPS/
FRONTEND/CORE, LBM_PORTS.
scripts/regen-counts.sh (117 LOC, POSIX sh) — computes every count
from source (MANIFEST.toml, Cargo.toml, find on skills/hooks/blocks/
manifests/bridges) and rewrites markers in place. --check mode
(side-effect-free via mktemp+cmp+diff) exits 1 on drift.
scripts/precommit-counts-check.sh (26 LOC) — invokes regen-counts
--check, blocks commit on drift with fix-it hint.
README gains 'Regenerating counts' subsection documenting both
commands and pre-commit wiring.
No Python/jq/yq hard deps. macOS /bin/sh compat (3.2-era). Idempotent.
Constructor Pattern: largest script 117 LOC (<120), largest awk fn
10 LOC (<30).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-04-22 15:24:05 +08:00 |
|