Repository navigation
fix(sync-project, doctor): restore the look-ledger seen hook when a project lacks it - #414
Merged
Merged
Conversation
…roject lacks it A lab project's look ledger read 0 of 31 pages seen while 22 had screenshots: .claude/settings.json held only what mxcli init writes. install-claude-permissions.sh (the only writer of the hooks) had never run there, sync-project.sh only printed a warning, and doctor.sh checked the allow-list but not the hooks. install-claude-permissions.sh gains --hooks-only (hooks only, no allow/deny/ask entries, no pruning, nothing in settings.local.json). sync-project.sh runs it when the hooks are missing (--dry-run reports). doctor.sh warns and names the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 16, 2026
… opt-out (review of #414) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
# Conflicts: # CHANGELOG.md
…er hook repair test Source bin/lib/portable.sh, call require_py and use "$PY". The hook command extraction no longer opens a heredoc inside $(...), which bash 3.2 cannot parse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MendixMau
added a commit
that referenced
this pull request
Oct 16, 2026
Independent review: APPROVE (421-r3). Follow-up commit 583487a only adds portability-ok markers on a diagnostic message and deliberate fake interpreter wrappers in the test (self-reviewed). # #421 delta r3 (cb1bcc0) Scope: the two CHANGES items in 421-r2.md. 1. The merge step now runs as `if ! "$SETTINGS_PY" - ... <<'PYMERGE' ... then cp snapshot; WARN; fi`, the shape r2 verified, so a failed merge under `set -euo pipefail` restores the snapshot byte for byte instead of exiting. New cases: fake python3 that passes the version probe and fails the merge; one that truncates the target then fails. test-wire-agents-settings.sh 17/17 on head; on c426e51 the 8 new assertions fail (9/17). 2. origin/master merged in; CHANGELOG conflict resolved keeping both sides. test-wire-agents-kiro 12/12. APPROVE. Merge before #414.
# Conflicts: # CHANGELOG.md
…layout --hooks-only refuses to rewrite a hand-formatted file (exit 3). The one-line-hook fixture only passed on hosts where mxcli on PATH had normalised the file first, and failed on the CI runner (H4/H6, run 38897076571). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Direct lane
What changed and why: In a lab project the look ledger read "0 of 31 pages seen" while 22 of those pages had screenshots. The project's
.claude/settings.jsonheld only whatmxcli initwrites: nolook-ledger.sh seenhook, no session-check hook, no wrapper allow-list, no permissions sidecar.install-claude-permissions.shis the only writer of the hooks and is called only byinit-project.shat scaffold time. The one later caller,sync-project.sh, ran it in--checkmode and printed a warning inside a long report.doctor.shchecked the allow-list but never the hooks. So a project that missed the scaffold-time install (or whose settings file was rewritten by a latermxcli init) stayed without the hook, silently, andseen.tsvwas never written. Fix:install-claude-permissions.sh --hooks-only(hooks only; no allow/deny/ask entries, no pruning, nothing insettings.local.json);sync-project.shruns it when the hooks are missing and the project installed the profile before (--dry-runreports it), else it warns;doctor.shwarns and names the fix.Impact
.claude/settings.json, only in a project that installed the permission profile before (sidecar with a non-empty allow, or.mxtk/permission-profile). Any other project gets a WARN with the one-lineinstall-claude-permissions.sh <dir> --hooks-onlycommand. Opt-out:.mxtk/no-hook-repair.bin/install-claude-permissions.sh,bin/sync-project.sh,bin/doctor.sh. No_common.shorexec.shchange. Unblocks the planned owed-LOOK threshold (#232): a block on this ledger is unsafe while the hook can be absent. No new tool or platform assumption; Bash 3.2 and Python as before.--hooks-only --checkcall (a single JSON read, well under a second). Doctor adds two greps.Field evidence: a copy of the lab project (APFS clone, original untouched). Before: no hooks in settings.json, no
seen.tsv, 110 owed rows, 31 pages OWED. Aftersync-project.sh: both hooks present and the project's own hook and allow entries kept. A Read of a capture png through the installed hook command wrote aseen.tsvrow, and a second capture matching an owed page flipped it to SEEN inlook-ledger.sh status(31 OWED became 30 OWED, 1 SEEN). Note: the copy sat under/tmp, where an unrelated.mprin an ancestor directory moved the ledger root, so the hook run on the copy usedPROJECT_ROOTset explicitly (the documented override); this is the known tier-3 behaviour in_common.sh, not part of this change.tests/wave2/test-look-ledger-hook-repair.sh13/13 pass on this branch (adds the declined-project, formatting and opt-out cases) and fails on master (H1 to H3, H6 at least; master has no--hooks-only).test-install-claude-permissions.sh77/77 andtest-look-ledger.sh11/11 still pass.CHANGELOG.mdline appended, credited;bin/check-pr-discipline.sh origin/masterclean🤖 Generated with Claude Code
Merge after #421.