feat(forgejo): make branch protection a real create-read-update converge #780
No reviewers
Labels
No labels
burndown-2026-06
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure!780
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/qa57-branch-protection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The converge only ever sent
{rule_name, enable_push}, so its diff covered those two fields and nothing else. A rule hand-edited to add a push allowlist, require approvals, or block on outdated branches showed no drift and reportedok.DESIRED_RULEnow declares every field the policy owns and drives each to that value. Scope is unchanged and already covers every active repo under the four owners, including the 14 carrying no rule at all today.Supporting fixes:
rule_nameis sent on create only.fail.Status checks are out of scope
This converge does not own
enable_status_checkorstatus_check_contexts.PR_REQUIRED_STATUS_CONTEXTS,PR_STATUS_CONTEXT_PREREQUISITES, and their accessors are removed, so whatever contexts a repo carries on the server are left exactly as they are, and setting a required PR context is a hand edit in the web UI.coilyco-flight-deck/agentic-osandcoilyco-flight-deck/wardkeep their existing contexts under that arrangement, now unmanaged.New
ward exec forgejo-branch-protection-testcovers the engine offline, 7 cases, no live calls. It asserts drift-detection behavior rather than restating the policy values, which stay owned byDESIRED_RULE.Docs corrected: both the skill and its reference doc claimed existing rules are "left untouched", which the code already contradicted, and the reference doc restated the rule's field values in prose. Also states plainly that this rule does not block pushes to
main, verified live during the fleet sweep.Not run against live Forgejo from this session: the apply needs the attended
ward exec forgejo-admin-tokenshell. Rundry_run=1first, the diff output is per-field.refs coilyco-flight-deck/agentic-os#994
The converge only ever sent {rule_name, enable_push}, so the diff it compared against the live rule covered those two fields and nothing else. A rule hand-edited in the web UI to add a push allowlist, require approvals, or block on outdated branches showed no drift and reported `ok`. Status contexts had the same gap in reverse: dropping a repo from the map left its stale contexts on the server forever. DESIRED_RULE now declares every field the policy owns and each is driven to that value, so drift is corrected rather than accepted. Scope is unchanged and already covers every active repo under the four owners, including the 14 currently carrying no rule at all. Three supporting fixes: * A field the running Forgejo does not report back is skipped and named in the output. Diffing an absent field would report drift on every run and never converge. * List fields compare order-insensitively, so context ordering is not drift. * rule_name is sent on create only. The edit endpoint takes the branch from the URL, and keeping it out of the desired state stops it being diffed against a response field that may be spelled branch_name. Every write is now re-read and re-compared. A repo that did not converge reports `fail` instead of a success it did not earn. Docs corrected while here. Both the skill and its reference doc said existing rules are "left untouched", which the code already contradicted, and the reference doc restated the rule's field values in prose. That duplication is gone: DESIRED_RULE is the owning source. Also states plainly that this rule does not block pushes to main, which was mistaken elsewhere. Verified live during the fleet sweep: ordinary pushes land on protected factorio-mods, inbox, and scoop-bucket. refs coilyco-flight-deck/agentic-os#994 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Kai Siren <coilysiren@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>