Skip to content

fix(ci): a check that never starts, and a contract that never moves - #11

Merged
euskadi31 merged 1 commit into
mainfrom
ci/spec-sync-verdict
Aug 24, 2026
Merged

fix(ci): a check that never starts, and a contract that never moves#11
euskadi31 merged 1 commit into
mainfrom
ci/spec-sync-verdict

Conversation

@euskadi31

Copy link
Copy Markdown
Contributor

engine.md section 11.4 gained two requirements after #9 was written. Both were
measured by other engines; both are defects in what #9 shipped.

The required check would never have started

A pull request opened with a repository's own GITHUB_TOKEN starts no
pull_request workflow — GitHub cuts there so an action cannot call itself in a
loop. #9 armed auto-merge behind a branch protection requiring Verify, and
Verify comes from ci.yml, which would never have run on a synchronization
pull request. Every synchronization would have sat at mergeStateStatus: BLOCKED
forever, waiting for a check with nothing to start it.

The workflow already runs the section 12.5 entry point. It now publishes that
result as the Verify commit status on the head it just pushed:

gh api -X POST "repos/$repo/statuses/$(git rev-parse HEAD)" \
  -f state=success|failure -f context=Verify ...

Same definition of green, same name the protection requires, no second workflow
recomputing it, and no token wider than statuses: write on the repository's own
commits. Measured on this branch's head: the POST succeeds and
GET /commits/{sha}/status reads it back as state: success.

The prose contracts travel with the release now

spec.md, engine.md and engine-swift.md became release artefacts in spec#87,
listed in SHA256SUMS and covered by the attestation this workflow already
verifies. #9 excluded them, on the then-correct ground that the release did not
publish them. Section 11.4 step 3 now names them, and the reason is the one the
Go engine gave: an engine that fetched only the data would keep a stale contract
and would not notice, because nothing digests them.

Still open, and still measured

  • The provenance writer is still not a release artefact, and neither are its
    templates. docs: the one file of section 11.4 step 3 the release does not carry #10 records it.
  • Allow GitHub Actions to create and approve pull requests is still off, and
    it is refused at the repository level with "The organization does not allow
    GitHub Actions to create or approve pull requests"
    . Until an owner checks it
    for the libbusinessid organization, a synchronization reaches step 6 and dies
    there with that instruction printed, its branch pushed.

@euskadi31
euskadi31 enabled auto-merge (squash) August 24, 2026 21:43
Two things `engine.md` section 11.4 gained after the workflow was written, both
measured by other engines rather than guessed here.

**The verdict is published, not awaited.** A pull request opened with a
repository's own `GITHUB_TOKEN` starts no `pull_request` workflow -- GitHub cuts
there so an action cannot call itself in a loop -- so a branch protection
requiring `Verify` would wait for a check that never starts, and auto-merge would
never fire. The workflow already runs the section 12.5 entry point; it now
publishes that result as the `Verify` commit status on the head it just pushed.
Same definition of green, same name, no second workflow, and no token wider than
`statuses: write` on its own repository.

**The prose contracts travel with the release.** `spec.md`, `engine.md` and
`engine-swift.md` are release artefacts since spec#87, listed in `SHA256SUMS` and
covered by the attestation this workflow already verifies. They were excluded
here on the ground that the release did not publish them; it does now, and an
engine that fetched only the data would keep a stale contract without noticing,
because nothing digests them.
@euskadi31
euskadi31 force-pushed the ci/spec-sync-verdict branch from 4274a93 to a25fa8d Compare August 24, 2026 21:44
@euskadi31

Copy link
Copy Markdown
Contributor Author

One more guard, made real rather than advisory.

GITHUB_TOKEN cannot read a branch's required checks — measured: actionlint
lists every permission scope a workflow may request and there is no
administration among them. So the first auto-merge condition was only a printed
note.

It is not the whole condition, but whether main is protected at all is readable
with the token already in hand: .protected is a field of the branch object.
Measured on this repository — main answers true, chore/rules-2026.08.25
answers false. The script now refuses to arm auto-merge when it answers false,
because that is precisely the case where auto-merge merges at once, green or red.
Which checks are required is still attempted and its refusal reported, not
treated as an answer.

@euskadi31
euskadi31 merged commit 3e4e731 into main Aug 24, 2026
3 checks passed
@euskadi31
euskadi31 deleted the ci/spec-sync-verdict branch August 24, 2026 21:54
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.

1 participant