Repository navigation
feat(workspace): find Goal requirements and original evidence - #8914
steven-kid wants to merge 1 commit into
Conversation
Signed-off-by: Yuchao Wang <stevenkid404@gmail.com>
|
CI attribution for head I reproduced the two
Command, run from each checkout: node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/content_digest_single_owner.test.tsBoth failures are identical:
The complete TAP outputs are identical after normalizing only checkout paths and elapsed times. The merge parents are exactly the base and PR head above. Limits/status: this reruns the complete affected test file, not all of TypeScript shard 3 or the full workflow. Direct job-log retrieval returned HTTP 403; the attribution above rests on exact-revision local reproduction and the recorded job status. In run 44038098200, |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
动机 / Motivation
需要在较长或包含多项阶段性成果的 Goal 中定位特定要求、自查说明或原始证据引用的 Personal Workspace 使用者与评审者。
改动前,支撑成果区块仅按前 3 项折叠预览,超出默认预览的要求或原始证据引用需要逐个展开全部成果并人工滚动翻找;改动后,GoalOutcomeRequirements 在统计与分布条下方提供即时客户端搜索框,支持按成果标题、要求 ID/正文、Agent 自查说明及 evidence_refs 大小写无关过滤(含预览之外的成果),匹配后保持总计数与“自查未替代独立检查”的语义不变,清空搜索或按 Escape 可恢复先前展开状态与聚焦,且在包含未发送草稿时不隐藏对应表单。但在精确头 13c1324fe4 上实跑 PR 新增的真实 SQLite 打包浏览器测试 npm run smoke:goal-requirements-packaged 在第 57 行失败,源读取失败后断言 Retain requirement 按钮禁用的同步竞争尚待修复。
前端构建、check:css-custom-properties、ruff check、34 项相关 pytest 及现有 smoke:goal-acceptance-contract-packaged(含 124 条要求过滤、未发送草稿保护、390px 窄屏无横向溢出及中英文对照)在精确头通过,且 Playwright 探针证实 /api/chat/goal-acceptance 返回 HTTP 503 后界面确实切换为 Last readback 并禁用 Retain requirement(disabledAfter503=true);然而 PR 新加的 npm run smoke:goal-requirements-packaged 两次独立实跑均在 goal-requirements-browser-smoke.mjs:57 确定性失败(AssertionError: false !== true),未能完成第 57 行之后的恢复路径断言。
本 PR 仅在现有 GoalOutcomeRequirements 客户端读回组件与文档/打包 smoke 中增加本地筛选交互并更新 docs/reference/goal-acceptance-observations.md,不引入后端搜索索引、存储结构迁移、权限变更或新的验收结论语义,也不修复基线分支既有的 typescript-core (3/3) CI 问题。
改动思路 / Approach
入口位于 Goal 概览页渲染支撑成果的 GoalOutcomeRequirements 组件(apps/presentation/dashboard/src/features/personal-workspace/goal-outcome-requirements.tsx:30-82),权威数据源仍是父级 GoalAcceptanceContractSection 通过 /api/chat/goal-acceptance 查询读回的 contract.outcome_requirements(goal-acceptance-contract.tsx:30-41,95-97)。设计上不新增后端索引、持久态或写入端,仅维护纯视图态 search 文本与 searchInput 引用:过滤时全量统计条与分布条(.goal-outcomes-counts / .goal-outcomes-distribution)继续基于完整 rows 计算,避免将命中数误读为完整验收状态;匹配的成果 <article> 与匹配要求 <li> 通过 [hidden](配合既有 goal-overview.css:169 的 display: none)控制显隐,同时当条目已有未发送草稿 text、未确认请求 pending 或 busy 状态时拒绝隐藏,并在清除搜索或按 Escape 后依据各自 <details> 的 open 状态恢复先前的展开上下文。不过实跑暴露父级 GoalAcceptanceContractSection 与新测试之间的时序边界缺陷:父组件 unavailable(L94)同时由 read.isError、actions.isError 与 error 触发,goal-requirements-browser-smoke.mjs 在页面初始化阶段将 /api/actions 统一拦截为 404 导致 role="alert" 提前常驻,第 55 行等待 [role="alert"] 抢先满足,第 57 行在 503 尚未返回时断言按钮禁用从而确定性失败。
架构判断:Reuses the existing client-side GoalOutcomeRequirements component and GoalAcceptanceContractSection readback state without adding a backend search endpoint, index, or acceptance decision owner, while exposing one deterministic race defect in the PR's new packaged SQLite browser smoke.
当前边界:Changes only frontend GoalOutcomeRequirements/goal-overview.css, package.json smoke script, two dashboard Playwright smoke files + fixture, docs/reference/goal-acceptance-observations.md, and one illustrative PNG under docs/assets.
具体改动 / Changes
- 规范来源:
docs/reference/goal-acceptance-observations.md@c757f41a3dba6590f75be508625295cb24cafb93(注:本 PR 同步更新了该文档第 126–144 行补充检索说明,本评审按基线c757f41a3dba6590f75be508625295cb24cafb93的既有“默认支撑成果与读写/过期保护”契约独立判定,并将新增文档与测试一并纳入核验)。OBS-SEARCH-1->implemented:在Supporting outcomes内支持大小写无关检索成果标题、要求 ID/正文、Agent 自查 note 与evidence_refs(含默认 3 项预览之外成果),顶部状态计数与比例条保持完整读回口径且零写请求(实跑smoke:goal-acceptance-contract-packaged通过)。OBS-SEARCH-2->implemented:按Escape或点击Clear search保留已展开成果/要求、保留未发送草稿并回聚搜索输入框,且在390px窄屏包裹换行不产生横向滚动条(实跑smoke:goal-acceptance-contract-packaged通过并完成桌面/窄屏截图检查)。OBS-SEARCH-3->not_met:真实 SQLite + 打包 HTTP 场景下的源失败禁用写控件与恢复断言未在 PR 测试中通过;实跑npm run smoke:goal-requirements-packaged在apps/presentation/dashboard/smoke/goal-requirements-browser-smoke.mjs:57连续两次确定性失败(AssertionError: false !== true),需先修复测试对404/api/actions告警与503/api/chat/goal-acceptance响应之间的竞态等待并重跑全量通过。
关键代码讲解
GoalOutcomeRequirements(apps/presentation/dashboard/src/features/personal-workspace/goal-outcome-requirements.tsx:30-82):使用query = search.trim().toLocaleLowerCase()计算matching与matchingOutcomes,但counts仍固定统计全量rows,确保筛选视图不伪造通过率或隐藏过期/失败条款;query非空时隐藏View all N outcomes折叠按钮并展示aria-live/role="status"计数提示,点击Clear search后重置search并调用searchInput.current?.focus()。Outcome(apps/presentation/dashboard/src/features/personal-workspace/goal-outcome-requirements.tsx:83-148):第 113 行以hidden={!shown && (!!query || !open) && !text && !pending && !busy}保障三项不变量:命中跨预览搜索时可见、命中前后人工展开且无新搜索词时保留、存在未发送草稿/待确认提交时不隐藏表单;第 125 行按outcome.objective或单条matchesRequirement隐藏未命中需求<li>。goal-requirements-browser-smoke.mjs(apps/presentation/dashboard/smoke/goal-requirements-browser-smoke.mjs:24-28,53-62):[阻塞项 F1] 第 24–28 行仅放行/api/chat/goal-acceptance与/api/chat/delivery-review,其余/api/**(包含useTypedActionReadback请求的/api/actions)返回404,使父组件.delivery-acceptance-contract在第 53 行调用command('fault')前已常驻role="alert"(alertBeforeFault=1);第 54 行点击局部Refresh result后第 55 行立即返回,第 57 行遂在503落地前断言Retain requirement已禁用而失败。
对主干的风险 / Risks
功能主链路(本地过滤、全量计数字段保持、键盘焦点与窄屏布局)在 goal-acceptance-contract-browser-smoke.mjs 中表现稳健,但当前头存在明确阻断合并的质量风险:PR 自身声明“passed”的新增真实 SQLite smoke npm run smoke:goal-requirements-packaged 在精确头 13c1324fe4 上实际 100% 确定性失败(连续 2 次实跑均停在 goal-requirements-browser-smoke.mjs:57,导致其后的第 58–62 行故障恢复后重查与权威不变性断言均未执行到)。
通过独立 Playwright 网络/DOM 探针进一步区分了测试缺陷与产品逻辑:当显式等待 /api/chat/goal-acceptance 的 503 响应到达后再检查 DOM,界面确实切换为 Last readback 且 Retain requirement 按钮变为禁用(disabledAfter503=true)。最小修复方案:apps/presentation/dashboard/smoke/goal-requirements-browser-smoke.mjs 第 24–28 行对 /api/actions 返回 200 空提案列表 {ok: true, schema_version: "loopx_chat_action_list_v1", proposals: []}(与 goal-acceptance-contract-browser-smoke.mjs 一致),或在第 54–60 行显式等待 /api/chat/goal-acceptance 503/200 响应或 .goal-outcomes-counts 出现 "Last readback" 文案后再断言 isDisabled() === true,随后重新运行 npm run smoke:goal-requirements-packaged 确认全流程通过。另有远端 typescript-core (3/3) CI 失败系基于旧基线 c757f41a3dba(本 PR 未改任何 TS control-plane 文件),与本次 UI 改动无因果关系。
| 验证项 | 状态 | 实跑结果(exact head 13c1324fe4fce146623bc952c21a7eec6965f9a9) |
|---|---|---|
npm run check:css-custom-properties & npm run build |
PASS | CSS token 检查与 Dashboard/Chat 打包构建均成功 |
uv run --extra test python -m pytest -q tests/test_delivery_review.py tests/control_plane/test_goal_outcome_capacity.py |
PASS | 34 passed |
uv run --extra test ruff check ...goal-requirements-http-fixture.py & git diff --check |
PASS | All checks passed!,零空白/格式问题 |
npm run smoke:goal-acceptance-contract-packaged |
PASS | 默认/搜索/窄屏 390px/未发送草稿/Escape/只读/中英文全过 |
npm run smoke:goal-requirements-packaged |
FAIL | 阻塞缺陷 F1:两次实跑均在 goal-requirements-browser-smoke.mjs:57 失败(false !== true) |
远端 GitHub CI typescript-core (3/3) / checks |
FAIL (pre-existing) | 旧基线 c757f41a3dba6590f75be508625295cb24cafb93 既有 TS 问题(dashboard-browser (1..3) 与 dashboard-acceptance 已全绿) |
我的整体评价 / Verdict
Inspected populated default and expanded desktop (1440px) and narrow (390px) views on the built packaged dashboard covering 124- and 150-requirement fixtures plus the canonical guide screenshot at 13c1324; layout wraps cleanly without horizontal overflow, and both expansion disclosure and 390px responsive behavior change meaningfully with filtering. Installed native App bundle and non-Chromium WebViews were not tested; verification used packaged Vite/Chat Chromium builds with synthetic fixtures at 13c1324.
就 UI 与视觉走查而言,实机检查的桌面端(1440px 默认/搜索展开)与移动端(390px 默认折叠/搜索结果/展开证据与作者提供的 docs/assets/goal-requirement-search.png)层次清晰、无横向溢出、不新增状态词汇(no_new_vocabulary / not_applicable),Agent 自查标签与独立检查边界清晰保留,仅因主视图固有粘性顶栏与底栏使得 390x844 下内容区可滚动视口较紧凑。但是按仓库交付门禁,PR 声称通过的新增真实 SQLite 打包浏览器测试 npm run smoke:goal-requirements-packaged 在精确头 13c1324fe4 上实际确定性失败,第 57 行之后故障恢复断言未获实跑证明。因此本轮给予 REQUEST_CHANGES:请修复 goal-requirements-browser-smoke.mjs 第 24–28 / 54–60 行告警与 503 等待竞态并重跑 npm run smoke:goal-requirements-packaged 通过,随后再行重审。
English verdict: REQUEST_CHANGES
Goal And Delivered Outcome
Long-running Goals retain many requirements, but finding one original condition or evidence reference required opening outcomes and scrolling. Supporting outcomes now searches the current readback across outcome titles, requirement IDs/text, Agent review notes and evidence references, including outcomes outside the three-item preview.
The owner can open the original matching requirement, read its evidence, and clear the search without losing disclosures or an unsent correction. Full state totals and independent-verification semantics remain unchanged. Searching makes no write, model call or check invocation.
Author Declaration
docs/architecture/rfcs/loopx-overall-roadmap-v0.mdS5/S6 anddocs/reference/goal-acceptance-observations.md§Default supporting outcomes atced8ee788d9004ae671144ddff6360f7033e316f. The bounded search interaction is specified by this PR.Self-check: reviewed the full diff and existing acceptance owner; ran the checks below. No independent approval is claimed.
Scope And Continuation
Complete within this search scope. The existing builtin Goal acceptance readback owns the data; this extends its presentation without introducing a capability/provider, index or acceptance decision. The local matcher remains in the existing component. Mounted outcomes and requirements preserve draft and disclosure identity through filtering.
Search covers the current readback, not a new historical or remote index. It does not qualify indexed persistence, model adoption, or the wider R4/R5 program. CLI and native acceptance contracts are unchanged.
Validation
13c1324fe4fce146623bc952c21a7eec6965f9a9(same tested source tree).Commands below run from
apps/presentation/dashboardunless stated otherwise.npm run build: TypeScript, dashboard and packaged Chat builds; existing bundle-size warnings remainnpm run smoke:goal-requirements-packaged: production HTTP and disposable SQLite, 150 requirements, evidence lookup, draft retention, source failure/recovery, unchanged authoritynpm run smoke:goal-acceptance-contract-packaged: mixed states, 124 requirements, case/CJK/evidence searches, empty results, keyboard, preserved disclosures/drafts, locales, mobile, existing read-only export.venv/bin/python -m pytest -q tests/test_delivery_review.py tests/control_plane/test_goal_outcome_capacity.py— 34 passednpm run check:css-custom-properties; Ruff on the added Python fixture;git diff --checkced8ee788d: automatic checks passed, zero failures. The binary guide image retains the explicit visual-evidence review hold; this is not a passed merge gateInitial setup needed writable temporary dependency caches and the repository's root npm dependencies for the CSS checker; checks above were rerun after setup. No dependency versions or lockfiles changed.
Frontend / Visual Evidence
The search field sits within Supporting outcomes. Existing progress and state totals stay above it; matched details retain the original Agent-review label. Clearing restores the prior disclosures and keyboard focus. At 390px the controls wrap without horizontal overflow. Empty results report zero matches; source failure retains the existing read-only/error state and does not discard a draft.
The canonical image below is used by the updated acceptance guide to explain the search and its verification boundary. It is a synthetic, packaged-App capture backed by disposable SQLite, not an installed/live Goal. Other execution captures remain ignored output.
Boundary Checklist