Commit Graph

203 Commits

Author SHA1 Message Date
iven
d758a4477f test(desktop): Phase 3 store unit tests — 112 new tests for 5 stores
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- saasStore: login/logout/register, TOTP setup/verify/disable, billing
  (plans/subscription/payment), templates, connection mode, config sync
- workflowStore: CRUD, trigger, cancel, loadRuns, client injection
- offlineStore: queue message, update/remove, reconnect backoff, getters
- handStore: loadHands, getHandDetails, trigger/approve/cancel,
  triggers CRUD, approvals, autonomy blocking
- streamStore: chatMode switching, getChatModeConfig, suggestions,
  setIsLoading, cancelStream, searchSkills, initStreamListener

All 173 tests pass (61 existing + 112 new).
2026-04-07 17:08:34 +08:00
iven
a5b887051d fix: butler audit critical fixes — pain detection, proposal trigger, URI + data flow
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
5 fixes from focused audit:
- Connect analyze_for_pain_signals() to post_conversation_hook (pain points now auto-created)
- Add "generate solution" button in InsightsSection for high-confidence pain points (>=0.7)
- Fix Memory URI mismatch: viking://agents/ → viking://agent/ (singular)
- Remove duplicate .then() chain in useButlerInsights (was destructuring undefined)
- Update stale director.rs doc comment (multi-agent now enabled by default)
2026-04-07 10:23:54 +08:00
iven
58703492e1 fix(intelligence): code review fixes — TODO annotations for data durability
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Add TODO to PainAggregator documenting in-memory-only data limitation
- Remove unused `use serde::Serialize` import from a2a.rs (already clean)
- ProposalsSection: trigger refresh on error instead of silent catch
- useButlerInsights: collect all errors instead of overwriting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 09:56:26 +08:00
iven
2e5f63be32 docs: reorganize docs — archive outdated, create brainstorming folder
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Create docs/brainstorming/ with 5 discussion records (Mar 16 - Apr 7)
- Archive ~30 outdated audit reports (V5-V11) to docs/archive/old-audits/
- Archive superseded analysis docs to docs/archive/old-analysis/
- Archive completed session plans to docs/archive/old-plans/
- Archive old test reports/validations to respective archive folders
- Remove empty directories left after moves
- Keep current docs: TRUTH.md, feature docs, deployment, knowledge-base, superpowers
2026-04-07 09:54:30 +08:00
iven
af20487b8d feat(intelligence): add personality detector — auto-adjust from conversation signals
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- PersonalityConfig with 4 dimensions: tone, proactiveness, formality, humor
- Signal detection from Chinese user messages (e.g. "说简单点" → Simple tone)
- apply_personality_adjustments() returns new immutable config
- build_personality_prompt() injects personality into system prompts
- Integrated into post_conversation_hook for automatic detection
- In-memory persistence via OnceLock (VikingStorage integration TODO)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 09:36:12 +08:00
iven
80cadd1158 feat(ui): add ButlerPanel — pain points, proposals, memory insights
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Add Butler types (PainPoint, Proposal, DelegationResult) to viking-client.ts
- Add butler API functions: getButlerInsights, getButlerProposals,
  recordButlerPainPoint, generateButlerSolution, updateButlerProposalStatus,
  butlerDelegateTask
- Create ButlerPanel with three sections:
  - InsightsSection: pain point cards with evidence chain, severity, confidence
  - ProposalsSection: solution cards with accept/reject actions
  - MemorySection: Viking memory entries per agent
- Create useButlerInsights hook for data fetching
- Add "管家" tab to RightPanel with ConciergeBell icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 09:30:28 +08:00
iven
e1f3a9719e feat(multi-agent): enable Director + butler delegation (Chunk 4)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Enable multi-agent feature by default in desktop build
- Add butler delegation logic: task decomposition, expert assignment
- Add ExpertTask, DelegationResult, butler_delegate() to Director
- Add butler_delegate_task Tauri command bridging Director to frontend
- 13 Director tests passing (6 original + 7 new butler tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 09:21:49 +08:00
iven
c7ffba196a feat(intelligence): add PainAggregator + SolutionGenerator (Chunk 2)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
PainAggregator: cross-session pain point merge with confidence scoring,
rule-based frustration detection, and category classification.

SolutionGenerator: transforms high-confidence pain points into proposals
with concrete steps, skill hints, and lifecycle management.

5 Tauri commands registered: butler_list_pain_points, butler_record_pain_point,
butler_generate_solution, butler_list_proposals, butler_update_proposal_status.
2026-04-07 09:06:05 +08:00
iven
0e1b29da06 test(reflection): add full reflection cycle e2e tests
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Task 1.2 verification: Reflection chain confirmed working.
- 6 Tauri commands registered 
- Frontend streamStore triggers after each conversation 
- Rust intelligence_hooks also triggers 
- LLM analysis with rules-based fallback 
- VikingStorage persistence (state/result/history) 

2 new tests: test_reflection_cycle_full, test_reflection_generates_identity_proposals
All 4 reflection tests pass.
2026-04-07 03:05:40 +08:00
iven
02c69bb3cf fix: subagent unique ID matching + AgentState serialization + pre-existing TS errors
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- S-3: Thread task_id (UUID) through all 6 layers (LoopEvent → StreamChatEvent → kernel-types → gateway-client → streamStore) so subtasks are matched by ID, not description string
- AgentState: Add #[serde(rename_all = "lowercase")] to fix PascalCase serialization ("Running" → "running"), update frontend matcher
- S-1: Remove unused onClose prop from ArtifactPanel + ChatArea call site
- Fix hooks/index.ts: remove orphaned useAutomationEvents re-exports (module deleted)
- Fix types/index.ts: remove orphaned automation type/value re-exports (module deleted)
- Fix ChatArea.tsx: framer-motion 12 + React 19 type compat — use createElement + explicit any return type to avoid unknown-in-JSX-child error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 22:30:16 +08:00
iven
bbbcd7725b fix: deep audit round 2 — non-streaming mode config + ClarificationCard + settings restructure
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
HIGH fixes:
- H-NS-1: Non-streaming agent_chat now builds ChatModeConfig and calls
  send_message_with_chat_mode(), matching the streaming path
- H-FE-1: ClarificationCard component renders structured clarification
  questions with type badge, question text, and numbered options
- H-SEM-1: SemanticSkillRouter annotated as @reserved (Phase 3 wiring)

MEDIUM fixes:
- M-SETTINGS-1: Settings menu restructured with "高级" section separator;
  skills/audit/tasks/heartbeat/semantic-memory grouped under advanced
- M-MAN-1: LoopEvent→StreamChatEvent mapping completeness checklist
  added as documentation comment in agent_chat_stream loop
- M-ORPH-1: Deleted orphaned Automation/ and SkillMarket/ files,
  plus transitively orphaned types, hooks, and adapters
2026-04-06 18:12:35 +08:00
iven
6a13fff9ec fix(runtime): deep audit fixes — clarification loop termination + callback alignment
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CRITICAL:
- ask_clarification now terminates Agent Loop in both run() and run_streaming()
  paths, preventing the LLM from continuing after requesting user clarification

HIGH:
- SaaS relay now forwards plan_mode and subagent_enabled to backend
- GatewayClient.chatStream now supports onThinkingDelta, onSubtaskStatus,
  and token-bearing onComplete — aligned with kernel-types StreamCallbacks
- ZclawStreamEvent type extended with thinking_delta, subtask_status variants
  and input_tokens/output_tokens fields for token tracking via Gateway path
2026-04-06 16:50:48 +08:00
iven
e7d5aaebdf fix: pass subagent_enabled in gateway-client.ts synchronous path
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
The connectZclawStream call in the synchronous code path (common case
when agentId is already known) was missing the subagent_enabled field,
causing Gateway-connected clients to never send the flag to the server.
2026-04-06 15:10:17 +08:00
iven
9871c254be feat: sub-agent streaming progress — TaskTool emits real-time status events
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Rust: LoopEvent::SubtaskStatus variant added to loop_runner.rs
- Rust: ToolContext.event_sender field for streaming tool progress
- Rust: TaskTool emits started/running/completed/failed via event_sender
- Rust: StreamChatEvent::SubtaskStatus mapped in Tauri chat command
- TS: StreamEventSubtaskStatus type + onSubtaskStatus callback added
- TS: kernel-chat.ts handles subtaskStatus event from Tauri
- TS: streamStore.ts wires callback, maps backend→frontend status,
  updates assistant message subtasks array in real-time
2026-04-06 13:05:37 +08:00
iven
15a1849255 feat: auto-create artifacts from file_write tool output
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
When the agent writes files via the file_write tool, artifacts are now
automatically created in the artifact panel. The file extension determines
the artifact type (code/markdown/text) and syntax highlighting language.

This connects the existing ArtifactPanel UI to actual tool output data.
2026-04-06 12:50:48 +08:00
iven
cb140b5151 feat: DeerFlow 2.0 core capabilities — Phase 1.0 + 1.1
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Phase 1.0 — Butler Mode UI:
- Hide "自动化" and "技能市场" entries from sidebar navigation
- Remove AutomationPanel and SkillMarket view rendering from App.tsx
- Simplify MainViewType to only 'chat'
- Main interface is now: chat + conversation list + detail panel only

Phase 1.1 — Mode Differentiation:
- Add subagent_enabled field to ChatModeConfig (Rust), StreamChatRequest (Tauri),
  gateway-client, kernel-client, saas-relay-client, and streamStore
- TaskTool is now only registered when subagent_enabled=true (Ultra mode)
- System prompt includes sub-agent delegation instructions only in Ultra mode
- Frontend transmits subagent_enabled from ChatMode config through the full stack

This connects the 4-tier mode selector (Flash/Thinking/Pro/Ultra) to actual
backend behavioral differences — Ultra mode now truly enables sub-agent delegation.
2026-04-06 12:46:43 +08:00
iven
9c346ed6fb fix(P2-10): is_placeholder now reflects actual LLM driver availability
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Previously hardcoded to false in Tauri bridge. Now checks whether
kernel provided a driver before building classroom, correctly flagging
placeholder content when LLM is unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 12:31:44 +08:00
iven
4a23bbeda6 fix: update chatStore tests for sub-store refactoring
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Tests were referencing old monolithic useChatStore API. Updated to
use useConversationStore for conversation/agent/model state and
useChatStore for message operations. 10→0 failures.
2026-04-06 11:57:46 +08:00
iven
7f9799b7e0 fix: P2-24 memory dedup + P2-25 audit logging + P3-02 whiteboard unification
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
P2-24: Add content_hash column to memories table with index.
Before INSERT, check for existing entry with same normalized content
hash within agent scope; merge importance and bump access_count.

P2-25: Add hand_executed/hand_approved/hand_denied/skill_executed
event types to security-audit.ts. Insert audit logging calls in
kernel-hands.ts triggerHand/approveHand and kernel-skills.ts
executeSkill execution paths.

P3-02: SceneRenderer now imports WhiteboardCanvas component instead
of inline SVG rendering, gaining chart/latex support. Deleted 27
lines of duplicated renderWhiteboardItem code.

Update DEFECT_LIST.md: P1-01  (Fantoccini confirmed), P3-02 ,
add P2-24/P2-25 entries. Active count: 48→50 fixed, 3→1 remaining.
2026-04-06 11:40:53 +08:00
iven
38e7c7bd9b refactor(classroom): unify whiteboard rendering to WhiteboardCanvas
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Replace inline SVG whiteboard rendering in SceneRenderer with the
dedicated WhiteboardCanvas component, gaining chart/latex support
and eliminating 27 lines of duplicated rendering logic.
2026-04-06 10:53:21 +08:00
iven
828be3cc9e fix: resolve 6 remaining defects (P2-18, P2-21, P3-04, P3-05, P3-06, P3-02)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- P2-18: TOTP QR code local generation via qrcode lib (no external service)
- P2-21: Suspend foreign LLM providers (OpenAI/Anthropic/Gemini) for early stage
- P3-04: get_progress() now calculates actual percentage from completed/total steps
- P3-05: saveSaaSSession calls now have .catch() error logging
- P3-06: SaaS relay chatStream passes session_key/agent_id to backend
- P3-02: Whiteboard unification plan document created

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 09:52:28 +08:00
iven
26a833d1c8 fix: resolve 17 P2 defects and 5 P3 defects from pre-launch audit
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Batch fix covering multiple modules:
- P2-01: HandRegistry Semaphore-based max_concurrent enforcement
- P2-03: Populate toolCount/metricCount from Hand trait methods
- P2-06: heartbeat_update_config minimum interval validation
- P2-07: ReflectionResult used_fallback marker for rule-based fallback
- P2-08/09: identity_propose_change parameter naming consistency
- P2-10: ClassroomMetadata is_placeholder flag for LLM failure
- P2-11: classroomStore userDidCloseDuringGeneration intent tracking
- P2-12: workflowStore pipeline_create sends actionType
- P2-13/14: PipelineInfo step_count + PipelineStepInfo for proper step mapping
- P2-15: Pipe transform support in context.resolve (8 transforms)
- P2-16: Mustache {{...}} → \${...} auto-normalization
- P2-17: SaaSLogin password placeholder 6→8
- P2-19: serialize_skill_md + update_skill preserve tools field
- P2-22: ToolOutputGuard sensitive patterns from warn→block
- P2-23: Mutex::unwrap() → unwrap_or_else in relay/service.rs
- P3-01/03/07/08/09: Various P3 fixes
- DEFECT_LIST.md: comprehensive status sync (43/51 fixed, 8 remaining)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 00:49:16 +08:00
iven
b5993d4f43 fix(desktop): sidebar tab animation + memory deduplication
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
1. Fix sidebar tab switching: replace containerVariants (staggerChildren
   without motion children) with simple fade variants. The previous
   staggerChildren:0.05 caused the container to stay at opacity:0 when
   switching to CloneManager because non-motion children couldn't
   participate in stagger animation.

2. Fix memory deduplication: add content+agentId based dedup check
   in fallbackMemory.store(). Previously same content was stored 4x
   with different IDs. Now updates importance/accessCount instead.
2026-04-05 22:02:55 +08:00
iven
bcaab50c56 fix(desktop): resolve all remaining P1 defects (P1-02/05/06, P1-01 experimental)
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- P1-02: Heartbeat auto-initialized in kernel_init for default agent
- P1-05: CloneManager shows warning when deleting active agent + auto-switch
- P1-06: AgentInfo returns soul/system_prompt/temperature/max_tokens
- P1-01: Browser Hand marked experimental (requires Fantoccini bridge)
- Updated DEFECT_LIST.md: all P1 resolved (0 active)
- Updated RELEASE_READINESS.md: all P1 sections reflect current status
2026-04-05 21:21:33 +08:00
iven
90855dc83e fix(desktop): resolve 2 release-blocking P1 defects
P1-04: GenerationPipeline hardcoded model="default" causing classroom
generation 404. Added model field to GenerationPipeline struct, passed
from kernel config via with_driver(driver, model). Static scene
generation now receives model parameter.

P1-03: LLM API concurrent 500 DATABASE_ERROR. Added transient DB error
retry (PoolTimedOut/Io) in create_relay_task with 200ms backoff.
Recommend setting ZCLAW_DB_MIN_CONNECTIONS=10 for burst resilience.
2026-04-05 19:18:41 +08:00
iven
9ee89ff67c fix(desktop): 功能验证 6 项缺陷修复
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- ISS-002: SkillInfoResponse 增加 source/path 字段,修复技能系统显示 0 个
- ISS-003: Sidebar 添加自动化/技能市场导航入口 + App 返回按钮
- ISS-004: SaaS fetchAvailableModels 添加 .catch() 防限流崩溃
- ISS-006: SaaSSettings/PricingPage 包裹 ErrorBoundary 防白屏
- ISS-008: listModels 加载 localStorage 自定义模型,修复仅显示 1 个模型
- configStore listSkills 映射添加 source/path 转发
2026-04-05 16:12:06 +08:00
iven
f33de62ee8 fix(desktop): add tauri-plugin-mcp setupPluginListeners() for dev debugging
The tauri-plugin-mcp was registered in Rust but the frontend never called
setupPluginListeners(), causing all DOM-related MCP operations (execute_js,
query_page, type_text) to timeout. This fix enables proper dev debugging
via tauri-mcp tools.
2026-04-05 15:49:12 +08:00
iven
aef4e01499 feat(desktop): add WebMCP debugging tools for structured AI agent access
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Register 15 structured tools via navigator.modelContext (Chrome 146+)
for direct state queries without DOM scraping. Reduces token consumption
~67% vs DevTools MCP snapshot-based debugging. Dev mode only.

Tools: get_zclaw_state, check_connection, send_message, cancel_stream,
get_streaming_state, list_conversations, get_current_conversation,
switch_conversation, get_token_usage, get_offline_queue,
get_saas_account, get_available_models, get_current_agent,
list_agents, get_console_errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 09:57:32 +08:00
iven
af0acff2aa fix(desktop): QA 驱动的 6 项缺陷修复
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
P0-C1: SecureStorage 解密失败上限 — 添加 per-key 失败计数器,
超过 2 次自动清除过期加密数据,阻断无限重试循环

P0-C2: Bootstrap 空指针防护 — connectionStore 中 relayModels[0]?.id
添加 null guard,抛出用户友好错误

P1-H1: 侧边栏对话列表去重 — ConversationList 添加按 ID 去重逻辑,
保留最新版本后按 updatedAt 排序

P1-H2: 搜索框过滤生效 — Sidebar 传递 searchQuery 给 ConversationList,
支持按标题和消息内容过滤

P1-H3: 模型选择器 fallback — 当 SaaS 和 config 均无模型时,
提供 6 个默认模型(GLM/GPT/DeepSeek/Qwen/Claude)

P1-H4: 详情面板错误友好化 — RightPanel 中 JS 错误替换为
'连接状态获取失败,请重新连接'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 07:57:53 +08:00
iven
3b0ab1a7b7 fix(types): Desktop type safety hardening (TYPE-01)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Unify ConnectionState: kernel-types.ts now canonical source
  with 'handshaking', gateway-types.ts re-exports
- PromptTemplateInfo source/status → union literals
- PromptVariable.type → union literal
- CreateRoleRequest id/permissions → optional
- PropertyPanel: replace 13 as any with typed accessor pattern
- chatStore: window cast via as unknown as Record
2026-04-05 01:30:29 +08:00
iven
fb0b8d2af3 fix(tauri): @reserved annotations for 16 unconnected commands
Complete Tauri command audit: 177 total (160 @connected + 16 @reserved + 1 unregistered identity_init)
Corrected zclaw_doctor from @connected to @reserved
2026-04-05 01:06:58 +08:00
iven
82842c4258 fix(frontend): initializeStores dedup + retryAllMessages guard + as any cleanup
- index.ts: add _storesInitialized guard to prevent triple initialization
- offlineStore.ts: add isRetrying mutex for retryAllMessages concurrency
- PropertyPanel.tsx: replace 13x (data as any) with typed d accessor
- chatStore.ts: replace window as any with Record<string, unknown>
- kernel-*.ts: replace prototype as any with Record<string, unknown>
- gateway-heartbeat.ts: delete dead code (9 as any, zero imports)
2026-04-05 01:06:48 +08:00
iven
f846f3d632 fix(tauri): update @reserved annotations + remove dead SaaS client methods
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Update 9 @reserved → @connected for commands with frontend consumers:
  zclaw_status, zclaw_start, zclaw_stop, zclaw_restart, zclaw_doctor,
  viking_add_with_metadata, viking_store_with_summaries,
  trigger_execute, scheduled_task_create
- Remove 10 dead SaaS client methods with zero callers:
  healthCheck, listDevices (saas-client.ts)
  getRelayTask, getUsage/relay (saas-relay.ts)
  listPrompts, getPrompt, listPromptVersions, getPromptVersion (saas-prompt.ts)
  getPlan, getUsage/billing (saas-billing.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 00:22:45 +08:00
iven
ac24d15bab fix(tauri): add @reserved annotations to 3 unconnected commands
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- classroom_chat_history: @reserved (no frontend consumer)
- orchestration_execute: @reserved (no frontend consumer)
- orchestration_validate: @reserved (no frontend consumer)

Update AUDIT_TRACKER: V11-P2-05 verified (89 connected / 18 @reserved)
DEAD-05 re-evaluated: 12 truly dead methods (not 39), documented in tracker
2026-04-05 00:04:20 +08:00
iven
1fec8cfbc1 fix(arch): unify TS/Rust types + classroom persistence registration + approval audit
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- M11-03: Register ClassroomPersistence via Tauri .setup() hook with
  in-memory fallback. Previously missing — classroom commands would crash at runtime.
- M3-02: Document BrowserHand as schema validator + TypeScript delegation
  passthrough (dual-path architecture explicitly documented).
- M4-04: Add defense-in-depth audit logging in execute_hand() and
  execute_hand_with_source() when needs_approval hands bypass approval gate.
- TYPE-01: Add #[serde(rename_all = "camelCase")] to Rust AgentInfo.
  Add missing fields to TS AgentInfo (messageCount, createdAt, updatedAt).
  Fix KernelStatus TS interface to match Rust KernelStatusResponse
  (baseUrl/model instead of defaultProvider/defaultModel).
- SEC2-P1-01: Document EXTRACTION_DRIVER OnceCell as legacy path;
  Kernel struct field is the active path.
- TriggerSource: Add #[derive(PartialEq)] for approval audit comparisons.
2026-04-04 21:09:02 +08:00
iven
88172aa651 feat(classroom): add SQLite persistence + security hardening
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M11-03: Classroom data persistence
- New persist.rs: SQLite-backed ClassroomPersistence with open/load_all/save
- Schema: classrooms (JSON blob) + classroom_chats tables
- generate.rs: auto-persist classroom after generation
- chat.rs: auto-persist chat messages after each exchange
- mod.rs: init_persistence() for app setup integration

M1-01: Gemini API key now uses x-goog-api-key header
- No longer leaks API key in URL query params or debug logs

M1-03/04: Mutex unwrap() replaced with unwrap_or_else(|e| e.into_inner())
- MemoryMiddleware and LoopGuardMiddleware recover from poison

M2-08: Agent creation input validation
- Reject empty names, out-of-range temperature (0-2), zero max_tokens

M11-06: Classroom chat message ID uses crypto.randomUUID()
2026-04-04 19:26:59 +08:00
iven
619bad30cb fix(security): Gemini API key header + Mutex safety + Agent validation
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M1-01: Move Gemini API key from URL query param to x-goog-api-key header,
     preventing key leakage in logs/proxy/telemetry (matches Anthropic/OpenAI pattern)

M1-03/M1-04: Replace Mutex .unwrap() with .unwrap_or_else(|e| e.into_inner())
     in MemoryMiddleware and LoopGuardMiddleware — recovers from poison
     instead of panicking async runtime

M2-08: Add input validation to agent_create — reject empty names,
     out-of-range temperature (0-2), and zero max_tokens

M11-06: Replace Date.now() message ID with crypto.randomUUID()
     to prevent collisions in classroom chat
2026-04-04 19:15:50 +08:00
iven
985644dd9a fix(memory): FTS5 full-text search + browser hand autonomy gate
Some checks failed
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M4-05: Replace LIKE-only search with FTS5-first strategy:
- Add memories_fts virtual table (unicode61 tokenizer)
- FTS5 MATCH primary path with CJK LIKE fallback
- Sync FTS index on store()

M3-03: Add autonomy approval check to browserHandStore:
- executeTemplate: check canAutoExecute before running
- executeScript: check approval gate for JS execution
2026-04-04 18:52:02 +08:00
iven
59f660b93b fix(hands): add max_concurrent + timeout_secs fields + hand timeout enforcement
Some checks failed
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M3-04/M3-05 audit fixes:
- HandConfig: add max_concurrent (u32) and timeout_secs (u64) with serde defaults
- Kernel execute_hand: enforce timeout via tokio::time::timeout, cancel on expiry
- All 9 hand implementations: add max_concurrent: 0, timeout_secs: 0
- Agent createClone: pass soul field through to kernel
- Fix duplicate soul block in agent_create command
2026-04-04 18:41:15 +08:00
iven
a644988ca3 fix(desktop): ConfigMigrationWizard PUT 使用 config item ID 替代布尔值
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
M7-02: exists 是 boolean,不能用作 URL 路径参数。
改为使用 saasConfigs.find() 获取完整对象,
用 existing.id 作为 PUT 路径参数。
2026-04-04 18:27:31 +08:00
iven
6d1f2d108a fix(audit): P1 心跳自启动 + refreshToken body + 类型修复
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
审计修复 Batch 2 (M4-03/M7-04/M11-01):

M4-03: 心跳引擎自动启动
  - chat.rs auto-init 块: engine 创建后立即 start()
  - 通过 engines.get() 获取引用避免 move 后使用

M7-04: refreshToken 发送 body 修复
  - SaaSClient 新增 refreshTokenValue 存储 refresh_token
  - refreshToken() 发送 { refresh_token } body
  - SaaSRefreshResponse 新增 refresh_token 字段
  - login/register 自动存储 refresh_token
  - 添加 getRefreshToken/setRefreshToken 访问器

M11-01: blocking_lock 死锁修复 (已存在)
  - 确认 try_lock + Result 匹配模式已正确
2026-04-04 18:26:10 +08:00
iven
05762261be fix(audit): P0 反思引擎 LLM 接入 + P1 hand run_id/skill triggers/pipeline v2
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
审计修复 Batch 1 (M4-02/M3-01/M5-01/M6-02):

P0 M4-02: reflection_reflect 从 KernelState 获取 LLM driver
  - 新增 kernel_state 参数,从 kernel.driver() 获取驱动
  - 自动路径(post_conversation_hook)已正常,手动 Tauri 命令路径已修复

P1 M3-01: hand_execute 返回 run_id 给前端
  - HandResult 新增 run_id 字段
  - execute_hand 结果包含 run_id.to_string()

P1 M5-01: skill-discovery 使用后端 triggers 字段
  - BackendSkillInfo 新增 triggers 字段
  - convertFromBackend 优先使用 triggers,fallback tags

P1 M6-02: pipeline_list 支持 v2 YAML 格式
  - scan_pipelines_with_paths 增加 v2 fallback 解析
  - 新增 pipeline_v2_to_info 转换函数
  - discovery.rs 导入 parse_pipeline_v2_yaml

注: M4-01 双数据库问题已在之前批次修复
     M6-01 route_intent 已确认注册,审计结论过时
2026-04-04 18:11:21 +08:00
iven
a6902c28f5 : ChatArea TS2322 workaround + SubscriptionPanel component
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
The ChatArea.tsx toolSteps/subtasks rendering uses helper functions to avoid TypeScript strict mode && chain producing unknown type in JSX children. Add SubscriptionPanel component for subscription status display in SaaS billing section.
2026-04-04 13:39:11 +08:00
iven
9f8b0ba375 fix(desktop): fix ChatArea TSx type narrowing for toolSteps and subtasks
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
unknown→ unknown

 ReactNode

error
2026-04-04 12:39:45 +08:00
iven
894c0d7b15 feat(desktop): pipeline result preview + industry templates + onboarding auto-trigger
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Sprint 2: 产品体验打磨 + 行业模板

- Create PipelineResultPreview component with tab-based output switching
- Connect workflow/hand messages to PresentationContainer in ChatArea
- Add auto-trigger first Hand after onboarding (industry-specific queries)
- Seed 3 industry agent templates (education, healthcare, design-shantou)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 10:48:47 +08:00
iven
eac1d9449e feat(desktop): add billing frontend — plans, subscription, payment flow
Sprint 1: Desktop 计费闭环

- Add 7 billing types to saas-types.ts (BillingPlan, Subscription, UsageQuota, etc.)
- Add 6 billing API methods to saas-billing.ts (listPlans, getSubscription, createPayment, etc.)
- Extend saas-client.ts with interface merging for billing methods
- Extend saasStore with billing state/actions (plans, subscription, payment polling)
- Create PricingPage component with plan cards, usage bars, and checkout modal
- Add billing page entry in SettingsLayout (CreditCard icon + route)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 10:48:33 +08:00
iven
be0a78a523 feat(saas): add model groups for cross-provider failover
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Model Groups provide logical model names that map to multiple physical
models across providers, with automatic failover when one provider's
key pool is exhausted.

Backend:
- New model_groups + model_group_members tables with FK constraints
- Full CRUD API (7 endpoints) with admin-only write permissions
- Cache layer: DashMap-backed CachedModelGroup with load_from_db
- Relay integration: ModelResolution enum for Direct/Group routing
- Cross-provider failover: sort_candidates_by_quota + OnceLock cache
- Relay failure path: record failure usage + relay_dequeue (fixes
  queue counter leak that caused connection pool exhaustion)
- add_group_member: validate model_id exists before insert

Frontend:
- saas-relay-client: accept getModel() callback for dynamic model selection
- connectionStore: prefer conversationStore.currentModel over first available

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 09:56:21 +08:00
iven
f4ed1b33e0 feat(kernel): add multi-skill orchestration bridge + true parallel execution
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Kernel orchestration bridge: execute_orchestration, auto_compose_skills,
  validate_orchestration methods on Kernel struct
- True parallel execution: replace sequential for-loop with tokio::JoinSet
  for concurrent node execution within parallel groups
- Tauri commands: orchestration_execute (auto-compose or pre-defined graph),
  orchestration_validate (dry-run validation)
- Full type conversions: OrchestrationRequest/Response with camelCase serde

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 09:18:26 +08:00
iven
769bfdf5d6 fix(desktop): 修复 10 个 agent 对话测试发现的缺陷
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- BUG-001+002 P0: 模型选择器合并 SaaS 可用模型列表
- BUG-003 P1: 修复 relay 错误消息重复显示
- BUG-005 P1: 设置页面显示实际连接模式和地址
- BUG-006 P2: 统一 UI 语言为中文
- BUG-009 P3: 错误时隐藏建议按钮
- BUG-010 P3: 密码切换按钮添加 aria-label

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 01:31:28 +08:00
iven
912f117ea3 feat(desktop): wire MCP client to settings UI
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- MCPServices.tsx now calls real Tauri commands (start/stop/list)
  instead of only toggling config flags
- Show running service count, discovered tools per service
- Expand/collapse tool list for each running MCP service
- Extended QuickConfig mcpServices type with command/args/env/cwd
- Config change persists enabled state, MCP start/stop happens live
2026-04-04 01:30:13 +08:00