Repository navigation
Conversation
…ects git, so the guards never run Filed from a LifeOS install with the Report tool; the negative control and the green run are in the PR body.
Owner
|
Note 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler Thanks @pareidox, your PR made |
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.
Fixes #2650.
Version
LifeOS 8.761.0 · attestation: 22 system file(s) differ from danielmiessler/LifeOS@v8.761.0:
What is broken
When git has a
core.hooksPathset at any scope (a global one is common with git-lfs or a personal hooks folder), git reads hooks from that folder and never from<tree>/.git/hooks.Secrets.ts install-hookstill writescommit-msg,pre-commitandpre-pushinto<tree>/.git/hooks, prints✓ installedfor each, and exits 0. So the env guard, the gitleaks scan, the SYSTEM leak scan and the private-remote push guard never run, and nothing says so. On my install they had been inert since they were installed.Related: #2425 (closed). Per the replies there, the next release's update step installs pre-push but "leaves ... a core.hooksPath redirect ... alone", and Doctor gains a
git-hookscheck that reports acore.hooksPaththat bypasses the hooks. The installer step for pre-commit is held on purpose (gitleaks fail-closed, #2428, #2424, no backup on overwrite), and this report does not touch that. Neither change is in 8.761.0, and neither changesinstall-hookitself, which #2425 names as the explicit step for the pre-commit guard. What is still open is narrow:install-hookreports success while installing hooks git will not run.The probe below runs on a fresh copy of
LifeOS/install/at tagv8.761.0(my own install has local edits, listed above;Secrets.tsandLIFEOS/TOOLS/githooks/are not among them), with a scratch HOME. Scenario A sets a globalcore.hooksPath, runsinstall-hook, stages a.envholding a dummy value, and commits. On 8.761.0 it prints✓ installedthree times, exits 0, and the.envis committed. Scenario B is the same with the flag the fix adds, which 8.761.0 ignores. Scenario C is the control: no redirect, and the guard refuses the commit, so only the redirect makes it inert. The pre-commit's env check runs before gitleaks, so C refuses with or without gitleaks installed.Where (file:line)
LIFEOS/TOOLS/Secrets.ts:410
Repro on a clean tree
Negative control
Probe:
/tmp/lifeos-probe/probe.sh· exit 1 · captured 2026-11-07T08:50:45.019ZRed looks like: FAIL: install-hook exit 0, and a staged .env was committed
Suggested fix
install-hooknow asks git where it reads hooks (git rev-parse --git-path hooks, resolved against the tree, so git older than 2.31 works) for every tree before writing anything.core.hooksPaththat set it, then exits 2.--set-hooks-path, it setscore.hooksPath=.git/hooksat repo level in each redirected tree (the USER data repo too, when it is one of them), re-checks that git now reads.git/hooks, then installs as before. Both messages say that hooks in the other folder (git-lfs, for example) stop running in that repo..git/hooksis checked before any refusal or config change, so a tree whose.gitis a file (a worktree) still fails as before, with nothing written.Checked beyond the probe: a git that rejects
--path-format(all three scenarios pass), a worktree as the USER tree (fails before writing config or hooks), a global~or relative path, a repo-level path to another folder, a repo-level.git/hooks, and a redirected second tree (both listed, nothing written).Options considered:
core.hooksPaththe user chose (husky, for example). So changing config needs consent, and a flag is the consent a non-interactive tool can take. Failing loud matches the pre-commit guard's fail-closed stance.core.hooksPathsilently. Simplest, but it changes git config without asking and quietly stops the user's other hooks in that repo.The update step from #2425 can call
install-hookwithout the flag and surface the refusal, or pass the flag after asking. The diff uses install paths; upstream it applies underLifeOS/install/(git apply --directory=LifeOS/install). It changes onlyLIFEOS/TOOLS/Secrets.ts; the top-levelLifeOS/skill copy is untouched.Verified after fix
Probe:
/tmp/lifeos-probe/probe.sh· exit 0 · captured 2026-11-07T08:51:01.889ZEnvironment
Before submitting
Searched for:
hooksPath,install-hook,pre-push,githooks,hooks never run,core.hooksPath install-hook