import { type EvidenceGraphSummary } from "./evidence_graph_view.js"; /** 诊断检查类型(CLI doctor 与 MCP handler 共用) */ export type DoctorCheckType = "state" | "gates" | "scope" | "paths" | "command" | "hooks" | "upgrade" | "full"; /** 诊断报告(纯数据结构,不含 MCP result 外壳;CLI doctor 直接消费,MCP handler 在外层包 result) */ export interface DoctorReport { check_type: DoctorCheckType; success: boolean; message?: string; error?: string; paths?: Array<{ key: string; resolved: string; is_default: boolean; default_path: string; exists: boolean; }>; has_current_task?: boolean; total_tasks?: number; task?: { id: string; intent: string; domain_focus?: string; status: string; system_context?: string; last_domain_focus_change?: { from?: string; to: string; source: string; at: string; }; }; evidence_summary?: { required: number; valid: number; invalid: number; missing: number; adversarial_review_passed?: boolean; }; gates?: Record; waivers?: { total: number; check_id_wide: number; stale_check_ids: string[]; ruleset_drifted: number; by_domain: Record; }; project_root?: string; denied_patterns?: string[]; state?: DoctorReport; scope?: { project_root?: string; denied_patterns?: string[]; message?: string; }; knowledge?: { exists: boolean; path: string; rule_count?: number; advice?: string; probe_health?: ProbeHealth; }; registry?: { total: number; zombies: number; orphans: number; overlaps: number; message: string; }; reviews?: { total: number; with_reviewer_id: number; duplicate_session_reviews: number; duplicate_sessions: string[]; in_progress_count: number; total_pending_tokens: number; message: string; }; command?: { resolved: boolean; version?: string; error?: string; }; hooks?: { settings_exists: boolean; mcp_exists: boolean; managed_hooks_present: { scope_check: boolean; bash_check: boolean; hook_check: boolean; }; matcher_ok: boolean; issues: string[]; message: string; }; secret?: { exists: boolean; path: string; mode_ok: boolean; status?: "ok" | "warn" | "error"; issues: string[]; }; security_posture?: { auth_token_configured: boolean; advisories: string[]; }; upgrade?: { project_version?: string; current_version: string; status: string; version_drift: boolean; mandatory_impacts: string[]; issues: string[]; }; signature_audit?: { unresolved: number; stores: string[]; message: string; }; governance?: { policy_count: number; recent_decisions: Record; recent_total: number; message: string; }; waiver_governance?: { total_waivers: number; structural_count: number; by_conflict_source: Array<{ source: string; count: number; limit: number; }>; expired_structural: Array<{ waiver_id: string; conflict_source: string; expires_at: number; }>; total_baselines: number; baselines: Array<{ baseline_id: string; check_id: string; path_pattern: string; registered_count: number; registered_at: string; }>; recent_changes: string[]; message: string; }; coverage?: { distribution: Array<{ domain: string; artifact_kind: string; formal_passed: number; formal_failed: number; trace: number; semantic_pending: number; /** 语义层非 pending 计数——当前引擎 AI 审完成态不回流证据(结论在独立 review store),正常数据恒 0; * 保留字段仅容纳 legacy 无 layer 记录的兼容归类,CLI 不单列(防「已审 0」误读为审查从未发生)。 */ semantic_reviewed: number; total_checks: number; evidence_at: number; }>; ai_review_share: { total_checks: number; semantic_pending: number; pending_percent: number; without_deterministic: string[]; without_any_check: string[]; }; blindspots: { items: Array<{ id: string; domain: string; description: string; mitigation: string; source: "platform" | "project"; }>; platform_count: number; project_count: number; errors: string[]; }; message: string; }; } /** 项目探针健康(doctor 硬预检:加载错误/依赖缺失 = 需修复项,不降级) */ interface ProbeHealth { /** L0/L1 探针规则数 */ total: number; /** 加载错误(无 verification_layer / 配对非法 / probe_path 越界等) */ errors: string[]; /** 声明了但未安装的探针依赖(semgrep/opa) */ missing_tools: string[]; } /** * 运行诊断检查(CLI doctor 命令与 MCP handler 共用入口)。 * @param projectRoot 项目根目录 * @param checkType 检查类型,默认 full * @returns 诊断报告(纯数据,不含 MCP result 外壳) */ /** 证据图诊断摘要(Step5 消费接入):经 EvidenceGraphView 读 store,不直接拼装 ResolutionStore/AdjudicationReviewStore。 * 提供任务级 findings/resolutions/artifacts/unresolvedCount 概览,供 doctor/审计查询。低风险:独立导出函数,不进 checkType 枚举/不改 runDoctorCheck。 */ export declare function getEvidenceGraphSummary(projectRoot: string, taskId: string): Promise; export declare function runDoctorCheck(projectRoot: string, checkType?: DoctorCheckType): Promise; /** 检查对抗审查独立性诊断(reviews 的 reviewer_session_id 多轮重复统计 + in_progress/pending token 计数)。 * 主链路已拒绝缺失/重复 reviewer_session_id;doctor 用于发现旧记录或手工污染,不写盘。 */ export declare function checkReviews(projectRoot: string): NonNullable; export {};