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

    Class OutcomeStore

    Bounded, append-only, in-memory store for task outcomes. Evicts oldest entries when capacity is exceeded.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Append a new outcome. Auto-classifies failures missing failureCategory (#1441) and resolves the outcome's vendor / family via the ModelRegistry (#2548) so family-level retrieval can warm-start siblings after a model retirement.

      Parameters

      • outcome: {
            id: string;
            cli: "claude" | "gemini" | "codex" | "opencode";
            category:
                | "planning"
                | "code_generation"
                | "code_review"
                | "research"
                | "architecture"
                | "security_review"
                | "documentation"
                | "testing"
                | "devops"
                | "exploration";
            model: string;
            success: boolean;
            durationMs: number;
            timestamp: string;
            qualitySignals?: string[];
            failureCategory?: | "unknown"
            | "timeout"
            | "parse"
            | "connection"
            | "execution"
            | "rate_limit"
            | "validation"
            | "authentication"
            | "generic"
            | "crash"
            | "adapter_unavailable";
            errorMessage?: string;
            source: "delegate"
            | "consensus"
            | "manual";
            wasRetried?: boolean;
            triageAction?: string;
            routingStage?: string;
            retryCount?: number;
            vendor?: string;
            family?: string;
            voterRole?: string;
            baselineId?: string;
        }
        • id: string
        • cli: "claude" | "gemini" | "codex" | "opencode"
        • category:
              | "planning"
              | "code_generation"
              | "code_review"
              | "research"
              | "architecture"
              | "security_review"
              | "documentation"
              | "testing"
              | "devops"
              | "exploration"
        • model: string
        • success: boolean
        • durationMs: number
        • timestamp: string
        • OptionalqualitySignals?: string[]
        • OptionalfailureCategory?:
              | "unknown"
              | "timeout"
              | "parse"
              | "connection"
              | "execution"
              | "rate_limit"
              | "validation"
              | "authentication"
              | "generic"
              | "crash"
              | "adapter_unavailable"
        • OptionalerrorMessage?: string
        • source: "delegate" | "consensus" | "manual"
        • OptionalwasRetried?: boolean

          Whether this outcome came from a triage-initiated retry (#1506).

        • OptionaltriageAction?: string

          Triage action taken on the failure (#1506).

        • OptionalroutingStage?: string

          Routing stage that selected this CLI (#1785).

        • OptionalretryCount?: number

          Number of retry attempts before this outcome (#1785).

        • Optionalvendor?: string

          Vendor resolved from model via ModelRegistry at write time (#2548).

        • Optionalfamily?: string

          Family resolved from model via ModelRegistry at write time (#2548).

        • OptionalvoterRole?: string

          Voter role for source: 'consensus' outcomes (#2662) — architect, security, etc. Absent on non-consensus outcomes. Lets the stratified outcome report break results down by voter role.

        • OptionalbaselineId?: string

          Baseline this outcome forked from (#2697 / Epic F follow-up to #2665). Set on outcomes recorded inside a fork-then-merge graph branch so query({ baselineId: 'B' }) returns every branch outcome forked from baseline B — letting later analysis compare branches as a cohort. Free-form string (caller-assigned); typically the parent node's executionId or taskId.

      Returns void

    • Query outcomes with optional filters.

      Parameters

      • Optionalfilter: {
            cli?: "claude" | "gemini" | "codex" | "opencode";
            category?:
                | "planning"
                | "code_generation"
                | "code_review"
                | "research"
                | "architecture"
                | "security_review"
                | "documentation"
                | "testing"
                | "devops"
                | "exploration";
            source?: "delegate"
            | "consensus"
            | "manual";
            success?: boolean;
            failureCategory?:
                | "unknown"
                | "timeout"
                | "parse"
                | "connection"
                | "execution"
                | "rate_limit"
                | "validation"
                | "authentication"
                | "generic"
                | "crash"
                | "adapter_unavailable";
            since?: string;
            limit?: number;
            excludeQualitySignals?: string[];
            baselineId?: string;
        }
        • Optionalcli?: "claude" | "gemini" | "codex" | "opencode"
        • Optionalcategory?:
              | "planning"
              | "code_generation"
              | "code_review"
              | "research"
              | "architecture"
              | "security_review"
              | "documentation"
              | "testing"
              | "devops"
              | "exploration"
        • Optionalsource?: "delegate" | "consensus" | "manual"
        • Optionalsuccess?: boolean
        • OptionalfailureCategory?:
              | "unknown"
              | "timeout"
              | "parse"
              | "connection"
              | "execution"
              | "rate_limit"
              | "validation"
              | "authentication"
              | "generic"
              | "crash"
              | "adapter_unavailable"
        • Optionalsince?: string
        • Optionallimit?: number
        • OptionalexcludeQualitySignals?: string[]

          Exclude outcomes with any of these quality signals (#1680).

        • OptionalbaselineId?: string

          Restrict to outcomes recorded against a specific baseline (#2697).

      Returns readonly {
          id: string;
          cli: "claude" | "gemini" | "codex" | "opencode";
          category:
              | "planning"
              | "code_generation"
              | "code_review"
              | "research"
              | "architecture"
              | "security_review"
              | "documentation"
              | "testing"
              | "devops"
              | "exploration";
          model: string;
          success: boolean;
          durationMs: number;
          timestamp: string;
          qualitySignals?: string[];
          failureCategory?: | "unknown"
          | "timeout"
          | "parse"
          | "connection"
          | "execution"
          | "rate_limit"
          | "validation"
          | "authentication"
          | "generic"
          | "crash"
          | "adapter_unavailable";
          errorMessage?: string;
          source: "delegate"
          | "consensus"
          | "manual";
          wasRetried?: boolean;
          triageAction?: string;
          routingStage?: string;
          retryCount?: number;
          vendor?: string;
          family?: string;
          voterRole?: string;
          baselineId?: string;
      }[]

    • Query outcomes for a specific model with a family-level warm-start fallback (#2548). When the literal modelId has fewer than threshold samples in the store, broaden the result to the model's {vendor, family} siblings — siblings within a family share enough behavior profile that their outcomes are useful priors for cold starts after a retirement.

      Returns the outcomes and a scope flag so callers know whether they're consuming literal-id data or family-broadened data.

      Parameters

      • modelId: string
      • Optionaloptions: {
            threshold?: number;
            extraFilter?: Omit<
                {
                    cli?: "claude"
                    | "gemini"
                    | "codex"
                    | "opencode";
                    category?:
                        | "planning"
                        | "code_generation"
                        | "code_review"
                        | "research"
                        | "architecture"
                        | "security_review"
                        | "documentation"
                        | "testing"
                        | "devops"
                        | "exploration";
                    source?: "delegate"
                    | "consensus"
                    | "manual";
                    success?: boolean;
                    failureCategory?:
                        | "unknown"
                        | "timeout"
                        | "parse"
                        | "connection"
                        | "execution"
                        | "rate_limit"
                        | "validation"
                        | "authentication"
                        | "generic"
                        | "crash"
                        | "adapter_unavailable";
                    since?: string;
                    limit?: number;
                    excludeQualitySignals?: string[];
                    baselineId?: string;
                },
                "limit",
            >;
        }

      Returns {
          outcomes: readonly {
              id: string;
              cli: "claude" | "gemini" | "codex" | "opencode";
              category:
                  | "planning"
                  | "code_generation"
                  | "code_review"
                  | "research"
                  | "architecture"
                  | "security_review"
                  | "documentation"
                  | "testing"
                  | "devops"
                  | "exploration";
              model: string;
              success: boolean;
              durationMs: number;
              timestamp: string;
              qualitySignals?: string[];
              failureCategory?: | "unknown"
              | "timeout"
              | "parse"
              | "connection"
              | "execution"
              | "rate_limit"
              | "validation"
              | "authentication"
              | "generic"
              | "crash"
              | "adapter_unavailable";
              errorMessage?: string;
              source: "delegate"
              | "consensus"
              | "manual";
              wasRetried?: boolean;
              triageAction?: string;
              routingStage?: string;
              retryCount?: number;
              vendor?: string;
              family?: string;
              voterRole?: string;
              baselineId?: string;
          }[];
          scope: "literal"
          | "empty"
          | "family";
          vendor?: string;
          family?: string;
      }

    • Aggregate outcomes into a performance summary.

      Parameters

      • Optionalfilter: {
            cli?: "claude" | "gemini" | "codex" | "opencode";
            category?:
                | "planning"
                | "code_generation"
                | "code_review"
                | "research"
                | "architecture"
                | "security_review"
                | "documentation"
                | "testing"
                | "devops"
                | "exploration";
            source?: "delegate"
            | "consensus"
            | "manual";
            success?: boolean;
            failureCategory?:
                | "unknown"
                | "timeout"
                | "parse"
                | "connection"
                | "execution"
                | "rate_limit"
                | "validation"
                | "authentication"
                | "generic"
                | "crash"
                | "adapter_unavailable";
            since?: string;
            limit?: number;
            excludeQualitySignals?: string[];
            baselineId?: string;
        }
        • Optionalcli?: "claude" | "gemini" | "codex" | "opencode"
        • Optionalcategory?:
              | "planning"
              | "code_generation"
              | "code_review"
              | "research"
              | "architecture"
              | "security_review"
              | "documentation"
              | "testing"
              | "devops"
              | "exploration"
        • Optionalsource?: "delegate" | "consensus" | "manual"
        • Optionalsuccess?: boolean
        • OptionalfailureCategory?:
              | "unknown"
              | "timeout"
              | "parse"
              | "connection"
              | "execution"
              | "rate_limit"
              | "validation"
              | "authentication"
              | "generic"
              | "crash"
              | "adapter_unavailable"
        • Optionalsince?: string
        • Optionallimit?: number
        • OptionalexcludeQualitySignals?: string[]

          Exclude outcomes with any of these quality signals (#1680).

        • OptionalbaselineId?: string

          Restrict to outcomes recorded against a specific baseline (#2697).

      Returns PerformanceSummary

    • Backfill: reclassify all entries missing failureCategory (#1444). Also reclassifies 'unknown' entries with no error message as 'execution' (#1511) since 'unknown' with no diagnostic info is less useful than the default 'execution' category. Returns count of reclassified entries.

      Returns number

    • Purge false failures with zero execution time (#1528). Removes non-success entries with durationMs=0 — these are either:

      • Skipped workers (circuit breaker, role auto-disable)
      • Test-generated entries (E2E eval artifacts)
      • Pre-execution short-circuits (validation, initialization) Real model execution always takes >0ms. Returns count of purged entries.

      Returns number