Skip to content

feat(wiki): post-campaign knowledge extraction and visualization#271

Merged
mtoslalibu merged 2 commits into
AI-native-Systems-Research:mainfrom
susiejojo:feat/wiki-persistence
Jun 2, 2026
Merged

feat(wiki): post-campaign knowledge extraction and visualization#271
mtoslalibu merged 2 commits into
AI-native-Systems-Research:mainfrom
susiejojo:feat/wiki-persistence

Conversation

@susiejojo
Copy link
Copy Markdown
Contributor

Summary

  • Adds /post-campaign skill that extracts structured knowledge (dead-ends, frontiers, interactions, concepts, summaries) from a completed campaign and generates an interactive HTML visualization
  • Adds /visualize-campaign thin wrapper skill for re-rendering without re-extracting
  • Adds scripts/visualize_campaign.py (interactive HTML generator) and scripts/validate_concepts.py (graph integrity checker)
  • Adds docs/nous-wiki.md documenting usage, data model, and output schemas

No existing code is modified. All output goes to ~/.nous/wiki/.

Related

Closes #270
See Discussion #269 for the broader cross-campaign persistence strategy.

Test plan

  • Run /post-campaign on a completed campaign directory → verify all output files appear in ~/.nous/wiki/campaigns/<name>/
  • Run python scripts/validate_concepts.py on the generated concepts.json → exits 0
  • Run /visualize-campaign → HTML opens in browser with Iterations, Knowledge, Insights, Summary tabs
  • Run /post-campaign again on the same campaign → skips extraction (idempotent), only regenerates viz

🤖 Generated with Claude Code

Add skills and scripts for extracting structured knowledge from completed
campaigns and rendering interactive HTML visualizations.

Closes AI-native-Systems-Research#270

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mtoslalibu
Copy link
Copy Markdown
Collaborator

Hey, nice feature — the self-contained HTML approach is the right call and the skill prompt is well-structured. One bug to fix though:


Bug: Slug mismatch between Python and JavaScript will silently break the Knowledge tab

The Python function _make_kg_id and the inline JS slug generation use different algorithms to create node IDs:

  • Python keeps underscores and = signs, only replaces a specific set of characters (' ()/-.,':;")
  • JS replaces ALL non-[a-z0-9] characters with dashes

So for a node like "request_timeout_ms":

  • Python generates: concept-request_timeout_ms
  • JS generates: concept-request-timeout-ms

When you click a node in the Knowledge tab, the panel lookup compares the Python-generated d.id against a freshly-computed JS slug — they won't match, item is undefined, and the panel shows empty. This will hit any concept or parameter name with underscores or special characters, which is most of them in this domain.

Fix: Make one algorithm match the other — either update Python to use the same [^a-z0-9] regex as JS, or have JS use the same selective replacement as Python.


Minor: showConceptPanel duplication

The if (isKnowledge) / else branches have ~92 lines of nearly identical chip-rendering code. The only difference is the string 'knowledge' vs 'iterations' passed to openChipPanel. Worth extracting a small helper so the next edit doesn't accidentally update one branch and forget the other.


Everything else looks good — validate_concepts.py is correct, the prompt contract is justified, and no existing code is touched. Nice work!

- _make_kg_id now uses the same [^a-z0-9]+ regex as the JS side, fixing
  silent panel lookup failures for names with underscores or special chars
- Extract renderRelationshipChips() to deduplicate ~92 lines of identical
  chip-rendering between Knowledge and Iterations tab branches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@susiejojo
Copy link
Copy Markdown
Contributor Author

Fixed both in f9483cb:

  1. Slug mismatch_make_kg_id now uses re.sub(r"[^a-z0-9]+", "-", name.lower()), matching the JS regex exactly. Panel lookups will work for names with underscores, =, etc.

  2. Chip duplication — extracted renderRelationshipChips(d, item, viewContext) that both branches call. Net -51 lines.

@mtoslalibu mtoslalibu merged commit 8236302 into AI-native-Systems-Research:main Jun 2, 2026
1 check was pending
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.

Post-campaign knowledge extraction and visualization

2 participants