Files
molecule-ai-sdk/.gitea/workflows/dispatch-core-sdk-pin-bump.yml
T
hongming-ceo-delegated 581035a586
contracts-codegen-drift / env-contract-drift (pull_request) Successful in 22s
contracts-codegen-drift / go-parity (pull_request) Successful in 21s
contracts-codegen-drift / native-plugins-registry-conformance (pull_request) Successful in 23s
contracts-codegen-drift / adapter-registry-conformance (pull_request) Successful in 24s
contracts-codegen-drift / workspace-routes-manifest-conformance (pull_request) Successful in 24s
contracts-codegen-drift / schedule accepts both cron spellings (pull_request) Successful in 23s
contracts-codegen-drift / contract-conformance (pull_request) Successful in 25s
contracts-codegen-drift / plugin-state-conformance (pull_request) Successful in 25s
contracts-codegen-drift / validate (pull_request) Successful in 26s
Test / package-smoke (pull_request) Successful in 28s
contracts-codegen-drift / env-contract-conformance (pull_request) Successful in 25s
Test / skill-framework-cli (pull_request) Successful in 28s
contracts-codegen-drift / prompt-canonical-text-conformance (pull_request) Successful in 24s
contracts-codegen-drift / plugin-install-report-conformance (pull_request) Successful in 20s
contracts-codegen-drift / codegen-drift (pull_request) Successful in 27s
contracts-codegen-drift / branding-conformance (pull_request) Successful in 26s
contracts-codegen-drift / org-template declares something (pull_request) Successful in 26s
contracts-codegen-drift / platform-identity-gate-conformance (pull_request) Successful in 26s
contracts-codegen-drift / bindings-parity (pull_request) Successful in 27s
meta-ci-advisory / meta (advisory) (pull_request) Successful in 7s
llm-registry-ssot-drift / llm-registry-ssot-drift (pull_request) Successful in 9s
registry-ssot-drift / registry-ssot-drift (pull_request) Successful in 8s
contracts-codegen-drift / all-required (pull_request) Successful in 4s
llm-registry-ssot-drift / llm-registry-ssot-conformance (pull_request) Successful in 14s
registry-ssot-drift / registry-ssot-conformance (pull_request) Successful in 13s
Test / test (3.11) (pull_request) Successful in 51s
Test / test (3.12) (pull_request) Successful in 57s
Test / test (3.13) (pull_request) Successful in 1m1s
Test / all-required (pull_request) Successful in 2s
ci(pin): dispatch molecule-core's sdk-pin-bump when SDK main moves
molecule-core's sdk-pin-bump lane does the whole consumer-pin bump (go get,
regenerate registry_gen.go, move canonicalRegistrySHA256, test, open a PR) and
fails closed, but it is workflow_dispatch:-only and its header expects "a human,
or the SDK side on merge to main". Nothing on the SDK side ever dispatched it,
so every bump stayed hand-authored — five in a row, the last three minutes after
#210 merged and 3.5h after the lane was armed, and each touching only
go.mod/go.sum rather than the full regeneration the lane performs.

Add the missing producer:

* .gitea/workflows/dispatch-core-sdk-pin-bump.yml — push to main only (a
  secret-bearing workflow must not be runnable from an unprotected ref, same
  rule as notify-molecule-ci-schema-sync.yml), no paths filter (the pin names a
  COMMIT and core's drift detector counts lag against main head with no path
  awareness, so filtering would let a docs-only commit age into a BLOCKING
  STUCK verdict with no bump PR ever opened), bursts collapsed via
  cancel-in-progress because the receiving lane resolves SDK head itself.

* tools/dispatch_core_sdk_pin_bump.py — asks the dispatch endpoint for
  return_run_details and rejects a bare 204 or a response without a
  workflow_run_id, so a green run always carries a molecule-core run id and
  cannot mean "dispatched nothing". Missing credential exits 1 before any
  network call; no warn-and-skip.

Credential: repo-scoped Actions secret SDK_PIN_BUMP_DISPATCH_TOKEN on this repo,
a write:repository PAT on molecule-sdk-pin-bot whose entire write surface is
molecule-core. write:repository is empirically the minimum Gitea accepts here.
2026-08-06 01:01:43 -07:00

92 lines
4.8 KiB
YAML

# Trigger molecule-core's SDK consumer-pin bump whenever this repo's main moves.
#
# THE PIPELINE, AND THE LEG THAT WAS MISSING
# molecule-core carries the OPENER (`sdk-pin-bump.yml` — go get, regenerate
# internal/providers/gen/registry_gen.go, move canonicalRegistrySHA256, test,
# open a PR) and the DETECTOR (`sdk-pin-drift.yml`). The opener is
# `workflow_dispatch:`-only and its header says it is dispatched "by a human, or
# by the SDK side on merge to main" — but no workflow in this repository ever
# dispatched it. So the standing requirement that the SDK pin "always bump with
# our CI pipeline instead of manual" was only half met: the lane existed and
# nothing pulled the lever. Five consecutive bumps were hand-authored, the last
# of them three minutes after PR #210 merged and 3.5 hours after the lane was
# armed, and each hand bump moved only go.mod/go.sum — skipping the regeneration
# and the checkpoint move the lane performs. This file is that missing leg.
#
# NO PATHS FILTER — deliberately.
# The consumer pin is a Go pseudo-version, `v0.0.0-<ts>-<sha12>`: it names a
# COMMIT, not a subset of this repo's content. molecule-core's detector compares
# the pinned sha against this repo's main HEAD and measures lag from the oldest
# unadopted commit, with no path awareness at all. So a docs-only commit on main
# makes the pin lag by the detector's own definition. Path-filtering the
# dispatch would mean no bump PR is opened for such a commit, and 72h later the
# detector classifies the pin STUCK and goes BLOCKING on every molecule-core PR
# (its branch protection is contexts ["*"]). A filter here would manufacture
# exactly the red that the detector reserves for "a human must act". If the
# dispatch is ever narrowed, the detector's staleness definition must be
# narrowed in the same commit.
#
# BURSTS COLLAPSE, AND THAT IS SAFE.
# `cancel-in-progress: true` means a rapid series of merges results in one
# dispatch rather than N. That is safe because the receiving lane takes NO
# inputs — it resolves molecule-ai-sdk@main itself at run time — so whichever
# dispatch survives targets the true head. Redundant dispatches would also be
# harmless (the lane's ALREADY CURRENT / ALREADY PROPOSED exits are green
# no-ops), but collapsing avoids queueing several multi-minute go-get+generate
# runs behind molecule-core's own `concurrency: sdk-pin-bump,
# cancel-in-progress: false`.
#
# PUSH-TO-MAIN ONLY — no workflow_dispatch, no pull_request arm.
# Same rule as notify-molecule-ci-schema-sync.yml: Gitea executes the workflow
# definition from the ref it runs on, so giving a SECRET-BEARING workflow a
# manual or PR trigger would let an unprotected branch rewrite the code that
# receives the credential. main is protected; nothing else here is.
#
# IT FAILS CLOSED.
# With the credential absent the script exits 1 before any network call — it does
# not warn and continue. The receiving lane's original defect was precisely a
# green-skip on a missing credential (run 620174: green in 19s, bump done by hand
# four minutes later), and reintroducing that shape in the trigger would recreate
# the same invisible failure one repo upstream. A green run of this job also
# cannot mean "dispatched nothing": the script asks the dispatch endpoint for
# `return_run_details` and treats a response without a workflow_run_id as an
# error, so success always carries a molecule-core run id.
#
# CREDENTIAL: repo-scoped Actions secret SDK_PIN_BUMP_DISPATCH_TOKEN on this
# repository (not org-scoped — exactly one lane in one repo uses it). It is a
# Gitea PAT named `sdk-pin-bump-dispatch-from-sdk` owned by molecule-sdk-pin-bot,
# whose ENTIRE write surface is molecule-ai/molecule-core and which is absent
# from the reviewer set, so it cannot approve the PRs it causes to be opened.
# write:repository is the minimum Gitea grants for this endpoint — a
# read:repository token is rejected with "required=[write:repository]" — and PAT
# scopes are category-wide, so narrowing the identity is the only way to narrow
# the credential. Runbook: molecule-core docs/runbooks/sdk-pin-bump-credential.md.
name: Dispatch molecule-core sdk-pin-bump
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: dispatch-core-sdk-pin-bump
cancel-in-progress: true
jobs:
dispatch:
name: Dispatch molecule-core sdk-pin-bump
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Dispatch the consumer pin bump
env:
SDK_PIN_BUMP_DISPATCH_TOKEN: ${{ secrets.SDK_PIN_BUMP_DISPATCH_TOKEN }}
run: python3 -I tools/dispatch_core_sdk_pin_bump.py