Skip to content

Keep saved research cases in place across desktop reopening - #8868

Merged
loopx-agent merged 2 commits into
mainfrom
codex/research-case-reader-delivery-20261116
Nov 16, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/research-case-reader-delivery-20261116

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

显式打开已保存的案例时,前端仍会立即拉取完整 Explore 历史;退出桌面后,原生偏好只恢复 Goal,丢失解读模式、版本和章节。这个修复将两处中断合成一条阅读流程:先读所选案例,按需打开完整历史,普通退出后在新的本地服务端口恢复同一解读和章节。

Related to #8745 and #8595. Base: main, verified at cac86bb.

Author Declaration

Written by: OpenAI Codex model agent.

Implemented against the Research Workspace contract in docs/development/design.md and the native source-Goal journey in docs/development/frontend-delivery.md, at the base above.

Criterion Disposition Implementation / evidence
Same Goal, registered version and chapter after reopening implemented Existing native workspace_location owner; persisted v1 preference stays compatible
Explicit case reading defers original history; full history remains available implemented Existing GoalResearchHistory fetch effect; opening history retains its source-scoped read
Invalid, foreign, remote and duplicate selections do not gain local authority implemented Existing origin/source guards plus scoped bookmark validation
Desktop, narrow layout and failed-read recovery implemented Packaged reader with real read-only backend; synthetic visual capture below
Official installed App adoption deferred Isolated native QA is complete; this PR does not claim an installed upgrade

Scope And Continuation

Three paths: native presentation preference, its existing README, and frontend history loading. Case/history are reused local presentation values; there is no new shared protocol vocabulary. The native parser is shared by close-time capture and preference recovery. Original analysis/source ownership, ordinary history defaults and explicit model execution remain with their existing owners.

The reading repair is complete within this scope. Broader research-quality and installed-adoption acceptance remain open. The native and frontend changes can be independently reverted.

Validation

Tested revision: 7e8f597. Run state: finished.
Input classes: synthetic, public_fixture, authorized_private_read_only.

Check Result Evidence / limitation
npm run build:chat passed TypeScript checking and exact-source packaged assets
Native workspace regression suite passed 17 tests: port changes, scoped pack/chapter/citation, legacy preferences and rejection paths
cargo fmt --check passed Native source and tests
Standard canary premerge passed Four direct checks, 19 selected checks, exact-scope quality receipt and public-boundary scan
Real packaged reader passed Explicit saved case reads no Explore pages initially; selecting history reads all 113 retained records; repeated view switches do not repeat that scan
Failed source and recovery passed ANN stays in case mode, exposes retry and restores the same version/chapter
Native window close/reopen passed Production native owners with the combined packaged frontend, separate QA identity and read-only source backend; new loopback port preserves the selected Codec chapter
Official installed App not_run No production replacement/restart
Remote CI not_run Not queried or awaited under the configured policy

The first Cargo attempt failed because the clean checkout lacked its generated desktop runtime resource. Building the exact committed runtime resolved that prerequisite; the subsequent suite passed. No benchmark, model call or original source mutation was initiated.

Visual Evidence

UI impact: changed loading and restoration behavior; the existing visual design is retained.
Source data: synthetic. Both captures use this head's packaged frontend and a disposable real backend. They demonstrate the retained conclusion-first reader and its ordinary history control; they do not represent a benchmark result or an installed App.

Packaged case reader, desktop, synthetic data Packaged case reader, narrow, synthetic data

The conclusion remains the primary reading region. Chapters and full history are available through existing controls; evidence and limitations remain expandable. The expanded and source-error states were checked separately. Before/after pixels are unchanged, so one current capture per viewport is used; the observable delta is the unnecessary background scan and native reopening behavior above.

Boundary Checklist

  • Public diff, text and attachments contain no private state, raw trajectories, credentials or local paths.
  • No paired RFC changed; bilingual diff check passed.
  • Both commits retain their DCO sign-off.
  • This is an author proposal; independent review and merge qualification remain separate.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 75d819552c099b52e517538ddf8d957104500716)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
(cherry picked from commit 61ec7db796f3aa70aec2305ea3b1a3161c433caf)

@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.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

动机 / Motivation

用户在本地 Goal 中阅读已保存的研究案例,稍后重开桌面或返回章节时,需要继续读原来的结论与依据。相同的 113 条历史样本,基线打开显式案例就读取 3 页;候选先显示案例,主动打开研究历程后才完整读取,反复切换也不重复扫描。原生偏好恢复原先遗漏的阅读选择。已在真实 HTTP/SQLite 后端上验证案例、完整历史、版本与引用恢复;同一份原生读写反例在基线丢失研究选择,在候选保留新端口上的同一 Goal、包与书签。本次限定本地阅读连续性;不执行研究任务、不授予远端权限,也不证明实体 App 关闭重开、正式安装升级或模型收益。

不处理时,案例越积越多,每次重开仍承担完整历史读取;原来的版本和章节也需要重新寻找。截短历史会丢失证据,单独保存整个 URL 又会把旧端口或来源带入恢复,因此这两种更小的表面修补都不满足阅读任务。

改动思路 / Approach

阅读意图由现有 URL 和原生本地偏好拥有,内容仍由注册分析包与 Explore 所有者提供;没有新增可执行权威或第二份研究状态。本 PR 保持一个历史读取 effect 和一个原生偏好读写所有者,只扩展按来源隔离的阅读选择与其现有校验。显式案例入口先读取分析目录;目录正在加载或读取失败时保留案例语义。只有明确无案例的成功结果才回到历史。用户主动打开研究历程后,同一来源的读取继续完成;切回案例不取消在途分页,也不重复扫描。

原生端只保存阅读意图:模式、已选择包和章节/引用标记。它们由既有按钮、版本选择器及目录链接产生,现有关闭/启动调用消费偏好;不需要新增准备或确认轮次。pack 是否存在、来源是否可读仍由真正的目录和后端判断。原生验证与内容所有者承担不同职责,保留这些边界比建立第二份缓存或偏好服务更简单。

以下为同一合成样本的执行观察,精确 head 为 7e8f597:

操作 基线 候选
直接打开显式案例 读取 3 页历史 初始历史读取为 0
主动打开研究历程 113 条完整记录 113/113,仍为 3 页
读取中切回案例、再反复切换 原分页契约 完成全部页,不重扫
偏好经写入、读取并换端口恢复 遗失 research_goal,独立断言失败 保留同一 Goal/包/引用,独立断言通过

具体改动 / Changes

完整差异为 3 个文件 +246/-11。React 部分复用原分页 effect;Rust 部分在现有本地偏好所有者内增加选择解析及相关回归;README 说明可恢复内容、重新校验和旧版本兼容,没有新增依赖或生成资源提交。

依据 docs/development/frontend-delivery.md,固定版本 02cc338,Workspace reading and request continuity 在本 head 为 implemented:选择按来源/Goal 隔离,完整分页及错误契约保留,缺失版本不能静默替换。同时对照同版本 Research Workspace 设计,结论、目录、证据和未知状态仍可阅读。

关键代码讲解

  • GoalResearchHistory 将显式案例与原默认路径区分。hasCases、loading/readError 决定是否延迟读取;openedHistorySource 绑定 Goal、原始 Goal 和读取来源,只记录当前阅读意图。未显式选择案例的默认入口仍读取历史,已实际检查该行为。
  • ResearchReading::selections 复用 case/history 词汇,限制包 digest 和章节语法,并要求书签属于选中的包;history 不携带章节。capture 与持久化解析都经过同一验证,避免两个输入路径规则漂移。
  • LocalWorkspace::capture 只接受现有本地 origin 与工作区路径,继续拒绝重复 query、foreign origin 和远端来源;research_goal、analysis_goal 与当前 Goal 一致时才保存相应选择。
  • LocalWorkspace::destination 使用启动时的新 origin 重建 URL,不回放旧端口或原始来源 URL。from_value 仍接受缺少 research 字段的 version-1 偏好;重开后的包注册和原文读取继续走真实后端。

对主干的风险 / Risks

最强反例包括:案例模式被错误当成无历史、切换时取消后续页、旧 Goal 的包串入新 Goal,或持久化书签越过来源权限。我用候选真实 Chat 资产连接生产 HTTP/ChatStore/SQLite,保留 113 条历史、两版长中文案例、失败候选和未知保留状态。读取中的模式切换完成了三页;另一个 Goal 显示自己的案例和一条历史。实际 503 保留案例错误与重试,恢复后包与章节不变;成功空目录才显示 0/0 历史。

引用入口真实读出了 facts.txt 第 4 行;刷新重新定位同一原文,Escape 回到原章节。尝试切换到未连通的只读来源时,旧案例被隐藏;移除该临时来源后,原包和章节重新可读。该测试来源因跨来源连接失败而不可用,不把它解释成产品回归或远端成功验收。合成源文件保持原字节,后端 mutation_attempts 为零。

PASS:实际 native crate 的 17 项 workspace 测试、29 项研究分析 API 回归、base/head Chat 构建、native fmt、desktop runtime bundle 和标准 premerge。另用原样复制的 base/head 偏好模块加同一独立断言,执行 capture→原子写入→读取→新端口 destination:基线缺失研究选择而失败,候选三项通过;foreign/remote/重复 query/旧 v1 控制也通过。最初两个 checkout 均因缺 dashboard 依赖构建失败,完成各自锁定依赖安装后才获得实际用于测试的成功资产;没有放宽检查。

语义与 CI 对齐

现有本地偏好格式是本次受影响的持久化边界;新增字段表示局部阅读意图,沿用既有词汇,不是通用控制面词汇或权限生命周期。旧 v1、无显式 case 的默认路径、完整历史以及包/来源重新校验均有保留证据。CI 未查询、未等待,结论依据独立的当前验证。

我的整体评价 / Verdict

APPROVE,适用于精确 head 7e8f597;通过 GitHub author-owned 的 COMMENTED fallback 发布。交付判断为 goal_achieved,限定到已验证的本地阅读连续性。long_horizon=improved 表示重复阅读成本和位置恢复得到改善,user_experience=improved 表示既有意图被复用、完整证据和真实错误仍可到达;不据此宣称模型质量或整个长程项目完成。observable_semantics=intentional_change_validated。

已实际检查构建后页面的桌面和窄屏默认、展开原文、来源失败与恢复;长中文、两份案例版本和下部证据区仍能区分结论、未知与原始依据。未检查实体 App 窗口关闭重开、官方安装包、其他操作系统或真实远端来源;跨来源失败用于验证旧内容隐藏和本地恢复,未宣称远端成功接入。验证边界是构建后网页、生产本地后端和原生偏好所有者;未将两段分立验证写成实体窗口端到端通过。改动与现存故障相称,沿用当前所有者的解析与分页便已完成有用切片;没有必要新增迁移服务或再拆模块。未发现当前阻塞 finding。后续 closeout、merge-readiness 与合并授权仍单独核对,本次不执行合并。

English verdict: APPROVE — explicit saved-case reads avoid eager history, full history remains accessible, and scoped native reading selections pass independent persistence and recovery checks.

@loopx-agent
loopx-agent merged commit 6cb5499 into main Nov 16, 2026
44 of 54 checks passed
@loopx-agent
loopx-agent deleted the codex/research-case-reader-delivery-20261116 branch November 16, 2026 15:42
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.

1 participant