Skip to content

feat(stride): persist Todo meta-goals across Turns - #9214

Open
cocolord wants to merge 9 commits into
mainfrom
codex/stride-meta-goal-runtime-20261122
Open

cocolord wants to merge 9 commits into
mainfrom
codex/stride-meta-goal-runtime-20261122

Conversation

@cocolord

@cocolord cocolord commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Goal And Delivered Outcome

Implement Todo-scoped meta-goals in Stride. The Agent records what it is trying to establish and the evidence needed to decide in the same decision as grow, switch, or verify and next_probe.

An open question follows its Todo across ordinary Turns. A later decision can cite exact subsequent work on that Todo and record an answer. The Todo details and CLI show the question, action, probe, and cited evidence. history --evidence-ref resolves the original records.

Related RFC #9209. This PR implements the single-Todo runtime behavior against main.

Author Declaration

Written by Codex (OpenAI). The implementation uses the existing Stride and Goal Vision replan owners and the Todo details reader.

Criterion Disposition Validation
Persist and continue one Todo-scoped question Implemented Two ordinary Turns carry the same open question in File and SQLite
Bind references to subsequent work on that Todo Implemented A foreign Todo's evidence is rejected and the valid result is readable from history
Show the decision in the existing Todo journey Implemented The packaged task drawer reads the same journal through the local Chat API

Scope And Continuation

The optional field is authored through an admitted Stride review. Existing Todo selection, scheduling, and settlement govern execution. Closure removes the question from ordinary Turn context and preserves the record for readback.

The checks below use synthetic Todo fixtures. Research reporting follows evaluation on real Todos.

Validation

Tested implementation revision 82af2151699fce0046509c49089cc0da1349a11f.

Check Result Evidence
CLI with File and SQLite Passed tests/control_plane/test_todo_stride_meta_goal_cli.py covers continuity, cross-Todo rejection, and exact evidence readback after resolution
TypeScript control plane Passed Typecheck and 204 targeted Stride, replan, TurnEnvelope, and progressive-context tests
Existing downstream paths Passed Focused Python regression suites, including Todo details, source routing, Vision budget, and 22 Steward replan tests
Packaged workspace Passed Desktop and narrow Todo details against the SQLite fixture, with an injected read failure and recovery through the native HTTP route

Review Follow-up

Revision 3041c11a874bac4ccd8d959b4bb22c206815376c incorporates main at 1b17c0c7.

  • The exact Todo reader opens the decision journal when it finds a recorded source for the Todo in the current Goal lifetime. File and SQLite regressions cover an unrelated truncated UTF-8 journal row, an unavailable saved source and successful readback after repair. Saved decisions remain readable with Stride disabled. Todo readback finding
  • Live quota passes its effective Stride strategy to the work context. The Stride writeback codec delegates Todo scope and evidence qualification to the existing typed owner. Maintainability finding

Standard premerge passed all 19 selected checks. The File and SQLite integration cases, 97 Python regression tests, 71 TypeScript tests and the control-plane typecheck passed on this revision.

Compact follow-up on ae2dfa168

An open Todo question carries by its exact previous decision reference. Todo detail and ordinary Turn readback recover the original question and criterion. A continuation can share same-write Vision path or previous Stride review citations, with the existing Goal, Agent, Todo and settled-work checks. Inline records remain supported.

The Vision budget remains 1,800 characters. A matched boundary check accepts the referenced continuation at 1,800 characters and rejects the form with repeated text and citations. Targeted validation passed on this revision in File and SQLite (four CLI cases), with 99 TypeScript tests, 22 Vision budget CLI tests, and control-plane typechecking. The existing packaged captures below use the revision named in their caption.

Settlement qualification on 870e04149

Preview, explicit citations, and continuation citations now share the quota owner's readback of the exact settled writeback. A work row or a debit row pending its receipt stays readable in history. A committed typed no-spend closeout qualifies through the same quota owner.

File and SQLite pass all eight combinations of paid or legal no-spend closeout and explicit or reused citation. The interruption cases keep the run index and withhold the closing receipt. The paid cases also verify the actual pre-spend detail read. Thirty focused Python tests, 305 TypeScript tests, control-plane typechecking, and all 19 standard premerge checks passed. P2 review thread

Single-Todo RFC trace acceptance

On this exact head, a bounded scheduler diagnosis derived from #8572 reached all three decision paths with native settlement and a separate verifier. A small SQLite pass led to actual SQLite qualification across three additional quota settings. A fixed host's failed SQLite admission led to executing the File authority path on that host. The budget-limited case finished the last admitted Turn, denied a fresh Turn, and kept the undecided question and Todo open. The two cases with conclusive results completed their diagnostic Todos. These exercise decision followthrough and settlement in disposable stores. Peak-throughput qualification is a separate measurement.

Frontend / Visual Evidence

The same synthetic Todo was read with locally packaged main (55bae0ac5) and the packaged implementation at 82af2151. The Meta-goal disclosure keeps the task request and controls visible when closed. Opening it shows the question, conclusion, next probe, and exact cited evidence.

Viewport Before After
Desktop 1440 × 960 Todo details on main at desktop width Expanded meta-goal and evidence at desktop width
Narrow 390 × 844 Todo details on main at narrow width Expanded meta-goal and evidence at narrow width

Injected read failure on the narrow drawer, followed by successful retry against the native backend.

Narrow Todo details with an injected read failure and a retry control

Type of Change

Feature and protocol documentation. All PR commits carry a DCO sign-off.

Technical Direction

The existing built-in todo_replan_cadence capability and loopx-core provider own Stride. The new field extends their typed decision and readback path.

Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

操作者打开 Todo 时需要看到可靠的任务要求和实际记录的规划问题。 过去打开一个从未记录元目标的任务只显示原任务详情。当前改动可能给这个任务加上无关的元目标故障提示。 提案在既有决定内记录单个 Todo 的问题、判定条件与后续证据,复用普通 Turn、精确 CLI 读取和 Task Request。 本轮独立验证覆盖源码、真实 File/SQLite 和本地包。调度收益、长期代理采纳与完整成本仍待用真实 Todo 衡量。

改动思路 / Approach

将元目标作为 Stride Decision 的可选字段,沿用有权复盘与精确的 Goal、Agent、Todo 和 Turn 绑定。 正常工作读回已记录的问题,结算证据交给现有独立所有者。任务详情的组成可以查询该记录。 沿用显式关闭和旧目标的可兼容读取。把配置和权威记录装配放在原有入口,而非由普通详情反查所有历史。

具体改动 / Changes

逐项检查当前头 82af215 和 merge base 55bae0a,21 个文件,+563/-15。同 55bae0a 对照审阅 21 个文件,并对 a6ffb3b 的干净整合预演重放反例。按协议核对 scoped-continuation、exact-readback 和 optional-isolation。TS 明确选择按 Todo 绑定的后续证据,Python 把事实交给它,App 走原任务详情。前两项有真实 CLI 控制。关闭且没有历史元目标时的详情路径不隔离。 评审依据为 82af215。 目标规范

关键代码讲解

  • 后续证据 只选当前作用域及记录之后符合条件的工作。
  • 普通 Turn 在有记录提示和策略启用时读回未解决的问题。
  • 写回 对已经资格通过的语义差量增加元目标核验。
  • 精确 Todo 任意 Agent Todo 详情调用读端,历史读取 先解码整份日志再检查是否存在记录。
  • 界面 显示问题、判定、探针与证据,并为未知状态提供重试。

对主干的风险 / Risks

[P2] 未使用元目标的 Todo 也会扫描历史并显示元目标故障。 在明确设置 Stride off、从未保存元目标的真实 Todo 上,旧版精确读取只返回正常详情。当前头和主干整合预演都为每次详情读取解析整份日志。在 File 和 SQLite 上,一条无关的残缺 UTF-8 日志尾随 40,000 条普通记录时,两者都返回 stride_meta_goal.unavailable=true。原 Todo 和日志内容保持原样,CLI 与 Task Request 的额外告警来自新加的读路径。 把已存在元目标的事实交给有作用域的读回所有者。没有元目标的 Todo 保持原详情,即使无关历史不可读。已保存的历史在显式关闭后仍应可查,按 Todo 与 GoalRef 查找其来源。 [P2] 新增控制面依赖和超预算决策函数使 premerge 失败。 准确头 quick premerge 的可维护性检查出现两条新增失败。普通工作上下文从控制面反向导入能力配置,qualify_replan_writeback 又超出决策函数预算。旧分叉基线及主干对照均为零未审项。 在现有配额或能力组装层解析策略,向工作上下文传入明确值。把元目标写回校验交给现有领域校验边界,再复跑标准 premerge。

在真实 File/SQLite CLI 上复验两条正常流程。元目标跨 Turn 延续,换动作和收口时外部 Todo 证据被拒绝,合法尾部观测、原决定与回执能从 history 读回。TypeScript 检查及桌面和 Chat 包构建通过。 准确头及整合预演的默认关闭反例一致。原生 quick premerge 的具体失败如上。没有查询 GitHub CI。 长日志用于验证读路径依赖,未作为稳定延迟基准。

我的整体评价 / Verdict

请求修改。将元目标作为 Stride Decision 的可选字段,沿用有权复盘与精确的 Goal、Agent、Todo 和 Turn 绑定。 正常工作读回已记录的问题,结算证据交给现有独立所有者。任务详情的组成可以查询该记录。 新功能的正常路径通过。现在普通任务详情受到不相关历史故障影响,且准确头出现两条新门禁失败。 请保留原有结算与历史读取语义,修复无记录时的详情隔离与新增的控制面门禁失败。 对当前头的本地打包 Chat 独立检查桌面和窄屏任务抽屉,均读回同一条证据。窄屏向真实 SQLite Goal 注入日志读取异常,恢复日志后重试能返回原证据。 验证环境为合成 Todo、真实 SQLite 和本地打包 Chat。窄屏默认折叠的视觉布局及已安装桌面应用未独立验证。

English verdict: REQUEST_CHANGES at 82af215. The scoped Stride lifecycle works on both local providers, but an unrelated journal failure affects exact Todo details when Stride is off and no meta-goal exists. The exact head also introduces two maintainability-gate failures.


instance = goal.get("goal_instance_id")
try:
meta_goal = read_todo_stride_meta_goal(

Copy link
Copy Markdown
Collaborator

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 查找其来源。

for lane in (goal.get("semantic_history") or {}).get("agents", [])
):
return
from ...capabilities.todo_replan_cadence.machine_defaults import resolve_todo_replan_cadence_goal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 准确头 quick premerge 的可维护性检查出现两条新增失败。普通工作上下文从控制面反向导入能力配置,qualify_replan_writeback 又超出决策函数预算。旧分叉基线及主干对照均为零未审项。 在现有配额或能力组装层解析策略,向工作上下文传入明确值。把元目标写回校验交给现有领域校验边界,再复跑标准 premerge。

@mergify

mergify Bot commented Nov 22, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 22, 2026
Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>
…odex/stride-meta-goal-runtime-20261122

Signed-off-by: cicolord <cicolord@outlook.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 22, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

持续处理同一 Todo 的 Agent 需要接续上轮的问题,并知道哪些后续证据已完成结算。 旧版可回看一般规划记录,普通 Todo 详情没有持续问题、下一探针和相应的证据。 同一 Todo 先写出实际进展,暂缓提交该轮的额度收据,再用精确 Todo CLI 读详情。File 和 SQLite 在只有写回行时就把该引用列入 subsequent_evidence。正常结算后,该引用及其预览逐字段相同。筛选核对了结算身份,仍缺实际结算回执。 当前头在 Stride Decision 中保存问题,普通 Turn 接续,详情显示问题、决定和证据。 验证使用精确源码、合成任务和真实 File、SQLite。真实工作的长期收益和候选已安装 App 仍待验证。

改动思路 / Approach

沿用 Stride 的 TypeScript 决策、已有结算和原任务详情入口,Python 负责提供原有记录。 范围为单个已准入 Todo 的开放问题、后续证据和历史回读。 通过现有结算所有者验证引用对应的 Goal、Agent、Todo、Turn 和效果,再将证据列入预览或用于续做决策。同一判定应覆盖写回完成、待结算和结算完成。

具体改动 / Changes

逐项检查当前头 3041c11 和 merge base 1b17c0c,22 个文件,+638/-20。22 个路径覆盖可选字段协议、Stride 与 quota 接续、读写回路、Dashboard 披露栏和两种 provider 的回归。新头已隔离普通详情和损坏历史,并把配置和写回校验移回原有职责。 分别核对任务问题接续(scoped-continuation)、结算证据(settled-evidence)和未使用时的隔离(optional-isolation)。 当前 main 干净整合后有一处共改 state_refresh.py。该文件仍同时保留现有结算入口和本提案的记录线索。对照执行使用精确 PR head。 评审依据为 3041c11。 目标规范

关键代码讲解

对主干的风险 / Risks

[P2] 额度仍待结算时已出现可引用的后续工作。 同一 Todo 先写出实际进展,暂缓提交该轮的额度收据,再用精确 Todo CLI 读详情。File 和 SQLite 在只有写回行时就把该引用列入 subsequent_evidence。正常结算后,该引用及其预览逐字段相同。筛选核对了结算身份,仍缺实际结算回执。 通过现有结算所有者验证引用对应的 Goal、Agent、Todo、Turn 和效果,再将证据列入预览或用于续做决策。同一判定应覆盖写回完成、待结算和结算完成。 待恢复的写回与已结算工作在候选证据里失去区分。

精确头的 File 和 SQLite 均能接续原问题、拒绝其他 Todo 的引用并从 history 读回正确证据。关闭 Stride 后保留历史回读。附加 40,000 条普通日志和损坏尾行后,无记录的 Todo 保持相同详情。 File 和 SQLite 原生生命周期 2 项通过。写回与结算之间的观测在两种 provider 重现,独立观测脚本 2 项通过。默认关闭的长日志故障隔离也已通过。 精确头标准 premerge 的 6 项直接检查与 19 项选定检查通过。 验证使用精确源码、合成任务和真实 File、SQLite。真实工作的长期收益和候选已安装 App 仍待验证。

我的整体评价 / Verdict

请求修改。沿用 Stride 的 TypeScript 决策、已有结算和原任务详情入口,Python 负责提供原有记录。 范围为单个已准入 Todo 的开放问题、后续证据和历史回读。 写回待结算结果可被历史读取,续做证据资格等到既有结算所有者确认。 请求修补该分支,并保留已回归验证的原流程。 上一评审头本地包已观察桌面和窄屏展开及异常重试。当前前端源码未变,真实 CLI 在两个后端重验详情数据。 当前头完整打包浏览器旅程和已安装 App 仍待验证。

English verdict: REQUEST_CHANGES at 3041c11. The previous default-off isolation regression is fixed. File and SQLite both expose writeback-only work as eligible subsequent evidence before the exact Turn settles.

if (order <= position || observationTodo(row) !== todoId || isAccountingRow(row) ||
acceptedDecisionSource(row) || hasConflictingTodoSettlement(row) ||
!MATERIAL_DELIVERY_OUTCOMES.some(outcome => outcome === row.delivery_outcome)) return [];
const ref = settledTodoEvidenceRef(row);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 额度仍待结算时已出现可引用的后续工作。同一 Todo 先写出实际进展,暂缓提交该轮的额度收据,再用精确 Todo CLI 读详情。File 和 SQLite 在只有写回行时就把该引用列入 subsequent_evidence。正常结算后,该引用及其预览逐字段相同。筛选核对了结算身份,仍缺实际结算回执。 通过现有结算所有者验证引用对应的 Goal、Agent、Todo、Turn 和效果,再将证据列入预览或用于续做决策。同一判定应覆盖写回完成、待结算和结算完成。

…ride-meta-goal-runtime-20261122

Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

同一个 Todo 经常需要跨多个工作轮次验证一个问题。Agent 接手时需要回读原问题、验收标准和下一次探针,随后用同一任务中已结算的证据决定是否改变方向。旧基线可回看一般规划历史,这个 PR 把问题与证据接到了 Todo 的工作上下文和按需详情。新的简写引用可以恢复上一轮的问题和验收标准,减少续做时重复填写。本次验收关注同一 Todo 的证据资格与可读回结果,未验证真实任务的长期收益。验收约束要求证据来自当前 Goal 生命周期内、同一 Agent 和 Todo 的后续已结算工作。 协议

改动思路 / Approach

沿用 Stride 的 TypeScript 决策、原生结算和已有 Todo 详情。当前头通过上一条精确的 Stride Decision 引用恢复目标和标准,允许从本次 path_delta 或 previous_review 复用引用。显式引用和简写都经过同一范围判定。用合成任务走了 File 和 SQLite 的真实 CLI 路径,分别检查正常结算、写回与结算之间的中间状态、跨 Todo 引用和关闭后的回读。

具体改动 / Changes

检查精确头 ae2dfa168055c1434ae4d7821dd44bd294b273e9 和 merge base 287616201b81b53824cae570265220ab4142a4b7,共 23 个文件,+780/-20。当前合成整合无文本冲突。规范和配置保留可选的开关及旧显式记录,写回与 quota 把同一开放问题带到工作上下文和后续复盘。

验收覆盖任务接续 (scoped-continuation)、已结算证据 (settled-evidence) 和默认关闭隔离 (optional-isolation)。

  • hydrateMetaGoal 沿同一 Todo 的原决策引用恢复简写定义,再核对引用证据的范围。 恢复已有问题
  • metaGoalWorkEvidence 为详情预览和 metaGoalCitations 提供候选。后者处理显式引用和复用同次写回引用的简写形式。 候选与引用
  • read_todo_stride_meta_goal 按来源线索读取历史,无记录的 Todo 保持原详情。Dashboard 在任务详情展开相应内容。 原生读取 任务详情

对主干的风险 / Risks

[P2] 结算前的写回仍被列为可引用证据。 在 File 和 SQLite 上,先运行 refresh-state,再分别于 spend-slot 前后读取 Todo 详情。结算前只有工作写回行,尚无 quota_spend_commit,两次返回的 subsequent_evidence 仍逐字段相同。用同一份真实的历史调用提案资格函数,显式引用与简写引用在两种 provider 上均通过。未结算时单独尝试准入,guard 未发出后续复盘义务。此次未观察到实际后续决定提交。

settledTodoEvidenceRef 由写回绑定身份产生可回读引用。应在 metaGoalWorkEvidence 通过既有结算所有者核对同一个 Goal、Agent、Todo、Turn 和 effect 的提交事实,再用于预览和提案。历史仍可检查待结算的写回。建议用同一输入加入结算前拒绝、正常结算后接受的回归,并覆盖两种引用形式。 判定位置

正常任务生命周期、跨 Todo 拒绝、关闭后的历史读取和无来源 Todo 的故障隔离通过。聚焦的 Python 套件通过 167 项、跳过 10 项,99 项 TypeScript 检查通过,四种 provider 与提案形式组合复现资格问题。 精确头的 quick premerge 的 6 项直接检查与 4 项选定检查通过。 远端 CI 未查询。

我的整体评价 / Verdict

请求修改。此更新已能续写并恢复简写,且保留此前的默认关闭隔离。请将结算前的写回从后续证据资格中排除,同时保留现有历史引用的回读。三个相关 Dashboard 源文件与先前本地包截图对应的版本内容相同。桌面与窄屏截图可见问题、下一探针、结果和错误重试。精确头复验了 CLI 详情数据,当前头的完整打包浏览器流程与安装版仍待验证。

English verdict: REQUEST_CHANGES at ae2dfa1. Both File and SQLite list an uncommitted writeback as eligible subsequent evidence, and both citation forms pass the evidence qualifier without a quota receipt. The pending guard issued no follow-up obligation. Preserve history readback while requiring the committed settlement in the shared eligibility check.

if (order <= position || row.agent_id !== after.agent_id || observationTodo(row) !== todoId || isAccountingRow(row) ||
acceptedDecisionSource(row) || hasConflictingTodoSettlement(row) ||
!MATERIAL_DELIVERY_OUTCOMES.some(outcome => outcome === row.delivery_outcome)) return [];
const ref = settledTodoEvidenceRef(row);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 结算前的写回仍被列为可引用证据。在真实 File 和 SQLite 上,先通过 refresh-state 写回同一 Todo 的进展,再在 spend-slot 前后各读一次 Todo 详情。写回时只有 settlement_identity,尚无 quota_spend_commit,两次的 subsequent_evidence 引用与内容却完全相同。用这份写回的真实历史调用提案资格函数,显式 evidence_refs 和新增的简写引用均通过资格校验。单独尝试在同一未结算状态开启后续 Turn,guard 没有发出 Stride replan obligation,因此未提交后续决定。 在 metaGoalWorkEvidence 中从原有结算所有者取得该 Goal、Agent、Todo、Turn 和 effect 的已提交结果,再为预览和显式或简写提案提供证据资格。历史读取继续允许回看待恢复的写回;结算前后应产生不同的资格结果。

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · Gemini · Google · self_reported

动机 / Motivation

受影响对象: 使用 Stride(证据驱动重规划策略)管理长期任务,或通过 CLI 与任务抽屉查看 Todo 目标和历史依据的开发者与 Agent。

前后场景对比: 改动前,Agent 在某个 Todo 下记下元问题、判定标准和结论后,下一轮普通工作无法直接读取该开放元目标,Todo 详情和续做上下文也无法回溯其引用依据;同时无记录的普通 Todo 若触发全局日志扫描还可能受无关尾部损坏行牵连。改动后(提交 ae2dfa1),当元目标存在持久记录时,后续 Turn 与任务详情会按精确的 Goal、Agent、Todo 与作用域投影元目标(包含 previous_decision_ref 多跳延续继承问题与判定标准),但同一 Todo 上仅写回进度而额度尚未扣减的 Turn 仍会被直接列入可引用后续工作列表。

可观测结果与边界: 在 File 与 SQLite 隔离夹具上,开放元目标可跨普通 Turn 保留并在 2 跳按引用延续时继承原问题和判定标准,且 Stride 关闭与无记录 Todo 在附加 40,000 条普通日志及残缺 UTF-8 尾行时与基线行为一致;但尚未结算的写回记录仍会无差别进入 subsequent_evidence。 非目标: 本次不新增独立元目标状态机或自动修改历史记录,也不替用户自动完成任务或绕过现有结算和租约门禁。 剩余缺口: todo.stride_meta_goal.subsequent_evidence 与 metaGoalWorkEvidence 仍只按 runs/index.jsonl 过滤,未验证对应 Turn 的额度结算回执是否已提交(PRRT_kwDOStEbEs66gzDf 仍未解决)。

改动思路 / Approach

作者将 Todo 元目标直接挂接在现有的 autonomous_replan_ack 决策记录与 stride_decision 契约之下,而不是另建第二套 Todo 状态存储;在最新提交 ae2dfa1680 中又补充了按 previous_decision_ref 延续时复用原 objective、resolution_criterion 与同写回/前序引用证据的能力,降低了 agent_vision_json 1,800 字符预算下的重复序列化负担。

机制 职责分类 归属边界 激活与默认值 失败与恢复语义
normalizeMetaGoal 协议与校验 stride_policy.ts 仅当提交 stride_decision.meta_goal 时生效 缺前置引用或缺必填字段时拒绝写回
hydrateMetaGoal / todoMetaGoal 投影与延续继承 replan_context.ts Stride 启用或读取已有 Todo 详情时按作用域执行 来源不匹配返回空;读取失败返回 {"unavailable": True}
metaGoalWorkEvidence 后续工作候选过滤 replan_context.ts 存在未关闭元目标时筛选同 Agent/Todo 后续运行 当前缺口:仅查运行索引,未剔除未结算 Turn
read_todo_stride_meta_goal 只读适配与日志容错 replan_context_codec.py 先检查 Todo/Run 线索,无记录跳过日志扫描 非法作用域或未命中线索直接隔离,不读受损无关日志
TaskRequest UI 折叠展示与重试 dashboard detail.stride_meta_goal 存在时渲染 不可读时提供显式重试按钮

架构归属与当前边界: 元数据存储复用已有 runs/index.jsonl 与 autonomous_replan_ack 写入链路,由 TypeScript 控制面 owner 承担校验、延续继承与预览投影,Python 仅做作用域定位、文件读取适配和 CLI/Chat 展示;未引入平行状态文件。当前 PR 范围锁定在单 Goal 作用域下开放元目标的持久化、按引用延续、只读预览与前端任务抽屉展示,不改变全局调度或既有结算写入协议,仅需在现有 TypeScript 证据过滤边界接入已结算核验即可闭环。

具体改动 / Changes

精确头 ae2dfa168055c1434ae4d7821dd44bd294b273e9 相对基线 287616201b81b53824cae570265220ab4142a4b7 共改动 23 个文件(+780 / -20):控制面 TypeScript(replan_context.ts、stride_policy.ts、vision_checkpoint.ts、replan_semantics.ts、live_decision 输入透传等)、Python 编解码与读回接口(replan_context_codec.py、semantic_replan_writeback.py、list_readback.py、context_readback.py、todo_detail.py)、协议文档 docs/reference/protocols/goal-vision-replan-contract-v0.md、前端展示与测试。

自上次评审头 3041c11a 到当前 ae2dfa16:先合入最新主干基线,再新增按引用延续(允许后续轮次只传 todo_id + previous_decision_ref 并继承原问题/标准),同时补充 22 项前端/CLI 与 TS 单元测试。已验证 2-hop 延续可正常继承并完成决议;但未修改 metaGoalWorkEvidence 对额度结算状态的核验,PRRT_kwDOStEbEs66gzDf 仍未闭环。

关键代码讲解

  1. hydrateMetaGoal & metaGoalCitations:沿同 Agent、同 Todo、同 goal_instance_id 的决策链向前回溯 previous_decision_ref,当后续决策省略 objective 与 resolution_criterion 时从首条声明继承,并支持从同写回 path_delta.evidence_refs 或紧邻前序评审摘要回填 evidence_refs,避免每次复盘重复消耗 Vision 1,800 字符预算。
  2. metaGoalWorkEvidence & settledTodoEvidenceRef:负责在 after 决策之后扫描同 Agent、同 Todo 的实质性后续交付并生成 replan-evidence-* 引用,但仅检查 runs/index.jsonl 行属性(delivery_outcome、无冲突标记),既未接入 rollout-event-log.jsonl 也未调用既有结算读回边界验证 quota_spend 是否已提交。
  3. read_todo_stride_meta_goal:按 goal_id、todo_id、agent_id、goal_ref 先做范围线索判断,确认无记录的普通 Todo 直接返回空而不触碰共享日志;仅当 Todo 确曾写过元目标记录时才扫描日志并向 TypeScript 请求只读投影,在日志尾损时退回 {"unavailable": True} 供前端重试。
  4. list_goal_todos & TaskRequest:CLI 单 Todo 查询与仪表盘请求抽屉复用同一个只读投影结构展示问题、判定标准、动作、探针与可追溯证据引用,前端校验 goal_id、todo_id 与 stride_meta_goal.meta_goal.todo_id 三重一致性后才渲染。

规范对照(docs/reference/protocols/goal-vision-replan-contract-v0.md @ 3041c11a874bac4ccd8d959b4bb2206815376c)

本 PR 新增了 docs/reference/protocols/goal-vision-replan-contract-v0.md 的元目标延续规范文本,对照前次 maintainer 评审线程(docs/reference/protocols/goal-vision-replan-contract-v0.md,锁定审视版本 3041c11a874bac4ccd8d959b4bb2206815376c,对应审查意见 PRRT_kwDOStEbEs66gzDf):

  • MG-1(implemented):跨正常 Turn 持久化开放元目标,不向普通工作暴露关闭后的历史元目标——由 todoMetaGoal 与 test_todo_meta_goal_survives_turns_and_links_decisive_evidence 验证。
  • MG-2(implemented):previous_decision_ref 按引用延续继承原问题、判定标准并绑定同 Todo 证据,满足 1,800 字符 Vision 预算与普通关闭隔离——由 hydrateMetaGoal 与实测 2-hop / 40,000 行日志隔离反例验证。
  • MG-3(not_met):后续工作引用必须严格来自同 Goal 生命周期内同 Agent、同 Todo 已结算(settled) 的工作——未满足:metaGoalWorkEvidence 与 replan_context_codec.py 未核验结算回执,导致 spend_required 阶段即生成并暴露同构 replan-evidence-*。

对主干的风险 / Risks

[P2] 额度仍待结算时已将未结算写回作为 subsequent_evidence 暴露

  • 触发状态与复现路径: 对一个拥有开放元目标的 Todo,完成一次 refresh-state 写回进展(进入 settlement_progress.state == "spend_required"),暂不执行 quota spend-slot,直接通过 loopx todo list --goal-id ... --todo-id ... 查询。
  • 根因代码路径: replan_context_codec.py 仅向 TS 传入 runs/index.jsonl,而 metaGoalWorkEvidence 与 settledTodoEvidenceRef 只过滤 delivery_outcome、Agent、Todo 与冲突字段,未消费既有结算回读结果确认 quota_spend 回执已提交。
  • 实测错误结果: 在本机隔离的 File 与 SQLite 双后端上实测确认:扣额前(writeback_settlement_state: "spend_required",后续 Turn 触发 unsettled_host_turn_recovery)subsequent_evidence 就已列出 replan-evidence-58cf014b...(File)/ replan-evidence-0c0a8bd5...(SQLite);随后执行 quota spend-slot 扣额前后,subsequent_evidence 预览逐字段完全相同(identical_preview_before_and_after_spend: true),违反规范文档与未关闭线程 PRRT_kwDOStEbEs66gzDf 关于"subsequent settled work"的约束。
  • 最小修复与回归要求: 复用既有结算回读边界核验候选进展记录对应的 Turn 是否确已完成额度结算(覆盖仅写回待扣额与正常结算两个状态对照),并保留 test_todo_stride_meta_goal_cli.py 与默认关闭隔离。

其余行为隔离与本地验证摘要

  • 默认关闭与长日志损坏隔离(PASS): 在 File 与 SQLite 上对比基线 287616201b 与当前头 ae2dfa16:设置 execution-stride-strategy off、无元目标记录、向 runs/index.jsonl 追加 40,000 条普通记录及末尾残缺 UTF-8 字节 b'{"incomplete":"\xe2' 后,todo list --todo-id 与 quota should-run --codex-app 返回字段与决策与基线完全一致(无 stride_meta_goal,无误报 unavailable;File 耗时 0.522s/1.072s,SQLite 1.169s/1.052s)。
  • 2-hop 按引用延续(PASS): 实测初始化 -> hop1(省略 objective/resolution_criterion/evidence_refs)-> hop2(同上并发起 switch + resolution)在 File 与 SQLite 均完整继承问题与判定标准并将 evidence_refs 晋升至决策历史,完成后普通工作上下文不再附带活跃 stride_meta_goal。
  • 工具链与门禁检查:
    • npm run typecheck:control-plane 与 tests/control_plane_ts/{vision_checkpoint,replan*,stride*}.test.ts:PASS(203 passed, 0 failed)。
    • pytest -q tests/control_plane/test_todo_stride_meta_goal_cli.py:PASS(4 passed,File + SQLite × inline/by-reference)。
    • ruff check(11 个变更 Python 文件)、mypy、scripts/check_rfc_bilingual.py、loopx check --scan-path:PASS(0 错误;vision_checkpoint.ts:172 含 1 条非字面量告警)。
    • loopx canary premerge --tier standard --from-git-diff --git-diff-base 287616201b...:direct/catalog(10)/risk(8)/boundary(1) 共 19 项全部 PASS(0 失败);严格模式因只读工作树无变更质量收据返回 receipt_missing。
    • 前端构建:tsc --noEmit 与 vite build PASS;smoke:todo-ownership 在基线与候选均在预设文本断言失败(归因既有基线无关)。未查询远程托管 CI。

语义与 CI 对齐

本 PR 在 stride_decision 契约上新增可选 meta_goal 字段与只读投影结构 stride_meta_goal / todo_meta_goals,属于受控的领域策略扩展(extend_vocabulary)并已同步更新 stride_decision_schema.json、goal-vision-replan-contract-v0.md 及 semantic-vocabulary-drift-smoke.py(通过),双语 RFC 差异门禁通过。唯一未对齐点在于将未结算 Turn 纳入 "settled work" 引用过滤条件。

我的整体评价 / Verdict

  • 长程与用户体验评估: 长程维度 accepted_tradeoff(2-hop 按引用延续保留了跨 Turn 问题与证据连续性,但在结算前即暴露候选证据存在未决失真风险);用户体验维度 accepted_tradeoff(前端和 CLI 详情能按需折叠显示问题与证据,且未牵连普通任务详情)。视觉评审: apps/presentation/dashboard 前端源码自 82af215 起无任何改动(与当前精确头 0 字节差异),本轮已在本机验证 tsc --noEmit 与 Vite 生产构建通过,smoke:todo-ownership 在基线与候选均因同一预设标题断言失败(与本次无关);本轮未重开打包浏览器检查。 未覆盖边界: 当前精确头 ae2dfa1 未重跑打包浏览器桌面端/窄屏截图检查(仅依赖 82af215 既有评审捕获与本头 0 字节前端源码差异及自动化构建),已安装桌面客户端及真实用户长期演化轨迹未覆盖。
  • 可观测语义与变更体量: 禁用与无记录路径与基线完全一致(observable_semantics 因未结算证据提前曝光判定为 unintended_drift);23 文件 +780/-20 主要集中在 TS 逻辑与测试,增量延续修复精炼、无平行写入所有者,属 necessary / proportionate(架构评估 retain — 元数据存储复用已有 runs/index.jsonl 与 autonomous_replan_ack 写入链路,由 TypeScript 控制面 owner 承担校验、延续继承与预览投影,Python 仅做作用域定位、文件读取适配和 CLI/Chat 展示;未引入平行状态文件。当前 PR 范围锁定在单 Goal 作用域下开放元目标的持久化、按引用延续、只读预览与前端任务抽屉展示,不改变全局调度或既有结算写入协议,仅需在现有 TypeScript 证据过滤边界接入已结算核验即可闭环。),无多余权限扩张。
  • 残余风险: 除上述 P2 阻塞项外,未覆盖跨多进程并发写入期间的实时浏览器实景与真实生产长周期演化收益验证;replan_context_codec.py 在真实历史很长时若该 Todo 已存在过元目标记录,仍会读取共享日志文件。
  • 结论: 请先补齐未结算写回在 metaGoalWorkEvidence / 结算读回中的资格校验以关闭 PRRT_kwDOStEbEs66gzDf,并补充 Writeback-only 与 Settled 对照回归后再复审。

English verdict: REQUEST_CHANGES at ae2dfa1. The by-reference continuation and default-off isolation pass on File and SQLite, but unsettled writeback work in spend_required state is still surfaced as eligible subsequent_evidence on both backends.

…ride-meta-goal-runtime-20261122

Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

用户通过 Todo 详情继续或回顾已经持久化的 Stride 问题。 上一提交从已有决策历史读取原问题。 在 File 和 SQLite 上,先用普通 CLI 建立并结算一个有效的 Stride 问题,再给独立的 quota rollout log 加一条已换行的损坏记录。相同读命令在上一提交仍显示原问题、准则及决策,新头却将整个 meta-goal 降为 unavailable。恢复 log 后原问题重新出现。已记录的问题及其定义仍完整。 新头用 quota receipt 校验供新决策引用的同 Todo 工作。 范围为已有问题读回和后续证据资格。

改动思路 / Approach

继续复用现有 Stride 决策和 quota settlement owner。 已记录的定义以及后续工作能否作为新证据分开判断。 让持久决策的定义读回独立于后续证据资格。保留已有问题、准则和决策,结算来源不可读时单独标记后续证据不可用,并继续拒绝使用无法核验的引用。

具体改动 / Changes

逐项检查当前头 870e041 和 merge base c563a47,26 个文件,+940/-36。检查了 Todo 详情、活跃 Turn 投影、当前结算身份、重规划写回以及客户端呈现。decision_readback 记录已保存问题的读回,settled_citations 记录新引用的结算资格。 评审依据为 c563a47。 目标规范

关键代码讲解

  • readAndProjectReplanContext 在项目级别加载结算快照。 读取
  • readQuotaSettlementSnapshot 的默认分支拒绝损坏的 rollout 行。 原 owner
  • CLI 同时覆盖两种存储、要证据的批准和中断恢复。 源用例

对主干的风险 / Risks

[P2] 独立结算日志的损坏隐藏了已保存的 Stride 问题。 在 File 和 SQLite 上,先用普通 CLI 建立并结算一个有效的 Stride 问题,再给独立的 quota rollout log 加一条已换行的损坏记录。相同读命令在上一提交仍显示原问题、准则及决策,新头却将整个 meta-goal 降为 unavailable。恢复 log 后原问题重新出现。已记录的问题及其定义仍完整。 让持久决策的定义读回独立于后续证据资格。保留已有问题、准则和决策,结算来源不可读时单独标记后续证据不可用,并继续拒绝使用无法核验的引用。 用户失去原问题和准则,也难以区分历史定义不可读与下一份证据不可核验。

8 项真实 CLI 用例通过,覆盖 File 和 SQLite、内联和引用、扣额与合法无扣额。定向 28 项 TypeScript 测试通过。写入前无结算的结果不再成为新引用,已结算的证据可以正常引用。 标准预合并中的语义词汇检查在并发负载下到时,局部验证和结果独立记录。 本轮独立复现了 File 和 SQLite 的 Todo CLI 数据故障,未复验当前提交的已安装桌面体验。

我的整体评价 / Verdict

请求修改。继续复用现有 Stride 决策和 quota settlement owner。 已记录的定义以及后续工作能否作为新证据分开判断。 当前健康读回已证实,独立日志故障的读回范围仍需收窄。 补上有效原问题与不可核验的新证据同时出现的回归。 已有作者截图展示正常历史内容,当前问题出在故障时的详情数据。 本轮独立复现了 File 和 SQLite 的 Todo CLI 数据故障,未复验当前提交的已安装桌面体验。

English verdict: REQUEST_CHANGES at 870e041. The newly enforced settled-citation check works on healthy File and SQLite. An unrelated corrupt rollout record hides an otherwise intact saved question. Keep stored question and decision readback separate from the availability of prospective citation evidence.

}
owner = {kind: "exact_source", goalRef: parsed.value};
}
const snapshot = await readQuotaSettlementSnapshot(runtimeRoot, goalId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 在 File 和 SQLite 上,先用普通 CLI 建立并结算一个有效的 Stride 问题,再给独立的 quota rollout log 加一条已换行的损坏记录。相同读命令在上一提交仍显示原问题、准则及决策,新头却将整个 meta-goal 降为 unavailable。恢复 log 后原问题重新出现。已记录的问题及其定义仍完整。 让持久决策的定义读回独立于后续证据资格。保留已有问题、准则和决策,结算来源不可读时单独标记后续证据不可用,并继续拒绝使用无法核验的引用。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants