An advanced markdown engine
Find a file
tegwick 14108533fb feat: implement schema filename validation (Phase 1 complete)
Implements filename convention enforcement for schema files as part of
the schema-of-schemas implementation. All schemas must now follow the
naming pattern: {domain}-schema-v{major}.{minor}.md

## Phase 1 Deliverables

### Schema Naming Module
**File:** `markitect/schema_naming.py` (380 lines)

**Functions:**
- `validate_schema_filename()` - Validate filename against pattern
- `suggest_schema_filename()` - Generate valid filename from domain/version
- `extract_schema_metadata()` - Extract domain and version from filename
- `get_validation_errors()` - Detailed error messages for invalid filenames
- `is_valid_schema_filename()` - Simple boolean validation
- `format_validation_message()` - User-friendly error formatting

**Features:**
- Regex-based pattern matching
- Automatic normalization (spaces → hyphens, lowercase)
- Detailed error reporting
- Domain validation (must start with letter)
- Version validation (major.minor format)

### Comprehensive Test Suite
**File:** `tests/test_schema_naming.py` (500+ lines, 50 tests)

**Test Coverage:**
-  Valid filename variations (simple, hyphenated, with numbers)
-  Invalid filenames (wrong extension, missing components, wrong case)
-  Filename suggestion with normalization
-  Metadata extraction
-  Error message generation
-  Edge cases (long names, many hyphens, large versions)
-  Pattern regex validation

**Results:** 50/50 tests passing (100%)

### Specification Document
**File:** `roadmap/schema-of-schemas/SCHEMA_NAMING_SPEC.md`

**Contents:**
- Formal specification of naming convention
- Regular expression pattern with explanation
- Valid and invalid examples
- Version numbering guidelines
- Domain naming best practices
- Normalization rules
- Migration strategy from legacy naming
- Implementation guide

## Naming Convention

### Format
```
{domain}-schema-v{major}.{minor}.md
```

### Examples
```
✓ manpage-schema-v1.0.md
✓ api-documentation-schema-v1.0.md
✓ terminology-schema-v1.0.md
✓ arc42-schema-v2.1.md

✗ manpage.json (wrong extension)
✗ ManPage-schema-v1.0.md (uppercase)
✗ manpage-v1.0.md (missing 'schema')
✗ manpage-schema-v1.md (missing minor version)
```

### Components
- **domain**: Lowercase, hyphen-separated, starts with letter
- **schema**: Literal keyword
- **version**: v{major}.{minor} (SemVer simplified)
- **extension**: .md (markdown)

## Implementation Highlights

### Automatic Normalization
```python
suggest_schema_filename("API Documentation", "2.1")
# → "api-documentation-schema-v2.1.md"

suggest_schema_filename("My_Custom Type", "1.0")
# → "my-custom-type-schema-v1.0.md"
```

### Detailed Error Reporting
```python
format_validation_message("invalid.json")
# → Detailed error list + suggested fix
```

### Metadata Extraction
```python
extract_schema_metadata("manpage-schema-v1.0.md")
# → {'domain': 'manpage', 'version': '1.0', 'major': 1, 'minor': 0}
```

## Migration Plan

Current schemas will be renamed:
```
Old                           → New
────────────────────────────────────────────────────────
terminology-schema.json       → terminology-schema-v1.0.md
api-documentation             → api-documentation-schema-v1.0.md
enhanced-manpage              → manpage-schema-v2.0.md
markdown-manpage              → DELETE (duplicate)
markdown-manpage-schema.json  → DELETE (duplicate)
```

## Phase 1 Status:  COMPLETE

### Completed
- [x] Schema naming module implementation
- [x] Comprehensive test suite (50 tests, 100% passing)
- [x] Specification document
- [x] TODO.md updated

### Next: Phase 2
- [ ] Update CLI schema-ingest with validation
- [ ] Implement markdown schema loader
- [ ] Parse frontmatter and JSON code blocks
- [ ] Update SchemaValidator for .md support

## Testing

```bash
# Run tests
pytest tests/test_schema_naming.py -v
# → 50 passed in 0.48s

# Test interactively
python -c "
from markitect.schema_naming import validate_schema_filename
print(validate_schema_filename('manpage-schema-v1.0.md'))
"
# → (True, {'domain': 'manpage', 'version': '1.0', ...})
```

## Files Changed

- markitect/schema_naming.py (NEW, 380 lines)
- tests/test_schema_naming.py (NEW, 500+ lines)
- roadmap/schema-of-schemas/SCHEMA_NAMING_SPEC.md (NEW)
- TODO.md (updated progress tracking)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-04 23:51:29 +01:00
.claude agent: improved capability integration 2025-12-17 19:38:06 +01:00
.github/workflows feat: Implement comprehensive Testing Architecture Enhancement 2025-09-26 22:36:35 +02:00
.issues feat: Integrate Requirements Engineering Agent and fix Issue #59 test failures 2025-10-02 00:45:06 +02:00
.venv_old chore: Keep old venv from ubuntu 18.04 for now just in case. 2025-09-23 01:16:12 +02:00
_issue-tracking chore: follow subrepo 2025-12-17 23:08:02 +01:00
agents feat: implement modular capability system with automatic discovery 2025-11-09 01:29:15 +01:00
application feat: Implement domain logic separation with clean architecture 2025-09-26 22:15:45 +02:00
assets fix: exclude assets.db from version control 2025-11-10 12:14:12 +01:00
capabilities chore: detach issue-facade capability for reorganization 2025-12-17 22:27:36 +01:00
config feat: Implement unified configuration management system 2025-09-26 17:45:56 +02:00
cost_notes feat: add Reset All button to EditControl panel 2025-11-14 15:25:29 +01:00
docs docs: add comprehensive Phase 2 documentation and mark completion 2026-01-04 21:35:24 +01:00
domain fix: Eliminate all 111 test warnings by fixing root causes 2025-09-27 20:14:22 +02:00
examples chore: establish schema-of-schemas workplan and reorganize roadmap 2026-01-04 23:47:02 +01:00
guides chore: history cleanup 2025-10-03 03:39:43 +02:00
history docs: add comprehensive architecture assessment and fix dependencies 2025-12-16 00:27:32 +01:00
infrastructure refactor: remove obsolete issue management system in favor of issue-facade 2025-10-24 21:25:04 +02:00
issue_tracker/cli feat: complete issue-facade capability enhancement and project cleanup 2025-11-10 10:53:37 +01:00
markitect feat: implement schema filename validation (Phase 1 complete) 2026-01-04 23:51:29 +01:00
node_modules refactor: Still trying to reorganize edit mode to be more robust 2025-11-04 21:59:22 +01:00
reports feat: complete Issue #146 - Asset Management Implementation Milestone 2025-10-14 18:29:37 +02:00
roadmap feat: implement schema filename validation (Phase 1 complete) 2026-01-04 23:51:29 +01:00
scripts feat: implement modular capability system with automatic discovery 2025-11-09 01:29:15 +01:00
services refactor: remove obsolete issue management system in favor of issue-facade 2025-10-24 21:25:04 +02:00
src chore: update project state and prepare for image support development 2025-10-26 08:06:22 +01:00
testdata chore: history cleanup 2025-10-03 03:39:43 +02:00
tests feat: implement schema filename validation (Phase 1 complete) 2026-01-04 23:51:29 +01:00
tools feat: implement unified DocumentNavigator with lazy loading for all modes 2025-11-10 19:39:46 +01:00
wiki@8818df03d3 chore: commit examples and some cleanup 2025-10-08 10:14:51 +02:00
.clinerules feat: implement markitect installer with version/release commands (issue #80) 2025-10-03 05:47:02 +02:00
.gitignore fix: exclude assets.db from version control 2025-11-10 12:14:12 +01:00
.gitmodules feat: re-integrate issue-facade with family-based architecture 2025-12-17 22:36:02 +01:00
aliases.sh feat: implement plugin-based architecture with md- command prefixes - Issue #44 2025-10-06 16:46:26 +02:00
asset_registry.json refactor: delegate version management to release-management capability 2025-11-09 10:41:28 +01:00
CHANGELOG.md chore: establish schema-of-schemas workplan and reorganize roadmap 2026-01-04 23:47:02 +01:00
demo_plugin_integration.py feat: implement plugin infrastructure for rendering engines 2025-11-14 06:49:41 +01:00
GUARDRAILS.md feat: implement unified DocumentNavigator with lazy loading for all modes 2025-11-10 19:39:46 +01:00
install feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
install.py feat: implement markitect installer with version/release commands (issue #80) 2025-10-03 05:47:02 +02:00
install.sh feat: implement markitect installer with version/release commands (issue #80) 2025-10-03 05:47:02 +02:00
Makefile refactor: clean up JavaScript development files and enhance automated testing 2025-11-09 23:16:47 +01:00
package-lock.json refactor: Still trying to reorganize edit mode to be more robust 2025-11-04 21:59:22 +01:00
package.json refactor: Still trying to reorganize edit mode to be more robust 2025-11-04 21:59:22 +01:00
pyproject.toml docs: add comprehensive architecture assessment and fix dependencies 2025-12-16 00:27:32 +01:00
pytest-timeout.ini feat: Implement test timeout infrastructure and fix failing tests 2025-10-01 18:07:05 +02:00
pytest.ini fix: eliminate all test suite warnings - Issue #129 2025-10-06 02:11:28 +02:00
test_asset_deployment.py feat: complete asset deployment for plugin engines 2025-11-14 09:20:37 +01:00
test_browser_ready.py fix: resolve JavaScript const redeclaration and MarkitectMain issues 2025-11-14 09:25:00 +01:00
test_cli_integration.py feat: complete CLI integration with plugin system 2025-11-14 08:47:30 +01:00
test_cli_plugin.md feat: complete CLI integration with plugin system 2025-11-14 08:47:30 +01:00
test_cli_simple.py feat: complete CLI integration with plugin system 2025-11-14 08:47:30 +01:00
test_cli_with_assets.py feat: complete asset deployment for plugin engines 2025-11-14 09:20:37 +01:00
test_complete_integration.py feat: complete CLI integration with plugin system 2025-11-14 08:47:30 +01:00
test_integration.md refactor: failed attempt at edit mode recovery and robustness implementation 2025-11-12 00:19:03 +01:00
test_plugin_discovery.py feat: complete CLI integration with plugin system 2025-11-14 08:47:30 +01:00
test_strict_mode.html refactor: failed attempt at edit mode recovery and robustness implementation 2025-11-12 00:19:03 +01:00
TODO.html feat: add Reset All button to EditControl panel 2025-11-14 15:25:29 +01:00
TODO.md feat: implement schema filename validation (Phase 1 complete) 2026-01-04 23:51:29 +01:00

MarkiTect Documentation

Welcome to the MarkiTect documentation. This directory contains comprehensive documentation for developers, users, and contributors.

Documentation Structure

📐 Architecture Documentation (architecture/)

Deep technical documentation about system design, performance, and implementation details.

  • Capabilities Architecture - Critical: How capabilities work as independent git submodules and separation of concerns
  • Caching System - Why and how MarkiTect's AST caching delivers 60-85% performance improvements
  • Coming soon: Database Schema, CLI Architecture

👥 User Guides (user-guides/)

End-user documentation for working with MarkiTect CLI and features.

  • Coming soon: Getting Started, Command Reference, Best Practices

🔧 Development Documentation (development/)

Documentation for contributors and developers extending MarkiTect.

  • Coming soon: Contributing Guide, Testing Strategy, Release Process

For Users

For Developers

Project Management

Key Concepts

Core Architecture Principles

  1. Parse Once, Use Many Times - AST caching for 60-85% performance improvement
  2. Convention Over Configuration - Sensible defaults with minimal setup
  3. Schema-Driven Processing - Structured markdown with validation
  4. Relational Metadata - Database-powered document relationships

Performance Philosophy

MarkiTect treats markdown documents as structured, queryable data rather than plain text. This approach enables:

  • Lightning-fast document processing through intelligent caching
  • Complex querying and relationship management
  • Schema validation and consistency enforcement
  • Scalable performance that grows with your content

Contributing to Documentation

Documentation follows the same quality standards as code:

  1. Clear Structure - Logical organization and navigation
  2. Practical Examples - Real-world usage patterns
  3. Performance Context - Why architectural decisions matter
  4. User-Focused - Written for the intended audience

Documentation Standards

  • Use clear, concise language
  • Include practical examples
  • Explain the "why" behind design decisions
  • Keep technical accuracy as the highest priority
  • Update docs when changing functionality

This documentation is maintained alongside the codebase. For the most current information, always refer to the latest version in the repository.