Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions benchmark/tests/test_checkpoint_joint_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def cli(*args):
assert code == 0, output
return json.loads(output)

def receiver_guard(*args):
# The receiver checks machine fields. run_native_work presents this
# same decision through the configured model transport afterwards.
return cli("quota", "should-run", "--context-delivery", "off", *args)

cli(
"bootstrap",
"--project",
Expand Down Expand Up @@ -304,7 +309,7 @@ def lose_binding_reply(self, *args):
"--turn-instance-id",
turn,
]
guard = cli("quota", "should-run", "--runtime-profile", "generic_cli", *binding)
guard = receiver_guard("--runtime-profile", "generic_cli", *binding)
assert guard["interaction_contract"]["agent_channel"]["delivery_allowed"]
external_path = os.environ.get("LOOPX_JOINT_RECEIVER_NATIVE")
external = json.loads(Path(external_path).read_bytes()) if external_path else None
Expand Down Expand Up @@ -663,9 +668,7 @@ def run_native_work(current_guard, logs, purpose):
hook = CheckpointWake(env, dict(pending_receipt))
assert not hook._first_replan({"capture": True, "obligation_id": "replan-new-destination"})
assert not (wakes.parent / "checkpoints").exists()
reviewed = cli(
"quota",
"should-run",
reviewed = receiver_guard(
"--goal-id",
goal,
"--agent-id",
Expand All @@ -682,9 +685,7 @@ def run_native_work(current_guard, logs, purpose):
assert any(
t["kind"] == "periodic_review_due" for t in obligation["triggers"]
), obligation
reviewed = cli(
"quota",
"should-run",
reviewed = receiver_guard(
"--goal-id",
goal,
"--agent-id",
Expand Down Expand Up @@ -865,9 +866,7 @@ def run_native_work(current_guard, logs, purpose):
next_turn,
]

next_guard = cli(
"quota",
"should-run",
next_guard = receiver_guard(
*next_binding,
"--runtime-profile",
"generic_cli",
Expand Down Expand Up @@ -982,17 +981,13 @@ def run_native_work(current_guard, logs, purpose):
"--execute",
)
if not external:
final = cli(
"quota",
"should-run",
final = receiver_guard(
"--goal-id",
goal,
"--agent-id",
agent,
# Readback is a scheduler observation, not another work
# Turn whose unperformed closeout could block recapture.
"--context-delivery",
"off",
"--runtime-profile",
"generic_cli",
"--available-capability",
Expand Down
8 changes: 4 additions & 4 deletions tests/control_plane/test_research_context_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ def settle(turn, vision, *, review=False):
'observed_reality': 'The current ordinary Goal reads the inherited rejected candidate.',
'retained': ['Candidate 3 is rejected; keep candidate 7.'], 'evidence_refs': ['checkpoint:' + digest]}}
initial = run('quota', 'should-run', *actor, '--todo-id', todo, '--turn-instance-id', 'ordinary-preparation',
'--runtime-profile', 'generic_cli', '--available-capability', 'shell')
'--runtime-profile', 'generic_cli', '--context-delivery', 'off', '--available-capability', 'shell')
assert initial['interaction_contract']['agent_channel']['delivery_allowed']
settle('ordinary-preparation', vision)
review = run('quota', 'should-run', *actor, '--turn-instance-id', 'ordinary-review',
'--runtime-profile', 'generic_cli', '--available-capability', 'shell')
'--runtime-profile', 'generic_cli', '--context-delivery', 'off', '--available-capability', 'shell')
assert review['interaction_contract']['mode'] == 'autonomous_replan'
review = run('quota', 'should-run', *actor, '--todo-id', todo, '--turn-instance-id', 'ordinary-review',
'--runtime-profile', 'generic_cli', '--available-capability', 'shell')
'--runtime-profile', 'generic_cli', '--context-delivery', 'off', '--available-capability', 'shell')
control = review['replan_action_packet']['stride_control']
assert any(row['finding_id'] == 'negative-3' for row in control['explore_basis']['finding_refs'])
decision = json.loads(json.dumps(control['minimal_example']))
Expand Down Expand Up @@ -321,7 +321,7 @@ def settle(turn, vision, *, review=False):
assert actual_decision['explore_review']['considered_refs'] == ['negative-3']
# The accepted decision is read from canonical history, not the submitted JSON.
following = run('quota', 'should-run', *actor, '--todo-id', todo, '--turn-instance-id', 'ordinary-experiment',
'--runtime-profile', 'generic_cli', '--available-capability', 'shell')
'--runtime-profile', 'generic_cli', '--context-delivery', 'off', '--available-capability', 'shell')
assert following['interaction_contract']['agent_channel']['delivery_allowed']
# Source history and operational observations are never used as current work.
result_path = workspace / 'complete-experiment.json'
Expand Down
Loading