Skip to content

Commit d404214

Browse files
fluffy314cursoragent
authored andcommitted
fix(autoresearch): certify sourced strategy intent
Accept DOI source IDs at the constrained Cursor boundary and persist the verified intent run/hash required by signed resume certificates. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 568c326 commit d404214

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

autoresearch/prefill/cursor_strategy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ def compile_memo_to_plan_id(
429429
return selections[0]
430430

431431

432-
_INTENT_LINE = re.compile(r"([a-z][a-z0-9_]{0,47}) ([A-Za-z0-9_.:+\-]+);")
432+
_INTENT_LINE = re.compile(
433+
r"([a-z][a-z0-9_]{0,47}) ([A-Za-z0-9_.:/+\-]+);"
434+
)
433435
_REPEATED_INTENT_FIELDS = {"gap_ref", "theorem_tag", "evidence_ref"}
434436

435437

scripts/launch_rh_strategy_tournament.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def main() -> int:
9191
parser.add_argument("--strategy-prompt-hash", default="")
9292
parser.add_argument("--strategy-evidence-hash", default="")
9393
parser.add_argument("--strategy-memo-hash", default="")
94+
parser.add_argument("--strategy-intent-hash", default="")
95+
parser.add_argument("--strategy-intent-run-id", default="")
9496
parser.add_argument("--apply", action="store_true")
9597
args = parser.parse_args()
9698
ledger_path = Path(args.ledger).expanduser().resolve()
@@ -198,6 +200,8 @@ def main() -> int:
198200
args.strategy_prompt_hash,
199201
args.strategy_evidence_hash,
200202
args.strategy_memo_hash,
203+
args.strategy_intent_hash,
204+
args.strategy_intent_run_id,
201205
)
202206
if any(not item for item in telemetry_values):
203207
raise SystemExit("apply requires complete Cursor Strategy telemetry")
@@ -366,6 +370,8 @@ def main() -> int:
366370
checkpoint.strategy_prompt_hash = args.strategy_prompt_hash
367371
checkpoint.strategy_evidence_hash = args.strategy_evidence_hash
368372
checkpoint.strategy_memo_hash = args.strategy_memo_hash
373+
checkpoint.strategy_intent_hash = args.strategy_intent_hash
374+
checkpoint.strategy_intent_run_id = args.strategy_intent_run_id
369375
checkpoint.strategy_intent_status = "HOST_PLAN_AUTHORITATIVE"
370376
checkpoint.strategy_selection_provenance = summary["strategy_advisory"]
371377
checkpoint.lean_actions_attempted += 1

tests/inference_engine/bench/test_strategy_tournament_stepwise.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
import pytest
99

1010
from autoresearch.prefill.architecture_v7 import run_architecture_v7_entry
11-
from autoresearch.prefill.cursor_strategy import CursorStrategyAdapter
11+
from autoresearch.prefill.cursor_strategy import (
12+
CursorStrategyAdapter,
13+
_parse_registered_intent,
14+
)
1215
from autoresearch.prefill.research_contract import gate_research_contract
1316
from autoresearch.prefill.orchestration_state import (
1417
OrchestrationCheckpoint,
@@ -112,6 +115,16 @@ def prompt(self, prompt, *, api_key, model_id, cwd):
112115
)
113116

114117

118+
def test_registered_intent_accepts_doi_evidence_reference():
119+
values = _parse_registered_intent(
120+
"evidence_ref doi:10.1073/pnas.1902572116;\nEND;",
121+
{"evidence_ref": ("doi:10.1073/pnas.1902572116",)},
122+
)
123+
assert values == {
124+
"evidence_ref": ("doi:10.1073/pnas.1902572116",),
125+
}
126+
127+
115128
def _strategy_adapter(
116129
target,
117130
gap_ref="",

0 commit comments

Comments
 (0)