feat(prompts): implement Phase 6 - Incremental Execution (FR-7, FR-8)

Add change detection, structural diff-based impact analysis,
configurable-depth incremental recomputation with circular suppression,
and impact debt tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 13:18:27 +01:00
parent 9ce157400e
commit bd1d05ba79
13 changed files with 2446 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
"""
Incremental execution for prompt artifacts.
Implements FR-7: Incremental Recomputation
Implements FR-8: Impact Analysis
- FR-7.1: Change detection with persistent records
- FR-7.2: Configurable-depth incremental recomputation
- FR-8.1: Structural diff-based impact analysis
- FR-8.2: Impact threshold decisions
"""
from markitect.prompts.incremental.models import (
ChangeType,
ArtifactChange,
ImpactDebt,
RecomputeConfig,
RecomputeResult,
)
from markitect.prompts.incremental.detector import ChangeDetector
from markitect.prompts.incremental.metrics import (
structural_diff_ratio,
line_diff_ratio,
calculate_change_magnitude,
)
from markitect.prompts.incremental.impact import ImpactAnalyzer
from markitect.prompts.incremental.engine import IncrementalExecutionEngine
__all__ = [
# Models
"ChangeType",
"ArtifactChange",
"ImpactDebt",
"RecomputeConfig",
"RecomputeResult",
# Detector
"ChangeDetector",
# Metrics
"structural_diff_ratio",
"line_diff_ratio",
"calculate_change_magnitude",
# Impact
"ImpactAnalyzer",
# Engine
"IncrementalExecutionEngine",
]