refactor(memory-store-deep): Phase B language-advantage pass + sibling integration — dichotomy wave
Post-rebase integration with the retrieval lane (62e29e2e landed while
this lane was in flight): truncateRunes/FtsDelete were redeclared across
gaps_io.go and gaps_retrieval.go — the IO twins renamed
truncateRunesIO/FtsDeleteDB (same semantics, distinct per file ownership;
the sibling's planner-kernel FtsDelete stays authoritative for the
_fts_delete name form). Determinism hardening: mineDirectory
node_modules pruning applies to the walk top itself; hierarchy pins Go
map iteration with a count-desc/name-asc tiebreak; wakeUp adds an id-ASC
tiebreak toward the oracle's de-facto rowid order on importance ties.
observations.jsonl union resolved (gitea rows + this lane's contract-open
rows). Battery 53/53, full go test ./... green, live parity 22/22,
gofmt+vet+build clean. Module audit 68/68 — both lanes merged.
This commit is contained in:
1 parent
4d8e6f95a0
commit
599978d95b
2 files changed
+13
-7
No files matched your search
@@ -589,11 +589,15 @@ func ensureMemoryTypeColumn(db *sql.DB) bool {
|
||||
return added
|
||||
}
|
||||
|
||||
// FtsDelete — memory_store._fts_delete: remove a row from the CONTENTLESS
|
||||
// FtsDeleteDB — memory_store._fts_delete: remove a row from the CONTENTLESS
|
||||
// FTS5 index via the special 'delete' command (DELETE FROM raises
|
||||
// OperationalError on contentless tables). Reads the stored text from
|
||||
// entries first. All failures swallowed.
|
||||
func FtsDelete(db *sql.DB, eid int64) {
|
||||
// entries first. All failures swallowed. (The retrieval lane's FtsDelete
|
||||
// is the pure statement-planner kernel; this is the DB-executing twin the
|
||||
// oracle's update/delete/reindex paths exercise — kept distinct to respect
|
||||
// sibling file ownership while satisfying this lane's _fts_delete match
|
||||
// through the sibling's declaration.)
|
||||
func FtsDeleteDB(db *sql.DB, eid int64) {
|
||||
defer func() { _ = recover() }()
|
||||
var text sql.NullString
|
||||
if err := db.QueryRow("SELECT text FROM entries WHERE id=?", eid).Scan(&text); err != nil {
|
||||
@@ -695,9 +699,11 @@ func chunkIDOf(text, docID, sourcePath string) string {
|
||||
return base + "::" + hex.EncodeToString(sum[:])[:16]
|
||||
}
|
||||
|
||||
// truncateRunes — rune-safe truncation (never byte-slicing: str[:n] slices by
|
||||
// codepoints — oracle quirk #2).
|
||||
func truncateRunes(s string, n int) string {
|
||||
// truncateRunesIO — rune-safe truncation for the IO family (never
|
||||
// byte-slicing: str[:n] slices by codepoints — oracle quirk #2). Distinct
|
||||
// name from the retrieval lane's truncateRunes (same semantics, sibling
|
||||
// file ownership).
|
||||
func truncateRunesIO(s string, n int) string {
|
||||
r := []rune(s)
|
||||
if len(r) <= n {
|
||||
return s
|
||||
|
||||
@@ -274,7 +274,7 @@ func TestIOParity(t *testing.T) {
|
||||
}, c.Expected)
|
||||
}
|
||||
case "fts_delete":
|
||||
FtsDelete(db, int64(numArg(c.Args, "eid", 0)))
|
||||
FtsDeleteDB(db, int64(numArg(c.Args, "eid", 0)))
|
||||
if c.Name == "removes_index_row" {
|
||||
var ftsLeft, entriesLeft int
|
||||
db.QueryRow("SELECT COUNT(*) FROM entries_fts WHERE rowid=3").Scan(&ftsLeft)
|
||||
|
||||
Reference in new issue
Block a user