Skip to content

feat: add lat.md support to the codebase#279

Merged
vinitkumar merged 5 commits intomasterfrom
feat/lat-md
Apr 3, 2026
Merged

feat: add lat.md support to the codebase#279
vinitkumar merged 5 commits intomasterfrom
feat/lat-md

Conversation

@vinitkumar
Copy link
Copy Markdown
Owner

@vinitkumar vinitkumar commented Apr 3, 2026

Summary by Sourcery

Introduce lat.md-based architecture, behavior, and test documentation and link key code paths and tests to the new knowledge graph.

Enhancements:

  • Annotate core conversion, CLI, backend selection, and input reader functions with @lat code references into the architecture and behavior docs.

Documentation:

  • Add lat.md knowledge graph with architecture, behavior, and tests specifications, plus contributor guidance in AGENTS.md for using lat.md tooling.

Tests:

  • Document critical CLI input precedence and conversion behavior tests in lat.md and link them to their corresponding test cases with @lat comments.

Chores:

  • Update repository hygiene docs to describe ignored local agent/editor state and how it relates to lat.md usage.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 3, 2026

Reviewer's Guide

Adds initial lat.md knowledge graph documentation (architecture, behavior, tests, and repo hygiene) and wires key code paths and tests to those docs via @lat comments, without changing runtime behavior.

Sequence diagram for Json2xml.to_xml conversion and validation behavior

sequenceDiagram
    actor Caller
    participant Json2xml as Json2xml.to_xml
    participant Dicttoxml as dicttoxml.dicttoxml
    participant XPath as convert_to_xpath31
    participant Minidom as defusedxml.minidom.parseString

    Caller->>Json2xml: to_xml(data, options)
    alt xpath_format enabled
        Json2xml->>Dicttoxml: dicttoxml(obj, xpath_format=True, options)
        Dicttoxml->>XPath: convert_to_xpath31(obj)
        XPath-->>Dicttoxml: xpath_xml_bytes
        Dicttoxml-->>Json2xml: xml_bytes
    else standard format
        Json2xml->>Dicttoxml: dicttoxml(obj, xpath_format=False, options)
        Dicttoxml-->>Json2xml: xml_bytes
    end

    alt pretty output enabled
        Json2xml->>Minidom: parseString(xml_bytes)
        alt xml is well formed
            Minidom-->>Json2xml: dom_document
            Json2xml-->>Caller: pretty_xml_string
        else xml is invalid
            Minidom-->>Json2xml: parse error
            Json2xml-->>Caller: raise InvalidDataError
        end
    else raw output
        Json2xml-->>Caller: xml_bytes
    end
Loading

File-Level Changes

Change Details Files
Introduce lat.md knowledge graph documents describing architecture, behavior, and key tests, plus usage guidelines for agents.
  • Add AGENTS.md with required workflow for maintaining lat.md docs and running lat CLI commands
  • Create lat.md/lat.md as the entrypoint that explains the knowledge graph layout, semantic search requirements, and ignored local tooling directories
  • Add lat.md/architecture.md documenting the core pipeline, conversion engine, backend selection, and CLI entrypoint, with links into existing Python modules
  • Add lat.md/behavior.md defining observable input, conversion-output, XPath format, and invalid-payload behavior, tied to concrete functions
  • Add lat.md/tests.md specifying a small, high-signal set of CLI and conversion behavior tests and enabling require-code-mention validation
AGENTS.md
lat.md/lat.md
lat.md/architecture.md
lat.md/behavior.md
lat.md/tests.md
Annotate core library, CLI, serializer, utils, and tests with @lat comments that tie code to the new knowledge graph sections.
  • Tag Json2xml class and its to_xml method with architecture and behavior sections describing the core pipeline and XML-output/validation behavior
  • Tag CLI create_parser and read_input with architecture and behavior sections for the CLI entrypoint and input readers
  • Tag dicttoxml and convert_to_xpath31 with architecture and behavior sections for the conversion engine and XPath 3.1 format
  • Tag dicttoxml_fast.dicttoxml with a backend-selection architecture section
  • Tag readfromjson with an input-readers behavior section
  • Tag selected tests in test_cli.py, test_dict2xml.py, and test_json2xml.py with tests sections for CLI input precedence, stdin dash handling, item-wrap behavior, and XPath namespace emission
json2xml/json2xml.py
json2xml/cli.py
json2xml/dicttoxml.py
json2xml/dicttoxml_fast.py
json2xml/utils.py
tests/test_cli.py
tests/test_dict2xml.py
tests/test_json2xml.py
Repository hygiene and tooling alignment for lat.md usage.
  • Update .gitignore to ensure local agent/editor directories such as .codex, .pi, and .cursor are ignored in line with AGENTS.md guidance
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.92%. Comparing base (b7a8095) to head (8e0b79f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
+ Coverage   95.89%   95.92%   +0.02%     
==========================================
  Files           5        5              
  Lines         463      466       +3     
==========================================
+ Hits          444      447       +3     
  Misses         19       19              
Flag Coverage Δ
unittests 95.92% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vinitkumar vinitkumar merged commit cc80191 into master Apr 3, 2026
48 checks passed
@vinitkumar vinitkumar deleted the feat/lat-md branch April 3, 2026 13:58
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.

1 participant