Skip to content

feat(workspace): read archived Goal executions on demand - #9436

Merged
huangruiteng merged 4 commits into
mainfrom
codex/research-source-execution-readback-20261125
Nov 27, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/research-source-execution-readback-20261125

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Expand a row in a linked Goal’s Historical executions to read the archived decision for that execution. The status response provides a source-bound reference. The read-only Chat endpoint resolves it through the registered source’s native history and returns the original decision fields and artifact digest. Missing records keep the index summary visible and can be retried from the same row.

Scope

The change covers the existing recent-execution drawer in packaged Chat. It supports relocated archives and preserves the original Goal and Turn identity when workspace aliases coincide. The list still shows the recent status window. Signed desktop installation, standalone prepared pages, and SSH validation are outside the evidence below.

Validation

  • python -m pytest -q tests/presentation/test_linked_goal_sources.py covers the HTTP owner with two separately bound archives, including duplicate original identifiers, source mismatch, missing original, wrong Turn, restore, byte digest, and unchanged source files.
  • npm run build:chat and npm run test:native-decision-read passed on the packaged frontend.
  • Packaged Chat against an isolated SQLite-backed workspace at 1440 and 390 CSS pixels. Verified keyboard expansion, a deferred read, index summary on a missing record, in-place retry after restore, and the recovered original decision without horizontal overflow.

Follow-up validation

  • Packaged Chat at 60645c0083 read back ten recent executions from two retained archives with the same original Goal ID. All fields and artifact digests matched the source files, four cross-source requests returned 409, and 260 source and fixture files were unchanged.
  • Three browser jobs timed out in chat-recovery on an obsolete collaboration-card assertion. The same failure reproduced on the exact merge base. PR #9437 updates the reason and recipient assertions. The full packaged chat-recovery scenario passes locally with the corrected test on both the base application and this exact feature head. Remote CI and review remain pending.

Long-archive correction

The execution endpoint uses the selected run’s recorded instant to query the registered source’s native History. It checks complete coverage of that instant, requires one matching source-bound reference, and verifies the original artifact. The same reference can still open after newer runs move it outside the recent list.

  • The independent review fixture contains 5,100 indexed rows. With the released LoopX 2.4.1 source CLI and isolated SQLite, the unfiltered response was 19,026,983 bytes. The selected 1,851-byte artifact returned HTTP 200 and its original SHA-256 in both the short and full archives. Source bytes were unchanged.
  • The linked-source suite passed 28 tests at 21a6b5b5dfa9, including an outdated summary, a timestamp/source mismatch, two matching index entries, a missing artifact and recovery. The exact-head Chat bundle build and native decision renderer passed.
  • The packaged Chat browser reopened the original execution at 1200 and 390 CSS pixels. Temporarily removing the synthetic artifact left the index summary visible, and Retry recovered it after restoration. These captures use the isolated fixture.

Desktop

Archived execution at 1200 CSS pixels

Narrow layout

Archived execution at 390 CSS pixels

Exact-head follow-up

An independent read-only review approved the archive-window correction at 21a6b5b. Its comparison reproduced the old HTTP 503 and the candidate's HTTP 200 for the same artifact. It also reproduced HTTP 503 when 5,100 runs occupy one microsecond and the filtered response itself exceeds the existing transport limit.

  • Packaged Chat read 20 original artifacts across four retained archives. Their Goal, Turn, decision fields and SHA-256 values matched the original files. The 286 indexed executions had distinct timestamps within each source. Four cross-source requests returned 409, and 580 source files kept their original bytes.
  • A prior main-branch run and this head reported the same PostgreSQL conformance assertion. The logs identify the failing ladder row, and the exact TAP subcase is still unavailable. This head · Prior main run

Release browser replay

The hosted browser check reached the installed wheel and timed out in the defer explanation in chat-recovery. Its candidate producer used product commit a382a9eebcab, which has the same source tree as this PR head, with an empty browser-fixture overlay. Hosted browser job

  • A macOS replay used the same checksum-verified CI wheel and Python 3.11. The original fixture reproduced the same timeout. Applying the single reviewed fixture from test(workspace): verify deferred handoff details in Chat smoke #9437 made chat-recovery pass with the wheel bytes unchanged. The affected local browser partition then passed all 29 scenarios and both team companions. Fixture correction
  • The hosted check still reflects the original fixture. The frozen-candidate overlay allowlist currently omits chat-recovery.mjs, so that workflow route does not carry this fix into an already built candidate. Fixture selection

PostgreSQL conformance diagnosis

The hosted PostgreSQL job stopped at shared managed-claim conformance. The exact CI candidate source and the tested main source each reproduced six expiry and recovery failures on isolated PostgreSQL 16.15 with Node 22.22.3. The test clock assumed a 45-minute lease after #9487 changed the default to three hours.

Applying only the fixture fix to the same CI candidate source changed the local result from 395 to 401 passing tests with zero skips. The hosted job on this PR still reflects the original fixture. Hosted job · Fixture fix #9496

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

通过已关联的归档 Goal 查看历史执行来源的操作人员和依赖原件的后续核验。原 Goal 的累计历史超过源读取的 16 MiB 上限,用户展开的当前记录仍完整且只有 1,851 字节。小索引能读取原记录并验证内容 digest,缩小索引后可再次采用同一引用。已打包的 Chat 在 1200 和 390 CSS 像素可保留索引摘要和 Retry。

On-demand original read。独立 SQLite fixture 有 5,100 条正常索引和对应原件,状态页仍显示最近 5 条,同一引用的详情返回 HTTP 503。完整历史 JSON 为 19,016,869 字节;将索引缩到 3 条后,原件以同一 digest 返回 HTTP 200。 当前结论来自本地 SQLite 原始来源、真实 Chat HTTP 和打包浏览器。SSH、签名桌面、Standalone 与托管 CI 未纳入。 PR 交付目标

改动思路 / Approach

原始来源注册与复核由 GoalSourceReader 持有,native history 提供持久索引,Chat 只读展示单条执行。已打包 Chat 的历史执行行 → GoalSourceRequestMixin → GoalSourceReader.execution → 源历史 CLI 和原件。

先由已有 history owner 按来源和引用作有界查询,只将匹配结果传回详情层。继续拒绝歧义、错源和原件不一致,保留单条大小上限,并加入长归档正例。

具体改动 / Changes

精确 head 60645c008309641f5bec43ec0fc8d41a39ea2c5f,目标分支快照与实际分叉基线均为 b34f0e6157968251dedbd88552ccad34c4fdeef9。10 个文件,+276 / −48。新增已有抽屉的懒加载详情、源绑定回执、只读 HTTP handler 及隔离测试。

关键代码讲解

  • GoalSourceReader.execution。先读取旧源历史,再按引用筛选唯一行并复验注册,整个历史传输在筛选之前。 源码
  • GoalSource.read_run_history。通过 native history CLI 读取高上限索引结果,调用走既有 16 MiB transport。 源码
  • GoalSource.read_execution。读取选中原件,验证原 Goal/Turn 和其他索引身份,再返回摘要与 digest。 源码
  • GoalSourceRequestMixin._goal_source_execution。环回 HTTP 入口重新核对注册绑定,异常映射 503 或 409。 源码
  • SourceRun。展开行时请求详情,处理失败、原件与索引摘要重试。 源码

对主干的风险 / Risks

[P2] 整份历史超过传输上限后,选中的短原件也无法读回

详情可用性取决于未选中的历史记录。持续积累会让近期条目显示可展开但整批无法读取,用户重复点击也不能恢复。 触发点是单条查询先请求全部历史 JSON,再按引用做唯一行匹配。先由已有 history owner 按来源和引用作有界查询,只将匹配结果传回详情层。继续拒绝歧义、错源和原件不一致,保留单条大小上限,并加入长归档正例。 调用位置

语义与本地验证

27 项真实 Chat 来源测试、打包构建、原生决策读取测试和标准 premerge 通过。额外精确头 HTTP 对照和浏览器验证复现长归档故障。 浏览器在同一大归档点击 Retry 后继续显示失败。

我的整体评价 / Verdict

REQUEST_CHANGES。 保留原件、源身份与 digest 的校验,先把单条匹配放入现有索引读取边界。长归档中的近期条目应能与小归档一样完成读取和验证。实际打包 Chat 的失败提示和 Retry 与原回合标识在宽窄屏均可见。折叠态仅检查了浏览器语义结构。签名桌面、SSH 和独立预制页面未经实际验证。

English verdict: REQUEST_CHANGES. Resolve one source-bound execution within the history owner so unrelated archive volume cannot prevent reading an intact selected record.

raise SourceScopeError("Choose one recorded source execution")
self.registered_status(goal_id, fresh=True)
source = self.source
history = source.read_run_history(goal_id)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[P2] 独立 SQLite fixture 有 5,100 条正常索引和对应原件,状态页仍显示最近 5 条,同一引用的详情返回 HTTP 503。完整历史 JSON 为 19,016,869 字节;将索引缩到 3 条后,原件以同一 digest 返回 HTTP 200。 先由已有 history owner 按来源和引用作有界查询,只将匹配结果传回详情层。继续拒绝歧义、错源和原件不一致,保留单条大小上限,并加入长归档正例。

…chive-execution-bounded-read-20261126

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…on-bounded-read-20261126

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

在 Chat 中查看链接 Goal 的用户,需要从近期执行中打开某一轮的原始决策、回合身份及来源。 主干的历史抽屉提供索引概要。先前 PR 版本已经增加详情读取,但一次加载整个原生历史,在大归档上让已有行返回 HTTP 503。

候选试图按所选执行时刻缩小原生读取范围,同时保留原 Goal 身份和唯一性校验。用户能在同一列表打开、重试和核对原始内容。 257 行的原生输入让旧版本在超出 16 MiB 后返回 503,当前版本仍返回已选记录。打包 Chat 独立观测缺失时 503、恢复同一文件后重试 200,原摘要和摘要散列可读。 本轮独立验证源码运行、真实 SQLite 和打包浏览器。签名桌面 WebView、SSH 源和远端 CI 尚未独立运行。

改动思路 / Approach

使用现有源注册、同源路由和 native History owner。详情按需读取的差异只落在已有历史抽屉与对应的源读取适配层。 交付的是已打包 Chat 的链接 Goal 只读旅程。当前状态窗口、原始档案存储、链接权限与历史聚合保持各自 owner。

采纳既有评审经验中的首次可用结果与恢复检查。优先验证从现有 Goal 概览发现入口、打开记录、保持失败提示及成功读回。没有混用已安装 WebView 与打包浏览器证据。

具体改动 / Changes

来源核对精确提交 21a6b5b5dfa96aaa5b6f592858f30cd02642a6b9 和不可变基线 e9bcad9aab48842459252c7347bd8fdbdde866db,10 个文件,+371/−53。基线契约

  • C1。Chat 通过已配置目录与原 owner 读取链接 Goal,保留 workspace 别名和原始身份。 跨源和不匹配时刻明确拒绝,原始 Goal、Turn 和散列与原文件一致。
  • C2。原生历史的读取、失败、重新打开及读回都能从同源界面完成。 打包 Chat 1200/390 下失败保持摘要,恢复同一文件后重试成功并展示来源。
  • C3。浏览器、后端和已安装 WebView 的验证边界分别披露。 真实 SQLite HTTP 和打包 Chat 已独立运行,未以其替代签名桌面或 SSH 验证。

关键代码讲解

  • GoalSourceReader.execution。按记录时刻查询原源的完整时间窗口,再校验唯一条目、实际文件与注册状态。 源码
  • GoalSource.read_execution。按原 Goal 的 artifact 身份读原始文件,返回实际内容摘要和受控字段。 源码
  • _goal_source_read。保留现有同源约束、准确 Goal 别名及 namespace,并在返回前确认链接。 源码
  • SourceRun。只在展开时调用读取入口,保留索引摘要并提供同处重试。 源码

对主干的风险 / Risks

旧执行被近期列表淘汰,或所选记录暂时缺失、来源变动、索引同一时刻过大。 同名 Goal 的域不混用。跨源/错误时刻/重复索引/不匹配身份明确拒绝,原文件缺失时保留索引并可重试。先前未限时刻的请求在大历史上确实失败。 保留已列摘要,补齐相同原源和记录后原地重试。对聚集在同一微秒而超过既有传输上限的归档,仍受原有预算,后续若需要更大窗口可让源 owner 提供精准索引读取。

语义与 CI 对齐

当前候选的 28 项源级 Chat 测试通过,原生决策 renderer 和打包 Chat 构建通过。1200 和 390 CSS 像素验证了实际打开、恢复、正文及精确摘要,窗口和面板均无横向溢出。 标准本地 premerge 的 6 项直接检查和 18 项选中检查无失败。DCO 和三方合并预演通过。 本轮独立验证源码运行、真实 SQLite 和打包浏览器。签名桌面 WebView、SSH 源和远端 CI 尚未独立运行。

桌面抽屉旁保留 Goal 概览,窄屏独立占满面板。除确认暂缺的回合仍能读到索引之外,还独立展开了深层来源面板,实际读回了原决策和同一 SHA-256。 画面为作者提供的合成数据样例。桌面 1200 像素 · 窄屏 390 像素

我的整体评价 / Verdict

APPROVE。 受检的打包旅程可以打开并恢复归档原始记录。远端部署证据保留现有边界。 从大量历史恢复原始执行证据可复现。缺失时保留原回合身份与可操作恢复路径。 普通旅程是打开历史抽屉并展开一行。缺失时无需更换 Goal 或重建链接,恢复后在同一行重试。 检查实际打包 Chat 的历史抽屉、缺失提示、同处重试及原始内容。沿用历史抽屉的现有断点,新增折叠内容在桌面和窄屏都独立检查。 未运行签名桌面 WebView 或 SSH source。

English verdict: APPROVE at 21a6b5b. The packaged Chat reads the original linked execution after history growth, preserves source identity, and retries the same row after a missing artifact. The independent browser run covered desktop and narrow viewports. Signed desktop and SSH were outside this run.

@huangruiteng
huangruiteng merged commit 11a3b9a into main Nov 27, 2026
42 of 64 checks passed
@huangruiteng
huangruiteng deleted the codex/research-source-execution-readback-20261125 branch November 27, 2026 14:52
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