Agents and defects

Agents take cases off the queue. Failures go somewhere.

Assay is built so an agent session and a person can work the same run without stepping on each other, and so a failure is never just a red mark nobody follows up.

The claim protocol

A claim is a lease, not a lock.

Cases are assigned to an agent first. The agent then claims them one at a time, highest priority first, with a single call.

  1. Claim

    The agent presents its key and asks for its next case. The database hands each case to exactly one caller, using row locks that skip rows another caller already holds, so two agents never get the same case.

  2. Execute and report

    The claim returns the steps, the run's environment settings, and the plan's environment notes, so the agent is never testing blind. It reports each step and the case result, and can attach evidence.

  3. Heartbeat

    A lease lasts 30 minutes by default. A heartbeat extends it, up to 4 hours from the first claim.

  4. Release or expire

    If the agent stops, a sweeper that runs every 30 seconds returns the case to the queue. The steps already reported stay recorded, and a case that keeps losing its claim is blocked with a reason.

Assay's Agents page: two registered agents, one holding a live lease on a case with 29 minutes left and two heartbeats.Assay's Agents page: two registered agents, one holding a live lease on a case with 29 minutes left and two heartbeats.
Agents: the registry, and the lease held right now. Enlarge to see the full screen.
What an agent key can do
ScopeLets an agent
ReadRead plans, runs, and cases.
ClaimClaim, heartbeat, and release its own assignments.
ReportReport step and case results.
EvidenceAttach evidence to a case or step.
CommentReserved for discussion on a case. Nothing uses it yet.

An agent key can't author a plan, assign work, or administer anything, and a key can't act as a person.

Defects

File it, link it, or say why not.

A failed case has four possible outcomes, and each one is recorded on the Defects page.

Defect states
StateMeaning
FilingQueued; a worker is about to create or update the card.
FiledA Docket card exists, created from the case's steps, expected and actual results, environment, and priority.
Not filedDelivery failed. The failure is recorded, the error is shown, and the page leads with these.
LinkedThe failure is attached to a card that already existed.
SuppressedDeliberately not filed, with a reason on record.
Assay's Defects page: two failures in the Linked state, each with its case, the time last seen, and a link to its Docket card.Assay's Defects page: two failures in the Linked state, each with its case, the time last seen, and a link to its Docket card.
Defects: each failure with its state and its card. Enlarge to see the full screen.
  1. De-duplicated

    Assay compares the first line of the failure text, with ids, timestamps, and long numbers masked. A repeat comments on the existing card and bumps its occurrence count instead of filing another.

  2. Never inline

    Filing goes through a durable outbox with retries that back off to ten minutes, so a Docket outage never blocks a tester's click or loses a result.

  3. Redacted evidence

    Secrets such as authorization headers, JWTs, payment-provider secret keys, cloud access keys, service tokens, and agent keys are replaced before evidence is stored, and the patterns that matched are recorded with it.

When a Chirp webhook is configured, Assay also posts a short notice when a run starts or finishes, when a P0 or P1 case fails, when a defect is filed, and when a run stalls.