Repository navigation
ci: run tests, plugin validation and a version-bump check on every PR - #259
Conversation
…every PR Nothing ran before a merge here, and a merge is the deploy to every consumer. dispatcher/test was in no gate at all, and the hooks and merge-gate/merge-verdict had no tests. - ci.yml: JSON parse of every tracked config, node --test over dispatcher and workflow/lib, claude plugin validate --strict (CLI pinned, no secrets), and a failure when workflow/skills or workflow/hooks change with an unchanged plugin.json version. - tests: stdin/exit-code contract for all four hooks, table-driven merge-gate and merge-verdict cases (placed in workflow/lib so the lean gate runs them). - README: Requirements section. A start-run preflight is left out on purpose: that skill is read on every dispatch and a routine brings its own toolchain. Co-Authored-By: Claude Fable 5.2 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The shape is right: one workflow, one job, no secrets, a read-only token, and the three things a merge here actually risks. The tests pay rent — 506 table-driven cases over the two scripts whose wrong answers are silent — and the diff is no larger than its own body claims. Nothing here is smuggled.
Two things the change makes stale rather than wrong, both one line each. ci.noCi still lists claude-workflow, so the dispatcher goes on treating this repo as having no CI. And the version-bump check watches workflow/skills and workflow/hooks, while workflow/lib ships in the plugin too.
Findings
- should-fix —
ci.noCistill calls this repo CI-less (ci.yml:12) - should-fix — the version check misses
workflow/lib(ci.yml:61) - consider — the gate is now defined twice, and already differs (ci.yml:45)
- consider — an
if:that can never be false (ci.yml:55)
What was checked
- Ran the PR's own steps from a detached worktree:
node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs→ 506 pass. The JSON loop parses all 8 tracked files, and exits 1 on a planted bad one — thewhilesubshell does propagate underpipefail. - Ladder: no new helper, file or dependency beyond the workflow and its tests;
@v7matches the pins in dispatcher.yml;workflow_run: workflows: [CI]in workflow-state.yml confirms the naming claim. - Read merge-gate.mjs
ciVerdictand gather.mjs:299 for thenoCipath, the four hooks against hooks.test.mjs, and the README requirement claims —pnpm execin prettier-format.mjs,python3in dev-server.sh,jqin 10 skills — all accurate. - No ticket and no preview: judged against the PR body.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The version-bump check watched workflow/skills and workflow/hooks only.
workflow/lib ships inside the plugin as well — skills run its scripts as
`${CLAUDE_PLUGIN_ROOT}/lib/<script>` (merge-verdict, comment-lint,
preview-auth) — so a lib change with an unchanged `version` never reaches
an installed plugin either, the failure this check exists to prevent.
`:!*.test.mjs` keeps the suites out: they run from the checkout, never
from an install, so this PR's own test files owe no bump.
Addresses #259 (comment)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r
`on: pull_request` is this workflow's only trigger, so `github.event_name == 'pull_request'` always holds. A condition that cannot be false reads as if another trigger existed. Addresses #259 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r
The plugin-validate and workflow/lib steps retyped `leanGate.command` from .claude/workflow.json, and the two had already drifted: CI also ran the dispatcher tests. A second copy of the gate is a copy that goes stale, and nothing would catch it — the by-hand gate and CI would simply check different things. CI now reads the command and runs it, so an edit to .claude/workflow.json reaches CI by itself. The dispatcher tests stay a step of their own: they belong in no gate today, and adding them to `leanGate.command` means writing a protected path, which needs an attended run. Addresses #259 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r
ci.yml lands in this merge, so the entry is stale the moment it does, and two effects outlive it. `ciVerdict` calls zero check runs green (merge-gate.mjs:140), which is exactly the conflicted-PR hole the guard below it closes — a conflicted PR schedules no runs. And a draft reads green the instant it opens. Both are now decided by the `test` check run, as in every other repo. A `pull_request` workflow runs from the merge commit, so a branch cut before this one still gets the check. The why.md line that cited `ci.noCi` as present fact is now the history it describes. Addresses #259 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r
The entry is gone, so the retired-reasons list cites a list this repo is no longer on. The reason it names is still true: there is no merge queue here. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r
|
Four critic threads, all adopted. The base merged clean and rode along with the work.
Lean gate green from the checkout and from a worktree; the full CI set is 509 passing. Security review of the branch diff: no findings. The body is rewritten whole from a fresh read — its backticks were backslash-escaped and rendered literally — and now covers the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
Failure prevented: no CI ran before a merge, and a merge here is the live deploy. A broken test, an invalid manifest, or a change to a file the plugin ships without a
versionbump (which never reaches an installed plugin) could all merge unnoticed..github/workflows/ci.yml(workflow nameCI, jobtest,pull_requestonly, read-only token, no secrets, Node 22, actions pinned like the existing workflows):*.jsonnode --test dispatcher/test/*.test.mjs— the one suite in no gate before.claude/workflow.jsonand run (claude plugin validate ./workflow --strict && node --test workflow/lib/*.test.mjs), so the gate has one definition and an edit there reaches CI by itself. The CLI is installed from npm, pinned to 2.1.311, and needs no loginworkflow/skills,workflow/hooksorworkflow/libchange andversioninworkflow/.claude-plugin/plugin.jsondoes not.:!*.test.mjsexcludes the suites: they run from the checkout, never from an installworkflow/lib/so the existing lean gate runs them):hooks.test.mjs(all four hooks; block-wrong-bash incl. the sibling-repo and non-repo session shapes),merge-gate.test.mjs,merge-verdict.test.mjs. No source file was changed.loop-config.json:ci.noCino longer listsclaude-workflow. The entry is stale the momentci.ymllands, and two effects outlive it —ciVerdictcalls zero check runs green (the conflicted-PR hole the guard below it closes), and a draft reads green the instant it opens. Both are now decided by thetestcheck run, as in every other repo.CLAUDE.mdno longer says there is no CI.docs/why.mdno longer citesci.noCias a present fact.No skill or hook changed, and the new tests are excluded, so no version bump is due.
Left out
workflow/lib/railway.mjsonly parses Railway URLs.leanGate.command: that means writing.claude/workflow.json, a protected path, which needs an attended run. They are a CI step of their own instead.Owner follow-up
Mark
CI / testas a required check in themainruleset if you want it to gate merges. The workflow is namedCIon purpose:workflow-state.ymllistens for that name, so a red run on a bot PR reachesfix-ci. Opened as a draft per the loop's rule; not merged and not armed for auto-merge (loopMayNotMerge).🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcS2igBboVrZ13w9r