You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gstack-memory-ingest: colliding path-derived slugs overwrite in staging, then fail the whole batch #2653
Two distinct source files can therefore collapse to one slug (a session resumed under the same session_id on the same day, or two sessions whose session_id shares a 12-char prefix on the same day).
writeStaged() names each staged file ${slug}.md, so the second file overwrites the first on disk. written still counts both, but only one file lands in the staging dir. gbrain's batch import then collects fewer files than were staged, and the staged-vs-collected reconciliation guard refuses to advance state:
[memory-ingest] ERR: gbrain import accounted for 21 of 22 staged page(s) (imported=7, unchanged=14).
gbrain collected 21 file(s) from the staging dir. Refusing to advance state ...
[memory-ingest] 0 written, 22 failed
ISSUE [transcripts]: gstack-memory-ingest exit 1
The guard is correct (no silent loss), but the batch fails on every run until the colliding inputs age out of the window. Note the message's .gitignore hint is a red herring for this case: the ingester already passes --include-gitignored and sets GIT_CEILING_DIRECTORIES, and a gitignore drop collects 0 files, not 21 of 22.
Reproduction
Two prepared pages with the same path-derived slug and distinct source_path values. writeStaged() writes 2 but only 1 file exists on disk; the reconciliation guard then fails the batch.
Proposed fix
Disambiguate colliding slugs in preparePages() before staging: keep the first page's slug, give each later collider a stable per-source suffix -<sha8(source_path)>. Deterministic across runs (same source -> same slug -> gbrain sees it unchanged, no churn), unique because source_path is unique per prepared page. Mutate slug and page_slug together to preserve the stagedRelPath() single-source-of-truth contract (staging path, #1802 resume reconstruction, and state recording stay in lockstep).
Abandoning this. Not pursuing a fix upstream right now. The root cause (colliding path-derived slugs overwriting in the memory-ingest staging dir) is real, but I'm closing my own report rather than leaving it open.
Activity
rayers commentedon Aug 20, 2026
Abandoning this. Not pursuing a fix upstream right now. The root cause (colliding path-derived slugs overwriting in the memory-ingest staging dir) is real, but I'm closing my own report rather than leaving it open.
v1.78.0.0 fix: the two-red-lanes wave — AUQ collapse rooted, OSV gree…