Bug
In cmd_index, per-file parsing failures are caught and counted but no detail is recorded:
except (MemoryError, json.JSONDecodeError, OSError, ValueError):
failed += 1
except Exception:
failed += 1
When files_failed > 0, there is no way to know which file failed or why. This makes indexing problems effectively undebuggable in production (the scheduled task runs hidden).
Suggested fix
Capture the offending file path and exception message — e.g. log to stderr, and/or store the first N failures in the index_runs.error column (or a new index_failures table).
Affected
Bug
In
cmd_index, per-file parsing failures are caught and counted but no detail is recorded:When
files_failed > 0, there is no way to know which file failed or why. This makes indexing problems effectively undebuggable in production (the scheduled task runs hidden).Suggested fix
Capture the offending file path and exception message — e.g. log to stderr, and/or store the first N failures in the
index_runs.errorcolumn (or a newindex_failurestable).Affected
engram.py→cmd_index