Summary
The nodeBook parser (cnl-parser.ts), operations pipeline (operations-to-graph.ts), and renderer (nodebook-graph.tsx) currently have no unit test coverage. Adding tests is critical before building new features on top of the existing infrastructure.
Test Coverage Needed
Parser (cnl-parser.ts)
- Heading parsing:
# Name [Type], # **adj** Name [Type], simple headings
- Relation parsing:
<relation> target;, multi-target, weighted arcs
- Attribute parsing: values with
*unit*, *quantifier*, ++adverb++, [modality]
- Mindmap parsing:
# Topic <relation> + - item bullets
- Accounting relations:
<debit> → has post_state, <credit> → has prior_state
- Currency directive:
currency: USD;
- Edge cases: empty input, malformed headings, missing semicolons
Operations Pipeline (operations-to-graph.ts)
- Three-pass processing: nodes → morphs → edges/attributes
- Morph creation and linkage
- Duplicate node deduplication
- Graph mode detection (mindmap / petri-net / concept-map)
Renderer (nodebook-graph.tsx)
- Snapshot tests for Cytoscape element generation per mode
- Token simulation: initial marking, firing rules, deadlock detection
- Accounting mode: balance computation, equation display, auto-fire
Schema Validation (validate-operations.ts)
- Valid/invalid node types, relation types, attribute types
- User schema overrides via
nodeBook-schema
Documentation
- Write tutorials for each graph mode (see sibling issues)
- Document CNL syntax extensions beyond the cheatsheet
- Architecture guide for contributors
Priority
High — prerequisite for safe feature development.
Summary
The nodeBook parser (
cnl-parser.ts), operations pipeline (operations-to-graph.ts), and renderer (nodebook-graph.tsx) currently have no unit test coverage. Adding tests is critical before building new features on top of the existing infrastructure.Test Coverage Needed
Parser (
cnl-parser.ts)# Name [Type],# **adj** Name [Type], simple headings<relation> target;, multi-target, weighted arcs*unit*,*quantifier*,++adverb++,[modality]# Topic <relation>+- itembullets<debit>→has post_state,<credit>→has prior_statecurrency: USD;Operations Pipeline (
operations-to-graph.ts)Renderer (
nodebook-graph.tsx)Schema Validation (
validate-operations.ts)nodeBook-schemaDocumentation
Priority
High — prerequisite for safe feature development.