12

Failure reports

A step in your product can report its own failure. ChangeBox fingerprints it, files one change, and confirms the fix when the step stays quiet — no one has to be watching.

The product finds the bug

Log ingest groups errors that already happened. This door is for a step that knows it failed: a gate, a render, a charge. The first code failure files a change with the event as evidence. The same failure later attaches to that change. The card reads seen 7× across 4 projects.

One event

POST /api/ingest/failures
x-changebox-ingest-key: cbi_…

{
  "environment": "production",
  "buildSha": "a1b2c3d4",
  "step": "gate-a",
  "errorClass": "TypeError",
  "message": "Cannot read properties of undefined (reading 'id')",
  "stack": "TypeError: …\n    at gateA (/src/pipeline/gate-a.ts:40:3)",
  "subjects": { "projectId": "prj_1", "episode": "4", "stageRunId": "run_9" },
  "occurredAt": "2026-10-27T03:11:00Z",
  "severity": "user-visible stall",
  "kind": "code"
}

The ingest key is the app. Operators and agents send the same body to POST /api/v1/failures with an operator token, or call the MCP tool changebox_report_failure. step is required; surface is accepted as that step when step is omitted. The stack is kept up to 4000 characters.

One defect, one change

The fingerprint is the app, the step, and the error with ids, numbers, and hashes removed. Two projects hitting the same TypeError on gate A are one change. Dev and production share the fingerprint, so a production report can see that dev already has the fix. A user-visible stall, or a charge that returned nothing, is filed as broken. Anything else is confusing.

kind        code      files on the first event
            quality   counts only — a judge verdict, a retry the system handled
threshold   3 distinct subjects in 24h     per app, on Signals
cap         5 new changes per step per day  the rest attach to a change that step already has

Repeats attach to the open change, including one that is live and not yet confirmed: occurrence count, the distinct subjects, and last seen. The card line uses project ids when the event has them.

Confirmed by the step staying quiet

{ "outcome": "success", "environment": "production", "step": "gate-a", "occurredAt": "…" }

A success files nothing. It counts a finished run of that step. A live change born from a failure report confirms itself when the fingerprint has not come back on the environment where the fix is live, for 5 successful runs of that step or 48 hours, whichever comes first. Both numbers are per app. A recurrence on that environment reopens the change and attaches the new event. A production report of a fingerprint already fixed on dev waits for the release instead of starting a second build — the same Awaiting release state as a person reporting a bug that is already on dev.