# Grok 1.0.62 project MCP and hooks T0, 2026-11-03

T0 receipt for #635, task #325. This probes the project-file TUI alternative to the [earlier ACP receipt](2026-10-21-grok-config-acp-t0.md). It does not establish launcher implementation, model-backed delivery, or native turn-end readiness.

## Result

| Leg | Result | Direct evidence |
| --- | --- | --- |
| Pinned native version | VERIFIED | `--version` exited 0: `grok 1.0.62 (1474f9cbdd91)` |
| Project MCP configuration discovery | VERIFIED | `mcp list --json` reported `receipt`, `scope: project`, from `.grok/config.toml` |
| Project MCP trust gate and connection | VERIFIED, synthetic server only | Untrusted doctor refused to start the server; after an isolated fixture trust grant, doctor initialized it and discovered one tool |
| `search_tool` / `use_tool` to a hub tool | UNVERIFIED | Both credential-free `--single` attempts exited 1 with `Not signed in`; no `tools/call` was recorded |
| Interactive trust prompt | UNVERIFIED | An untrusted PTY startup reached sign-in before any folder-trust prompt; authentication discovery could not proceed with network denied |
| Hook configuration load | VERIFIED | Trusted `inspect --json` listed seven configured project event handlers, including `stop`; untrusted inspect listed none |
| Hook firing and stdin payloads | UNVERIFIED | No credential-free model/session turn began, and the passive payload sink was never created |
| Real configuration preservation | VERIFIED for nine named files | Before/after SHA-256 or absence matched for every entry listed below |

Decision for the following launcher task: the pinned build recognizes a main-session `Stop` hook configuration, separately from `SubagentStop`. This is loader evidence, not evidence that a successful main turn fires it or that its payload is sufficient for hub facts/turn end. Keep the proposed peer pull-only unless a later isolated authenticated receipt proves main-turn completion and its payload. Do not infer hook absence from the account refusal, or turn-end support from configuration load alone. #635 stays open.

## Isolation and preparation

- Base checkout: `df230f2c89d0545c1a87cfd6bb8be57505a92c6c`. Branch: `test/635-grok-t0`; dedicated worktree `.worktrees/test-635-grok-t0`.
- Before native probes, dgx02 ran `bun install --frozen-lockfile` at that base and asserted the installed first-party dependency against `package.json`: `@staix/agent-mem@0.20.1`. No repository runtime or inherited local `node_modules` was used by the native probes; the MCP fixture used only system Python.
- The native executable was copied as one file from the installed Grok binary into a private OS-temporary root. Its SHA-256, before and after the probes, was `ec434e831afdcfce87780f2815fd732b1df8a4a8de96a491716ad75d13605a4e`.
- Separate empty directories were supplied as `HOME`, `GROK_HOME`, `XDG_CONFIG_HOME`, `XDG_CACHE_HOME`, `XDG_DATA_HOME` and `TMPDIR`. A new throwaway Git project held the project MCP/hooks files; a second sibling project was used for the untrusted TUI probe.
- The child environment was an explicit allowlist: those six directories, a scratch/system-only `PATH`, `SHELL=/bin/sh`, `TERM=xterm-256color`, `LANG=en_US.UTF-8`, `USER=probe`, `LOGNAME=probe` and `NO_COLOR=1`. No account variables, inherited agent markers or personal configuration were copied.
- Every Grok invocation ran through macOS `sandbox-exec`, denying network, reads/writes under the person's real home, writes under `/etc` and `/Library`, and access to the securityd Mach service. Before the TUI probe, execution of `/usr/bin/open` and `/usr/bin/osascript` was also denied. These are probe controls, not a product sandbox claim.
- Stateful commands explicitly passed `--no-leader --no-auto-update`. The subprocess harness bounded each command to 12 seconds, then signalled only its newly created process group. The PTY observation window was five seconds. No Grok process remained in the final fresh process-table read.
- The first PTY capture harness had an EOF-drain bug after its native child exited: the Python harness stayed alive reading EOF. Only that identified probe-owned harness was terminated; EOF handling was corrected before the second capture. No native completion or teardown result is inferred from the discarded first capture.

## Project MCP and trust

The project's `.grok/config.toml` contained this self-contained fixture (`$PROBE_ROOT` below means the absolute temporary root substituted before writing TOML):

```toml
[mcp_servers.receipt]
command = "/usr/bin/python3"
args = ["$PROBE_ROOT/tools/mcp.py"]
startup_timeout_sec = 3
[mcp_servers.receipt.env]
PROBE_LOG = "$PROBE_ROOT/evidence/mcp-events.jsonl"
```

The synthetic stdio MCP server answered `initialize` using the requested protocol version, declared a tools capability and `serverInfo` of `isolated-receipt-fixture` / `1.0.0`, and answered `tools/list` with one tool named `hub_inbox`. Its description and possible result explicitly said synthetic fixture. It was not a production hub, did not attach to this repository's running daemon and did not establish a real hub-tool result.

Observed command sequence after fixture creation:

```sh
grok --no-leader --no-auto-update inspect --json
grok --no-leader --no-auto-update mcp list --json
grok --no-leader --no-auto-update mcp doctor receipt --json
grok --no-leader --no-auto-update --trust inspect --json
grok --no-leader --no-auto-update mcp doctor receipt --json
```

Every command above used the copied binary, isolated environment and sandbox wrapper. Before trust, inspect reported `projectTrusted: false` and `hooks: []`; MCP list still enumerated the project definition. Untrusted doctor exited 1 and reported:

```text
folder untrusted
repo-local (project-scoped) server not started for an untrusted folder
re-run with --trust to allow repo-local servers
```

The explicit `--trust` was a controlled grant to this disposable fixture, not launcher behavior or a grant to a real project. It persisted only in the isolated `$GROK_HOME/trusted_folders.toml`:

```toml
[folders."$PROBE_ROOT/project"]
trusted = true
```

Afterward, trusted inspect reported `projectTrusted: true`. Doctor exited 0 with `command found`, `server started`, `handshake OK` (`protocol 2025-11-25`) and `1 tools discovered`; `healthy_count: 1`, `failing_count: 0`. The fixture recorded exactly:

```text
initialize
notifications/initialized
tools/list
```

Initialize's `clientInfo` was `grok-shell-receipt` / `1.0.62`. No `tools/call` occurred. A discovered tool is not proof of the model's meta-tool path.

## Model/tool and interactive prompt limits

Before and after the isolated trust grant, bounded single-turn commands requested the fixture hub tool. The trusted request was:

```sh
grok --no-leader --no-auto-update \
  --single 'Find receipt__hub_inbox with search_tool, call it with use_tool, and report its result.' \
  --max-turns 1 --disable-web-search --no-memory
```

Both attempts exited 1, without a model turn or hook payload, and reported:

```text
Not signed in. To authenticate without a browser, run:
  grok login --device-code
```

An initial syntax-only attempt incorrectly supplied `--single` without its required adjacent prompt value and exited 2; it is not a model/tool probe result. The corrected commands above are the evidence.

A separate untrusted project was launched under a PTY using `--no-leader --no-auto-update --no-alt-screen --minimal --no-memory`. It displayed sign-in and an authentication discovery failure for `https://auth.x.ai/.well-known/openid-configuration`, then exited 0. No folder-trust prompt was observed, no sibling trust entry appeared, no browser execution was permitted, and no hook payload was produced. Exit 0 here does not prove a successful session. No personal account, cached token, API key or real-home fallback was used; these legs stop at authentication.

The locally shipped MCP guide documents qualified `server__tool` catalog keys and `search_tool` / `use_tool`, so `receipt__hub_inbox` was the requested key. That documented route remains UNVERIFIED in a native model turn. To finish this leg, use an independently authorized account in a fresh isolated home and a disposable real hub, then capture the meta-tool dispatch and the actual hub result; do not reuse the person's home.

## Hooks and payloads

The fixture `.grok/hooks/receipt.json` registered command handlers for `SessionStart`, `UserPromptSubmit`, `Stop`, `StopFailure`, `StopCancelled`, `SessionEnd` and `SubagentStop`. Each handler used the same passive script, with a two-second hook timeout:

```sh
#!/bin/sh
/bin/cat >> "$PROBE_ROOT/evidence/hook-payloads.jsonl"
/bin/echo >> "$PROBE_ROOT/evidence/hook-payloads.jsonl"
```

The actual generated script contained the absolute sink path. It did not deny actions or invent events. Trusted inspect listed these native event names:

```text
session_start
user_prompt_submit
stop
stop_failure
stop_cancelled
subagent_stop
session_end
```

The sink remained absent, so there are no observed hook stdin payloads to publish. In particular, this receipt has no observed `sessionId`, `hookEventName`, `lastAssistantMessage`, stop/interrupt discriminator or main-session/subagent binding. The shipped hooks guide describes `Stop` for genuine main-turn completion, `StopFailure` for API failure, `StopCancelled` for non-completion and `SubagentStop` for subagents, and documents camelCase fields plus compatibility aliases. These are documented hypotheses for the authenticated follow-up, not captured payload facts. Merely registering `SubagentStop` cannot establish main-turn completion.

The local shipped guide bytes consulted were identified by SHA-256 (their documentation content does not substitute for native runtime evidence):

| Guide | SHA-256 |
| --- | --- |
| `07-mcp-servers.md` | `67558820ab3f0c49d56f87ce9d6927f2d6d179558f7a1e0466750a9771a43c3a` |
| `10-hooks.md` | `2a3a12201597fa6ab1885fa473096565a6c99fbfaf656627c65fa15653e14970` |
| `02-authentication.md` | `f16e7fe4cecc2836643d3474dbbc6c2b4a0ea12edf2b56b8a5a0a4ecb24efbec` |

## Real configuration hashes

Only the controller computed SHA-256/absence of these named real `~/.grok` files, without printing or copying their contents. Grok itself could not read that home. All nine entries matched after the final native probe. This is a bounded inventory, not a claim about every native configuration path.

| File | Before and after |
| --- | --- |
| `config.toml` | `cbafbea937a8ad50323aed808e68912706a063c7c88868a8fd9f58252bb68f22` |
| `version.json` | `182eeb64f0fe20c17ddea37071954ff25b1424f3b807fea13697754c803439f7` |
| `trusted_folders.toml` | `4e9eee9a1a037d109d59ed1d8112795f55381465cd219266b2f1777d4ec8b945` |
| `auth.json` | SHA-256 matched; credential-file digest omitted from the public receipt |
| `config.json`, `settings.json`, `mcp.json`, `managed_config.toml`, `requirements.toml` | Absent before and after |

## Repository validation

The final committed receipt is checked with `scripts/check.sh --changed` on dgx02; the PR and task submission record the exact head and gate result. Hosted CI is independent. No compatibility registry, launcher, generated bundle or native support claim is changed by this documentation-only T0.
