Skip to content

feat(git-hooks): fall back to the standards lint configs when standards_repository is set - #18972

Merged
kyle-sexton merged 7 commits into
mainfrom
feat/lint-standards-fallback
Nov 25, 2026
Merged

kyle-sexton merged 7 commits into
mainfrom
feat/lint-standards-fallback

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #18971

Summary

Owner decision Q298 (L3) under the Q295 layering rule (L426, L423; verbatim: "OK go w/ recommendations"): the aggregate lefthook remote's lint adapters fall back to melodic-software/standards' lint configs when the repository's docs/conventions/source-control.yaml sets standards_repository. Repositories without the key keep today's behavior (the bundled typos default, tool defaults elsewhere).

Today the three surfaces disagree: CI composites read standards, the standards lefthook remote reads standards, and this remote reads the repo file or its own bundled default. After this, local hooks use the same default CI does.

Fix

  • lib/git-hooks/resolve-tool.sh: rt_standards_file <root> <path> reads the top-level standards_repository (<owner>/<repo>, validated; no .-leading segments) and resolves the file in a local checkout: STANDARDS_DIR, else <ghq root>/github.com/<owner>/<repo> (git config ghq.root, default ~/ghq), the shape docs/conventions/ecosystems/cross-cutting.yaml:10-11 already uses. Cached per root. Synced to the plugin copies.
  • Per tool, following the tool's own layering:
Tool Native layering Opted in, no repo config Opted in, repo config
typos (spelling) -c base, discovered repo config merges over it standards _typos.toml is the -c base (bundled file otherwise) repo config merges over the standards base; a key both set keeps the base value (typos precedence)
markdownlint-cli2 (markdown-format) --config is a base, in-tree configs merge rule by rule standards .markdownlint-cli2.jsonc governs (it is an opt-in too) repo rules win per rule; standards rules it leaves unset apply
ShellCheck (bash-format) none: one rc, no include --rcfile standards any repo .shellcheckrc replaces it whole
actionlint none: one config, no extends -config-file standards repo .github/actionlint.{yaml,yml} replaces it whole
  • A standards markdownlint config that could run code (the existing md_classify test) is never used, so the redirect cannot bypass the code-config approval gate.
  • READMEs of the four plugins state the rule; changelog fragments (minor for the four, none for the four plugins that only carry the resolver copy).

Not here: gitleaks and editorconfig-checker have no adapter in this repository; they stay on the standards remote, which drops its typos, markdownlint and ShellCheck jobs in a standards PR so each tool runs once per commit.

Effect today: only this repository sets standards_repository, and its root _typos.toml, .markdownlint-cli2.jsonc, .shellcheckrc and .github/actionlint.yaml exist, so only the typos base changes here: the bundled SHA-hex ignore gives way to standards' _typos.toml (identical to this repo's root file), which is what CI's typos composite already applies.

Verification

All with real binaries (typos 1.52.2, ShellCheck 0.11.0, actionlint 1.17.1, markdownlint-cli2 0.24.1):

  • bash lib/git-hooks/resolve-tool.test.sh: 32 pass, including STANDARDS_DIR > ghq.root > ~/ghq, quoted and CRLF values, four malformed values, a nested key not opting in.
  • plugins/spelling/git-hooks/lint.test.sh 70 pass: default (standards word blocks, control opted out passes, missing checkout falls back to the bundled base), extend (repo word accepted, standards word still blocks).
  • plugins/actionlint/git-hooks/lint.test.sh 66 pass: default (standards ignore rule holds; control blocks), partly staged index path, replace (repo config replaces whole). Mutation: dropping -config-file from the index path fails the partly-staged case.
  • plugins/bash-format/git-hooks/lint.test.sh 64 pass: default (standards disable= holds; control blocks), partly staged index path, replace.
  • plugins/markdown-format/git-hooks/lint.test.sh 83 pass: default, control, extend (both layers apply; control shows the standards layer matters), partial override, code-capable standards config ignored.
  • Every other test under lib/git-hooks/ and the four plugins' git-hooks/ and hooks/ passes (24 files).
  • shellcheck clean on changed scripts; lefthook pre-commit (comment lint, content scan) clean.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 24, 2026 22:15
…ds_repository is set

A repository whose docs/conventions/source-control.yaml names a
standards_repository now gets that repository's lint configs from the
aggregate lefthook remote's adapters, read from a local checkout
(STANDARDS_DIR, else <ghq root>/github.com/<owner>/<repo>):

- spelling: the standards _typos.toml is the -c base in place of the
  bundled default; the repository's typos config merges over it.
- markdown-format: the standards .markdownlint-cli2.jsonc is the
  --config base; repository configs merge over it rule by rule. A
  standards config that could run code is never used.
- bash-format: with no repository .shellcheckrc, --rcfile standards.
- actionlint: with no repository config, -config-file standards.

The resolver is rt_standards_file in lib/git-hooks/resolve-tool.sh.

Closes #18971

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T03:24:56.874792Z 0fe7a13 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fe7a13caf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/git-hooks/resolve-tool.sh Resolved
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
…fig's layering (#1132)

No linked issue in this repository: owner decisions Q295 (Z2 layering
rule) and Q298 (L3), [owner-decisions.md
L423](https://github.com/melodic-software/architecture/blob/f32d7178d132bf8a5402add0985e0ee557ec37ef/docs/owner-decisions.md#L423)
and
[L426](https://github.com/melodic-software/architecture/blob/f32d7178d132bf8a5402add0985e0ee557ec37ef/docs/owner-decisions.md#L426).
Owner, verbatim: "OK go w/ recommendations".

## Summary

Each hygiene hook runs once per commit, and each lint config documents
its layering modes.

Before: this repository's lefthook remote ran typos, gitleaks,
editorconfig-checker and markdownlint (plus ShellCheck from
lefthook-shellcheck's remote), while every repository already runs the
melodic-software/claude-code-plugins aggregate remote, whose spelling,
markdown-format, bash-format and actionlint jobs cover typos,
markdownlint, ShellCheck and actionlint. A repository listing both ran
three tools twice. melodic-software/claude-code-plugins#18972 makes
those ccp jobs read this repository's configs when the repository's
source-control config names `standards_repository`, so this remote keeps
only the two tools ccp does not run.

## Fix

- `components/lefthook-base/lefthook-remote.yml`: only
`standards-gitleaks` and `standards-editorconfig`. Removed
`standards-typos.sh`, `standards-markdownlint.sh`,
`standards-shellcheck.sh` and
`components/lefthook-shellcheck/lefthook-remote.yml`. No repository
lists this remote yet (layering plan: E3 not started), so nothing
consumes the removed jobs.
- The two wrappers use the repository's own root `.gitleaks.toml` /
`.editorconfig-checker.json` when present (both tools read one config
file), else the fetched standards config, matching the ci-workflows
composites (`download-standards/lib.sh` `standards_config`). Before,
they always forced the standards config, so local and CI disagreed for a
repository with its own file.
- "Defaults, extensions and overrides" sections in the typos,
markdownlint, shellcheck, actionlint, editorconfig-checker and gitleaks
READMEs (the lychee/zizmor shape from #1130), with the readers named.
The typos README no longer says typos has no native layering: `-c`
merges with the discovered config (checked with typos 1.52.2). The
gitleaks section records why `[extend] path` cannot point at this file
portably (it resolves relative to the directory gitleaks runs in, per
the gitleaks README).
- lefthook-base and lefthook-shellcheck READMEs describe the remote's
narrower scope.

Per-tool modes (merge-capable tools layer; single-file tools: repo file
replaces whole):

| Tool | Default | Extend | Partial override | Complete override |
| --- | --- | --- | --- | --- |
| typos | standards file | repo `extend-*` entries add | only keys
standards leaves unset | CI `config:` other path; local skip the ccp job
|
| markdownlint-cli2 | standards file | repo rules add | repo rule wins
per rule | set every rule, or CI `config:` other path |
| ShellCheck | standards rc | `# shellcheck disable=` | none (copy and
edit) | repo `.shellcheckrc` |
| actionlint | standards config | none | none | repo
`.github/actionlint.yaml` |
| editorconfig-checker | standards config | composite `exclude` | none |
repo `.editorconfig-checker.json` |
| gitleaks | standards config | `gitleaks:allow`, `.gitleaksignore` |
none | repo `.gitleaks.toml` |

Not in this PR: dropping the lint configs and lefthook fragments from
the sync manifest. Per R5 that waits until every reader uses the new
rule (melodic-software/claude-code-plugins#18972 and
melodic-software/ci-workflows#1219 merged, and the five repositories
extending `.lefthook/base.yml` switched to this remote).

## Verification

- `bash harness/shell/run-tests.sh
components/lefthook-base/lefthook-remote.test.sh
components/lefthook-base/lefthook-merge-skip.test.sh
components/lefthook-shellcheck/lefthook-shellcheck.test.sh
components/lefthook-base/lefthook-base.test.sh`: 4 passed. The remote
test adds a case per tool where the consumer's own config is passed
instead of the standards one, and asserts the merged config holds no
typos, markdownlint or ShellCheck job.
- Mutation: the old `standards-gitleaks.sh` fails "standards-gitleaks
passes the repository's own .gitleaks.toml, not the standards one".
- lefthook pre-commit clean (typos, shellcheck, markdown, comment lint,
content scan).

## Related

- melodic-software/claude-code-plugins#18972: ccp adapters fall back to
these configs.
- melodic-software/ci-workflows#1219: typos and markdownlint composites
merge the caller's config over these.
- #1125 added this remote; #1130 the same mode tables for lychee and
zizmor.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Lane-Activity: pr-refine/fix-docs
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed eba11a3694a58e1164e569fa7649db8870c4dc20: read 31 of 31 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18972

No security issues found. This lane already reviewed an earlier head, so this review was blocking only: it reports CRITICAL and IMPORTANT findings and drops SUGGESTION findings.

What changed

The shared lib/git-hooks/resolve-tool.sh gains a new function, rt_standards_file, which is synced into eight plugin copies. The function reads the top-level standards_repository key from the repository's docs/conventions/source-control.yaml and looks for a lint config file in a local checkout of that repository. It looks in STANDARDS_DIR first, then <ghq root>/github.com/<owner>/<repo>. The adapters use the file it finds as follows:

  • typos: the file is the -c base.
  • markdownlint-cli2: the file is passed with --config.
  • ShellCheck: the file is passed with --rcfile, but only when the repository has no rc file of its own.
  • actionlint: the file is passed with -config-file, but only when the repository has no config of its own.

The diff also updates the four plugins' READMEs, adds tests, and adds changelog fragments.

What I checked

  • Path input from the repository. The standards_repository value comes from the repository being committed to, so it can be hostile. Before the value is used in a path it must match ^[A-Za-z0-9_-][A-Za-z0-9_.-]*/[A-Za-z0-9_-][A-Za-z0-9_.-]*$ (resolve-tool.sh#L130). Neither segment can start with ., so a .. traversal is impossible. A segment that starts with - is harmless because the code uses cd --. At most, a hostile repository can choose one of the user's own ghq checkouts.
  • What the chosen config can do. typos TOML, ShellCheck rc files and actionlint YAML are declarative and never run code. A markdownlint-cli2 standards config that could run code (customRules, markdownItPlugins, outputFormatters, or escaped strings) is caught by the existing md_classify gate. That gate is at markdown-gates.sh#L37-L46, and such a config is skipped at adapters.sh#L694. The code-config approval gate is therefore not bypassed. The worst a hostile repository can do is quiet lint findings in its own commits, and it could already do that with a config file of its own.
  • Command construction. The new RT_SCRIPT fragments reference variables that are exported and quoted, for example ${AL_STANDARDS:+-config-file "$AL_STANDARDS"}, and the sh -c shell expands them as arguments. The file path is never spliced into the command text, so it cannot inject commands. The index-path calls in lint.sh and rt_lint_index use the same quoted form.
  • Excluded categories. None of the changed files is a trust control, workflow, token, kill switch, merge hold, plugin manifest or standing instruction. There are no manifest lines, and no instruction-surface deletion needed a check against the protected-class register.
  • Settled and prior items. The prior-findings file lists only this lane's earlier summary, which had no findings, so nothing is re-posted. No settled threads were supplied.
  • Cost. Nothing in this change can cause a charge.

I read all 18 files listed in to-read.txt in full; the listed copies have the same content and play the same role at their paths.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed eba11a3694a58e1164e569fa7649db8870c4dc20: read 31 of 31 changed file(s); 0 finding(s), 0 as inline comments.

Code review (blocking only): no findings

prior-findings.md says blocking only: yes: this lane already reviewed an earlier head, so this pass reports blocking findings only. There was no REVIEW SCOPE: incremental note, so I read the whole diff: all 18 files on the to-read list, every hunk. The copies listed in identical.txt are the four bump: minor fragments, the four bump: patch fragments and the eight plugins/*/lib/git-hooks/resolve-tool.sh copies. Each copy is at a parallel path, where the same content does the same thing.

What I checked

  • rt_standards_file (lib/git-hooks/resolve-tool.sh and its copies)
    • The value regex rejects .-leading segments and extra slashes, so ../x and a/../b both fail.
    • The awk extraction reads only a top-level key. It strips quotes, CR and a trailing comment.
    • A directory that cd cannot enter gives an empty result, so the adapter keeps its default.
    • The cache is keyed by root and stores only the directory, so the file check still runs on every call.
    • All eight plugin copies of resolve-tool.sh exist and are synced.
  • bash-format
    • BF_SC_RC is exported and expanded inside RT_SCRIPT at sh -c time, which covers bf_lint → rt_run. The index path in lint.sh passes it too.
    • bf__standards_rc sets it only when the root has no .shellcheckrc and git tracks none anywhere in the repo. That matches the README's rule that any repo rc replaces the standards one whole.
    • hooks/bash-format.sh sources resolve-tool.sh before adapters.sh, so the new function resolves there.
  • markdown-format
    • Before the standards config is used, mf__std runs it through md_classify and restores MD_CODE_CONFIGS and MD_TRUST_BLOCK afterwards. A code-capable standards config is never used, so the approval gate stays in force.
    • The MD_STATE=none path now proceeds only when MF_STD is set.
  • actionlint: AL_STANDARDS is set only when the repo has no .github/actionlint.{yaml,yml}. It reaches both the RT_SCRIPT path and the rt_lint_index path.
  • spelling: sp__base runs before every detail or script use of SP_CONFIG. Without a checkout it falls back to the bundled file.
  • Changelog fragments: minor for the four plugins whose adapters gain the fallback. patch for the four that only carry the synced resolver, which no adapter of theirs calls. Both levels fit the change.

Closing issue #18971, "Done when"

  • "Tests prove default, extend (merge tools) and replace (single-file tools) per adapter, with controls, against the real binaries." Met in the diff:

    • spelling: default, control, extend.
    • markdown-format: default, control, extend, override, code-config refusal.
    • bash-format: default, control, index path, replace.
    • actionlint: default, control, index path, replace.

    The author says these pass with real binaries; I did not run them.

  • "lib/git-hooks/resolve-tool.sh holds the one resolver (rt_standards_file), shared to the plugin copies." Met.

Loosened checks. The prompt has no loosened_check_verdict: or loosened_check_patterns: lines, so I used fail and no consumer entries. With no decision-record line, I did not check the citation requirement.

Using a standards .shellcheckrc or actionlint config in a repo with no config of its own can make those linters accept more (kind 9). The closing issue's spec names that behavior per tool, with the owner-decision link and verbatim quote, so it passes. No test is skipped or deleted. The new bash-format cases skip only when shellcheck is absent, and they add coverage.

Loosened checks would be marked: fail (default: no verdict line in prompt); patterns: 0

Security findings are out of scope here because this repository runs a security lane. No plugin manifest changed, and nothing here can cause a real charge.

Verifier dropped 0 of 0 candidates.

kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
…ted word (#1133)

Follow-up to #1132 (its last commit was pushed after the merge). Owner
decision Q295 (Z2 layering rule): [owner-decisions.md
L423](https://github.com/melodic-software/architecture/blob/f32d7178d132bf8a5402add0985e0ee557ec37ef/docs/owner-decisions.md#L423),
owner verbatim: "OK go w/ recommendations".

## Summary

The typos mode table says a key this file sets keeps its value. That
holds within `extend-words`, but typos also has a native route for a
repository to accept a word this file corrects: an
`[default.extend-identifiers]` entry mapping the word to itself is
matched before word corrections.

## Fix

`components/typos/README.md`, Partial override row: names the
`extend-identifiers` route.

## Verification

typos 1.52.2, this repository's `_typos.toml` passed with `-c`, a file
with one British spelling this file corrects:

- repository `_typos.toml` with the word under
`[default.extend-identifiers]` mapped to itself: exit 0.
- control, no repository config: exit 2, the correction reported.
- the same word under `[default.extend-words]` in the repository file:
exit 2 (this file's value wins), as the row already said.

ci-workflows#1219 (merged) made the CI composite pass this file as the
base, so this is the route a repository such as songwriting has if it
wants to keep a word standards corrects.

## Related

- #1132, melodic-software/ci-workflows#1219,
melodic-software/claude-code-plugins#18972.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/.github that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/agent-plugins that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/codex-plugins that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/ci-runner that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/cursor-plugins that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
A relative STANDARDS_DIR returned a relative config path, which the
markdown-format lint entry lost once it moved into its temp mirror.
The checkout directory is now made absolute (cd + pwd) before it is
cached and joined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/claude-code-account-rotation that referenced this pull request Nov 25, 2026
No related issue: config-only change the owner decided (A3 in
melodic-software/architecture docs/owner-decisions.md); tracked by the
claude-code-plugins pull requests under Related.

## Summary

Names `melodic-software/standards` as this repository's standards
repository, so the claude-code-plugins readers read standards `main`
instead of this repository's synced copies.

## Fix

Adds the top-level `standards_repository: melodic-software/standards`
key to `docs/conventions/source-control.yaml` (creating the file with
the schema header where the repository had none). With it set, the
babysit lane and the pr-merge gate read the Dependabot policy from
standards, and the claude-code-plugins aggregate lefthook remote falls
back to the standards lint configs when the repository has none of its
own. No synced copy is deleted; that is a later step.

## Verification

- The file validates against claude-code-plugins
`plugins/source-control/schemas/source-control.schema.json`
(`check-jsonschema`: ok).
- The commit passed this repository's pre-commit and commit-msg hooks
locally.

## Related

- Owner decision A3: `standards_repository: melodic-software/standards`
in every repository that receives the policy.
- Refs: melodic-software/claude-code-plugins#18988
- Refs: melodic-software/claude-code-plugins#18972

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 71ca422 Nov 25, 2026
60 checks passed
@kyle-sexton
kyle-sexton deleted the feat/lint-standards-fallback branch November 25, 2026 06:29
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 25, 2026
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
…ents (#1136)

No related issue: owner decisions Q295 (Z2) and Q298 (L3)
(melodic-software/architecture `docs/owner-decisions.md` L423 and L426)
authorize this retirement directly.

## Summary

Stops syncing eight components whose readers already read this
repository's root configs at run time:

- the lefthook fragments `lefthook-base` (`.lefthook/base.yml`) and
`lefthook-shellcheck` (`.lefthook/shellcheck.yml`);
- the lint configs `typos` (`_typos.toml`), `markdownlint`
(`.markdownlint-cli2.jsonc`), `gitleaks` (`.gitleaks.toml`),
`editorconfig-checker` (`.editorconfig-checker.json`), `actionlint`
(`.github/actionlint.yaml`) and `shellcheck` (`.shellcheckrc`).

This is the manifest step of the retirement procedure
(`distribution/README.md` Lifecycle "Retire" row,
`docs/component-lifecycle.md` "Retirement"). Readers moved first.
Deselection never deletes, so nothing changes in a target until its own
deletion pull request removes its copies.

Readiness checks, run on each target's `origin/HEAD` before writing:

- No target's root `lefthook.yml` extends `.lefthook/base.yml` or
`.lefthook/shellcheck.yml`. The remaining `extends` entries name
`.lefthook/python.yml`, `.lefthook/powershell.yml`,
`.lefthook/dotnet.yml` or repository-owned files. claude-code-proxy,
dotfiles, github-iac and provisioning list the standards remote and set
`min_version`, `assert_lefthook_installed` and `glob_matcher:
doublestar` themselves.
- 18 of 19 targets set `standards_repository:
melodic-software/standards` in `docs/conventions/source-control.yaml`.
songwriting does not. This PR changes nothing for songwriting: it
manages none of these components (only
`dependabot-automerge-fleet-caller`, `dependabot-policy` and
`managed-files-guard-fleet-caller`). Its `_typos.toml`,
`.markdownlint-cli2.jsonc`, `.gitleaks.toml`, `.shellcheckrc` and
`.github/actionlint.yaml` are its own files, which no sync wrote. Until
it sets the key, the claude-code-plugins adapters use its own files
where it has them and their bundled defaults where it does not.
- Every `managed` copy in a target is byte-identical to the current
source, so every reader sees the same rules after the copy is deleted.
The `locally-owned` copies (actionlint in ci-runner, github-iac and
medley; shellcheck in dotfiles; all six lint configs in medley) are each
repository's own whole-file override and stay.

## Fix

- `distribution/sync-manifest.yml`:
  - removes the eight component entries;
- removes the `requires` edges that pointed at them: lefthook-base's six
(`editorconfig-checker`, `gitleaks`, `markdownlint`, `node-runtime`,
`repository-text`, `typos`), editorconfig-checker's `repository-text`,
lefthook-shellcheck's `lefthook-base` and `shellcheck`, and the
`lefthook-base` edge on `lefthook-dotnet`, `lefthook-powershell` and
`lefthook-python`;
- removes every target's `managed` and `locally-owned` entry for the
eight, and the comments that described them (the actionlint exclusion
block, medley's per-file divergence notes, ci-workflows' actionlint
parity note, architecture's typos note, claude-code-proxy's
lefthook-base closure).

The managed-files guard resolves destinations at run time, so it has no
static path list to prune. `node-runtime` and `repository-text` stay:
every target that needed them through these edges still lists them under
`managed`.
- Kept, with reason:
- Root `_typos.toml`, `.markdownlint-cli2.jsonc`, `.gitleaks.toml`,
`.editorconfig-checker.json`, `.github/actionlint.yaml` and
`.shellcheckrc`. They are this repository's own configs, and the
ci-workflows composites (`download-standards`), the claude-code-plugins
adapters (`rt_standards_file`) and
`components/lefthook-base/lefthook-remote.yml` read them from here.
- `components/<tool>/` for each lint config: READMEs, contract tests and
fixtures. These prove the policy and hold no sync wiring.
- `components/lefthook-base/lefthook-remote.yml` and
`.lefthook/pre-commit/standards-*.sh`: the standards remote.
- `components/lefthook-base/lefthook.yml` and
`components/lefthook-shellcheck/lefthook.yml`. This repository's own
root `lefthook.yml` extends both. `lefthook-merge-skip.test.sh`,
`lefthook-shellcheck.test.sh` and `dotnet-format-staged.test.mjs`
exercise them. Their READMEs now say the manifest no longer distributes
them.
- READMEs:
- The six lint-config READMEs say each config is read at run time, not
synced. The "Managed consumers do not edit" escape-hatch text in
gitleaks and editorconfig-checker now points at the complete-override
row.
- markdownlint's component table names only `markdownlint-home` as a
manifest component.
- The lefthook-base and lefthook-shellcheck READMEs are updated as
above.
- The dotnet, powershell, python and typescript adapter READMEs now say
the consumer root sets the strict settings itself, where they said
"compose with `lefthook-base`".
- The root `README.md` names run-time reads beside native references and
sync PRs.
- `standards/review/overlays/bash.md` no longer says the shellcheck
component "ships" `.shellcheckrc`.
- The first header line of
`components/lefthook-{dotnet,powershell,python,typescript}/lefthook.yml`
drops "alongside the base". Dotnet, powershell and python are synced, so
github-iac, claude-code-account-rotation, claude-code-proxy, dotfiles
and provisioning each get a small sync PR (that header line plus the
`glob_matcher` line below). Without this, the synced header would keep
naming `.lefthook/base.yml` after the deletion PRs remove it.
-
`components/lefthook-{dotnet,powershell,python,typescript}/lefthook.yml`
each set `glob_matcher: doublestar` themselves. Their `**/*.ext` globs
miss root-level files under Lefthook's default matcher, and these
fragments used to rely on lefthook-base for the setting. Lefthook merges
an extended file's top-level setting into the consumer config, so no
consumer has to remember it. All current consumers (claude-code-proxy,
dotfiles, github-iac, provisioning) already set it in their root files,
so nothing changes for them.
- New `components/lefthook-base/lefthook-adapter-globs.test.sh`, run in
CI's lefthook job, extends each adapter alone from a root that sets no
matcher and checks that a staged root-level file reaches the lane.
- `distribution/sync-manifest.test.sh`:
- the lefthook-python direct-dependency assertion now expects `ruff` (it
expected `lefthook-base,ruff`);
  - the retired-component loop gains the eight names.

## Verification

- `distribution/sync-manifest.sh validate`: `Manifest valid: 39
components, 19 targets` (47 before).
- `bash distribution/sync-manifest.test.sh`: exit 0, 334 assertions pass
(326 before), including `PASS: [161]`-`[168]` for the eight new retired
names.
- Each new retired assertion fails if its name returns. The loop's
expression `[.components | keys[] | select(. == strenv(COMPONENT))] |
length` counts 0 for each of the eight on this branch. On
`origin/main`'s manifest, where each still exists, it counts 1, so
`assert_eq ... '0'` fails.
- `harness/shell/run-tests.sh` on `lefthook-base.test.sh`,
`lefthook-remote.test.sh`, `lefthook-merge-skip.test.sh`,
`lefthook-shellcheck.test.sh` and `lefthook-typescript.test.sh`: 5
passed. `node --test
components/lefthook-dotnet/dotnet-format-staged.test.mjs`: 12 passed.
- `lefthook-adapter-globs.test.sh`: 12 assertions pass. Without the
fragment matcher it fails for all four adapters: the root-level
`setup.py`, `build.ps1`, `eslint.config.mjs` and `Program.cs` never
reach their lanes.
- markdownlint-cli2: 0 issues across the 14 changed Markdown files. The
pre-commit hooks (typos, gitleaks, shellcheck, comment lint, content
scan) pass.

## Loosened checks

No assertion is removed. One expected value changes:

- `Lefthook Python carries its complete direct dependencies` now expects
`ruff` instead of `lefthook-base,ruff`. It still checks the exact list.
The `lefthook-base` edge goes because the component is retired under
Q295 and Q298 (melodic-software/architecture `docs/owner-decisions.md`
L423 and L426, owner words "OK go w/ recommendations"). A target
extending `.lefthook/python.yml` now sets the strict settings in its own
root `lefthook.yml`, as all four current consumers do.

## Related

- Owner decisions Q295 (Z2, config layering rule) and Q298 (L3, lefthook
lint-config fallback), melodic-software/architecture
`docs/owner-decisions.md` L423 and L426, owner words "OK go w/
recommendations". Loosened-check reasons follow D4 (L349).
- Readers that moved first:
-
[melodic-software/claude-code-plugins#18972](melodic-software/claude-code-plugins#18972):
the aggregate lefthook remote adapters fall back to these configs when
`standards_repository` is set.
-
[melodic-software/ci-workflows#1219](melodic-software/ci-workflows#1219):
the CI composites read these configs.
- [#1132](#1132): the
standards remote keeps only gitleaks and editorconfig-checker.
- github-iac, provisioning, claude-code-proxy and dotfiles moved from
`extends: .lefthook/base.yml` to the standards remote.
- Same procedure as
[#1135](#1135).
- Next: one deletion PR per target, removing its synced copies
(`.lefthook/base.yml`, `.lefthook/shellcheck.yml`, and the lint configs
it managed). songwriting's deletion PR waits until it sets
`standards_repository`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
No linked issue: owner decision Q298 (L3) (melodic-software/architecture
`docs/owner-decisions.md` L426) authorizes this directly.

## Summary

In this repository, five hygiene tools ran twice on every commit. The
root `lefthook.yml` extended `components/lefthook-base/lefthook.yml`,
`lefthook-shellcheck`, `lefthook-python` and `lefthook-typescript`, and
it also listed the claude-code-plugins aggregate remote. The duplicate
pairs were:

- `typos` and `spelling-remote-lint`;
- `markdownlint` and `markdown-format-remote-lint`;
- `shellcheck` and `bash-format-remote-lint`;
- `ruff-lint`/`ruff-format` and `python-format-remote-*`;
- `biome` and `javascript-format-remote-*`.

The ccp jobs read the same root configs (`_typos.toml`,
`.markdownlint-cli2.jsonc`, `.shellcheckrc`, `ruff.toml`,
`biome.jsonc`). Q298 asks for each hook to run once. Now every hygiene
tool runs once, from a remote.

## Fix

- `lefthook.yml`:
  - drops all four `extends` entries;
- lists this repository's own remote
(`components/lefthook-base/lefthook-remote.yml` at `main`) for
`standards-gitleaks` and `standards-editorconfig`. It is a remote, not
an `extends`, because the remote's scripts act only from the fetched
copy under `info/lefthook-remotes/`. A local `extends` would run them
from `.lefthook/pre-commit/`, where they exit 0 (lefthook-base README,
"Remote form");
- carries the strict settings the base fragment supplied, as that README
prescribes for a remote consumer: `min_version: "2.0.5"`,
`assert_lefthook_installed: true`, `glob_matcher: doublestar` and
`pre-commit.parallel: true`;
- keeps the fixture `exclude` and the `psscriptanalyzer` and
`dotnet-format` source-slice lanes unchanged.
- The component fragments stay. The contract tests still compose them in
temporary consumers: `lefthook-base.test.sh`,
`lefthook-merge-skip.test.sh`, `lefthook-shellcheck.test.sh`,
`lefthook-typescript.test.sh` and `dotnet-format-staged.test.mjs`.
- `docs/conventions/ecosystems/{bash,markdown,python,typescript}.yaml`:
the comments name the claude-code-plugins hook that runs each tool
locally, in place of the dropped lane.
- `pr-require-checks.yml`:
- the `lefthook validate` step is renamed "Validate the root hook
config", because the fragments are no longer merged into the root;
- a new step, "Validate each lefthook component fragment", runs
`components/lefthook-base/lefthook-fragments-validate.test.sh`. That
test extends each `components/lefthook-*/lefthook.yml` alone from a
scratch consumer and runs `lefthook validate`, so the root no longer has
to load the fragments for CI to check them.

## Verification

- `lefthook dump --format json`, after `lefthook install` fetched both
remotes: every pre-commit job and command name appears once. A
`group_by` over the names finds no duplicates.
  - `standards-gitleaks` and `standards-editorconfig` appear once each.
- None of `typos`, `markdownlint`, `shellcheck`, `ruff-*`, `biome`,
`gitleaks` or `editorconfig` appears as a local command.
- The settings dump as `min_version 2.0.5`, `assert_lefthook_installed
true`, `glob_matcher doublestar`, `parallel true`.
- This commit's own pre-commit run executed each job once, including
`standards-gitleaks` ("no leaks found") and `standards-editorconfig`.
The hook took 0.60 s.
- `lefthook-fragments-validate.test.sh`: 9 assertions pass. Planting an
unknown key (`commands:` renamed) in the real
`components/lefthook-python/lefthook.yml` fails `[4]`, and restoring the
file makes it pass.
- `lefthook validate`: All good.
- `harness/shell/run-tests.sh` on lefthook-base, lefthook-remote,
lefthook-merge-skip, lefthook-shellcheck and lefthook-typescript: 5
passed. `node --test
components/lefthook-dotnet/dotnet-format-staged.test.mjs`: 12 passed.

Known overlap I left in place: the `psscriptanalyzer` lane and ccp's
`powershell-format-remote-lint` both run PSScriptAnalyzer with
`PSScriptAnalyzerSettings.psd1`. The lane stays as a repo-specific
adapter that dogfoods
`components/lefthook-powershell/psscriptanalyzer-staged.ps1`. Removing
it would make PSScriptAnalyzer run once too.

## Related

- Owner decision Q298 (L3), melodic-software/architecture
`docs/owner-decisions.md` L426, owner words "OK go w/ recommendations".
- [#1132](#1132)
narrowed the standards remote to gitleaks and editorconfig-checker.
[#1136](#1136) stops
syncing the fragments and lint configs. This PR is independent of #1136.
-
[melodic-software/claude-code-plugins#18972](melodic-software/claude-code-plugins#18972):
the ccp adapters read the standards configs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(git-hooks): fall back to the standards lint configs when standards_repository is set

1 participant