Skip to content

feat(git-hooks): migrate hook artifacts left under an earlier plugin name - #15594

Merged
kyle-sexton merged 16 commits into
mainfrom
feat/git-hooks-superseded-artifacts
Nov 12, 2026
Merged

kyle-sexton merged 16 commits into
mainfrom
feat/git-hooks-superseded-artifacts

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Refs: #15552

Summary

The shared git-hook installer (lib/git-hooks/install.mjs and its copy in every carrier plugin) now finds what an install under a plugin's former name left for one of its entries, when the plugin declares that name, and gives the setup agent what it needs to retire it. Nothing is renamed here: this is the generic support a plugin rename needs before it lands.

Fix

  • A renamed plugin declares its former names as a top-level earlierNames array in git-hooks/entries.json. Each name must match the entry-name rule, must not be the plugin's own name, and may not repeat; a malformed list is a manifest error. Each name is a migration line, removed once no consumer repository still holds artifacts under it. With no earlierNames, the installer behaves exactly as on main.

  • verify adds one superseded row per declared earlier name an entry has artifacts under. The artifacts are:

    • stamped copies in the repository and in the user config-hook directory;
    • <event>.d/ markers;
    • lefthook jobs that run such a copy;
    • config-hook keys and their includeIf;
    • decline keys in this clone's own config.

    Only declared names are looked at, so another plugin that ships an entry of the same name is never reported, offered for removal or counted. The installer code holds no earlier name.

  • A decline key under a declared earlier name still counts, at any scope. Git resolves it: the entry's own key comes first, then the earlier-name key's resolved value, then the master key. Nobody is asked again, and an earlier opt-in (false) still wins over a master decline.

  • plan returns a superseded decision per entry and earlier name. For declines it acts on this clone only:

    • Carry. When this clone has no own key, the decision carries the value this clone resolves to the entry's own key in this clone's local config (install.mjs decline, with the new --opt-in for false). When keys under different earlier names resolve differently, nothing is carried and the lines are kept for the user.
    • Unset. Only earlier-name lines in this clone's own local and worktree config files are listed for removal.
    • Report only. A line in a system or global file, or in a file one includes, is marked keep and shared and is never edited. The setup agent shows the user the exact git config --file <file> --unset-all <key> command, to run once every clone that relies on that line has its own key. A line in a file a local include pulls in is marked included and reported the same way.
    • verify stays silent about shared lines once this clone has its own key.
  • copy writes the local opt-in when only the master key or the own global key would decline, so an install survives the old key's removal.

  • repoInfo reads the work tree root and the hooks, exclude and config paths in one git rev-parse call instead of three.

  • Docs:

    • the decisions reference (synced copies and guardrails' hand-kept copy);
    • the check step of each carrier's setup skill;
    • the check-placement contract: the entry manifest's earlierNames field, and the superseded and decline rows of its drift table.
  • One minor changelog fragment per carrier plugin (10).

Verification

  • node --test --test-concurrency=4 lib/git-hooks/install.test.mjs: 226 tests, 222 pass, 0 fail, 4 skipped, about 7.6 s. The skipped cases are config-hook cases that need git 2.54; this host has 2.53.0.
    • A 130-case table covers the own key (unset, or true/false at local or global scope), the earlier-name key (unset, or true/false/2 at local scope, at global scope, or in an include that only one clone matches), and the master key.
    • It checks four things: following the plan keeps whether the entry is declined in the clone that plans, in a clone an include names and in a clone none names; it changes no file outside the planning clone's own config; it leaves that clone no earlier-name line in its own files; and a second plan proposes nothing more.
    • When I mutated the code to edit shared lines, 60 of the cases failed, so the table detects that regression.
    • Further cases cover an undeclared name (ignored: same-named artifacts and declines from another plugin are neither reported nor counted), one declared name, two declared names, and a malformed earlierNames (a hostile name, not a list, a repeated name, the plugin's own name).
  • bash lib/git-hooks/check-lib.test.sh: 61 passed, 0 failed.
  • scripts/sync-shared-copies.sh --check: all 818 registered copies match.
  • scripts/check-changelog-fragments.sh --check-required origin/main: all 10 changed fragment-mode plugins have a fragment.
  • typos --config _typos.toml over the changed files: no findings.

Against the issue text

This follows #15552's "The old name reaches it as data from the plugin, a migration line listed in the PR with its removal condition": the installer reads former names from the plugin's earlierNames, and the rename PR (#15568) supplies the value.

Related

session: AI Hero

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

kyle-sexton and others added 2 commits November 12, 2026 09:32
…name

The git-hook installer now finds everything an install under an earlier
plugin name left for one of a plugin's entries: stamped copies in the
repository and user config-hook directories, <event>.d markers, lefthook
jobs that run such a copy, decline keys, config-hook keys and the includeIf
that loads them. Entry names are unique across plugins, so no earlier name
appears in code.

- verify adds a superseded row per earlier plugin name, naming the exact
  removal; a decline under the earlier name counts as declined, resolved by
  git's precedence (its false is an opt-in), and stays silent at session
  start.
- plan returns a superseded decision per entry and earlier name; the setup
  agent removes the artifacts and carries each decline to the entry's own
  key at the same scope on the user's yes, through the new
  install.mjs decline --opt-in for a false value.
- copy writes the local opt-in when only the master or own global key would
  decline, so an install survives the old key's removal.
- Synced to every carrier; the decisions reference (synced copies and
  guardrails' copy), each carrier's setup skill check step, the
  check-placement contract and minor fragments describe it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T15:01:55.049494Z a1115d3 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: a1115d3875

ℹ️ 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/install.mjs Resolved
Comment thread lib/git-hooks/install.mjs Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-security-review

Comment thread lib/git-hooks/install.mjs Resolved
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15594, changes since 123fa830, at c74788c8

No security findings. This lane already reviewed earlier heads of this pull request, so this review reported CRITICAL and IMPORTANT findings only.

critical-findings: 0

Scope

  • I read every hunk of the 8 files on the to-read list:
    • lib/git-hooks/install.mjs and lib/git-hooks/install.test.mjs
    • plugins/actionlint/lib/git-hooks/install.mjs
    • the three git-hook-decisions.md files (lib, actionlint, guardrails)
    • docs/contracts/check-placement/README.md
    • the actionlint changeset
  • The other nine plugins/*/lib/git-hooks/install.mjs copies and their git-hook-decisions.md and .changes/ copies have the same content. They sit at vendored library, reference-doc and changelog paths. None of them is a hook, workflow, settings or manifest path, so where a copy sits doesn't change what it does.
  • No file in this push matches a trusted-path glob. The push doesn't touch any plugin manifest (plugin.json / marketplace.json), workflow, token request, trusted-actor list, kill switch or merge hold.
  • The prompt says no person can answer during this run. Nothing in this review needs a person's decision, so I'm not asking for the human-gated label.

What I checked

  • The installer only looks at names the plugin itself declares. Before this push, leftovers() and priorDecline() accepted any plugin name that matched NAME_RE from directory entries, <event>.d/ marker names, lefthook jobs, hook.* keys and checks.*.<entry>.declined keys. Now each of those requires earlier.has(from). That set comes from earlierNames in the plugin's own git-hooks/entries.json (install.mjs L1251-L1252). A plugin with no earlierNames returns nothing.
  • Effect on the earlier finding. The SUGGESTION I posted at a1115d38 warned that names taken from repository-controlled directory and marker names could reach the agent's delete step. That path is now closed. A repository can't add a name to the declared set, and every from that reaches a superseded decision is a declared name.
  • Copied-script stamp check. The stamp now has to name the same directory (stamp.plugin !== d.name, L1278). That tightens the check.
  • Decline keys. Only declared earlier names count toward the declined state now (L563-L565). A cloned repository's local config can no longer silence a check by setting a decline key under some other plugin's name.
  • Key reads. configBool builds checks.${from}.${entry.name}.declined and passes it to git as an argument-array element, not through a shell.
  • Validation of earlierNames. earlierErrors rejects anything that isn't an array of strings matching NAME_RE, and rejects duplicates. loadPlugin rejects the plugin's own name (L289-L297, L338). The new tests cover $(touch pwned), a plain string, a duplicate and the plugin's own name.
  • Decisions text. The superseded row only changes how it describes where from comes from. The instruction to pass each path, key and value as a single quoted argument, never through a shell string, is still there. Nothing was removed from any instruction.
  • Docs and changesets. These are prose only and change no control.

No spend or billing changes.

kyle-sexton and others added 2 commits November 12, 2026 10:05
Two review findings on the superseded plan:

- A decline under an earlier plugin name that an includeIf scopes to some
  repositories was planned by scope only, so the carry landed in the main
  global file (every clone) and the unset missed the included key. Each
  declines[] and config[] item now names the config file that sets it,
  decline takes --file to write the plugin's own key there, and the
  decisions reference has the agent carry and unset in that file.
- The carried value was hand-parsed, so a value git reads as true, such as
  2, was planned as an opt-in. Each line's boolean now comes from
  git config --type=bool in its own file, the same reading configBool uses;
  a value git rejects is only unset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
The superseded scan took an earlier plugin name from repository directory
and marker names (behind a stamp a repository author can forge, or none)
and from decline config keys, so a cloned repository could put a name
such as `$(...)` into the paths the setup agent is told to delete.

Every source of an earlier name (copy directories, <event>.d markers,
lefthook jobs, decline keys and config-hook keys) now has to match the
entry-name rule ([a-z0-9][a-z0-9-]*), one NAME_PART pattern shared by all;
any other name is skipped. The decisions reference tells the agent to pass
each listed path, key and value as one argument, never inside a shell
string.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

claude-review: incremental review of 123fa830..c74788c8. This lane has already reviewed earlier heads (blocking only: yes), so this review reports blocking findings only.

Scope. I read every hunk of the 8 files in to-read.txt:

  • the actionlint changelog fragment, which stands for the 10 identical fragments;
  • docs/contracts/check-placement/README.md;
  • lib/git-hooks/git-hook-decisions.md;
  • lib/git-hooks/install.mjs;
  • lib/git-hooks/install.test.mjs;
  • plugins/actionlint/lib/git-hooks/install.mjs, which stands for the 10 vendored installers;
  • the actionlint decisions reference, which stands for its 8 copies;
  • guardrails' hand-kept decisions reference.

None of the copies sits at a path that changes what its content does. Guardrails' hand-kept copy has the same new superseded row as the synced copies.

What changed. Before this push, the installer treated any other plugin name as a possible earlier name. Now it uses only the names the plugin lists in a new earlierNames field in entries.json:

  • earlierErrors() checks the field: it must be a list, each name must match NAME_RE, and no name may repeat. loadPlugin() also rejects the plugin's own name.
  • loadPlugin() defaults the field to []. It is the only place that builds the plugin object, so plugin.earlierNames.map(...) in priorDecline always gets an array (L342, L563-L565).
  • priorDecline now reads exactly checks.<earlier>.<entry>.declined for each declared name. It no longer scans every checks.* key.
  • leftovers() returns early when no earlier names are declared. Its copy directories, markers, lefthook jobs, decline lines and hook.* keys are all filtered with earlier.has(...).
  • A copy directory now counts only when its stamp names the same plugin as the directory (stamp.plugin !== d.name). This is stricter than before, which skipped only a stamp that named this plugin.
  • Every name that reaches a path or key is now a declared, NAME_RE-checked value. That keeps the earlier hardening thread's point (command substitution in a marker or directory name) closed.

The tests cover these cases:

  • an undeclared name is ignored for both artifacts and declines;
  • two declared names are each retired;
  • malformed lists are rejected: a hostile name, a string instead of a list, a repeated name, and the plugin's own name.

The existing superseded and decline tests now declare their earlier names.

No blocking findings. A minor point, not counted: the loadPlugin(root) -> { name, root, entries, libText } comment at L320 still leaves out remote and earlierNames.

Settled threads. The Windows short-name realOr thread is resolved with no lines changed since resolution, and this push does not touch realOr. Every earlier finding of this lane is resolved, so none is posted again.

Closing issue. The PR body says Refs: #15552 and closes no issue, so there are no acceptance criteria to check.

Manifests. This push changes no plugin.json or marketplace.json. The 10 changelog fragments change only their text and keep bump: minor.

Embedded text. I found none in the PR context, the settled threads or the prior findings.

Not verified by me. I had no shell and ran nothing. The test counts, the sync check and the mutation results in the PR body are the author's claims and unverified.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
…own key

The plan marked an earlier-name line for carry-over whenever the file
that sets it had no own key, though the entry's own key wins from any
scope. Following the plan could then flip a decline. A line is now only
unset once the own key is set anywhere.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
… reaches

Following the superseded plan must never change whether the entry is
declined, in the clone that plans or in any other. The own-key guard was
clone-wide, so a global earlier-name line was only unset once this clone
had a local own key (as copy writes), and every other clone lost the
decline.

carryOver() now decides per line: a local line is carried when no own key
is set here; a global line is carried unless an own key at system scope or
in a main global file already reaches every clone, and is kept for the
user (keep: true) when an own key in an include holds the other value,
since a carry then shadows that include and no carry drops the decline
elsewhere. The decisions reference tells the agent to leave and report a
kept line.

A table-driven test checks the invariant over 100 states (own key, earlier
key, master key) in the planning clone and a second clone; before this fix
it failed the 6 states with a local own key and a global earlier key that
disagrees with the master key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 12, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Held: a seventh review finding on the decline carry-over (a global carry can change clones covered by an includeIf file the planning clone does not match) raises a design choice for the owner: keep extending the global carry, or carry only clone-local lines and report global ones. The hold ends when the owner chooses and the chosen change is pushed and reviewed.

kyle-sexton and others added 2 commits November 12, 2026 11:38
The decline carry-over read config only as the planning clone sees it, so
an own key or an earlier-name line in an include this clone does not match
was invisible: a global line was carried over an own key that only another
clone reads, and an earlier-name line in such an include was never listed
or removed.

sharedConfig() now reads the system file and both global files directly
(GIT_CONFIG_GLOBAL, or ~/.gitconfig and $XDG_CONFIG_HOME/git/config) with
every file they include, nested to git's depth, whatever the condition,
marking each file conditional or not; a file that exists but cannot be read
counts against every shared line. Each file's lines are read on their own
with git's boolean reading, so a key set twice is listed per line.
carryOver() then decides from the clones each line reaches: an own key in a
file every clone reads means unset only, one in a conditional include with
the other value means keep, and a local or worktree line follows this
clone's own key. Earlier-name lines in includes this clone does not match
are now listed, carried and unset in place.

The invariant test grows to 234 states with includes that match only the
planning clone or only a second clone, checked in three clones, and now also
asserts that no earlier-name line is left but kept ones. Before this fix 60
states failed. New tests cover nested and unreadable includes, both global
files, a key set twice, mixed-case section names and worktree config. The
decisions reference tells the agent what the scan covers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 12, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold lifted: the owner chose the complete carry-over ("nothing cosmetic left behind, whatever is cleanest/tidiest, best long term", 2026-11-12), and it is pushed in 2ceccce. The usual merge gates apply: both review lanes on the head, ci-status green, no open threads.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head c74788c8d9f4264cbf21716d087efdcddc9911fe. What it wrote, as data:

What it wrote (82 lines)
Summary: Whole spec, fail: PR #15594 refs #15552 (spec_kind refs). Its body names the part it
  delivers: the shared git-hook artifact migration in lib/git-hooks/ (Migration item 3), with
  plugin-declared `earlierNames`. It names the remaining work: the rename itself, in #15568. I read
  every listed file whole. Both chunk results confirm these parts:
- The earlier names reach the installer as data, as validated migration lines with a removal
  condition.
- `verify` reports every listed old-name artifact as `superseded` drift and names the fix.
- `plan` and `copy` install the new entry and carry a resolved decline to the new local key.
- The canonical code is in lib/git-hooks/ (chunk 1), and the vendored copies in chunks 1 and 2 match
  it.

The deciding fact is removal. Both chunk verifiers say plainly that `apply install-git-hooks` does
  not remove earlier-name decline keys in system or global config, or in files those include. It
  only reports them, with a command for the user to run. Issue item 3 says to remove the old git
  config keys, and its acceptance line says no `checks.typos-format.*` key may remain. The narrowing
  rests on an owner ruling (Q37) recorded only in the PR body and comments. Under the rules, only
  person_checks or credited_siblings can excuse a spec item, and the spec has neither. So the
  removal item and the a
Chunk 1 of 2, pass-notes: PR #15594 links #15552 with `Refs:`, so it delivers only part of the
  issue. Its body names the part: the shared git-hook artifact migration in `lib/git-hooks/`, which
  is Migration item 3 ("Build this in lib/git-hooks/ so the two formatter renames reuse it"). It
  also names the remaining work: the rename itself, in #15568, which supplies the `earlierNames`
  value. The part is within the issue's scope. I read all 20 parts of chunk 1, the manifest, the
  context, the spec and the upstream jobs.

**Delivered in full in chunk 1:**
- The old name reaches the installer as data. A plugin lists its former names in `earlierNames` in
  `entries.json`. Each name is checked against the name rule, may not repeat, and may not be the
  plugin's own name. The contract doc gives each name's removal condition. The installer code holds
  no earlier name.
- `verify` reports every old-name artifact the issue lists as a `superseded` drift row that names
  the fix: `.githooks/<name>/` and the other hook directories, `<event>.d` markers, lefthook jobs,
  decline keys, `hook.<name>-<entry>` keys with their `includeIf`, and the user config-hook
  directory `checks/<name>`. `driftLine` and `DRIFT` are updated, so the session-start probe shows
  it too.
- `plan` returns a `superseded` decision with the dirs, markers, jobs, config k
Chunk 2 of 2, pass-notes: Chunk 2 of 2 for PR #15594, which links #15552 with `spec_kind` refs. The
  PR body names the part it delivers: the shared git-hook artifact migration from #15552's Migration
  item 3, built in `lib/git-hooks/` and driven by a plugin-declared `earlierNames` list. It also
  names the remaining work: the rename itself, which goes to #15568 and supplies the `earlierNames`
  value. That part is within the issue's scope.

My parts hold the vendored copies for three plugins:
- `plugins/ruff-format/lib/git-hooks/install.mjs` and
  `plugins/typos-format/lib/git-hooks/install.mjs`. Both carry the same blob change
  (b77b3d904..abb112d48), so they match each other.
- The `superseded` row added to `skills/setup/reference/git-hook-decisions.md` in powershell-format,
  ruff-format and typos-format (same blob 9e0896ea8..d5a41b34f).
- The check step of the ruff-format and typos-format `setup/SKILL.md`.

What these copies deliver for the Migration item 3 part:
- **Check reports drift.** `verify` adds a `superseded` drift row for each declared earlier name an
  entry has artifacts under, and `DRIFT` and `driftLine` name the fix (`apply install-git-hooks`).
  The artifacts covered are the `.githooks/<name>/` directories, `<event>.d` markers, lefthook jobs,
  `hook.<name>-<entry>` config keys and their includeIf, the user `
- lib/git-hooks/install.mjs: issue #15552 Migration item 3 asks `apply install-git-hooks` to remove
  the old git config keys. The plan marks earlier-name decline lines in system or global config, or
  in files those include, as `keep` plus `shared` or `included`, and never removes them. Either
  remove them (and update the vendored copies in chunks 1 and 2) or get the narrowing written into
  the issue's spec text. A Q37 ruling cited only in the PR body or comments cannot excuse a spec
  item.
- lib/git-hooks/install.mjs: #15552's acceptance line asks that no `checks.typos-format.*` key
  remain after `apply install-git-hooks`. Earlier-name keys in shared or included config files
  remain by design, so this criterion is met only in part. Close the gap, or record the narrowing in
  the issue.
- lib/git-hooks/install.mjs (leftovers): old-name decline lines in system or global config files, or
  in files they include, are only reported with an unset command and never removed. Issue #15552
  item 3 asks to remove the old git config keys, and its acceptance criterion says no
  `checks.typos-format.*` key may remain. The PR relies on an owner ruling (Q37) that appears only
  in the PR body and comments, not in the issue's spec text. A human should confirm that this
  narrowing is accepted.
- .changes/typos-format/feat-git-hooks-superseded-artifacts-079d4427.md: this fragment adds a file
  under the old-name directory. Issue #15552 warns that such a fragment must be moved with `git mv`
  into `.changes/spelling/` before the rename lands. Rename PR #15568 must move it, or `git ls-files
  | grep typos-format` will not print nothing.
- plugins/typos-format/lib/git-hooks/install.mjs: the change does less than #15552's acceptance
  line. That line says no `checks.typos-format.*` key remains after `apply install-git-hooks`, but
  earlier-name decline lines in system or global config, or in an included file, are only reported
  (`keep` plus `shared` or `included`), never removed. The PR body credits an owner ruling (Q37) for
  limiting carry-over to clone-local lines. A default `decline` writes only local keys, so a typical
  test repository would pass, but a human should confirm that this narrowing of the issue text is
  accepted (the same applies to the ruff-format copy and the canonical lib/git-hooks/install.mjs).

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 12, 2026
kyle-sexton and others added 2 commits November 12, 2026 11:52
…ge it

A carry writes the own key into the line's file, where git appends a new
section at the end, past everything the file includes, while an included
file is read at its include line. Two earlier-name lines of different
values in a file and a file it includes could so be carried in the other
order, flipping every clone that reads both.

orderBound() states the principle: a carry is planned only when its outcome
cannot depend on file order. Within one include chain (the system file,
each global file, this clone's local file, its worktree file, each with
what it includes), readOrder() records where each file's last earlier-name
line and its end fall; carries of different values in two files are kept
when those come in a different order, or when the chain reads a file
twice. Carries into one file replace each other and end on git's value.
Separate chains keep their order. Different values under two earlier
plugin names, read as "declined when any is true", are kept too.

The invariant tests now run each case in its own HOME through child
processes, concurrently: 234 one-line cases and 168 two-line cases (a file
and its include, a file and an includeIf only another clone matches, a
local file and a local include, both include orders, and both global
files). Before this fix 20 two-line states failed, all with the include
line after the key in the parent and different values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 12, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Held: a ninth review finding on the decline carry-over (a file included from two global config chains) is open. Before another patch, the owner is asked whether to keep modelling git's shared-config read order or to carry at local scope only and report shared lines. The hold ends when the owner chooses and the chosen change is pushed.

…cal key only

The decline carry-over modelled the read order of shared git config so it
could carry and unset lines in system and global files and their includes,
and each review found another order it missed. Following the owner's
ruling, the plan now acts on the planning clone only.

- An earlier-name decline key still counts at any scope, as git resolves
  it (own key, then the earlier-name key, then the master key).
- When this clone sets no own key, plan carries the value this clone
  resolves to the own key in its local config; keys under different
  earlier names that resolve differently, or to no boolean, carry nothing
  and are kept for the user.
- Only earlier-name lines in this clone's own local and worktree config
  files are listed for removal. A line in a system or global file, or a
  file one includes, is marked keep and shared; one in a file a local
  include pulls in, keep and included. Neither is ever edited: the setup
  agent shows the user the command to remove it once every clone relying
  on it has its own key, and verify stays silent about it once this clone
  has one.
- sharedConfig(), readOrder(), orderBound(), carryOver() and decline
  --file are gone. repoInfo reads its paths in one rev-parse call.
- The invariant test is one 130-case table in-process; the file runs in
  about 7.5 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 12, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold lifted. Design change in ff20d68 (owner ruling, 2026-11-12): the decline carry-over is now local-only.

  • An earlier-name decline key still counts at any scope, as git resolves it.
  • plan carries the value this clone resolves to the entry's own key in this clone's local config, and lists for removal only earlier-name lines in this clone's own local and worktree config.
  • Lines in system or global files, or any file they include (or a local include), are reported with keep: true plus shared or included and are never edited. The setup agent shows the user the removal command to run once every relying clone has its own key.
  • Removed: the shared-config read-order modelling (sharedConfig, readOrder, orderBound, carryOver, decline --file) that the last several findings targeted.
  • A 130-case invariant table checks three clones, byte-identical shared files, a clean own config and an idempotent second plan. install.mjs is +225 net against main (was +371); the test file runs in about 7.5 s.

The usual merge gates apply: both review lanes on the head, ci-status green, no open threads.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
repoInfo resolved the clone's own config paths against the directory as
the caller spelled it, while config lines carry the path git reports.
Through a symlinked or short-name path a local earlier-name line read as
coming from an included file and was never listed for removal.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

claude-lane: claude-review

Comment thread lib/git-hooks/install.mjs Resolved
kyle-sexton and others added 3 commits November 12, 2026 13:48
The JavaScript realpath keeps a Windows short-name component as written,
while git reports the long name, so the clone's own config still did not
match through a short-name path.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
…rlier names

The installer treated any other plugin name holding a copy, marker,
lefthook job, config-hook key or decline key for the same entry as an
earlier name, relying on entry names being unique across plugins, which
nothing enforces: a plugin shipping a same-named entry could have its live
install offered for removal and its declines counted.

A renamed plugin now declares its former names as a top-level
earlierNames array in git-hooks/entries.json, the manifest the installer
already loads and validates. Each name must match the entry-name rule,
must not be the plugin's own name and may not repeat; anything else is a
manifest error. leftovers() and the decline lookup read only those names,
and with none the installer behaves as before this change. Each name is a
migration line, removed once no consumer repository still holds artifacts
under it. The check-placement contract, the decisions reference and the
fragments say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Pz6CBRwjqpnFDbP9Rr
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 12, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 77ff4e1 Nov 12, 2026
88 checks passed
@kyle-sexton
kyle-sexton deleted the feat/git-hooks-superseded-artifacts branch November 12, 2026 20:20
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 12, 2026
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.

1 participant