Internal

Parser Pipeline

The parser reads a documents folder, recognizes document type by filename, and builds the reader document collection.

parserfilteringarchitecture

Main flow

The parser lives in lib/documentation-file.ts. It:

  1. resolves the documents folder from NEENJA_DOCUMENTS_DIR or NEENJA_DOCUMENTS_PATH, otherwise ${projectRoot}/.neenja
  2. scans the folder for recognized filenames
  3. parses documentation.md with the concept parser
  4. parses project-plan.md with the technical plan-section parser
  5. parses task-tree.yaml with the YAML task-tree parser
  6. applies public/private filtering only to documentation concepts
  7. groups documentation concepts by category, technical plan sections by area, and tasks by area
  8. derives task graph edges, root task IDs, child IDs, reverse dependency IDs, status summaries, and progress
  9. builds a DocumentCollection for routing, navbar switching, search, and rendering

Project plan parsing

The project-plan parser treats ## Plan: as the section boundary and ### as the detail-block boundary inside a section. It reads only ID, Area, and optional Summary as section metadata, so technical plans can use normal Markdown for lists, compact notes, examples, and longer implementation detail.

Summary is extracted into PlanSection.summary, while all non-metadata section text stays in Markdown content. Content before the first ### heading becomes section intro Markdown. Each ### detail block keeps its body as free-form Markdown.

Legacy path

NEENJA_DOCUMENTATION_PATH and CLI --file are supported for a single documentation file. When used, the reader builds a one-document collection with only the documentation document. If no folder documentation file exists, the reader can still fall back to the legacy root file ./neenja.knowledge.md.

Visibility defaults

  • NEENJA_DOCS_VISIBILITY=private means documentation keeps both public and private concepts, and the collection can include project-plan and task-tree documents.
  • NEENJA_DOCS_VISIBILITY=public means only public documentation concepts survive the final document model. Project-plan and task-tree documents are omitted before parsing.
  • When no explicit visibility flag is provided, dev mode defaults to the full set and production mode defaults to the public subset.