Skip to content

fix(heartbeat): fit selected prompt diagnostics within budget - #5827

Merged
huangruiteng merged 2 commits into
loopx-project:mainfrom
mikamikasuki:codex/loopx-thin-heartbeat-budget
Oct 7, 2026
Merged

huangruiteng merged 2 commits into
loopx-project:mainfrom
mikamikasuki:codex/loopx-thin-heartbeat-budget

Conversation

@mikamikasuki

@mikamikasuki mikamikasuki commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis: Reproduced registered CLI output-budget failures in thin Markdown and brief JSON/Markdown heartbeat prompt modes.
  • Goal/source and gap: Generator diagnostics repeated commands for unselected prompt modes. Brief JSON also carried all four top-level mode commands even though its task body already includes the compact-detail command. Long absolute runtime paths made the duplicated strings exceed the declared surface ceilings.
  • Observable before → after: At a controlled 128-character absolute root, the brief JSON/Markdown baseline measured 12,107/10,500 and 10,198/9,000 characters; after the change it measures 10,018/10,500 and 8,118/9,000. Thin Markdown fixtures shrink from 5,438/5,100 to 4,954/5,100. Generated task bodies and command routing remain unchanged.
  • Issue/task and intended base: No separate issue is required for these self-contained output-contract defects under CONTRIBUTING.md. Tested against current main da45cfe.

Author Declaration

  • Written by: model_agent — OpenAI GPT-6 Luna.

Implemented against

  • Specification and revision: Registered CLI output ceilings in loopx/control_plane/testing/cli_output_budget.py and heartbeat prompt mode behavior at base da45cfe.
  • Criteria:
Criterion Disposition Symbol / path Test or command
Thin Markdown diagnostics show the selected command without unused prompt modes implemented render_heartbeat_generator_inputs_markdown test_thin_markdown_diagnostics_only_show_the_selected_prompt_command
Brief JSON retains the selected brief command while omitting redundant mode commands implemented build_heartbeat_prompt test_brief_diagnostics_keep_only_the_selected_prompt_command
Brief Markdown diagnostics show only the selected brief command implemented render_heartbeat_generator_inputs_markdown test_brief_diagnostics_keep_only_the_selected_prompt_command
Keep the executable task body and runtime routing unchanged implemented heartbeat builder and renderer tests/control_plane/test_heartbeat_prompt_support.py
Keep thin Markdown and long-path brief outputs within their registered ceilings implemented heartbeat_prompt_thin / heartbeat_prompt_brief tests/control_plane/test_cli_output_budget.py
  • Self-check: The registered regressions failed before the change. The patch keeps brief_prompt_command and the compact command inside task_body, removes only duplicated unselected top-level/diagnostic commands, and passes the same real-CLI long-path fixture. Thin and brief task-body generation is unchanged.

Scope And Continuation

  • Completed scope and remaining work: Thin and brief heartbeat diagnostics now include the selected mode command only. The brief task body still carries its compact-detail command. No prompt instructions, admission rules, permissions, runtime routes, or task-body behavior changed.
  • Slice boundary: Complete within these heartbeat prompt mode outputs. Independent quota and turn-plan budget overages remain outside this change.

Validation

  • Tested revision: 16c055b on current main da45cfe.
  • Run state: Local validation finished; exact-head GitHub checks and fresh code-owner review are pending.
  • Input classes: Synthetic fixtures and a controlled 128-character absolute root.
Check kind Result Evidence / limitation
regression_parity passed Long-path brief baseline: 12,107/10,500 JSON and 10,198/9,000 Markdown; changed head: 10,018 and 8,118. Thin Markdown fixtures: 5,438/5,100 before and 4,954/5,100 after.
unit passed tests/control_plane/test_heartbeat_prompt_support.py plus test_brief_budget_retains_full_commands_on_real_long_paths: 41 passed.
output_budget_matrix partial Full tests/control_plane/test_cli_output_budget.py: 20 passed, 4 failed. The exact base reproduces the independent quota JSON 34,371/34,000, vision quota JSON 40,164/40,000, crowded turn-plan JSON 15,023/15,000, and quota runtime-root assertion failures. No heartbeat brief test fails on this head.
static passed Ruff, changed-file Python compilation, and git diff --check passed.
integration passed Standard loopx canary premerge --from-git-diff: 13 selected checks passed, zero failures, zero manual holds.
  • Coverage and gaps: Full repository pytest was not run. Independent quota/turn-plan output-budget failures and the quota runtime-root assertion reproduce on the exact base; they are outside the heartbeat diagnostic diff.

Frontend / Visual Evidence

  • UI impact: none.
  • Before: N/A.
  • After: N/A.
  • States and viewports shown: N/A.
  • Source data: synthetic.
  • Attention review: N/A.

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

  • Direction / acceptance reference: N/A; this is an output projection correction under existing mode-specific ceilings, with no change to prompt contents or execution policy.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A.
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A; no authority schema or runtime contract changes.
  • Provider conformance arms run: N/A.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A.

Boundary Checklist

  • No private state, credentials, raw traces, internal links, or local machine paths are included.
  • No maintainer-owned benchmark work is duplicated.
  • The change is scoped to heartbeat prompt diagnostic output budgets.
  • UI impact is none.
  • Every commit includes a DCO Signed-off-by trailer.

loopx-agent
loopx-agent previously approved these changes Oct 7, 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.

APPROVE — exact head ed1d470; immutable merge-base a8b759d.

动机

使用 CLI 生成精简心跳提示的维护者和宿主 Agent。 三个固定负载的精简 Markdown 原为5438字符,超过5100上限;修复后为4954字符,实际执行的任务正文保持不变。 真实 heartbeat-prompt CLI 对照确认,只有未选模式的诊断命令被移除;精简 JSON 和任务正文逐字相同,显式 full、compact、brief Markdown 逐字相同。 本 PR 只修复精简 Markdown 诊断,不声称解决全部输出预算、升级当前安装或通过规模验收。

改动思路

既有 Python Markdown adapter根据已有thin布尔值选诊断;任务生成、TS决策、registry/runtime路由和预算owner保持原职责,无新能力、协议或第二决策源。 当前边界是可独立回滚的CLI诊断修复,通用预算债务及宿主采用仍由原owner验证。
最小变更继续使用现有owner。删除unused模式诊断比扩大预算或删任务正文更小,也不增加新引用机制。

具体改动

全2路径+25/-5:renderer保留agent_scopes原位置,已有thin=True只输出thin_prompt_command,非thin保留四个模式命令;新增11行facade回归。正常/错误包装共用renderer,JSON与任务生成未变。丢弃unused诊断比提高预算、砍任务正文或新引用框架更小。
Accepted spec: loopx/control_plane/testing/cli_output_budget.py; spec_ref loopx/control_plane/testing/cli_output_budget.py; spec_revision a8b759d.
Criteria: heartbeat_prompt_thin, task_body, Budget Failure Decisions. 均implemented;Budget Failure Decisions同时按同B质量指南读取。
Python3.12.15基线38/当前39通过;同一冻结真实CLI脚本60个标准预算观察,三组thin MD5438→4954/JSON3078/任务不变。三组显式full/compact/brief逐字相同。Ruff、advisory后全树semantic、native premerge13selected+5direct通过、零manualhold。
未测vision额外预算、全量增长/重复资格、全部pytest、packaged App或现场安装采用;risk selector未选择独立budget脚本。

对主干的风险

No blocking finding. Originalbudget/mypyfailures remainred and are independently matched, not waived. Only exactdiff-proven+9mypyline movement normalized; fullerrors preserved. Selected13canaries do not qualify the omittedbudgetscript.
两侧crowded quota JSON34371>34000、turn-plan JSON15023>15000;原128字符根brief JSON12107>10500同样失败。直接mypy两侧四个相同interface_budget.get union-attr错误,diff仅移动行号+9。四份budget owner/test/runner/differential源码字节相同,未扩大上限。
该窄修复无阻塞发现;原预算和mypy债务留在既有owner,不把全部预算资格标绿。
三组原预算fixture、人口数、路径和上限保持相同;thin JSON/正文与显式full、compact、brief输出按字节对照,没有仅比较字段存在。合成隔离后端未修改活动Goal、writer fence或其它角色状态。不查询、轮询或等待CI。

我的整体评价

APPROVE. 没有阻塞发现;批准窄诊断修复,原预算/mypy资格仍红,不能称为通用预算或安装完成。
既有 Python Markdown adapter根据已有thin布尔值选诊断;任务生成、TS决策、registry/runtime路由和预算owner保持原职责,无新能力、协议或第二决策源。 当前边界是可独立回滚的CLI诊断修复,通用预算债务及宿主采用仍由原owner验证。
Future-facing pass: 当前codec/renderer边界足够;没有增加parserfactory、新模式配置或引用框架的必要,未发现有价值的额外抽象。

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh.
English verdict: APPROVE - All three original thin Markdown fixtures shrink from 5438 to 4954 characters under the unchanged 5100 ceiling. Thin JSON and task body, plus explicit full, compact and brief Markdown, are byte-identical on immutable base and head. Focused tests, Ruff, semantic checks and 13 selected premerge checks pass. Unchanged crowded and long-path budget failures and four direct mypy diagnostics remain independently attributed. This approval covers the existing diagnostic renderer; no CI, general budget qualification, installed adoption or merge authority is claimed.

@mikamikasuki mikamikasuki changed the title fix(heartbeat): keep thin diagnostics within budget fix(heartbeat): fit selected prompt diagnostics within budget Oct 7, 2026
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
@mikamikasuki
mikamikasuki force-pushed the codex/loopx-thin-heartbeat-budget branch from 63569c6 to 16c055b Compare October 7, 2026 00:39

@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; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh.
APPROVE — exact head 16c055b; baseline da45cfe. 未发现本次改动的阻塞问题;已归因的基线失败单独保留。

动机

使用 thin/brief heartbeat 提示继续工作的 Agent,以及需要读取生成诊断和执行命令的维护者。 原先简短模式诊断重复展示 full、compact、brief、thin 四条含完整路径的命令;在真实 128 字符根路径下,brief JSON 12107、Markdown 10198 字符超过既有 10500/9000 预算。 当前 brief 同一工作负载降到 JSON 10018/Markdown 8118;任务执行正文逐字相同,所选命令与完整参数仍可用,full/compact 保持原样。
未运行全仓 pytest、Windows、已安装 App 升级或长期运行资格;本 PR 不引入新的用户操作,未改 frontend/Lark 状态或 Goal 配置。

改动思路

沿用现有 Python heartbeat builder 和 Markdown renderer 的传输/展示边界;quota、任务准入和 TS 决策 owner 不变,不新增平行决策源或模式配置。 当前 PR 是现有提示诊断的冗余压缩与兼容读回,完成该有界预算修复,不关闭所有预算/类型债务或整个 Goal。
真正的成本来自同一组长命令在诊断重复出现,而执行正文已经有明确详情命令。当前方案删掉其它模式的诊断复制,保留选择模式、scope、registry/runtime 参数和执行正文;比放宽预算或截断路径更能保留消费者价值。只改投影,不改变机器执行的 must_attempt、Todo/quota 规则或 mode admission。TypeScript 优先原则不要求为这种既有 Python 输出适配器另造 TS 决策层。

具体改动

完整 3 文件 +52/-5;逐项读取完整 diff、远端 body/comments/reviews/files/commits 与 immutable B/H 定义,未继承旧 head 的批准。 两个 DCO 提交均已读取,覆盖初始 thin 及本次 brief 修复,未把旧 head 的已撤回 review 套用到新版本。
预变更依据:docs/development/testing-and-quality.md 的 Budget Failure Decisions,spec_ref docs/development/testing-and-quality.md,spec_revision da45cfe771e96d20b9c5129a021a8c971ee03324,以及 B 的 loopx/control_plane/testing/cli_output_budget.py。判据 heartbeat_prompt_thin、heartbeat_prompt_brief、full_compact_parity 均 implemented 于同一固定工作负载;没有更改 5100、10500、9000 等原预算。

关键代码讲解

  • build_heartbeat_prompt 的 thin 保留既有轻量字段投影,brief 移除 expanded/compact/thin 三个重复顶层命令,保留 brief 命令与 task_body 的 cold detail。
  • render_heartbeat_generator_inputs_markdown 严格判断 is True;thin/brief 只显示所选模式,其它模式仍显示四条命令。Agent scope 的展示和其它诊断段落未变。
  • support 回归 验证选定诊断与正文 compact 入口;真实长路径预算由既有 CLI tests 和独立配对探针确认,而非仅断言 helper 字段。
    H 60 过/4 失败,B 56 过/6 失败:两项 long-brief 失败已消除,四项原预算/显式 runtime-root 命令断言失败保持。全 3 场景 ×10 CLI surface ×2 格式固定工作负载复核;显式 full/compact/brief 另核验;128 字符相同根路径 brief JSON 12107→10018、MD 10198→8118,task_body 逐字相同且 JSON 仅移除三条重复命令。advisory 后 semantic、native premerge 13 项通过。 显式 full/compact MD 在三个场景均逐字相同(17052/10851);short brief 8006→6748,thin MD 5438→4954、thin JSON 3078 不变。brief JSON 对照只移除上述三条重复命令,剩余对象逐字一致。测试了 None/False/1/string 不冒充 True 的边界。

对主干的风险

四项原失败为 crowded quota 34371>34000、vision 40164>40000、turn-plan 15023>15000,以及 should-run 显式 runtime-root 前缀断言。完整 mypy B/H 均 4589 errors/541 files,诊断路径/文本/重数仅归一行号后相同;没有把失败变为绿灯,预合并选择器也不覆盖这些完整预算检查。 本次 APPROVE 不宣称整个仓库检查绿色,也不抹掉合并限制;这些失败均在 immutable B/H 的同一完整执行中独立归因。四项 failed tests 的 command/原始诊断保持,不能靠 selected premerge 成功覆盖它们。
当前相同 workload 的正文、runtime/registry 命令参数、full/compact byte parity 和无新写入路径已检查。JSON brief 顶层确实移除三键,这是公开输出兼容变化;当前 PR 描述和 mode 测试已披露,任务正文及明确 full/compact 详情继续可用。没有引入新设置、可选能力、permission、用户交互或前端 companion 缺口;mode rendering 不授予执行权。不查询、轮询或等待 CI。

语义与 CI 对齐

复用现有 output-mode vocabulary/owner,未新增状态分类或 substring denylist。changed-diff advisory 后全树 semantic 通过,现有 formal producer coverage 限制仍保留。固定预算通过去除真正冗余改善,没有缩短实际路径、更换 workload、提高阈值或删除决策条件;同完整 base/head mypy 的诊断只归一行号,不消除任何错误。

我的整体评价

APPROVE;problem_context=goal_achieved 仅指该有界诊断预算修复。long_horizon=preserved,user_experience=improved:减少无用重复而保留可执行上下文。当前 PR 是现有提示诊断的冗余压缩与兼容读回,完成该有界预算修复,不关闭所有预算/类型债务或整个 Goal。 新机制相称,既有 owner 足够;future-facing pass 未发现值得附带的新抽象或 language-only 迁移。没有阻塞发现;最强未测项是 Windows/安装后的长期运行,全仓预算和类型债务保持红状态。正式批准后仍需 native approval closeout;控制面 PR 留维护者决定合并,不由批准记录自动授权合并。

English verdict: APPROVE - 16c055b. Thin/brief diagnostics remove redundant commands while preserving executable task bodies and full/compact byte parity. Identical real 128-character-path probes show brief JSON 12107→10018 and Markdown 10198→8118. Four unchanged budget/command failures and identical baseline mypy errors remain disclosed; 13 selected premerge checks passed, and CI was not consulted.

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.

3 participants