fix: stop flagging dual-encoding pairs as contradictions (T60)#11
Merged
Conversation
steward conflict detection treated any lifecycle difference between two similar memories as a contradiction. The same event is routinely stored at two layers — a raw session summary (lifecycle draft) and the extracted/promoted entity (active/canonical) — which are near-identical by design. This produced a large false-positive class: a full scan over ~1879 memories returned 64 contradictions, all dual-encoding pairs, forcing dozens of manual suppress actions per cleanup. A lifecycle difference now counts as a conflict only on explicit invalidation: one side outdated/superseded while the other is live (active/canonical/draft). draft<->active<->canonical differences are normal maturation and ignored. Genuine same-layer disagreements are still caught via explicit supersession links, temporal window overlap, and content contradiction keywords. - scanner.go: replace bare 'la != lb' signal with lifecycleInvalidationConflict - tests: lifecycle matrix, dual-encoding skip + same-layer flag (unit + full scan path) - docs: STEWARDSHIP.md dual-encoding policy section Closes T60
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.
Что и зачем
steward_run(scope=full)на Sema (1879 memories) возвращал 64 contradictions — все false positives класса dual-encoding: одно событие хранится в двух слоях — raw session summary (Session close / X, lifecycledraft) и извлечённая/промоутнутая entity (Task complete: X,active/canonical). Они семантически почти идентичны by design, но conflict detection считал любую разницу lifecycle противоречием. На одном/memory-cleanupприходилось делать 69 ручныхsuppress, и это растёт линейно с числом закрытых задач.Root cause
В
hasContradictionSignalsветкаif la != "" && lb != "" && la != lb { return true }срабатывала на естественной разницеdraftvscanonical.Fix
Разница lifecycle считается конфликтом только при явной инвалидации: одна сторона
outdated/superseded, другая — живая (active/canonical/draft). Различия среди живых статусов (draft↔active↔canonical) — нормальное вызревание/dual-encoding, игнорируются. Настоящие same-layer противоречия по-прежнему ловятся через explicit supersession links, пересечение temporal-окон и content-keywords.scanner.go:la != lb→lifecycleInvalidationConflict(la, lb)hasContradictionSignals) и полный scan-путь (scanSemanticConflicts)docs/STEWARDSHIP.md— секция dual-encoding policyAcceptance (T60)
Проверка
go build ./...— OKgo test ./...— зелёныеaudit.go/inbox.goне относятся к изменению)Закрывает T60.