Skip to content

feat: Make Grok CLI a first-class citizen with full plugin + working governance hooks#91

Merged
htafolla merged 8 commits into
masterfrom
feat/grok-cli-mcp-integration
May 19, 2026
Merged

feat: Make Grok CLI a first-class citizen with full plugin + working governance hooks#91
htafolla merged 8 commits into
masterfrom
feat/grok-cli-mcp-integration

Conversation

@htafolla
Copy link
Copy Markdown
Owner

Summary

This PR makes Grok CLI a first-class citizen in StringRay, at the same depth as the existing OpenCode integration.

What’s Included

  • Full Grok plugin architecture

    • Plugin payload at .grok/plugins/strray-ai/ (hooks + .mcp.json)
    • PreToolUse + SessionStart hooks registered
  • Real governance enforcement in the hook

    • The pre-tool-use.js handler now robustly locates and calls applyDecisionMatrix from the Dynamo Solar SSOT core.
    • Bad code patterns produce low resonance + REJECT recommendations from the real decision matrix.
    • Clean operations get high resonance.
    • This is actual governance running inside Grok CLI sessions (not just logging).
  • Installation paths

    • npx strray-ai grok install (with --force and dry-run support + auto-trust)
    • Automatic seeding via postinstall (project-level .grok/plugins/strray-ai/)
    • Matches the OpenCode pattern exactly
  • MCP registration

    • .mcp.json registers strray-governance and strray-skills (including researcher)
  • Comprehensive E2E validation

    • 52 passing tests in test-grok-cli-e2e.mjs
    • Validates the packaged tarball end-to-end (the method the user specified)
    • Includes Phase 12 that proves the hook actually executes real Solar decisions on bad vs clean tool calls
    • Full parity with OpenCode, Hermes, and OpenClaw E2E suites

Architecture (ASCII overview printed by the E2E)

Grok CLI — First Class Citizen
├── .grok/plugins/strray-ai/
│   ├── hooks/hooks.json (PreToolUse → real hook)
│   └── .mcp.json (governance + skills)
├── dist/integrations/grok/hooks/pre-tool-use.js
│   └── calls applyDecisionMatrix (Solar SSOT)
└── dist/governance/ + dist/mcps/

Testing

  • All 11 internal pipelines pass
  • Grok consumer E2E (pack → install → test) is green
  • Hook enforcement is actually exercised and verified

This brings Grok CLI to the same level as OpenCode for using the full power of 0xRay (researcher + governance) natively.

…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.
@htafolla htafolla force-pushed the feat/grok-cli-mcp-integration branch from db8a25a to d1dc009 Compare May 18, 2026 19:27
…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.
@htafolla htafolla force-pushed the feat/grok-cli-mcp-integration branch from d1dc009 to 9cb6e5e Compare May 18, 2026 19:37
@htafolla htafolla force-pushed the feat/grok-cli-mcp-integration branch from 2b822f1 to d795492 Compare May 19, 2026 10:28
htafolla added 3 commits May 19, 2026 05:30
- 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-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.
@htafolla htafolla merged commit 635ff55 into master May 19, 2026
14 checks passed
@htafolla htafolla deleted the feat/grok-cli-mcp-integration branch May 19, 2026 11:18
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