Remove the unused knowledge-graph tables and dashboard resources - #1061
Merged
Conversation
Nothing wrote to the knowledge graph. No code created an Entity, an EntityRelation or an ArticleEntity outside a manual dashboard form, and article-analysis never sent entities at all, so every reader read empty. With the Ticker Profile serving the two readers that mattered, drop the nine models and their two orphaned enums, the four dashboard resources, the six insight panels that always rendered nothing, the KG component of the score breakdown, and the seed script. Two codegen sites named the removed models by string rather than type, so they failed at generate time rather than compile time; both are updated.
kevinhermawan
force-pushed
the
feat/remove-knowledge-graph
branch
from
July 28, 2026 09:38
44c5f98 to
e874daa
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.
What changed
The knowledge graph had no writer. Nothing in the codebase created an
Entity, anEntityRelationor anArticleEntityoutside a manual dashboard form, and the article-analysis agent never sent entities at all. Every reader therefore read empty, and the dashboard exposed four tables an operator could only fill in by hand.#1060 moved the two readers that mattered — article-analysis relevance gating and content-generation competitor context — onto
TickerProfile. This removes what is left.Removed
Nine models:
Entity,EntityAlias,EntityType,RelationType,TickerEntity,EntityRelation,EntityEvidence,EntityRelationEvidence,ArticleEntity. Two enums that become orphaned with them,SentimentandTickerEntitySource—FeedbackSentimentis a different enum and stays.Four dashboard resources and their registry entries. The
seed-kg-vocabularyscript and its package script.Six article-analysis insight panels that read those tables: Entity mentions, With entities, Relations extracted, Top entities, Entity sentiment, and the relation-extraction timeline and type breakdown. The
kgRelationscoring component went with them, so Score composition now renders four slices instead of five.Notes for review
Two sites referenced the removed models as strings, not types. They fail at
generatetime rather than compile time, so a typecheck alone would not have caught them: thePRISMA_WRITE_METADATA_MODEL_NAMESallowlist driving dashboard write-body codegen, and the Prisma-enum-to-Zod map. Both updated.Verification
Full
pnpm code-qualitypasses: 108/108 tasks, lint, typecheck, tests and Prettier across the workspace.The migration drops nine tables and is not reversible. It is written and applied locally; applying it to production is a separate deploy decision.
Related issues: Closes #1059