nexus-agents - v2.80.0
    Preparing search index...

    Function validateCorroboration

    • Validate that an agent action has sufficient corroboration from authoritative sources.

      Parameters

      • action:
            | {
                type: "SummarizeIssue";
                summary: string;
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | {
                type: "ProposeLabels";
                labels: string[];
                reason: string;
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | {
                type: "DraftReply";
                body: string;
                requiresApproval: true;
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | { type: "RequestHumanApproval"; reason: string; context: string }
            | {
                type: "GeneratePatchPlan";
                files: {
                    path: string;
                    operation: "create" | "modify" | "delete";
                    description: string;
                }[];
                rationale: string;
                requiresApproval: true;
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | {
                type: "ClassifyIssue";
                category: | "security"
                | "documentation"
                | "performance"
                | "bug"
                | "feature"
                | "question";
                confidence: number;
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | {
                type: "IdentifyDuplicates";
                candidates: number[];
                similarity: number[];
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }
            | {
                type: "RefuseAction";
                reason: string;
                escalateTo: "security"
                | "maintainer";
            }
            | {
                type: "HandoffMessage";
                targetCapability: string;
                reason: string;
                inputTrustTier: "1"
                | "2"
                | "3"
                | "4";
                sources: (
                    | { type: "repoFile"; path: string; line?: number; commit?: string }
                    | {
                        type: "issueComment";
                        issueNumber: number;
                        commentId: number;
                        author: string;
                        authorTrustTier: "1" | "2" | "3" | "4";
                    }
                    | {
                        type: "ciResult";
                        runId: number;
                        status: "pass"
                        | "fail";
                        job: string;
                    }
                    | { type: "policyDoc"; path: string; section: string }
                    | { type: "maintainerCommand"; username: string; commentId: number }
                )[];
            }

        The validated AgentAction to check.

      Returns CorroborationResult

      CorroborationResult indicating whether requirements are met.