ADR-0184 §7 S4: add generate/derivation/state/source.py — the single boundary through which semantic-ledger worlds become pool candidates — and swap pool.py's accumulation source to semantic_state_candidates(). accumulate.py keeps its public surfaces as thin compatibility wrappers (ADR-0184 §10). Byte-identical over the 937-problem differential; verify.py / pool.py remain the sole commit authority (structural no-authority-import scan over state/, non-vacuous). Also: docs/analysis design note for the S3–S5 boundary stack, and a drive-by ruff F541 fix in r1_reconstruction.py (rf->r, zero behavior).
75 lines
2.3 KiB
Python
75 lines
2.3 KiB
Python
"""ADR-0175 Phase 3 — grounded derivation search + self-verification gate.
|
|
|
|
Phase 3a (this surface): the self-verification gate — grounded operands ∧
|
|
grounded operation cues ∧ unit consistency ∧ uniqueness. The wrong=0-critical
|
|
guard that keeps the (Phase 3b) bounded search honest.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from generate.derivation.clauses import (
|
|
ClauseResult,
|
|
clause_local_results,
|
|
segment_clauses,
|
|
)
|
|
from generate.derivation.accumulate import accumulation_candidates, compose_accumulation
|
|
from generate.derivation.compose import compose_sequential
|
|
from generate.derivation.comparatives import (
|
|
ComparativeScalar,
|
|
comparative_step,
|
|
extract_comparative_scalars,
|
|
)
|
|
from generate.derivation.extract import extract_quantities
|
|
from generate.derivation.model import GroundedDerivation, Quantity, Step, VALID_OPS
|
|
from generate.derivation.multistep import candidate_chains, search_chain
|
|
from generate.derivation.pool import pooled_candidates, resolve_pooled
|
|
from generate.derivation.r1_reconstruction import R1Reconstruction, reconstruct_r1_total
|
|
from generate.derivation.search import (
|
|
MULTIPLICATIVE_CUES,
|
|
multiplicative_candidates,
|
|
search_multiplicative,
|
|
)
|
|
from generate.derivation.state.source import semantic_state_candidates
|
|
from generate.derivation.target import Target, asks_prior_state, extract_target
|
|
from generate.derivation.verify import (
|
|
Resolution,
|
|
SelfVerification,
|
|
classify_derivation,
|
|
select_self_verified,
|
|
self_verifies,
|
|
)
|
|
|
|
__all__ = [
|
|
"ClauseResult",
|
|
"ComparativeScalar",
|
|
"GroundedDerivation",
|
|
"MULTIPLICATIVE_CUES",
|
|
"Quantity",
|
|
"Resolution",
|
|
"R1Reconstruction",
|
|
"SelfVerification",
|
|
"Step",
|
|
"Target",
|
|
"VALID_OPS",
|
|
"accumulation_candidates",
|
|
"asks_prior_state",
|
|
"candidate_chains",
|
|
"classify_derivation",
|
|
"clause_local_results",
|
|
"compose_accumulation",
|
|
"compose_sequential",
|
|
"comparative_step",
|
|
"extract_comparative_scalars",
|
|
"extract_quantities",
|
|
"extract_target",
|
|
"multiplicative_candidates",
|
|
"pooled_candidates",
|
|
"resolve_pooled",
|
|
"reconstruct_r1_total",
|
|
"search_chain",
|
|
"search_multiplicative",
|
|
"segment_clauses",
|
|
"select_self_verified",
|
|
"self_verifies",
|
|
"semantic_state_candidates",
|
|
]
|