Skip to content

[FEATURE] Add capability reliability ledger #186

Description

@Joncallim

Problem Statement

Forge cannot safely infer trust from a task-level pass/fail count. Capabilities differ by project, resource scope, runtime, model, policy version, and verification quality. A global agent score would hide material differences and encourage unsafe autonomy.

Parent Epic: #184
Depends on: #185

Desired Outcome

Forge records an append-only, evidence-backed history of comparable capability attempts and calculates transparent reliability metrics without letting the execution worker grade itself.

Reliability is keyed to a bounded cohort such as:

project + capability + scope fingerprint + runtime/model + harness/policy version

User Story

As a Forge operator,
I want to see how reliably a specific capability has performed in a specific scope,
So that trust and autonomy decisions reflect comparable verified evidence rather than a vague agent reputation.

Requirements

  • Add a durable capability-attempt contract linked to the canonical outcome from [FEATURE] Normalize execution outcomes and stop reasons #185.
  • Include at least:
    • attempt id;
    • project id;
    • task/work-package/agent-run references;
    • capability key;
    • normalized scope fingerprint;
    • runtime/provider/model snapshot;
    • harness/policy version;
    • outcome and stop-reason code;
    • verification result and verifier reference;
    • acceptance-criteria totals;
    • validation-command totals;
    • human override/rejection/rollback flags;
    • evidence references;
    • timestamps.
  • Define which attempts are comparable. Material runtime/model, policy, capability, or scope changes must start a new cohort or require requalification.
  • Make attempt ingestion idempotent and append-only for auditability.
  • Calculate deterministic metrics such as:
    • first-attempt success rate;
    • independently verified pass rate;
    • repair/retry rate;
    • human rejection rate;
    • rollback/regression rate;
    • policy-block rate;
    • false-success rate;
    • consecutive verified passes;
    • evidence freshness.
  • Support rolling windows and minimum sample sizes.
  • Weight or classify critical failures separately so averages cannot conceal them.
  • Exclude self-reported confidence or prose grades from authoritative calculations.
  • Add data retention, redaction, and migration notes.

Acceptance Criteria

  • Two attempts with materially different capability scopes are not silently combined.
  • Runtime/model or policy-version changes are visible and can trigger requalification.
  • Every ledger entry links to a canonical outcome and verification/evidence state.
  • Reprocessing an attempt is idempotent.
  • Metrics can be recomputed deterministically from stored attempts.
  • A critical failure remains visible regardless of the aggregate pass percentage.
  • Human rejection, rollback, and override events affect the reliability view.
  • Missing independent verification is not counted as a verified pass.
  • Tests cover cohorting, rolling windows, critical failures, idempotency, and historical data.

Out of Scope

Implementation Scope

Large — data model, evidence ingestion, deterministic aggregation, and tests.

Technical Notes

Potential persistence:

  • capability_attempts as immutable attempt evidence;
  • optional materialized reliability summaries that can always be rebuilt;
  • a stable scope fingerprint derived from normalized allowed paths/resources/capabilities, never raw secrets;
  • foreign keys to existing project/task/work-package/agent-run records where available.

Use PostgreSQL as authority. Redis may schedule recomputation but must not hold the canonical ledger.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions