fix(web): render full document content, keep graph connected under categories
Two fixes to the new category taxonomy:
- Knowledge Base couldn't show a document/investigation/runbook's own
markdown body — knowledge_entities.content was never exposed by any
endpoint (GetEntityKnowledge answers "what knowledge references this
entity", not "what is this entity's content"). Add GET
/api/v1/knowledge/content/{id} and render it with the existing
marked+DOMPurify pipeline in a new Content section.
- The graph hid any edge whose other endpoint wasn't in the active
category, so nodes with only cross-category neighbors rendered as
disconnected dots. Queried the real relationship table: ~70% of infra
edges cross Fleet/Network/Services/Storage lines (compute+network+
software+storage+physical used to be one "infrastructure" layer).
EntityGraph now keeps 1-hop neighbors visible but dimmed instead of
hiding them, so the edges — and what they connect to — stay visible.
- categories.ts: `cognition` domain conflated true knowledge (document/
investigation/runbook, 58 entities) with operational telemetry
(execution/check/task/signal/approval/pattern/skill/classification/
feedback, 300+ entities with their own Operations/Signals/Learning
pages). Mapping the whole domain to Knowledge pulled in 245 execution
entities fanning out from ~17 compute nodes via `targets` edges — the
single biggest source of graph clutter. Knowledge now maps by type
(document/investigation/runbook only); the rest of cognition is
excluded from Knowledge Base browsing entirely.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -601,6 +601,23 @@ export async function fetchEntityKnowledge(entityId: string): Promise<KnowledgeH
|
||||
return data.items ?? []
|
||||
}
|
||||
|
||||
export interface KnowledgeContent {
|
||||
title: string
|
||||
content: string
|
||||
source: string
|
||||
tags: string[]
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
// Full markdown body for a document/investigation/runbook entity — distinct
|
||||
// from fetchEntityKnowledge, which returns knowledge that references OTHER
|
||||
// entities, not this entity's own content.
|
||||
export async function fetchKnowledgeContent(id: string): Promise<KnowledgeContent | null> {
|
||||
const res = await fetchWithAuth(`${API}/knowledge/content/${encodeURIComponent(id)}`)
|
||||
if (!res.ok) return null
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export async function fetchEntityEvents(entityId: string): Promise<import('./stores/events').OikosEvent[]> {
|
||||
const params = new URLSearchParams({ entity_id: entityId, limit: '50' })
|
||||
const res = await fetchWithAuth(`${API}/events?${params}`)
|
||||
|
||||
Reference in New Issue
Block a user