Repository navigation
feat(deploy-gate): reusable deploy gate with the claims check from the last successful deployment - #23
Conversation
|
Train batch |
9656686 to
4233b65
Compare
|
Adversarial test of head 9656686. I ran the real "Resolve the deploy range" block under Result: HELD 12, BROKE 2, UNPROVEN 4.
B1 (cheap). B2 (not cheap). The gate filters deployments by environment name only: no creator, ref or workflow filter. Docs: "Create a deployment" (docs.github.com/en/rest/deployments/deployments) takes any branch, tag or SHA, needs Deployments: write, and with no required_contexts "will always succeed"; "Create a deployment status" says "Users with push access can create deployment statuses". Neither page says protection rules apply to API-created deployments. So a branch workflow with UNPROVEN, need a live run:
Controls. Negative: an uncited "guarantee 100% uptime" line in README.md in the range gives exit 1. Positive: plain copy gives exit 0, "Model not called". Full report: scratchpad |
|
Landed in train batch |
Problem
The estate has no shared deploy function. Approval is configured per repo: environments
cortex-prod,hotkeys-web-prodandvespertin-prodwith required reviewer todie, plus sovereign's deploy number on paas promote PRs. No deploy runs the claims check. Christian, 2026-11-20 10:22:28Z: "add agent jury claims check and deployment approval to estate standard deployment functions". TASK-0823 settled the approval binding: option A, a GitHub environment<unit>-prodwith required reviewer todie.Change
deploy-gate.yml, a new reusable workflow:GET /deployments, then each deployment's latest status) to the checked-out commit.claims_modeinput.shaandbase.base_sha; an API refusal (it names thedeployments: readpermission); a base outside the history; or an unsafe environment name.Approval: the environment on the caller's deploy job,
needs: gate. The reviewer approves the job that holds the credentials, after the gate has run in the same run. That is one approval per deploy, and a workflow edit cannot remove it. An approval on the gate job instead would mean either two approvals, or deploy credentials in an environment without a reviewer.scripts/claims_job.sh: the claims step moves here fromagent-jury.yml, so both workflows run one file. There are three edits:BASE_REFskips theorigin/<ref>attempt, in the diff and for the evidence base;CLAIMS_SUBJECTreplaces "PR #n" in the model prompt;PR_NUMBERmay be unset.diffagainst the inline block on main shows only these lines.Docs: a README section and a CHANGELOG entry.
Verification
Red first:
3ff234caddstests/test_deploy_gate.pyand points the job-shell tests at the script file. It errors with 6 errors, because neither file exists.Green: 123 tests pass on
9656686.Mutation checks:
successstatus check fails 3 range tests.Range tests: the real
Resolve the deploy rangeblock, run by bash against a real git repo and a local HTTP server that answers the two GitHub endpoints.Lint: actionlint 1.7.12 (shellcheck off) reports nothing beyond the known
job.workflow_*schema gap. shellcheck-S warningis clean onscripts/claims_job.shand on the range block.End-to-end canary on cerebral-work/vilicus, pinned to
9656686:canary/deploy-gate, with a throwaway environmentjury-gate-canarythat had no reviewer and no secrets. The deploy job only echoed.BASE_SHAenv)70443e1d, first deploy, inputbase_sha= main33af9e1a33af9e1a..70443e1d6ac28a9f, nobase_sha, addsWe guarantee 100% uptime for every customer.70443e1d..6ac28a9f, read from the deploymentcad69a61, copy replaced by a definition and a negation70443e1d..cad69a61: the failed run did not move the base863676d2, workflow comment onlycad69a61..863676d2: a success moves the baseJury canary, cerebral-work/vilicus#295 (closed, never landed): run 44741719179 ran
bash -e .jury-tools/scripts/claims_job.shfrom9656686and failed the uncited claim.Not verified: the approval wait. It needs todie's click, so it is proven on the first reverie deploy (CER-4035), as the CER-4034 acceptance states.
References
no XERJ hit. Queries:
xerj searchon the prefixesvespertin-site,cortexandcanary: "environment deployment approval required reviewer deploy job needs";xerj code cygnus-gitops: "github actions deployment gate environment approval last deployed sha".House pattern:
cerebral-work/vespertin.github/workflows/atlas-deploy.yml. The deploy job holds the environment, and the environment holds the token and allows only main. GitHub REST: deployments and deployment statuses (GET /repos/{owner}/{repo}/deployments?environment=,GET .../deployments/{id}/statuses).Linear
CER-4034. Searched open and done issues for "deploy gate" and "deployment approval"; CER-4034 is the ticket, filed today.