Repository navigation
feat(git-hooks): fall back to the standards lint configs when standards_repository is set - #18972
Conversation
…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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
…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
|
claude-security-review reviewed Security review: PR #18972No 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 changedThe shared
The diff also updates the four plugins' READMEs, adds tests, and adds changelog fragments. What I checked
I read all 18 files listed in critical-findings: 0 |
|
claude-review reviewed Code review (blocking only): no findings
What I checked
Closing issue #18971, "Done when"
Loosened checks. The prompt has no Using a standards 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. |
…rrier plugins Co-Authored-By: Claude Opus 5.5 <[email protected]>
…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]>
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]>
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]>
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]>
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]>
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]>
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]>
…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]>
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]>
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.yamlsetsstandards_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-levelstandards_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 shapedocs/conventions/ecosystems/cross-cutting.yaml:10-11already uses. Cached per root. Synced to the plugin copies.-cbase, discovered repo config merges over it_typos.tomlis the-cbase (bundled file otherwise)--configis a base, in-tree configs merge rule by rule.markdownlint-cli2.jsoncgoverns (it is an opt-in too)--rcfilestandards.shellcheckrcreplaces it whole-config-filestandards.github/actionlint.{yaml,yml}replaces it wholemd_classifytest) is never used, so the redirect cannot bypass the code-config approval gate.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,.shellcheckrcand.github/actionlint.yamlexist, 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.sh70 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.sh66 pass: default (standards ignore rule holds; control blocks), partly staged index path, replace (repo config replaces whole). Mutation: dropping-config-filefrom the index path fails the partly-staged case.plugins/bash-format/git-hooks/lint.test.sh64 pass: default (standardsdisable=holds; control blocks), partly staged index path, replace.plugins/markdown-format/git-hooks/lint.test.sh83 pass: default, control, extend (both layers apply; control shows the standards layer matters), partial override, code-capable standards config ignored.lib/git-hooks/and the four plugins'git-hooks/andhooks/passes (24 files).Related
🤖 Generated with Claude Code