import { shouldSample } from "./risk_sampler.js";
import { debug } from "../core/logger.js";
/**
 * 从审计池按风险加权抽样，返回需要人工审查的任务列表。
 * @param options - 抽样选项，包含种子和数量
 * @returns 抽样结果列表
 */
export function sampleAuditItems(items, seed = 0) {
    debug("audit_sampler", "sampleAuditItems() 开始执行");
    const decisions = [];
    for (const item of items) {
        const decision = shouldSample({
            task_id: item.task_id,
            risk: item.risk,
            changed_files: item.changed_files,
            capability_refs: item.capability_refs,
        }, seed);
        decisions.push(decision);
    }
    const sampledCount = decisions.filter((d) => d.should_sample).length;
    return {
        seed,
        total_items: decisions.length,
        sampled_count: sampledCount,
        skipped_count: decisions.length - sampledCount,
        decisions,
    };
}
//# sourceMappingURL=audit_sampler.js.map