Skip to content

R1: a first-party fork repo never gets allow_auto_merge, so a PASS verdict cannot arm native auto-merge #179

Done

Description

@aitrawog

Summary

A first-party fork repo in the org never gets allow_auto_merge (or
delete_branch_on_merge), so on a charly/pr-validator PASS the validator cannot
arm GitHub native auto-merge and the PR sits mergeStateStatus: CLEAN but unmerged.
A human must merge it by hand.

Mechanism (measured 2026-10-08)

scripts/org-ruleset.sh apply sets those two settings per-repo — they have no
org-level default — by looping for repo in "${repos[@]}", where repos is the
discover_repos target set (lib-org.sh): active, non-fork, main-default.
Forks are excluded from the ruleset by design, so they are not in repos and the
settings loop never touches them.

$ gh api repos/opencharly/dsh-github     --jq '{allow_auto_merge,delete_branch_on_merge}'
{"allow_auto_merge":false,"delete_branch_on_merge":false}      # isFork=true
$ gh api repos/opencharly/pi-subagents   --jq '.allow_auto_merge'
false                                                          # isFork=true
$ gh api repos/opencharly/crabbox        --jq '.allow_auto_merge'
false                                                          # isFork=true
$ gh api repos/opencharly/pod-dsh        --jq '.allow_auto_merge'
true                                                           # isFork=false (target)

Why it now bites (it did not before)

opencharly/.github#177 (merged 2026-10-08, squash 220df6d2) corrected the required
workflow's predicate from head.repo.fork == false to
head.repo.full_name == github.repository, so a same-repo PR in a fork now runs the
validator
(previously the required check was skipped, and the PR could never merge at
all — a different, worse failure). With the check now produced, the remaining blocker is
the missing allow_auto_merge: the PASS has nothing to arm.

Measured on opencharly/dsh-github#6: the validator posted PASS, but
mergeStateStatus stayed CLEAN with autoMergeRequest: null because the repo setting
was off. Setting allow_auto_merge=true and re-running the validator armed the merge
(autoMergeRequest non-null), which then landed.

Interim action taken (disclosed)

allow_auto_merge=true was set on opencharly/dsh-github via the repo PATCH API so the
already-PASSed PR could arm native auto-merge — the sanctioned path (the validator arms
the merge; no agent self-merge). That is a local repo setting, not a durable org fix.

Proposed root fix

Extend the settings loop in scripts/org-ruleset.sh to cover the fork subset of the
exclude set (a fork with a main default that participates in the org PR flow), or —
if forks are deliberately meant to be un-armed — document that a fork repo must have
allow_auto_merge set at creation, and have apply assert it. The exact scope decision
(fix vs document) is the operator's.

Agent: dsh-tui-install · session ses_eefd1f32fffeNl8ajvmzJ0hGLk
Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (analysed on a live system)

Activity

  1. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    CLAIM

    CLAIM — I found and measured this while landing opencharly/dsh-github#6 (the first fork PR after #177). The interim unblock (allow_auto_merge=true on dsh-github) is done; the durable fix (extend the org-ruleset.sh settings loop to the fork subset, or document/assert it at repo creation) is a scope decision I have not taken unilaterally and will implement per your direction.

    Agent: dsh-tui-install · session ses_eefd1f32fffeNl8ajvmzJ0hGLk
    Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  2. self-assigned this
    on Oct 8, 2026
  3. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    Addendum — a design interaction worth deciding before the fix, measured.

    discover_excludes (lib-org.sh) filters isFork == true. So when the operator next runs scripts/org-ruleset.sh apply, dsh-github (a first-party fork with main) drops OUT of the ruleset's target scope entirely — no workflows rule, no required validate / validate. The required check then applies again to nobody, which is the original deadlock (opencharly/dsh-github#2) returning through the exclude door rather than the skip door.

    Measured today:

    $ gh api repos/opencharly/dsh-github/rules/branches/main --jq length
    5                       # currently targeted → the check is required
    # after apply: 0          # excluded (isFork==true) → the check is NOT required
    

    Also measured: dsh-github has no tag-on-merge.yml caller, so it has no CalVer tags (its only tags are the fork's own v0.7.x).

    So #177 fixed the predicate, but the scope is the remaining question: the org's design says first-party forks are un-managed repos, yet dsh-github is a real maintained plugin the org pins into pod-dsh. Two coherent postures:

    • (a) keep forks excluded — then a first-party fork is a plain repo: no org validator, no CalVer, and it must be merged by hand. That is a legitimate choice; it just has to be stated, and #177's predicate fix then only matters for the window before the next apply.
    • (b) bring maintained first-party forks INTO the target set — drop the isFork filter for org-owned forks (or add an explicit include-list), so they get the same validator + auto-merge + CalVer as any other repo. #177's predicate fix then makes same-repo PRs validate.

    This is the scope decision I flagged; I have not taken it. The interim allow_auto_merge=true I set on dsh-github is consistent with (b).

    Agent: dsh-tui-install · session ses_eefd1f32fffeNl8ajvmzJ0hGLk
    Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (analysed on a live system)

    Agent: dsh-tui-install · session ses_eefd1f32fffeNl8ajvmzJ0hGLk
    Assisted-by: OpenCode ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  4. aitrawog commented on Oct 9, 2026

    @aitrawog
    ContributorAuthor

    STATUS — mechanism re-confirmed at main, and the blast radius is now measured instead of asserted: 12 of 14 forks, all 14 on delete_branch_on_merge.

    What was measured

    opencharly/.github@main, scripts/org-ruleset.sh — both loops iterate the TARGET set only:

    :83   repos_out="$(discover_repos)"              # active, non-fork, default branch `main`
    :230  for repo in "${repos[@]}"; do             # apply: allow_auto_merge / delete_branch_on_merge
    :233    gh api --method PATCH "repos/$ORG/$repo" -f allow_auto_merge=true
    :282  for repo in "${repos[@]}"; do             # verify: same set
    :291    [[ "$auto" == "true" ]] || { echo "$repo: allow_auto_merge must be true" >&2; fail=1; }
    

    discover_excludes (:93) is read only to build the ruleset's exclude list — nothing iterates or asserts over it.

    Live census of the whole org (gh repo list opencharly --limit 500 → 458 repos, 14 forks), per-repo gh api repos/opencharly/<r>:

    openclaw-enterprise      auto=false  dbom=false   crabbox               auto=false  dbom=false
    dsh-github               auto=true   dbom=false   pi-subagents          auto=false  dbom=false
    dsh-workspace-enhancement auto=false dbom=false   pi-goal               auto=false  dbom=false
    dsh-git-worktree         auto=false  dbom=false   pi-mcp-adapter        auto=false  dbom=false
    gst-wayland-display      auto=true   dbom=false   pi-web-access         auto=false  dbom=false
    pi-claude-marketplace    auto=false  dbom=false   pi-simple-team        auto=false  dbom=false
    pi-ollama-cloud          auto=false  dbom=false   pi-memory             auto=false  dbom=false
    

    12 of 14 forks have allow_auto_merge=false; 14 of 14 have delete_branch_on_merge=false. The two trues are dsh-github (the hand-patch the issue discloses) and gst-wayland-display (a fork whose default branch is stable, so it is outside the PR flow anyway).

    Root cause

    Mechanism — allow_auto_merge/delete_branch_on_merge have no org-level default, so the script must set them per-repo; it sets and asserts them over discover_repos, which excludes forks by construction. A same-repo PR in a fork still runs the validator (#177 corrected the required workflow's predicate to head.repo.full_name == github.repository), so the PASS is produced and then has nothing to arm. Missed control — the provisioning loop and the assertion loop are the same set, so the setting is only ever asserted where it was just written; nothing asserts the post-condition over the repos the validator can now be triggered on. Blast radius — measured: 12 forks today, and it grows with every fork the org creates. Root fix — name the participating subset once and use it for both the settings loop and its assertion (a fork whose default participates in the org PR flow), or assert at fork-creation time; either way the loop and the assertion must not be the same derivation, or the assertion can never fail. Deps — needs the operator's fork-scope decision (does the org PR flow cover forks?) before the subset is named.

    Agent: org-triage-2026-10-09
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  5. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — a second, adjacent instance of the same scoping mechanism, measured today: a fork that is IN scope when the design says it must be OUT.

    opencharly/openclaw is a fork of openclaw/openclaw, created 2026-10-10T21:56:07Z — after the last org-ruleset.sh apply — so it never made it into the rendered exclude list. The consequence is not a missing auto-merge; it is a branch that cannot be advanced AT ALL:

    $ gh api repos/opencharly/openclaw/rules/branches/main --jq '[.[].type]|join(",")'
    workflows,required_status_checks,non_fast_forward,deletion,creation
    
    $ gh repo sync opencharly/openclaw --source openclaw/openclaw
    Required workflow 'charly/pr-validator, charly/pr-validator' is not satisfied
    Required status check "validate / validate" is expected.
    $ echo $?                                     # 1 — head unchanged (f3af0db8), the fast-forward did not happen
    
    $ gh api repos/opencharly/openclaw-enterprise/rules/branches/main --jq 'length'
    0                                             # created 2026-10-09T05:51:15Z → IS in the exclude list
    $ gh repo sync opencharly/openclaw-enterprise --source openclaw/openclaw-enterprise
    $ echo $?                                     # 0 — fast-forwarded to upstream main 3d180654

    Two siblings, one ruleset, opposite outcomes, and the only difference is which side of the last apply's timestamp their creation fell on. That makes the artifact measurable rather than speculative: gh repo list opencharly --limit 500 --json name,isFork,isArchived,defaultBranchRef against the rendered conditions.repository_name.exclude of ruleset 23827016 names every repo in this state.

    The reason it matters here beyond #179's auto-merge case: the ruleset's only bypass actor is the charly-auto-merge Integration (4675576, bypass_mode: always), so no plain push — agent or operator — can advance a fork's main. A vendored upstream fork whose whole purpose is to track its upstream therefore cannot be kept current while it is in scope. This is what blocks opencharly/opencharly#472 (registering the two OpenClaw forks as umbrella submodules), and it is not a defect in that PR.

    No scope taken here — this comment is evidence for your a/b decision, not a third posture.

    Agent: dsh-openclaw-upstream
    Assisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)

  6. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — at the operator's explicit direction this session (2026-10-13, Europe/Vienna) I am making the ONE-NAME surgical exclusion this issue's evidence calls for, and recording who directed it, because the org ruleset is security machinery (rulebook T1–T4).

    The direction, quoted from the operator's answer in the agent session that opened opencharly/opencharly#472:

    "I make the one-name exclusion at your direction"

    chosen over the three alternatives offered in that question — the operator applying it themselves, re-running scripts/org-ruleset.sh apply, or dropping openclaw from the cutover.

    The exact edit — openclaw added to conditions.repository_name.exclude of ruleset 23827016, nothing else:

    • exclude before: 25 names, sorted, openclaw absent
    • exclude after: 26 names, sorted, openclaw inserted between omarchy-eval-artifacts and openclaw-enterprise
    • name / target / enforcement / bypass_actors / the ref_name conditions / the five rules (workflows, required_status_checks, non_fast_forward, deletion, creation): unchanged, sent back verbatim from the GET.

    It is deliberately NOT the recompute. The staleness is wider than one name, measured live just now (460 repos; discover_excludes replayed by hand):

    live exclude (ruleset 23827016)      : 25
    computed non-targets (forks ∪ archived ∪ non-main-default): 29
    IN SCOPE BUT NON-TARGET              : clawsweeper, dsh-git-worktree, dsh-github,
                                           dsh-workspace-enhancement, openclaw
    rendered but no longer a non-target  : plugin-example-require-bootstraptmp

    Four of those five are the first-party-fork posture THIS issue is about (dsh-*), and clawsweeper is a fork in the same class. I am not deciding them by side effect; the edit narrows exactly one name.

    Why the edit is needed at all: opencharly/opencharly#472 registers the two OpenClaw upstream forks as umbrella submodules, and a pin must be the repo's own default-branch HEAD (README "Pinning"), so opencharly/openclaw has to be fast-forwarded to upstream first — which the required workflows rule blocks on every push while the fork is in scope (gh repo sync → Required workflow 'charly/pr-validator' is not satisfied, rc=1, head unchanged).

    Agent: dsh-openclaw-upstream
    Assisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)

  7. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the directed one-name exclusion is live; the remaining drift is measured and deliberately left to you.

    The edit landed on ruleset 23827016, read back from the API afterwards: repository_name.exclude 25 -> 26, the delta being exactly openclaw; name, target, enforcement, bypass_actors, the ref_name conditions and all five rules identical. Effect:

    $ gh api repos/opencharly/openclaw/rules/branches/main --jq 'length'
    0
    $ gh repo sync opencharly/openclaw --source openclaw/openclaw; echo $?
    0
    $ gh api 'repos/opencharly/openclaw/compare/opencharly:main...openclaw:main' --jq '.status, .ahead_by, .behind_by'
    identical
    0
    0

    What that bought, and what it did NOT: the umbrella registration of the two OpenClaw upstream forks (opencharly/opencharly#472) is unblocked and its PR opens next. The general drift is untouched — and it MOVES, two measurements minutes apart:

    first measurement:  460 repos, exclude 25, computed non-targets 29
                         in scope but non-target: clawsweeper, dsh-git-worktree, dsh-github,
                                                  dsh-workspace-enhancement, openclaw
    now:                462 repos, exclude 26, computed non-targets 31
                         in scope but non-target: clawsweeper, crabhelm, dsh-git-worktree,
                                                  dsh-github, dsh-workspace-enhancement, lobster
                         rendered but no longer a non-target: plugin-example-require-bootstraptmp
    

    So org-ruleset.sh's own verify exclude comparison still reports a mismatch, deliberately: four of the six remaining names are the first-party-fork posture (a)/(b) this issue leaves open with you, and closing those by side effect would be exactly the unilateral scope decision I declined to take. The recompute stays your action item; the one name I added is the minimum that lets a mirror fork be advanced at all.

    Agent: dsh-openclaw-upstream
    Assisted-by: DSH DeepSeek V4.1 Flash (fully tested and validated)

  8. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the instance measured on this thread is closed; the posture question this thread owns is not.

    opencharly/openclaw — the fork no push could advance while the ruleset targeted it — fast-forwarded (head 9354a2ca, identical to its upstream) the moment the single name openclaw entered ruleset 23827016's exclude set, and its umbrella registration landed: opencharly/opencharly#473, squash 5f45c82, merge-time tag v2026.286.1143, CHANGELOG 2026.286.1143.md. opencharly/opencharly#472 is closed with the same record.

    Still open HERE, for you: the recompute (org-ruleset.sh apply) and the first-party-fork posture. Measured after the landing, the in-scope-but-non-target set is unchanged at six names (clawsweeper, crabhelm, dsh-git-worktree, dsh-github, dsh-workspace-enhancement, lobster); my edit touched exactly one name and closed none of those, deliberately — deciding them by side effect is the scope I declined to take.

    No claim is taken on this thread's scope. This is the close-out of the BLOCKS I posted on #472.

    Agent: dsh-openclaw-upstream
    Assisted-by: DSH DeepSeek V4.1 Flash (fully tested and validated)

  9. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — a second directed one-name exclusion, same mechanism, recorded BEFORE the edit as before.

    Direction. Asked how to unblock opencharly/clawsweeper (a second fork created after the last org-ruleset.sh apply), the operator chose "Same surgical one-name exclusion" over both the general recompute and pinning a stale head. That is the same class of change as the openclaw exclusion earlier today, extended to a repo named in the same request ("do the same with ... clawsweeper ...").

    The exact edit — clawsweeper added to conditions.repository_name.exclude of ruleset 23827016, nothing else: 26 -> 27 names, sorted; name, target, enforcement, bypass_actors, the ref_name conditions and all five rules sent back verbatim from the GET.

    Still deliberately not the recompute. The in-scope non-target set changes by exactly this one name, so org-ruleset.sh's verify exclude comparison still reports a mismatch and the first-party-fork posture (dsh-git-worktree, dsh-github, dsh-workspace-enhancement) stays yours.

    Context: part of opencharly/opencharly#474 — registering four OpenClaw-org upstream forks (clawsweeper, crabbox, crabhelm, lobster) as umbrella submodules, the follow-up to #472.

    Agent: dsh-openclaw-forks
    Assisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)

  10. aitrawog commented on Oct 13, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the second instance is closed; the posture question this thread owns is still open.

    opencharly/clawsweeper — the second fork no push could advance while the ruleset targeted it — fast-forwarded (head 1fa8e7d2, identical to its upstream) the moment the single name clawsweeper entered ruleset 23827016's exclude set (26 -> 27), and its umbrella registration landed together with the other three OpenClaw-org forks (crabbox, crabhelm, lobster): opencharly/opencharly#475, squash f90eb4b, merge-time tag v2026.286.1304, CHANGELOG 2026.286.1304.md. opencharly/opencharly#474 is closed with the same record.

    Measured after this second edit:

    repos: 462 | rendered exclude: 27 | computed non-targets: 31
    in scope but non-target: crabhelm, dsh-git-worktree, dsh-github, dsh-workspace-enhancement, lobster
    rendered but now a target: plugin-example-require-bootstraptmp
    

    Two of those five are the remaining OpenClaw mirrors (crabhelm, lobster — both currently identical to their upstreams, so nothing is blocked today), and three are the first-party-fork posture (dsh-*) this thread leaves with you. The recompute (org-ruleset.sh apply) stays your action item, so verify's exclude comparison still reports the mismatch — deliberately, since narrowing it to the names that actually block a mirror while leaving the posture alone is the scope I was given.

    No claim on this thread's scope. This closes out the two instances I measured and edited under your direction.

    Agent: dsh-openclaw-forks
    Assisted-by: DSH DeepSeek V4.1 Flash (fully tested and validated)

  11. added
    category:governance
    type:fix
    on Nov 23, 2026
  12. added a commit that references this issue on Nov 25, 2026
    ab0cfbc
  13. aitrawog commented on Nov 25, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    STATUS — the durable fix merged in #322 (tag v2026.329.0923): org ruleset B covers every active fork, and org-ruleset.sh apply now sets allow_auto_merge / delete_branch_on_merge over discover_forks.

    The LIVE setting changes only when the rollout's apply runs (#320), so this issue closes then — not at the merge. The interim hand-patch on dsh-github is superseded by the script.

    Agent: fork-ci-gate · Claude Code session a49fdfba-bbc0-403f-90b9-3e298539b848
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

  14. aitrawog commented on Nov 25, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED

    RESOLVED — the durable fix is LIVE. #322 (tag v2026.329.0923) added org ruleset B and the fork settings loop; the rollout applied it on 2026-11-25: every active fork has allow_auto_merge=true and delete_branch_on_merge=true, and the verify fork loop reports no settings findings. The interim dsh-github hand-patch is superseded.

    Agent: fork-ci-gate · Claude Code session a49fdfba-bbc0-403f-90b9-3e298539b848
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:governancetype:fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions