Skip to content

feat(ci): run self-adapter gates on PRs (closes #25) - #42

Merged
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-25-ci-self-gates
Jul 3, 2026
Merged

feat(ci): run self-adapter gates on PRs (closes #25)#42
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-25-ci-self-gates

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Runs the self-adapter gates server-side on PRs to this repo, so .claude/** and docs/** changes are gated in CI (the root placeholder .claude/gates.json has empty gates → skip).

Changes

  • .github/workflows/gates.yml — adds a self-gates job (matrix [build, lint, test], checks named self / build|lint|test) that runs GATES_FILE=.claude/self/gates.json bash .claude/scripts/gate.sh <gate> on pull_request. The existing placeholder-adapter gates job is left intact.
  • .claude/self/checks.sh — replaces the node --check loop over .claude/workflows/*.js with a parse-only check (strip export/import, wrap in an async IIFE to legalize top-level await/return, compile with vm.Script). node --check treated the ESM/DSL feature-fanout.js as CommonJS and failed on export; node --input-type=module --check still failed on the top-level return. The new check still catches real syntax errors in both CJS and ESM/workflow files.

This also unblocks the previously-RED self lint/test gates on main (they choked on feature-fanout.js), so the new CI job is green on its own PR.

Gated locally via the self adapter (build/lint/test all exit 0) and reviewed through the correctness + tests lenses (both approve).

closes #25

robercano and others added 2 commits July 3, 2026 15:52
.claude/workflows/*.js mix ESM-only `export` syntax with top-level
`return`/`await`, so they're valid as neither plain CommonJS nor plain
ESM and `node --check` can't validate them. Strip the `export`
keywords, wrap the body in an async IIFE, and parse (not execute) it
with vm.Script so real syntax errors still surface without needing the
harness globals (agent, phase, log, ...) to be defined.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
The `gates` job reads the default, placeholder adapter (.claude/gates.json),
whose commands are empty for this repo and so every check skips green. That
leaves harness (.claude/**) and docs (docs/**) changes with no real
server-side gate. Add a second `self-gates` job that runs build/lint/test
through the self adapter (.claude/self/gates.json), whose checks are actually
implemented, without touching the existing placeholder job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
@robercano-ghbot
robercano-ghbot merged commit 54fbf81 into main Jul 3, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-25-ci-self-gates branch July 3, 2026 15:28
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.

Run the self-adapter gates in CI on PRs to this repo

2 participants