Implement comprehensive MarkiTect metaschema that extends standard JSON Schema with MarkiTect-specific features for document analysis and generation. 🎯 TDD8 Implementation Complete: - ISSUE: Analyzed existing schema system and requirements - TEST: 15 comprehensive tests covering all features - RED: Verified tests fail before implementation - GREEN: Implemented metaschema JSON and validation logic - REFACTOR: Clean, extensible validator architecture - DOCUMENT: Updated CLI help and comprehensive documentation - REFINE: 100% test success rate and CLI integration - PUBLISH: Ready for production use ✅ Key Features Implemented: - Heading text capture support (x-markitect-heading-text) - Content field instructions (x-markitect-content-instructions) - Outline structure representation (x-markitect-outline-mode/depth) - Backward compatibility with existing schemas - Validation rules for all new features - CLI integration in schema-ingest command 📁 Files Added: - markitect/metaschema.py - Validation logic and MetaschemaValidator - markitect/schemas/markitect-metaschema.json - Metaschema definition - Enhanced markitect/cli.py - Automatic metaschema validation 🧪 Testing: - 15 comprehensive tests (100% passing) - RED-GREEN-REFACTOR cycle validated - CLI integration tested and working - Backward compatibility verified 📋 Acceptance Criteria Met: ✅ Schema metaschema supports heading text capture ✅ Schema metaschema supports content field instructions ✅ Schema metaschema supports outline structure representation ✅ Schema metaschema is backward compatible with existing schemas ✅ Schema metaschema includes validation rules for new features ✅ Documentation explains the metaschema structure and usage 🔗 Foundation for Future Issues: - Issue #51: Outline mode schema generation - Issue #52: Heading text capture in schemas - Issue #54: Content instruction capabilities - Issue #55: Schema-based draft generation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.9 KiB
JSON
52 lines
1.9 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://markitect.io/schemas/markitect-metaschema.json",
|
|
"type": "object",
|
|
"title": "MarkiTect Extended JSON Schema Metaschema",
|
|
"description": "Metaschema for MarkiTect JSON schemas that extends standard JSON Schema with MarkiTect-specific features for document structure analysis and generation",
|
|
"allOf": [
|
|
{
|
|
"$ref": "http://json-schema.org/draft-07/schema#"
|
|
},
|
|
{
|
|
"properties": {
|
|
"x-markitect-heading-text": {
|
|
"type": "string",
|
|
"description": "Preserve actual heading text from source document for validation and template generation"
|
|
},
|
|
"x-markitect-content-instructions": {
|
|
"type": "string",
|
|
"description": "Instructions for content authors about what should go in this section"
|
|
},
|
|
"x-markitect-outline-mode": {
|
|
"type": "boolean",
|
|
"description": "Indicates if this schema was generated in outline mode, focusing on structural hierarchy"
|
|
},
|
|
"x-markitect-outline-depth": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Maximum heading depth captured in outline mode"
|
|
},
|
|
"x-markitect-instruction-type": {
|
|
"type": "string",
|
|
"enum": ["description", "example", "constraint", "template"],
|
|
"description": "Type of content instruction provided"
|
|
},
|
|
"x-markitect-generated-from": {
|
|
"type": "string",
|
|
"description": "Source file or document this schema was generated from"
|
|
},
|
|
"x-markitect-generation-mode": {
|
|
"type": "string",
|
|
"enum": ["outline", "full"],
|
|
"description": "Mode used to generate this schema"
|
|
}
|
|
},
|
|
"patternProperties": {
|
|
"^x-markitect-": {
|
|
"description": "MarkiTect extension properties"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
} |