Documentation Build Validation
Scope
Build validation only: detect documentation build configuration, run applicable build targets, collect all errors and warnings, and categorize by severity.
Inputs
- Repository root.
Actions
Identify documentation root: Detect docs roots in this order:
docs/- Repository root, when both
conf.pyandMakefileexist doc/documentation/site/docs-src/
If still not found, perform a bounded search for
conf.py(max depth 4) and use its parent as the docs root.Detect build configuration: Check for the presence of:
conf.pyin the detected docs rootMakefilein the detected docs root- Optional:
.readthedocs.yamlin the detected docs root or at repository root
If Sphinx build artifacts are absent in the target repository, report "not applicable" in findings and exit cleanly.
Run build targets (when applicable):
cd <docs_root> # Use clean-doc when available, otherwise fall back to clean if make -n clean-doc 2>/dev/null; then make clean-doc else make clean fi make htmlRun additional checks for targets that exist. Check each target before running to avoid false failures:
# Check and run each target if available for target in spelling linkcheck lint-md vale woke pa11y; do if make -n $target 2>/dev/null; then make $target fi doneCapture output and handle failures: If any command fails:
- Capture the full error output from stderr and stdout
- Run
make clean-doc(ormake cleanifclean-docis unavailable) to reset build state - Retry the failed build command once
- If retry fails, STOP and report all captured errors
- Do not proceed to content analysis until build succeeds
Warnings must be collected and reported, but are not blocking unless the repository explicitly treats warnings as errors.
Categorize findings by severity:
- Errors: Build failures, broken links, missing files.
- Warnings: Deprecation notices, missing references, formatting issues.
- Info: Suggestions, minor notices.
Verify completion: Confirm the validation completed:
- Build targets were executed (or determined not applicable)
- Output was captured (errors and warnings)
- Findings were categorized by severity
State the completion status:
✓ Build validation complete: [N] errors, [M] warnings found- OR
✓ Build validation complete: No issues found - OR
✓ Build validation: Not applicable - Sphinx artifacts not detected
Constraints
- Do not approve documentation that fails the Sphinx build.
- Build docs locally to catch build warnings.
- Do not invent Makefile targets; only use targets confirmed to exist in the target repository.
Output
A build validation report listing all errors and warnings, categorized by severity. If Sphinx artifacts are not detected, report "Not applicable -- Sphinx artifacts not detected in target repo".