feat: KB quality improvements — CHECK constraints, FTS coverage, outcome validation (#90) - #91
Merged
Merged
Conversation
There was a problem hiding this comment.
2 issues found across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
four-bytes-robby
force-pushed
the
feat/90-kb-quality-improvements
branch
from
June 7, 2026 14:12
ba559f4 to
0afa508
Compare
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.
Summary
Ports quality improvements from the standalone
four-opencode-knowledgeplugin to brain'ssrc/knowledge/.Changes
Schema —
src/schema.tsconfidence(0.0–1.0),review_state(valid enum),outcome(valid enum)migrateEntityTypeCheckpattern with retry)entry_key,kind,entity_type(previously only 5 columns)Runtime —
src/knowledge/store.tskbRecord()— rejects invalid outcomes before INSERT with clear error messageVerification
Closes #90
Summary by cubic
Improves knowledge base data quality by enforcing constraints, making outcome validation unconditional, and rebuilding FTS for better search. Implements the KB quality work from #90.
New Features
review_stateenum, occurrenceoutcomeenum.kbRecord()now always runs before insert and throws a clear error with allowed values.Migration
entry_key,kind,entity_typeand recreates sync triggers with full 8-column coverage; content table remains unchanged.Written for commit 0afa508. Summary will update on new commits.