Repository navigation
feat(agents): start an agent job from a failed verify or soak (#5339) - #5395
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).pendingAgentFactsjoins the signed facts under_alerts/per member inside the window. The settings are checked against the default branch through--digest.Trigger
on: "verify-failed"joinsAGENT_FACT_TRIGGERSandAGENT_SIGNED_TRIGGERSinpackages/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'sCHANT_AGENT_FACTSnamesverify-failed:soakAtGate(pipeline/soak-gate.ts): a check whose status turns to failed, at the same change that sends thesoaknotify event. A check that keeps failing records nothing more, and an unknown reading records nothing. This covers a stage's soak incomponents promoteand a wave's soak in a wave job.components promoteandredeploy: a failed step in a phase namedVerify, or of a kind listed inVERIFY_STEP_KINDS(core's wait-and-verify verbs andhttp-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
VerifyFailedRecordinci-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 carrytrigger: "verify-failed"and averifieslist naming the failed stage and check of each failure.Jobs
agentFacts.triggerson the waves and pipeline options defaults to["apply-failed"]. Addingverify-failedturns it on for the wave jobs and for the pipeline's promote and recheck jobs on all three forges.For products
productVerifyFailedAgentandrecordVerifyFailedare in@intentius/chant/ci-product, gated byVERIFY_FAILED_AGENT_FLOOR. The vocabulary gains theagent.verify-failedrow, 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.tsrecords both kinds of fact on a temporary ledger. It runs a failing soak throughsoakAtGatewith 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.