Implements persistent transclusion context for Information Spaces: - ScopedVariables: Variable scope layers (request > document > space) - SpaceTransclusionContext: Extends TransclusionContext with DB persistence - CrossSpaceResolver: Resolve references across space boundaries - ReferenceGraph: Track document dependencies for cache invalidation - PersistentReferenceGraph: Repository-backed reference tracking - RenderCache: Cache rendered output with invalidation support - CacheInvalidator: Event-driven cache invalidation using reference graph Key features: - Variable precedence: request overrides document overrides space - Reference tracking during transclusion processing - Transitive dependent calculation for cache invalidation - Event bus integration for automatic invalidation on content changes 47 unit tests covering all components. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.0 KiB
Python
46 lines
1.0 KiB
Python
"""
|
|
Persistent transclusion context for Information Spaces.
|
|
|
|
This package extends the existing TransclusionContext with:
|
|
- Database persistence for context state
|
|
- Cross-space reference resolution
|
|
- Reference graph for dependency tracking
|
|
- Variable scope layers (space, document, request)
|
|
- Event-driven cache invalidation
|
|
"""
|
|
|
|
from .persistent_context import (
|
|
SpaceTransclusionContext,
|
|
ScopedVariables,
|
|
VariableScope,
|
|
CrossSpaceResolver,
|
|
)
|
|
from .reference_graph import (
|
|
ReferenceGraph,
|
|
PersistentReferenceGraph,
|
|
DependencyNode,
|
|
)
|
|
from .cache_invalidation import (
|
|
RenderCache,
|
|
CacheEntry,
|
|
CacheInvalidator,
|
|
create_invalidation_handler,
|
|
)
|
|
|
|
__all__ = [
|
|
# Persistent context
|
|
"SpaceTransclusionContext",
|
|
"ScopedVariables",
|
|
"VariableScope",
|
|
"CrossSpaceResolver",
|
|
# Reference graph
|
|
"ReferenceGraph",
|
|
"PersistentReferenceGraph",
|
|
"DependencyNode",
|
|
# Cache invalidation
|
|
"RenderCache",
|
|
"CacheEntry",
|
|
"CacheInvalidator",
|
|
"create_invalidation_handler",
|
|
]
|