Skip to content

[codex] Enforce concept alias foreign keys#198

Merged
yibeichan merged 2 commits into
mainfrom
codex/issue-196-concept-alias-fk
Jun 11, 2026
Merged

[codex] Enforce concept alias foreign keys#198
yibeichan merged 2 commits into
mainfrom
codex/issue-196-concept-alias-fk

Conversation

@yibeichan

Copy link
Copy Markdown
Owner

Summary

  • enable SQLite foreign-key enforcement for writable vault DB connections
  • make the concept alias test fixture use FK-backed concept slugs
  • add regression coverage for nonexistent duplicate and canonical slugs

Root cause

SQLite does not enforce foreign-key constraints unless each writing connection enables PRAGMA foreign_keys = ON. addConceptAlias opened a writable schist.db connection without that pragma, so orphaned concept_aliases rows could be inserted silently.

Validation

  • npm test -- --testPathPatterns=memory.test.ts
  • npm test

Closes #196

@yibeichan yibeichan marked this pull request as ready for review June 11, 2026 14:34
@yibeichan yibeichan merged commit c17f466 into main Jun 11, 2026
5 checks passed
@yibeichan yibeichan deleted the codex/issue-196-concept-alias-fk branch June 11, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: concept_aliases foreign-key constraints silently unenforced — add_concept_alias accepts nonexistent concept slugs

1 participant