Skip to content

docs(spec): B4 resolved — the audit status context cannot match GitHub - #526

Merged
ProtocolWarden merged 1 commit into
mainfrom
docs/b4-resolved
Aug 19, 2026
Merged

docs(spec): B4 resolved — the audit status context cannot match GitHub#526
ProtocolWarden merged 1 commit into
mainfrom
docs/b4-resolved

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

The spec's last open item, resolved by actually running it. Forgejo Actions is live: runner 6.3.1 registered against the instance, probe workflow executed end to end (pulled node:20-bookworm, success in 91s).

B4's premise was wrong, and sharper than "inconvenient"

B4 said audit "must be reproduced under an identical context name, or every PR blocks forever". The identical name is not achievable.

GitHub uses the job id, so OC's required context is the bare string audit. Forgejo composes:

<workflow name:> / <run-name> (<event>)

…and with no run-name:, the middle segment is the commit message. The first probe produced:

audit.yml / ci: probe the status context name (push)

A required status check is a fixed string. A context carrying the commit message changes on every push — so the default configuration isn't mismatched, it's unsatisfiable in principle. No amount of renaming on the GitHub side fixes it.

run-name: audit pins it:

custodian-audit / audit (push)

Verified stable by re-running under a deliberately different commit message.

Second finding: both events fire on a PR head

custodian-audit / audit (pull_request)  -> success
custodian-audit / audit (push)          -> pending

The GitHub workflow triggers on both, so on Forgejo that does the work twice and leaves a second context outstanding for any gate requiring "nothing incomplete". Trigger on pull_request only.

Cutover configuration, now concrete

  • workflow: name: custodian-audit, run-name: audit, on: pull_request
  • branch protection status_check_contexts: custodian-audit / audit (pull_request)
  • apply_to_admins: true (the earlier live finding)

Any checklist saying "use the same name" is wrong.

Bonus: #517 validated against real data

The probe exercised ForgejoPRClient on actual Forgejo statuses rather than fixtures:

failed:     []
incomplete: ['custodian-audit / audit (push)']
completed:  ['custodian-audit / audit (pull_request)']

The endpoint returned a three-entry posting history (pending, pending, success) for one job, and the latest-per-context dedupe resolved it exactly as designed.

Also included

deploy/forgejo/README.md records the runner setup so it's reproducible — including why it joins the docker group rather than running as root, and that either way it grants control of the Docker daemon, which is root-equivalent on the host.

(The link checker reports 1 broken link in worktrees only — docs/backends/aider_local.md points at a sibling repo worktrees don't have; broken: 0 from a real checkout.)

🤖 Generated with Claude Code

Forgejo Actions is running on the live instance: runner 6.3.1 registered, probe
workflow executed end to end (pulled node:20-bookworm, success in 91s).

The spec's last open item said `audit` "must be reproduced under an identical
context name, or every PR blocks forever". Running it shows the identical name
is not achievable, and the reason is sharper than the inconvenience:

GitHub uses the job id, so OC's required context is the bare string `audit`.
Forgejo composes `<workflow name:> / <run-name> (<event>)` — and with no
`run-name:` the middle segment is THE COMMIT MESSAGE:

    audit.yml / ci: probe the status context name (push)

A required status check is a fixed string. A context carrying the commit
message changes on every push, so the default configuration is not "mismatched"
— it is unsatisfiable in principle. Setting `run-name: audit` pins it:

    custodian-audit / audit (push)

verified stable by re-running under a deliberately different commit message.

Second finding: `push` and `pull_request` each produce their own context on a
PR head, so the GitHub workflow's dual trigger does the work twice and leaves a
second context outstanding for any gate that requires nothing incomplete. The
Forgejo workflow should trigger on `pull_request` only.

Cutover configuration, now concrete: `run-name: audit`, `on: pull_request`,
branch protection requiring `custodian-audit / audit (pull_request)` and
`apply_to_admins: true`. Any checklist saying "use the same name" is wrong.

deploy/forgejo/README.md records the runner setup so it is reproducible,
including why it joins the docker group rather than running as root — and that
either way it grants control of the Docker daemon.

The probe also live-validated #517 against real status data rather than
fixtures: completed=['...(pull_request)'], incomplete=['...(push)'], resolved
from a three-entry posting history by the latest-per-context dedupe.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ProtocolWarden
ProtocolWarden merged commit 84a87f2 into main Aug 19, 2026
27 checks passed
@ProtocolWarden
ProtocolWarden deleted the docs/b4-resolved branch August 19, 2026 14:10
ProtocolWarden added a commit that referenced this pull request Aug 19, 2026
…inding (#527)

Two things, both from running Forgejo Actions rather than reasoning about it.

FIRST, A CORRECTION. #526 claimed `run-name:` pins the middle segment of
Forgejo's status context. That is wrong. A two-job workflow with
`run-name: probe` produces:

    multi / alpha (pull_request)
    multi / beta  (pull_request)

`probe` appears in neither. A job carrying `name: Pretty Job Name` produces
`naming / Pretty Job Name (pull_request)`. So the format is

    <workflow name:> / <job name:, or the job id> (<event>)

and it is STABLE BY DEFAULT — no `run-name:` required, and each job gets its
own context exactly as on GitHub, just prefixed. The commit-message form I
first observed appears only when a run fails before any job starts, where
Forgejo falls back to the file name and run title. I generalised a fallback
into a rule.

SECOND, THE PORT. Forgejo executes `.github/workflows/` as well as `.forgejo/`,
so pushing OC to the instance handed a single local runner the whole GitHub CI
suite — 27 tasks dispatched, most failing, the audit queued behind them. The
three workflows are now ported to `.forgejo/workflows/` with their jobs
byte-identical (verified by parsing both and comparing the `jobs` mappings) and
one deliberate change: `on:` is pull_request only, because a `push` trigger
produces a second, separate context on the same head.

The 13 contexts these produce are enumerated in the spec, and are what Forgejo
branch protection must require.

This change is ADDITIVE on purpose. Deleting `.github/workflows/` cannot merge
here: it removes the `audit` status branch protection requires, with
enforce_admins on, so that PR could never go green. The deletion lands on
Forgejo after the fleet cuts over.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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