Skip to content

fix: reserve bounded capacity for outcome evidence reviews - #7056

Merged
huangruiteng merged 3 commits into
mainfrom
codex/outcome-capacity-20261022
Oct 22, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/outcome-capacity-20261022

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A valid, nearly full outcome declaration can currently prevent its next evidence review, even when the review adds no provenance. This change reserves independent 128 KiB UTF-8 JSON budgets for declarations and current reviews in the existing TypeScript owner, so progress can be reviewed without deleting original requirements or sources.

This is an explicit resource-policy change: the combined ceiling rises from 128 to 256 KiB. Each envelope remains bounded and cannot borrow from the other. Schema, canonical snapshot, CAS, receipts, source/count limits and provider transport limits remain unchanged. The paired RFC documents this tradeoff, older-writer limitations and the decision to avoid adding a reference/hydration protocol for existing synchronous consumers.

Validation on 24099275a44519cb1ba9777d0e6c3288a28b6f8c:

  • 53 Python cases pass: existing outcome/replan/native regressions plus real File/SQLite CLI and admitted native-conversation crowded-state paths; the four new cases were rerun after the lint-only correction.
  • 454 authority/acceptance cases pass with isolated real PostgreSQL 16, File and SQLite, including reopen, receipt replay, stale bases and atomic overflow rejection. No PostgreSQL skip; the temporary server was removed. Thirty existing TypeScript outcome regressions also pass.
  • Exact-head change-quality receipt cqr_dd3b7f049fdc10c5069d verifies valid; final standard premerge passes all 5 direct and 14 selected checks. Earlier runs held on a stale receipt; the receipt was regenerated for the refreshed base and unchanged author diff.
  • Control-plane typecheck, Ruff, bilingual RFC checks, semantic advisory and the five-file public-boundary scan pass.
  • The source-only synthetic 20-outcome/100-requirement case is rejected by the old cap and succeeds at 131,753 stored bytes with all declarations retained. Its full projection is 154,503 bytes. A common-input, alternating 100-sample pure-owner comparison measured p50 1.025/1.034 ms and p95 1.387/1.417 ms (base/candidate). This excludes CLI, provider and model costs and is not a performance SLO or long-horizon qualification.

The original combined-budget failure and initial lint failure are retained as historical observations. This proposal does not claim installed adoption or full workflow completion. Older writers may reject further updates above their old combined cap; rollback must preserve declarations and receipts. Exact-head PR review, merge readiness and maintainer merge authorization remain separate gates.

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 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-astra · OpenAI · runtime_reported · xhigh

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

动机

持续维护成果要求的 Agent 在完成阶段检查、通过 CLI 或原生会话记录证据自查时会遇到此问题。
同一份 131,000 字节、20 项成果的合法声明,旧版本拒绝下一次完整自查;候选版本通过同一入口保存并读回自查,全部原始来源保持。
实测 File 和 SQLite 均可保存近满声明的自查并只重放一次;超限拒绝保持原状态,精简当前证据后能继续工作。
本 PR 不修改根目标、授权、调度、独立验收或迁移能力,也不宣称已安装或已证明模型长程收益。
仍需维护者批准集成,随后在安装态正常入口验证实际采用;更大的目标整理与各 Agent 独立采用尚未完成。

改动思路

预算判断继续由现有 TypeScript 成果 owner 独占,provider 只负责存储;声明只是瞬时派生视图,不增加第二份权威状态。
本次边界是可通过现有 CLI/原生会话完成并读回的容量修复;目标语义整理、owner 批准与 peer 采用仍沿用原链路。
CLI 和原生会话仍进入同一 refineGoalAcceptanceOutcome:先校验调用者及当前版本,再验证细化内容,最后以 CAS 一次提交快照、事件和回执。声明身份、原始目标、要求、工作关联及来源继续使用原预算;只有可替换的当前自查占用新增预算。新预算不是无限空间,也不保证所有字段都取最大值时仍能写入。

同一输入 基线 本 head
557 字节普通声明的完整自查 保存,重放不重复写 相同,完整投影指纹相同
131,000 字节声明的下一次自查 容量错误,原状态不变 保存、读回、重放,保留全部来源
三份含多字节长备注的累计自查超限 拒绝,错误归因于声明 拒绝,明确归因于自查预算
精简第一份当前自查后再提交第三份 成功 相同,投影指纹相同

这是审查时在真实 File/SQLite CLI 上执行的对照。去掉新的进展来源不能解决既有声明已满的问题;统一放大原上限会额外放大声明容量;裁剪历史违背来源保留;引用还原协议则会扩大现有同步读取链的维护面。本次采用最小的同 owner 改动。

具体改动

PR 的 merge-base diff 为5文件 +271/-1:生产 +8/-1,测试 +212,英中 RFC +51。主分支后续其他功能的差异不属于本 PR。

关键代码讲解

  1. refineGoalOutcome 仍先检查 owner、不可变原目标、来源、要求和完整自查。第177–183行从完整下一状态派生无 review 的声明,以 UTF-8 JSON 字节计算两项预算;第二项使用完整序列化大小减声明大小,覆盖所有成果和结构开销。没有新增持久化状态、枚举或 Python 规则副本。任一超限在返回下一状态之前抛错。
  2. refineGoalAcceptanceOutcome 是未改动的真实调用/提交 owner:已有操作优先读取回执,新操作校验版本,dry-run 只预览,成功后提交一份快照并读回当前投影。这里验证扩容没有绕过原子提交、精确重放或旧基线冲突。原生会话仍在此之前重检 host 绑定和暂停状态。

TS 新测试覆盖20成果/100要求、独立声明上限、跨成果 UTF-8 自查上限及真实 File/SQLite/PostgreSQL 重新打开、重放、旧基线和原子拒绝。Python 新测试通过真正 CLI 子进程和原生工具记录自查、独立读回、重放与暂停拒绝。既有前端 GoalOutcomeRequirements 已读取完整要求和自查证据,明确区分“自查满足”与“独立核验”;本 PR 无新页面、交互或投影形状变更。

规范依据:docs/architecture/rfcs/goal-outcome-refinement-v0.md,修订 9ea541b0f60ac2647ee5fbf957276567274e1fe5。按变更前文本审查,而非用新增预算段落自行证明正确:

  • Decisive acceptance 2:implemented,原 Goal、原目标、要求及来源保留,容量测试逐项对比。
  • Decisive acceptance 3:implemented,新 CLI 进程和 provider 重开后仍读到完整20项与来源。
  • Decisive acceptance 5:implemented,外来 Agent、CAS/冲突、单次重放由既有 owner 与真实存储回归覆盖。
  • Decisive acceptance 9:implemented,本次原生暂停/重放及既有49项恢复/lifetime用例覆盖;脚本工具执行不等于模型遵循。
  • Decisive acceptance 7:out_of_scope,本次不改变 UI/readback 形状;既有页面源码路径已核对,不声称重新验收全部打包界面。
  • Open-ended research and no premature stop:deferred,真实模型采用、完整成本及匹配成果收益仍归既有 S11 资格工作;没有把基础测试称作长程提升。

对主干的风险

最主要取舍是成果状态合计预算从128提高到256 KiB。声明不能借自查预算,自查也不能越过自己的总预算;字段数、单字段、provider 传输上限不变。普通输入不受影响,较大状态仍可能增加后续序列化、上下文与 IO 成本。RFC 的交替100次纯 owner p50/p95 仅是局部成本观察,不是 CLI/provider SLO,更不是模型效果结论。

审查额外执行基线 9ea541b0f60ac2647ee5fbf957276567274e1fe5 与 head 24099275a44519cb1ba9777d0e6c3288a28b6f8c 的相同合成输入:2个实际本地 provider ×3类场景×2个版本,记录完整 error/error_detail、来源及投影指纹。普通路径、声明超限、外来调用者拒绝、Unicode超限后的恢复结果一致;保留“近满声明旧版本失败”这个负结果。自查超限的新错误说明只改变错误归因,未放宽授权。旧读者可读同一 schema,但旧写入器可能因共享上限拒绝扩容后的数据;回滚不得删声明或历史回执。

当前 head 的4项新增 CLI/native 测试、49项既有 Python 回归、454项真实 provider/acceptance 测试均通过(PostgreSQL 使用隔离真实服务器,0跳过)。TypeScript typecheck、Ruff、双语检查、语义 advisory 与5项直接+14项风险选择 premerge 检查通过;精确 scope 的质量回执有效。复用此前验证前核对了生产/测试内容及 head;审查 harness 初次把 CLI 的 error 当作详细错误字段,校正为实际 error_detail 后重跑两个版本,未改产品或取消断言。按当前托管策略未查询 CI。

语义与 CI 对齐

沿用既有类型词汇,新增的是显式、有界的容量政策;错误为通用成果术语,预算是强制拒绝,自查结论仍不是独立通过。无 default-off 声明或新增激活开关。按照现有 Budget Failure Decisions 评估保留信息与成本,不改写历史失败、不改变任何冻结实验标准。合并授权与 readiness 单独判断,APPROVE 不授予安装或合并权限。

我的整体评价

结论为 justified_increment:堵塞正常自查的容量边界得到完整、可回滚修复。long_horizon 为 accepted_tradeoff:保留累计承诺并支持后续工作,同时明确承担有界增长;user_experience 为 improved:同一合法请求即可完成,新增人工输入或确认轮次为0。确定性入口、恢复与持久化证据充分,但安装态采用、模型理解和完整成本收益仍未证明。

复用单个 TypeScript owner、无新 schema/CLI/迁移协议,体量与问题相称。保留现有持久化兼容,暂不引入引用还原框架。未发现当前范围的阻塞缺陷;这是作者自审的 COMMENTED 结论,维护者的独立判断和受保护运行时变更合并授权仍须保留。

English verdict: APPROVE — exact head 2409927. Real File/SQLite baseline/head CLI comparisons reproduce the old full-declaration failure and verify bounded review, unchanged origins, retry and recovery. Real PostgreSQL/acceptance and local premerge validation pass. The combined cap intentionally increases to256 KiB; installed/model adoption and end-to-end cost remain unqualified. This author-owned COMMENTED review grants no merge authority.

@huangruiteng
huangruiteng merged commit 265ec9b into main Oct 22, 2026
6 of 8 checks passed
@huangruiteng
huangruiteng deleted the codex/outcome-capacity-20261022 branch October 22, 2026 12:29
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