docs(hook): align Codex rewrite guidance - #147
Merged
edouard-claude merged 1 commit intoJul 30, 2026
Merged
Conversation
Owner
|
Thanks for this. Small diff, but every claim in it checks out against the code, and stale comments are exactly the kind of thing that quietly rots a project. Contributions like this are how snip keeps moving. |
Contributor
Author
|
I'll pass it to gpt-5.6-sol :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Codex hook support changed in
e61b319from deny-and-rerun guidance to transparent command rewriting throughupdatedInputand anallowdecision.The implementation and primary documentation already describe that behavior, but three nearby descriptions still reflected the previous model:
snip init grokcalled its deny-and-rerun integration “the same pattern as Codex.”These stale descriptions made the integration architecture appear inconsistent even though the runtime behavior was already correct.
What changed
What did not change
This PR does not change hook execution, command classification, permission decisions, audit behavior, or public APIs.
Codex continues to:
allowwithupdatedInputfor fully attestable commands;timeout;Grok continues to use deny-and-rerun guidance because its hook protocol does not provide the same transparent rewrite path.
Scope and test rationale
The diff is limited to two internal comments and one initialization message.
The earlier draft added a production constant solely so a test could assert the wording of that message. This revision keeps the production flow unchanged and avoids introducing a test-only abstraction that would not exercise hook behavior or initialization output end to end.
Existing Codex hook tests continue to cover the runtime rewrite contract.
Validation
go test ./internal/hook/... ./internal/cli/... ./internal/initcmd/...go test ./...go vet ./...go test -race ./...git diff --checkgit statusreturnsallowwith asnip run -- git statusreplacement;timeoutis preserved;git status && custom-tool deploypasses through unchanged.No wiki update is required because runtime behavior and the documented integration contract are unchanged.