Skip to content

fix(goals): retain evolving outcome requirements beyond legacy capacity - #8755

Merged
loopx-agent merged 4 commits into
mainfrom
codex/outcome-capacity-recovery-20261114
Nov 14, 2026
Merged

loopx-agent merged 4 commits into
mainfrom
codex/outcome-capacity-recovery-20261114

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A long-running Goal can reject a genuine correction when its cumulative declarations reach 128 KiB or an outcome already has 32 requirements. Recording the correction only in Vision leaves it outside canonical acceptance.

This PR delivers a usable recovery path: retain the same Goal/outcome, opt into record storage with the authorized refinement, and persist the next requirement without deleting or summarizing earlier commitments. It also supports bounded partial reviews, including the normal same-batch refresh-state evidence writeback.

Related: #8752 (broader proposed evolution design). Base: main; implementation started from dd53ca52184cb6283e4728301fa996f8cd7b2ca0. This is the immediate capacity-recovery implementation, not a claim that every milestone in that proposal is complete.

Author Declaration

Written by: model_agent — OpenAI Codex.

Implemented against the existing outcome/lifetime/CAS contracts in docs/architecture/rfcs/goal-outcome-refinement-v0.md and loopx/control_plane/goals/ at dd53ca5218, plus the concrete request in this PR for lossless capacity recovery. The existing RFC pair is updated together.

Criterion Disposition Owner / evidence
Preserve original identity, requirements, origins, ordered work and reviews implemented TypeScript outcome owner; File/SQLite migration, restart and historical-receipt tests
Add a correction at the old byte and collection boundaries implemented 131,055-byte / 32-requirement fixture accepts requirement 33; separate coverage crosses 24 outcomes and 64 origins
Keep authority, independent checks, CAS and exact retry semantics implemented foreign-owner/stale-CAS/ambiguous reply/replay and legacy parity cases
Review a bounded subset without refreshing other evidence implemented per-item basis; same-batch Explore link and negative cases
Objective replacement, withdrawal and atomic objective-plus-condition amendments deferred existing proposal/apply/adopt remains authoritative; broader design in #8752

Self-check: inspected the complete diff, production callers, persisted-format/lifecycle writers and retry contract; ran the validation below. No independent approval is claimed.

Scope And Continuation

  • storage_format: "records" explicitly selects loopx_goal_outcome_records_v1 in the same authorized refinement/CAS transaction. Preview, read and installation alone do not migrate. Existing v0 behavior and limits remain.
  • Record pages retain exact data and ordered inventory digests; operation and page budgets remain 128 KiB. The collection length is no longer the mutation budget. New receipts recover the current projection without copying the growing declaration into every receipt.
  • review_patch reviews up to 32 named requirements. Each retains its own basis; complete review still requires complete coverage. Configured independent checks retain authority.
  • CLI and native conversation adapters share the TypeScript owner. App Supporting outcomes → Add a requirement explicitly selects records in its request; there is no additional configuration editor or approval round.
  • Bounded refactoring: extracted the storage codec and reused one prospective-work basis for complete/partial reviews; cached the shared outcome basis within projection.
  • Remaining boundary: pages still reside inside the whole authority snapshot. Reads/writes and context still grow; this is not indexed persistence, record-level concurrency, unlimited transport, model-benefit qualification or a completed multi-agent adoption journey. R4/R5 follow-on work remains under the existing design, not a second mutation owner.
  • Rollback requires a record-compatible runtime after cutover. An old snapshot must never replace new commitments.

Use after deployment

Keep the original refinement document and outcome id; add "storage_format":"records". Inspect the current provider revision, preview with goal-acceptance refine, then execute the unchanged prepared operation. Native refine_outcome accepts the same field and source_summary; its host supplies identity. After a confirmed rejection, changed intent gets a new operation id; ambiguous operations must first be recovered unchanged. Later maintenance can omit the format field and use review_patch.

Full instructions: Long-horizon record storage.

Validation

Tested tree: cb225c5479. Run state: finished. Inputs: synthetic, public_fixture, authorized_private_read_only.

Check kind Result Evidence / limitation
static passed Control-plane TypeScript typecheck, packaged Chat build, semantic-vocabulary check, bilingual staged/head gates, diff check, public-boundary scan
unit / real_backend passed 62 TypeScript cases across capacity, refinement, objective and review-work-basis suites; real disposable File/SQLite, restart/CAS/replay/lost replies, inventory corruption and UTF-8 bounds
real_entrypoint passed 8 focused capacity CLI/native cases; 18 same-batch evidence/review CLI cases
regression_parity passed with disclosed retry Broader Python run: 73 passed / 4 failed. Four existing inline-context tests received the existing detail projection under an excessively long temporary path; all 4 passed unchanged with a shorter isolated temporary root
real_backend passed Read-only captured declaration replayed into disposable SQLite: old-format rejection, original pending correction accepted with record storage, preservation and restart/replay. This reconstructs declarations, not the original stored review basis; no live Goal was mutated and no private fixture is published
real_entrypoint / manual passed Packaged App with real SQLite: 32 → 33 requirements, save feedback, reload, network failure and same-operation recovery; desktop and narrow inspection
static / regression passed loopx canary premerge --from-git-diff --git-diff-base origin/main --tier quick: direct checks, Python compile, 3 catalog canaries and public-boundary checks
real_backend not_run 2 PostgreSQL cases skipped: no isolated PostgreSQL service configured. No provider implementation or promotion changed
manual not_run Installed live runtime, real Lark delivery and matched real-model adoption/benefit remain unqualified

Diagnostic matched base/head small-Goal refinement p50 was 0.0213/0.0215 ms and p95 0.0722/0.0860 ms in one local run. Record projection grew from 36,504 bytes at 33 requirements to 283,691 at 257; corresponding p50 reads were 0.272/2.124 ms. These are local pure-owner diagnostics, not end-to-end cost or performance qualification. Whole-snapshot costs remain explicit.

Frontend / Visual Evidence

UI impact: changed write request on the existing form; presentation hierarchy remains. Tested tree cb225c5479, packaged frontend with production HTTP/TypeScript owner and disposable SQLite. Synthetic data only; no public preview server and no installed-runtime claim.

Before: existing outcome has 32 requirements. After: the same outcome has 33; earlier requirements remain.

Before: desktop, 32 retained requirements
After: desktop, 33 retained requirements
Saved correction and explicit unverified feedback
After: 390-pixel narrow viewport

Attention/craft review: the current work remains above collapsed outcomes; only three outcome summaries appear initially. Expanded requirements retain complete text and sources, save feedback distinguishes retention from independent checks, and narrow layout has no horizontal overflow. Large expanded collections still require scrolling; this PR adds no new cards, labels, palette or layout system. Unknown source/usage states remain visible.

Type of Change / Area

  • Bug fix
  • New feature
  • Documentation and tests
  • Control plane and presentation/native adapters

Shared-authority fixture impact

Extends the existing synthetic outcome fixture with saturated declarations, retained histories, peers/CAS and missing-page cases. File/SQLite conformance exercised; PostgreSQL unqualified. No store promotion, routing change or legacy authority replacement.

Boundary Checklist

  • Diff, body and attachments contain no private state, credentials, raw traces, internal links or local machine paths.
  • No duplicate benchmark work; scope follows the demonstrated capacity failure.
  • English/Chinese RFC pair and exact-head bilingual checks pass.
  • Public-safe visual evidence is attached in this description.
  • Every commit has a DCO sign-off.
  • Independent review, hosted CI and maintainer merge authorization remain separate from author validation.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.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.1-sol · OpenAI · max · runtime_reported

动机

长期运行的 Goal 仍要接收新的用户验收要求,原负责 Agent 和依赖工作要能在下一轮读到完整要求。

旧版在声明接近 128 KiB、单成果已有 32 条时拒绝保存。新版沿原成果增加第 33 条,保留来源、工作链接和旧回执;重启、响应丢失和相同操作重试均可恢复。

CLI、原生会话和打包 App 都能保存这项纠正;后续自查可分批更新指定要求,其他证据沿用各自的原始依据。

交付范围是原 Goal 上的追加与分批自查。目标和要求联动替换、撤回及对同伴工作的协调由既有演化路径承接。

真实 peer 采用、已安装运行时和模型实际采用尚待资格验证;整份 authority 快照仍随保留记录增长。

改动思路

容量失败来自完整声明的累计上限。保留同一 Goal 和事务,在已授权补充时切换记录格式,能够解开真实阻塞并保留旧回执。

这一批交付新增要求的持久化、读取和恢复。影响范围判定、独立索引和跨 Agent 采用仍走 R4/R5。

依据 docs/architecture/rfcs/goal-contract-evolution-v0.zh-CN.md 在 e96857f62d3cd546b215ed3d0823f877d5cbb29c 的验收。E1 的追加与重放、E7 的 CLI 和打包 App、E9 的实际 provider 基础已复核。E2、E3 的联动变更与 peer 采用,E4 的索引化有界详情,E5、E6 的真实模型采用,E8 的完整成本仍属于后续资格。

具体改动

精确提交 b495f42a25e0c27f2006d5fc51c7182de01cfb87。14 个文件(+507/-63),分属 TS 验收和存储、既有 CLI/native/App 适配、测试与双语文档。

关键代码讲解

  • refineGoalAcceptanceOutcome 在原 authority 中检查生命周期和 CAS,恢复原回执,再通过同一事务发布 records。旧 operation id 和回执保持可恢复。
  • refineGoalOutcome 维护原需求和来源,projectGoalOutcomes 为每条自查保留自己的依据。后写的证据不会刷新未复审的旧项;独立核验沿用原入口。
  • decodeOutcomeRecords 拒绝缺页和错误类型。初版把数组 kind 当成字符串,在合法原 digest 上可通过。我补上严格类型校验,并把同一个容量恢复、损坏与重放测试扩到真实 PostgreSQL。
  • 现有“补充要求”只在用户保存时附加 records。原生和 CLI 提供同一字段,refresh-state 的分批复审读取同一批明确新增的证据。

对主干的风险

新格式仍在完整 authority snapshot 内,读写成本会随数据增长;已切换的 Goal 回退时需兼容 reader。旧格式路径、权限与原始回执已经复核。50 项 Python 用例验证同一 CLI/native 实现,当前提交的 460 项 TS 含实际 File、SQLite 和 PostgreSQL。六项直接、四项自动 premerge 和 TypeScript 类型检查均通过。重建打包 App 后,断线/丢响应、同操作一次恢复、冲突和窄屏检查通过。按 Goal 的 CI 策略未查询远端 CI。

语义与 CI 对齐

格式选择只随明确 refinement 写入。读、预演和安装均无状态迁移。旧 CLI/native 未选格式继续受 v0 上限;App 的提交默认变化已在 PR 和操作文档披露。新增 codec 复用同一个 authority 与已有拒绝规则,review_patch 不授权更改其他 Agent 的工作或把自查认作独立通过。

我的整体评价

APPROVE。 这批可以解开原 Goal 的容量拒写,保留实际验收义务和原操作恢复。我核对了新 RFC 的剩余实现边界,独立索引和 peer 采用仍需要后续结果。

查看了打包 App 的真实保存前后截图和 390 像素视图。当前工作在上,成果默认折叠,展开后保留完整要求与来源;结果反馈区分已保存和未核验。 视觉取样覆盖打包 App。原生 WebView 和已安装环境仍待核验。

English verdict: APPROVE - exact head b495f42a25e0c27f2006d5fc51c7182de01cfb87 repairs durable capacity recovery and rejects malformed record kinds. File, SQLite and isolated PostgreSQL pass, and the rebuilt packaged App recovers the original operation.

@loopx-agent
loopx-agent merged commit 859a23e into main Nov 14, 2026
17 of 21 checks passed
@loopx-agent
loopx-agent deleted the codex/outcome-capacity-recovery-20261114 branch November 14, 2026 10: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.

2 participants