Commit Graph

27 Commits

Author SHA1 Message Date
AskaEth 7eb5e984c2 refactor: 认证系统重构 + DevTools CLI 重写 + 文档全面更新
- auth: Login 简化为管理员始终通过 .env 验证,GetProfile 修正 admin DB 查询
- devtools: .sh/.bat 同步重写为完整 CLI (start/stop/status/logs/build/db:*)
- docs: 新增 devtools.md,重写 Deploy.md (三种方式+Windows说明),更新 README/gateway-api
- voice-service: DashScope 实时流式 STT 支持
- gateway: Phase 6 多模型配置 + 多端客户端管理 + WebSocket 增强

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 14:55:47 +08:00
AskaEth 83e94d9e97 feat: 新增 GET /api/v1/profile 用户信息查询接口,支持前端凭据查询当前用户
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 14:00:35 +08:00
AskaEth 70f8b30d04 docs: 添加完整 API 文档 — Gateway 统一文档 + 后端服务文档
新增 docs/api/gateway-api.md:面向客户端开发的网关 API 统一文档,覆盖全部 16 个模块。
新增 docs/api/backend-services/:后端服务详细文档 (ai-core, memory-service, voice-service, iot-debug, tool-engine)。
更新 .gitignore:docs/api/ 例外允许推送,其他 docs/ 内容仍忽略。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 12:39:55 +08:00
AskaEth 965cce7192 feat: Phase 4 多平台接入 — Platform Bridge + 6平台适配器 + 身份权限系统 (22文件, 2129行)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 16:19:57 +08:00
AskaEth 717ad65b05 feat: Phase 3 插件与工具系统 — Plugin SDK + Plugin Manager + 13内置插件 (40文件, 3293行)
- Plugin SDK: Plugin/Tool/ComplexTool/HostAPI 标准化接口
- Plugin Manager: 插件生命周期管理 (Install/Enable/Disable/Uninstall/Reload)
- Tool Registry: 聚合工具注册表 (Register/Execute/Dispatch)
- 13 个内置插件: 将原有硬编码工具迁移为标准插件格式
- REST API: 11 个端点 (net/http, 零外部依赖)
- ai-core 集成: PluginManagerClient 替代本地工具调用
- plugin.json 元数据: 每个插件含完整 author/version/category/permissions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 15:50:19 +08:00
AskaEth 87214b9441 feat: Phase 1+2 架构进化 — 连续思考链/主动消息决策/情感状态机/离线自主思考 (86文件)
Phase 1 (基础设施):
- ThinkChain 思考链连续性 + 差异化思考提示词 (persistent)
- AutonomousToolPolicy 工具安全策略 (safe/unsafe/conditional)
- MessageScheduler 自适应消息节奏 (Idle/Available/Busy)
- SessionEnrichmentStore 渐进式上下文丰富 (5层)
- ConversationBus 事件总线 + ResponseCache (dedup)
- pkg/logger 统一日志 + 所有 handler 替换 fmt.Printf
- NPE 守卫/链路优化/数据库表修复/Go workspace

Phase 2 (人格交互):
- EmotionState/EmotionTracker 情感状态机 (5种心情, 情绪衰减)
- ProactiveGuard 主动消息多维决策 (静默时段/紧急度/频率/校验)
- Gateway↔ai-core 在线状态感知链路 (presence notification)
- 离线思考频率控制 + 重连问候 + 离线消息排队

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 15:25:12 +08:00
AskaEth b123a36aae fix: 第四轮调试 — 回复去重/消息时序/UI布局/自主思考深度优化 + 文档重整
后端修复:
- main.go: 恢复 /api/v1/chat 路由中丢失的 handleChat 调用 (空响应回归)
- orchestrator.go: splitChatByLines 改为双换行分割, 避免单换行误拆
- chat_handler.go: multi_message 增加 !hasReview 守卫, 消息延迟 200→800ms
- thinker.go: RecordUserMessage 追踪活跃会话ID, 推送主动消息到正确会话
- thinker.go: 增强思考提示词 — 禁止在用户休息/离开时发送主动消息

前端修复:
- useWebSocket.ts: stream_segments 不再创建消息气泡, 消除重复回复
- MessageBubble.tsx: 动作消息居左对齐无头像, 时间戳移至气泡外侧 hover 显示
- ChatInput.tsx: 昔涟输入提示移至输入框上方, 波点动画效果
- MessageList/TypingIndicator/ChatContainer: 清理冗余 isTyping 传递
- MemoryPanel.tsx: 新增记忆面板组件

文档重整:
- docs/debug/ → docs/debug_log/ 重命名统一
- 新增 debug_log/README.md 索引
- .gitignore: 新增 android/ 排除规则

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 13:09:18 +08:00
AskaEth 26a5c69aba docs: Round 5-6最终汇总报告 + E2E测试脚本补充
- 新增第5-6轮修复最终汇总报告 (全系统E2E验证 + 性能数据)
- 新增多设备IoT E2E测试脚本 (test_multi_device.mjs)
- 新增综合E2E测试脚本 (test_final_e2e.mjs)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 23:08:38 +08:00
AskaEth 498bf0d4fa fix: IoT快速通道补充关掉/关上 + 多设备上下文窗口扩展至30字节
- intent_analyzer: isStrongIoTCommand controlWords新增"关掉""关上"
- iot_provider: 操作检测上下文窗口±15→±30字节,新增全文回退逻辑
- 修复多设备命令中远处关键词无法匹配导致操作误判为query

E2E: "关掉"快速通道2.57s 多设备同时开关 8设备查询

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 23:01:45 +08:00
AskaEth a67b95cbc4 fix: IoT多设备支持 + Review Pipeline审查消息 + 意图分析快速通道优化
- IoT Provider: 重写Execute()支持多设备命令批量执行,修复persona路径
- Intent Analyzer: 新增isStrongIoTCommand快速通道,跳过LLM分析节省2-3s
- Orchestrator: parseReviewMessages()内联审查 + 快速通道扩展(chat/greeting跳过子会话)
- Gateway: SSE review_messages解析→WebSocket结构化消息转发(action/chat)
- Persona: 对话风格注入action格式指令(括号包裹动作描述)
- Frontend: sessionStore历史消息msgType映射
- 新增E2E测试脚本 + 调试标准文档 + 第4轮修复报告

E2E验证: IoT设备操控 Review消息拆分 快速通道 响应时间~3.4s

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 22:51:27 +08:00
AskaEth 9e7ada1ec3 docs: 最终汇总报告 - Cyrene系统修复完成 (三轮修复共47文件, E2E 24/24全绿) 2026-05-22 12:19:14 +08:00
AskaEth b15e1c9541 fix: 第二轮深度调试修复 - useSpeechSynthesis守卫+NPE防护+E2E测试完善
- P0: useSpeechSynthesis.ts cancel()增加isSupported守卫
- P0: iot_provider.go 添加loader nil检查防止NPE panic
- 新增CDP E2E v4测试脚本 14项全绿通过
- 生成第二轮修复报告 docs/debug/2026-05-21-round2-fixes.md
2026-05-22 00:10:37 +08:00
AskaEth 8b7d4ec19a fix(frontend): 修复 speechSynthesis.cancel() 未守卫导致的页面崩溃 2026-05-21 19:06:40 +08:00
AskaEth 702d4ee1fe chore: 重新编译 gateway + 添加第11轮 API 契约测试报告
第11轮诊断发现运行中 gateway 二进制严重过时(5月17日编译),
导致面板API路由缺失、认证逻辑不完整等问题。
重新编译并重启后问题解决。

修复过程:
- 重新编译 gateway (go build)
- 启动 SSH 数据库隧道
- 重启 gateway 连接 PostgreSQL
- 管理员登录正常,user_id 返回 'admin'
- 所有面板 API (files/knowledge/automation/sessions/briefings) 均 200

报告: docs/debug/2026-05-21-round11-api-contract.md (10个问题, 25/56通过)
2026-05-21 14:44:05 +08:00
AskaEth 20cdcc748e fix: round 10 critical fixes - WebSocket race, rate limiting, XSS protection, Caddyfile, and input validation 2026-05-20 17:59:22 +08:00
AskaEth a5b5713b29 docs: add round 9 debug report - config audit and comprehensive summary 2026-05-20 15:42:28 +08:00
AskaEth 9c9f54ab9a docs: add round 8 debug report - Docker, PWA, and WebSocket deep audit 2026-05-20 15:31:13 +08:00
AskaEth d71e7b4c83 docs: add round 7 debug report - E2E scenarios and cross-service data flow 2026-05-20 15:22:00 +08:00
AskaEth 692c1844bc docs: add round 6 debug report - performance benchmarks and code quality audit 2026-05-20 15:04:22 +08:00
AskaEth 7daa8a9b23 docs: add round 5 debug report - security audit and boundary testing 2026-05-20 14:53:57 +08:00
AskaEth d239b958df docs: add round 4 debug report - sub-services and database integrity 2026-05-20 14:37:40 +08:00
AskaEth 3adf0137cc fix: 第3轮调试Bug修复 (P1: 弱随机+crypto/rand, Knowledge键对齐; P2: 简报created_at, CORS+安全头) 2026-05-20 14:20:47 +08:00
AskaEth 25d6eff7c3 fix: 种子用户日志和密码配置化 + 第2轮调试文档 2026-05-20 14:02:09 +08:00
AskaEth 9dd1582987 fix: 创建users表 + 用户认证系统 (REG1) — 第1轮调试修复
新增 user_store.go 实现 users 表自动建表和 CRUD
注册使用 bcrypt 哈希密码存入 users 表
登录从 users 表查询用户并验证密码
启动时自动种子 admin/admin123 用户
调试文档: docs/debug/2026-05-20-round1-regression-verification.md
2026-05-20 13:52:12 +08:00
AskaEth baaf90fc47 fix: 添加.gitignore规则排除编译产物 + 添加10轮持续调试报告
- 排除 voice-service/main, main2, voice-svc-new (各8.5MB)
- 排除 gateway/cmd/gateway (15MB)
- 添加 docs/fixes/2026-05-19-round7-continuous-debugging-report.md
  10轮持续调试汇总: 19个Bug (5 P0, 5 P1, 4 P2, 5 P3)
2026-05-20 12:02:02 +08:00
AskaEth 0e21d8fb76 chore: docs 2026-05-16 08:30:22 +08:00
AskaEth eb4129176c dev 分支暂存 2026-05-16 08:26:56 +08:00