Skip to content

feat(lefthook): run each hygiene hook once and document each lint config's layering - #1132

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/lint-layering
Nov 25, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
feat/lint-layering

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No linked issue in this repository: owner decisions Q295 (Z2 layering rule) and Q298 (L3), owner-decisions.md L423 and 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 docs(lychee,zizmor): document default, extension and override modes #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

🤖 Generated with Claude Code

…fig's layering

The standards lefthook remote keeps only Gitleaks and EditorConfig-checker.
Typos, markdownlint-cli2 and ShellCheck move to the claude-code-plugins
aggregate remote, which every repository lists and which reads these
configs for a repository that names standards_repository
(melodic-software/claude-code-plugins#18972), so listing both remotes
runs each tool once per commit.

The two remaining wrappers use the repository's own root config when it
has one (both tools read one file) and the standards config otherwise,
as the ci-workflows composites do.

Each lint component README gains a "Defaults, extensions and overrides"
section: where the default lives, how a repository extends, partly or
completely overrides it, and which readers apply it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton enabled auto-merge (squash) November 25, 2026 03:27
@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:28:51.063994Z f9f1e03 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.

@kyle-sexton
kyle-sexton merged commit 707f4f9 into main Nov 25, 2026
32 checks passed
@kyle-sexton
kyle-sexton deleted the feat/lint-layering branch November 25, 2026 03:29
@github-actions

Copy link
Copy Markdown

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

Security review: PR #1132

I read every hunk of all 12 listed files in .claude-lane/pr.diff, plus the three files the PR deletes whole: standards-markdownlint.sh, standards-shellcheck.sh and components/lefthook-shellcheck/lefthook-remote.yml. No security issues found.

What I checked

  • Gitleaks and editorconfig-checker wrappers (.lefthook/pre-commit/standards-gitleaks.sh, standards-editorconfig.sh):
    • Each wrapper now passes the consumer's own root .gitleaks.toml or .editorconfig-checker.json when that file exists. Otherwise it passes the fetched standards config, as before.
    • Both config paths are fixed literals, so no outside input reaches the command line and there is no injection or path traversal.
    • A consumer can now weaken their own local Gitleaks scan with their own config. Doing that needs write access to their own work tree, and the same person can already skip the hook with --no-verify. A local pre-commit hook does not protect against the person committing, so nobody gains anything new. The PR context says the ci-workflows composites already work this way (download-standards/lib.sh standards_config), so CI behaviour does not change.
    • The Gitleaks job is still in the remote.
  • Removed remote jobs (components/lefthook-base/lefthook-remote.yml, the deleted components/lefthook-shellcheck/lefthook-remote.yml): the typos, markdownlint and ShellCheck jobs were removed. These are lint and spelling hooks, not security controls. The Gitleaks secret scan stays. The changed fail_text is prose only.
  • Test (components/lefthook-base/lefthook-remote.test.sh): the shims write their logs under a mktemp directory that is cleaned up on exit. The test is not a security surface.
  • README changes: these only document how each lint config is layered. None of them deletes or softens a standing instruction, a hook block list or an allowlist. docs/contracts/instruction-exception-register/README.md is not part of this repository, so I judged by consequence: no removed text was guarding a protected action.
  • Trust controls and trusted paths: no changed file matches a trusted path. None touches the trusted-actor list, check-trusted-trigger, the lane token, the kill switch, the token broker, a merge hold, CODEOWNERS, .gitmodules or any .github/actions/ composite.
  • Plugin manifests: no .claude-plugin/plugin.json or marketplace.json changed.
  • PR context: it has no embedded instructions aimed at the review lane.
  • Prior findings: this lane has not reviewed an earlier head (blocking only: no), so this was a full review.

critical-findings: 0

@kyle-sexton
kyle-sexton restored the feat/lint-layering branch November 25, 2026 03:29

@github-actions github-actions 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.

claude-review: 3 inline finding(s) on f9f1e03efc9afa6ad633662de521f512a94b961f; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment on lines +7 to +10
# Typos, markdownlint-cli2, ShellCheck and actionlint run from the
# claude-code-plugins remote, which reads these same standards configs for a
# repository whose source-control config names standards_repository, so each
# tool runs once per commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fail a change that loosens a check (check removed) — blocking

This PR removes three jobs from the remote (old lines 20-24 and 35-40), along with their scripts and components/lefthook-shellcheck/lefthook-remote.yml:

  • standards-typos
  • standards-markdownlint
  • standards-shellcheck

It also deletes the tests for those jobs in lefthook-remote.test.sh:

  • Case 4 (missing markdownlint-cli2)
  • the typos missing-tool case
  • Case 6 (real typos and ShellCheck against fixtures only the standards config rejects)

Before: a consumer listing this remote got Typos, markdownlint-cli2 and ShellCheck on every commit, each with the standards config.

After: this remote runs none of them. They run only if the claude-code-plugins remote is listed, the repository names standards_repository, and melodic-software/claude-code-plugins#18972 has merged. The PR body says #18972 has not merged yet.

Missing reason: no closing issue (spec) names these removals, and the PR body has no ## Loosened checks section. Under the criterion, the reasoning in the Summary and Fix sections does not count.

Fix: either restore the jobs, or add a ## Loosened checks section to the PR body that names each removed job and its tests and says why. For example: the claude-code-plugins remote runs the same tool with this config, and no consumer lists this remote yet.

claude-lane: claude-review

Comment on lines +13 to +16
# gitleaks reads one config: the repository's own .gitleaks.toml replaces this one whole.
if [ -f .gitleaks.toml ]; then
exec gitleaks git --pre-commit --staged --no-banner --config .gitleaks.toml
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fail a change that loosens a check (a secret scanner's own code accepts more, kind 9) — blocking

Before: the hook always ran Gitleaks with the standards .gitleaks.toml, which the README calls its rule set and no repository could replace.

After: any repository-local .gitleaks.toml replaces it whole. A consumer file with broad allowlists, or with fewer rules, lets secrets through that the standards config would block. The fail_text change in lefthook-remote.yml also stops pointing at .gitleaks.toml as the place to allowlist.

Missing reason: Gitleaks is a secret scanner, and only the spec (a closing issue's text) can allow loosening one; a PR-body ## Loosened checks section cannot. This PR has no closing issue. "Matches the ci-workflows composites" is in the Fix section, which does not count.

Fix: either keep the standards config forced in the hook, or link an issue whose text names this change to the Gitleaks hook and says why.

Same class as the standards-editorconfig.sh change, which can be cleared differently because EditorConfig-checker is an ordinary check.

claude-lane: claude-review

Comment on lines +13 to +16
# editorconfig-checker reads one config: the repository's own replaces this one whole.
if [ -f .editorconfig-checker.json ]; then
exec editorconfig-checker -config .editorconfig-checker.json "$@"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fail a change that loosens a check (a check's own code accepts more, kind 9) — blocking

Before: the hook always passed -config with the standards .editorconfig-checker.json.

After: a repository-local .editorconfig-checker.json replaces it whole. That file can exclude paths or disable checks the standards config enforces, so the hook accepts files it used to reject.

Missing reason: no closing issue names this, and the PR body has no ## Loosened checks section. The Fix section's reasoning (matching the ci-workflows composites) does not count under the criterion.

Fix: EditorConfig-checker is an ordinary check, so either undo the switch, or add a ## Loosened checks section that names this hook change and says why, for example that it matches what the CI composite already accepts.

Same class as the standards-gitleaks.sh change.

claude-lane: claude-review

@github-actions

Copy link
Copy Markdown

claude-review reviewed f9f1e03efc9afa6ad633662de521f512a94b961f: read 12 of 12 changed file(s); 3 finding(s), 3 as inline comments.

Code review: PR #1132

The PR narrows the standards lefthook remote to Gitleaks and EditorConfig-checker. It removes the Typos, markdownlint-cli2 and ShellCheck jobs and their scripts, which the claude-code-plugins remote now runs. The two remaining wrappers now use a repository's own root config when it has one, and six component READMEs gain a "Defaults, extensions and overrides" table.

The code is correct as far as I traced it:

  • Lefthook runs each script from the repository root, so the relative [ -f .gitleaks.toml ] / [ -f .editorconfig-checker.json ] checks and the paths passed with --config / -config resolve against the consumer's root.
  • The new Case 1b in lefthook-remote.test.sh tests that branch for both tools, and its shims record what each script passes.
  • Nothing else in the repository references the removed scripts or components/lefthook-shellcheck/lefthook-remote.yml. lefthook-merge-skip.test.sh globs components/lefthook-*/lefthook-remote.yml, so the deleted file just drops out of that loop.

I did not run the test suite or the mutation check. The PR description reports both, but I have not confirmed them.

Blocking findings (all under "Fail a change that loosens a check")

There is no closing issue, so there is no spec, and the PR body has no ## Loosened checks section. Under the criterion, the Summary and Fix text do not count as a reason. So each loosening below has no accepted reason:

  1. Check removed (kind 6): the standards-typos, standards-markdownlint and standards-shellcheck jobs are gone from the remote. Their tests went with them: the markdownlint-missing case, the typos missing-tool case and the Case 6 real-tool fixtures. Inline on components/lefthook-base/lefthook-remote.yml.
  2. Secret scanner's own code accepts more (kind 9): standards-gitleaks.sh now uses any repository-local .gitleaks.toml in place of the standards config. Only a spec can clear a secret-scanner loosening; a PR-body section cannot. Inline on .lefthook/pre-commit/standards-gitleaks.sh.
  3. Check's own code accepts more (kind 9): standards-editorconfig.sh makes the same switch for .editorconfig-checker.json. This is an ordinary check, so a ## Loosened checks section with a reason that holds would clear it. Inline on .lefthook/pre-commit/standards-editorconfig.sh.

Loosened checks would be marked: fail (default: the prompt carried no loosened_check_verdict: or loosened_check_patterns: line, so I used fail and no consumer entries); patterns: 0. The prompt also had no loosened_check_decision_record: line, so I did not check whether the spec cites the owner's decision.

Other notes

  • Security lane: this repository runs one (.github/workflows/pr-review-security.yml), so this review leaves security findings to it and sets no critical-security hold. The Gitleaks finding is reported here only as a loosened check.
  • Closing issue: none. The PR cites owner decisions Q295/Q298 in a private record. Those decisions are not issue text, so they give no acceptance criteria to check and no spec reason for a loosening.
  • Paved paths: no paved-path row was found in the standards index, so there is nothing to report.
  • Prior findings: none; this is the first review of this PR.
  • Embedded instructions: none found in the PR context, REVIEW.md or .claude/rules/pr-body-contract.md.

No verifier subagents were dispatched; I checked all three candidates against the criterion text myself.
Verifier dropped 0 of 3 candidates.

kyle-sexton added a commit 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 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 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant