feat(steward): deliver task-adaptive Markdown answers in Chat - #5029
Conversation
…sations Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
There was a problem hiding this comment.
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
Goal And Delivered Outcome
main.Scope And Continuation
Validation
e76e5df2f922aa3f5cc50a3ed822d92131638ae1againste5e1a6a9e2c85ef62b9f35b91dbeede09c6b7486.examples/manager-answer-contract-smoke.py: short and long answers, manager-only readback, empty answer exclusion.examples/loopx-steward-managed-chat-smoke.py: fixture-backed DSH V4 Flash managed turn, persisted answer and read-only sandbox boundary.npm run smoke:team-report: table readability, raw fidelity, safe links, inert HTML and chat/report parity.npm run smoke:personal-workspace-packaged: packaged browser journey includes answer presentation, desktop/mobile and existing workspace scenarios.npm run build:chat, targeted Python Ruff, changed-path public/private scan, andgit diff --check origin/main...HEAD.loopx canary premerge --from-git-diff --goal-id loopx-metaincludes 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.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
docs/architecture/rfcs/intelligent-review-presentation-surfaces-v0.mdStage 3.Shared-authority RFC fixture impact
Boundary Checklist
Signed-off-bytrailer (git commit -s).