Commit Graph

434 Commits

Author SHA1 Message Date
iven
ba586e5aa7 fix: BUG-009/010/011 — DataMasking, cancel button, SQL casts
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-009 (P1): Add frontend DataMasking in saas-relay-client.ts
- Masks ID cards, phones, emails, money, company names before relay
- Unmasks tokens in AI response so user sees original data
- Mirrors Rust DataMasking middleware patterns

BUG-010 (P3): Send button transforms to Stop during streaming
- Shows square icon when isStreaming, calls cancelStream()
- Normal arrow icon when idle, calls handleSend()

BUG-011 (P2): Add ::timestamptz casts for old TEXT timestamp columns
- account/handlers.rs: dashboard stats query
- telemetry/service.rs: reported_at comparisons
- workers/aggregate_usage.rs: usage aggregation query
2026-04-09 23:45:19 +08:00
iven
a304544233 docs: update bug tracker with UI issues + untestable scenarios
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
New bugs from user review:
- BUG-012 (P2): side panel button overlaps with detail button
- BUG-013 (P2): AI response Markdown not rendered, poor formatting

Added detailed section for untestable scenarios:
- 6 scenarios need Tauri local kernel mode
- 4 scenarios need physical environment changes
- 2 scenarios need Admin backend verification
2026-04-09 23:40:28 +08:00
iven
5ae80d800e test: complete exploratory test results for all 4 storylines + sign-off
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
Storyline 3 (极客张):
- 3.4 PASS: SaaS Relay SSE chain verified
- 3.6 FAIL: BUG-009 confirmed - middleware chain bypassed
- Others NOT TESTED: require Tauri kernel local mode

Storyline 4 (妈妈):
- 4.1 PASS: simple mode UI + message flow
- Others SKIP/NOT TESTED: voice input, cold start

Sign-off report updated with full test matrix and release recommendation.
Blocking: BUG-009 (DataMasking bypass in SaaS Relay mode)
2026-04-09 23:21:41 +08:00
iven
71cfcf1277 test: final exploratory test report — 82% pass rate, conditional release
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
50 test items: 4 storylines + 21 module P0 + 6 Admin pages
41 PASS / 2 FAIL / 7 SKIP or N/A
Key blocker: BUG-009 (middleware bypass in SaaS Relay)
Recommendation: conditional release, prioritize BUG-009 fix
2026-04-09 23:12:04 +08:00
iven
b87e4379f6 test: module matrix P0 verification + Admin V2 results
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
15/21 P0 items PASS, 5 SKIP (Tauri-only), 2 PARTIAL
Admin V2: accounts/model-services/relay pages working
New: BUG-011 (P2) Admin dashboard SQL type error
2026-04-09 23:09:33 +08:00
iven
20b856cfb2 test: complete storyline-2 results (BUG-008 fix verification)
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
All scenarios PASS after BUG-008 fix:
- 2.1 PASS: teacher role recognition + proactive help
- 2.2 PASS: 5 quiz questions + answers + analysis
- 2.3 PASS: 10-page courseware + interactive elements
- 2.4 PARTIAL: speech guidance ok, TTS not triggered (SaaS Relay)

Known: All Hands (Quiz/Slideshow/Speech) bypassed in SaaS Relay mode (BUG-009)
2026-04-09 23:06:43 +08:00
iven
87537e7c53 test: storyline 2/3/4 exploratory test results + BUG-009/010
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
Storyline 2 (Teacher): 3 PASS, 1 FAIL (BUG-008 confirmed)
Storyline 3 (Tech user): SSE verified, model switch OK, BUG-009 middleware bypass
Storyline 4 (Mom): 3 PASS, scene 4.3 anomalous BUG-008 behavior with kimi

New findings:
- BUG-009 (P1): SaaS Relay bypasses all 14 middleware layers
- BUG-010 (P3): No cancel button during streaming
2026-04-09 23:02:58 +08:00
iven
448b89e682 test: complete storyline-1 results (1.5-1.8) + BUG-008 tracker update
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.5 PASS: policy compliance check with 6-clause analysis + PPT outline
- 1.6 PASS: BUG-008 fix verified, AI correctly references prior context
- 1.7 PARTIAL: NlScheduleParser not triggered in SaaS Relay mode
- 1.8 NOT TESTED: requires physical network disconnect
2026-04-09 22:56:25 +08:00
iven
9442471c98 fix(relay): send conversation history to SaaS relay (BUG-008)
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
SaaS Relay was sending only the current message without conversation
history, giving LLM no context from previous turns. Root cause:
streamStore passed only `content` string to chatStream(), and
saas-relay-client hard-coded a single-element messages array.

Fix:
- GatewayClient.chatStream() opts: add `history` field
- streamStore: extract last 20 messages as history before calling chatStream
- saas-relay-client: build messages array from history + current message
2026-04-09 22:41:56 +08:00
iven
f8850ba95a test: add storyline-1 test results + update bug tracker
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
Storyline 1 (医院行政小李) results:
- 1.1 SKIP (非首次安装)
- 1.2 PASS (首次对话科室识别)
- 1.3 PASS (会议纪要)
- 1.4 NOT TESTED (Collector Hand)
- Found BUG-003 (require→import), BUG-004 (health formula), BUG-008 (no history)
2026-04-09 22:33:17 +08:00
iven
bf728c34f3 fix: saasStore require() bug + health check pool formula + DEV error details
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.ts: replace require('./chat/conversationStore') with await import()
  to fix ReferenceError in Vite ESM environment (P1)
- main.rs: fix health check pool usage formula from max_connections - num_idle
  to pool.size() - num_idle, preventing false "degraded" status (P1)
- error.rs: show detailed error messages in ZCLAW_SAAS_DEV=true mode
- Update bug tracker with BUG-003 through BUG-007
2026-04-09 22:23:05 +08:00
iven
bd6cf8e05f fix(saas): add ::bigint cast to all SUM() aggregates for PG NUMERIC compat
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
PostgreSQL SUM() on bigint returns NUMERIC, causing sqlx decode errors
when Rust expects i64/Option<i64>. Root cause: key_pool.rs
select_best_key() token_count SUM was missing ::bigint, causing
DATABASE_ERROR on every relay request.

Fixed in 4 files:
- relay/key_pool.rs: SUM(token_count) — root cause of relay failure
- relay/service.rs: SUM(remaining_rpm) in sort_candidates_by_quota
- account/handlers.rs: SUM(input/output_tokens) in dashboard stats
- workers/aggregate_usage.rs: SUM(input/output_tokens) in aggregation
2026-04-09 22:16:27 +08:00
iven
0054b32c61 chore(test): create exploratory test result directory and templates
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
2026-04-09 20:53:45 +08:00
iven
a081a97678 fix(relay): audit fixes — abort signal, model selector guard, SSE CRLF, SQL format
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
Addresses findings from deep code audit:

H-1: Pass abortController.signal to saasClient.chatCompletion() so
     user-cancelled streams actually abort the HTTP connection (was only
     stopping the read loop, leaving server-side SSE connection open).

H-2: ModelSelector now shows only when (!isTauriRuntime() || isLoggedIn).
     Prevents decorative model list in Tauri local kernel mode where model
     selection has no effect (violates CLAUDE.md §5.2).

M-1: Normalize CRLF to LF before SSE event boundary parsing (\n\n).
     Prevents buffer overflow when behind nginx/CDN with CRLF line endings.

M-2: SQL window_minute comparison uses to_char(NOW()-interval, format)
     instead of (NOW()-interval)::TEXT, matching the stored format exactly.

M-3: sort_candidates_by_quota uses same sliding 60s window as select_best_key.

LOW: Fix misleading invalidate_cache doc comment.
2026-04-09 19:51:34 +08:00
iven
e6eb97dcaa perf(relay): full-chain optimization — key pool, model sync, SSE stream
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 (Key Pool correctness):
- RPM: fixed-minute window → sliding 60s aggregation (prevents 2x burst)
- Remove fallback-to-provider-key bypass when all keys rate-limited
- SSE semaphore: 16→64 permits, cleanup delay 60s→5s
- Default 429 cooldown: 5min→60s (better for Coding Plan quotas)
- Expire old key_usage_window rows on record

Phase 2 (Frontend model sync):
- currentModel empty-string fallback to glm-4-flash-250414 in relay client
- Merge duplicate listModels() calls in connectionStore SaaS path
- Show ModelSelector in Tauri mode when models available
- Clear currentModel on SaaS logout

Phase 3 (Relay performance):
- Key Pool: DashMap in-memory cache (TTL 5s) for select_best_key
- Cache invalidation on 429 marking

Phase 4 (SSE stream):
- AbortController integration for user-cancelled streams
- SSE parsing: split by event boundaries (\n\n) instead of per-line
- streamStore cancelStream adapts to 0-arg and 1-arg cancel fns
2026-04-09 19:34:02 +08:00
iven
5c6964f52a fix(desktop): error response improvements — content, retry, model selector
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
P1: onError callback now sets content to error message instead of empty string.
    Previously API errors (404/429) produced empty assistant messages with only
    a visual error badge — now the error text is persisted in message content.

P3: Retry button now re-sends the preceding user message via sendToGateway
    instead of copying to input. Works for both virtualized and non-virtualized
    message lists. Removed unused setInput prop from MessageBubble.

Also hides model selector in Tauri runtime (SaaS token pool routes models).
2026-04-09 18:52:27 +08:00
iven
125da57436 fix: sync currentModel from SaaS available models on login
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
Root cause: conversationStore hardcoded 'glm-4-flash' as default model,
which may not exist in SaaS admin config, causing 404 on all chat requests.

- conversationStore: default currentModel to empty string (runtime-resolved)
- saasStore: after fetching available models, auto-switch currentModel
  to first available if the stored model is not in the list
- SaaS relay getModel() already had fallback to first available model
2026-04-09 18:50:38 +08:00
iven
1965fa5269 fix: migrate glm-4-flash to glm-4-flash-250414 (model deprecated by Zhipu)
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
Zhipu AI has deprecated glm-4-flash, causing 404 errors on all chat requests.
Updated all references:
- config: glm-4-flash → glm-4-flash-250414, added glm-z1-flash
- frontend: defaultModel, conversationStore, ChatArea fallback, ModelsAPI
2026-04-09 18:42:47 +08:00
iven
5f47e62a46 fix(desktop): hide model selector in Tauri runtime — SaaS token pool routes models
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 selector was cosmetic-only in desktop mode: chatStream never passes
model param to backend. Hiding prevents user confusion and 404 errors when
selecting models not in SaaS token pool.

Also adds E2E test report covering 168 messages, 4 bugs found (P0 fixed).
2026-04-09 18:35:34 +08:00
iven
4c325de6c3 docs: update CLAUDE.md §13 + TRUTH.md for Hermes Intelligence Pipeline
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
- §13: Add Hermes pipeline subsystem (4 chunks: experience/user profile/NL cron/trajectory)
- §13: Update middleware count 13→14 (TrajectoryRecorder@650)
- §13: Update recent changes with Hermes entry
- TRUTH.md: Update test count, middleware count, add change log entry
2026-04-09 17:52:15 +08:00
iven
d6ccb18336 docs: add pre-release functional test design + screenshots 2026-04-09 17:48:40 +08:00
iven
2f25316e83 feat(desktop): simple mode UI — ChatArea compact + SimpleSidebar + RightPanel dual-mode
Adapt ChatArea for compact/butler mode:
- Add onOpenDetail prop for expanding to full view
- Remove inline export dialog (moved to detail view)
- Replace SquarePen with ClipboardList icon

Add SimpleSidebar component for butler simple mode:
- Two tabs: 对话 / 行业资讯
- Quick suggestion buttons
- Minimal navigation

RightPanel refactoring for dual-mode support:
- Detect simple vs professional mode
- Conditional rendering based on butler mode state
2026-04-09 17:48:18 +08:00
iven
4b15ead8e7 feat(hermes): implement intelligence pipeline — 4 chunks, 684 tests passing
Hermes Intelligence Pipeline closes breakpoints in ZCLAW's existing
intelligence components with 4 self-contained modules:

Chunk 1 — Self-improvement Loop:
- ExperienceStore (zclaw-growth): FTS5+TF-IDF wrapper with scope prefix
- ExperienceExtractor (desktop/intelligence): template-based extraction
  from successful proposals with implicit keyword detection

Chunk 2 — User Modeling:
- UserProfileStore (zclaw-memory): SQLite-backed structured profiles
  with industry/role/expertise/comm_style/recent_topics/pain_points
- UserProfiler (desktop/intelligence): fact classification by category
  (Preference/Knowledge/Behavior) with profile summary formatting

Chunk 3 — NL Cron Chinese Time Parser:
- NlScheduleParser (zclaw-runtime): 6 pattern matchers for Chinese time
  expressions (每天/每周/工作日/间隔/每月/一次性) producing cron expressions
- Period-aware hour adjustment (下午3点→15, 晚上8点→20)
- Schedule intent detection + task description extraction

Chunk 4 — Trajectory Compression:
- TrajectoryStore (zclaw-memory): trajectory_events + compressed_trajectories
- TrajectoryRecorderMiddleware (zclaw-runtime/middleware): priority 650,
  async non-blocking event recording via tokio::spawn
- TrajectoryCompressor (desktop/intelligence): dedup, request classification,
  satisfaction detection, execution chain JSON

Schema migrations: v2→v3 (user_profiles), v3→v4 (trajectory tables)
2026-04-09 17:47:43 +08:00
iven
0883bb28ff fix: validation hardening — agent import prompt limit, relay retry tracking, heartbeat validation
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
- agent_import: add system_prompt length validation (max 50K chars)
  to prevent excessive token consumption from imported configs
- relay retry_task: wrap JoinHandle to log abort on server shutdown
- device_heartbeat: validate device_id length (1-64 chars) matching
  register endpoint constraints
2026-04-09 17:24:36 +08:00
iven
cf9b258c6c docs: pre-release test report + TRUTH.md numbers update
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 comprehensive pre-release test report (code-level audit)
- Update TRUTH.md: SaaS endpoints 130→140, middleware 12→13
- Update CLAUDE.md stabilization table with correct numbers
- Mark all blocking bugs as resolved in test report
2026-04-09 16:44:54 +08:00
iven
3f2acb49fb fix: pre-release audit fixes — Twitter OAuth, DataMasking perf, Prompt versioning
- Twitter like/retweet: return explicit unavailable error instead of
  sending doomed Bearer token requests (would 403 on Twitter API v2)
- DataMasking: pre-compile regex patterns with LazyLock (was compiling
  6 patterns on every mask() call)
- Prompt version: fix get_version handler ignoring version path param,
  add service::get_version_by_number for correct per-version retrieval
2026-04-09 16:43:24 +08:00
iven
f2d6a3b6b7 docs: add architecture awareness system — CLAUDE.md §13/§14 + ARCHITECTURE_BRIEF
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
- Activate CLAUDE.md with §13 architecture snapshot (auto-sync markers)
  and §14 anti-pattern warnings + scenario instructions
- Fix dead link to non-existent STABILIZATION_DIRECTIVE.md
- Update stale numbers (93→130 SaaS APIs, 171→182 Tauri commands, 13→15 admin pages)
- Create docs/ARCHITECTURE_BRIEF.md as permanent architecture reference
  covering 10 subsystems (butler, chatstream, LLM drivers, client routing,
  SaaS auth, memory pipeline, Pipeline DSL, Hands, middleware, key paths)
- Add /sync-arch skill for manual or workflow-triggered architecture sync
- Add PostToolUse hook to remind doc sync after git commit/push
- Update §8.3 completion flow to include architecture snapshot updates
- Mark memory files (system_architecture, butler_mode) as migrated to BRIEF
- Add ARCHITECTURE_BRIEF.md as top entry in MEMORY.md index
2026-04-09 14:09:26 +08:00
iven
26f50cd746 fix(butler): runtime fixes — SQLite mode=rwc + React hooks ordering
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
- Add ?mode=rwc to pain.db SQLite URL so it creates the file on first run
- Move useUIModeStore hook before conditional returns in App.tsx to fix
  React "Rendered more hooks than during the previous render" error
2026-04-09 12:15:34 +08:00
iven
646d8c21af fix(butler): wire verification gaps — pain storage init, cold start, UI mode switches
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
- Call init_pain_storage() in Tauri .setup() so pain persistence activates on boot
- Integrate useColdStart hook into FirstConversationPrompt for auto-greeting
- Add UI mode toggle section to Settings/General (already had imports)
- Add "简洁" mode switch-back button to TopBar in professional layout
- Update SemanticSkillRouter @reserved annotation to reflect active status
2026-04-09 10:38:49 +08:00
iven
e6937e1e5f feat: deliverables 3-6 — cold start, simple mode UI, bridge tests, docs
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
Deliverable 3 — Cold Start Flow:
- New: use-cold-start.ts — cold start detection + greeting management
- Default Chinese greeting for hospital admin users
- Phase tracking: idle → greeting_sent → waiting_response → completed

Deliverable 4 — Simple Mode UI:
- New: uiModeStore.ts — 'simple'|'professional' mode with localStorage
- New: SimpleTopBar.tsx — minimal top bar with mode toggle
- Modified: App.tsx — dual layout rendering based on UI mode
- Modified: ChatArea.tsx — compact prop hides advanced controls
- Default: 'simple' mode for zero-barrier first experience

Deliverable 5 — Tauri Bridge Integration Tests:
- New: tauri-bridge.integration.test.ts — 14 test cases
- Covers: cold start, chat flow, persistence, memory, butler, UI mode, e2e
- 14/14 passing

Deliverable 6 — Release Documentation:
- New: installation-guide.md — user-facing install guide (Chinese, no jargon)
- New: hospital-deployment.md — IT admin deployment guide (Docker, GPO, SCCM)
2026-04-09 09:51:56 +08:00
iven
ffaee49d67 feat(middleware): add butler router for semantic skill routing
New ButlerRouterMiddleware (priority 80) intercepts user messages,
classifies intent using keyword-based domain detection, and injects
routing context into the system prompt. Supports healthcare, data
report, policy compliance, and meeting coordination domains.

- New: butler_router.rs — keyword classifier + MiddlewareContext injection
- Registered in Kernel::create_middleware_chain() at priority 80
- 9 tests passing (classification + middleware integration)
2026-04-09 09:26:48 +08:00
iven
a4c89ec6f1 feat(intelligence): persist pain points and proposals to SQLite
PainAggregator and SolutionGenerator were in-memory only, losing all
data on restart. Add PainStorage module with SQLite backend (4 tables),
dual-write strategy (hot cache + durable), and startup cache warming.

- New: pain_storage.rs — SQLite CRUD for pain_points, pain_evidence,
  proposals, proposal_steps with schema initialization
- Modified: pain_aggregator.rs — global PAIN_STORAGE singleton,
  init_pain_storage() for startup, dual-write in merge_or_create/update
- Modified: solution_generator.rs — same dual-write pattern via
  global PAIN_STORAGE
- 20 tests passing (10 storage + 10 aggregator)
2026-04-09 09:15:15 +08:00
iven
2247edc362 chore: add @reserved annotations to 5 butler Tauri 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
These pain_aggregator functions have no frontend UI yet.
2026-04-09 08:54:53 +08:00
iven
f298a8e1a2 fix(ui): remove duplicate 'Z' from TopBar header
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 TopBar had a gradient badge with 'Z' letter followed by the title
'ZCLAW', creating visual 'ZZCLAW'. Replaced badge with a solid gradient
square as a brand indicator without the duplicate letter.
2026-04-09 08:47:34 +08:00
iven
5da6c0e4aa docs: add release assessment report + update TRUTH.md command counts
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 5+6 complete:
- 182 Tauri commands audited: 92 connected, 20 reserved, 70 orphan
- Release assessment: CONDITIONAL GO for beta
- TRUTH.md updated with accurate command counts from cross-validation
- All P2 bugs fixed, core features verified across 3 LLM models
2026-04-08 23:15:06 +08:00
iven
8af8d733fd fix(ui): remove AnimatePresence from sidebar tabs to fix content switching
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
The framer-motion AnimatePresence with mode="wait" caused the sidebar
content to get stuck on the conversations list when switching to the
agents tab. The React state updated correctly but the DOM did not
re-render. Replaced with simple conditional rendering which is more
reliable and removes the framer-motion dependency from this component.
2026-04-08 23:09:01 +08:00
iven
d5ad07d0a7 docs: add Phase 4 test report (Role C teacher agent, 13/14 PASS)
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
All core and extended test scenarios passed for the high school math
teacher persona using DeepSeek-V3 and Kimi models. Key findings:
- Math problem solving, quiz generation, memory flywheel all working
- Model switching (deepseek→kimi) verified mid-conversation
- Safety boundary correctly rejects sensitive requests
- 1 P2 bug: sidebar AnimatePresence tab switching fails
2026-04-08 23:02:54 +08:00
iven
adcce0d70c fix: 4 pre-release bug fixes — identity override, model config, agent sync, auto-identity
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
P1: identity.rs get_identity() returns empty soul/instructions for agents
without explicit identity files. This prevents the default ZCLAW personality
from overriding agent_config.system_prompt. New get_identity_or_default()
method added for the DEFAULT agent.

P2: messaging.rs now uses agent_config.model.model when available, falling
back to global Kernel config. This allows per-agent model selection.

P2: agentStore.ts loadClones retries up to 3 times (300ms interval) when
getClient() returns null, handling the coordinator initialization race.

P2: agent_create Tauri command auto-populates identity files (soul +
instructions) from creation parameters, ensuring build_system_prompt()
has content for new agents.

Also fixes conversationStore upsertActiveConversation to persist generated
conversation IDs, preventing duplicate entries on new conversations.
2026-04-08 21:47:46 +08:00
iven
8eeb616f61 docs: update TRUTH.md with Phase 3 pre-release test results
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
2026-04-08 21:09:49 +08:00
iven
de2d3e3a11 fix(runtime): add 30s timeout to tool execution in AgentLoop
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
Tool execution (ShellExec, WebFetch, etc.) had no timeout, causing the
entire streaming response to hang indefinitely when a tool fails or stalls.
Now wraps execute_tool calls in tokio::time::timeout(30s) with a graceful
error message on timeout.
2026-04-08 20:44:52 +08:00
iven
6e0c1e55a9 fix(wizard): off-by-one causing step 7/6 display and broken completion
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
- nextStep() was allowing currentStep to reach steps.length (6), past
  the last step index (5), showing "步骤 7/6:" with empty content area
- On the last step, nextStep now triggers handleSubmit() directly
  instead of navigating to a phantom step 6
- Footer button condition changed: "完成" shows on last step instead
  of after it, keeping error/success messages visible
- Added error logging in catch block (was silently swallowing errors)
2026-04-08 19:18:33 +08:00
iven
0b0ab00b9c fix(chat): prevent React Maximum update depth exceeded during streaming
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
Root cause: Each LLM delta (text/thinking) triggered a synchronous
setState via updateMessages → chatStore.setState. With Kimi thinking
model emitting many deltas per frame, this caused a React render storm
that hit the maximum update depth limit.

Fix (two-layer approach):
1. streamStore: Buffer text/thinking deltas locally and flush to store
   via setTimeout(0), batching multiple deltas per frame
2. chatStore: Microtask batching in injectChatStore.updateMessages to
   coalesce rapid successive updates

Verified: 2-round conversation (4 messages) with Kimi thinking model
completes without crash. Previously crashed 100% on 2nd message.
2026-04-08 14:47:43 +08:00
iven
ade534d1ce feat: 添加MCP调试插件并优化流式超时处理
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
refactor(relay): 将Provider Key管理路由移至model_config模块
fix(saas): 修复demo_keys与provider_keys的匹配逻辑
perf(runtime): 将流式响应超时从60秒延长至180秒以适配思考型模型
docs: 新增模块化审计和上线前功能测试方案文档
chore: 添加tauri-plugin-mcp依赖及相关配置
2026-04-08 13:39:06 +08:00
iven
81d1702484 fix(chat): replace h-full with flex-1 min-h-0 for ChatArea container
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
h-full = 100% of parent height, but TopBar already occupies 56px above.
This caused ChatArea to overflow by 56px, pushing the input box below
the visible viewport. flex-1 + min-h-0 correctly fills remaining space
in the flex column layout.
2026-04-08 09:29:30 +08:00
iven
a616c73883 fix(chat): input box cut off — add flex-shrink-0 to prevent flex compression
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 input area at the bottom of the chat panel lacked flex-shrink-0,
causing the flex column layout to compress it when message content filled
the Conversation area. This made the textarea only partially visible and
the scrollbar unable to reach the bottom of the input area.
2026-04-08 08:51:57 +08:00
iven
eab9b5fdcc fix(saas): WorkerDispatcher registration race — consumer starts after all workers registered
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
Root cause: start_consumer() was called in new() before any register() calls,
so the consumer's cloned HashMap was always empty. Workers like log_operation
and record_usage were never found, causing "Unknown worker" errors.

- Add WorkerDispatcher::start() method to be called after all register()s
- Update main.rs to call dispatcher.start() after 7 workers registered
2026-04-08 08:33:54 +08:00
iven
f9303ae0c3 fix(saas): SQL type cast fixes for E2E relay 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
- key_pool.rs: cast cooldown_until to timestamptz for comparison with NOW()
- key_pool.rs: cast request_count to bigint (INT4→INT8) for sqlx decoding
- service.rs: cast cooldown_until to timestamptz in quota sort query
- scheduler.rs: cast last_seen_at to timestamptz in device cleanup
- totp.rs: use DateTime<Utc> instead of rfc3339 string for updated_at
2026-04-07 22:24:19 +08:00
iven
ca0e537682 docs: update TRUTH.md and CLAUDE.md with Phase 5 test results
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
- TRUTH.md: Rust tests 383→537, frontend tests 23→31 files, add Phase 5 changelog
- TRUTH.md: update date to 2026-04-07, add 1048 total test count
- CLAUDE.md: fix zclaw-hands test count 155→106
- CLAUDE.md: add Rust and SaaS test commands to verification section
2026-04-07 21:20:08 +08:00
iven
ab0e11a719 fix(saas): Phase 5 regression fixes — SQL type casts + test data corrections
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
- Fix usage_stats SQL: add ::timestamptz cast for Option<String> params
- Fix usage_stats SQL: add ::bigint cast for COALESCE(SUM(...))
- Fix telemetry INSERT: add ::timestamptz cast for reported_at column
- Fix config_analysis_empty test: seed data makes total_items > 0
- Fix key_pool_crud test: key_value must be >= 20 chars
- Fix SkillManifest test helpers: add missing tools field

All 1048 tests pass: 580 Rust + 138 SaaS + 330 Desktop Vitest
2026-04-07 19:21:45 +08:00
iven
6d2bedcfd7 test(desktop): Phase 4 E2E scenario tests — 47 tests for 10 user scenarios
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
4 new Playwright spec files covering all 10 planned E2E scenarios:

- user-scenarios-core.spec.ts (14 tests): Onboarding, multi-turn dialogue,
  model switching — covers scenarios 1-3
- user-scenarios-automation.spec.ts (16 tests): Hands CRUD/trigger/approval,
  Pipeline workflow, automation triggers — covers scenarios 4, 6, 9
- user-scenarios-saas-memory.spec.ts (16 tests): Memory system, settings
  config, SaaS integration, butler panel — covers scenarios 5, 7, 8, 10
- user-scenarios-live.spec.ts (1 test): 100+ round real LLM conversation
  with context recall verification — uses live backend
2026-04-07 17:44:31 +08:00