Repository navigation
fix: archive_learning prefix by UUID range; 0-row PATCH not durable (GIT-119) - #54
Merged
1 commit merged intoSep 23, 2026
Merged
1 commit merged into
1 commit merged into
Conversation
… not durable (GIT-119)
archive_learning sent id=like.<prefix>% against a uuid column, which Postgres
rejects (42883), so prefix archiving failed on every store. The prefix now
resolves from the local index, or from the store as a UUID range when cold.
directPatch returns { count, rows }. PostgREST answers 200 [] when a PATCH
matched nothing; all 8 callers now treat count 0 as not durable (archive of a
nonexistent id, session embedding, superseded mark, thread resolve/touch/
auto-archive, relevance update, transcript path).
Tests: +12 (9 parameterized zero-row cases, 3 archive). Venue driver gains a
prefix archive of a row the index has not seen, and a nonexistent full UUID.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
GIT-119: archive_learning prefix resolution; a 0-row PATCH is not durable
Just upgrade the package. Nothing to change on your database. Works on the v1.8.0 schema.
What was wrong
archive_learningresolved an id prefix withid=like.<prefix>%. The column isuuid, and Postgres has no LIKE for it (42883 "operator does not exist"), so prefix archiving failed on every store.[]when a PATCH matches nothing, so archiving a nonexistent id reported "Archived" anddurable: true.directPatchcallers.Fix
and=(id.gte.<prefix>000…,id.lte.<prefix>fff…)). UUIDs order bytewise, so the range is exact. The PATCH isid=eq.<uuid>.directPatchreturns{ count, rows }. Every caller treats count 0 as not durable:success:false,durable:false, "nothing was archived"saveSessionEmbedding, extracted)markSessionSuperseded, exported)relevance_updatefailurepatch_warningEvidence
Unit, parameterized over all 8 callers (
tests/unit/services/directpatch-zero-rows.test.ts), fetch stubbed so every PATCH returns 200[]:Venue flow on v1.8.0 (
vujndhcumgroztfkkdus). The driver inserts a learning after the server loaded its index, archives it by 8-char prefix, then archives a nonexistent full UUID.Archived learning 5e394eee → 5e394eee-642c-…, rowis_active=false; the ghost id returns "No learning … in the store — nothing was archived".Suite: tsc clean. Unit 1369 on the branch vs 1357 on main (+12: 9 parameterized, 3 archive).
Old-behaviour tests changed
archive-learning.test.ts: two tests asserted thelike.filter. They now assert the UUID range filter. ThedirectPatchmock default now returns{count:1, rows}, the new shape.Stacking note
thread-supabase.tsoverlaps GIT-117 (#52), which readspatched.length. At release/D those lines becomepatched.count.🤖 Generated with Claude Code