Skip to content

Remove the unused knowledge-graph tables and dashboard resources - #1061

Merged
kevinhermawan merged 1 commit into
mainfrom
feat/remove-knowledge-graph
Jul 28, 2026
Merged

Remove the unused knowledge-graph tables and dashboard resources#1061
kevinhermawan merged 1 commit into
mainfrom
feat/remove-knowledge-graph

Conversation

@kevinhermawan

Copy link
Copy Markdown
Contributor

Stacked on #1060. Review that first; this PR's diff is against it.

What changed

The knowledge graph had no writer. Nothing in the codebase created an Entity, an EntityRelation or an ArticleEntity outside 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, Sentiment and TickerEntitySourceFeedbackSentiment is a different enum and stays.

Four dashboard resources and their registry entries. The seed-kg-vocabulary script 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 kgRelation scoring 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 generate time rather than compile time, so a typecheck alone would not have caught them: the PRISMA_WRITE_METADATA_MODEL_NAMES allowlist driving dashboard write-body codegen, and the Prisma-enum-to-Zod map. Both updated.

Verification

Full pnpm code-quality passes: 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

Base automatically changed from feat/ticker-profile to main July 28, 2026 09:36
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
kevinhermawan force-pushed the feat/remove-knowledge-graph branch from 44c5f98 to e874daa Compare July 28, 2026 09:38
@kevinhermawan
kevinhermawan merged commit 1a46f30 into main Jul 28, 2026
24 checks passed
@kevinhermawan
kevinhermawan deleted the feat/remove-knowledge-graph branch July 28, 2026 09:47
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.

Remove the unused knowledge-graph tables and dashboard resources

2 participants