# CorpusFetch Method Slice (Zero-Prose Python Stdlib Reference) # Canonical Residual: https://corpusfetch.com/c/why-does-losing-intermediate-falsification-steps-weaken-the-final-stored-conclusion.md # Remnant Warrant: https://corpusfetch.com/c/why-does-losing-intermediate-falsification-steps-weaken-the-final-stored-conclusion.warrant.json # Markdown SHA-256: 62c980d37257e950f3e76bf46008ee4293635b9eb90fead5b89260d5a3f1d7bc # Code AST SHA-256: 1281c19796fd43c3523af37f45c9068a2f0b791a1172631fff2e58c4d9cc7f2a # Verified Classes: FalsifiedHypothesisStep, ConcludedResidualCandidate, FalsificationLineageTruncationViolation, FalsificationPreservationGate # Defensive Guards: 3 fail-closed invariants (zero external deps) from dataclasses import dataclass from typing import Final, FrozenSet, Tuple import hashlib @dataclass(frozen=True) class FalsifiedHypothesisStep: hypothesis_id: str candidate_strategy: str refuting_counterexample: str observed_failure_class: str @dataclass(frozen=True) class ConcludedResidualCandidate: slug: str final_conclusion_summary: str required_defensive_guards: FrozenSet[str] preserved_falsifications: Tuple[FalsifiedHypothesisStep, ...] discarded_falsification_count: int class FalsificationLineageTruncationViolation(Exception): """Raised when a stored conclusion strips intermediate falsification steps or leaves defensive guards unjustified.""" pass class FalsificationPreservationGate: def verify_epistemic_lineage(self, candidate: ConcludedResidualCandidate) -> str: # 1. Fail-closed if any intermediate falsification steps were discarded during summarization if candidate.discarded_falsification_count > 0: raise FalsificationLineageTruncationViolation( f"Residual '{candidate.slug}' discarded {candidate.discarded_falsification_count} " "intermediate falsification step(s); refusing lossy conclusion commit." ) # 2. Require at least one preserved falsification step when defensive guards are mandated if candidate.required_defensive_guards and not candidate.preserved_falsifications: raise FalsificationLineageTruncationViolation( f"Residual '{candidate.slug}' mandates defensive guards without preserving " "the falsification steps that proved them necessary." ) # 3. Verify every falsified step contains a concrete counterexample and failure class lineage_tokens = [candidate.slug, candidate.final_conclusion_summary] for step in candidate.preserved_falsifications: if not step.refuting_counterexample.strip() or not step.observed_failure_class.strip(): raise FalsificationLineageTruncationViolation( f"Falsified hypothesis '{step.hypothesis_id}' lacks a concrete counterexample or failure class." ) lineage_tokens.append(f"{step.hypothesis_id}:{step.observed_failure_class}:{step.refuting_counterexample}") return hashlib.sha256("|".join(lineage_tokens).encode("utf-8")).hexdigest()