Standardize CI / validate as canonical generated-repo validate-context in molecule-ci (inline validate job, sidestep Gitea-1.22 cross-repo uses:) #33
Reference in New Issue
Block a user
Delete Branch "feat/canonical-ci-validate-templates"
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?
Standardize
CI / validateas the canonical generated-repo validate-context (molecule-ci SSOT side)Durable-fix step 1 from
bp-drift-durable-fix.md. Follows the merged advisory BP-context drift-gate (#32). Advisory / foundational only — no consumer repo is touched, no branch protection is changed, no secret is set.What this PR adds
Three canonical consumer
ci.ymltemplates intemplates/, the files new generated repos inherit:templates/ci-org-template.ymlCI / validatetemplates/ci-plugin.ymlCI / validatetemplates/ci-workspace-template.ymlCI / validate(fork PRs → static-only)Each sets workflow
name: CI+ a job whose status display-name isvalidate, so the emitted commit-status context is exactlyCI / validateacross the fleet.(a) Canonical name decision:
CI / validateKeep
CI / validate(already on ~26 repos — minimizes churn). Fix the EMITTER side here in molecule-ci rather than renaming BP on ~26 repos. The cleanest emitter is a consumerci.ymlwithname: CI+ an inlinevalidate:job.Why inline, not
uses:— cross-repouses: molecule-ai/molecule-ci/.gitea/workflows/...@ref(workflow_call) is Gitea-1.22.6-fragile:[actions].DEFAULT_ACTIONS_URL=githubroutes the reusable-workflow fetch to github.com where themolecule-aiorg is suspended. The inline job anon-clones the public molecule-ci SSOT at CI time and runs the canonical validator directly — same single source of truth, no cross-repouses:dependency. (Note:uses:-form consumers today still emitCI / validatebecause the context is<consumer workflow name> / <consumer job key>=CI / validateregardless — but they're one DEFAULT_ACTIONS_URL hiccup away from a 404'd, non-emitting run; the inline form removes that fragility while keeping the identical context.) When the operator-host actions/* mirror lands (internal #109) the inline job can collapse back touses:WITHOUT changing the emitted context.The SSOT is cloned into
.molecule-ci(not.molecule-ci-canonical) so the canonicalcheck-secrets.py— whoseSKIP_DIRSprunes.molecule-ci— does not scan the cloned SSOT and self-flag.CI impact (molecule-ci's own)
No existing file changed; only
templates/added. Gitea Actions only runs.gitea/workflows/**and.github/workflows/**, sotemplates/*.ymlare inert data files and molecule-ci's CI (yaml-lint / python-lint / pytest / secrets-scan) is unaffected. All three templates were YAML-parse-validated and confirmed to emitname: CI/ jobvalidate.(b) Convergence checklist (follow-up — out of scope for THIS PR)
Audited via read-only
branch_protections/main+.gitea/workflows/ci.ymlacross all org-template / plugin / workspace-template repos. Each item below is a 1-PR-each follow-up to converge the consumerci.ymland/or owner-gated BP ontoCI / validate.Already converged (BP
CI / validate+ inline emit — no action): plugin-browser-automation, plugin-ecc, plugin-molecule-audit, plugin-molecule-audit-trail, plugin-molecule-careful-bash, plugin-molecule-compliance, plugin-molecule-dev, plugin-molecule-freeze-scope, plugin-molecule-hitl, plugin-molecule-prompt-watchdog, plugin-molecule-security-scan, plugin-molecule-session-context, plugin-molecule-skill-code-review, plugin-molecule-skill-cron-learnings, plugin-molecule-skill-cross-vendor-review, plugin-molecule-skill-llm-judge, plugin-molecule-skill-update-docs, plugin-molecule-workflow-retro, plugin-molecule-workflow-triage, plugin-superpowers.Emitter convergence (
uses:-form → inline this template; keepsCI / validate):molecule-ai-org-template-molecule-worker-gemini— ci.ymluses: validate-org-template.yml@mainmolecule-ai-org-template-reno-stars— ci.ymluses: validate-org-template.yml@mainmolecule-ai-plugin-molecule-skill-five-axis-review— ci.ymluses: validate-plugin.yml@mainmolecule-ai-workspace-template-crewai— ci.ymluses: validate-workspace-template.yml@mainmolecule-ai-workspace-template-deepagents— ci.ymluses: validate-workspace-template.yml@mainmolecule-ai-workspace-template-gemini-cli— ci.ymluses: validate-workspace-template.yml@mainBP required-context convergence (OWNER-LEVER — CTO, not this PR):
molecule-ai-org-template-molecule-production— LIVE PERMA-BLOCK, see (c)molecule-ai-org-template-molecule-dev— BP requires BOTHCI / Org template validation+CI / validate(emits both). Drop the legacyCI / Org template validationonce converged → require onlyCI / validate.molecule-ai-org-template-ux-ab-lab— BPenable_status_check=truebutstatus_check_contexts=[](no required context — gate is inert). Set toCI / validateafter its ci.yml emits it.molecule-ai-org-template-mock-bigorg— BPenable_status_check=false, ctxs=[]; no.gitea/workflows/ci.yml. Add ci.yml fromtemplates/ci-org-template.yml+ enable BPCI / validate.molecule-ai-org-template-gemini-growth-team— NO BP, no ci.yml. Add ci.yml + BP.molecule-ai-plugin-coding-discipline— BPenable_status_check=false(gate off though ci.yml emitsCI / validate). Enable + requireCI / validate.molecule-ai-workspace-template-claude-code— BP requiresTemplate validation (static)/(runtime)+Adapter unit tests+Secret scan / ..., NOTCI / validate. AddCI / validateto BP (it already emits it) or converge to the singlevalidatejob.molecule-ai-workspace-template-hermes— BP requiresCI / Shell unit tests+ Template validation static/runtime +CI / validate. Already includesCI / validate; consider consolidating the extras.molecule-ai-workspace-template-langgraph— BPCI / validate+Secret scan / ...(OK; secret-scan is a legit repo extra).molecule-ai-workspace-template-openclaw— BPCI / validate+Secret scan / secret-scan(OK).molecule-ai-workspace-template-autogen— BPCI / validate(OK; ci.yml also emits an unusedCI / all-required).Gate gaps (NO branch protection at all — add BP after emitter converges):
molecule-ai-workspace-template-google-adk— NO BP (emitsCI / validate).molecule-ai-workspace-template-seo-agent— NO BP, no ci.yml.(Legit non-
validatecustom contexts, NOT drift — leave as-is:molecule-ai-plugin-gh-identityrequiresCI / Go build + test + vet+CI / Shellcheck + wrapper tests.)(c) ⚠️ LIVE BP PERMA-BLOCK — needs CTO BP action (owner-lever)
molecule-ai-org-template-molecule-productionbranch protection onmainrequires:CI / all-required (pull_request)— NO workflow emits this (its ci.yml has a singlevalidate:job namedOrg template validation→ emits onlyCI / Org template validation). An unemitted required context is treated as perma-pending, so the Gitea merge endpoint returns HTTP 405 "try again later" forever. Any PR to this repo is currently un-mergeable.approval-gate / dual-pool (pull_request)Recommended BP change (CTO, owner-lever — I did NOT make it): change the required context from
CI / all-required (pull_request)→CI / Org template validation (pull_request)(what it emits today), unblocking the repo immediately. Then as a follow-up converge its ci.ymlvalidate:job-name tovalidate(pertemplates/ci-org-template.yml) and flip BP to the canonicalCI / validate (pull_request).(d) Gate promotion path
After the emitter-convergence items above land and a clean advisory window passes, the merged
bp-context-drift-gate(#32) can be promoted advisory → required (continue-on-error: false+ addbp-context-drift-gateto BP), which requires theDRIFT_BOT_TOKENorg secret (already set) — both owner-levers, separate follow-up PRs.Reviewer
@agent-reviewer-cr2 please review (1-approval SOP)
🤖 Generated with Claude Code
Add templates/ci-{org-template,plugin,workspace-template}.yml as the canonical ci.yml that new generated repos inherit. Each sets workflow name: CI + a job whose status display-name is validate, so the emitted commit-status context is exactly CI / validate fleet-wide. This lets a single canonical branch-protection required context (CI / validate (pull_request)) work across every template/plugin repo and lets the bp-context-drift-gate (advisory, merged #32) later go hard. The validate job INLINES the canonical validator: it anon-clones the public molecule-ci SSOT at CI time and runs the validator script directly, instead of cross-repo uses: molecule-ai/molecule-ci/... which is Gitea-1.22.6-fragile (DEFAULT_ACTIONS_URL=github routes the reusable-workflow fetch to the suspended github.com org). Same SSOT (validator lives in molecule-ci, fetched fresh per run), no cross-repo uses: dependency. When the operator-host actions/* mirror lands the inline job can collapse back to uses: without changing the emitted CI / validate context. SSOT cloned into .molecule-ci (not .molecule-ci-canonical) so the canonical check-secrets.py SKIP_DIRS prunes it and does not self-flag. No consumer repo touched and no existing molecule-ci workflow changed, so molecule-ci CI (yaml-lint/python-lint/pytest/secrets-scan) is unaffected. Design: bp-drift-durable-fix.md step 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>@agent-reviewer-cr2 please review (1-approval SOP). Foundational/advisory only: adds templates/ci-{org-template,plugin,workspace-template}.yml emitting CI / validate; no consumer repo, branch protection, or secret touched. Convergence checklist + the org-template-molecule-production live BP perma-block (CTO owner-lever) are in the PR description.
Requesting changes on the workspace-template CI template path.
The org/plugin templates clone molecule-ci into
.molecule-ciand then run validators from.molecule-ci/.molecule-ci/scripts/..., which matches the cloned repo layout. Buttemplates/ci-workspace-template.ymlruns both workspace validator steps as.molecule-ci/scripts/validate-workspace-template.py. That path skips the cloned repo's.molecule-ci/directory and will not find the SSOT script aftergit clone ... .molecule-ci.This means new workspace-template repos inheriting this template would emit the canonical
CI / validatejob, but the job would fail at the validator step instead of providing the intended static/full validation. Please change both workspace-template validator invocations to.molecule-ci/.molecule-ci/scripts/validate-workspace-template.pyto match the clone layout and the org/plugin templates.Approved on head
36daaf28d1.Re-review confirms the prior blocker is fixed: both workspace-template validator invocations now use the cloned molecule-ci layout at
.molecule-ci/.molecule-ci/scripts/validate-workspace-template.py, matching the org/plugin templates. The three templates consistently emitCI / validate, keep permissions to contents:read, pin checkout/setup-python actions, avoid cross-repo workflow_call fragility, and preserve fork-PR static-only behavior for workspace-template validation.5-axis pass: correctness and robustness look sound for new generated repos, security posture is appropriate for untrusted fork PRs and secret scanning, performance impact is bounded to normal validation jobs, and the templates are readable. CI is green and the PR is mergeable.