git commit --amend mints against the wrong baseline — an unminted ref can never be rescuedindex/hook.js decides what to mint with freshRefs(rel, was, now), where was is the ref's blob AT ctx.head.sha — the F tokens the staged blob carries that HEAD does not. On a git commit --amend HEAD IS THE COMMIT BEING AMENDED, so every ref that commit already introduced reads as old and mints nothing. The baseline should be the commit's PARENT, which is what the amended commit will actually replace. The practical loss: a ref that landed transient — committed before BEE-014, or with --no-verify, or on a commit the hook could not resolve at the time — can NEVER be upgraded by amending, which is the one move a reader would reach for.
Found 2026-08-16 while checking whether --amend would rescue e814db0's unminted refs (it will not). Four commits in a clone of ///bee-journal, hook installed, post-BEE-014 binary:
ref A BEE-006:42:3B here -> BEE-006:gt:3Bxd. The control: minting works.--no-verify with ref B BEE-007:10:BN here, then git commit --amend --no-edit -> UNCHANGED, silent. The hook ran; the ref was not fresh against HEAD, which is B itself.touch + git add the same file, then amend -> still UNCHANGED. Re-staging does not help, because freshness is content-vs-HEAD, not staged-vs-nothing. ref D DOG-036:5:oa here -> the NEW ref mints (DOG-036:23:oakl) and B's BEE-007:10:BN in the very same file STAYS transient. So an amend mints exactly the refs new since the amended commit, which is the wrong set.index/hook.js has no notion of amend at all: headEntry and the freshRefs baseline both read ctx.head.sha (hook.js:146 :162 :206).An amend mints what the resulting commit introduces, not what the last one did.
pre-commit hook is the whole problem: git sets no environment variable for it, and the hook's own argv is empty. Whatever tell is used must be stated and tested, not inferred.ninja && ninja -j20 test in quickjab/build green; test/hook and test/perma legs unmoved.NOTHING WAS BUILT: every route out is blocked on a ruling, so the work stopped at the evidence. Three findings settle the design space, and the first two kill the ticket's own proposal.
git diff-index --cached HEAD names it, and only freshRefs excludes the older ref. B is not a freshness question at all — with nothing re-staged the staged tree EQUALS HEAD's tree, stagedFiles returns an EMPTY map, and the hook considers no file whatever. Fixing the gate alone leaves B exactly as broken as it is.hash-object -w + update-index --cacheinfo (hook.js:311 :317), so any file the pass touches JOINS THE COMMIT. Widening the baseline to the parent would sweep in every file HEAD changed — files the author never staged — and silently add them to the commit. That is a far worse bug than the one being fixed, and it is why B cannot be reached by relaxing anything: it can only be reached by KNOWING an amend is in flight.pre-commit across a plain commit, an amend with nothing staged and an amend with a file staged shows a BYTE-IDENTICAL environment (GIT_AUTHOR_*, GIT_EDITOR, GIT_EXEC_PATH, GIT_INDEX_FILE, GIT_PREFIX — no more), empty argv, and not one file written under .git/ in between.prepare-commit-msg ROUTE IS DEAD, and the ticket's Blockers were wrong to prefer it: hook ORDER is pre-commit THEN prepare-commit-msg, so the note would be left after the only reader had already run. Confirmed by logging both; prepare-commit-msg does get $2 = commit on an amend, but it gets it too late to matter..git/COMMIT_EDITMSG IS NOT A TELL either: it read "exists" at the amend's pre-commit only because the PREVIOUS commit left the file behind. It is a leftover, not a signal./proc/$PPID/cmdline (git commit -q --amend --no-edit). Sniffing the parent process is Linux-only and breaks under any wrapper, alias, GUI or IDE that spawns git indirectly, so it is offered only to be refused.test/hook legNo fixture was added. A leg pinning B and D would be RED with no fix to make it green, and the suite is the one thing that must not be left broken; the standalone repro in Context stands in until a route is ruled.
pre-commit cannot learn that an amend is in flight from git, so the only routes are (1) accept D-only — mint older transient refs in files the commit ALREADY stages, leaving B broken forever; (2) change the INSTALL CONTRACT, wrapping git commit or installing a second hook, which is the only way to reach B; or (3) leave it and put the weight on a bee mint verb instead.hook.js:3 "a commit is the last moment the ref is still current"). The counter-argument is that a rotted transient ref is equally wrong and goes on drifting, so freezing today's reading at least stops the drift. That is a semantics call, not an implementation one.bee mint?) rather than a hook, and that is worth its own ticket if the backlog matters — 60 in ///bee, 15 in ///bee-journal. It would also subsume route (1) above: a verb can mint what a hook may not.STOPPED AT THE EVIDENCE, nothing built and nothing edited — ///bee carries only BEE-014's changes, and ninja && ninja -j20 test in quickjab/build is 146/146. Every route out needs a ruling from gritzko, so building one would have been guessing.
pre-commit (identical env, empty argv, nothing written under .git/); pre-commit runs BEFORE prepare-commit-msg, so this ticket's preferred route was never available; and B never reaches the freshness gate at all, because an amend with nothing re-staged leaves the staged tree equal to HEAD's and stagedFiles empty.bee mint verb.prepare-commit-msg; that is now struck on evidence, and the Design decisions carry the replacement reading.