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
5 changes: 3 additions & 2 deletions loopx/chat_loopx_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,9 @@ def dispatch(name, arguments):
from .control_plane.goals.acceptance import inspect_goal_acceptance
objective_basis = inspect_goal_acceptance(registry_path=self.controller.registry_path,
runtime_root=str(self.store.root.parent), goal_id=current["goal_id"], agent_id=settings["agent_id"])
if objective_basis.get("goal_objective_guard"):
return {"ok": False, "error": "goal_objective_review_required", **objective_basis["goal_objective_guard"],
guard = objective_basis.get("goal_objective_guard")
if isinstance(guard, dict) and guard:
return {"ok": False, "error": "goal_objective_review_required", **guard,
"next_action": "Use action=outcomes; reconcile your work and action=adopt_goal_objective before this execution."}
if action in {"prepare_goal_objective", "adopt_goal_objective"}:
from .control_plane.goals.acceptance import public_goal_acceptance, update_goal_objective
Expand Down
27 changes: 22 additions & 5 deletions loopx/cli_commands/project_lifecycle_refresh_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os
from collections.abc import Callable, Mapping, Sequence
from pathlib import Path
from typing import cast

from ..capabilities.explore.activation import (
sync_explore_graph_after_material_refresh,
Expand Down Expand Up @@ -524,12 +525,28 @@ def handle_refresh_state_command(
raise ValueError("--resume-external-sinks requires the original --turn-instance-id")
if outcome_update is not None:
from ..control_plane.goals.acceptance import refine_goal_outcome, public_goal_acceptance
raw_refinement = outcome_update["refinement"]
refinement = raw_refinement if isinstance(raw_refinement, Mapping) else {}
reviewed_work_update = (
{
"todo_id": args.todo_id,
"append_explore_result_node_refs": [explore_result["node_id"]],
}
if explore_result is not None
and any(key in refinement for key in ("review", "review_patch"))
else None
)
refinement_result = refine_goal_outcome(
registry_path=registry_path, runtime_root=args.runtime_root, goal_id=args.goal_id,
agent_id=args.agent_id, execute=not args.dry_run, **outcome_update,
**({"reviewed_work_update": {"todo_id": args.todo_id,
"append_explore_result_node_refs": [explore_result["node_id"]]}}
if explore_result is not None and any(key in outcome_update["refinement"] for key in ("review", "review_patch")) else {}))
registry_path=registry_path,
runtime_root=args.runtime_root,
goal_id=args.goal_id,
agent_id=args.agent_id,
execute=not args.dry_run,
refinement=refinement,
expected_provider_revision=cast(str, outcome_update["expected_provider_revision"]),
operation_id=cast(str, outcome_update["operation_id"]),
reviewed_work_update=reviewed_work_update,
)
outcome_update_result = public_goal_acceptance(refinement_result, include_contract=False)
if args.dry_run:
# Preview the same ordered composition as execution: the typed
Expand Down
Loading
Loading