OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

knowledge-graph: skill recommends `module` but the bundled viewer cannot style it (silently folded into `other`)

Open devstar-korea opened this issue 3 months ago • 0 comments

The knowledge-graph compile skill and its bundled visualization script disagree about the entity_type vocabulary in three separate places. Authors who follow the skill literally get nodes that silently lose their colour, shape, and type-filter entry — no error, no warning, exit 0.

I checked every file in this repo that mentions entity_type (there are four) plus both graph-show scripts, and could not find a supported way to extend the palette — hence this report rather than a config change on my side.

1. The skill recommends a type the viewer cannot style

examples/compile/ov-compile-skills/knowledge-graph/SKILL.md (Entity nodes):

Choose a stable lowercase snake_case value such as person, organization, group, animal, place, product, project, system, service, module, dataset, standard, document, artifact, or event.

examples/compile/graph-show/knowledge-graph/knowledge_graph.py defines _TYPE_STYLE with 15 keys — but not the same 15:

skill body − _TYPE_STYLE = {module}    # recommended, unstylable
_TYPE_STYLE − skill body = {other}     # the fallback bucket

module is not in _TYPE_ALIASES either, so it takes the fallback path in _normalize_entity_type():

normalized = _TYPE_ALIASES.get(normalized, normalized)
return normalized if normalized in _TYPE_STYLE else "other"

2. The same SKILL.md states the vocabulary twice, with different membership

The frontmatter description enumerates 12 kinds; the body enumerates 15:

body − description = {dataset, module, standard}
description − body = {}

So module, dataset, and standard are recommended in the body but absent from the description that agents see first.

3. Two statements in the skill are hard to satisfy together

  • Display contract: "Use entity_type for node shape, color, grouping, and filtering." The bundled viewer does not honour this for module.
  • Quality check: "every node has a supported entity_type". If "supported" means "supported by the visualization", then following the skill's own recommended list can fail the skill's own quality gate, and nothing surfaces it.

Why it is easy to miss

The collapse happens inside load_entities() — before build_graph() and render_html(). The page still renders, the loader exits 0, and the legend looks internally consistent. The only symptom is that a recommended type is folded into grey other.

Reproduce

  1. Author a graph with entities declaring entity_type: module, per the skill.
  2. Run knowledge_graph.py on the output directory.
  3. Those nodes render grey under the other legend entry; no diagnostic is emitted.

No supported workaround that I can find

knowledge_graph.py accepts three CLI arguments (path, -o/--output, --title), reads no environment variables and no config file (os is used only for the atomic write), and exposes no hook to extend _TYPE_STYLE. The sibling llm-wiki/wiki_graph.py does read OPENVIKING_* and ovcli.conf, but only for connection settings — its _CATEGORY_STYLE is hardcoded too. So the palette is closed by design in both scripts.

Possible fixes

  • Add a module entry to _TYPE_STYLE, or map it in _TYPE_ALIASES; and align the SKILL.md description list with its body list.
  • Independently of module: emit a warning when a declared type falls back to other. The skill explicitly permits narrower types ("introduce a narrower type only when it materially improves filtering or visualization"), so today every such type degrades silently — which makes that permission hard to act on.
  • Optionally, let the script take a small JSON style map so narrower vocabularies can be visualized without patching the example.

Checked against knowledge_graph.py at blob ec9676c42c210fd165046720299d2741241a7adf.

devstar-korea avatar Aug 28 '26 06:08 devstar-korea