Skip to content

fix(deploy-gate): base is the newest deployed ancestor; base_sha only as a first-deploy fallback - #24

Merged
cerebral-work[bot] merged 3 commits into
mainfrom
fix/deploy-gate-base
Nov 20, 2026
Merged

cerebral-work[bot] merged 3 commits into
mainfrom
fix/deploy-gate-base

Conversation

@todie

@todie todie commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The assurance re-check of #23 (comment 7040523492) broke two things, and I found a third while working through them:

  1. base_sha overrode the deployment history. It was checked only for existence. With base_sha set to the commit being deployed, or to a later one, the range is empty and an uncited claim passes. A caller that wires base_sha from a dispatch input would have no claims check.
  2. A token with deployments: write can create a success deployment and move the base. This is from the REST documentation and was not run live.
  3. Rollback hole. The base was the newest successful deployment whatever its relation to the commit being deployed. Re-running an old run after a newer deploy gave an empty base...sha range, so a commit that was never deployed shipped unchecked.

Change

  • Base: the newest successful deployment whose commit is an ancestor of, or equal to, the commit being deployed. Newer deployments that are not ancestors are skipped and counted. A rollback to a commit that was never deployed is checked from the deployed commit before it.
  • base_sha:
    • It is used only when no such deployment exists, and it must be a strict ancestor of the commit being deployed.
    • Otherwise it is ignored with a warning annotation.
    • It never skips the API call.
  • Visibility: the log prints the range, its commit count and the base source. The summary adds the skip count.
  • Finding 2: a README residual, not a fix. A tamper-evident record of each gate pass replaces deployment statuses when the approval moves to a reflex RED card (TASK-0823). Option A already admits that agents holding todie's token can approve.
  • README limits also gain:
    • no if: always() or !cancelled() on the deploy job;
    • the .jury-tools path clash.

Verification

  • Red first: b5e6902 adds 6 tests and widens a seventh. On main 4233b65, 7 cases in 6 tests fail: base_sha ignored when a deployment exists, base_sha strict ancestor (2 cases), base_sha never skips the API, rollback from the newest deployed ancestor, rollback to a deployed commit, and no deployed ancestor failing closed.
  • Green: 129 tests pass on 8cda2fb.
  • Mutation checks:
    • Dropping the ancestor test fails 3 tests.
    • Dropping the not-HEAD guard fails the strict-ancestor test.
  • Lint: actionlint 1.7.12 and shellcheck -S warning are clean.
  • Live canary on cerebral-work/vilicus, pinned to 8cda2fb, with an environment that had no deployments. The branch and the environment are deleted.
    • Run 44744308919, a live negative: base_sha was a local GitButler workspace commit that was never pushed. It failed closed: "input base_sha ... is not an ancestor of ...".
    • Run 44744525331: base_sha = main c2d0a6d. Success, deployment 7942821279 at 12b7c636.
    • Run 44744713123: base_sha still set, plus an uncited claim.
      • Warning: "input base_sha ignored; deployment 7942821279 at 12b7c636 is the base".
      • Log: "range 12b7c636..89cc8b0b, 1 commit(s)".
      • The claims check failed, and the deploy was skipped.
  • Assurance's unproven items, shown live:

References

no XERJ hit (queries in #23).

Linear

CER-4034.

@todie todie added the train the merge train lands this PR label Nov 20, 2026
cerebral-work Bot and others added 3 commits November 20, 2026 13:35
…or, strict ancestry, rollback ranges

Co-authored-by: Christian M. Todie <chris@todie.io>
Train-Original-Commit: b5e6902
Train-Batch: 4233b65-7533e5e6
Train-Base: 4233b65
Train-Prs: 24
… as a first-deploy fallback and a strict ancestor

Co-authored-by: Christian M. Todie <chris@todie.io>
Train-Original-Commit: 4f2b9b5
Train-Batch: 4233b65-7533e5e6
Train-Base: 4233b65
Train-Prs: 24
…d .jury-tools limits

Co-authored-by: Christian M. Todie <chris@todie.io>
Train-Original-Commit: 8cda2fb
Train-Batch: 4233b65-7533e5e6
Train-Base: 4233b65
Train-Prs: 24
Train-Original-Head: 8cda2fb
@cerebral-work
cerebral-work Bot force-pushed the fix/deploy-gate-base branch from 8cda2fb to 7802b95 Compare November 20, 2026 13:35
@cerebral-work

cerebral-work Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Train batch 4233b65b-7533e5e6: replayed onto main 4233b65b as 1/1; your branch was rewritten (original saved at train/orig/24). Tip 7802b956fbba8a65e193d0bddecc27387327c0cf.

@cerebral-work
cerebral-work Bot merged commit 7802b95 into main Nov 20, 2026
4 checks passed
@cerebral-work

cerebral-work Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Landed in train batch 4233b65b-7533e5e6 at 7802b956fbba8a65e193d0bddecc27387327c0cf.

cerebral-work Bot added a commit that referenced this pull request Nov 20, 2026
Train-Original-Head: 8cda2fb
Train-Pr: 24
Train-Batch: 4233b65-7533e5e6
Train-Landed: 7802b95
@cerebral-work
cerebral-work Bot deleted the fix/deploy-gate-base branch November 20, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

train the merge train lands this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant