feat(spaces): implement Phase 0-1 of Information Space Service
Phase 0 - Project Organization: - Create docs/PROJECT_STRUCTURE.md documenting codebase layout - Create markitect/core/ with parser, serializer, document_manager, workspace - Create markitect/schema/ consolidating 6 schema_*.py modules - Create markitect/storage/ with database module - Maintain backward compatibility via re-exports from original locations - Add docs/roadmap/information-space-service/ with README and WORKPLAN Phase 1 - Foundation (Weeks 1-3): - Week 1: Core domain models (InformationSpace, SpaceDocument, SpaceConfig, SpaceMetadata, SpaceVariable, TransclusionReference, SpaceStatus) - Week 2: Repository layer with interfaces (ISpaceRepository, IDocumentAssociationRepository, IVariableRepository, IReferenceRepository) and SQLite implementations with foreign key cascade deletes - Week 3: SpaceService orchestration layer with full CRUD, document, variable, and reference tracking operations Test coverage: 124 tests (25 model + 63 repository + 36 integration) Capabilities delivered: - CAP-001: InformationSpace entity with lifecycle management - CAP-002: SpaceRepository CRUD with SQLite backing - CAP-003: Document-Space associations with path-based organization - CAP-004: Space metadata and configuration schemas - CAP-005: Database schema with migrations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
76
markitect/spaces/__init__.py
Normal file
76
markitect/spaces/__init__.py
Normal file
@@ -0,0 +1,76 @@
|
||||
"""
|
||||
Information Spaces package for MarkiTect.
|
||||
|
||||
This package provides the Information Space abstraction, enabling:
|
||||
- First-class space entities with identity, metadata, and lifecycle
|
||||
- Event-driven change tracking and notifications
|
||||
- Persistent transclusion context with cross-space references
|
||||
- HTML rendering with caching and theme support
|
||||
- Bidirectional directory synchronization
|
||||
- Composable space hierarchies
|
||||
|
||||
Package Structure:
|
||||
- models: Core domain models (InformationSpace, SpaceDocument, SpaceConfig)
|
||||
- events: Event system (SpaceEvent, EventBus, handlers)
|
||||
- repositories: Data access layer (ISpaceRepository, SqliteSpaceRepository)
|
||||
- transclusion: Persistent transclusion context and reference tracking
|
||||
- rendering: Space rendering (HTML, themes)
|
||||
- sync: Directory synchronization (export, import, bidirectional)
|
||||
- services: Business logic (SpaceService)
|
||||
- history: Optional git-based version control
|
||||
|
||||
Usage:
|
||||
from markitect.spaces import SpaceService, InformationSpace
|
||||
|
||||
service = SpaceService()
|
||||
space = await service.create_space("my-docs")
|
||||
await service.add_document(space, "/intro.md", content="# Intro")
|
||||
await service.render(space, output_dir="./html/")
|
||||
"""
|
||||
|
||||
# Phase 1: Foundation
|
||||
from .models import (
|
||||
InformationSpace,
|
||||
SpaceDocument,
|
||||
SpaceConfig,
|
||||
SpaceMetadata,
|
||||
SpaceVariable,
|
||||
TransclusionReference,
|
||||
SpaceStatus,
|
||||
)
|
||||
from .services import SpaceService
|
||||
from .repositories import (
|
||||
ISpaceRepository,
|
||||
IDocumentAssociationRepository,
|
||||
IVariableRepository,
|
||||
IReferenceRepository,
|
||||
SqliteSpaceRepository,
|
||||
SqliteDocumentRepository,
|
||||
SqliteVariableRepository,
|
||||
SqliteReferenceRepository,
|
||||
initialize_space_tables,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Models
|
||||
"InformationSpace",
|
||||
"SpaceDocument",
|
||||
"SpaceConfig",
|
||||
"SpaceMetadata",
|
||||
"SpaceVariable",
|
||||
"TransclusionReference",
|
||||
"SpaceStatus",
|
||||
# Services
|
||||
"SpaceService",
|
||||
# Repository Interfaces
|
||||
"ISpaceRepository",
|
||||
"IDocumentAssociationRepository",
|
||||
"IVariableRepository",
|
||||
"IReferenceRepository",
|
||||
# SQLite Implementations
|
||||
"SqliteSpaceRepository",
|
||||
"SqliteDocumentRepository",
|
||||
"SqliteVariableRepository",
|
||||
"SqliteReferenceRepository",
|
||||
"initialize_space_tables",
|
||||
]
|
||||
Reference in New Issue
Block a user