Skip to content

fix(ci-gate): shape every commit-status description inside post_status - #209

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/hopeful-edison-e7pfvj
Dec 1, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
claude/hopeful-edison-e7pfvj

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

GitHub's statuses API rejects a description with a character outside the BMP (HTTP 422 "Description doesn't accept 4-byte Unicode"). Seen at hyperpolymath/resource-algebra PR 51, commit fec1930, run 44214588445, triggered by a workflow named 🟡 CHECK: Groove Protocol Compliance: the gate posted CI/gate = failure.

That consumer pins 4e9e680b, whose "Mark a started or re-run workflow pending" step built re-run started: <run name> and whose publisher's clip() did not shape characters. Current main has already moved on: the early pending uses fixed text, and the publisher and tamper status replace non-BMP characters with ?. What was still missing is the guarantee at the single writer, so post_status itself did not shape its input.

Changes

  • scripts/ci-gate-api.sh: new status_description (non-BMP character -> ?, one for one; then at most 140 characters with an ellipsis; by characters in any locale, via jq). post_status shapes the text once, before the duplicate-skip compare and the POST, so the 1000-status skip compares what is actually written. If shaping fails, nothing is written and it returns 1 with an ::error::.
  • .github/workflows/ci-gate.yml: the embedded REST layer, regenerated byte for byte from the script (the existing test fails if they differ).
  • scripts/ci-gate-publish.sh: clip() delegates to status_description (one sanitiser).
  • tests/ci-gate-api.sh (already wired in code-hygiene-self-test.yml): cases for the emoji-led name, ASCII identity, BMP non-ASCII (é, ✓), LC_ALL=C, a 200-character cut (140, valid UTF-8), an emoji-only name (??), and the skip compare; plus a mutant for the shaping. The existing "standing status is not rewritten" mutant is re-aimed at the new line.

Departure from the brief, reported: non-BMP characters become ? (the estate's existing, tested convention in the publisher and tamper status) rather than being removed, so 🟡 CHECK: ... reads ? CHECK: ....

Verification

  • bash tests/ci-gate-api.sh: 140 passed, 0 failed (including mutants)
  • bash tests/ci-gate.sh: 830 passed, 0 failed
  • bash tests/ci-gate-tamper-guard.sh: 159 passed; bash tests/composite-shell-contract.sh: 28 passed
  • actionlint on ci-gate.yml: clean. shellcheck: only info/style notes and the pre-existing SC2034 in the changed files.

Consumers pin ci-gate.yml by SHA; they need an actions.lock bump after merge (not done here).


Generated by Claude Code

GitHub's statuses API refuses a description holding a character outside
the BMP (HTTP 422 "Description doesn't accept 4-byte Unicode"), e.g. a
workflow named "🟡 CHECK: Groove Protocol Compliance", and the gate then
posts CI/gate = failure with no verdict.

Main already clipped descriptions in the publisher and tamper status, and
the early pending uses fixed text; the older pinned gate built the early
pending from the run name. post_status itself did not shape its input, so
any writer that skipped the publisher's clip stayed exposed.

Add status_description to the REST layer (non-BMP -> '?', one for one,
then 140 characters with an ellipsis, by characters in any locale) and
have post_status shape the text once, before the duplicate-skip compare
and the POST, so the 1000-status skip compares what is written. The
publisher's clip now delegates to it. The workflow's embedded copy is
regenerated byte for byte from scripts/ci-gate-api.sh.

Tests: tests/ci-gate-api.sh gains cases (emoji name, ASCII identity, BMP
non-ASCII, C locale, 140 cut valid UTF-8, emoji-only, skip compare) and a
mutant for the shaping; the existing mutant is re-aimed at the new line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDijevnYHrThF6iwy7r
@gitnotebooks

gitnotebooks Bot commented Nov 30, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review December 1, 2026 01:21
Repository owner deleted a comment from coderabbitai Bot Dec 1, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 31884edf-ead3-4345-b8f2-b37b96526d12
Commits

Reviewing files that changed from the base of the PR and between d862173 and b07a39d.

Files selected for processing: 4

  • .github/workflows/ci-gate.yml
  • scripts/ci-gate-api.sh
  • scripts/ci-gate-publish.sh
  • tests/ci-gate-api.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Repository owner deleted a comment from chatgpt-codex-connector Bot Dec 1, 2026
@hyperpolymath
hyperpolymath enabled auto-merge (squash) December 1, 2026 01:21

Copy link
Copy Markdown
Owner Author

CI/gate-tamper-guard is failing by design: this PR edits gate files (.github/workflows/ci-gate.yml, scripts/ci-gate-api.sh, scripts/ci-gate-publish.sh), so the guard requires the owner to apply gate-change-approved after the newest commit (currently c6b2077). Agents must not apply that label, so this check is blocked on owner approval, not on a code fix.


Generated by Claude Code

@hyperpolymath
hyperpolymath merged commit 08e4b0c into main Dec 1, 2026
18 checks passed
@hyperpolymath
hyperpolymath deleted the claude/hopeful-edison-e7pfvj branch December 1, 2026 01:39
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

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.

2 participants