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>
This commit is contained in:
iven
2026-04-06 00:49:16 +08:00
parent f9e1ce1d6e
commit 26a833d1c8
25 changed files with 408 additions and 143 deletions

View File

@@ -79,7 +79,7 @@ impl From<zclaw_hands::HandConfig> for HandInfoResponse {
enabled: config.enabled,
category,
icon,
tool_count: 0,
tool_count: 0, // P2-03: TODO — populated from hand execution metadata
metric_count: 0,
}
}
@@ -123,7 +123,18 @@ pub async fn hand_list(
.ok_or_else(|| "Kernel not initialized. Call kernel_init first.".to_string())?;
let hands = kernel.list_hands().await;
Ok(hands.into_iter().map(HandInfoResponse::from).collect())
let registry = kernel.hands();
// P2-03: Populate tool_count/metric_count from actual Hand instances
let mut results = Vec::new();
for config in hands {
let (tool_count, metric_count) = registry.get_counts(&config.id).await;
let mut info = HandInfoResponse::from(config);
info.tool_count = tool_count;
info.metric_count = metric_count;
results.push(info);
}
Ok(results)
}
/// Execute a hand

View File

@@ -172,6 +172,7 @@ pub async fn skill_create(
tags: vec![],
category: None,
triggers: request.triggers,
tools: vec![], // P2-19: Include tools field
enabled: request.enabled.unwrap_or(true),
};
@@ -217,6 +218,7 @@ pub async fn skill_update(
tags: existing.tags.clone(),
category: existing.category.clone(),
triggers: request.triggers.unwrap_or(existing.triggers),
tools: existing.tools.clone(), // P2-19: Preserve tools on update
enabled: request.enabled.unwrap_or(existing.enabled),
};