Repository navigation
Conversation
…every commit (#805) git commit exports GIT_INDEX_FILE; model-stamp.sh made it absolute (the 2026-09-26 worktree fix) and every `git -C <model folder>` then read the committing repo's index. With the model in a different repository (a Team Server clone used in place), that index never holds model files, so check --staged refused with "refusing to fingerprint an empty set" on every commit, docs-only included. check --staged now asks the model folder for its own top with GIT_DIR, GIT_INDEX_FILE and GIT_WORK_TREE unset (subshell unset, no env -u), and compares it with the top of the repo being committed to. When they differ it passes with "the model is in another repository". Same repo, worktree and --git-dir commits included, behaves exactly as before. Fixture test-model-stamp.sh T11: two real repos, hook installed; master 36/2, branch 38/0 (T9 worktree/--git-dir cases unchanged). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review: MERGE-AFTER-FIX. This fixes #805, but comparing repository tops opens a bypass. A commit made with Value: Fixes #805 as reported: with the model in a separate repo, a docs-only commit is now accepted. The change is small, with unchanged exit codes. Regression risk: Fixtures green on head:
Adversarial cases:
The cause is at Correctness: T11 builds two real repos and runs the real hook. Context cost: none. Time cost: ~ms per commit. Exact fixes required:
Generated by Claude Code |
…n a nested repo (#805) Independent review (MERGE-AFTER-FIX): comparing repo tops opened a bypass. A GIT_DIR/GIT_WORK_TREE commit whose work tree has no .git and sits inside an unrelated outer repo made the model folder's "own top" the outer repo, so an unverified model passed as "in another repository". check --staged now passes only when the model's real path is not under the committing work tree, or the model's own top (git variables unset) is strictly under it, i.e. a separate nested repo. Everything else falls through to the existing check. T11 gains two cases: a nested separate model repo (docs-only commit accepted) and the GIT_DIR/GIT_WORK_TREE work tree inside an outer repo (unverified model refused; this case FAILs on the previous branch head). test-model-stamp 41/0 (master 38/3, previous head 39/2); module-close-cadence 67/0, exec-gate-kind 32/0, restatement-git-hooks 28/0; check-portability clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review fix pushed in 774b1be. T11 adds two cases:
Needs a re-review. Generated by Claude Code |
|
Review: MERGE — re-review of 774b1be: the bypass is closed. The hook skips only when the model's real path is outside the work tree, or when its own repo top is strictly under it (
Regression risk: One new accept that master refused. A main-checkout commit that stages an unverified model while
Minor: the new outer-repo check ( Generated by Claude Code |
…efuse (#810 review) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review: MERGE stands — re-check of 1ec86a6: T11 now fails unless the refusal says Generated by Claude Code |
Fixes #805
Direct lane
What changed and why (one paragraph): When a project uses its model in place from another git repository (CLAUDE.local.md "Project MPR" points at a Team Server clone outside the project repo), the
mxtk-model-stamppre-commit hook refused every commit, docs-only commits included, with "refusing to fingerprint an empty set".The cause:
git commitexportsGIT_INDEX_FILE.project-bin/model-stamp.shmakes it absolute and exports it (the 2026-09-26 worktree fix).git -C "$MODEL_DIR"then read the project repo's index, found no model files there, and refused.The fix, per the triage sketch:
check --stagedfirst asks the model folder for its own top level, withGIT_DIR/GIT_INDEX_FILE/GIT_WORK_TREEunset in a subshell. It compares that with the committing repo's top.--git-dircommits the 2026-09-26 fix protects.Exit codes are unchanged.
Impact
project-bin/model-stamp.shonly (reaches projects via sync). No new tools; a subshellunsetworks on bash 3.2/macOS and Git Bash.git rev-parse --show-toplevelpercheck --staged: ~8 ms per commit, measured.Time cost: per commit · ~0.008 s on Linux · can force rework: n · offset: removes a false refusal that forced
MODEL_UNVERIFIED_OK=1on every commit in the two-repository layoutField evidence: reported by thanarat in #805, on macOS (git 2.50.1 Apple, bash 3.2 hook) with a separate Team Server clone. The fixture now builds that layout from two real git repos.
Fixture:
tests/wave2/test-model-stamp.sh, new case T11. It uses a project repo plus a separate model repo, with the hook installed andMPR_FILEpointing at the other repo.Results:
The T9 worktree /
--git-dir/commit -a/commit -- appcases still refuse an unverified model inside the repo. A new check confirms that an unverified model staged in its own repo is still refused.Other fixtures that exercise
check --staged, all green on the branch:check-scripts,check-portability, the leak guard andcheck-pr-disciplineare clean.Known limits: a commit in the main checkout passes when
MPR_FILEpoints at a different linked worktree's model, since that model is outside this work tree (needs a mis-pointed config; the mirror case, worktree → main checkout, is already accepted on master).app/cases are unchanged; T11 adds the external-repo layoutCHANGELOG.mdline appended, crediting thanarat (pre-commit model-stamp refuses every commit when the .mpr lives in a separate git repo (GIT_INDEX_FILE leaks into git -C $MODEL_DIR) #805)Review: pending independent review
Generated by Claude Code