Skip to content

feat(steward): deliver task-adaptive Markdown answers in Chat - #5029

Merged
huangruiteng merged 2 commits into
mainfrom
codex/product-capability-adaptive-answer-0925
Sep 25, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/product-capability-adaptive-answer-0925

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Goal/source and gap: The LoopX steward required every answer to follow four fixed labels and could collapse a substantive investigation into a short ID inventory. Ordinary Chat also rendered Markdown tables differently from report artifacts.
  • Observable before → after: simple questions can receive direct sourced answers, while investigation and decision answers can keep their full judgment, comparison, evidence, and limitations in the conversation. Chat and report artifacts share the inert Markdown table renderer. The manager contract smoke, a fixture-backed managed steward turn, rendering smoke, and packaged browser scenario validate this slice.
  • Issue/task and intended base: LoopX product-capability Todo for adaptive steward answers; main.

Scope And Continuation

  • Completed scope and remaining work: Replaced the fixed answer-shape instruction, refreshed managed steward context, changed the readback to report presentation format and length without asserting quality, and unified safe Markdown table rendering. The existing RFC records this stage. Qualitative live-model answer quality, an independently addressable versioned report for every investigation, and full long-answer delivery across every external channel remain open in the same product program.
  • Slice boundary / successor: This is independently reviewable and reversible because the answer rule, readback and renderer can be validated together without adding a report store or changing channel delivery authority. Continue the existing product-capability Todo after maintainer review.

Validation

  • Tested revision: e76e5df2f922aa3f5cc50a3ed822d92131638ae1 against e5e1a6a9e2c85ef62b9f35b91dbeede09c6b7486.
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
unit passed 89 targeted manager, chat-agent and context tests.
integration passed examples/manager-answer-contract-smoke.py: short and long answers, manager-only readback, empty answer exclusion.
integration passed examples/loopx-steward-managed-chat-smoke.py: fixture-backed DSH V4 Flash managed turn, persisted answer and read-only sandbox boundary.
integration passed npm run smoke:team-report: table readability, raw fidelity, safe links, inert HTML and chat/report parity.
real_entrypoint passed npm run smoke:personal-workspace-packaged: packaged browser journey includes answer presentation, desktop/mobile and existing workspace scenarios.
static passed npm run build:chat, targeted Python Ruff, changed-path public/private scan, and git diff --check origin/main...HEAD.
static failed loopx canary premerge --from-git-diff --goal-id loopx-meta includes the base-branch semantic vocabulary budget failure: 44 maintained Python/TypeScript twins against a budget of 43. This change adds no control-plane twin. The exact-scope quality receipt passed.
  • Coverage and gaps: The shipped renderer and manager instructions are exercised with synthetic and fixture-backed inputs. A live model's long-form answer quality and external-channel truncation remain future acceptance work, stated in the RFC. The pre-existing base-branch budget failure prevents a fully green premerge result and is not waived here.

Frontend / Visual Evidence

  • UI impact: changed (answer content presentation; the first-screen layout and navigation are unchanged).
  • Before: ordinary steward answers were pressed into four labels; Markdown tables in ordinary conversation did not use the report renderer.
  • After: a synthetic answer with judgment, comparison table, evidence link and literal HTML is readable in Chat on desktop and mobile. HTML remains inert text and report raw view remains available.
  • States and viewports shown: packaged browser smoke covered desktop and mobile answer presentation; existing navigation, loading and error journeys also passed. Synthetic screenshots were generated locally by that smoke; no private screenshot is attached.
  • Source data: synthetic.
  • Attention review: the content hierarchy begins with the answer, then the comparison and evidence. No new persistent chrome or competing callout was added; tables scroll on narrow screens and missing evidence stays a bounded limitation.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference: Operator surface and IM integration; docs/architecture/rfcs/intelligent-review-presentation-surfaces-v0.md Stage 3.

Shared-authority RFC fixture impact

  • N/A: This PR does not change shared Goal Authority semantics or production-scale fixture dimensions.

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

…sations

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng 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.

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
Reviewed exact head: e76e5df

动机

旧管家回答被强制套入“结论→里程碑/基线→依据→缺口”四个标签,简单问题显得冗长,复杂调查又容易退化成短 ID 清单;普通 Chat 与报告对 Markdown 表格的呈现还不一致。目标是让用户在原会话中直接拿到与任务相称、可读且带边界的答案,同时不把展示格式误认成事实质量或行动授权。它是更大跨渠道产品旅程的一个可用阶段,不等于完成所有外部渠道或 live 模型质量验收。

改动思路

复用现有 Chat Turn、响应 envelope 和消息持久化路径,不另建报告存储或第二份 authority。manager_answer_contract_instruction 同时进入运行时管家目标与受管技能;响应 readback 只记录非空 owner-manager 答案的 Markdown 格式和字符数,不评分内容、不触碰外部受众会话。前端 MarkdownText 以 React 节点呈现被允许的语法,把原报告表格解析路径用于 Chat;raw HTML 保留为惰性文本,http/https 链接仍受原有白名单约束。短问答与长调查共用一条可恢复的消息路径,报告 artifact 的独立身份仍留给后续阶段。

具体改动

关键代码讲解

  • loopx/capabilities/manager_context/answer_contract.py 的 manager_answer_contract_instruction 移除强制四标签,改为按问题复杂度给直接答案或判断、比较、证据与限制;classify_manager_answer_shape 不再用字面标签假装评价质量,只回读 present/markdown/字符数。
  • loopx/chat_manager.py 的 manager_answer_readback 仅给 owner-manager 的非空消息附加结构,外部 audience 与空答案保持原样;运行时仍经 chat_runtime 的完成转移和消息存储回读。
  • loopx/chat_agent.py 的 _turn_prompt 要求安全 Markdown、完整答案在会话中,并保持机器 envelope 的完整 message;受保护动作、提案和 gate 的原协议未扩大。
  • apps/presentation/dashboard/src/features/personal-workspace/markdown.tsx 的 parseBlocks/MarkdownText 统一聊天与报告表格分支,不使用 dangerouslySetInnerHTML;窄屏表格独立滚动。受管技能、RFC、Python smoke 与打包浏览器场景同步更新。
  • 我的独立复跑:manager-answer-contract-smoke、托管 DSH fixture Turn(含只读沙箱拒写)、70 个相关 Python 单测、team-report smoke、build:chat、完整打包浏览器场景和 Ruff/diff 检查通过。浏览器截图中桌面/390px 手机均可见结论、链接和 HTML 惰性文本;重载后答案仍在原会话。

对主干的风险

变更是管家默认回答方式的有意改变,PR 和 RFC 已披露;它不是 opt-in,因此不存在可声称“关闭时完全相同”的特性开关。测试里的模型端点是 fixture,浏览器答案也是合成文本,不能证明 live 模型稳定地产生足够深的调查,也不能证明所有外部渠道传输长答案;这些差距应由现有 Stage 3 后续承接,不应在此评论里假装已验收。手机表格的第三列需要横向滑动且视觉提示弱,可作为非阻断的呈现改进。合并阻断同样是现行 semantic-vocabulary-drift-smoke 在此 exact head 报 44/43;本 PR 没有改动 control_plane 的 twin 集合、生成器或预算,故这是基线门槛而非此功能引入的增长。预合并套件在独立审阅 worktree 还因缺少本地 change-quality receipt 未全绿;那是本地资格回执,不是 PR 的代码失败。未查询或等待远端 CI。

语义与 CI 对齐

回答格式读回是 manager_context 的局部展示语义,未创造新的共享状态词汇或行动权限。必跑的绝对 twin 预算仍须由其 owner 按同口径 base/head 和消费者价值修复或作有证据的决定,再重跑原检查;不能删测试或仅提高 43 的数字来制造绿色结果。

我的整体评价

这一阶段有真实用户价值,代码量主要在负例与跨前后端验收,未见另一套状态机或不必要兼容分支。长期会话的结论/证据保留路径得到改善,用户体验从固定模板转向可读答案;live 质量与跨渠道完整性仍是明确未完成项。由于 exact head 的必跑本地预算检查仍失败,本次结论为 REQUEST_CHANGES/暂缓合并,而非宣称实现本身存在新回归;共享门槛修复并复跑通过后可重新审结同一 head。此 PR 涉及 loopx 与 apps 运行行为,按仓库规则不得自合并。

English verdict: REQUEST_CHANGES

@huangruiteng
huangruiteng merged commit 0c82b9b into main Sep 25, 2026
23 of 27 checks passed
@huangruiteng
huangruiteng deleted the codex/product-capability-adaptive-answer-0925 branch September 25, 2026 05:27
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