Record one forge attempt's outcome.
true when the judge approved; false for shape-check
or judge rejections.
Judge's confidence score for approved tools. Summed
into approvedConfidenceSum (skipped for rejections so rejection
confidence does not dilute the average).
Optional toolName: stringOptional tool name. When provided, tracks unique-tool metrics (eventually-approved vs terminally-rejected) rather than raw attempt counts.
Optional errorReason: stringOptional rejection-reason string. On a rejected
attempt, passed through classifyForgeRejection and binned
into rejectionReasons.
Build a plain-object snapshot of current stats. Safe to JSON-serialize and ship to clients. Returns a shallow copy so callers can mutate without affecting the aggregator's internal state.
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
forgeStatskey in whatever payload the consumer ships to clients.