tegwick
7b4bd461c9
feat(prompts): implement Phase 8 - Observability & Traceability (FR-11)
Complete implementation of Phase 8, the final phase of prompt dependency
resolution infrastructure, adding full observability and traceability.
## Features (FR-11)
### FR-11.1: Complete Artifact Provenance Tracing
- TraceabilityService: composition layer for full artifact lineage
- Trace any artifact to producing PromptTemplate, input artifacts,
generator runs, and quality validation results
- ProvenanceTrace model with complete dependency chain reconstruction
- RunSummary and ArtifactLineage models for structured trace output
### FR-11.2: Recomputation Query Infrastructure
- PromptQueryService: cross-service complex queries
- Run history queries with template and status filters
- Stale artifact detection via impact debt analysis
- Dependency graph statistics (nodes, edges, cycles, roots, leaves)
- Content-based artifact lookups by digest
### Visualization Support
- GraphExporter: DOT (Graphviz) and Mermaid format export
- Supports all edge types (requires, generates, includes)
- Handles isolated nodes, linear chains, diamonds, and complex graphs
### CLI Commands (prompt group)
- `prompt trace <artifact_id>` - Full provenance trace as JSON
- `prompt graph <artifact_id>` - Dependency graph (DOT/Mermaid)
- `prompt runs` - List execution runs with filters
- `prompt debt` - Show impact debt and stale artifacts
- `prompt stats` - Dependency graph statistics
## Implementation
Source files (8):
- markitect/prompts/traceability/models.py - Trace data models
- markitect/prompts/traceability/service.py - TraceabilityService
- markitect/prompts/visualization/graph.py - Graph export
- markitect/prompts/queries/operations.py - PromptQueryService
- markitect/prompts/cli.py - Click CLI commands
- Package __init__.py files (3)
Tests (64 total, all passing):
- tests/unit/prompts/test_traceability_service.py (21 tests)
- tests/unit/prompts/test_visualization.py (14 tests)
- tests/unit/prompts/test_query_operations.py (12 tests)
- tests/integration/prompts/test_traceability_workflow.py (7 tests)
- tests/integration/prompts/test_prompt_cli.py (10 tests)
## Architecture
TraceabilityService is a composition layer that delegates to:
- DependencyQueryService (transitive dependency lookups)
- QualityValidator (validation history)
- IncrementalExecutionEngine (impact debt queries)
- Direct repository access (artifacts, edges)
No duplicate data storage - all data comes from existing Phase 1-7
infrastructure (artifact repo, dependency repo, validation DB, debt DB).
## Verification
All 2250 tests pass with 0 regressions.
Phase 8 completes the full 8-phase implementation roadmap.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 20:32:18 +01:00
..
2025-10-02 00:45:06 +02:00
2025-09-29 12:18:25 +02:00
2025-10-02 09:32:16 +02:00
2026-02-09 20:32:18 +01:00
2026-02-09 20:32:18 +01:00
2025-10-06 02:11:28 +02:00
2025-11-09 09:22:26 +01:00
2025-09-26 22:36:35 +02:00
2025-10-02 15:33:32 +02:00
2025-10-02 09:14:24 +02:00
2025-11-09 09:22:26 +01:00
2025-10-01 21:05:36 +02:00
2025-09-22 02:04:19 +02:00
2025-10-02 09:14:24 +02:00
2025-10-01 21:05:36 +02:00
2025-09-30 03:31:48 +02:00
2025-09-30 03:31:48 +02:00
2025-10-01 21:05:36 +02:00
2025-10-01 21:05:36 +02:00
2025-09-22 02:04:19 +02:00
2025-10-03 10:45:43 +02:00
2025-10-03 10:53:44 +02:00
2025-10-06 18:04:05 +02:00
2025-10-06 17:46:54 +02:00
2025-10-06 17:46:54 +02:00
2025-10-01 21:05:36 +02:00
2025-09-30 23:33:43 +02:00
2025-09-30 13:09:37 +02:00
2025-10-01 12:48:48 +02:00
2025-10-01 02:59:40 +02:00
2025-10-01 08:03:11 +02:00
2025-10-02 15:33:32 +02:00
2025-10-02 15:33:32 +02:00
2025-10-02 15:33:32 +02:00
2025-10-27 21:31:08 +01:00
2025-10-07 01:22:09 +02:00
2025-10-07 01:32:47 +02:00
2025-10-07 12:47:59 +02:00
2025-10-28 03:50:21 +01:00
2025-10-07 15:44:30 +02:00
2025-10-07 15:44:30 +02:00
2025-10-07 15:44:30 +02:00
2025-10-12 19:57:31 +02:00
2025-10-07 22:47:05 +02:00
2025-10-12 19:57:31 +02:00
2025-10-07 22:47:05 +02:00
2025-10-12 19:57:31 +02:00
2025-10-07 22:47:05 +02:00
2025-10-07 23:11:33 +02:00
2025-10-12 19:57:31 +02:00
2025-11-09 09:22:26 +01:00
2025-10-12 19:57:31 +02:00
2025-10-12 19:57:31 +02:00
2025-10-14 19:29:08 +02:00
2025-11-09 09:22:26 +01:00
2025-11-09 10:41:28 +01:00
2025-11-09 10:41:28 +01:00
2025-10-14 23:42:42 +02:00
2025-10-15 00:19:52 +02:00
2025-10-15 20:00:25 +02:00
2025-10-15 20:00:25 +02:00
2025-10-15 20:00:25 +02:00
2025-10-15 20:00:25 +02:00
2025-12-17 12:10:25 +01:00
2025-11-04 21:59:22 +01:00
2025-10-12 20:17:41 +02:00
2025-10-12 22:30:06 +02:00
2025-10-13 20:26:08 +02:00
2025-10-13 23:09:18 +02:00
2025-10-13 23:09:18 +02:00
2025-10-13 23:09:18 +02:00
2025-10-14 07:53:38 +02:00
2025-11-10 11:04:51 +01:00
2025-11-10 10:53:37 +01:00
2025-09-29 12:18:25 +02:00
2025-11-09 10:41:28 +01:00
2025-09-29 12:18:25 +02:00
2025-09-30 23:33:43 +02:00
2025-10-06 16:46:26 +02:00
2025-10-13 20:26:08 +02:00
2025-09-30 23:33:43 +02:00
2025-10-01 21:05:36 +02:00
2025-09-29 12:18:25 +02:00
2025-10-03 05:37:17 +02:00
2025-09-30 22:13:07 +02:00
2025-09-30 23:33:43 +02:00
2025-11-09 10:41:28 +01:00
2025-09-29 12:18:25 +02:00
2025-09-29 12:18:25 +02:00
2025-10-29 23:12:44 +01:00
2025-11-10 11:43:25 +01:00
2025-10-04 01:53:31 +02:00
2025-10-04 01:53:31 +02:00
2025-10-13 20:26:08 +02:00
2026-01-04 21:33:37 +01:00
2026-01-05 00:02:15 +01:00
2026-01-05 03:10:49 +01:00
2026-01-04 23:51:29 +01:00
2026-01-04 21:33:37 +01:00
2025-10-03 05:37:17 +02:00
2026-01-06 03:41:03 +01:00
2025-12-17 12:10:25 +01:00