Repository navigation
Description
Version
LifeOS 8.761.0 · attestation: 22 system file(s) differ from danielmiessler/LifeOS@v8.761.0:
- hooks/LoadContext.hook.ts
- skills/Research/SourceRoutingProtocol.md
- skills/LifeOS/Tools/Report.ts
- skills/LifeOS/Intents/Report.md
- agents/Grok.md
- LIFEOS/TOOLS/UpdateLifeosState.ts
- LIFEOS/TOOLS/MemoryWriter.ts
- LIFEOS/TOOLS/GrokQuery.ts
- LIFEOS/TOOLS/MergeSettings.ts
- LIFEOS/TOOLS/PerplexitySearch.ts
- LIFEOS/TOOLS/Cortex.ts
- LIFEOS/TOOLS/MemorySystem.ts
- LIFEOS/TOOLS/model-pricing.json
- LIFEOS/DOCUMENTATION/Memory/CortexContract.md
- LIFEOS/DOCUMENTATION/Memory/MemorySystem.md
- LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md
- LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.md
- LIFEOS/PULSE/Observability/observability.ts
- LIFEOS/PULSE/Observability/src/app/business/page.tsx
- LIFEOS/PULSE/lib/business-sources.ts
- LIFEOS/VIGIL/Emit.ts
- LIFEOS/VIGIL/adapters/telos.ts
What is broken
When git has a core.hooksPath set 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-hook still writes commit-msg, pre-commit and pre-push into <tree>/.git/hooks, prints ✓ installed for 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-hooks check that reports a core.hooksPath that 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 changes install-hook itself, which #2425 names as the explicit step for the pre-commit guard. What is still open is narrow: install-hook reports success while installing hooks git will not run.
The probe below runs on a fresh copy of LifeOS/install/ at tag v8.761.0 (my own install has local edits, listed above; Secrets.ts and LIFEOS/TOOLS/githooks/ are not among them), with a scratch HOME. Scenario A sets a global core.hooksPath, runs install-hook, stages a .env holding a dummy value, and commits. On 8.761.0 it prints ✓ installed three times, exits 0, and the .env is 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
#!/bin/bash
# Build SRC first: a fresh copy of LifeOS/install/ from danielmiessler/LifeOS at tag v8.761.0.
set -u
SRC=/tmp/lifeos-probe/src
scenario() { # $1 = install-hook flag, $2 = "redirect" to set a global core.hooksPath
local flag="$1" W out rc
W=$(mktemp -d /tmp/lifeos-probe/run.XXXX)
export HOME="$W/h"; mkdir -p "$HOME/.git-hooks"
[ "$2" = redirect ] && git config --global core.hooksPath "$HOME/.git-hooks"
git config --global user.name probe; git config --global user.email probe
cp -R "$SRC" "$W/cfg"; cd "$W/cfg"
git init -q . && git add -A >/dev/null 2>&1 && git commit -q --no-verify -m base >/dev/null 2>&1
export CLAUDE_CONFIG_DIR="$W/cfg"
echo "--- install-hook $flag ($2)"
out=$(bun LIFEOS/TOOLS/Secrets.ts install-hook $flag 2>&1); rc=$?; echo "$out"
echo "install-hook exit $rc; git reads hooks from $(cd "$(git rev-parse --git-path hooks)" && pwd -P)"
if [ -z "$flag" ] && [ $rc -eq 2 ] && echo "$out" | grep -q "nothing installed" && [ ! -e .git/hooks/pre-commit ]; then
echo "PASS: install-hook refused, said why, and wrote no hooks"; return 0
fi
echo X=1 > .env; git add -f .env
if git commit -q -m "probe: staged .env" 2>&1; then
echo "FAIL: install-hook exit $rc, and a staged .env was committed: $(git show --name-only --format= HEAD | tr '\n' ' ')"; return 1
fi
[ $rc -eq 0 ] && { echo "PASS: commit with staged .env refused"; return 0; }
echo "FAIL: install-hook exit $rc"; return 1
}
( scenario "" redirect ); a=$? # A: global core.hooksPath, plain install-hook
( scenario "--set-hooks-path" redirect ); b=$? # B: the opt-in the fix adds (8.761.0 ignores the flag)
( scenario "" none ); c=$? # C: control, no redirect
echo "A=$a B=$b C=$c"; [ $a -eq 0 ] && [ $b -eq 0 ] && [ $c -eq 0 ]Negative control
Probe: /tmp/lifeos-probe/probe.sh · exit 1 · captured 2026-11-07T08:50:45.019Z
Red looks like: FAIL: install-hook exit 0, and a staged .env was committed
--- install-hook (redirect)
✓ installed /tmp/lifeos-probe/run.K1YN/cfg/.git/hooks/commit-msg
✓ installed /tmp/lifeos-probe/run.K1YN/cfg/.git/hooks/pre-commit
✓ installed /tmp/lifeos-probe/run.K1YN/cfg/.git/hooks/pre-push
install-hook exit 0; git reads hooks from /private/tmp/lifeos-probe/run.K1YN/h/.git-hooks
FAIL: install-hook exit 0, and a staged .env was committed: .env
--- install-hook --set-hooks-path (redirect)
✓ installed /tmp/lifeos-probe/run.Iz36/cfg/.git/hooks/commit-msg
✓ installed /tmp/lifeos-probe/run.Iz36/cfg/.git/hooks/pre-commit
✓ installed /tmp/lifeos-probe/run.Iz36/cfg/.git/hooks/pre-push
install-hook exit 0; git reads hooks from /private/tmp/lifeos-probe/run.Iz36/h/.git-hooks
FAIL: install-hook exit 0, and a staged .env was committed: .env
--- install-hook (none)
✓ installed /tmp/lifeos-probe/run.98ah/cfg/.git/hooks/commit-msg
✓ installed /tmp/lifeos-probe/run.98ah/cfg/.git/hooks/pre-commit
✓ installed /tmp/lifeos-probe/run.98ah/cfg/.git/hooks/pre-push
install-hook exit 0; git reads hooks from /private/tmp/lifeos-probe/run.98ah/cfg/.git/hooks
✗ lifeos-secrets-guard: refusing to commit plaintext env file(s):
.env
The plaintext .env is local-only. Seal it instead: bun LIFEOS/TOOLS/Secrets.ts seal
PASS: commit with staged .env refused
A=1 B=1 C=0
Suggested fix
install-hook now 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.
- If any tree is redirected and no flag is given, it writes nothing. It names each tree, the folder git reads, and the value, scope and file of the
core.hooksPaththat set it, then exits 2. - With
--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. - Every tree's
.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. - With no redirect, behaviour is unchanged (scenario C).
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:
- Refuse and explain, with an opt-in flag to fix it (picked). The global folder may carry hooks other repos need, such as git-lfs. A repo-level setting also replaces any repo-level
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. - Set the repo-level
core.hooksPathsilently. Simplest, but it changes git config without asking and quietly stops the user's other hooks in that repo. - Write the hooks into the redirected folder. Rejected: a global folder runs for every repo on the machine, and this would overwrite the user's own hooks there.
The update step from #2425 can call install-hook without the flag and surface the refusal, or pass the flag after asking. The diff uses install paths; upstream it applies under LifeOS/install/ (git apply --directory=LifeOS/install). It changes only LIFEOS/TOOLS/Secrets.ts; the top-level LifeOS/ skill copy is untouched.
--- a/LIFEOS/TOOLS/Secrets.ts
+++ b/LIFEOS/TOOLS/Secrets.ts
@@ -34,7 +34,7 @@
* Never prints a key value. Identity reaches `age` via /dev/stdin, never argv or a temp file.
*/
import { existsSync, readFileSync, writeFileSync, chmodSync, renameSync, mkdirSync, realpathSync, statSync } from "node:fs";
-import { dirname, join } from "node:path";
+import { dirname, join, resolve } from "node:path";
import { createHash } from "node:crypto";
import { spawnSync } from "node:child_process";
@@ -407,7 +407,29 @@
process.stdout.write(identity + "\n");
}
-function cmdInstallHook(): void {
+/** The folder git actually reads hooks from in `tree`. A core.hooksPath at any scope (often a global one
+ * set for git-lfs or a personal hooks folder) moves it away from <tree>/.git/hooks. */
+function effectiveHooksDir(tree: string): string {
+ // No --path-format=absolute: it needs git 2.31+. A relative answer is relative to the -C directory.
+ const r = spawnSync("git", ["-C", tree, "rev-parse", "--git-path", "hooks"], { encoding: "utf8" });
+ invariant(r.status === 0 && r.stdout.trim() !== "", `git could not report the hooks folder for ${tree}: ${(r.stderr ?? "").trim()}`);
+ return resolve(tree, r.stdout.trim());
+}
+
+function samePath(a: string, b: string): boolean {
+ const real = (p: string) => (existsSync(p) ? realpathSync(p) : p);
+ return real(a) === real(b);
+}
+
+/** Which config set core.hooksPath, for the refusal message. git prints scope, origin and value tab-separated. */
+function hooksPathOrigin(tree: string): string {
+ const r = spawnSync("git", ["-C", tree, "config", "--show-scope", "--show-origin", "--get", "core.hooksPath"], { encoding: "utf8" });
+ if (r.status !== 0) return "core.hooksPath origin not reported by git";
+ const [scope, origin, value] = r.stdout.trim().split("\t");
+ return `core.hooksPath = ${value ?? "?"}, set in ${scope ?? "?"} config ${(origin ?? "?").replace(/^file:/, "")}`;
+}
+
+function cmdInstallHook(setHooksPath: boolean): void {
invariant(existsSync(HOOK_SRC_PRE_COMMIT), `hook source missing at ${HOOK_SRC_PRE_COMMIT}`);
invariant(existsSync(HOOK_SRC_COMMIT_MSG), `hook source missing at ${HOOK_SRC_COMMIT_MSG}`);
const hooksDir = join(REPO_ROOT, ".git", "hooks");
@@ -415,15 +437,10 @@
const preCommitBody = readFileSync(HOOK_SRC_PRE_COMMIT, "utf8");
invariant(preCommitBody.includes("lifeos-secrets-guard"), "pre-commit hook source must carry the lifeos-secrets-guard marker");
-
- // Install commit-msg hook (SYSTEM tree only: it guards layer-one rule removals)
- const commitMsgDst = join(hooksDir, "commit-msg");
const commitMsgBody = readFileSync(HOOK_SRC_COMMIT_MSG, "utf8");
invariant(commitMsgBody.includes("lifeos-judgment-lane-guard"), "commit-msg hook source must carry the lifeos-judgment-lane-guard marker");
- writeAtomic(commitMsgDst, commitMsgBody, 0o755);
- console.log(`✓ installed ${commitMsgDst}`);
- // Install pre-commit and pre-push in every private tree: this repo and the USER data repo behind
+ // pre-commit and pre-push go in every private tree: this repo and the USER data repo behind
// LIFEOS/USER. pre-commit's env and gitleaks checks apply to both; its SYSTEM leak scan runs only
// where LIFEOS/TOOLS/githooks/StagedLeakScan.ts exists under the tree's top level.
const prePushSrc = join(REPO_ROOT, "LIFEOS", "TOOLS", "githooks", "pre-push");
@@ -436,6 +453,33 @@
const top = spawnSync("git", ["-C", realpathSync(userLink), "rev-parse", "--show-toplevel"], { encoding: "utf8" });
if (top.status === 0 && top.stdout.trim()) trees.push(top.stdout.trim());
}
+
+ // A hook written to .git/hooks never runs when core.hooksPath points git elsewhere, so the env guard,
+ // the leak scans and the private-remote push guard would be silently inert. Check every tree before
+ // writing anything: refuse and say why, or, with --set-hooks-path, pin the tree to its own .git/hooks.
+ // Every tree must have a real .git/hooks folder first (a worktree's .git is a file), so a refusal or a
+ // config change is never made for a tree the install would then fail on.
+ for (const tree of trees) invariant(existsSync(join(tree, ".git", "hooks")), `${tree}/.git/hooks missing`);
+ const redirected = trees.filter((t) => !samePath(effectiveHooksDir(t), join(t, ".git", "hooks")));
+ if (redirected.length > 0 && !setHooksPath) {
+ for (const t of redirected) {
+ console.error(`✗ ${t}: git reads hooks from ${effectiveHooksDir(t)} (${hooksPathOrigin(t)}), not ${join(t, ".git", "hooks")}; hooks installed there would never run.`);
+ }
+ die("nothing installed. Re-run with --set-hooks-path to set core.hooksPath=.git/hooks in each tree above (the USER data repo included, if listed). That repo-level setting overrides a global one and replaces a repo-level one, so hooks in the other folder (git-lfs, for example) stop running in that repo. Or call LIFEOS/TOOLS/githooks from that hooks folder yourself.", 2);
+ }
+ for (const t of redirected) {
+ const was = `${effectiveHooksDir(t)} (${hooksPathOrigin(t)}); hooks there no longer run in this repo`;
+ const r = spawnSync("git", ["-C", t, "config", "--local", "core.hooksPath", ".git/hooks"], { encoding: "utf8" });
+ invariant(r.status === 0, `could not set core.hooksPath in ${t}: ${(r.stderr ?? "").trim()}`);
+ invariant(samePath(effectiveHooksDir(t), join(t, ".git", "hooks")), `${t} still reads hooks from ${effectiveHooksDir(t)} after setting core.hooksPath`);
+ console.log(`✓ set core.hooksPath=.git/hooks in ${t} (git was reading ${was})`);
+ }
+
+ // Install commit-msg hook (SYSTEM tree only: it guards layer-one rule removals)
+ const commitMsgDst = join(hooksDir, "commit-msg");
+ writeAtomic(commitMsgDst, commitMsgBody, 0o755);
+ console.log(`✓ installed ${commitMsgDst}`);
+
for (const tree of trees) {
invariant(existsSync(join(tree, ".git", "hooks")), `${tree}/.git/hooks missing`);
for (const [name, body] of [["pre-commit", preCommitBody], ["pre-push", prePushBody]] as const) {
@@ -457,7 +501,7 @@
case "unseal": cmdUnseal(force); break;
case "status": process.exitCode = cmdStatus(); break;
case "export-identity": cmdExportIdentity(yes); break;
- case "install-hook": cmdInstallHook(); break;
+ case "install-hook": cmdInstallHook(rest.includes("--set-hooks-path")); break;
case "has": process.exitCode = cmdHas(rest.filter((a) => !a.startsWith("--"))); break;
case "keys": cmdKeys(); break;
case "set": {
@@ -469,7 +513,7 @@
break;
}
default:
- console.log("usage: Secrets.ts init [--force] | seal | unseal [--force] | status | export-identity --yes | install-hook | has KEY [KEY...] | set KEY | keys");
+ console.log("usage: Secrets.ts init [--force] | seal | unseal [--force] | status | export-identity --yes | install-hook [--set-hooks-path] | has KEY [KEY...] | set KEY | keys");
process.exit(cmd ? 1 : 0);
}
}Verified after fix
Probe: /tmp/lifeos-probe/probe.sh · exit 0 · captured 2026-11-07T08:51:01.889Z
--- install-hook (redirect)
✗ /tmp/lifeos-probe/run.u4MI/cfg: git reads hooks from /tmp/lifeos-probe/run.u4MI/h/.git-hooks (core.hooksPath = /tmp/lifeos-probe/run.u4MI/h/.git-hooks, set in global config /tmp/lifeos-probe/run.u4MI/h/.gitconfig), not /tmp/lifeos-probe/run.u4MI/cfg/.git/hooks; hooks installed there would never run.
✗ nothing installed. Re-run with --set-hooks-path to set core.hooksPath=.git/hooks in each tree above (the USER data repo included, if listed). That repo-level setting overrides a global one and replaces a repo-level one, so hooks in the other folder (git-lfs, for example) stop running in that repo. Or call LIFEOS/TOOLS/githooks from that hooks folder yourself.
install-hook exit 2; git reads hooks from /private/tmp/lifeos-probe/run.u4MI/h/.git-hooks
PASS: install-hook refused, said why, and wrote no hooks
--- install-hook --set-hooks-path (redirect)
✓ set core.hooksPath=.git/hooks in /tmp/lifeos-probe/run.M7uG/cfg (git was reading /tmp/lifeos-probe/run.M7uG/h/.git-hooks (core.hooksPath = /tmp/lifeos-probe/run.M7uG/h/.git-hooks, set in global config /tmp/lifeos-probe/run.M7uG/h/.gitconfig); hooks there no longer run in this repo)
✓ installed /tmp/lifeos-probe/run.M7uG/cfg/.git/hooks/commit-msg
✓ installed /tmp/lifeos-probe/run.M7uG/cfg/.git/hooks/pre-commit
✓ installed /tmp/lifeos-probe/run.M7uG/cfg/.git/hooks/pre-push
install-hook exit 0; git reads hooks from /private/tmp/lifeos-probe/run.M7uG/cfg/.git/hooks
✗ lifeos-secrets-guard: refusing to commit plaintext env file(s):
.env
The plaintext .env is local-only. Seal it instead: bun LIFEOS/TOOLS/Secrets.ts seal
PASS: commit with staged .env refused
--- install-hook (none)
✓ installed /tmp/lifeos-probe/run.QEGd/cfg/.git/hooks/commit-msg
✓ installed /tmp/lifeos-probe/run.QEGd/cfg/.git/hooks/pre-commit
✓ installed /tmp/lifeos-probe/run.QEGd/cfg/.git/hooks/pre-push
install-hook exit 0; git reads hooks from /private/tmp/lifeos-probe/run.QEGd/cfg/.git/hooks
✗ lifeos-secrets-guard: refusing to commit plaintext env file(s):
.env
The plaintext .env is local-only. Seal it instead: bun LIFEOS/TOOLS/Secrets.ts seal
PASS: commit with staged .env refused
A=0 B=0 C=0
Environment
- OS: macOS 27.2 (arm64)
- Harness: claude-code
- bun: 1.3.14 · git: 2.54.0
- Doctor broken: none
Before submitting
- I searched open and closed issues for this defect.
- The repro runs against a clean tree of the version above, not against my modified install.
- I removed personal data from the pasted output — real names, absolute home paths, tokens, my own content.
Searched for: hooksPath, install-hook, pre-push, githooks, hooks never run, core.hooksPath install-hook
Activity
danielmiessler commentedon Nov 12, 2026
Note
🤖 Kai (AI assistant) responding on behalf of Daniel Miessler
Thanks @pareidox, you found that
Secrets.ts install-hookreported success even whencore.hooksPathredirected git, so the guards never ran. It now checks every tree for that redirect before writing anything, exits 2 and prints the one-linegit config --local core.hooksPath .git/hooksfix, inLIFEOS/TOOLS/Secrets.ts. It ships in the next public release after 8.761.0.