Repository navigation
fix: thread triples reference the thread row id, not its t- id (GIT-105) - #44
Merged
2 commits merged intoSep 22, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
…IT-105)
knowledge_triples.source_id is a UUID column on every schema, including the
v1.8.0 setup.sql. Thread triples wrote the thread id ("t-xxxxxxxx") into it,
so every create_thread / resolve_thread triple failed with 400 (22P02) and
the failure was swallowed. No schema change needed:
- source_id is the thread's gitmem_threads.id, a UUID the store already has.
create_thread passes the row id createThreadInSupabase returned;
resolution triples look it up by thread_id. A failed or empty lookup writes
the triple with source_id null rather than losing it.
- writeTriples never sends a non-UUID source_id from any caller; it logs and
sends null instead.
thread-triples.test.ts: two assertions expected source_id "t-abc12345", the
value the column rejects. They now expect the row id. +5 tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…expected failures (GIT-105) Exits 1 on 1.10.0 (0 thread triples stored); exits 0 with the fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
neoneye
pushed a commit
to agent-memory-atlas-archive/gitmem-dev--gitmem
that referenced
this pull request
Sep 22, 2026
Conflicts (blank-supabase.mjs): - EXPECTED_FAILURES: gitmem-dev#42 removed GIT-73 and gitmem-dev#44 removed GIT-105; both removals kept, so the list is empty. - all result fields and all checks kept. tsc clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Thread triples reach
knowledge_tripleson a v1.8.0 store (GIT-105). No schema change.source_idis now the thread's row id (gitmem_threads.id, a UUID the store already has), withsource_type: "thread". It used to be the textthread_id(t-xxxxxxxx).create_threadpasses the row idcreateThreadInSupabasereturns, so there's no extra request.thread_id(oneGET gitmem_threads?select=id&thread_id=eq.…).source_id: nullinstead of losing it. The subject/object labels still carry the relation.writeTriplesnever sends a non-UUIDsource_idfrom any caller: it logs and sendsnull.Why
knowledge_triples.source_idisUUIDin every schema, includingv1.8.0:schema/setup.sql. Writing"t-b4d09cb0"into it failed the row with22P02 invalid input syntax for type uuid, so everycreate_threadandresolve_threadtriple 400'd, and the failure was swallowed. The table has no JSONB column to stash the text id in. The row id is the value that actually fits the column's meaning, and nothing readssource_idback as a thread id:graph_traverseonly displays it, and the scar lookup filters on learning UUIDs.How to test
Venue (v1.8.0
setup.sql,vujndhcumgroztfkkdus; production not touched). GIT-105 is removed fromEXPECTED_FAILURES, which leaves only GIT-73 on this branch (GIT-73's own PR, #42, removes that one).flownow readsknowledge_triples?source_type=eq.threadback and requires everysource_idto be a realgitmem_threads.id.origin/main1.10.0POST knowledge_triplesThe resolution path isn't driven on the venue in this branch (the resolve step arrives with GIT-101's driver change, #40). It's covered by unit tests: lookup by
thread_id, not found → null, lookup failure → null.Unit tests: 1279/1279 pass (+5). Creation uses the passed row id with no lookup; resolution looks it up; not-found and lookup failure →
nullwith the triple still written; a non-UUIDsource_idfrom any caller →null; extraction without a row id →null, never thethread_id.Existing tests that encoded the old behaviour (changed, not deleted)
tests/unit/services/thread-triples.test.ts:sets correct source_type and half_life on all triplesandhas correct subject/object labelsassertedsource_id === "t-abc12345", the exact value the UUID column rejects. They now pass athread_row_idin the fixture and expect it assource_id. All other assertions are unchanged.Checklist
npm run test:unitpasses (1279)Breaking changes
None. Thread triples previously never landed, so there are no existing rows to be inconsistent with.
🤖 Generated with Claude Code