Skip to content

docs-hygiene: no drift test between scripts/check-docs-naming.sh and the emitted gate template #4139

Description

@kyle-sexton

What

scripts/check-docs-naming.sh is this repository's own file-name gate, added by PR #4097. plugins/docs-hygiene/skills/generate-file-name-gate/templates/check-file-names.sh.tmpl is the generalized form of the same script, added by PR #4133, which a consumer emits with its own rule and exemptions inlined.

Nothing checks that the two still agree. A fix to one is invisible to the other, and the failure is silent in both directions: a consumer's emitted gate quietly stops catching something this repository's gate catches, or this repository's gate keeps a bug the template has already fixed.

A fresh-context review of the template confirmed the generalization currently loses no behaviour (exemption order, the tr-based fold that keeps Bash 3.2 working, the collision pass over every tracked path including exempt names, the 0/1/2 exits). That is the state to hold, not a state to assume.

Suggested shape

A test that emits the gate into a fixture with this repository's own .claude/docs-hygiene.json and compares the result against scripts/check-docs-naming.sh behaviourally rather than textually: run both over the same seeded tree (offenders by case, by underscore, by empty dot segment, a case-collision pair, one instance of each declared exemption) and assert identical findings, identical streams, and identical exit codes.

Behavioural rather than textual because the two differ by construction: the template carries a generated header, computes its own root hop, and reads its values from arrays rather than literals. A diff would be red forever; the findings are what must match.

Natural home: scripts/check-docs-naming.test.sh, which already builds the fixtures such a comparison needs.

Why it is a follow-up rather than part of #4133

The generalization landed with the emitter. This gate is about the two staying aligned over time, which is a different concern and a different test, and #4133 is already large.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions