import type { GrawkusConfig, Message } from './types.js';
export interface BenchmarkTraceEvent {
    seq: number;
    tool: string;
    target: string;
    status: 'ok' | 'error';
    verification: boolean;
    elapsedMs: number;
    inputPreview: string;
    outputPreview: string;
}
export interface BenchmarkTraceSummary {
    version: 1;
    sessionId: string;
    mode: string;
    cwd: string;
    provider: string;
    model: string;
    startedAt: string;
    endedAt: string;
    durationMs: number;
    toolCallCount: number;
    errorCount: number;
    usage: BenchmarkUsageSummary;
    verificationCount: number;
    verificationCommands: string[];
    verificationEvidence: BenchmarkVerificationEvidence;
    finalAnswerEvidence: BenchmarkFinalAnswerEvidence;
    changedFiles: string[];
    worktreeChangedFiles: string[];
    artifacts: BenchmarkTraceArtifact[];
    openAgentLeaderboardDraft: OpenAgentLeaderboardDraft;
    trajectoryQuality: BenchmarkTrajectoryQuality;
    experienceCard: BenchmarkExperienceCard;
    changeEvaluation: BenchmarkChangeEvaluation;
    agentContextCompilation: BenchmarkAgentContextCompilation;
    submissionBundleManifest: BenchmarkSubmissionBundleManifest;
    finalAssistant: string;
    events: BenchmarkTraceEvent[];
}
export interface BenchmarkExperienceCard {
    version: 1;
    replayCheckpoints: BenchmarkExperienceReplayCheckpoint[];
    failureSignatures: BenchmarkVerifierFailureSignature[];
    sourceResearchCoverage: SourceResearchCoverage;
    sourceMiningCoverage: BenchmarkSourceMiningCoverage;
    componentObservability: BenchmarkExperienceComponentObservability;
    taskContract: BenchmarkExperienceTaskContract;
    taskAlignment: BenchmarkExperienceTaskAlignment;
    specCompliance: BenchmarkExperienceSpecCompliance;
    rewardHack: BenchmarkExperienceRewardHack;
    harnessSafety: BenchmarkHarnessSafetyAudit;
    longHorizon: BenchmarkExperienceLongHorizon;
    proactivity: BenchmarkExperienceProactivity;
    candidateDossier: BenchmarkExperienceCandidateDossier;
    rootCauseHypothesis: BenchmarkExperienceRootCauseHypothesis;
    failureOnset: BenchmarkFailureOnsetDiagnosis;
    trajectoryTriage: BenchmarkTrajectoryTriage;
    trajectoryCleanup: BenchmarkExperienceTrajectoryCleanup;
    environmentReconstruction: BenchmarkExperienceEnvironmentReconstruction;
    dependencyUpgrade: BenchmarkExperienceDependencyUpgrade;
    decisionObservability: BenchmarkExperienceDecisionObservability;
    validationReliability: BenchmarkExperienceValidationReliability;
    contextUtilization: BenchmarkExperienceContextUtilization;
    runEfficiency: BenchmarkExperienceRunEfficiency;
    verificationCommands: string[];
    changedFiles: string[];
    warnings: string[];
}
export interface BenchmarkExperienceReplayCheckpoint {
    seq: number;
    tool: string;
    target: string;
    reason: 'file_context' | 'search_context' | 'failing_verifier';
    score: number;
}
export type BenchmarkHarnessComponentKind = 'system_prompt' | 'tool_description' | 'tool_implementation' | 'middleware' | 'skill' | 'sub_agent' | 'long_term_memory' | 'short_term_memory' | 'agent_config' | 'adapter' | 'benchmark_trace' | 'test_or_verifier' | 'dependency_manifest' | 'dependency_lockfile' | 'documentation' | 'source_code' | 'unknown';
export interface BenchmarkComponentEditEvent {
    seq: number;
    tool: string;
    target: string;
    component: BenchmarkHarnessComponentKind;
    reason: string;
}
export interface BenchmarkComponentEditSummary {
    component: BenchmarkHarnessComponentKind;
    editCount: number;
    targets: string[];
}
export interface BenchmarkExperienceComponentObservability {
    editCount: number;
    classifiedEditCount: number;
    unclassifiedEditCount: number;
    components: BenchmarkComponentEditSummary[];
    editEvents: BenchmarkComponentEditEvent[];
}
export interface BenchmarkExperienceTaskContract {
    signalCount: number;
    signals: string[];
    checklistAfterContext: boolean | null;
    checklistComplete: boolean | null;
    incompleteCount: number;
    incompleteItems: BenchmarkTodoIncompleteItem[];
}
export interface BenchmarkExperienceTaskAlignment {
    risk: boolean;
    signalCount: number;
    signals: BenchmarkTaskAlignmentSignal[];
}
export interface BenchmarkExperienceSpecCompliance {
    risk: boolean;
    signalCount: number;
    signals: BenchmarkSpecComplianceSignal[];
}
export interface BenchmarkExperienceRewardHack {
    risk: boolean;
    signalCount: number;
    signals: BenchmarkRewardHackSignal[];
}
export type BenchmarkHarnessSafetySignalCategory = 'resource_access' | 'information_transfer' | 'destructive_operation' | 'oracle_access';
export interface BenchmarkHarnessSafetySignal {
    seq: number;
    tool: string;
    target: string;
    category: BenchmarkHarnessSafetySignalCategory;
    reason: string;
    evidence: string;
}
export interface BenchmarkHarnessSafetyAudit {
    risk: boolean;
    signalCount: number;
    signals: BenchmarkHarnessSafetySignal[];
    resourceAccessCount: number;
    informationTransferCount: number;
    destructiveOperationCount: number;
    oracleAccessCount: number;
}
export interface BenchmarkExperienceLongHorizon {
    risk: boolean;
    signalCount: number;
    signals: BenchmarkLongHorizonSignal[];
}
export interface BenchmarkExperienceProactivity {
    detected: boolean;
    risk: boolean;
    signalCount: number;
    signals: BenchmarkProactivitySignal[];
    contextContract: BenchmarkProactivityContextContract;
    hiddenIntentEvidence: boolean;
    clarificationEvidence: boolean;
    privacyEvidence: boolean;
    completionEvidence: boolean;
    actionCount: number;
}
export interface BenchmarkProactivityContextContract {
    profile: boolean;
    history: boolean;
    files: boolean;
    appState: boolean;
    tools: boolean;
    preferences: boolean;
    coverageCount: number;
}
export interface BenchmarkExperienceDecisionObservability {
    editCount: number;
    predictedEditCount: number;
    verifiedPredictionCount: number;
    targetedFixCount: number;
    missingTargetedFixCount: number;
    regressionForecastCount: number;
    missingRegressionForecastCount: number;
    editPredictions: BenchmarkExperienceEditPrediction[];
}
export interface BenchmarkExperienceRootCauseHypothesis {
    recorded: boolean;
    risk: boolean;
    signalCount: number;
    signals: BenchmarkRootCauseHypothesisSignal[];
}
export type BenchmarkFailureOnsetCategory = 'none' | 'pre_edit_reproduction' | 'post_edit_regression' | 'repair_loop' | 'inconclusive_verifier' | 'unknown_failure';
export type BenchmarkFailureOnsetRecommendedAction = 'none' | 'diagnose_before_patch' | 'inspect_failure_files' | 'avoid_redundant_rerun' | 'stabilize_regression_cycle' | 'refresh_state_then_repair';
export interface BenchmarkFailureOnsetDiagnosis {
    detected: boolean;
    risk: boolean;
    category: BenchmarkFailureOnsetCategory;
    failedVerificationSeq: number | null;
    suspectedOnsetSeq: number | null;
    suspectedOnsetTool: string | null;
    suspectedOnsetTarget: string | null;
    command: string | null;
    diagnosisRecorded: boolean;
    downstreamRepairCount: number;
    blindRepairCount: number;
    unalignedRepairCount: number;
    repeatedVerifierCount: number;
    regressionCycleCount: number;
    evidence: string[];
    recommendedAction: BenchmarkFailureOnsetRecommendedAction;
}
export type BenchmarkTrajectoryTriageCategory = 'interaction' | 'execution' | 'environment';
export type BenchmarkTrajectoryTriageKind = 'misalignment' | 'stagnation' | 'disengagement' | 'satisfaction' | 'failure' | 'loop' | 'exhaustion';
export type BenchmarkTrajectoryTriageSeverity = 'info' | BenchmarkProcessDefectSeverity;
export interface BenchmarkTrajectoryTriageSignal {
    category: BenchmarkTrajectoryTriageCategory;
    kind: BenchmarkTrajectoryTriageKind;
    severity: BenchmarkTrajectoryTriageSeverity;
    seq: number | null;
    evidence: string;
}
export interface BenchmarkTrajectoryTriage {
    informative: boolean;
    score: number;
    signalCount: number;
    categories: Record<BenchmarkTrajectoryTriageCategory, number>;
    signals: BenchmarkTrajectoryTriageSignal[];
    summary: string;
}
export interface BenchmarkExperienceEditPrediction {
    editSeq: number;
    tool: string;
    target: string;
    prediction: string;
    targetedFix: string | null;
    requiresTargetedFix: boolean;
    predictedRegression: string | null;
    nextVerifierSeq: number | null;
    nextVerifierStatus: 'ok' | 'error' | null;
    nextVerifierCommand: string | null;
}
export interface BenchmarkChangeEvaluation {
    version: 1;
    format: 'grawkus-change-evaluation-v1';
    source: 'grawkus benchmark trace';
    createdAt: string;
    status: 'no_edits' | 'missing_predictions' | 'missing_regression_forecasts' | 'pending_verification' | 'contradicted' | 'regression_risk' | 'confirmed';
    accepted: boolean | null;
    reason: string;
    editCount: number;
    predictedEditCount: number;
    targetedFixCount: number;
    missingTargetedFixCount: number;
    targetedFixManifestRisk: boolean;
    regressionForecastCount: number;
    missingRegressionForecastCount: number;
    unpredictedEditCount: number;
    confirmedPredictionCount: number;
    contradictedPredictionCount: number;
    unverifiedPredictionCount: number;
    decisionCoveragePercent: number | null;
    regressionCycleCount: number;
    broadRegressionFailureCount: number;
    predictions: BenchmarkChangeEvaluationPrediction[];
    unpredictedEdits: BenchmarkChangeEvaluationUnpredictedEdit[];
    regressionCycles: BenchmarkPostEditRegressionCycleEvent[];
    recommendedAction: string;
}
export interface BenchmarkChangeEvaluationPrediction extends BenchmarkExperienceEditPrediction {
    verdict: 'confirmed' | 'contradicted' | 'unverified';
    evidence: string;
}
export interface BenchmarkChangeEvaluationUnpredictedEdit {
    editSeq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkExperienceValidationReliability {
    lastEditSeq: number | null;
    finalEditVerificationCount: number;
    finalEditPassingVerificationCount: number;
    stableValidationAfterLastEdit: boolean | null;
    broadValidationAfterLastEdit: boolean | null;
    passingBroadValidationAfterLastEdit: boolean | null;
    ciValidationAfterLastEdit: boolean | null;
    passingCiValidationAfterLastEdit: boolean | null;
    postEditRegressionCycleCount: number;
    lastPostEditVerificationSeq: number | null;
    lastPostEditVerificationStatus: 'ok' | 'error' | null;
    finalVerifierCommands: string[];
}
export interface BenchmarkExperienceContextUtilization {
    inspectCount: number;
    hitCount: number;
    missCount: number;
    utilizationPercent: number | null;
    risk: boolean;
    missEvents: BenchmarkContextUtilizationEvent[];
    preEditInspectCount: number;
    preEditHitCount: number;
    preEditMissCount: number;
    preEditUtilizationPercent: number | null;
    preEditBloatRisk: boolean;
    preEditBloatEvents: BenchmarkContextBloatEvent[];
}
export interface BenchmarkExperienceCandidateDossier {
    recorded: boolean;
    risk: boolean;
    signalCount: number;
    signals: BenchmarkCandidateDossierSignal[];
}
export interface BenchmarkExperienceTrajectoryCleanup {
    risk: boolean;
    eventCount: number;
    noisyOutputCount: number;
    oversizedOutputCount: number;
    duplicateOutputCount: number;
    base64OutputCount: number;
    highEntropyOutputCount: number;
    events: BenchmarkTrajectoryCleanupEvent[];
}
export interface BenchmarkExperienceRunEfficiency {
    toolCallCount: number;
    totalToolElapsedMs: number;
    maxToolElapsedMs: number;
    slowToolCallCount: number;
    usageCallCount: number;
    totalTokens: number;
    estimatedCostUsd: number;
    successfulVerificationCount: number;
    processScore: number;
    processDefectCount: number;
    warningCount: number;
    invalidToolActionCount: number;
    invalidToolActionPercent: number;
    costEfficiencyRisk: boolean;
    timeEfficiencyRisk: boolean;
    slowToolEvents: BenchmarkSlowToolEvent[];
}
export interface BenchmarkAgentContextCompilation {
    version: 1;
    format: 'grawkus-agent-context-compilation-v1';
    task: string;
    context: string;
    answer: string;
    metadata: {
        sessionId: string;
        mode: string;
        cwd: string;
        provider: string;
        model: string;
        eventCount: number;
        contextEventCount: number;
        verificationStatus: BenchmarkVerificationEvidence['lastVerificationStatus'];
        successfulVerificationCount: number;
        processScore: number;
        usageTotalTokens: number;
        estimatedCostUsd: number;
        changedFiles: string[];
        verificationCommands: string[];
        sourceResearchCoverage: SourceResearchCoverage;
        sourceMiningCoverage: BenchmarkSourceMiningCoverage;
        warnings: string[];
    };
}
export interface BenchmarkTraceArtifact {
    kind: 'patch' | 'git-status' | 'open-agent-leaderboard-draft' | 'agent-context-compilation' | 'change-evaluation' | 'submission-bundle-manifest';
    path: string;
    contentType: string;
    description: string;
    sizeBytes: number;
    sha256?: string;
}
export interface BenchmarkSubmissionBundleManifest {
    version: 1;
    format: 'grawkus-submission-bundle-manifest-v1';
    source: 'grawkus benchmark trace';
    createdAt: string;
    submissionReady: boolean;
    reason: string;
    officialResultRequired: boolean;
    missingOfficialFields: string[];
    benchmark: string;
    benchmarkName: string;
    sessionId: string;
    mode: string;
    provider: string;
    model: string;
    summaryContainer: {
        path: string | null;
        contentType: 'application/json';
        hashNote: string;
    };
    artifacts: BenchmarkSubmissionBundleArtifact[];
    verification: {
        count: number;
        latestStatus: BenchmarkVerificationEvidence['lastVerificationStatus'];
        successfulCount: number;
        commands: string[];
    };
    usage: {
        callCount: number;
        totalTokens: number;
        estimatedCostUsd: number;
    };
    process: {
        score: number;
        warningCount: number;
        defectCount: number;
        invalidToolActionCount: number;
        invalidToolActionPercent: number;
    };
    leaderboardDraft: {
        submissionReady: boolean;
        reason: string;
        missingOfficialFields: string[];
    };
}
export interface BenchmarkSubmissionBundleArtifact {
    kind: BenchmarkTraceArtifact['kind'] | 'trace-jsonl';
    path: string;
    contentType: string;
    description: string;
    role: string;
    requiredForClaim: boolean;
    sizeBytes: number;
    sha256: string;
}
export interface BenchmarkUsageEvent {
    model: string;
    promptTokens: number;
    completionTokens: number;
    totalTokens: number;
    estimatedCostUsd: number;
}
export interface BenchmarkModelUsageSummary {
    model: string;
    calls: number;
    promptTokens: number;
    completionTokens: number;
    totalTokens: number;
    estimatedCostUsd: number;
}
export interface BenchmarkUsageSummary {
    callCount: number;
    promptTokens: number;
    completionTokens: number;
    totalTokens: number;
    estimatedCostUsd: number;
    byModel: BenchmarkModelUsageSummary[];
}
export interface OpenAgentLeaderboardDraft {
    version: 1;
    source: 'grawkus benchmark trace';
    submissionReady: boolean;
    reason: string;
    agent: string;
    agent_name: string;
    benchmark: string;
    benchmark_name: string;
    model: string;
    model_name: string;
    total_sessions: number;
    planned_sessions: number;
    completed_sessions: number | null;
    incomplete_sessions: number | null;
    missing_sessions: number | null;
    successful_sessions: number | null;
    benchmark_score: number | null;
    average_score: number | null;
    average_steps: number;
    average_action_count: number;
    average_invalid_action_count: number;
    average_invalid_action_percent: number;
    average_agent_cost: number;
    total_agent_cost: number;
    average_benchmark_cost: number;
    total_benchmark_cost: number;
    total_run_cost: number;
    percent_finished: number | null;
    percent_successful: number | null;
    percent_finished_successful: number | null;
    percent_finished_unsuccessful: number | null;
    percent_unfinished: number | null;
    percent_error: number | null;
    compact_process_score: number;
    subset_name: string | null;
    compact_final_answer_completion: BenchmarkFinalAnswerEvidence['finalAnswerCompletion'];
    compact_latest_verification_status: BenchmarkVerificationEvidence['lastVerificationStatus'];
    compact_verification_count: number;
    compact_warnings: string[];
    missingOfficialFields: string[];
}
export interface BenchmarkVerificationEvidence {
    lastVerificationSeq: number | null;
    lastVerificationStatus: 'ok' | 'error' | null;
    lastSuccessfulVerificationSeq: number | null;
    lastFailedVerificationSeq: number | null;
    extracted: BenchmarkVerifierOutputSignal[];
    failureSignatures: BenchmarkVerifierFailureSignature[];
    incompleteRuns: BenchmarkVerifierIncompleteRun[];
}
export interface BenchmarkFinalAnswerEvidence {
    mentionsVerification: boolean;
    claimsPassingVerification: boolean;
    claimsNoVerificationRun: boolean;
    claimsIncomplete: boolean;
    claimsBlocked: boolean;
    finalAnswerCompletion: 'blocked' | 'incomplete' | 'unknown';
    unsupportedPassingClaim: boolean;
    contradictedPassingClaim: boolean;
    staleNoVerificationClaim: boolean;
    latestVerificationStatus: 'ok' | 'error' | null;
    lastSuccessfulVerificationSeq: number | null;
    verificationCount: number;
    warnings: string[];
}
export interface BenchmarkVerifierOutputSignal {
    seq: number;
    command: string;
    status: 'ok' | 'error';
    framework: string;
    passed?: number;
    failed?: number;
    skipped?: number;
    errors?: number;
    total?: number;
    raw: string;
}
export interface BenchmarkVerifierFailureSignature {
    seq: number;
    command: string;
    framework: string;
    tests: string[];
    files: string[];
    errors: string[];
    raw: string;
}
export interface BenchmarkVerifierIncompleteRun {
    seq: number;
    command: string;
    timedOut: boolean;
    truncated: boolean;
    omittedLines?: number;
    omittedChars?: number;
    fullLog?: string;
    conclusiveFailureEvidence: boolean;
    reason: string;
}
export interface BenchmarkEnvironmentSetupEvent {
    seq: number;
    command: string;
    status: 'ok' | 'error';
    kind: string;
}
export interface BenchmarkEnvironmentSetupFailureEvent {
    seq: number;
    command: string;
    reason: string;
    evidence: string;
}
export interface BenchmarkExperienceEnvironmentReconstruction {
    setupFailureCount: number;
    unresolvedSetupFailureCount: number;
    setupCount: number;
    successfulSetupCount: number;
    setupEvents: BenchmarkEnvironmentSetupEvent[];
    setupFailures: BenchmarkEnvironmentSetupFailureEvent[];
    unresolvedSetupFailures: BenchmarkEnvironmentSetupFailureEvent[];
}
export interface BenchmarkDependencyEditEvent {
    seq: number;
    tool: string;
    target: string;
    ecosystem: string;
    kind: 'manifest' | 'lockfile';
}
export interface BenchmarkExperienceDependencyUpgrade {
    manifestEditCount: number;
    lockfileEditCount: number;
    manifestEdits: BenchmarkDependencyEditEvent[];
    lockfileEdits: BenchmarkDependencyEditEvent[];
    setupAfterManifestEdit: boolean | null;
    passingSetupAfterManifestEdit: boolean | null;
    validationAfterManifestEdit: boolean | null;
    passingValidationAfterManifestEdit: boolean | null;
    firstSetupAfterManifestEditSeq: number | null;
    firstValidationAfterManifestEditSeq: number | null;
}
export interface BenchmarkSkillViewEvent {
    seq: number;
    name: string;
}
export interface BenchmarkInvalidToolActionEvent {
    seq: number;
    tool: string;
    reason: string;
    evidence: string;
}
export interface BenchmarkSlowToolEvent {
    seq: number;
    tool: string;
    target: string;
    elapsedMs: number;
    status: 'ok' | 'error';
    reason: string;
}
export interface BenchmarkTrajectoryQuality {
    version: 1;
    toolCallCount: number;
    totalToolElapsedMs: number;
    maxToolElapsedMs: number;
    slowToolCallCount: number;
    slowToolEvents: BenchmarkSlowToolEvent[];
    timeEfficiencyRisk: boolean;
    usageCallCount: number;
    usageTotalTokens: number;
    usageEstimatedCostUsd: number;
    costEfficiencyRisk: boolean;
    invalidToolActionCount: number;
    invalidToolActionPercent: number;
    invalidToolActionEvents: BenchmarkInvalidToolActionEvent[];
    inspectCount: number;
    editCount: number;
    verificationCount: number;
    successfulVerificationCount: number;
    failedVerificationCount: number;
    incompleteVerifierCount: number;
    incompleteVerifierEvents: BenchmarkVerifierIncompleteRun[];
    inconclusiveVerifierEvents: BenchmarkVerifierIncompleteRun[];
    environmentSetupFailureCount: number;
    environmentSetupFailureEvents: BenchmarkEnvironmentSetupFailureEvent[];
    unresolvedEnvironmentSetupFailureCount: number;
    unresolvedEnvironmentSetupFailureEvents: BenchmarkEnvironmentSetupFailureEvent[];
    environmentSetupCount: number;
    successfulEnvironmentSetupCount: number;
    environmentSetupEvents: BenchmarkEnvironmentSetupEvent[];
    dependencyManifestEditCount: number;
    dependencyLockfileEditCount: number;
    dependencyManifestEditEvents: BenchmarkDependencyEditEvent[];
    dependencyLockfileEditEvents: BenchmarkDependencyEditEvent[];
    dependencySetupAfterManifestEdit: boolean | null;
    passingDependencySetupAfterManifestEdit: boolean | null;
    dependencyValidationAfterManifestEdit: boolean | null;
    passingDependencyValidationAfterManifestEdit: boolean | null;
    firstDependencySetupAfterManifestEditSeq: number | null;
    firstDependencyValidationAfterManifestEditSeq: number | null;
    skillViewCount: number;
    skillViewEvents: BenchmarkSkillViewEvent[];
    skillNames: string[];
    skillLoadedBeforeLocalContext: boolean;
    excessiveSkillViewCount: boolean;
    ciWorkflowCommandCount: number;
    ciVerifierCommands: string[];
    ciValidationAfterFirstEdit: boolean | null;
    passingCiValidationAfterFirstEdit: boolean | null;
    ciValidationAfterLastEdit: boolean | null;
    passingCiValidationAfterLastEdit: boolean | null;
    firstCiValidationAfterFirstEditSeq: number | null;
    benchmarkContextUsed: boolean;
    sourceResearchUsed: boolean;
    sourceResearchCoverage: SourceResearchCoverage;
    sourceMiningCoverage: BenchmarkSourceMiningCoverage;
    taskContractSignalCount: number;
    taskContractChecklistUsed: boolean;
    taskContractChecklistAfterContext: boolean | null;
    taskContractChecklistComplete: boolean | null;
    latestTodoSeq: number | null;
    todoIncompleteCount: number;
    todoIncompleteItems: BenchmarkTodoIncompleteItem[];
    taskAlignmentRisk: boolean;
    taskAlignmentSignalCount: number;
    taskAlignmentSignals: BenchmarkTaskAlignmentSignal[];
    specComplianceRisk: boolean;
    specComplianceSignalCount: number;
    specComplianceSignals: BenchmarkSpecComplianceSignal[];
    rewardHackRisk: boolean;
    rewardHackSignalCount: number;
    rewardHackSignals: BenchmarkRewardHackSignal[];
    harnessSafety: BenchmarkHarnessSafetyAudit;
    harnessSafetyRisk: boolean;
    harnessSafetySignalCount: number;
    harnessSafetySignals: BenchmarkHarnessSafetySignal[];
    longHorizonRisk: boolean;
    longHorizonSignalCount: number;
    longHorizonSignals: BenchmarkLongHorizonSignal[];
    proactivityDetected: boolean;
    proactivityRisk: boolean;
    proactivitySignalCount: number;
    proactivitySignals: BenchmarkProactivitySignal[];
    proactivityContextContract: BenchmarkProactivityContextContract;
    proactivityHiddenIntentEvidence: boolean;
    proactivityClarificationEvidence: boolean;
    proactivityPrivacyEvidence: boolean;
    proactivityCompletionEvidence: boolean;
    proactivityActionCount: number;
    noEditContractDetected: boolean;
    editAfterNoEditContract: boolean;
    componentEditCount: number;
    componentUnclassifiedEditCount: number;
    componentEditComponents: BenchmarkComponentEditSummary[];
    componentEditEvents: BenchmarkComponentEditEvent[];
    editTargetCount: number;
    localizedEditTargetCount: number;
    unlocalizedEditTargetEvents: BenchmarkUnlocalizedEditEvent[];
    contextUtilizationInspectCount: number;
    contextUtilizationHitCount: number;
    contextUtilizationMissCount: number;
    contextUtilizationPercent: number | null;
    contextUtilizationRisk: boolean;
    contextUtilizationMissEvents: BenchmarkContextUtilizationEvent[];
    preEditContextInspectCount: number;
    preEditContextHitCount: number;
    preEditContextMissCount: number;
    preEditContextUtilizationPercent: number | null;
    contextBloatRisk: boolean;
    contextBloatEventCount: number;
    contextBloatEvents: BenchmarkContextBloatEvent[];
    candidateDossierRecorded: boolean;
    candidateDossierRisk: boolean;
    candidateDossierSignalCount: number;
    candidateDossierSignals: BenchmarkCandidateDossierSignal[];
    rootCauseHypothesisRecorded: boolean;
    rootCauseHypothesisRisk: boolean;
    rootCauseHypothesisSignalCount: number;
    rootCauseHypothesisSignals: BenchmarkRootCauseHypothesisSignal[];
    failureOnset: BenchmarkFailureOnsetDiagnosis;
    trajectoryTriage: BenchmarkTrajectoryTriage;
    trajectoryCleanupRisk: boolean;
    trajectoryCleanupEventCount: number;
    trajectoryCleanupNoisyOutputCount: number;
    trajectoryCleanupOversizedOutputCount: number;
    trajectoryCleanupDuplicateOutputCount: number;
    trajectoryCleanupBase64OutputCount: number;
    trajectoryCleanupHighEntropyOutputCount: number;
    trajectoryCleanupEvents: BenchmarkTrajectoryCleanupEvent[];
    evidenceGroundingRisk: boolean;
    evidenceGroundingEventCount: number;
    evidenceGroundingEvents: BenchmarkEvidenceGroundingEvent[];
    broadEditContractDetected: boolean;
    largeEditSurfaceTargetCount: number;
    largeEditSurfaceTargets: string[];
    redundantToolCallCount: number;
    redundantToolCallEvents: BenchmarkRedundantToolCallEvent[];
    redundantVerifierCount: number;
    redundantVerifierEvents: BenchmarkRedundantVerifierEvent[];
    blindRepairCount: number;
    blindRepairEvents: BenchmarkBlindRepairEvent[];
    failureAlignedRepairCount: number;
    failureUnalignedRepairCount: number;
    failureUnalignedRepairEvents: BenchmarkFailureUnalignedRepairEvent[];
    postEditRegressionCycleCount: number;
    postEditRegressionCycleEvents: BenchmarkPostEditRegressionCycleEvent[];
    postSuccessMutationCount: number;
    postSuccessMutationEvents: BenchmarkPostSuccessMutationEvent[];
    predictedEditCount: number;
    targetedFixCount: number;
    missingTargetedFixCount: number;
    targetedFixManifestRisk: boolean;
    regressionForecastCount: number;
    missingRegressionForecastCount: number;
    regressionForesightRisk: boolean;
    unpredictedEditCount: number;
    contradictedEditPredictionCount: number;
    unverifiedEditPredictionCount: number;
    decisionObservabilityRisk: boolean;
    scratchArtifactPermissionDetected: boolean;
    scratchArtifactEvents: BenchmarkScratchArtifactEvent[];
    postEditDiffReview: boolean | null;
    diffReviewAfterLastEdit: boolean | null;
    testEditPermissionDetected: boolean;
    testHarnessEditEvents: BenchmarkTestHarnessEditEvent[];
    leakageRiskEvents: BenchmarkLeakageRiskEvent[];
    firstInspectSeq: number | null;
    firstEditSeq: number | null;
    lastEditSeq: number | null;
    firstVerificationSeq: number | null;
    firstTaskContractSeq: number | null;
    firstNoEditContractSeq: number | null;
    firstTodoSeq: number | null;
    firstPostEditDiffReviewSeq: number | null;
    firstDiffReviewAfterLastEditSeq: number | null;
    firstBroadValidationAfterFirstEditSeq: number | null;
    lastPostEditVerificationSeq: number | null;
    lastPostEditVerificationStatus: 'ok' | 'error' | null;
    lastPostEditVerificationConclusiveFailure: boolean | null;
    finalEditVerificationCount: number;
    finalEditPassingVerificationCount: number;
    stableValidationAfterLastEdit: boolean | null;
    firstSuccessfulVerificationSeq: number | null;
    firstFailedVerificationSeq: number | null;
    firstConclusiveFailedVerificationSeq: number | null;
    localizationBeforeFirstEdit: boolean | null;
    reproductionBeforeFirstEdit: boolean | null;
    failingReproductionBeforeFirstEdit: boolean | null;
    validationAfterFirstEdit: boolean | null;
    passingValidationAfterFirstEdit: boolean | null;
    broadValidationAfterFirstEdit: boolean | null;
    passingBroadValidationAfterFirstEdit: boolean | null;
    validationAfterLastEdit: boolean | null;
    passingValidationAfterLastEdit: boolean | null;
    broadValidationAfterLastEdit: boolean | null;
    passingBroadValidationAfterLastEdit: boolean | null;
    processScore: number;
    processDefects: BenchmarkProcessDefect[];
    warnings: string[];
}
export type BenchmarkProcessDefectCategory = 'orientation' | 'requirement_fidelity' | 'benchmark_validity' | 'localization' | 'reproduction' | 'validation' | 'source_research' | 'leakage' | 'execution_control';
export type BenchmarkProcessDefectSeverity = 'low' | 'medium' | 'high' | 'critical';
export interface BenchmarkProcessDefect {
    code: string;
    category: BenchmarkProcessDefectCategory;
    severity: BenchmarkProcessDefectSeverity;
    seq: number | null;
    message: string;
    evidence: string;
}
export declare const BENCHMARK_INVALID_TOOL_ACTION_TOOL = "__invalid_tool_action__";
export interface SourceResearchCoverage {
    callCount: number;
    arxiv: boolean;
    github: boolean;
    huggingface: boolean;
    kaggle: boolean;
    sourceHitCount: number;
    sourceErrorCount: number;
    githubKinds: string[];
    huggingFaceKinds: string[];
    kaggleKinds: string[];
    resultSources: string[];
    topUrls: string[];
    recentDays: number[];
    datedHitCount: number;
    freshHitCount: number;
    staleHitCount: number;
    unknownDateHitCount: number;
    newestDate: string | null;
    oldestDate: string | null;
    freshTargetedCoverage: boolean;
    kaggleCompetitionsSkipped: boolean;
    coverageNotes: string[];
    githubAuthFound: boolean;
    githubAuthMissing: boolean;
    huggingFaceAuthFound: boolean;
    huggingFaceAuthMissing: boolean;
    kaggleAuthFound: boolean;
    kaggleAuthMissing: boolean;
    sourceAuthIncomplete: boolean;
    completeTargetedCoverage: boolean;
}
export interface BenchmarkSourceMiningCoverage {
    catalogCallCount: number;
    repoDigestCallCount: number;
    catalogUsed: boolean;
    repoDigestUsed: boolean;
    catalogQueries: string[];
    catalogPositiveMatchCount: number;
    catalogGapCount: number;
    catalogPositiveProjects: string[];
    catalogGapProjects: string[];
    catalogRepos: string[];
    repoDigestRepos: string[];
    contextCatalogHintCount: number;
    contextCatalogGapCount: number;
}
export interface BenchmarkLeakageRiskEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkTaskAlignmentSignal {
    seq: number;
    tool: string;
    target: string;
    reason: 'ignored_task_contract' | 'distractor_reference' | 'off_task_edit';
    evidence: string;
}
export interface BenchmarkSpecComplianceSignal {
    seq: number;
    tool: string;
    target: string;
    reason: 'visible_suite_only' | 'incomplete_contract_after_visible_pass' | 'test_case_memorization';
    evidence: string;
}
export interface BenchmarkRewardHackSignal {
    seq: number;
    tool: string;
    target: string;
    reason: 'verifier_tamper' | 'oracle_or_solution_probe' | 'result_file_edit' | 'shortcut_completion_marker' | 'bypass_command';
    evidence: string;
}
export interface BenchmarkLongHorizonSignal {
    seq: number;
    tool: string;
    target: string;
    reason: 'missing_roadmap_checklist' | 'incomplete_roadmap_after_validation' | 'missing_broad_integration_validation' | 'missing_swecycle_phase_checklist' | 'missing_swecycle_environment_validation' | 'missing_swecycle_test_generation_evidence' | 'missing_swecycle_judge_validation' | 'missing_sweci_evolution_checklist' | 'missing_sweci_ci_loop_validation' | 'missing_mobile_platform_validation' | 'missing_saas_integration_validation' | 'missing_webdev_canary_checklist' | 'missing_frontend_backend_validation' | 'missing_security_production_validation';
    evidence: string;
}
export interface BenchmarkProactivitySignal {
    seq: number;
    tool: string;
    target: string;
    reason: 'missing_pibench_context_contract' | 'missing_hidden_intent_hypothesis' | 'missing_clarification_decision' | 'missing_privacy_review' | 'missing_observable_completion_evidence';
    evidence: string;
}
export interface BenchmarkTodoIncompleteItem {
    content: string;
    status: 'pending' | 'in_progress';
}
export interface BenchmarkTestHarnessEditEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkUnlocalizedEditEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkContextUtilizationEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkContextBloatEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkCandidateDossierSignal {
    seq: number;
    inspectCount: number;
    reason: 'broad_pre_edit_context_without_dossier' | 'missing_candidate_dossier_before_edit';
    evidence: string;
}
export type BenchmarkRootCauseHypothesisReason = 'missing_root_cause_before_repair_edit';
export interface BenchmarkRootCauseHypothesisSignal {
    seq: number;
    editSeq: number;
    failedVerificationSeq: number;
    reason: BenchmarkRootCauseHypothesisReason;
    evidence: string;
}
export type BenchmarkTrajectoryCleanupReason = 'base64_blob' | 'high_entropy_output' | 'duplicate_output' | 'oversized_output';
export interface BenchmarkTrajectoryCleanupEvent {
    seq: number;
    tool: string;
    target: string;
    reason: BenchmarkTrajectoryCleanupReason;
    evidence: string;
    duplicateOfSeq?: number;
}
export interface BenchmarkEvidenceGroundingEvent {
    seq: number;
    tool: string;
    target: string;
    staleSeq: number;
    staleTool: string;
    reason: string;
    evidence: string;
}
export interface BenchmarkRedundantToolCallEvent {
    seq: number;
    tool: string;
    target: string;
    repeatOfSeq: number;
    repeatCount: number;
    reason: string;
}
export interface BenchmarkRedundantVerifierEvent {
    seq: number;
    command: string;
    repeatOfSeq: number;
    repeatCount: number;
    reason: string;
}
export interface BenchmarkBlindRepairEvent {
    failedVerificationSeq: number;
    editSeq: number;
    command: string;
    editTarget: string;
    reason: string;
}
export interface BenchmarkFailureUnalignedRepairEvent {
    failedVerificationSeq: number;
    editSeq: number;
    command: string;
    failureFiles: string[];
    inspectedTargets: string[];
    editTarget: string;
    reason: string;
}
export interface BenchmarkPostEditRegressionCycleEvent {
    firstPassingSeq: number;
    failingSeq: number;
    recoveryPassingSeq: number;
    failingCommand: string;
    recoveryCommand: string;
    broadFailure: boolean;
}
export interface BenchmarkPostSuccessMutationEvent {
    seq: number;
    tool: string;
    target: string;
    passingVerifierSeq: number;
    passingVerifierCommand: string;
    reason: string;
}
export interface BenchmarkScratchArtifactEvent {
    seq: number;
    tool: string;
    target: string;
    reason: string;
}
export interface BenchmarkTraceWriteInput {
    sessionId: string;
    mode: string;
    cwd: string;
    config: GrawkusConfig;
    startedAtMs: number;
    endedAtMs?: number;
    messages: Message[];
    events: BenchmarkTraceEvent[];
    usageEvents?: BenchmarkUsageEvent[];
}
export interface BenchmarkTraceWriteResult {
    dir: string;
    summaryPath: string;
    jsonlPath: string;
}
export declare function redactTraceText(value: unknown): string;
export declare function makeBenchmarkTraceEvent(opts: {
    seq: number;
    tool: string;
    input: Record<string, unknown>;
    output: unknown;
    isError: boolean;
    elapsedMs: number;
}): BenchmarkTraceEvent;
export declare function makeBenchmarkInvalidToolActionEvent(opts: {
    seq: number;
    tool: string;
    reason: string;
    evidence: string;
    input?: Record<string, unknown>;
    elapsedMs?: number;
}): BenchmarkTraceEvent;
export declare function buildBenchmarkTraceSummary(input: BenchmarkTraceWriteInput): BenchmarkTraceSummary;
export declare function buildBenchmarkExperienceCard(input: {
    events: BenchmarkTraceEvent[];
    messages: Message[];
    changedFiles: string[];
    verificationCommands: string[];
    verificationEvidence: BenchmarkVerificationEvidence;
    trajectoryQuality: BenchmarkTrajectoryQuality;
}): BenchmarkExperienceCard;
export declare function buildBenchmarkChangeEvaluation(input: {
    events: BenchmarkTraceEvent[];
    messages: Message[];
    trajectoryQuality: BenchmarkTrajectoryQuality;
    createdAt?: string;
}): BenchmarkChangeEvaluation;
export declare function buildOpenAgentLeaderboardDraft(input: BenchmarkTraceWriteInput, events: BenchmarkTraceEvent[], usage: BenchmarkUsageSummary, verificationEvidence: BenchmarkVerificationEvidence, finalAnswerEvidence: BenchmarkFinalAnswerEvidence, trajectoryQuality: BenchmarkTrajectoryQuality): OpenAgentLeaderboardDraft;
export declare function buildBenchmarkUsageSummary(events: BenchmarkUsageEvent[]): BenchmarkUsageSummary;
export declare function buildBenchmarkTrajectoryQuality(events: BenchmarkTraceEvent[], usage?: BenchmarkUsageSummary, messages?: Message[]): BenchmarkTrajectoryQuality;
export declare function buildBenchmarkTrajectorySystemBlock(events: BenchmarkTraceEvent[], usageEvents?: BenchmarkUsageEvent[], messages?: Message[]): string | null;
export declare function buildBenchmarkVerificationEvidence(events: BenchmarkTraceEvent[]): BenchmarkVerificationEvidence;
export declare function buildBenchmarkFinalAnswerEvidence(finalAssistant: string, verificationEvidence: BenchmarkVerificationEvidence, events?: BenchmarkTraceEvent[]): BenchmarkFinalAnswerEvidence;
export declare function buildSourceResearchCoverage(events: BenchmarkTraceEvent[]): SourceResearchCoverage;
export declare function buildBenchmarkSourceMiningCoverage(events: BenchmarkTraceEvent[]): BenchmarkSourceMiningCoverage;
export declare function countTaskContractSignals(events: BenchmarkTraceEvent[]): number;
export declare function buildBenchmarkUnlocalizedEditEvents(events: BenchmarkTraceEvent[]): BenchmarkUnlocalizedEditEvent[];
export declare function buildBenchmarkRedundantToolCallEvents(events: BenchmarkTraceEvent[]): BenchmarkRedundantToolCallEvent[];
export declare function buildBenchmarkRedundantVerifierEvents(events: BenchmarkTraceEvent[]): BenchmarkRedundantVerifierEvent[];
export declare function buildBenchmarkBlindRepairEvents(events: BenchmarkTraceEvent[]): BenchmarkBlindRepairEvent[];
export declare function buildBenchmarkPostEditRegressionCycleEvents(events: BenchmarkTraceEvent[]): BenchmarkPostEditRegressionCycleEvent[];
export declare function buildBenchmarkPostSuccessMutationEvents(events: BenchmarkTraceEvent[]): BenchmarkPostSuccessMutationEvent[];
export declare function buildBenchmarkFailureUnalignedRepairEvents(events: BenchmarkTraceEvent[]): BenchmarkFailureUnalignedRepairEvent[];
export declare function buildBenchmarkIncompleteVerifierEvents(events: BenchmarkTraceEvent[]): BenchmarkVerifierIncompleteRun[];
export declare function buildBenchmarkEnvironmentSetupEvents(events: BenchmarkTraceEvent[]): BenchmarkEnvironmentSetupEvent[];
export declare function buildBenchmarkDependencyEditEvents(events: BenchmarkTraceEvent[]): BenchmarkDependencyEditEvent[];
export declare function buildBenchmarkSkillViewEvents(events: BenchmarkTraceEvent[]): BenchmarkSkillViewEvent[];
export declare function buildBenchmarkInvalidToolActionEvents(events: BenchmarkTraceEvent[]): BenchmarkInvalidToolActionEvent[];
export declare function buildBenchmarkEnvironmentSetupFailureEvents(events: BenchmarkTraceEvent[]): BenchmarkEnvironmentSetupFailureEvent[];
export declare function buildBenchmarkScratchArtifactEvents(events: BenchmarkTraceEvent[]): BenchmarkScratchArtifactEvent[];
export declare function buildBenchmarkComponentEditEvents(events: BenchmarkTraceEvent[]): BenchmarkComponentEditEvent[];
export declare function buildBenchmarkContextBloatEvents(events: BenchmarkTraceEvent[]): BenchmarkContextBloatEvent[];
export declare function buildBenchmarkCandidateDossierSignals(events: BenchmarkTraceEvent[], messages?: Message[]): BenchmarkCandidateDossierSignal[];
export declare function buildBenchmarkRootCauseHypothesisSignals(events: BenchmarkTraceEvent[], messages?: Message[]): BenchmarkRootCauseHypothesisSignal[];
export declare function buildBenchmarkFailureOnsetDiagnosis(events: BenchmarkTraceEvent[], input?: {
    rootCauseRecorded?: boolean;
    rootCauseRisk?: boolean;
    blindRepairEvents?: BenchmarkBlindRepairEvent[];
    failureUnalignedRepairEvents?: BenchmarkFailureUnalignedRepairEvent[];
    redundantVerifierEvents?: BenchmarkRedundantVerifierEvent[];
    postEditRegressionCycleEvents?: BenchmarkPostEditRegressionCycleEvent[];
}): BenchmarkFailureOnsetDiagnosis;
export declare function buildBenchmarkTrajectoryCleanupEvents(events: BenchmarkTraceEvent[]): BenchmarkTrajectoryCleanupEvent[];
export declare function buildBenchmarkEvidenceGroundingEvents(events: BenchmarkTraceEvent[]): BenchmarkEvidenceGroundingEvent[];
export declare function buildBenchmarkTestHarnessEditEvents(events: BenchmarkTraceEvent[]): BenchmarkTestHarnessEditEvent[];
export declare function buildBenchmarkTaskAlignmentSignals(events: BenchmarkTraceEvent[], options?: {
    firstNoEditContractSeq?: number | null;
    editAfterNoEditContract?: boolean;
    unlocalizedEditTargetEvents?: BenchmarkUnlocalizedEditEvent[];
    taskContractSignalCount?: number;
}): BenchmarkTaskAlignmentSignal[];
export declare function buildBenchmarkSpecComplianceSignals(events: BenchmarkTraceEvent[], options?: {
    messages?: Message[];
    taskContractSignalCount?: number;
    taskContractChecklistComplete?: boolean | null;
    todoIncompleteCount?: number;
    firstTaskContractSeq?: number | null;
    firstEditSeq?: number | null;
    passingValidationAfterFirstEdit?: boolean | null;
    passingBroadValidationAfterFirstEdit?: boolean | null;
    passingCiValidationAfterFirstEdit?: boolean | null;
    finalEditVerificationCount?: number;
    finalEditPassingVerificationCount?: number;
    stableValidationAfterLastEdit?: boolean | null;
    rewardHackSignals?: BenchmarkRewardHackSignal[];
    testHarnessEditEvents?: BenchmarkTestHarnessEditEvent[];
    leakageRiskEvents?: BenchmarkLeakageRiskEvent[];
}): BenchmarkSpecComplianceSignal[];
export declare function buildBenchmarkProactivitySignals(events: BenchmarkTraceEvent[], options?: {
    messages?: Message[];
}): BenchmarkProactivitySignal[];
export declare function buildBenchmarkLongHorizonSignals(events: BenchmarkTraceEvent[], options?: {
    messages?: Message[];
    taskContractSignalCount?: number;
    taskContractChecklistAfterContext?: boolean | null;
    taskContractChecklistComplete?: boolean | null;
    todoIncompleteCount?: number;
    firstTaskContractSeq?: number | null;
    firstEditSeq?: number | null;
    passingValidationAfterFirstEdit?: boolean | null;
    passingBroadValidationAfterFirstEdit?: boolean | null;
    passingCiValidationAfterFirstEdit?: boolean | null;
    finalEditVerificationCount?: number;
    finalEditPassingVerificationCount?: number;
}): BenchmarkLongHorizonSignal[];
export declare function buildBenchmarkRewardHackSignals(events: BenchmarkTraceEvent[], options?: {
    testEditPermissionDetected?: boolean;
    testHarnessEditEvents?: BenchmarkTestHarnessEditEvent[];
    leakageRiskEvents?: BenchmarkLeakageRiskEvent[];
}): BenchmarkRewardHackSignal[];
export declare function buildBenchmarkHarnessSafetyAudit(events: BenchmarkTraceEvent[], options?: {
    leakageRiskEvents?: BenchmarkLeakageRiskEvent[];
}): BenchmarkHarnessSafetyAudit;
export declare function buildBenchmarkLeakageRiskEvents(events: BenchmarkTraceEvent[]): BenchmarkLeakageRiskEvent[];
export declare function buildBenchmarkCompletionReminder(events: BenchmarkTraceEvent[], usageEvents?: BenchmarkUsageEvent[], messages?: Message[]): string | null;
export declare function writeBenchmarkTrace(input: BenchmarkTraceWriteInput): BenchmarkTraceWriteResult | null;
