Skip to content

The hook records a version-pinned path, so an upgrade leaves it behind #693

Description

@MongLong0214

Found after v1.0.1, in doctor:

warn  runtime identity — hook identity differs from CLI:
      hook v0.8.0 … CLI v1.0.1

The hook resolves through a per-repository git config value:

$ git config --local --get commitlore.bin
/Users/isaac/.local/share/commitlore/v0.8.2/dist/commitlore.mjs

A versioned path. Every upgrade leaves it pointing at the previous install, so
commits in that repository are validated by an old build while the CLI reports
the new one.

This is the fourth instance of one pattern today

.mcp.json            "commitlore"                  the wrapper   → followed the upgrade
Hermes external_dirs .../v0.8.2/hermes/skills      versioned     → broke   (#686)
plugin cache         a copy of the code            a copy        → stalled (#660)
hook commitlore.bin  .../v0.8.2/dist/commitlore.mjs versioned    → this

The one config that pinned nothing is the one that survived. Everything holding a
version or a copy needed a fix.

Two halves, and both are needed

Record the wrapper, not the versioned path. ~/.local/bin/commitlore already
resolves to the current install; a hook written against it follows upgrades for
free, the way .mcp.json did. That is the actual repair, and it only helps hooks
installed after it ships.

Existing hooks need commitlore hooks install re-run. doctor already emits
exactly that as its fix line, so the path exists — what is missing is that
nothing tells a user to run doctor after upgrading.

install.sh cannot do this for them: it has no way to know which repositories
have hooks. That is a real limit and worth stating rather than working around.

Note on the versioned path's original purpose

It is not arbitrary — recording the exact bundle makes the hook independent of
PATH and of whatever node_modules/.bin/commitlore a parent directory holds
(the stub comments say so). The wrapper keeps that property: it is an absolute
path too, just one that does not name a version.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions