@miller-tech/uap 1.26.1 → 1.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miller-tech/uap",
3
- "version": "1.26.1",
3
+ "version": "1.26.2",
4
4
  "description": "Autonomous AI agent memory system with CLAUDE.md protocol enforcement",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,10 +32,17 @@ fi
32
32
  # (common for Write to a new file).
33
33
  ABS_PATH="$(realpath -m "$FILE_PATH" 2>/dev/null || printf '%s' "$FILE_PATH")"
34
34
 
35
- # Resolve repo root from current working directory. If cwd is not inside a
36
- # git repo at all, allow there's no worktree policy to enforce.
35
+ # Resolve repo root from current working directory. In a BARE repo (this
36
+ # project's layout) `git rev-parse --show-toplevel` returns empty even from the
37
+ # project root — so fall back to the root derived from the hook's own location
38
+ # (<root>/.factory/hooks/) and FAIL CLOSED. A missing repo root must not silently
39
+ # disable the worktree guard, which previously let root-dir edits through.
37
40
  REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
38
41
  if [ -z "$REPO_ROOT" ]; then
42
+ REPO_ROOT="$(cd "$HOOK_DIR/../.." 2>/dev/null && pwd || true)"
43
+ fi
44
+ if [ -z "$REPO_ROOT" ]; then
45
+ # Genuinely cannot locate a project root — nothing to enforce against.
39
46
  exit 0
40
47
  fi
41
48