Skip to content

ci: run tests, plugin validation and a version-bump check on every PR - #259

Merged
Ardnived merged 7 commits into
mainfrom
claude/pr-checks
Nov 17, 2026
Merged

Ardnived merged 7 commits into
mainfrom
claude/pr-checks

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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 version bump (which never reaches an installed plugin) could all merge unnoticed.

  • .github/workflows/ci.yml (workflow name CI, job test, pull_request only, read-only token, no secrets, Node 22, actions pinned like the existing workflows):
    • JSON parse of every tracked *.json
    • node --test dispatcher/test/*.test.mjs — the one suite in no gate before
    • the lean gate itself, read from .claude/workflow.json and 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 login
    • fails when workflow/skills, workflow/hooks or workflow/lib change and version in workflow/.claude-plugin/plugin.json does not. :!*.test.mjs excludes the suites: they run from the checkout, never from an install
  • Tests (node:test, in workflow/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.noCi no longer lists claude-workflow. The entry is stale the moment ci.yml lands, and two effects outlive it — ciVerdict calls 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 the test check run, as in every other repo.
  • README: short Requirements section, plus one line on CI. CLAUDE.md no longer says there is no CI. docs/why.md no longer cites ci.noCi as a present fact.

No skill or hook changed, and the new tests are excluded, so no version bump is due.

Left out

  • start-run preflight: that skill is read on every dispatch (25 to 40 a day), a routine brings its own toolchain, and the README now states the requirements once.
  • railway is not a requirement: workflow/lib/railway.mjs only parses Railway URLs.
  • the dispatcher tests in 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 / test as a required check in the main ruleset if you want it to gate merges. The workflow is named CI on purpose: workflow-state.yml listens for that name, so a red run on a bot PR reaches fix-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

…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]>
@Ardnived
Ardnived marked this pull request as ready for review November 16, 2026 22:38
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 16, 2026
@sydevs-bot

sydevs-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:46Z address-review · attempt 1 · session · done
  • 22:46Z address-review · attempt 1 · session
  • 22:39Z review-pr · attempt 1 · session · done
  • 22:39Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 16, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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.noCi still 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 — the while subshell does propagate under pipefail.
  • Ladder: no new helper, file or dependency beyond the workflow and its tests; @v7 matches the pins in dispatcher.yml; workflow_run: workflows: [CI] in workflow-state.yml confirms the naming claim.
  • Read merge-gate.mjs ciVerdict and gather.mjs:299 for the noCi path, the four hooks against hooks.test.mjs, and the README requirement claims — pnpm exec in prettier-format.mjs, python3 in dev-server.sh, jq in 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

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 16, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor

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 loop-config.json change.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 16, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 16, 2026
@Ardnived
Ardnived merged commit 16cf037 into main Nov 17, 2026
55 of 61 checks passed
@Ardnived
Ardnived deleted the claude/pr-checks branch November 17, 2026 16:47
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants