Skip to content

Commit 635ff55

Browse files
authored
feat: Make Grok CLI a first-class citizen with full plugin + working governance hooks (#91)
* feat(grok): first-class Grok CLI integration with working governance hooks - Full plugin payload under .grok/plugins/strray-ai/ (hooks + .mcp.json) - PreToolUse hook that actually invokes applyDecisionMatrix (Dynamo Solar SSOT) - Real enforcement: bad code patterns → low resonance + REJECT from the matrix - strray-ai grok install CLI command with auto-trust support - Postinstall automatically seeds the plugin (project-level) - Comprehensive E2E (52 passes) validating the packaged artifact end-to-end - Parity with OpenCode/Hermes/OpenClaw integrations The hook now runs real governance decisions inside Grok CLI sessions. * fix(grok): resolve ESM __dirname paths, ESLint no-empty in hook, and add proper Vitest timeouts to Hermes bridge tests - Fixed path depth in installForGrokCLI for published packages - Added /* noop */ to satisfy no-empty lint rule in pre-tool-use hook - Properly increased both bridgeExec and Vitest test timeouts (previously only bridgeExec was updated, causing 30s Vitest timeouts) This commit is now focused only on Grok + related test stability fixes. * fix(tests): relax duration assertion for CI speed, lift Hermes bridge timeout to 180s * fix(inference): add 8s timeout to governance MCP call to prevent hang when server unavailable * fix(inference): add 8s timeout to orchestrator MCP call in invokeAgentInternal to prevent hang * test: fix state-manager-persistence test to inspect last write instead of calls[0] (per-key debounce change) * ci: gate heavy jobs behind labels + add CI Summary job - Gate test-pipeline, test-package, and security behind needs-pipeline / ci:full - Gate hermes-plugin.yml behind needs-hermes / ci:full - Add ci-summary job as single required status check (depends on quality, test-unit, enforcement) - This dramatically speeds up normal PR feedback while still allowing full runs when needed Part of Grok CLI first-class citizen PR cleanup * ci: clean up ci-health dependencies after job gating - ci-health now only depends on ci-summary (the required path) and docs-build - Prevents unnecessary coupling to conditionally-run jobs (test-pipeline, test-package, security) - Keeps ci-health as the operational monitor with if: always() Part of Grok CLI first-class citizen CI improvements.
1 parent 6712a80 commit 635ff55

10 files changed

Lines changed: 588 additions & 93 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ jobs:
101101
run: npm test
102102

103103
# ═══════════════════════════════════════════════════════
104-
# Pipeline Tests
104+
# Pipeline Tests (gated: schedule, needs-pipeline, or ci:full)
105105
# ═══════════════════════════════════════════════════════
106106
test-pipeline:
107107
name: Pipeline Tests
108108
runs-on: ubuntu-latest
109109
needs: test-unit
110+
if: |
111+
github.event_name == 'schedule' ||
112+
contains(github.event.pull_request.labels.*.name, 'needs-pipeline') ||
113+
contains(github.event.pull_request.labels.*.name, 'ci:full')
110114
steps:
111115
- name: Checkout
112116
uses: actions/checkout@v4
@@ -127,12 +131,16 @@ jobs:
127131
run: npm run test:pipelines
128132

129133
# ═══════════════════════════════════════════════════════
130-
# Consumer Package Test
134+
# Consumer Package Test (gated: schedule, needs-pipeline, or ci:full)
131135
# ═══════════════════════════════════════════════════════
132136
test-package:
133137
name: Package Installation
134138
runs-on: ubuntu-latest
135139
needs: test-pipeline
140+
if: |
141+
github.event_name == 'schedule' ||
142+
contains(github.event.pull_request.labels.*.name, 'needs-pipeline') ||
143+
contains(github.event.pull_request.labels.*.name, 'ci:full')
136144
steps:
137145
- name: Checkout
138146
uses: actions/checkout@v4
@@ -181,12 +189,16 @@ jobs:
181189
node node_modules/strray-ai/scripts/mjs/validate-mcp-connectivity.cjs || true
182190
183191
# ═══════════════════════════════════════════════════════
184-
# Security Audit
192+
# Security Audit (gated: schedule, needs-pipeline, or ci:full)
185193
# ═══════════════════════════════════════════════════════
186194
security:
187195
name: Security Audit
188196
runs-on: ubuntu-latest
189197
needs: test-package
198+
if: |
199+
github.event_name == 'schedule' ||
200+
contains(github.event.pull_request.labels.*.name, 'needs-pipeline') ||
201+
contains(github.event.pull_request.labels.*.name, 'ci:full')
190202
steps:
191203
- name: Checkout
192204
uses: actions/checkout@v4
@@ -245,7 +257,7 @@ jobs:
245257
ci-health:
246258
name: CI Health Monitor
247259
runs-on: ubuntu-latest
248-
needs: [quality, test-unit, test-pipeline, test-package, security, enforcement, docs-build]
260+
needs: [ci-summary, docs-build]
249261
if: always()
250262
steps:
251263
- name: Checkout
@@ -278,3 +290,26 @@ jobs:
278290
with:
279291
name: ci-health-report
280292
path: .opencode/logs/ci-cd-monitor-report.json
293+
294+
# ═══════════════════════════════════════════════════════
295+
# CI Summary Job (single required status check)
296+
# ═══════════════════════════════════════════════════════
297+
ci-summary:
298+
name: CI Summary
299+
runs-on: ubuntu-latest
300+
needs: [quality, test-unit, enforcement]
301+
if: always()
302+
steps:
303+
- name: Check required jobs status
304+
run: |
305+
echo "Quality: ${{ needs.quality.result }}"
306+
echo "Unit Tests: ${{ needs.test-unit.result }}"
307+
echo "Codex Enforcement: ${{ needs.enforcement.result }}"
308+
309+
if [ "${{ needs.quality.result }}" != "success" ] || \
310+
[ "${{ needs.test-unit.result }}" != "success" ] || \
311+
[ "${{ needs.enforcement.result }}" != "success" ]; then
312+
echo "❌ One or more required jobs failed"
313+
exit 1
314+
fi
315+
echo "✅ All required CI checks passed"

.github/workflows/hermes-plugin.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ on:
1111
- "src/integrations/hermes-agent/**"
1212
- "hooks/**"
1313
- "scripts/hooks/**"
14+
# Also allow manual triggering via PR label
15+
workflow_dispatch:
1416

1517
jobs:
1618
plugin-python-tests:
1719
name: Python Plugin Tests
1820
runs-on: ubuntu-latest
21+
if: |
22+
github.event_name == 'schedule' ||
23+
contains(github.event.pull_request.labels.*.name, 'needs-hermes') ||
24+
contains(github.event.pull_request.labels.*.name, 'ci:full')
1925
steps:
2026
- uses: actions/checkout@v4
2127

@@ -45,6 +51,10 @@ jobs:
4551
git-hook-scripts:
4652
name: Git Hook Scripts Validation
4753
runs-on: ubuntu-latest
54+
if: |
55+
github.event_name == 'schedule' ||
56+
contains(github.event.pull_request.labels.*.name, 'needs-hermes') ||
57+
contains(github.event.pull_request.labels.*.name, 'ci:full')
4858
steps:
4959
- uses: actions/checkout@v4
5060

@@ -98,6 +108,10 @@ jobs:
98108
name: Bridge Hooks Command
99109
runs-on: ubuntu-latest
100110
needs: plugin-python-tests
111+
if: |
112+
github.event_name == 'schedule' ||
113+
contains(github.event.pull_request.labels.*.name, 'needs-hermes') ||
114+
contains(github.event.pull_request.labels.*.name, 'ci:full')
101115
steps:
102116
- uses: actions/checkout@v4
103117

0 commit comments

Comments
 (0)