Commit 9879f59
committed
Implement full XML-Lifecycle Validator & Publisher stack
This comprehensive implementation adds enterprise-grade validation,
publishing, and governance capabilities to xml-lib:
## Core Features
### Validation Engine
- Relax NG + Schematron validation for lifecycle phases
(begin → start → iteration → end → continuum)
- Cross-file constraints: ID uniqueness, reference integrity
- Temporal monotonicity validation (timestamps must increase)
- SHA-256 checksum validation and verification
### Guardrail Rule Engine
- Compiles XML guardrails into executable checks
- Full provenance tracking (author, timestamp, rationale)
- Multiple constraint types: XPath, regex, checksum, temporal, cross-file
- Priority levels: critical, high, medium, low
- Example guardrails in /guardrails/lifecycle-integrity.xml
### Assertion Ledger
- Cryptographically signed validation results (RSA-PSS-SHA256)
- XML output with public key and signature
- JSON Lines format for CI/CD integration
- Tamper-evident audit trail
### Content-Addressed Storage
- Deterministic UUID v5 generation
- SHA-256 content addressing in /store/sha256/
- Automatic deduplication
- Idempotent operations
### XSLT 3.0 Publisher
- Transforms XML to HTML documentation
- Automatic index page generation
- Default stylesheet with responsive design
- Customizable XSLT templates
### OOXML Composer
- Generates PowerPoint presentations from XML
- Slide masters and layouts
- Automatic citation tracking
- Template support
### Telemetry Sink
- Pluggable backends: file, SQLite, PostgreSQL
- Captures validation runs with duration and pass/fail metrics
- Aggregation for heatmaps and performance analysis
- JSON Lines format for easy parsing
### Schema-Aware Differ
- Structural XML comparison
- Semantic explanations of differences
- Lifecycle-aware diff symbols
- Attribute, element, and content tracking
## CLI Commands
- `xml-lib validate` - Validate XML documents
- `xml-lib publish` - Generate HTML documentation
- `xml-lib render-pptx` - Create PowerPoint presentations
- `xml-lib diff --explain` - Compare documents with explanations
## Testing
- Golden tests with valid/invalid fixtures
- Property-based tests for idempotence (Hypothesis)
- Unit tests for all components
- Test coverage infrastructure
## CI/CD
- GitHub Actions workflow (lint, typecheck, test)
- Makefile with dev, test, and publish targets
- Artifact upload for validation results and docs
- Multi-version Python testing (3.9, 3.10, 3.11)
## Documentation
- Comprehensive README with 15-minute quickstart
- ARTIFACTS.md with schemas, operators, CLI contracts, benchmarks
- Example guardrails with provenance
- Test fixtures demonstrating valid and invalid cases
## Architecture
All code follows clean architecture principles:
- Separated concerns (validator, publisher, storage, etc.)
- Type hints throughout
- Pluggable backends (telemetry)
- Extensible schema system
The implementation preserves all existing XML lifecycle examples
and documentation while adding a complete validation and publishing
stack that can be used standalone or integrated into CI/CD pipelines.1 parent e7c6d95 commit 9879f59
File tree
31 files changed
+4813
-15
lines changed- .github/workflows
- cli/xml_lib
- guardrails
- schemas
- tests
- fixtures
31 files changed
+4813
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
0 commit comments