Repository navigation
Conversation
The update hook refused a ref policy op that it does not know with `unknown policy op %q for <ref>`, which repeats the op whole on git's stderr, and git shows that line to the pusher. The op is text of the pusher's token and can be as long as an environment entry allows. The ref, commit and merge writes of the API already quote the same op with errtext.Quote (#902). The hook now quotes it with errtext.Quote too: an op over 256 bytes is cut and followed by its length. This is the server's own refusal text, not a pattern that reads git's stderr. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ Change-Id: I67245cd17be12a5aaad3b4cf130c2f80326f8c8b Signed-off-by: Thomas Kosiewski <tk@coder.com>
hook.go is covered code: evalRefPolicy quotes an unknown op with errtext.Quote. Signed-off-by: Thomas Kosiewski <tk@coder.com> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ Change-Id: I720e36ba852e4a43db4cc3be6ea393253143f485 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The update hook refused a ref policy op that it does not know with
unknown policy op %q for <ref>, which repeated the op whole on git's stderr, and git shows that line to the pusher. The op is text of the pusher's token, so it can be as long as one environment entry allows (the hook gets the refs claim inOPENSTORAGE_GIT_REFS_POLICY). The API's ref, commit and merge writes already quote the same op witherrtext.Quotesince #902.The hook now quotes it with
errtext.Quotetoo. A short op reads as before; an op over 256 bytes is cut at a character and followed by its length:This is the server's own refusal text, not a pattern that reads git's stderr (AGENTS.md).
Changes
evalRefPolicy(internal/githttp/hook.go): the unknown-op refusal quotes the op witherrtext.Quote. Every path that refuses an unknown op runs this check: the pre-receive policy gate (the line a push with a pack shows), the--atomicdenial and the update hook.internal/errtext/README.mdlists the hook as a caller.hook.gois covered by the lane-schedule model, so its fingerprints are re-recorded.Evidence
TestUnknownPolicyOpRefusalQuotedBounded(internal/githttp) callsevalRefPolicywith a 100,000-byte op,no-flyandno"fly, with full evaluation and the budget-free mode. Each must return a refusal that git shows the pusher (ShownToPusher) with the exact text.hook.go, the long-op case fails; the short cases pass unchanged.go test -race -tags=openstorage_viewcheckof./internal/githttp/...(835 s) and./internal/errtext/...(1 s) passes at e5769b0.Reviews
--atomicdenial 706 (60,433) and the update hook 586 (60,313), each still a refusal. A short op prints byte for byte as before. No code parses this text. Its mutants (a 4,096-byte cap, noRefuse, quoting in one evaluation mode only, no length suffix) all failed the test. Left open (P3):evalRefPolicywithfullEvaloff that does, and the classifier turns it into a reservation denial.update: parse ops claim %qrepeats the whole ops claim, but no push reaches it: the server writes that claim withjson.Marshal, which always parses back.Found by the reviews of #902 (desk follow-up).
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh