Repository navigation
feat(fork-gate)!: gate every first-party fork with the org ruleset, no copied caller - #322
Conversation
…o copied caller - org-ruleset.sh: a second org ruleset (B) from the SAME payload builder, scoped to discover_forks, ref ~DEFAULT_BRANCH, carrying the SAME workflows rule + strict required validate/validate + nf/del/creation + the App bypass. A fork's check is produced by the ORG required workflow; no per-fork pr-validator.yml is copied. - fork settings over discover_forks (allow_auto_merge, delete_branch_on_merge, allow_update_branch=false), set BEFORE the gate so a PASS can arm (#212). - apply refuses on a surviving fork copy, sweeps non-canonical repo branch rulesets (keeps tag-target ones, FATAL on an unclassifiable target), deletes B when no forks. - verify: one shared assertion set for A and B, plus the fork loop (default branch, no repo branch ruleset, tag caller, settings, legacy protection); archived forks named. - retire + reconcile gain SCOPE=forks; the tag caller is installed on a fork's DEFAULT branch (birth, untagged) and a SHA pin is bumped to the current .github main sha. - tag-on-merge: the CHANGELOG read/write use pr.base.ref; the dispatcher's push backstop covers main/master/stable. - new sync-forks.sh + workflow: App-token merge-upstream, never forced. - delete templates/fork-pr-validator.yml (R5); docs, governance claims and tests. Closes #179. Refs #212, #225, #317, #320. *Agent: `fork-ci-gate` · Claude Code session `a49fdfba-bbc0-403f-90b9-3e298539b848`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)*
Review — BLOCKHead SHA: Change class: hook/workflow + code/config (org policy shell scripts, workflow files, rulebook). Comment thread: empty (0 comments) — nothing to disposition; note this below. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
Maintainer sign-off: APPROVED for head This sign-off is posted at the operator's explicit direction (AskUserQuestion, this session, Assessment: the change strengthens the gate. It extends the org required workflow and the RCA (R1) — the missed control
Agent: |
Review — PASSHead SHA: Change class: hook/workflow + code/config (org-policy shell scripts, landing workflows, rulebook). Security screen: PASS — no new secrets (reuses existing Checklist: All applicable rules PASS or NA (T1–T4, A1–A3, R0–R11, PIL/ADE/SDD, CONC, HC, ARCH, DISP, QUAL, COORD). R9 (binary) NA — no binary/image. Comment dispositions
Non-blocking notes
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…ed forks (#1280) - DESIGN.md A.12: a first-party fork now carries the tag-on-merge caller, so it is tagged like any other landing repo. `not-applicable` describes a repository with NO caller — an un-onboarded fork, a vendored mirror, an archived repo, or a captured-output branch — not "a fork". Cites D-PLUG-3. - .agents/skills/repo-setup: the org model is TWO rulesets from one payload builder (A: non-fork `main`; B: forks on ~DEFAULT_BRANCH, the SAME required workflow), so NO per-fork pr-validator.yml is copied; the only per-fork file is the tag-on-merge caller; mirror sync uses the App-token sync-forks.yml; a new "Onboarding a fork" checklist; forks leave the exclusion list. - README.md org map: the vendored forks are gated and tagged at merge; sync via sync-forks.yml. The mechanism lands in opencharly/.github#322; this PR is the contract and the guidance that must be in place BEFORE any fork mints a tag. Refs opencharly/.github#320, #322. *Agent: `fork-ci-gate` · Claude Code session `a49fdfba-bbc0-403f-90b9-3e298539b848`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)*
Summary
Measured 2026-11-25 (issue #320): the org has 20 active forks, and the org-wide gate
covered none of them. This cutover gates every fork with the SAME org required workflow —
no
pr-validator.ymlcaller is copied into any fork.scripts/org-ruleset.shnow builds ruleset A (activenon-fork
main-default repos) and ruleset B (the active forks,~DEFAULT_BRANCH) fromONE payload builder. Both carry the
workflowsrule (the org required workflow), thestrict required
validate / validate,non_fast_forward/deletion/creation, and thecharly-auto-merge App bypass. A fork's check is produced by the org workflow.
allow_auto_merge,delete_branch_on_mergeandallow_update_branch=falseoverdiscover_forks, before the gate exists, so a PASScan arm (The required workflow should not render a PASS as a failed check when a repo disallows auto-merge #212: with auto-merge disabled an approved PR renders as a FAILED check).
applyrefuses while a fork still carries apr-validator.yml; it deletes every fork's non-canonical BRANCH repo ruleset(
crabbox PR gate, gst'smain branch protection, Qwen3-TTS's workflows-rule ruleset),KEEPS tag-target rulesets, FATALs on an unclassifiable target, and removes legacy
protection on the fork's DEFAULT branch (
stable/masterincluded).fork loop asserts the default branch, no repo branch ruleset, the tag caller, the
settings and legacy protection; archived forks are named, never silently skipped.
retire-per-repo-dispatchers.shandreconcile-tag-on-merge-callers.shgainSCOPE=forks. The canonical caller is installedon the fork's DEFAULT branch as a BIRTH (untagged — design-pintag's
pre-release-process), a copy that pins the reusable to a SHA is bumped to the CURRENT.githubmain sha, and the targets scope still never installs an absent caller.tag-on-merge.ymlhard-codedmainfor the CHANGELOGread/write, so a
stable/masterfork would mint a tag and write no CHANGELOG → nowpr.base.ref. The dispatcher'spushbackstop covered onlymain→ nowmain/master/stable.workflowsrule blocks a USER-tokengh repo sync(R1: a first-party fork repo never gets allow_auto_merge, so a PASS verdict cannot arm native auto-merge #179), so a newsync-forks.ymlfast-forwards with the App token (the ruleset's bypass actor). It neverforces: a conflict is reported and fails the run.
templates/fork-pr-validator.ymlis removed; no fork validatorcaller remains.
Files
scripts/lib-org.shdiscover_forks,discover_archived_forks,json_string_list,filter_fork_rowsscripts/org-ruleset.shscripts/org-ruleset_test.shscripts/retire-per-repo-dispatchers.shSCOPE=forks; writes the fork's default branchscripts/retire-per-repo-dispatchers_test.shstable; targets never touches a forkscripts/reconcile-tag-on-merge-callers.shSCOPE=forks; installs absent on the default branch (birth, untagged); SHA-pin bump; shared row filterscripts/reconcile-fork-callers_test.shscripts/sync-forks.shmerge-upstream, read-back, never forcedscripts/sync-forks_test.shscripts/tag-on-merge-assert_test.shpr.base.ref, no'main'hard-code, dispatcher covers main/master/stable.github/workflows/tag-on-merge.ymlpr.base.ref.github/workflows/tag-on-merge-dispatcher.ymlmain/master/stable.github/workflows/retire-per-repo-dispatchers.ymlscopeinput.github/workflows/reconcile-tag-on-merge-callers.ymlscopeinput + doc.github/workflows/sync-forks.yml.github/workflows/workflow-checks.ymlAGENTS.mdREADME.mdscripts/check-stalled-automerge.shscripts/governance-claims.tsvtemplates/fork-pr-validator.ymlHow tested
The change-class gate for this repo is the offline mock-
ghpolicy suite plus thegovernance reconciliation, run on the committed tree (no disposable bed exists in
.github; the LIVE apply is the operator-authorized rollout in #320, not a pre-merge step).The coverage fails without the change. The new
org-ruleset_test.shrun against theOLD
org-ruleset.sh(git show origin/main:scripts/org-ruleset.sh) fails:R5, claim-keyed grep (history excluded):
Live audit (issue #320): 20 active forks; 17 had no branch rules; 13 had
allow_auto_merge=false; 17 haddelete_branch_on_merge=false; 14 had no tag-on-mergecaller. Those numbers are the rollout's inputs and are re-measured by
scripts/org-ruleset.sh verifyafter the apply.Rulebook compliance
/charly-internals:repo-setupand/charly-internals:git-workflowloaded beforethe first action; the dotgithub
AGENTS.mdwas read before editing here.one anomaly (Qwen3-TTS) is diagnosed and filed.
EXTENDED with a scope, not duplicated;
filter_fork_rowslives once inlib-org.sh.templates/fork-pr-validator.ymldeleted; the grep above is the proof.origin/main; no force-push; the umbrella's uncommitted tree(another session's work) is untouched.
behavior; the emitted ruleset payloads are asserted by
jqat their boundary.ghis the offline test boundary for the policy scripts; no live serviceis faked. The live writes are the authorized rollout in Gate all 20 first-party forks: one org ruleset reusing the required workflow, plus tag-on-merge #320.
9a4176b;.githubhas nodisposable: truebed.release tag" state. The DESIGN amendment lands in the umbrella PR before any fork
mints a tag; this PR does not change tags yet.
Change classification
Breaking change + rollback: a fork no longer carries a per-fork
pr-validator.ymlcaller; its required
validate / validateis produced by the org required workflow throughorg ruleset B. Rollback: revert this commit (which restores
templates/fork-pr-validator.ymland the per-fork caller model) and run
scripts/org-ruleset.sh apply, which deletes rulesetB and re-applies the target-only rules. No tag is moved and no history is rewritten.
Filed issues
Testsis red on PR heads, so the fork gate cannot arm auto-merge.LintandSonarCloudare red on PR heads.CIis red on PR heads (defaultmaster).CodeQLred andCIcancelled on PR heads.tag (filed here because the owning repo has Issues disabled: HTTP 410).
Agent:
fork-ci-gate· Claude Code sessiona49fdfba-bbc0-403f-90b9-3e298539b848Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)