|
| 1 | +# ghook Statusline Phase 1 |
| 2 | + |
| 3 | +## Scope |
| 4 | + |
| 5 | +This plan covers only the Rust-side `gobby-cli` work for Claude Code |
| 6 | +statusline handling. Gobby/Python installer migration, rollback bake, and |
| 7 | +eventual Python handler deletion are tracked outside this repository. |
| 8 | + |
| 9 | +## Implemented |
| 10 | + |
| 11 | +- `ghook --gobby-owned --cli=claude --type=statusline` is routed before the |
| 12 | + generic hook enqueue/POST flow. |
| 13 | +- The statusline path writes downstream stdout bytes directly and does not |
| 14 | + use the shared JSON hook emitter. |
| 15 | +- The handler extracts the Claude statusline usage payload and posts it to |
| 16 | + `/api/sessions/statusline` with best-effort failure semantics. |
| 17 | +- The crate version is bumped to `0.3.1` so the Gobby installer can probe for |
| 18 | + statusline-capable `ghook` binaries before switching statusline config. |
| 19 | + |
| 20 | +## Parity Contract |
| 21 | + |
| 22 | +Golden fixtures live in `crates/ghook/tests/fixtures/statusline/`: |
| 23 | + |
| 24 | +- `full-input.json` -> `full-payload.json` |
| 25 | +- `defaults-input.json` -> `defaults-payload.json` |
| 26 | + |
| 27 | +These fixtures capture the stable wire contract from Claude statusline stdin |
| 28 | +to the daemon payload. Missing or falsy `session_id` produces no daemon POST. |
| 29 | +Missing `cost`, `model`, or `context_window` fields use the same defaults as |
| 30 | +the legacy Python middleware. |
| 31 | + |
| 32 | +## Validation |
| 33 | + |
| 34 | +Required checks before release: |
| 35 | + |
| 36 | +- `cargo test -p gobby-hooks` |
| 37 | +- `cargo test -p gobby-hooks --no-default-features` |
| 38 | +- `cargo clippy -p gobby-hooks --all-targets -- -D warnings` |
| 39 | +- `cargo build --release -p gobby-hooks` |
| 40 | + |
| 41 | +Local install is intentionally out of scope. Do not copy the built artifact to |
| 42 | +`~/.gobby/bin/ghook` as part of this phase. |
0 commit comments