Repository navigation
feat(stride): persist Todo meta-goals across Turns #9214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cocolord
wants to merge
2
commits into
main
Choose a base branch
from
codex/stride-meta-goal-runtime-20261122
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+563
−15
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,6 +98,42 @@ def _user_context( | |
| "todos": inventory["todos"]} | ||
|
|
||
|
|
||
| def attach_stride_meta_goal_context( | ||
| payload: dict[str, Any], *, status_payload: dict[str, Any], | ||
| registry_goal: dict[str, Any] | None, runtime_root: Path, | ||
| ) -> None: | ||
| if registry_goal is None or not payload.get("should_run") or not payload.get("normal_delivery_allowed"): | ||
| return | ||
| selected = payload.get("selected_todo") | ||
| agent = (payload.get("agent_identity") or {}).get("agent_id") | ||
| goal_id = payload.get("goal_id") | ||
| channel = (payload.get("interaction_contract") or {}).get("agent_channel") or {} | ||
| context = channel.get("work_context") | ||
| if not agent or not goal_id or not isinstance(context, dict) or not isinstance(selected, dict): | ||
| return | ||
| todo_id = selected.get("todo_id") | ||
| if not isinstance(todo_id, str) or not any( | ||
| lane.get("agent_id") == agent and lane.get("has_stride_meta_goal") is True | ||
| for goal in (status_payload.get("run_history") or {}).get("goals", []) if goal.get("id") == goal_id | ||
| for lane in (goal.get("semantic_history") or {}).get("agents", []) | ||
| ): | ||
| return | ||
| from ...capabilities.todo_replan_cadence.machine_defaults import resolve_todo_replan_cadence_goal | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 准确头 quick premerge 的可维护性检查出现两条新增失败。普通工作上下文从控制面反向导入能力配置,qualify_replan_writeback 又超出决策函数预算。旧分叉基线及主干对照均为零未审项。 在现有配额或能力组装层解析策略,向工作上下文传入明确值。把元目标写回校验交给现有领域校验边界,再复跑标准 premerge。 |
||
| from .replan_context_codec import read_todo_stride_meta_goal | ||
|
|
||
| profile = resolve_todo_replan_cadence_goal(registry_goal, runtime_root).get("execution_profile") or {} | ||
| if profile.get("stride_strategy", "off") == "off": | ||
| return | ||
| try: | ||
| record = read_todo_stride_meta_goal(runtime_root=runtime_root, goal_id=goal_id, | ||
| todo_id=todo_id, agent_id=agent, goal_ref=payload.get("goal_ref")) | ||
| except (ValueError, OSError, RuntimeError): | ||
| context["stride_meta_goal"] = {"unavailable": True} | ||
| return | ||
| if record is not None and not record["meta_goal"].get("resolution"): | ||
| context["stride_meta_goal"] = record | ||
|
|
||
|
|
||
| def attach_work_context(payload: dict[str, Any], *, registry_path: Path, | ||
| runtime_root: Path, hook_dispatch: dict[str, Any] | None, | ||
| context_navigation: bool = False, | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 未使用元目标的 Todo 也会扫描历史并显示元目标故障。在明确设置 Stride off、从未保存元目标的真实 Todo 上,旧版精确读取只返回正常详情。当前头和主干整合预演都为每次详情读取解析整份日志。在 File 和 SQLite 上,一条无关的残缺 UTF-8 日志尾随 40,000 条普通记录时,两者都返回 stride_meta_goal.unavailable=true。原 Todo 和日志内容保持原样,CLI 与 Task Request 的额外告警来自新加的读路径。 把已存在元目标的事实交给有作用域的读回所有者。没有元目标的 Todo 保持原详情,即使无关历史不可读。已保存的历史在显式关闭后仍应可查,按 Todo 与 GoalRef 查找其来源。