Observability, Counterfactual Debugging, and Replay
SUMMARY
Defines path-level traces, structural failure classification, counterfactual queries, and reproducible replay for incomplete execution.
DETAIL
Debugging a Lacunar Code system means inspecting graph decisions, obligations, and transitions rather than reconstructing hidden procedural control flow.
An execution trace exposes the active intent, intent-graph version, selected Minimum Viable Path, ready frontiers, lacuna transitions, proposed candidates, validation outcomes, assumptions, external dependencies, bypasses, refusals, overlay composition, invalidations, and the structural condition that ended execution. Durable intent and generated overlay structure must remain visually and semantically distinct.
Failure classification should be structural. The runtime distinguishes no candidate retrieved, candidate topology mismatch, semantic or behavioral contract failure, safety rejection, authority rejection, unavailable prerequisite, overlay conflict, exhausted budget, oscillation, divergence, dependency deadlock, invalidation, and false quiescence. Localizing stuckness as a graph leaf or blocking cut prevents one unresolved branch from becoming an undifferentiated system-wide failure.
The most useful explanations are bounded. A developer usually needs the cone of relevant causes, the first failed obligation, the smallest blocking cut, the minimal path witness, or the assumptions supporting a selected edge. Full provenance dumps obscure these structures and may expose sensitive data without improving diagnosis.
Counterfactual queries should answer which constraint excluded a candidate, why a lacuna was bypassed, what smallest change would make another path admissible, which outputs depend on an invalidated completion, and what prevented the ready frontier from advancing. These queries make graph shape an executable explanation surface.
Replay requires durable execution state because a nondeterministic resolver cannot reconstruct prior behavior from intent alone. A replay record preserves the graph version, active constraints, accepted overlay, external observations, resolver version, ranking and tie-breaking policy, randomness controls, and validation witnesses.
Strict replay reuses the accepted overlay and identical inputs. Regenerative replay reruns resolution under frozen retrieval and policy boundaries to test solver stability. Comparative replay varies one declared dimension, such as resolver version or cost policy, while holding the dependency cone fixed. Changed safety, authority, consent, or environmental facts invalidate strict reproduction before effects are recommitted.
Observability remains bounded by privacy and security. The runtime can expose decisions, obligations, and structural witnesses without revealing unrestricted internal model reasoning or sensitive source material.
WHY THIS EXISTS
Supports IDEs, incident response, audit, causal explanation, replay, regression testing, and controlled upgrades of probabilistic resolvers.
SOURCE CONTEXT POINTERS
- /concepts/lacunar-code/PATTERNS.txt
- /concepts/lacunar-code/PRODUCT_BUSINESS.txt
- /concepts/lacunar-code/RISKS_AND_CONTRADICTIONS.txt
EVIDENCE QUESTIONS
- No evidence query recorded