Sisyphus
Continuously drive authorized release candidates from the newest concrete
failure to terminal deployed proof. Do not retry an unchanged candidate and do
not stop at a local commit, holding branch, pull request, image, or zero-traffic
revision.
Establish the contract
Before changing state, record:
- the target repository, branch, environment, and deployment workflow;
- what the user authorized: local edits, commits, pushes, deploys, secrets,
provider changes, or traffic changes;
- the terminal condition, such as CI green, build green, revision promoted,
health green, or provider proof complete;
- any retry limit. When the user says one attempt, permit exactly one external
build submission for each distinct pushed candidate.
A request to keep fixing failures authorizes persistence, not unrelated
mutations. Stop for credentials, provider changes, IAM grants, production data
writes, or broader deployment authority that the user did not grant.
Interpret continuous authorization
When the user says "continuously," "keep fixing until green," "get a working
Cloud Run build," or equivalent:
- treat local edits, commits, sequential fast-forward pushes to the identified
deployment branch, and deployments triggered by its checked-in workflow as
authorized;
- if the repository and workflow make the deployment branch and environment
unambiguous, proceed without pausing to ask again;
- keep manual traffic commands, provider mutations, secrets, IAM, production
data, and unconfigured environments approval-gated;
- remain in the loop after each terminal failure: capture it, fix it locally,
publish one distinct candidate, and monitor again.
A temporary isolated checkout or codex/ branch is an implementation detail.
It is not a handoff or stop condition. Reconcile and publish its validated
commit to the authorized deployment branch unless a remote movement, protected
branch rule, missing credential, or user instruction blocks that action.
Protect the checkout
- Read repository instructions and inspect
git status --short.
- Pin
HEAD, the remote target, and the files owned by this task.
- Preserve unrelated dirty changes. In a shared or heavily dirty checkout, use
an isolated worktree based on the intended remote commit.
- Re-read status before broad gates, staging, rebasing, or pushing.
- Stage explicit paths only. Never use a broad stage command in a shared
checkout.
Do not switch or clean a shared dirty checkout merely to publish. Commit in the
isolated checkout, fetch the real remote, prove a fast-forward, and push that
exact commit from the isolated checkout.
Keep local proof, remote CI proof, build proof, deployed proof, provider proof,
and external sign-off separate.
Start from the newest failure
Inspect the newest run for the exact candidate. Capture:
- workflow run and job IDs;
- build ID and candidate commit;
- failing step, exit code, and the smallest useful log excerpt;
- current deployed revision and traffic baseline.
Classify the failure before editing:
- source regression;
- generated artifact or contract drift;
- configuration, secret, IAM, or provider state;
- infrastructure or transient failure;
- concurrent branch movement or unrelated change.
Do not speculate from an older failure after a newer candidate exists. Do not
submit another build merely to discover an error that can be reproduced
locally.
Rehearse locally
- Reproduce the failing command or closest production-equivalent artifact.
- Fix the smallest coherent cause. Do not weaken tests, contracts, refusal
gates, tenancy, idempotency, or security checks.
- Run the narrowest affected test immediately.
- Broaden to the repository-required type, lint, contract, build, generated
artifact, and domain gates.
- If another failure appears locally, fix it before pushing.
- Record exact commands, results, and changed files.
Treat unavailable integrations separately from source failures. A local pass is
not deploy proof.
Publish one candidate
Immediately before committing or pushing:
- Fetch the remote target and compare it with the pinned base.
- If the remote moved, preserve concurrent work and replay only this task's
commits. Never force-push unless the user explicitly requested it.
- Review the staged diff and path list.
- Commit with a message that explains the failure fixed and the release impact.
- Push once to the actual deployment branch. A local-only or non-deploying
branch does not satisfy this step unless the user explicitly requested PR
validation instead of a deployment.
- Confirm that exactly one deployment workflow and one external build
submission correspond to the candidate.
If a workflow fails before submitting a build, record that distinction. Do not
count a validation-only failure as a Cloud Build attempt.
Monitor to a terminal result
Follow the candidate continuously through:
- CI validation;
- build submission;
- image build and immutable digest;
- zero-traffic candidate creation when supported;
- candidate health and dependency readiness;
- indexes, queues, schedulers, secrets, and release-resource readback;
- traffic promotion;
- post-promotion observation;
- terminal workflow status.
Send concise progress updates during long waits. Prefer direct build logs over
repeated UI polling when they expose the active step sooner.
On failure:
- Capture the new exact error and confirm whether traffic stayed on the prior
healthy revision or rollback succeeded.
- Do not rerun the same candidate.
- Return to local rehearsal with the new failure.
- Publish a new commit only after the fix and required gates pass.
- Continue the same loop immediately. A progress report is not a handoff.
On success, independently read back the deployed revision, commit label, image
digest, traffic percentage, health/readiness status, and required resource
state. Do not rely only on a green workflow badge.
Secrets and credentials
- Never print, commit, or include secret values in logs or handoffs.
- Use masked CI secret channels and the platform's secret manager.
- Verify secret presence, version, access, and binding without echoing content.
- Do not invent credentials or grant broad IAM to make a pipeline pass.
- Provision, rotate, or bind a secret only when the user authorized that exact
environment mutation.
Stop conditions
Stop when:
- the full terminal contract is proven;
- the next action needs new authority or user-controlled credentials;
- the failure is an external provider or infrastructure blocker that cannot be
resolved safely;
- the same approach has failed unchanged and no new evidence supports another
attempt.
Do not stop or claim success merely because source tests pass, a local branch is
clean, a pull request exists, an image builds, or a revision exists at zero
traffic. When continuous execution was requested, yield a final handoff only
after deployed proof succeeds or a genuine stop condition is evidenced.
Handoff
Report:
- final outcome and exact candidate commit;
- workflow run ID and conclusion;
- build ID and number of submissions;
- deployed revision, image digest, traffic, health, and readiness;
- resource readback such as indexes, queues, and schedulers;
- commit-to-path ledger;
- local and remote gates run;
- current
HEAD versus remote target;
- preserved unrelated work;
- any remaining provider action or sign-off.
Keep secret values out of the report.
Example triggers
- "Fix each new GitHub Actions error, push the fix, and follow one Cloud Build
submission until Cloud Run is healthy."
- "Keep repairing the deployment until green, but never retry an unchanged
candidate."
- "Continuously push distinct fixes to main and monitor Cloud Run until the new
revision is healthy."
1---2name: sisyphus3description: Continuously diagnoses and fixes CI, build, and deployment failures one candidate at a time, then commits, pushes to the deployment branch, and monitors each authorized attempt until the requested remote deployment is green or genuinely blocked. Use when the user invokes Sisyphus or asks to keep fixing GitHub Actions, Cloud Build, Cloud Run, or a similar deployment without retry churn; a local branch or local pass is never the terminal result.4---56# Sisyphus78Continuously drive authorized release candidates from the newest concrete9failure to terminal deployed proof. Do not retry an unchanged candidate and do10not stop at a local commit, holding branch, pull request, image, or zero-traffic11revision.1213## Establish the contract1415Before changing state, record:1617- the target repository, branch, environment, and deployment workflow;18- what the user authorized: local edits, commits, pushes, deploys, secrets,19 provider changes, or traffic changes;20- the terminal condition, such as CI green, build green, revision promoted,21 health green, or provider proof complete;22- any retry limit. When the user says one attempt, permit exactly one external23 build submission for each distinct pushed candidate.2425A request to keep fixing failures authorizes persistence, not unrelated26mutations. Stop for credentials, provider changes, IAM grants, production data27writes, or broader deployment authority that the user did not grant.2829## Interpret continuous authorization3031When the user says "continuously," "keep fixing until green," "get a working32Cloud Run build," or equivalent:3334- treat local edits, commits, sequential fast-forward pushes to the identified35 deployment branch, and deployments triggered by its checked-in workflow as36 authorized;37- if the repository and workflow make the deployment branch and environment38 unambiguous, proceed without pausing to ask again;39- keep manual traffic commands, provider mutations, secrets, IAM, production40 data, and unconfigured environments approval-gated;41- remain in the loop after each terminal failure: capture it, fix it locally,42 publish one distinct candidate, and monitor again.4344A temporary isolated checkout or `codex/` branch is an implementation detail.45It is not a handoff or stop condition. Reconcile and publish its validated46commit to the authorized deployment branch unless a remote movement, protected47branch rule, missing credential, or user instruction blocks that action.4849## Protect the checkout50511. Read repository instructions and inspect `git status --short`.522. Pin `HEAD`, the remote target, and the files owned by this task.533. Preserve unrelated dirty changes. In a shared or heavily dirty checkout, use54 an isolated worktree based on the intended remote commit.554. Re-read status before broad gates, staging, rebasing, or pushing.565. Stage explicit paths only. Never use a broad stage command in a shared57 checkout.5859Do not switch or clean a shared dirty checkout merely to publish. Commit in the60isolated checkout, fetch the real remote, prove a fast-forward, and push that61exact commit from the isolated checkout.6263Keep local proof, remote CI proof, build proof, deployed proof, provider proof,64and external sign-off separate.6566## Start from the newest failure6768Inspect the newest run for the exact candidate. Capture:6970- workflow run and job IDs;71- build ID and candidate commit;72- failing step, exit code, and the smallest useful log excerpt;73- current deployed revision and traffic baseline.7475Classify the failure before editing:7677- source regression;78- generated artifact or contract drift;79- configuration, secret, IAM, or provider state;80- infrastructure or transient failure;81- concurrent branch movement or unrelated change.8283Do not speculate from an older failure after a newer candidate exists. Do not84submit another build merely to discover an error that can be reproduced85locally.8687## Rehearse locally88891. Reproduce the failing command or closest production-equivalent artifact.902. Fix the smallest coherent cause. Do not weaken tests, contracts, refusal91 gates, tenancy, idempotency, or security checks.923. Run the narrowest affected test immediately.934. Broaden to the repository-required type, lint, contract, build, generated94 artifact, and domain gates.955. If another failure appears locally, fix it before pushing.966. Record exact commands, results, and changed files.9798Treat unavailable integrations separately from source failures. A local pass is99not deploy proof.100101## Publish one candidate102103Immediately before committing or pushing:1041051. Fetch the remote target and compare it with the pinned base.1062. If the remote moved, preserve concurrent work and replay only this task's107 commits. Never force-push unless the user explicitly requested it.1083. Review the staged diff and path list.1094. Commit with a message that explains the failure fixed and the release impact.1105. Push once to the actual deployment branch. A local-only or non-deploying111 branch does not satisfy this step unless the user explicitly requested PR112 validation instead of a deployment.1136. Confirm that exactly one deployment workflow and one external build114 submission correspond to the candidate.115116If a workflow fails before submitting a build, record that distinction. Do not117count a validation-only failure as a Cloud Build attempt.118119## Monitor to a terminal result120121Follow the candidate continuously through:1221231. CI validation;1242. build submission;1253. image build and immutable digest;1264. zero-traffic candidate creation when supported;1275. candidate health and dependency readiness;1286. indexes, queues, schedulers, secrets, and release-resource readback;1297. traffic promotion;1308. post-promotion observation;1319. terminal workflow status.132133Send concise progress updates during long waits. Prefer direct build logs over134repeated UI polling when they expose the active step sooner.135136On failure:1371381. Capture the new exact error and confirm whether traffic stayed on the prior139 healthy revision or rollback succeeded.1402. Do not rerun the same candidate.1413. Return to local rehearsal with the new failure.1424. Publish a new commit only after the fix and required gates pass.1435. Continue the same loop immediately. A progress report is not a handoff.144145On success, independently read back the deployed revision, commit label, image146digest, traffic percentage, health/readiness status, and required resource147state. Do not rely only on a green workflow badge.148149## Secrets and credentials150151- Never print, commit, or include secret values in logs or handoffs.152- Use masked CI secret channels and the platform's secret manager.153- Verify secret presence, version, access, and binding without echoing content.154- Do not invent credentials or grant broad IAM to make a pipeline pass.155- Provision, rotate, or bind a secret only when the user authorized that exact156 environment mutation.157158## Stop conditions159160Stop when:161162- the full terminal contract is proven;163- the next action needs new authority or user-controlled credentials;164- the failure is an external provider or infrastructure blocker that cannot be165 resolved safely;166- the same approach has failed unchanged and no new evidence supports another167 attempt.168169Do not stop or claim success merely because source tests pass, a local branch is170clean, a pull request exists, an image builds, or a revision exists at zero171traffic. When continuous execution was requested, yield a final handoff only172after deployed proof succeeds or a genuine stop condition is evidenced.173174## Handoff175176Report:177178- final outcome and exact candidate commit;179- workflow run ID and conclusion;180- build ID and number of submissions;181- deployed revision, image digest, traffic, health, and readiness;182- resource readback such as indexes, queues, and schedulers;183- commit-to-path ledger;184- local and remote gates run;185- current `HEAD` versus remote target;186- preserved unrelated work;187- any remaining provider action or sign-off.188189Keep secret values out of the report.190191## Example triggers192193- "Fix each new GitHub Actions error, push the fix, and follow one Cloud Build194 submission until Cloud Run is healthy."195- "Keep repairing the deployment until green, but never retry an unchanged196 candidate."197- "Continuously push distinct fixes to main and monitor Cloud Run until the new198 revision is healthy."