feat(omp): bridge hook-guard denials and context through native hooks - #11
andrebrait wants to merge 5 commits into
Conversation
Claude PreToolUse additionalContext parity: run the guard in tool_call as before (strict deny path unchanged), but deliver the nudge by appending it to that call's tool_result content instead of accumulating a deduped context-transform message. Every qualifying call now carries its own guidance inline, persisted across compaction like any tool output; the before_agent_start reset now only clears pending deliveries.
|
@coderabbitai review |
There was a problem hiding this comment.
🟡 Changes recommended
The new OMP documentation claims guidance is “deduplicated,” but the implementation can append/concatenate per-call guidance without deduplication, so the docs should be corrected to match behavior.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds an “Oh My Pi (OMP)” native extension bridge so OMP can call Graphify’s existing hook-guard policy via an installed graphify CLI, translating denials into OMP blocks and attaching guidance to tool results. This expands Graphify’s installer surface area (new graphify omp … subcommand), ships a wheel-contained OMP package, and adds both Python + Bun-based tests plus CI coverage for the integration.
Changes:
- Ship a new OMP extension package under
graphify/omp/(TypeScript entrypoint +package.json) and include it in Python package data. - Add
graphify omp {install,path}CLI support (delegates installation toomp plugin install …) and suppress startup tip noise forompinvocations. - Add Python and Bun tests plus a dedicated CI job to validate the native hook bridging behavior end-to-end.
File summaries
| File | Description |
|---|---|
tests/test_omp_install.py |
Validates graphify omp path/install behavior and propagation of host install failures. |
tests/omp.test.ts |
End-to-end Bun tests exercising the OMP extension’s tool-call/tool-result bridge against a real installed graphify CLI. |
README.md |
Documents OMP install workflow, guard behavior, safety constraints, and uninstall steps. |
pyproject.toml |
Includes OMP extension files (omp/package.json, omp/index.ts) in wheel/sdist package data. |
graphify/omp/package.json |
Declares the OMP extension manifest and extension entrypoint. |
graphify/omp/index.ts |
Implements native OMP hook bridge: guarded subprocess invocation, cancellation, size/time limits, and tool-result context injection. |
graphify/omp/bun.lock |
Pins Bun dependency tree for the OMP extension tests and CI install reproducibility. |
graphify/install.py |
Adds omp to install command dispatch and implements graphify omp {install,path} delegation to omp plugin install. |
graphify/__main__.py |
Adds omp to silent commands and exposes omp help text in CLI usage. |
CHANGELOG.md |
Notes the OMP native guard feature in the changelog. |
.gitignore |
Ignores graphify/omp/node_modules/ and a temporary root /node_modules symlink used by Bun tests. |
.github/workflows/ci.yml |
Adds an omp-bridge job installing both uv + Bun and running tests/omp.test.ts. |
Review details
- Files reviewed: 10/12 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Denials become OMP `block`/`reason`; guidance becomes one deduplicated context | ||
| message, cleared for each new user run and session navigation. In-flight hooks | ||
| are cancelled on these boundaries. No graph is created or updated automatically. |
Copilot review finding: the README still described the replaced deduplicated context message. Describe the actual behavior: each qualifying call's guidance is appended to that call's persisted tool result.
Companion PR (review-only)
Companion of Graphify-Labs#3506 (same head, same upstream base
v8=26b02b5, identical diff), opened on our fork so our review bots can access it — the upstream repository is read-only for us and its check runs sit inaction_required.Current state carries the parity delivery:
tool_callruns the guard andtool_resultappends the nudge to the call's persisted tool result (ClaudePreToolUseadditionalContext parity) — see the parity commit and the upstream thread for the review round and rationale. Review-only refs: do not merge here; landing happens upstream and viaintegration.