MVP Development Tasks (TDD Specification)
This document specifies the exact, step-by-step development tasks required to build the Universal Documentation Engine (UDE) MVP v1.0.
In alignment with our engineering standards, we strictly follow the Test-Driven Development (TDD) methodology. For every single task, development must proceed through the following lifecycle:
- RED Phase: Write failing unit tests checking the specified interfaces, inputs, and validation criteria.
- GREEN Phase: Implement the minimal functional code required to make the tests pass.
- REFACTOR Phase: Clean up, optimize, and modularize the implementation while ensuring the test suite remains 100% green.
🛠️ Task Group 1: Testing & CI/CD Infrastructure
TSK-INF-01 (Dependency & Testing Harness Initialization)
- Part 1: Implementation Guide:
- Initialize a Python project within the
engine/submodule directory using the Poetry package manager. - Create a standard
pyproject.tomlfile. - Add production dependencies:
pydantic>=2.0,jinja2,lxml(or use standardxml.etreewhere safe). - Add development dependencies:
pytest,pytest-cov,black,mypy. - Set up the basic directory structure:
ude/(source code root) andtests/(testing suite root).
- Initialize a Python project within the
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_harness.pyasserting thatudeis importable and thatude.__version__matches"0.1.0". Runpoetry run pytest(orpytest) to verify it fails due to the missing module. - TDD Green Phase: Create
ude/__init__.pydeclaring__version__ = "0.1.0". - Verification Command:
pytest --cov=ude tests/
- Expected Result: Tests pass with 100% coverage on
__init__.py.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest --cov=ude tests/
- Expected Result: pytest runs successfully, returning exit code 0, and showing 100% coverage for
__init__.py. - Manual Checks:
- Verify the presence of
pyproject.tomlinengine/containing all required production and development dependencies. - Verify that the standard directories
ude/andtests/are successfully created. - Confirm that
ude/__init__.pydefines__version__ = "0.1.0". - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify the presence of
- Verification Command:
TSK-INF-02 (Mock XML Asset Ingestion Harness)
- Part 1: Implementation Guide:
- Create a testing asset manager helper class
MockAssetLoaderintests/utils.py. - Set up a mock asset directory:
tests/assets/doxygen/. - Create mock XML files:
index.xml: Structure mapping a project namespaces catalog.class_definition.xml: Mock XML representing a C++ class with fields and public methods.
- Create a testing asset manager helper class
- Part 2: Verification Guide:
- TDD Red Phase: Write a unit test
tests/test_assets.pytrying to instantiateMockAssetLoader().load_xml("index.xml")and asserting that it returns an XML string. Verify it fails becausetests/utils.pydoes not exist. - TDD Green Phase: Implement
MockAssetLoaderintests/utils.pyusing standard file I/O to read fromtests/assets/doxygen/. - Verification Command:
pytest tests/test_assets.py
- Expected Result: Green assertions confirming that mock files are correctly located and loaded as string/binary.
- TDD Red Phase: Write a unit test
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_assets.py
- Expected Result: All unit tests in
test_assets.pypass cleanly. - Manual Checks:
- Confirm that
MockAssetLoaderis defined insidetests/utils.py. - Verify that physical mock files
index.xmlandclass_definition.xmlexist insidetests/assets/doxygen/. - Ensure that tests successfully read and load these mock files as XML strings.
- Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Confirm that
- Verification Command:
💾 Task Group 2: Intermediate Representation (IR) Schema & Storage
TSK-DAT-01 (Pydantic Model Schema Validation)
- Part 1: Implementation Guide:
- Create
ude/models.py. - Define the core Pydantic v2 schemas for representing the AST data catalog:
ProjectCatalog: Root catalog holding list of namespaces.NamespaceEntity: Represents namespaces, packages, or module structures.ClassEntity: Represents classes, interfaces, or structs. Holds name, namespace, docstring, methods, and fields.MethodEntity: Represents functions, member methods, constructors. Holds name, signature, parameters, return type, and normalized docstring.ParameterField: Holds name, type, and description.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_models.pydeclaring a complete mockProjectCatalogpayload with nested types, and asserting that instantiation succeeds. Write another test passing invalid datatypes (e.g., an integer forfully_qualified_name) and assert that aValidationErroris raised. Verify tests fail due to missing classes. - TDD Green Phase: Create the Pydantic classes inheriting from
pydantic.BaseModelinude/models.pywith strict type annotations. - Verification Command:
pytest tests/test_models.py
- Expected Result: Success on valid schemas and correct exceptions thrown on validation boundary violations.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_models.py
- Expected Result: All schema validation tests pass with green status.
- Manual Checks:
- Verify that Pydantic v2 schemas (
ProjectCatalog,NamespaceEntity,ClassEntity,MethodEntity,ParameterField) are defined inude/models.py. - Verify that schema models enforce strict types and successfully raise
ValidationErrorwhen passed invalid types. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that Pydantic v2 schemas (
- Verification Command:
TSK-DAT-02 (Gzip Storage & Transparent Compression)
- Part 1: Implementation Guide:
- Create
ude/storage.py. - Implement saving and loading helper functions:
save_compressed_ir(catalog: ProjectCatalog, file_path: str): Serializes the Pydantic catalog into JSON, compresses it using the nativegzipalgorithm, and writes it to disk with.json.gzextension.load_compressed_ir(file_path: str) -> ProjectCatalog: Reads a compressed file, decompresses on-the-fly, parses the JSON back into the typedProjectCatalogschema.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_storage.pyasserting that a sample catalog is written totests/scratch/temp_ir.json.gz, that the file on disk is binary/compressed, and that reading it back restores an identicalProjectCatalogobject. - TDD Green Phase: Implement
save_compressed_irandload_compressed_irusing standard Python modulesgzipandjson. - Verification Command:
pytest tests/test_storage.py
- Expected Result: Successful compression and decompression with 100% data fidelity.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_storage.py
- Expected Result: Tests pass successfully, demonstrating lossless compression/decompression.
- Manual Checks:
- Confirm that
save_compressed_irandload_compressed_irare implemented inude/storage.py. - Verify that the serialized IR file is physically compressed with a
.json.gzextension. - Confirm that reading the file back decompressses it and restores an identical Pydantic catalog object.
- Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Confirm that
- Verification Command:
TSK-DAT-03 (Two-Level Incremental Caching)
- Part 1: Implementation Guide:
- In
ude/storage.pyimplementBuildCacheManager, saving caching metadata to a compressed.build_cache.json.gzinside the target directory. - Level 1 (Parsing Cache): Store file paths, modification times (
mtime), content hashes, and serialized IR subtrees. Skip re-parsing of unchanged files. - Level 2 (Rendering Cache): Track output file content signatures and template hashes. Skip physical file writes if the generated contents haven't changed.
- In
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_caching.py. Assert that running parse/render phases sequentially twice yields zero XML parser calls and zero physical file writes on the second run. Verify it fails. - TDD Green Phase: Implement the
BuildCacheManagerand integrate cache lookups into parser and renderer. - Verification Command:
pytest tests/test_caching.py
- Expected Result: Fast incremental builds with zero repeated I/O operations for unmodified sources.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_caching.py
- Expected Result: Unit tests pass, proving that the incremental build cache behaves correctly.
- Manual Checks:
- Verify that
BuildCacheManageris defined insideude/storage.py. - Verify that running the compilation twice in succession with unchanged files results in 0 repeated XML parse calls or file writes.
- Confirm that cache metadata is stored inside a compressed
.build_cache.json.gzfile. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
🔌 Task Group 3: Modular Interfaces & Doxygen Ingestion
TSK-PAR-01 (Abstract Module & Interface Design)
- Part 1: Implementation Guide:
- Create
ude/interfaces.py. - Define
BaseParserandBaseRendereras Abstract Base Classes (ABCs) using Python'sabcmodule. BaseParsermust enforce an abstract method.parse(self, input_path: str) -> ProjectCatalog.BaseRenderermust enforce an abstract method.render(self, catalog: ProjectCatalog, output_path: str).- Define custom exceptions:
UdeException,ParserError,RendererError. - Implement traceability tracking: add structured docstrings referencing requirement IDs (e.g.,
Satisfies REQ-FUN-02).
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_interfaces.pyasserting that trying to instantiateBaseParser()orBaseRenderer()throwsTypeError. Assert that a dummy parser class that inherits fromBaseParserbut lacks a.parse()implementation fails to instantiate. Check docstrings forSatisfiesstrings. - TDD Green Phase: Implement abstract contracts and custom exceptions in
ude/interfaces.py. - Verification Command:
pytest tests/test_interfaces.py
- Expected Result: Interface safety checks pass, guaranteeing modular safety.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_interfaces.py
- Expected Result: All modular safety interface assertions pass.
- Manual Checks:
- Confirm that abstract base classes
BaseParser,BaseRenderer, and collector contracts exist inude/interfaces.py. - Check for custom exceptions:
UdeException,ParserError,RendererError. - Ensure docstrings have requirement mapping tags (e.g.,
Satisfies REQ-FUN-02). - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Confirm that abstract base classes
- Verification Command:
TSK-PAR-02 (Doxygen XML Ingestion & Extractors)
- Part 1: Implementation Guide:
- Create
ude/parsers/doxygen.pyinheriting fromBaseParser. - Implement parsing of the root Doxygen XML catalog (
index.xml) to extract the list of compound files. - Parse compound files to extract classes, namespaces, methods, fields, and docstring comments for C++, C#, Java, and Python to the unified IR schema.
- Support real C++ constructs: nested namespaces (separated by
::), constructors/destructors, template definitions, typedefs, compiler export macros (e.g.NWDBEXPORT), and SWIG wrapper filtration ifexclude_swig_internalsis active.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_doxygen_parser.pyasserting that feeding a mock C++ namespace compound XML returns aProjectCatalogpopulated with C++ classes, method signatures, parameters, and access scopes. Check that SWIG internal methods are ignored and export macros are stripped. - TDD Green Phase: Implement
DoxygenXmlParserusing Python'slxmlorxml.etreelibraries, traversing XML structures and mapping tags (e.g.<compounddef>,<memberdef>) to IR fields. - Verification Command:
pytest tests/test_doxygen_parser.py
- Expected Result: Accurate extraction of language-specific API structural metadata into unified schemas.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_doxygen_parser.py
- Expected Result: All parser unit tests pass with clean assertions.
- Manual Checks:
- Verify that
DoxygenXmlParseris implemented insideude/parsers/doxygen.py. - Confirm that C++, C#, Java, and Python compound definitions are successfully parsed.
- Verify that compiler-specific macros and SWIG wrapper internals are filtered out during ingestion.
- Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
TSK-PAR-03 (Multi-Language Parser Facade)
- Part 1: Implementation Guide:
- Subclass
DoxygenXmlParserfromBaseDoxygenParserto form a routing Facade pattern. - Dynamically instantiate and route parsing requests to concrete subclasses (e.g.,
CppDoxygenParser,CsharpDoxygenParser,JavaDoxygenParser,PythonDoxygenParser) based on the providedlanguageargument. - Support dynamic auto-detection of programming languages using path analysis if the language is unspecified.
- Maintain complete backward compatibility of import paths under
ude.parsers.doxygen.
- Subclass
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_parser_facade.pyasserting proper routing and fallback auto-detection. - TDD Green Phase: Implement routing facade and language detection.
- Verification Command:
pytest tests/test_parser_facade.py
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Expected Result: All facade assertions pass cleanly, routing parser jobs seamlessly.
- Manual Checks:
- Verify that
DoxygenXmlParserinherits fromBaseDoxygenParserto maintain LSP compliance. - Confirm dynamic language auto-detection via directory structures.
- Confirm backward-compatible imports under
ude.parsers.doxygen.
- Verify that
TSK-COL-01 (Preprocessing Environment & Doxygen Collectors)
- Part 1: Implementation Guide:
- Define
BaseCollectorinude/interfaces.pywith abstract methods:validate_environment(config_path),collect(config_path) -> Path, andcleanup(temp_path). - Implement
DoxygenXmlCollectorinude/collectors/doxygen.py. validate_environmentchecks Python, Doxygen paths, the presence ofDoxyfileand the target source directories.collectexecutes a Doxygen subprocess on-the-fly, generating temporary configuration profiles per-language and writing raw XML files to an isolated temporary directory.cleanupsafely and recursively deletes the temporary workspace. Add strong guard clauses (ValueError on empty, root, current or parent directory cleanups) to prevent accidental data deletion.
- Define
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_doxygen_collector.py. Assert that invalid cleanup directory inputs (like/,., parent paths) trigger aValueError. Verify it fails. - TDD Green Phase: Implement
DoxygenXmlCollectorwith strict path validation rules. - Verification Command:
pytest tests/test_doxygen_collector.py
- Expected Result: Successful pre-flight environment checks, secure subprocess invocations, and highly resilient/safe directory cleanup loops.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_doxygen_collector.py
- Expected Result: Collector environment validations, subprocess runs, and cleanup safety tests pass.
- Manual Checks:
- Verify that
DoxygenXmlCollectoris implemented insideude/collectors/doxygen.py. - Confirm that the
cleanupmethod includes safety checks raisingValueErroron empty, root, or parent folders. - Verify that Doxygen is executed as a subprocess inside
collect. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
📝 Task Group 4: Docstring Normalization & Ignore Filters
TSK-NML-01 (Comment Markup Normalizer)
- Part 1: Implementation Guide:
- Create
ude/normalizer.py. - Implement
CommentNormalizerto parse docstrings:- Convert different comment style markers (e.g., Javadoc
@param, Doxygen\param,@return,\return) into structured schemas. - Strips markers and transforms the rest of the text into standard CommonMark Markdown.
- Convert different comment style markers (e.g., Javadoc
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_normalizer.pypassing a Javadoc string containing@param count Number of objectsand@return booleanand assert that parameter names and descriptions are correctly isolated and mapped to metadata fields, leaving only clean Markdown prose in the description field. - TDD Green Phase: Implement the normalizer using regular expression substitution patterns and metadata dictionary builders.
- Verification Command:
pytest tests/test_normalizer.py
- Expected Result: Docstrings are decoupled from style, generating uniform CommonMark output.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_normalizer.py
- Expected Result: Docstring normalization tests pass cleanly.
- Manual Checks:
- Verify that
CommentNormalizeris defined insideude/normalizer.py. - Confirm that Javadoc and Doxygen tag formats are successfully converted into structured metadata.
- Confirm that the main comment text is stripped of tags and normalized to CommonMark markdown.
- Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
TSK-NML-02 (Ignore Tags & Range Exclusion Filters)
- Part 1: Implementation Guide:
- Extend
DoxygenXmlParserto handle exclusion comments:- Identify range exclusions: Skip all XML elements and code blocks situated between
DOM-IGNORE-BEGINandDOM-IGNORE-ENDcomments. - Identify conditional exclusions: Skip elements bounded by
\cond/@condand\endcond/@endcond. - Identify internal exclusions: Skip elements containing
\internalor@internaltags.
- Identify range exclusions: Skip all XML elements and code blocks situated between
- Extend
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_exclusions.pyfeeding a Doxygen XML string where one class contains the\internaltag and another class is placed betweenDOM-IGNORE-BEGINandDOM-IGNORE-ENDcomments. Assert that the resulting parsedProjectCatalogcontains zero reference to these classes. - TDD Green Phase: Implement filter checks within the parser loops that skip compound parsing when exclusion tags or active range flags are encountered.
- Verification Command:
pytest tests/test_exclusions.py
- Expected Result: Strict execution of exclusion policies, ensuring zero unapproved data leaks.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_exclusions.py
- Expected Result: Tag/range exclusion tests pass with 100% information isolation.
- Manual Checks:
- Verify that elements within
DOM-IGNORE-BEGIN...DOM-IGNORE-ENDblocks are excluded from parsing. - Verify that internal components marked with
\internalor\condare skipped from the final catalog. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that elements within
- Verification Command:
🎨 Task Group 5: Template-Based Rendering Engine
TSK-RND-01 (Jinja2 Markdown Compilation & Hugo Layouts)
- Part 1: Implementation Guide:
- Create
ude/renderers/hugo_markdown.pyinheriting fromBaseRenderer. - Configure a Jinja2 template loader to locate layout templates (e.g., Markdown layouts with front-matter blocks).
- Serialize
ProjectCatalogelements, injecting YAML/TOML metadata front-matter (such astitle,sidebar_position) at the top of each page file. - Automatically escape C++ template characters
< >in method/class declarations to prevent broken HTML outputs.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_hugo_renderer.pyinstantiatingHugoMarkdownRenderer, passing a valid catalog, and asserting that the written markdown starts with a valid YAML header containing correct keys and that the compiled body utilizes correct headings. Check template bracket escaping. - TDD Green Phase: Implement
HugoMarkdownRendererusing standardjinja2.Environmentcompiler structures. - Verification Command:
pytest tests/test_hugo_renderer.py
- Expected Result: Standardized and beautiful Hugo-compatible Markdown generated on disk.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_hugo_renderer.py
- Expected Result: Hugo rendering tests pass with green assertions.
- Manual Checks:
- Verify that
HugoMarkdownRendereris implemented insideude/renderers/hugo_markdown.py. - Confirm that the generated Markdown begins with a valid front-matter header containing
titleandsidebar_position. - Confirm that C++ template tags
< >are escaped during rendering to prevent web-layout breakage. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
TSK-RND-02 (Direct Static HTML Compilation)
- Part 1: Implementation Guide:
- Create
ude/renderers/static_html.pyinheriting fromBaseRenderer. - Write standalone HTML/CSS templates in Jinja2.
- Compile the intermediate representation catalog directly into an organized structure of local static HTML files.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write `tests/test_html_renderer.py asserting that rendering a mock catalog results in static HTML pages containing correct navigation headers, class detail links, and valid DOM elements.
- TDD Green Phase: Implement
HtmlRenderercompiling catalog objects directly to HTML layouts via Jinja2. - Verification Command:
pytest tests/test_html_renderer.py
- Expected Result: Compilation of direct offline-viewable static HTML pages.
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_html_renderer.py
- Expected Result: Direct static HTML rendering tests pass successfully.
- Manual Checks:
- Verify that
HtmlRendereris implemented insideude/renderers/static_html.py. - Confirm that the renderer outputs full static pages containing functional navigation links, CSS stylings, and lists.
- Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
TSK-RND-09 (Language-Specific Signature Formatting Strategy)
- Part 1: Implementation Guide:
- Implement an extensible Strategy Pattern via
BaseSignatureFormatterandget_signature_formatter(language). - Format names, scope delimiters (
::vs.), prefix syntax, templates, and fallback methods per target language.
- Implement an extensible Strategy Pattern via
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_signature_strategies.pyasserting correct delimiters and formatting per language. - TDD Green Phase: Implement signature strategies and integrate them.
- Verification Command:
pytest tests/test_signature_strategies.py
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Expected Result: Formatters output exact language-compliant declarations.
- Manual Checks:
- Verify that the formatter selection operates via
get_signature_formatter(language). - Verify that scope delimiters (
::for C++,.for other languages) are dynamically resolved.
- Verify that the formatter selection operates via
TSK-RND-10 (Robust Layout Template Loading & Inline Fallback)
- Part 1: Implementation Guide:
- Implement a fallback loader chain inside
HtmlRenderer: primary language layout, secondary root default layout, and fail-safe inline template string.
- Implement a fallback loader chain inside
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_template_fallbacks.pyasserting no crashes and successful inline loading when directories are missing. - TDD Green Phase: Implement fallback loader logic.
- Verification Command:
pytest tests/test_template_fallbacks.py
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Expected Result: Fault-tolerant layouts ensure error-free builds in all environment setups.
- Manual Checks:
- Verify physical template absence triggers fail-safe inline string loading.
- Confirm no crashing occurs during rendering if standard folders are missing.
🚀 Task Group 6: Automation & Integration Gates
TSK-CLI-01 (Non-Interactive CLI Core)
- Part 1: Implementation Guide:
- Create
ude/cli.pycontaining the main entry point logic. - Configure
argparseto parse:--config <file>(UDE config JSON).--input <dir>(Doxygen XML directory override).--format <hugo_markdown|html>(output rendering format override).--output <dir>(directory override for compiled files).
- Orchestrate relative path resolutions from the file path location of the configuration JSON.
- Ensure that any execution error catches standard exceptions, prints short diagnostics to stderr, and exits with code
1, while successful completion exits with code0.
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_cli.pysimulating standard sysargv inputs. Assert that passing invalid parameters raises aSystemExitexception with code1or2, and valid arguments exit with0. - TDD Green Phase: Implement arguments parsing and pipeline orchestration in
cli.py. - Verification Command:
pytest tests/test_cli.py
- Expected Result: Clean non-interactive automation compatibility with exit status validation.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_cli.py
- Expected Result: All CLI automation tests pass with green exit status.
- Manual Checks:
- Verify that
ude/cli.pyparses--config,--input,--output, and--formatusingargparse. - Confirm that relative paths are resolved relative to the configuration file's physical directory.
- Verify that the CLI exit codes are standard:
0for success, non-zero (e.g.,1) for errors. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command:
TSK-CLI-02 (End-to-End Pipeline & Coverage Verification)
- Part 1: Implementation Guide:
- Create a complete end-to-end integration test file
tests/test_integration_pipeline.py. - Load all mock files from
tests/assets/doxygen/, run the parser, write Gzip files, reload, compile to Hugo Markdown and HTML layouts, and verify structural files on disk. - Refactor and optimize test files across the engine until the aggregate test coverage reaches
>= 98%.
- Create a complete end-to-end integration test file
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_integration_pipeline.pyexecuting the entire pipeline flow and asserting compiled HTML structures. Run pytest-cov to check current coverage. - TDD Green Phase: Refactor parser helper routines, handle edge cases, and add coverage tests.
- Verification Command:
pytest --cov=ude tests/
- Expected Result: Complete green status across all E2E integration suites, and aggregate coverage calculated strictly
>= 98%.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest --cov=ude tests/
- Expected Result: Integration tests pass and overall test coverage report confirms >= 98% coverage.
- Manual Checks:
- Confirm that a complete integration pipeline test
tests/test_integration_pipeline.pyis present. - Verify that the overall code coverage of
ude/is calculated and strictly meets or exceeds98%. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Confirm that a complete integration pipeline test
- Verification Command:
TSK-CLI-03 (Centralized Multi-Target Orchestrator)
- Part 1: Implementation Guide:
- Create
ude/orchestrator.pyand implement theUdeOrchestratorclass. - Configure it to load the project configuration files (
ude_config.json) and dynamically resolve all configured relative paths (src_dir,output_dir) relative to the config file's physical directory rather than the process working directory (REQ-FUN-29). Hardcoding absolute physical paths in code is strictly prohibited. - Coordinate pipeline stages: instantiate the designated collector, parse the sources into Gzip-compressed IR, run the template renderer, and ensure resource cleanups are executed inside
finallyblocks. - Adhere to the global
error_policy(fail-fastorcontinue-on-error).
- Create
- Part 2: Verification Guide:
- TDD Red Phase: Write
tests/test_orchestrator.py. Assert that executing the pipeline from different CWD working paths yields identical, correctly resolved absolute paths to source XMLs and output pages. Verify it fails. - TDD Green Phase: Implement
UdeOrchestratorwith robust config-based path resolution. - Verification Command:
pytest tests/test_orchestrator.py
- Expected Result: Fully portable build orchestration with absolute path isolation and complete exception safety.
- TDD Red Phase: Write
- Part 3: User Acceptance Scenario:
- Verification Command:
cd enginepoetry run pytest tests/test_orchestrator.py
- Expected Result: Orchestrator portability and safety assertions pass cleanly.
- Manual Checks:
- Verify that
UdeOrchestratoris defined insideude/orchestrator.py. - Verify that the orchestrator resolves paths relative to the loaded config file, regardless of current working directory.
- Confirm that temporary file cleanup is always performed inside
finallyblocks during errors. - Verify that all file and directory paths are fully dynamic and portable (no absolute hardcoded developer paths).
- Verify that the central compliance registry at
design-docs/docs/srs/task_compliance.mdis updated to reflect task completion.
- Verify that
- Verification Command: