diff --git a/.planning/phases/02-thread-and-skills-logic-reconciliation/02-CONTEXT.md b/.planning/phases/02-thread-and-skills-logic-reconciliation/02-CONTEXT.md new file mode 100644 index 00000000..04a34894 --- /dev/null +++ b/.planning/phases/02-thread-and-skills-logic-reconciliation/02-CONTEXT.md @@ -0,0 +1,85 @@ +# Phase 02: Thread and Skills Logic Reconciliation - Context + +**Gathered:** 2026-04-07 +**Status:** Ready for planning + + +## Phase Boundary + +本阶段只处理线程路由/复用与 skills bootstrap 合同的逻辑对齐与去重,目标是“新逻辑单路径”。 +不扩展新产品能力,不做视觉重构。 + + + + +## Implementation Decisions + +### 路由与参数语义 +- **D-01:** `thread_id/isnew/xclaw_used` 全量与新逻辑对齐;若新逻辑无对应语义,删除旧参数和旧分支。 + +### Skills Bootstrap 合同 +- **D-02:** `content_id/content_ids` 方向全量与新逻辑对齐;旧合同只保留必要兼容层,最终以新逻辑主合同为准。 + +### 重复与死逻辑处置 +- **D-03:** 直接删除旧逻辑,只保留新逻辑单路径,不保留双实现并行。 + +### Claude's Discretion +- 可自行决定最小兼容层的落点(adapter 放在 API 层还是 core 层),前提是不引入第二套主路径。 + + + + +## Canonical References + +**Downstream agents MUST read these before planning or implementing.** + +### 里程碑与需求 +- `.planning/ROADMAP.md` — Phase 2 目标与边界(MERGE-02, LOGIC-03, LOGIC-04) +- `.planning/REQUIREMENTS.md` — 本阶段验收要求 +- `.planning/PROJECT.md` — 项目核心原则(旧视觉 + 新逻辑) + +### 上一阶段审计输入 +- `.planning/phases/01-conflict-inventory-and-decision-matrix/conflict-inventory.csv` — 冲突热点与风险分级 +- `.planning/phases/01-conflict-inventory-and-decision-matrix/titan-decision-matrix.md` — keep/replace/hybrid 决策输入 +- `.planning/phases/01-conflict-inventory-and-decision-matrix/audit-evidence.md` — 证据链来源 + +### 关键实现入口 +- `frontend/src/app/workspace/chats/[thread_id]/page.tsx` — 路由入口 +- `frontend/src/core/threads/hooks.ts` — 线程主逻辑 +- `frontend/src/core/skills/api.ts` — skills 合同入口 + + + + +## Existing Code Insights + +### Reusable Assets +- `core/threads/hooks.ts` 已是线程逻辑主入口,适合收敛单路径。 +- `core/skills/api.ts` 可作为合同归一的单入口。 + +### Established Patterns +- 路由层负责参数接入,`core/*` 负责业务逻辑;应避免 page/component 再实现一套逻辑。 + +### Integration Points +- 聊天页参数解析 -> `core/threads/hooks.ts` +- skills bootstrap 请求 -> `core/skills/api.ts` + + + + +## Specific Ideas + +- 用户明确要求“与新逻辑对齐;新逻辑没有就删除”,不接受旧逻辑兜底长期保留。 + + + + +## Deferred Ideas + +None — discussion stayed within phase scope. + + + +--- +*Phase: 02-thread-and-skills-logic-reconciliation* +*Context gathered: 2026-04-07* diff --git a/.planning/phases/02-thread-and-skills-logic-reconciliation/02-DISCUSSION-LOG.md b/.planning/phases/02-thread-and-skills-logic-reconciliation/02-DISCUSSION-LOG.md new file mode 100644 index 00000000..42809068 --- /dev/null +++ b/.planning/phases/02-thread-and-skills-logic-reconciliation/02-DISCUSSION-LOG.md @@ -0,0 +1,55 @@ +# Phase 02: Thread and Skills Logic Reconciliation - Discussion Log + +> **Audit trail only.** Do not use as input to planning, research, or execution agents. +> Decisions are captured in CONTEXT.md. + +**Date:** 2026-04-07 +**Phase:** 02-thread-and-skills-logic-reconciliation +**Areas discussed:** 路由参数语义, skills 合同方向, 重复逻辑处置 + +--- + +## 路由参数语义(thread_id/isnew/xclaw_used) + +| Option | Description | Selected | +|--------|-------------|----------| +| 与新逻辑对齐,不存在语义则删除 | 参数与分支全部按新逻辑收敛 | ✓ | +| 保留旧逻辑兼容优先 | 老分支长期保留 | | +| 冲突时报错拒绝 | 严格拒绝混合输入 | | + +**User's choice:** 与新逻辑对齐,不存在语义则删除。 +**Notes:** 用户强调“这几个参数要和新逻辑对齐,如果新逻辑没有,就删除”。 + +--- + +## Skills 合同(content_id/content_ids) + +| Option | Description | Selected | +|--------|-------------|----------| +| 与新逻辑对齐 | 旧字段仅做必要兼容层 | ✓ | +| 保持旧字段主导 | 继续以旧合同为主 | | +| 双轨长期并存 | 两套主合同并行 | | + +**User's choice:** 与新逻辑对齐。 +**Notes:** 用户明确“与新逻辑对齐”。 + +--- + +## 重复/死逻辑处置 + +| Option | Description | Selected | +|--------|-------------|----------| +| 直接删除旧逻辑,只保留新逻辑单路径 | 不保留双实现 | ✓ | +| 先保留,后续再删 | 临时过渡 | | +| 双实现+开关并行 | feature flag 双路径 | | + +**User's choice:** 直接删除旧逻辑,只保留新逻辑单路径。 +**Notes:** 用户回复“1”。 + +## Claude's Discretion + +- 兼容层具体放置位置可由执行代理决定,但不得形成第二主路径。 + +## Deferred Ideas + +None.