Skip to content

feat(agents): start an agent job from a failed verify or soak (#5339) - #5395

Merged
lex00 merged 2 commits into
mainfrom
feat/5339-agent-verify-failed
Nov 20, 2026
Merged

lex00 merged 2 commits into
mainfrom
feat/5339-agent-verify-failed

Conversation

@lex00

@lex00 lex00 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Closes #5339

A failed verify step or a soak check that starts failing can now start an agent job. chant writes the fact itself on chant/lifecycle, so no webhook is involved. The intake is the one alerts and failed applies use (#5329, #5357). pendingAgentFacts joins the signed facts under _alerts/ per member inside the window. The settings are checked against the default branch through --digest.

Trigger

on: "verify-failed" joins AGENT_FACT_TRIGGERS and AGENT_SIGNED_TRIGGERS in packages/core/src/ci-agent.ts. The agent runs as its own workflow on a schedule, and a person can start it by hand. It answers with a pull request from <product>/agent/<name>[-<member>], and a person reviews it.

Two places record a fact under _alerts/verify-failed.jsonl, signed with the relay key, when the job's CHANT_AGENT_FACTS names verify-failed:

  • soakAtGate (pipeline/soak-gate.ts): a check whose status turns to failed, at the same change that sends the soak notify event. A check that keeps failing records nothing more, and an unknown reading records nothing. This covers a stage's soak in components promote and a wave's soak in a wave job.
  • components promote and redeploy: a failed step in a phase named Verify, or of a kind listed in VERIFY_STEP_KINDS (core's wait-and-verify verbs and http-check).

Recording changes nothing else. The soak's outcome is the same with or without it (tested), and the promote exits as before. A rollback the stage requests (#5328) is untouched. The agent never writes the gate ledger, and its prompt and pull request say the rollback stands and is decided at the stage's gate.

Data and limits

Each fact keeps the failure as VerifyFailedRecord in ci-agent-verify-failed.ts. The step's error or the check's output is cut to 8,000 characters per fact. The prompt carries the failures as quoted JSON, cut to 20,000 characters. Run records carry trigger: "verify-failed" and a verifies list naming the failed stage and check of each failure.

Jobs

  • agentFacts.triggers on the waves and pipeline options defaults to ["apply-failed"]. Adding verify-failed turns it on for the wave jobs and for the pipeline's promote and recheck jobs on all three forges.
  • The agent's own workflow renders on GitHub, GitLab and Forgejo through the same fact-agent path as agents: start an agent job from a failed apply, and on a schedule #5357.

For products

productVerifyFailedAgent and recordVerifyFailed are in @intentius/chant/ci-product, gated by VERIFY_FAILED_AGENT_FLOOR. The vocabulary gains the agent.verify-failed row, and the shared agent rows list it. The agent jobs guide has a section for the trigger.

Nothing turns on by default. The agent's jobs hold no way to apply or approve, and its pull request waits for a person to merge it.

Tests

packages/core/src/ci-agent-verify-failed.test.ts records both kinds of fact on a temporary ledger. It runs a failing soak through soakAtGate with recording on and off. A landing test checks the forge calls, the pushes and the run record for each guarantee the issue names. The generator tests on each forge cover the agent workflow and the promote jobs' variables.

@lex00
lex00 enabled auto-merge November 20, 2026 14:45
@lex00
lex00 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 07854b1 Nov 20, 2026
10 checks passed
@lex00
lex00 deleted the feat/5339-agent-verify-failed branch November 20, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agents: start an agent job from a failed verify or soak

1 participant