Skip to content

feat(ci): structural drift gate for cascade list vs manifest (RFC #388 PR-3) - #2561

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/cascade-list-drift-gate
May 3, 2026
Merged

HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/cascade-list-drift-gate

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Closes the recurrence path of PR #2556. The data fix realigned 8→4 templates in publish-runtime.yml's TEMPLATES variable, but the underlying drift hazard was unguarded — the next manifest change could silently leave cascade out of sync again.

What it gates

Any PR that changes `manifest.json` or `publish-runtime.yml` in a way that makes the cascade list diverge from manifest `workspace_templates` (suffix-stripped). Either direction is caught:

Mode Bug class
Templates in manifest but missing from cascade The codex-stuck-on-stale-runtime class. PR #2512 added codex to manifest; cascade wasn't updated; codex stayed pinned to its last-built runtime version for weeks until PR #2556.
Templates in cascade but not in manifest Wasted-API-calls + dead-CI-noise class. PR #2536 pruned 5 templates from manifest; cascade kept dispatching to all 8 until PR #2556.

Implementation

`scripts/check-cascade-list-vs-manifest.sh` — bash, jq, single grep+sed+comm pipeline (~50 lines). Triggers narrowly: only on PRs that touch `manifest.json`, `publish-runtime.yml`, or the script itself.

Self-tested both failure modes locally before commit

Drop `codex` from cascade → script fails with `MISSING: codex`.
Add `langgraph` to cascade → script fails with `EXTRA: langgraph`.
Current staging cascade aligned with manifest → script passes (4 entries).

A subtle bug I caught while writing this

First draft used `\s*` in the sed pattern. macOS BSD sed doesn't recognize `\s` — treats it as literal `s` with `*` quantifier (matching empty-prefix-of-literal-s). The pattern "matched" but didn't strip the leading whitespace, so the captured group was ` TEMPLATES="claude-code hermes openclaw codex"`, which then split into garbage tokens.

Fixed to `[[:space:]]` which works on both BSD and GNU sed. Documented inline so the next person adding a similar script doesn't re-stumble.

Refs

  • RFC: #388
  • Source-of-truth alignment fix (companion): PR #2556
  • Strategic prune that started this drift class: PR #2536

Test plan

  • YAML validates
  • shellcheck passes (only style nits remaining: SC2001 sed-vs-bash-param-expansion, kept for clarity)
  • Both failure modes verified locally (missing codex, extra langgraph)
  • Current staging passes
  • CI green on this branch
  • After merge: any future drift surfaces immediately as a CI failure on the PR that introduced it

🤖 Generated with Claude Code

…PR-3)

Closes the recurrence path of PR #2556. The data fix realigned 8→4
templates in publish-runtime.yml's TEMPLATES variable, but the
underlying drift hazard was unguarded — the next manifest change
could silently leave cascade out of sync again.

This gate fails any PR that changes manifest.json or
publish-runtime.yml in a way that makes the cascade list diverge
from manifest workspace_templates (suffix-stripped). Either
direction is caught:

  missing-from-cascade  templates that won't auto-rebuild on a new
                       wheel publish (the codex-stuck-on-stale-runtime
                       bug class — PR #2512 added codex to manifest,
                       cascade wasn't updated, codex stayed pinned to
                       its last-built runtime version for weeks).

  extra-in-cascade     cascade dispatches to deprecated templates
                       (the wasted-API-calls + dead-CI-noise class —
                       PR #2536 pruned 5 templates from manifest;
                       cascade kept dispatching to all 8 until
                       PR #2556).

Triggers narrowly: only on PRs that touch manifest.json,
publish-runtime.yml, or the script itself. Fast (single grep+sed+comm
pipeline, no Go build).

Surfaced during the RFC #388 prior-art audit; folded in as the
structural follow-up to the data fix #2556 promised.

Self-tested both failure modes locally before commit:
  - Drop codex from cascade → script fails with "MISSING: codex"
  - Add langgraph to cascade → script fails with "EXTRA: langgraph"

Refs: https://github.com/Molecule-AI/molecule-controlplane/issues/388

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit added this pull request to the merge queue May 3, 2026
Merged via the queue into staging with commit 78721f7 May 3, 2026
23 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/cascade-list-drift-gate branch May 3, 2026 10:59
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
…-check job (hung-run bound)' (#2561) from fix/gate-check-v3-timeout into main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant