Skip to content

Fix XML closing tag typo in prompts.py and add structure validation to tests #9

@chigwell

Description

@chigwell

User Story
As a software developer,
I want to correct the XML tag typo in prompts.py
so that downstream systems can parse templates without failures.

Background
The malformed closing </nodes> tag in prompts.py violates XML syntax rules, specifically in the SYSTEM_PROMPT template. This error occurs in the final line of the prompt definition where <nodes> is incorrectly closed. Current unit tests in test_eknowledge.py validate node extraction logic but don't check XML structural integrity, leaving risk undetected. Downstream systems relying on well-formed XML (e.g., ontology visualizers) would fail to process outputs containing this error.

Acceptance Criteria

  • Modify eknowledge/prompts.py to replace </nodes> with </node> in the SYSTEM_PROMPT template
  • Verify through code review that no other XML tags in the file use incorrect closing syntax
  • Add XML structure validation to test_eknowledge.py:
    • Extract XML content from SYSTEM_PROMPT during test setup
    • Use Python's xml.etree.ElementTree to parse the template and confirm well-formedness
  • Confirm successful parsing in a downstream sandbox environment using patched SYSTEM_PROMPT

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions