doc-triggers never fires three documents whose Governs carries a gloss after the glob #21
Labels
No Label
P0
P1
P2
release-blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Project-Template#21
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three of the seven path-governing documents have never fired, for anything, since the template was first committed. They are not reported as skipped either — they fall into neither list, so nothing on screen says they were not checked.
The cause is a
Governs:entry that carries a gloss after the glob:Governs:is split on commas only, so each of those is one entry and the whole string is used as the glob.looks_like_path()says yes (it contains/), so the document is classified as path-governing rather than subject-governing. Thenmatches()testsfnmatch("docs/data/img/icon.webp", "docs/data/** — the assets privacyllc.dev renders for this project"), which is false and always will be. The document is therefore not fired, and — because it was classified as path-governing — it is also absent from the "govern a subject rather than paths, judge them yourself" list that exists precisely to stop a reader concluding everything was checked.Measured at
81e3268:What it costs
This is the same class as #20 and the opposite sign, which makes it worse. #20 was a document firing when it should not — a false prompt, and the cost is a glance. This is a document silently not firing when it should — the cost is a document that goes quietly stale while a tool whose entire purpose is to prevent that reports success.
GUARDS.mdopens with the sentence that applies: a guard that cannot fail is worse than no guard, because it is trusted.docs/data/img/README.mdis the document that governs the branding assets, which is the subject of open issue #14. Editing those assets has never once prompted the document that specifies their names, dimensions and ceilings.The gloss is in the template's own documents at its first commit (
6965915), so no adopting project has ever had these three fire either.What to do
Extract the glob from the entry rather than using the entry whole:
--surrounded by spaces — and keep the left side.looks_like_path().Keep classification untouched: whether a document is path-governing or subject-governing must still be decided by
looks_like_path()on the whole entry, or documents move between the two lists as a side effect.Also treat a glob with a trailing
/as a directory prefix.docs/architecture/githooks/README.mdgoverns "the.githooks/a project installs", and after step 2 that yields the bare token.githooks/, whichfnmatchwill not match against.githooks/pre-commit.Traps
-:source-grepanddoc-claimsappear in these headers and would be cut in half.privacyllc.devin thedocs/data/README.mdgloss passeslooks_like_path()on the extension rule, so extracting tokens from the whole entry rather than from the left of the gloss reintroduces it as a spurious glob. Cutting at the gloss first is what avoids it.Verify:
docs/data/README.mdanddocs/data/img/README.mdboth fire ondocs/data/img/icon.webp;docs/architecture/githooks/README.mdfires ondocs/architecture/githooks/pre-commitand on.githooks/pre-commit;privacyllc.devdoes not matchdocs/data/README.md; the seven path-governing and twelve subject-governing documents are classified exactly as they are now.