deerflow2/.planning/phases/06-/06-VERIFICATION.md

126 lines
9.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
phase: 06-
verified: 2026-04-15T03:50:52Z
status: gaps_found
score: 6/8 must-haves verified
overrides_applied: 0
gaps:
- truth: "ATREF-02: 选中文件后以可删除 chip 展示,并在同名场景显示“文件名 + 类型 + 路径尾段”,引用上限 10"
status: failed
reason: "实现与测试已切换为上限 6且候选/预览未显示“类型”维度。"
artifacts:
- path: "frontend/src/components/workspace/input-box.tsx"
issue: "MAX_REFERENCES_PER_MESSAGE=6提示文案为“单条消息最多引用 6 个文件”;候选 detail 仅 pathTail/ref_source无类型徽标。"
- path: "frontend/tests/e2e/input-and-compose.spec.ts"
issue: "DF-INPUT-009 断言与“上限 6”绑定。"
missing:
- "若 requirement 仍为 ATREF-02上限 10需把上限与提示、断言统一回 10。"
- "补齐同名去歧义中的“类型”展示(文件名 + 类型 + 路径尾段)。"
- truth: "ATREF-04: 引用能力具备自动化回归验证(单测 + E2E及按 style/logic/tests/docs 的提交分组计划"
status: partial
reason: "提交分组计划已存在,但 E2E 覆盖存在强制 skip 与不稳定断言,回归稳定性不足。"
artifacts:
- path: "frontend/tests/e2e/input-and-compose.spec.ts"
issue: "DF-INPUT-008 使用 testInfo.skip(true) 永久跳过DF-INPUT-009 运行失败strict locator 冲突)。"
- path: ".planning/phases/06-/06-COMMIT-GUIDE.md"
issue: "分组计划存在且格式正确(通过)。"
missing:
- "将 DF-INPUT-008 从永久 skip 改为可执行场景或条件化 fixture 注入。"
- "修复 DF-INPUT-009 断言稳定性(避免 getByText 严格模式多命中)。"
---
# Phase 6: 在输入框输入@时,可引用已生成文件和已上传附件 Verification Report
**Phase Goal:** 在当前线程聊天输入框中实现 `@` 文件引用artifacts + uploads并通过 `additional_kwargs.files` 稳定提交且具备回归测试。
**Verified:** 2026-04-15T03:50:52Z
**Status:** gaps_found
**Re-verification:** No — initial verification
## Goal Achievement
### Observable Truths
| # | Truth | Status | Evidence |
| --- | --- | --- | --- |
| 1 | 输入 `@` 时仅展示当前线程候选并支持连续过滤ATREF-01 | ✓ VERIFIED | `input-box.tsx``thread.values.artifacts` + `useUploadedFiles(threadId)` 聚合候选,`findMentionToken` + `mentionQuery` 做过滤。 |
| 2 | 选中后展示可删除 chip而非纯文本 | ✓ VERIFIED | `input-box.tsx` 使用 `references` 状态渲染内嵌预览,`移除引用` 按钮与空输入 `Backspace` 删除最后一项。 |
| 3 | 同名场景显示“文件名+类型+路径尾段”,且上限 10ATREF-02 | ✗ FAILED | 当前为上限 6`MAX_REFERENCES_PER_MESSAGE = 6`toast“最多 6 个”);候选 detail 为 `pathTail/ref_source`,无“类型”字段。 |
| 4 | 引用通过 `additional_kwargs.files` 提交,不新增并行主结构 | ✓ VERIFIED | `hooks.ts` 两条提交链路均写入 `additional_kwargs: { files: filesForSubmit }``buildFilesForSubmit` 统一 uploads + references。 |
| 5 | 引用提交带来源元信息且兼容既有渲染链路ATREF-03 | ✓ VERIFIED | `FileInMessage``ref_kind/ref_source` 可选字段;`message-list-item.tsx` 读取 `additional_kwargs.files` 并正常渲染。 |
| 6 | 失效引用软剔除并继续发送文本ATREF-03 | ✓ VERIFIED | `buildFilesForSubmit` 统计并丢弃 `stale``hooks.ts` toast 后仍继续 `thread.submit`。 |
| 7 | 回归测试覆盖候选/chip/上限/软失败ATREF-04 | ✗ FAILED | 单测通过;但 E2E 有永久 skipDF-INPUT-008且 DF-INPUT-009 失败。 |
| 8 | 存在 style/logic/tests/docs 提交分组计划ATREF-04 | ✓ VERIFIED | `06-COMMIT-GUIDE.md` 明确 `style -> logic -> tests -> docs` 且含分组文件清单与命令。 |
**Score:** 6/8 truths verified
### Required Artifacts
| Artifact | Expected | Status | Details |
| --- | --- | --- | --- |
| `frontend/src/components/workspace/input-box.tsx` | `@` 候选、过滤、chip、键盘交互 | ✓ VERIFIED | 实现齐全,但与 requirement 的“上限10+类型徽标”不一致。 |
| `frontend/src/core/threads/hooks.ts` | 统一提交 `additional_kwargs.files` | ✓ VERIFIED | 两条 submit 链路均使用 `filesForSubmit`。 |
| `frontend/src/core/threads/submit-files.ts` | uploads/references 合并与 artifact 物化 | ✓ VERIFIED | `materializeArtifactReferences` + `buildFilesForSubmit` 可用。 |
| `frontend/src/core/messages/utils.ts` | `FileInMessage` 扩展兼容 | ✓ VERIFIED | 扩展字段为可选,未破坏旧路径。 |
| `frontend/src/core/threads/hooks.test.ts` | 提交流程与软失败单测 | ✓ VERIFIED | 4 条测试通过。 |
| `frontend/tests/e2e/input-and-compose.spec.ts` | `@` 引用 E2E 回归 | ⚠️ HOLLOW — wired but data disconnected | 用例存在DF-INPUT-008 永久 skipDF-INPUT-009 当前失败。 |
| `.planning/phases/06-/06-COMMIT-GUIDE.md` | 分组提交计划 | ✓ VERIFIED | 顺序、规则与样例齐全,且 tests 组最小 E2E 验证已覆盖 `DF-INPUT-009`。 |
### Key Link Verification
| From | To | Via | Status | Details |
| --- | --- | --- | --- | --- |
| `input-box.tsx` | `uploads/hooks.ts` | `useUploadedFiles(threadId)` | ✓ WIRED | 实际调用存在。 |
| `input-box.tsx` | `thread.values.artifacts` | thread 内 artifacts 候选源 | ✓ WIRED | 直接读取 `thread.values.artifacts`。 |
| `input-box.tsx` | `hooks.ts` | `PromptInputMessage.references` | ✓ WIRED | `handleSubmit``references` 合并进 message提交给上层 `onSubmit`。 |
| `hooks.ts` | `submit-files.ts` | `buildFilesForSubmit/materializeArtifactReferences` | ✓ WIRED | 已 import 并用于提交前标准化。 |
| `hooks.ts` | `additional_kwargs.files` | 提交 envelope | ✓ WIRED | `thread.submit` 中写入 `additional_kwargs.files`。 |
| `input-box.tsx` | `dropdown-menu.tsx` | Dropdown 候选面板 | ⚠️ PARTIAL | 当前候选面板为自定义 `<div>`;不再使用 `DropdownMenuContent/Item`。 |
### Data-Flow Trace (Level 4)
| Artifact | Data Variable | Source | Produces Real Data | Status |
| --- | --- | --- | --- | --- |
| `input-box.tsx` | `mentionCandidates` | `thread.values.artifacts` + `useUploadedFiles(threadId)` | Yes`listUploadedFiles` 走后端 `/uploads/list` | ✓ FLOWING |
| `hooks.ts` | `filesForSubmit` | `uploadedFileInfo` + `normalizedReferences` | Yes上传接口 + artifact fetch/upload | ✓ FLOWING |
| `message-list-item.tsx` | `files` | `message.additional_kwargs.files` | Yes数组即渲染文件卡片 | ✓ FLOWING |
| `input-and-compose.spec.ts` | E2E 断言链路 | Playwright + 线程 fixture | Partial存在 skip / flaky 断言) | ⚠️ STATIC |
### Behavioral Spot-Checks
| Behavior | Command | Result | Status |
| --- | --- | --- | --- |
| 提交构建与软失败单测 | `cd frontend && node --test src/core/threads/hooks.test.ts` | 4 passed, 0 failed | ✓ PASS |
| 类型检查 | `cd frontend && pnpm -s typecheck` | exit 0 | ✓ PASS |
| 上限回归 E2E | `cd frontend && pnpm -s test:e2e --grep "DF-INPUT-009"` | 1 failedstrict locator 多命中) | ✗ FAIL |
| 候选/软失败 E2E 抽样 | `cd frontend && timeout 10s pnpm -s test:e2e --grep "DF-INPUT-007|DF-INPUT-008|DF-INPUT-009"` | 007 pass008 skip009 未在 10s 窗口内收尾 | ? SKIP |
### Requirements Coverage
| Requirement | Source Plan | Description | Status | Evidence |
| --- | --- | --- | --- | --- |
| ATREF-01 | 06-02, 06-05 | `@` 仅显示当前线程候选并支持过滤 | ✓ SATISFIED | 当前实现已满足06-05 不改候选来源只修剩余 gap。 |
| ATREF-02 | 06-02, 06-05 | chip 展示 + 同名去歧义(文件名+类型+路径尾段)+ 上限 10 | ✗ BLOCKED | 需由 06-05 把“上限 6/缺类型维度”统一修回 requirement=10。 |
| ATREF-03 | 06-01, 06-05 | `additional_kwargs.files` 提交 + 元信息 + stale 软剔除 | ✓ SATISFIED | `hooks.ts/submit-files.ts/utils.ts` 主链路完整06-05 只补验证稳定性。 |
| ATREF-04 | 06-03, 06-05 | 单测+E2E 回归 + 提交分组计划 | ✗ BLOCKED | 提交分组计划满足06-05 负责关闭永久 skip 与 strict locator 缺口。 |
Orphaned requirements for Phase 6: None`ATREF-01..04` 均已在计划 frontmatter 声明)。
### Anti-Patterns Found
| File | Line | Pattern | Severity | Impact |
| --- | --- | --- | --- | --- |
| `frontend/tests/e2e/input-and-compose.spec.ts` | 158 | `testInfo.skip(true, ...)` | ⚠️ Warning | 软失败场景永久跳过,降低回归可信度。 |
| `frontend/src/components/workspace/input-box.tsx` | 662 | `TODO` connector 占位注释 | Info | 与本阶段目标无直接阻断。 |
### Gaps Summary
Phase 6 核心链路(`@` 候选、引用提交到 `additional_kwargs.files`、stale 软失败)已落地并可运行,但仍有两项合同级缺口:
1. `ATREF-02` 与当前实现不一致:需求写的是上限 10 且含“类型”去歧义,代码/测试为上限 6 且缺少类型显示;该缺口现由 `06-05-PLAN.md` 接手修复。
2. `ATREF-04` 自动化回归不稳定:存在永久 skip 与失败断言尚不足以作为稳定回归护栏tests/doc hygiene 已迁移到 `06-COMMIT-GUIDE.md``06-05` 继续收口用例稳定性。
---
_Verified: 2026-04-15T03:50:52Z_
_Verifier: Claude (gsd-verifier)_