Skip to content

chore: root-md cleanup + pre-commit allowlist guard - #210

Merged
flupkede merged 4 commits into
developfrom
chore/root-md-cleanup
Aug 18, 2026
Merged

chore: root-md cleanup + pre-commit allowlist guard#210
flupkede merged 4 commits into
developfrom
chore/root-md-cleanup

Conversation

@flupkede

Copy link
Copy Markdown
Owner

What

  • Root markdown limited to the 7-file allowlist: AGENTS.md, AGENTS.develop.md, CLAUDE.md, README.md, README_CSharp.md, CHANGELOG.md, RELEASING.md.
  • Stray root mds + tracked docs/ dissolved into gitignored .docs/ (byte-identical, blob-hash verified).
  • pre-commit guard rejects introduced root-level *.md outside the allowlist (quotePath-safe, bash 3.2 safe).
  • Rule documented in AGENTS.md + AGENTS.develop.md + .githooks/README.md.
  • CHANGELOG [1.3.1] entry present.

… .docs/

Root markdown is now limited to the allowlist (AGENTS.md, AGENTS.develop.md,
CLAUDE.md, README.md, README_CSharp.md, CHANGELOG.md, RELEASING.md). Diagnosis
write-ups, plans, test scenarios and worklogs move to the gitignored .docs/
folder (content preserved locally, untracked); the tracked docs/ folder is
dissolved. Rule documented in AGENTS.md "Root file hygiene (markdown)" and
AGENTS.develop.md "Key conventions for agents"; .gitignore lists .docs/
explicitly. CLAUDE.md already is the one-line pointer to AGENTS.md.

Review-fixes:
- [Important] AGENTS.md claims a pre-commit root-md guard that doesn't exist yet -> guard added in the next commit on this branch (stage 2)
- [Minor] .gitignore comment said the .*/ rule is "below" when it is above -> corrected
- [Minor][pre-existing] src/serve/tests.rs doc-comment pointed at docs/diagnose-federated-keep-warm.md (a path that never existed) -> now .docs/DIAGNOSE_FEDERATED_KEEP_WARM.md
Rejects any commit that introduces (adds/copies/renames) a root-level *.md
outside the allowlist (AGENTS.md, AGENTS.develop.md, CLAUDE.md, README.md,
README_CSharp.md, CHANGELOG.md, RELEASING.md); the message points at .docs/
and AGENTS.md "Root file hygiene (markdown)". Only introductions are checked
(diff-filter=ACR); dot-folders are out of scope by construction. .githooks/
README.md documents the guard; CHANGELOG gets a new pending [1.3.1] section
(Cargo.toml already builds 1.3.1).

Verified by direct hook runs: stray root add blocked (rc=1), rename
allowlisted->stray blocked (rc=1), allowlisted modify / nested add / .docs
add all pass (rc=0).

Review-fixes (from stage 1 review, resolved here):
- [Important] AGENTS.md claimed a pre-commit root-md guard that did not exist -> guard now exists in .githooks/pre-commit with matching allowlist; .githooks/README.md table row updated

Review-fixes (from stage 2 review round 1, resolved here):
- [Important] non-ASCII root md names escaped the guard: core.quotePath (default true) C-quotes them, so the *.md case missed the quoted trailing quote char -> diff now runs with -c core.quotePath=false; verified DIAGNOSE_ü.md now blocked rc=1

[Debt, recorded not fixed] allowlist restated in 3 live sites (pre-commit, .githooks/README.md, AGENTS.develop.md) — documentation-inevitable duplication, stable at 7 files.
Replace the ${var,,} lowercase expansion (bash >= 4 only; fatal "bad
substitution" on stock macOS bash 3.2, which would block every commit
containing a root-level file) with tr 'A-Z' 'a-z'. Verified: EVIL.MD and
DIAGNOSE_ü.md still blocked rc=1, allowlisted modify rc=0, clean tree rc=0.

Review-fixes:
- [Important] guard used ${staged,,}, unsupported on macOS bash 3.2 -> tr-based lowering, behavior unchanged
- [Debt, corrected count] allowlist restated in 5 live sites (pre-commit, .githooks/README.md, AGENTS.md, AGENTS.develop.md, CHANGELOG.md), not 3 as previously recorded
…old [1.3.1] entry into pending [1.3.2] per changelog convention; keep serve-tests doc-comment fix on top of new tests)

# Conflicts:
#	CHANGELOG.md
@flupkede
flupkede merged commit 90dd8f6 into develop Aug 18, 2026
4 of 5 checks passed
@flupkede
flupkede deleted the chore/root-md-cleanup branch August 18, 2026 20:15
@flupkede flupkede mentioned this pull request Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant