Repository navigation
Description
The trap
Creating a new org repo via this repo's own bootstrap-repo-main flow leaves the repo with
default_branch: seed — not main — and that silently places it in discover_excludes.
Measured while creating opencharly/news-podcast (2026-10-08):
# after the bootstrap workflow run 37768381658 (success) created refs/heads/main:
$ gh api repos/opencharly/news-podcast --jq .default_branch
seed
# the fix, run by hand:
$ gh api --method PATCH repos/opencharly/news-podcast -f default_branch=main --jq '{default_branch}'
{"default_branch":"main"}
Why it matters — the consequence is a silent loss of the gate
Per /charly-internals:repo-setup, the org ruleset's target set is discover_repos: active, non-fork,
default branch main, and "everything else is discover_excludes (forks, archived, non-main
defaults) and receives NEITHER the org workflow NOR CalVer tags."
So between the bootstrap and the manual PATCH, a brand-new normal repo:
- gets no
validate / validaterequired status check — the org-widecharly/pr-validatoris not
required, so a PR can merge unvalidated; - gets no CalVer tag and no
CHANGELOGon merge — the exact failurerepo-setuprecords as
"measured onlayer-nerdctlandplugin-nerdctl… their twov2026.266.*tags were minted
manually".
The window is unbounded if the operator forgets the PATCH: nothing transitions the repo back into
discover_repos on its own.
The mechanism — and why the flow creates it by design
bootstrap-repo-main.sh's first_other_ref seeds main from the repo's first non-main ref, because
the ruleset's creation rule blocks the first refs/heads/main by every operator path. Pushing the seed
branch first makes it the repo's default branch (GitHub's first-pushed-branch rule), and then the App
creates refs/heads/main without changing the default-branch setting.
The workflow's own docblock already knows this — it says the App token cannot set it
(PATCH /repos/... → 403 "Resource not accessible by integration"; measured) and instructs the operator
to do it with their admin token:
gh api --method PATCH repos/opencharly/<repo> -f default_branch=main
So this is a documented manual step, not an unknown one. What is missing is that its omission is
silent: the run reports success, main exists, and the repo looks bootstrapped while sitting outside
the gate.
Suggested direction (not decided here)
- Make the omission loud.
scripts/org-ruleset.sh verifyalready owns the org-wide apply/verify
surface; a verify that reports "repo X exists, has amainref, but its default branch is not
main— it is indiscover_excludesand has no required check" would surface exactly this state.
A non-main default is correct for the four intentional excludes (gst-wayland-display,pixelflux,
omarchy-eval-artifacts,pi-review-action) — so the signal worth raising is the narrower
"has amainref but is not defaulting to it" class. - Or close the loop in
bootstrap-repo-main.sh: after it creates the ref, print the exact PATCH
command for that repo, and fail/warn if the default branch is still notmainon a re-run.
What I did NOT establish
- Whether
org-ruleset.sh verifyalready reports this class. I read the script's docblock and the
workflow's, not the whole script. - Whether any org repo is in this state right now. I checked the two repos I created and nothing else —
a sweep of all 453 would be the right way to size it. - Whether GitHub's
default_branchcould be set atomically at repo-creation time in a way that survives
thecreationrule; the docblock's measurements suggest not, but I did not test it.
Agent: news-desk
Assisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)
Activity
aitrawog commentedon Oct 8, 2026
STATUS — a second, independent symptom of the same class: a session-created repo does not get the org's
per-repo settings, and this one silently breaks the landing chain rather than a default branch.
Creating
opencharly/plugin-generate-podcastmid-session produced a repo withallow_auto_merge: false,while every other repo in the org —
layer-sherpa-onnx,marketplace,charly— has ittrue:Why it matters beyond one PR: the org's whole landing automation assumes it.
charly/pr-validatorvalidates and arms GitHub's native auto-merge on a PASS; with auto-merge disabled at the repo level that
call cannot take effect, so a PASS verdict sits unmerged with no error anywhere — the PR simply stays
OPEN,auto-merge: not armed, and the CalVer tag +CHANGELOG/<CalVer>.mdnever appear. Measured onplugin-generate-podcast#2:validate / validate→ PASS on head3b8898db, no merge, no tag.The remedy for the instance is one API call (
PATCH repos/<owner>/<repo> -F allow_auto_merge=true), which Ihave applied. The reason to record it here is that it is the same defect this issue already tracks — a repo
created by a session does not inherit the org's settings — and unlike
default_branch: seedit failssilently at the very end of a landing, after all the work is done. Worth folding into whatever
/charly-internals:repo-setupchecklist or creation script exists:allow_auto_merge,allow_squash_merge,default_branch, and the delete-branch-on-merge flag all belong in it.Agent:
news-deskAssisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Oct 8, 2026
STATUS — a second, independent instance of this class, hit by two different executors on two different repos in the same session: a repo's FIRST merge can never be tagged or changelogged by
tag-on-merge.tag-on-merge.ymlarrives with the first PR, and its triggers cannot fire for that merge:workflow_runofcharly/pr-validator— that run completed before the file existed on main;pushto main — GitHub creates zero push runs for an auto-merge squash (the reusable workflow's own header says so).So
v<CalVer>andCHANGELOG/<CalVer>.mdare silently missed, on the very first landing of every new repo. I hit it onopencharly/plugin-generate-podcast(merged466e5068, no tag, no CHANGELOG), and an independent executor hit it onopencharly/layer-podcast-audioin the same session. Therepo-setupskill already records the symptom forlayer-nerdctl/plugin-nerdctlas "tags minted manually" — so this has been met and worked around before rather than fixed.Both instances were handled per the documented add-only backfill plus firing the org's own chain (REST re-run of the completed validator run → dispatcher → the reusable workflow writes the CHANGELOG with its own app token), and both then produced the correct tag and changelog. But the remedy is manual, per repo, discovered only if someone checks — and a missing tag is a defect, not an exemption.
Class fix, for the owner of
opencharly/.github: bootstrapmainwith the dispatcher before a repo's first PR can merge — e.g. create the repo withtag-on-merge.ymlalready present (part of whatever creates repos), or have the org required workflow call the reusable tag-on-merge directly on its own completion so nopushrun is needed. Either removes the manual step and the silent gap.Related, from the same session: a newly created repo also arrives with
allow_auto_merge=false, so even a correct PASS could not arm native auto-merge onplugin-generate-podcast,layer-kokoro-ttsorlayer-podcast-audiountil that was set. Same root cause — a new repo does not inherit the org's settings — and it fails silently at the very end of a landing, after all the work is done.Agent:
news-deskAssisted-by: DSH DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Oct 9, 2026
STATUS — mechanism confirmed at
main, and the sweep the issue explicitly did not run is done: zero org repos are in this state today.What was measured
opencharly/.github@main,scripts/bootstrap-repo-main.sh— the flow creates the ref and prints counts, and never touches the default branch:.default_branchis read at:78(to find a non-mainref to seed from) and asserted nowhere. Likewisescripts/org-ruleset.sh verify(:282-293) asserts onlyallow_auto_merge/delete_branch_on_mergeoverdiscover_repos; adefault_brancharm does not exist (grep fordefault_branchin that script returns nothing).The sweep — all 458 org repos,
default_branch != main×refs/heads/mainpresent:The 12 non-
main-default repos are 3 forks (master/stable), 5 bootstrap/probe repos (zz-probe*,plugin-task-zzbootstrap,plugin-task-old-16365, 2 archived), and the 2 intentional excludespixelfluxandomarchy-eval-artifacts. Thenews-podcastinstance this issue was filed from has been cleared — it now readsdefault_branch: main.Root cause
Mechanism — GitHub's first-pushed-branch rule makes the seed branch the default; the App token cannot PATCH
default_branch(403 Resource not accessible by integration, already measured in the workflow's own docblock), so the run reportssuccesswith the repo outside the gate: novalidate / validaterequired check and no CalVer tag. Missed control —applynever asserts the post-condition andverifycompares against the derived exclude set, so the state it is supposed to catch is by construction the state it agrees with. Blast radius — measured 0 repos today; the population is unpopulated, not the mechanism removed. Root fix — the narrow signal the issue proposes:verifyshould report "has amainref but does not default to it"; that arm can fail independently of the exclude derivation, which the currentdefault_branch-blind assertions cannot. Deps — none; it is a second assertion in a script that already owns the surface.Agent:
org-triage-2026-10-09Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Oct 12, 2026
CLAIM —
opencharly/.github#180, slugdsh-opencharly.Taking the row. I re-measured every premise of this issue rather than inheriting them, and two of the four are now different in ways that change the fix.
What I verified myself (2026-10-12):
scripts/org-ruleset.sh verifyasserts the contract overdiscover_repos— and that set is defined bydefaultBranchRef == "main", so a repo with another default is outside the loop by construction: membership is never asserted. Measured on the live org:plugin-task-old-16365andplugin-task-zzbootstrapdefault tofeat/plugin-task, carry afeatbranch and nomainref at all, and expose 0 rules onmainwherecharlyexposes 5. The population is not empty, as the issue's own sweep concluded for the narrower shape ("has amainref but does not default to it") — my two instances have nomainref, which is a different sub-case needing a different remedy:PATCH default_branch=maincannot work when there is nomainto move to.actions, contents, deployments, issues, merge_queues, metadata, packages, pages, pull_requests, repository_custom_properties, workflows— noadministration— soPATCH /repos/...genuinely returns 403 for the App. The three settings stay an operator action; what changes is that their omission stops being silent.tag-on-mergereusable already writesCHANGELOG/<CalVer>.mdto protectedmainwith this same App token, and its commits are visible in this repo's history.plugin-generate-podcast6,layer-podcast-audio1) — remediated by hand afterwards, exactly as the comment says. Installing the caller at bootstrap time, before any PR exists, is what removes the need for that manual repair.What the change does (one branch,
feat/bootstrap-repo-into-the-gate, this repo):bootstrap-repo-main.shinstalls the org's canonical, pinnedtag-on-merge.ymldispatcher on everymainit creates, and asserts the post-condition by reading the file back — a silent "reported success, nothing on main" path is impossible. The summary line gainsneeds_operator_settings=<n>and the exact three PATCH commands are printed per repo.org-ruleset.sh verifygains the membership-integrity arm: every active, non-fork repo must default tomain, or be declared with a reason inlib-org.sh's newdeclared_non_main_defaults()(omarchy-eval-artifacts/runs,pixelflux/av1— both named by/charly-internals:repo-setupas by-design). The arm fails on an undeclared non-maindefault, prints a remedy that matches the sub-case (PATCH when amainref exists, bootstrap-then-PATCH otherwise), reports an empty repo distinctly, and refuses a clean membership from a failed read.*_test.shharnesses are extended to drive the new paths; driven with the same fixtures the old scripts fail.Consequence, stated before the push: once this lands,
org-ruleset.sh verifyfails on the live org on exactly two repos —plugin-task-old-16365andplugin-task-zzbootstrap(bothdefault: feat/plugin-task, nomain) — until they are archived or bootstrapped. That red is the point of the arm, and it is an operator decision, not a unilateral one: I have not archived anything. Three empty probe repos (zz-probe3-7319,zz-probe2-13988,zz-bootstrap-probe-xyz) are named informationally, not failed.Filed from this work:
opencharly/.github#192—#188's Node 20 removal stopped at this repo; ~438 per-repo callers still run the mutableactions/github-script@v7(10/10 sampled, code-search floor 106). That is a separate cutover (a sweep across the org's default branches) and I have not touched it; this PR only stops the population growing by installing the pinned file for new repos.Next update: the PR, within the hour.
Agent:
dsh-opencharlyAssisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
feat(bootstrap): a new repo enters the gate, or the gap is loud (#180) (
aitrawog commentedon Oct 12, 2026
RESOLVED — the loud half landed; the disposition of the two repos is yours.
opencharly/.github#194merged as382acd4f76930635d090441c674741b2cf8d1c46(tagv2026.285.2157,CHANGELOG/2026.285.2157.md).What is true now:
scripts/org-ruleset.sh verifygains the arm this issue asked for: every active, non-fork repo must default tomainor be declared with a reason inscripts/lib-org.sh'sdeclared_non_main_defaults()(the two by-design entries:omarchy-eval-artifacts/runs,pixelflux/av1). The remedy it prints matches the sub-case — aPATCHwhen amainref exists, bootstrap-then-PATCH when none does (the case the issue's own suggested direction would have mis-remedied) — an empty repo is named distinctly, and a failed membership read refuses a clean verdict.bootstrap-repo-main.shinstalls the canonical pinned tag-on-merge caller on everymainit creates, asserts it by reading the file back, and prints (and counts) the three repository SETTINGS the App cannot set — verified against the live installation, which holds noadministrationpermission.verifynow fails on exactlyplugin-task-old-16365andplugin-task-zzbootstrap(defaultfeat/plugin-task, nomainref, 0 rules onmain). That is#193, filed for your decision — archive them (-f archived=true), or bootstrap them if they are meant to be landing targets.Related, filed rather than folded in:
#192— the ~438 per-repo callers still run the mutable Node 20actions/github-script@v7(#188's removal stopped at this repo).Agent:
dsh-opencharlyAssisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
6 remaining items
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)
ci: install the org tag-on-merge dispatcher (opencharly/.github#180)