Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "ix-memory",
"source": "./",
"description": "Ix Memory integration — cognitive skills, agentic workflows, and auto-ingestion hooks for graph-aware engineering",
"version": "3.1.0"
"version": "3.1.1"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ix-memory",
"version": "3.1.0",
"version": "3.1.1",
"description": "Ix Memory integration — transforms Claude into a graph-reasoning agent with cognitive skills for understanding, investigation, impact analysis, planning, debugging, architecture auditing, and deep documentation synthesis.",
"author": {
"name": "Ix Memory"
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

## 3.1.1

Hardening for the auto-ingestion hooks so background graph refresh is safe to run frequently.

- **Post-edit hook (`ix-ingest.sh`) no longer retries `ix map` itself.** The `ix` CLI now owns retry/backoff and a per-run wall-clock deadline and is single-flight per workspace, so a shell-level retry only amplified load against a slow backend.
- **Both refresh hooks (`ix-map.sh`, `ix-ingest.sh`) mark their map as automatic (`IX_AUTO_MAP=1`).** The CLI skips an automatic map when the active backend is remote, so background refresh stays a local convenience and remote ingestion is left to deliberate, manual `ix map`. Set `IX_AUTO_MAP_CLOUD=1` to opt back in to remote auto-refresh.

Pairs with the `ix` CLI single-flight + deadline support (Ix #290).

## 3.1.0

- Adopt `ix --format llm` across skills and agents.
- Add an `mkdir`-lock fallback to the Stop-time full-map hook so concurrent runs don't stack on systems without `flock`.
28 changes: 17 additions & 11 deletions hooks/ix-ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,30 @@ source "${_HOOK_DIR}/lib/index.sh"
ix_health_check
IX_HOOK_NAME="ix-ingest"

# Mark this map as automatic (background refresh). The CLI skips an automatic
# map when the active backend is remote (see ix-map.sh for the rationale).
export IX_AUTO_MAP=1

IX_INGEST_INJECT="${IX_INGEST_INJECT:-off}"
ix_log "ENTRY file=$FILE_PATH inject=$IX_INGEST_INJECT"

# ── Map file (retry once on failure) ─────────────────────────────────────────
# ── Map file (single attempt) ────────────────────────────────────────────────
# No shell-level retry. The ix CLI owns retry/backoff and a hard wall-clock
# deadline, and is single-flight per workspace (a concurrent map coalesces and
# exits 0). A shell retry here only amplified load against an unhealthy backend:
# a burst of edits could stack many immediate re-attempts. One attempt is
# enough — if it misses, the next edit or the Stop-hook full map (ix-map.sh)
# refreshes anything left stale.
ix_log "RUN ix map $FILE_PATH"
_map_err=$(mktemp)
ix_log_command ix map "$FILE_PATH"
ix map "$FILE_PATH" >/dev/null 2>"$_map_err" || {
ix_log "RETRY ix map failed once, retrying"
ix_log_command ix map "$FILE_PATH"
ix map "$FILE_PATH" >/dev/null 2>"$_map_err" || {
_exit=$?
ix_capture_async "ix" "ix-map" "ix map failed" "$_exit" \
"ix map $(basename "$FILE_PATH")" "$(head -3 "$_map_err")"
ix_log "FAILED ix map after retry exit=$_exit"
rm -f "$_map_err"
exit 0
}
_exit=$?
ix_capture_async "ix" "ix-map" "ix map failed" "$_exit" \
"ix map $(basename "$FILE_PATH")" "$(head -3 "$_map_err")"
ix_log "FAILED ix map exit=$_exit"
rm -f "$_map_err"
exit 0
}
rm -f "$_map_err"
ix_log "DONE mapped $FILE_PATH"
Expand Down
6 changes: 6 additions & 0 deletions hooks/ix-map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ source "${_HOOK_DIR}/lib/index.sh" 2>/dev/null || true
ix_health_check
IX_HOOK_NAME="ix-map"

# Mark this map as automatic (background refresh). The CLI skips an automatic
# map when the active backend is remote — a shared remote graph should be fed
# deliberately, not on every change from every client. Manual `ix map` is
# unaffected. Users who want remote auto-refresh set IX_AUTO_MAP_CLOUD=1.
export IX_AUTO_MAP=1

# ── Debounce — skip if a map ran recently ────────────────────────────────────
IX_MAP_DEBOUNCE_SECONDS="${IX_MAP_DEBOUNCE_SECONDS:-300}"
IX_MAP_DEBOUNCE_FILE="${TMPDIR:-/tmp}/ix-map-last"
Expand Down