Loading...
Loading...
Compare original and translation side by side
.feature/state/implement/node_modules/vendor/.git/__pycache__/dist/build/.feature/state/implement/node_modules/vendor/.git/__pycache__/dist/build/.feature/state/plan/.feature/state/plan/.feature/state/implement/| Indicator | Language |
|---|---|
| Go |
| Python |
| TypeScript |
| JavaScript |
| Language | Export Pattern | Import Pattern | Common Integration Failures |
|---|---|---|---|
| Go | Capitalized identifiers at package level | | Exported function in wrong package; interface satisfied but never used via interface type; |
| Python | Module-level definitions, | | Circular imports causing silent failures; |
| TypeScript | | | Barrel file missing re-export; type-only import where value import needed; path alias not resolving |
| JavaScript | | | CommonJS/ESM mismatch; default vs named export confusion |
.feature/state/implement/| 识别标识 | 对应语言 |
|---|---|
| Go |
| Python |
| TypeScript |
| JavaScript |
| 语言 | 导出模式 | 导入模式 | 常见集成失败场景 |
|---|---|---|---|
| Go | 包级别的大写标识符 | | 导出函数位于错误包中;接口已实现但从未通过接口类型使用;因包未导入导致 |
| Python | 模块级定义、 | | 循环导入导致静默失败; |
| TypeScript | | | 桶文件缺失重导出;在需要值导入的场景使用了类型仅导入;路径别名无法解析 |
| JavaScript | | | CommonJS/ESM不兼容;默认导出与命名导出混淆 |
__all____init__.pyexportexport default{file, name, kind (function/type/const/var), line}| Condition | Status | Severity |
|---|---|---|
| Exported, imported, AND used in at least one consumer | WIRED | Pass |
| Exported and imported, but never used beyond the import statement | IMPORTED_NOT_USED | Warning |
| Exported but never imported anywhere in the project | ORPHANED | Failure |
main()_test.go__all__undefined__all____init__.pyexportexport default{文件路径, 名称, 类型(函数/类型/常量/变量), 行号}| 条件 | 状态 | 严重程度 |
|---|---|---|
| 已导出、已导入且至少在一个消费者中被使用 | WIRED | 通过 |
| 已导出且已导入,但除导入语句外从未被使用 | IMPORTED_NOT_USED | 警告 |
| 已导出但从未被代码库中任何部分导入 | ORPHANED | 失败 |
main()_test.go__all__undefined| File | Export | Kind | Imported By |
|---|---|---|---|
| api/handlers.go | HandleUserDelete | func | (none) |
| utils/format.py | format_currency | func | (none) |
| 文件 | 导出内容 | 类型 | 被导入位置 |
|---|---|---|---|
| api/handlers.go | HandleUserDelete | 函数 | (无) |
| utils/format.py | format_currency | 函数 | (无) |
| File | Export | Kind | Imported By | Used? |
|---|---|---|---|---|
| api/handlers.go | HandleUserUpdate | func | routes/api.go | No |
| 文件 | 导出内容 | 类型 | 被导入位置 | 是否使用 |
|---|---|---|---|---|
| api/handlers.go | HandleUserUpdate | 函数 | routes/api.go | 否 |
**Gate**: All in-scope exports classified. Map produced. Proceed to Phase 2.
---
**准入条件**:范围内所有导出内容已完成分类、关系图已生成,进入阶段2。
---processItems([])handleUsers([]User{})nilNonenullundefinedUser{}{}__ = paramreturn []return nilreturn {}{file, line, kind (empty-data|placeholder|dead-param|mock-remnant), description}processItems([])handleUsers([]User{})nilNonenullundefinedUser{}{}__ = paramreturn []return nilreturn {}{文件路径, 行号, 类型(空数据|占位符|无效参数|残留模拟数据), 描述}{id, name, email}{userId, displayName, emailAddress}"user.created""userCreated"{producer_file, consumer_file, mismatch_kind, description}{id, name, email}{userId, displayName, emailAddress}"user.created""userCreated"{生产者文件, 消费者文件, 不匹配类型, 描述}.feature/state/plan/| Status | Meaning |
|---|---|
| WIRED | Requirement has a complete integration path from entry point to implementation |
| PARTIAL | Some components exist but the path has gaps (identify the gaps) |
| UNWIRED | Components may exist but no integration path connects them |
undefined.feature/state/plan/| 状态 | 含义 |
|---|---|
| WIRED | 需求具备从入口点到实现的完整集成路径 |
| PARTIAL | 部分组件存在,但路径存在缺口(需明确缺口位置) |
| UNWIRED | 组件可能存在,但无集成路径将其关联 |
undefined| Requirement | Status | Integration Path |
|---|---|---|
| User can delete account | WIRED | DELETE /api/users/:id -> routes/api.go -> handlers.HandleUserDelete -> db.DeleteUser |
| Email notification on delete | PARTIAL | handlers.HandleUserDelete -> [GAP] -> email.SendNotification (exists but not called from handler) |
| Audit log on delete | UNWIRED | audit.LogEvent exists, but no call from any delete path |
**Step 2: Compile integration report**
```markdown| 需求 | 状态 | 集成路径 |
|---|---|---|
| 用户可删除账户 | WIRED | DELETE /api/users/:id -> routes/api.go -> handlers.HandleUserDelete -> db.DeleteUser |
| 删除操作触发邮件通知 | PARTIAL | handlers.HandleUserDelete -> [缺口] -> email.SendNotification(存在但未被处理器调用) |
| 删除操作记录审计日志 | UNWIRED | audit.LogEvent存在,但所有删除路径均未调用 |
**步骤2:编译集成报告**
```markdown
**Step 3: Verdict and next steps**
| Verdict | Next Step |
|---------|-----------|
| **PASS** | Proceed to /feature-validate |
| **WARN** | Review warnings. Proceed if warnings are intentional (unused imports for future use, etc.). Fix if unintentional. |
| **FAIL** | Route back to /feature-implement with specific wiring tasks. Do NOT proceed to validation. |
**Gate**: Report produced with verdict and actionable recommendations.
---
**步骤3:结论与下一步**
| 结论 | 下一步操作 |
|---------|-----------|
| **通过** | 进入/feature-validate阶段 |
| **警告** | 查看警告内容。若为有意为之(如预留未使用导入用于后续功能)可继续;若为无意疏漏则修复问题。 |
| **失败** | 跳转至/feature-implement阶段并处理具体连接任务,**请勿**进入验证阶段。 |
**准入条件**:已生成包含结论和可执行建议的报告。
---| Error | Cause | Solution |
|---|---|---|
| No source files found | Wrong scope path or empty project | Verify working directory, check scope parameter |
| Language not detected | No recognizable build files or source extensions | Specify language manually or check project structure |
| Too many exports to analyze | Large monorepo or library with thousands of exports | Narrow scope to changed files (use |
| False positive ORPHANED | Library code, plugin interfaces, or entry points | Check exclusion patterns. If legitimate public API, add to exclusions. |
| Circular import detected | Python circular imports or Go import cycles | Report as separate finding — circular imports are integration issues themselves |
| No implementation artifact | Running in pipeline mode but implement phase didn't checkpoint | Fall back to standalone mode using git diff to identify changed files |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 未找到源文件 | 范围路径错误或项目为空 | 验证工作目录,检查范围参数 |
| 未检测到语言 | 无可识别的构建文件或源文件扩展名 | 手动指定语言或检查项目结构 |
| 待分析导出内容过多 | 大型单体仓库或包含数千个导出的库 | 将范围缩小到已修改文件(使用 |
| ORPHANED误报 | 库代码、插件接口或入口点 | 检查排除规则。若为合法公开API,添加到排除列表 |
| 检测到循环导入 | Python循环导入或Go导入循环 | 作为单独问题报告——循环导入本身属于集成问题 |
| 无实现产物 | 处于流水线模式但实现阶段未生成检查点 | 回退到独立模式,使用git diff识别已修改文件 |
| Anti-Pattern | Why Wrong | Do Instead |
|---|---|---|
| Checking only that imports exist | Import without usage is a distinct failure mode (IMPORTED_NOT_USED) | Verify import AND usage for each export |
| Treating all ORPHANED as bugs | Library code, plugin interfaces, and entry points are intentionally not imported internally | Apply exclusion patterns before flagging |
| Skipping data flow check because wiring exists | A component wired to always receive empty data is functionally disconnected | Check data flow for every WIRED connection |
| Running on entire monorepo in pipeline mode | Wastes time analyzing unchanged code | Scope to files changed since implementation started |
| Auto-fixing wiring issues | Integration fixes often require design decisions (which component should call which?) | Report issues, let human or feature-implement decide the fix |
| Treating low-confidence contract findings as failures | Dynamic language contract checking is approximate without runtime types | Report confidence level, only FAIL on high-confidence mismatches |
| 反模式 | 问题所在 | 正确做法 |
|---|---|---|
| 仅检查导入是否存在 | 仅导入未使用是独立的失败模式(IMPORTED_NOT_USED) | 针对每个导出内容,同时验证导入和使用情况 |
| 将所有ORPHANED标记为bug | 库代码、插件接口和入口点本就不会被内部导入 | 在标记前应用排除规则 |
| 因已连接而跳过数据流检查 | 始终接收空数据的组件在功能上等同于未连接 | 针对每个WIRED连接检查数据流 |
| 流水线模式下扫描整个单体仓库 | 浪费时间分析未修改代码 | 将范围限定为实现阶段开始后修改的文件 |
| 自动修复连接问题 | 集成修复通常需要设计决策(如确定哪个组件调用哪个) | 报告问题,由人工或feature-implement阶段决定修复方案 |
| 将低置信度契约问题标记为失败 | 动态语言的契约检查在无运行时类型的情况下是近似的 | 报告置信度,仅将高置信度不匹配标记为失败 |
| Rationalization Attempt | Why It's Wrong | Required Action |
|---|---|---|
| "The component exists and has real logic, so it's integrated" | Existence is not integration. A function that's never called is dead code. | Check import AND usage, not just existence |
| "It's imported, so it must be used" | Unused imports are a specific failure mode — someone started wiring but didn't finish | Verify the import is followed by actual usage |
| "The wiring looks right so data must flow" | Wiring to an empty array is functionally the same as no wiring | Trace actual data through each connection |
| "Contract checking is too hard in dynamic languages" | Approximate checking still catches obvious mismatches | Check what you can, report confidence levels |
| "These ORPHANED exports are for future use" | Future use is not current integration. Flag them now, exclude intentionally if confirmed. | Report all ORPHANED, let the user decide which are intentional |
| "Integration checking is overkill for a small change" | Small changes are where wiring gets forgotten — new function added but never called | Run the check. Scope narrows automatically for small changes. |
| 合理化尝试 | 问题所在 | 必要操作 |
|---|---|---|
| 「组件存在且逻辑正确,所以已集成」 | 存在不等于集成。从未被调用的函数属于死代码 | 检查导入和使用情况,而非仅确认存在 |
| 「已导入,所以肯定在使用」 | 未使用的导入是特定失败模式——有人开始连接但未完成 | 验证导入后是否有实际使用 |
| 「连接看起来正确,所以数据肯定能流转」 | 连接到空数组在功能上等同于未连接 | 追踪每个连接中的实际数据 |
| 「动态语言的契约检查太难了」 | 近似检查仍能发现明显的不匹配 | 尽可能检查,并报告置信度 |
| 「这些ORPHANED导出是为未来功能预留的」 | 未来使用不等于当前集成。先标记,确认有意为之再排除 | 报告所有ORPHANED,由用户决定哪些是有意预留 |
| 「小改动没必要做集成检查」 | 小改动最容易遗漏连接——新增函数但从未被调用 | 执行检查,小改动会自动缩小分析范围 |