From 70d8d6e2c47d3117aa6abea1d9f3301f5feef2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sun, 19 Jul 2026 07:12:31 -0400 Subject: [PATCH] docs: verify Grok Build hook contract --- AGENTS.md | 1 + integrations/README.md | 2 ++ integrations/catalog.json | 1 + test/integration-catalog.test.mjs | 13 +++++++++++++ 4 files changed, 17 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 0597270..0b297f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,7 @@ This repository publishes the open-source server, console, integration catalog, - Keep stable, legacy, and early-access contracts explicit, including their activation commands. - Select Kimi Code and legacy `kimi-cli` contracts from runtime evidence. An empty `KIMI_CODE_HOME` uses `~/.kimi-code`; create no cross-runtime migration marker. - Preserve Kimi TOML comments and unrelated formatting through range-based edits, then parse the complete rendered document before writing it. +- Write Grok Build integrations to a native user hook file under non-empty `GROK_HOME` or `~/.grok`; keep Claude Code and Cursor compatibility sources read-only. ## Mirror Workflow diff --git a/integrations/README.md b/integrations/README.md index 874c9cb..52a9930 100644 --- a/integrations/README.md +++ b/integrations/README.md @@ -4,6 +4,8 @@ The provider-level contract represents the default stable runtime. `contract_variants` records opt-in or transitional runtimes with their activation command and release channel. Kiro CLI uses this field for its v2 embedded hooks and v3 standalone hooks. +Grok Build adapters write native user hook files under `$GROK_HOME/hooks` or `~/.grok/hooks`. Project `.grok/hooks` files require `/hooks-trust` or `--trust`; Claude Code and Cursor hook files are read-only compatibility sources for Elydora. + `delivery_state` is computed from the `node`, `python`, and `go` adapter flags: | State | Meaning | diff --git a/integrations/catalog.json b/integrations/catalog.json index f401ee1..e6fd17b 100644 --- a/integrations/catalog.json +++ b/integrations/catalog.json @@ -240,6 +240,7 @@ "integration_mode": "command_hooks", "config_format": "json", "config_paths": [ + "$GROK_HOME/hooks/*.json", "~/.grok/hooks/*.json", ".grok/hooks/*.json" ], diff --git a/test/integration-catalog.test.mjs b/test/integration-catalog.test.mjs index ad14c9a..f0bfab4 100644 --- a/test/integration-catalog.test.mjs +++ b/test/integration-catalog.test.mjs @@ -219,6 +219,19 @@ test('high-drift providers retain their verified hook contracts', async () => { input: 'toolInput', session: 'sessionId', }); + assert.deepEqual(providers.get('grok').config_paths, [ + '$GROK_HOME/hooks/*.json', + '~/.grok/hooks/*.json', + '.grok/hooks/*.json', + ]); + assert.deepEqual(providers.get('grok').events, { + before_tool: 'PreToolUse', + after_tool: 'PostToolUse', + }); + assert.deepEqual(providers.get('grok').blocking, { + mechanism: 'exit_code_2', + failure_mode: 'fail_open', + }); assert.deepEqual(providers.get('kirocli').config_paths, [ '~/.kiro/agents/*.json', '.kiro/agents/*.json',