Skip to content

Commit 5e4cd95

Browse files
fluffy314cursoragent
authored andcommitted
feat(autoresearch): add bounded decomposition exploration
Separate private candidate discovery from proof certification so novel subproblems can be explored without weakening authoritative Lean, ledger, or Judge gates. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cc7c73f commit 5e4cd95

14 files changed

Lines changed: 1641 additions & 76 deletions

autoresearch/prefill/architecture_v7.py

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
load_resolution_store,
2020
resolve_one_concept,
2121
)
22+
from autoresearch.prefill.decomposition_exploration import (
23+
gate_decomposition_exploration,
24+
)
2225
from autoresearch.prefill.orchestration_state import (
2326
OrchestrationCheckpoint,
2427
ProofState,
@@ -646,6 +649,7 @@ def run_architecture_v7_entry(
646649
"move_family": (
647650
"MOVE_DIRECT", "MOVE_FALSIFY", "MOVE_REDUCE",
648651
"MOVE_REFRAME", "MOVE_REGISTRY_EXPANSION",
652+
"MOVE_EXPLORE_SUBPROBLEMS",
649653
),
650654
"theorem_tag": theorem_tags,
651655
"evidence_ref": evidence_ids,
@@ -801,11 +805,16 @@ def run_architecture_v7_entry(
801805
"RESEARCH_CONTRACT_GATE"
802806
if plan.plan_class
803807
== PlanClass.DEFINITION_RESOLUTION_PLAN.value
808+
else "DECOMPOSITION_EXPLORATION"
809+
if plan.plan_class
810+
== PlanClass.DECOMPOSE_TO_SUBPROBLEMS.value
804811
else "PROOF_SEARCH"
805812
),
806813
"proof_search_allowed": (
807-
plan.plan_class
808-
!= PlanClass.DEFINITION_RESOLUTION_PLAN.value
814+
plan.plan_class not in {
815+
PlanClass.DEFINITION_RESOLUTION_PLAN.value,
816+
PlanClass.DECOMPOSE_TO_SUBPROBLEMS.value,
817+
}
809818
),
810819
}
811820
for plan in plans
@@ -840,6 +849,41 @@ def run_architecture_v7_entry(
840849
# Memo metadata, constrained intent, compiled plans, feasibility, selection,
841850
# and the reachable artifact pointer become visible in one checkpoint swap.
842851
save_checkpoint(checkpoint_path, checkpoint)
852+
selected = next(
853+
(plan for plan in plans if plan.plan_id == tournament.selected_plan_id),
854+
None,
855+
)
856+
if (
857+
selected is not None
858+
and selected.plan_class == PlanClass.DECOMPOSE_TO_SUBPROBLEMS.value
859+
):
860+
exploration = gate_decomposition_exploration(
861+
selected,
862+
target_obligation_id=target_ref,
863+
target_context_hash=checkpoint.target_context_hash,
864+
proposition_hash=proposition_hash,
865+
evidence_refs=selected.evidence_refs,
866+
no_go_refs=selected.known_no_go_refs,
867+
theorem_card_ids=selected.theorem_card_ids,
868+
candidate_budget=selected.candidate_budget,
869+
)
870+
checkpoint.exploration_contract_id = exploration.contract_id
871+
checkpoint.exploration_contract_hash = exploration.content_hash
872+
persist_validated_artifact(
873+
checkpoint_path,
874+
checkpoint,
875+
role="decomposition_exploration_contract",
876+
payload=asdict(exploration),
877+
dependencies=[tournament_ref.sha256],
878+
source_run_id=f"host:{event_id}:exploration-contract",
879+
)
880+
checkpoint.transition(
881+
ProofState.DECOMPOSITION_EXPLORATION,
882+
"decomposition-exploration-contract-accepted",
883+
strategy_reused=False,
884+
)
885+
save_checkpoint(checkpoint_path, checkpoint)
886+
return checkpoint
843887
precontract_reasons = []
844888
if unresolved_definitions:
845889
precontract_reasons.append("MISSING_DEFINITION")
@@ -872,10 +916,6 @@ def run_architecture_v7_entry(
872916
)
873917
save_checkpoint(checkpoint_path, checkpoint)
874918
return checkpoint
875-
selected = next(
876-
(plan for plan in plans if plan.plan_id == tournament.selected_plan_id),
877-
None,
878-
)
879919
if selected is None:
880920
checkpoint.research_contract_rejection_codes = []
881921
checkpoint.transition(

0 commit comments

Comments
 (0)