Skip to content

Fix Lifecycle

Every failure follows the same path, and every path ends in one of two visible outcomes. Autowright never leaves a failure in limbo.

1. Report and dedup

The browser package POSTs an ErrorContext to the service. The service computes an error hash — SHA-256 over the script ID, classification, failed step, and normalized error message — and checks whether this incident is already known.

A scraper on a 5-minute cron that hits the same broken selector all night produces one fix job, not a hundred. Repeat reports within the dedupe window (default 24 hours, AUTOWRIGHT_DEDUPE_TTL_MS) are counted but not re-queued.

2. Queue and pick up

New incidents become pending jobs. The fixer polls the service (default every 5 seconds), takes jobs up to its concurrency limit (MAX_CONCURRENT_FIXES), and marks each in-progress.

3. The fix attempt

For each job, in a sandboxed temp directory:

  1. Download the evidence bundle from artifact storage.
  2. Clone the target repo (shallow, blob-filtered).
  3. Run the Claude agent with the captured DOM, action log, error details, and classification-specific fix guidance. The agent can read and edit the repo but is confined to the job’s working directory.

4. The confidence gate

The agent must end with an explicit verdict:

  • FIX_OUTCOME: FIXED — the agent is confident. The change is committed, pushed, and opened as a pull request. Slack gets a “Fix proposed” message.
  • FIX_OUTCOME: CANNOT_FIX — no confident fix (the site needs new credentials, the flow changed fundamentally, the evidence is ambiguous). No PR is opened. Slack gets a “Needs attention” message with the diagnosis and a link to the evidence bundle.

A fix that can’t be made confidently degrades to triage — it never becomes a speculative PR, and it never disappears silently.

5. Human review

A proposed fix is a proposal. The PR description carries the agent’s reasoning, the files changed, and the evidence link. You verify it against the live site before merging — Autowright optimizes for making that verification take seconds, not for merging its own work.

Cost accounting

Every fix attempt records its real spend — total dollars, input/output/cache tokens, agent turns, and wall-clock duration — surfaced in the Slack message and on the dashboard’s fix detail page. A trivial selector fix lands around $0.09; you’ll know exactly what a complicated one cost.