Class ForgeStatsAggregator

Aggregator for forge outcomes across a single run. No dependency on the cost tracker or any consumer-specific types — consumers compose it into whatever telemetry layer they already have.

Typical wiring: the consumer's forge capture callback calls recordAttempt with the outcome fields, then embeds snapshot under a forgeStats key in whatever payload the consumer ships to clients.

Constructors

Methods

  • Record one forge attempt's outcome.

    Parameters

    • approved: boolean

      true when the judge approved; false for shape-check or judge rejections.

    • confidence: number

      Judge's confidence score for approved tools. Summed into approvedConfidenceSum (skipped for rejections so rejection confidence does not dilute the average).

    • Optional toolName: string

      Optional tool name. When provided, tracks unique-tool metrics (eventually-approved vs terminally-rejected) rather than raw attempt counts.

    • Optional errorReason: string

      Optional rejection-reason string. On a rejected attempt, passed through classifyForgeRejection and binned into rejectionReasons.

    Returns void