Skip to content

ci(town-crier): auto-resolve bus thread on 2-approval consensus#136

Merged
jasperboerhof merged 2 commits into
mainfrom
ci/crier-2approval-consensus
Jun 24, 2026
Merged

ci(town-crier): auto-resolve bus thread on 2-approval consensus#136
jasperboerhof merged 2 commits into
mainfrom
ci/crier-2approval-consensus

Conversation

@jasperboerhof

Copy link
Copy Markdown
Contributor

Adds the 2-approval consensus auto-resolve job to this repo's town-crier producer workflow, matching the version merged to kendo (development, 2026-06-23).

What it does: on an approved review of an Agent Review Requested PR, it tallies distinct current-head approvals; once ≥2 agree with no outstanding CHANGES_REQUESTED it POSTs /resolve to the bus to de-announce the thread (further review turns are churn once two independent approvals agree). Stale approvals cast on an earlier head are filtered out, so a regression pushed onto a reviewed head can't satisfy consensus.

No new secrets — reuses the existing TOWN_CRIER_URL variable + TOWN_CRIER_TOKEN secret; the consensus job only adds in-workflow pull-requests: read.

The announce-pr.yml is byte-identical to kendo's deployed version (sha256 eb9ccfe3…).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jasperboerhof jasperboerhof requested a review from a team as a code owner June 24, 2026 06:53
@jasperboerhof jasperboerhof added the Agent Review Requested Requesting review of specialized AI review agents. label Jun 24, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying fs-packages with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1b8862e
Status: ✅  Deploy successful!
Preview URL: https://8118d123.fs-packages.pages.dev
Branch Preview URL: https://ci-crier-2approval-consensus.fs-packages.pages.dev

View logs

@jasperboerhof

Copy link
Copy Markdown
Contributor Author

Town Crier Review · 8/10 · PASS · 🔎 Independent · ⛔ CI red

fs-packages #136 · AC anchor: PR description (config-only; no board) · head 8c2015be14 · via the town-crier bus (request #154)

Warning

CI is red — check.
Config-only PR adding a consensus job to fs-packages' town-crier producer workflow; I simulated the new approval-tally jq across the load-bearing paths (two distinct current-head approvals, stale-approval exclusion via commit_id==$head, outstanding CHANGES_REQUESTED blocking, single-reviewer dedup, empty-input) and it is correct, with a proper fail-open + loud-on-missing-provisioning posture and job-scoped pull-requests: read. The red check CI is a pre-existing npm audit --audit-level=high failure on the moderate js-yaml/@changesets dev-chain advisory — unrelated to this diff (it touches one workflow YAML, no JS/deps), so this PR does not own it.

No findings — clean against the review checklist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@Goosterhof Goosterhof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approve-worthy

0 blockers · 1 concern · 1 nit · 1 praise · 0 inline
Round 1. Bus thread: confirming @Jasper's independent PASS (8/10, no findings) — I reach the same verdict by re-walking the tally jq, with one body-claim correction below.
CI: all required checks green (check now passes — @Jasper's bus note flagged it red on a pre-existing npm audit failure; that has since cleared).

Config-only PR adding a consensus job to this repo's announce-pr.yml producer workflow: a pull_request_review of state approved on an Agent Review Requested PR tallies distinct current-head approvals and POSTs /resolve once ≥2 agree with no outstanding CHANGES_REQUESTED. The tally logic is sound — group_by(.user.login) | map(max_by(.submitted_at)) correctly takes the latest opinionated review per reviewer, the .commit_id == $head filter on approvals is the load-bearing stale-approval guard, and the failure posture is right (missing provisioning fails loud; an unreadable review list / bus hiccup degrades to ::warning:: and stays green). I confirm @Jasper's simulated paths.

Cross-file findings

Concern — the PR body's "byte-identical to kendo's deployed version (sha256 eb9ccfe3…)" claim does not hold. The kendo development file hashes eb9ccfe3b280… as claimed, but this PR's file at 1b8862e0 hashes 0a934d8c1adf…. diff of the two shows the divergence is purely indentation — kendo uses 2-space YAML indent, this file uses 4-space — across the on:, announce, resolve, and consensus blocks. The jobs, if guards, env, and run-scripts are otherwise character-for-character equal. So the workflows are functionally identical but not byte-identical, and the sha256 in the body is the kendo file's hash, not this file's. Not a defect in the workflow; the PR description just overstates the equality. Either soften the claim to "functionally identical (4-space-indented to match this repo's workflow style)" or, if true byte-parity across the fleet is the goal, normalize indentation — but that's a fleet-wide decision, not this PR's.

Nit — changes is counted regardless of commit_id. The approved tally filters to .commit_id == $head, but the changes tally selects every latest-per-reviewer CHANGES_REQUESTED with no head filter. This is the conservative direction (a stale CHANGES_REQUESTED still blocks consensus-resolve, never falsely resolves), so it is safe and arguably correct — leaving it unfiltered means a regression-then-reapproved cycle can't slip through on a stale objection. Flagging only for symmetry-awareness, not as a change ask.

Praise — the --paginate --jq '.[]' | jq -s slurp pattern with the inline comment citing why (avoids gh api --slurp, newer-gh only) is a real portability call against a runner-version assumption, not a standard move.

Automated war-room agent review — posted because this PR carries the Agent Review Requested label.

@jasperboerhof jasperboerhof merged commit 8ec555e into main Jun 24, 2026
8 checks passed
@jasperboerhof jasperboerhof deleted the ci/crier-2approval-consensus branch June 24, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Agent Review Requested Requesting review of specialized AI review agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants