claude-memory/graph/fixes/fix-memory-repo-pre-commit-hook-blocking-edge-files-missing-c3f6fb.md
2026-02-19 23:40:00 -06:00

46 lines
1.2 KiB
Markdown

---
id: c3f6fbc2-04d0-41ef-87c2-8685d8769ac3
type: fix
title: "Fix: memory repo pre-commit hook blocking edge files missing title field"
tags: [cognitive-memory, git, pre-commit-hook, fix, edge-files]
importance: 0.6
confidence: 0.8
created: "2026-02-20T05:39:51.522395+00:00"
updated: "2026-02-20T05:40:00.105088+00:00"
relations:
- target: 43cb893a-c577-407e-a41c-51d7f81e80f6
type: CAUSES
direction: incoming
strength: 0.8
edge_id: 6cecf4c4-e3c4-44f7-bba8-ad69a10f9c86
---
# Pre-commit Hook Fix: Edge Files Have Different Schema
## Problem
The `~/.claude/memory` repo pre-commit hook required `id`, `type`, and `title` fields on all markdown files under `graph/`. Edge files use a different schema with no `title` field:
```yaml
# Edge file schema
id: <uuid>
type: <relation_type>
from_id: <uuid>
to_id: <uuid>
from_title: <string>
to_title: <string>
```
This caused all edge commits to be blocked with a validation error about the missing `title` field.
## Fix
Added a path check in the pre-commit hook:
- Files matching `graph/edges/` validate against edge schema: `(id, type, from_id, to_id)`
- All other files continue to require `(id, type, title)`
## Location
`~/.claude/memory/.git/hooks/pre-commit` (or equivalent hook script)