TASK 1 — Profile Schema (core/profile/schema.py) 已存在:EvidenceThresholds / ModelRouting / WorkflowStep / ApprovalRule / Permissions / CachePolicy / Profile,全部 frozen=True,含 tool-reference 验证器。 TASK 2 — 三个行业 SOP Profile YAML - profiles/presales/profile.yaml 企业预售方案生成 - profiles/security_analysis/profile.yaml 安全事件分析(host_isolation 需审批) - profiles/knowledge_qa/profile.yaml 知识问答(严格模式,阈值全 0.90) TASK 3 — loader / registry / 测试 - core/profile/loader.py + registry.py(线程安全单例 + 热更新) - tests/unit/test_profiles.py(19 个用例) - tests/unit/test_scorer.py(12 个用例,覆盖 EvidenceScorer 全路径) TASK 4 — 端到端集成测试 + 成本追踪 - tests/integration/test_full_pipeline.py 7 个 mock-based 测试 - tests/integration/test_cost_tracking.py 3 个成本测试 - scripts/smoke_test.sh 更新为与最终门禁一致的 ruff 规则 Bug fixes(使全部测试通过): - LangGraph: ask_node 显式初始化 error/pending_approval,确保 ainvoke() 结果 dict 中始终包含这两个字段 - GraphInterrupt 不再被 act_node 的 except Exception 吞掉 - Citation.model_dump(mode="json") 修复 Decimal JSON 序列化问题 - act_node 直接调用 audit_logger.write_tool_call(集成测试 mock executor 时仍可审计) - 修复 mypy 错误:config.py 重复字段、encryptor __init__ 返回值、 registry 属性声明、sanitizer.py 类型注解 - 修复 47 处 ruff lint(F401/F841/E501/I001) - 添加 pytest-timeout>=2.3.0 依赖 最终门禁全部通过: ruff E,F,I 0 errors | mypy 0 errors 143 unit tests, 80.38% coverage | 11 integration tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
112 lines
2.6 KiB
YAML
112 lines
2.6 KiB
YAML
name: "企业预售方案生成"
|
||
version: "1.0.0"
|
||
profile_type: "presales"
|
||
description: "为客户生成专业预售方案,从信息收集到 Word 文档交付,典型耗时 30 分钟以内"
|
||
|
||
allowed_tools:
|
||
- enterprise_info_search
|
||
- rag_case_retriever
|
||
- word_doc_generator
|
||
|
||
input_fields:
|
||
- name: customer_name
|
||
description: 客户公司全称
|
||
required: true
|
||
- name: industry
|
||
description: 所在行业
|
||
required: false
|
||
- name: scale
|
||
description: 企业规模(人数或营收)
|
||
required: false
|
||
- name: pain_points
|
||
description: 核心痛点(可多个)
|
||
required: false
|
||
- name: budget_range
|
||
description: 预算范围
|
||
required: false
|
||
|
||
workflow_steps:
|
||
- id: step_01_enterprise_info
|
||
tool: enterprise_info_search
|
||
params:
|
||
company_name: "{{user_input.customer_name}}"
|
||
include_financials: false
|
||
include_news: true
|
||
output_key: enterprise_profile
|
||
on_failure: abort
|
||
approval_required: false
|
||
estimated_duration_ms: 5000
|
||
|
||
- id: step_02_case_retrieval
|
||
tool: rag_case_retriever
|
||
params:
|
||
query: "{{user_input.pain_points}} {{steps.step_01_enterprise_info.summary}}"
|
||
industry_filter: "{{user_input.industry}}"
|
||
top_k: 5
|
||
tenant_id: "{{user_input.tenant_id}}"
|
||
output_key: matched_cases
|
||
on_failure: skip
|
||
approval_required: false
|
||
estimated_duration_ms: 8000
|
||
|
||
- id: step_03_generate_doc
|
||
tool: word_doc_generator
|
||
params:
|
||
template_name: "presales_standard_v2"
|
||
content:
|
||
enterprise_profile: "{{steps.step_01_enterprise_info}}"
|
||
matched_cases: "{{steps.step_02_case_retrieval}}"
|
||
pain_points: "{{user_input.pain_points}}"
|
||
output_format: docx
|
||
output_key: final_document
|
||
on_failure: abort
|
||
approval_required: false
|
||
estimated_duration_ms: 15000
|
||
|
||
approval_rules:
|
||
- risk_level: high
|
||
require_approval: true
|
||
approver_role: manager
|
||
|
||
evidence_thresholds:
|
||
output_normal: 0.85
|
||
output_with_warning: 0.60
|
||
reject: 0.60
|
||
|
||
model_routing:
|
||
default: "local"
|
||
complex_reasoning: "claude-sonnet-4-6-20260217"
|
||
force_local_if_sensitive: true
|
||
|
||
permissions:
|
||
allowed_roles:
|
||
- admin
|
||
- manager
|
||
- analyst
|
||
data_scope_required: []
|
||
|
||
cache_policy:
|
||
enabled: true
|
||
ttl_seconds: 3600
|
||
|
||
output_format: "docx"
|
||
|
||
required_sections:
|
||
- 执行摘要
|
||
- 客户画像
|
||
- 方案设计
|
||
- 商业价值
|
||
- 实施计划
|
||
- 下一步行动
|
||
|
||
required_output_fields:
|
||
- customer_name
|
||
- industry
|
||
- proposed_solution
|
||
- business_value
|
||
|
||
terminology: |
|
||
预售:售前技术支持阶段
|
||
POC:概念验证(Proof of Concept)
|
||
ROI:投资回报率(Return on Investment)
|