Repository navigation
Description
Refs #9737
Outcome
The commit-subject and PR-title enforcement resolver no longer reads <repo>/.claude/source-control.md. Two rungs read it today, both for one release: the ## convention_source pointer and the ## <key> H2. The resolver is lib/resolve-convention-pattern.sh and its synced copy plugins/guardrails/hooks/resolve-convention-pattern.sh (scripts/shared-copies.txt:19), and block-convention-violation.sh reads the same file itself.
Both readers keep the well-known docs/conventions/source-control/commit-convention.yml rung, tracked file only. That follows the 2026-11-03 decision on #9737: eight repositories get subject enforcement only from that file. The rung must work on its own, with no legacy markdown file present.
The YAML reader landed in guardrails 0.61.0 (plugins/guardrails/CHANGELOG.md:525-531), and 1.3.5 has shipped since. None of those eight repositories tracks a .claude/source-control.md: the contents API returned 404 for each on 2026-11-05 (checked by the drafting session; not re-run at filing). So dropping the two markdown rungs changes enforcement in none of them. The user-global ~/.claude/source-control.md is a drafting input that the resolver never reads, and that stays as it is.
Change
lib/resolve-convention-pattern.sh:- Remove
LEGACY_MD_REL/TEAM_FILE(:95, :142), theconvention_sourcepointer read insideresolve_legacy(:430), and the H2 fallback inteam_value(:506-507). Removeh2_value(:155-175), which has no other caller. - Keep the well-known rung (
WELL_KNOWN_NEUTRAL, git-tracked only) and its checks. - Update the header (:14-26) and the diagnostics that mention falling back to the markdown H2.
- Remove
- Regenerate the guardrails copy with
scripts/sync-shared-copies.sh. plugins/guardrails/hooks/block-convention-violation.sh:- Remove
conv_pointer(:172-198), its call and theCONV_POINTERappend (:210-211), and the.claude/source-control.mdentry ofCONV_DEPS(:206). - Keep the
commit-convention.ymlentry. - Update the header comment (:11).
- Remove
plugins/guardrails/git-hooks/commit-msg-convention.sh:12comment,plugins/guardrails/README.md:105,145,1764, and theblock_convention_gate_enableddescription atplugins/guardrails/.claude-plugin/plugin.json:166. Keep the README row and plugin.json in step.docs/contracts/commit-convention/README.md:17,29,50-53,96, theconvention_sourcesection (:86-130), and 'for one release' wherever it describes thecommit-convention.ymlrung, which stays. Checkscripts/validate-plugin-contracts.test.sh:680before renaming that heading.- Reword the resolver diagnostics at :455-482 that name
convention_source. - Tests:
- Convert the fixtures that set a pattern through
.claude/source-control.mdtodocs/conventions/source-control.yamlor the folder-form file. The files arelib/resolve-convention-pattern.test.sh,plugins/guardrails/hooks/block-convention-violation.test.sh,plugins/guardrails/git-hooks/commit-msg-convention.test.shandplugins/guardrails/git-hooks/lefthook-remote.test.sh. - Replace the legacy-rung cases with one case asserting that a tracked
.claude/source-control.mdH2 pattern is not enforced.
- Convert the fixtures that set a pattern through
- Add a guardrails changelog fragment. Repeat the 0.61.0 note: a
commit-msg-conventioncopy installed before 0.61.0 enforces nothing until/guardrails:setup apply install-git-hooksrefreshes it.
Done when
-
git grep -nP '(?<!~/)(?<!HOME/)(?<!\}/)\.claude/source-control\.md' -- lib plugins/guardrails docs/contracts/commit-convention ':!*CHANGELOG*' ':!*.test.sh'prints nothing (onorigin/mainit prints 18 lines in 7 files). -
git grep -n 'readonly WELL_KNOWN_NEUTRAL="docs/conventions/source-control/commit-convention.yml"' -- lib/resolve-convention-pattern.shprints one line. -
git grep -n 'docs/conventions/source-control/commit-convention.yml' -- plugins/guardrails/hooks/block-convention-violation.shprints at least one line. -
grep -n '^## \[1.1.0\]' plugins/guardrails/CHANGELOG.mdprints one line (a release after the 0.61.0 YAML reader). -
bash scripts/sync-shared-copies.sh --checkexits 0. -
bash scripts/run-test-file.sh lib/resolve-convention-pattern.test.shexits 0. -
bash scripts/run-test-file.sh plugins/guardrails/hooks/block-convention-violation.test.shexits 0. -
bash scripts/run-test-file.sh plugins/guardrails/git-hooks/commit-msg-convention.test.shexits 0. -
bash scripts/run-test-file.sh plugins/guardrails/git-hooks/lefthook-remote.test.shexits 0. -
scripts/check-changelog-fragments.sh --check-required origin/mainexits 0.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Activity
github-actions commentedon Nov 5, 2026
Proposed work class: work-class: structural
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
Understood: remove the resolver's two one-release reads of
.claude/source-control.md(theconvention_sourcepointer and the H2 fallback) fromlib/resolve-convention-pattern.shand its synced copy. Do the same inblock-convention-violation.sh, and keep thecommit-convention.ymlrung. Docs, the plugin.json description, tests and a changelog fragment follow. The scope and done-when checks are exact.Possible mismatch to check when picking this up: the done-when item expects a
## [1.1.0]changelog heading, while the body says 1.3.5 has already shipped.This is a child of #9737, not a duplicate. #13473, #13471 and #13474 cover other plugins' config reads.
Automated triage, applied by the lanes App.
github-actions commentedon Nov 5, 2026
github-actions commentedon Nov 5, 2026