Skip to content

Commit 612fcd8

Browse files
fluffy314cursoragent
authored andcommitted
fix(autoresearch): preserve contract during definition resume
Treat contract-bound definition resolution as a downstream resume so wrapper candidate drift cannot replace accepted provenance with an empty checkpoint. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5e4cd95 commit 612fcd8

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

autoresearch/prefill/supervisor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,7 @@ def is_contract_bound_subgoal_resume(
18881888
return bool(
18891889
checkpoint is not None
18901890
and checkpoint.proof_state in {
1891+
ProofState.DEFINITION_RESOLUTION,
18911892
ProofState.DECOMPOSER,
18921893
ProofState.DECOMPOSITION_EXPLORATION,
18931894
ProofState.CANDIDATE_PREFILTER,

tests/inference_engine/bench/test_autoresearch_supervisor.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ def test_target_bound_decomposer_resume_ignores_wrapper_candidate_hash():
126126
)
127127

128128

129+
def test_contract_bound_definition_resolution_preserves_provenance_on_wrapper_drift():
130+
checkpoint = OrchestrationCheckpoint(
131+
state=ProofState.DEFINITION_RESOLUTION.value,
132+
current_role="definition_resolution",
133+
target_obligation_id="RH-C0-root",
134+
proposition_hash="p" * 64,
135+
target_context_hash="c" * 64,
136+
selected_strategy_plan_id="SP-root",
137+
research_contract_id="RC-root",
138+
candidate_sha256="stale-wrapper-hash",
139+
definition_audit_outcome="COMPLETE",
140+
)
141+
assert is_contract_bound_subgoal_resume(checkpoint)
142+
assert should_resume_downstream(
143+
checkpoint,
144+
candidate_sha256="new-wrapper-hash",
145+
force_strategy=False,
146+
strategy_trigger_exists=False,
147+
)
148+
149+
129150
def test_duplicate_wrapper_block_recovers_bound_decomposer():
130151
checkpoint = OrchestrationCheckpoint(
131152
state=ProofState.BLOCKED.value,

0 commit comments

Comments
 (0)