Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
I've signed the Google Individual CLA and confirmed that my GitHub username ( Could a maintainer please rerun the CLA check or advise on the next troubleshooting step? Thanks! |
|
Update: the The remaining |
Problem
check_hooks()validates the matcher group and its handlers, but accepts a non-stringmatcher, such as42,true, a list, or an object.tree.validate(CODEX_SURFACE, proposed)consequently accepts these proposals and reports one hook file.The pinned Codex 0.144.6 schema declares
MatcherGroup.matcherasOption<String>. Its discovery loader deserializes the entireHooksFile; an incompatible matcher causes it to warn and discard the file, including otherwise valid sibling hooks.Change
Reject non-null, non-string matchers at the existing proposal-validation boundary, with the file, event, and group index in the error. Preserve missing/null/string matchers and keep accumulating handler errors. Do not coerce or rewrite the proposed JSON.
Regression tests exercise the public
tree.validate()entry point: eight invalid values; missing, null, empty, plain, and regex-string controls; and an invalid group among valid siblings.Related: #142 checks handler command types. This PR checks group matcher types only; it does not include the command or timeout changes.
Verification
Ran 3 tests/FAILED (failures=9).Ran 3 tests/OK.tree.pyin an independent copy restores the same nine failures.git diff --checkpass.I also ran the complete suite on the baseline plus the new tests and on the patch. Neither full suite is green in this environment, so this is not a claim of full-suite acceptance:
python:3.12-slim, canonical Git-blob sourceThe failing case names are identical after removing the nine fixed matcher failures; no new failing case was introduced. Existing failures include POSIX-only imports on Windows and fixture/provenance checks in the full suite. No Codex/model invocation or benchmark run was used; the downstream loader behavior above was checked against the pinned source.
The reproducer and tests above were executed locally.