fix(hf): verify empty-metadata kernels from exact Git - #355
Conversation
Catch the observed empty-build error at the selfcheck loader boundary. Materialize the exact revision read-only through authenticated Git and preserve fail-closed behavior for every other error. Signed-off-by: Lutar, Stephen P. <stephenlutar2@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2670c69200
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| self._git( | ||
| ["checkout", "-q", "--detach", "FETCH_HEAD"], | ||
| cwd=repo, | ||
| env=env, |
There was a problem hiding this comment.
Materialize Git LFS build objects before loading
When a Kernel variant contains LFS-tracked artifacts such as a compiled .so, this checkout runs with _auth_environment(), which sets GIT_LFS_SKIP_SMUDGE=1, and the sparse tree also omits .gitattributes; consequently build/** contains LFS pointer text rather than the binary that get_local_kernel() must import, so the new fallback still fails for compiled builds. This is reproducible with a local LFS-backed Kernel repository, and git lfs smudge --help confirms that GIT_LFS_SKIP_SMUDGE disables smudging. Enable LFS materialization for this read-only checkout (including the relevant attributes or an explicit authenticated LFS fetch/checkout) before invoking the loader.
Useful? React with 👍 / 👎.
Outcome
Repairs the still-failing real controller path after #354. Post-merge run 30379450034 disproved the first hypothesis: Kernel metadata revision resolution succeeded, but
kernels.get_kernel(...)raisedValueError: min() iterable argument is emptyduring exact-revision selfcheck.Root cause
The exception occurs after
[validated] kernel-card-publishand beforekernel-verify. The pinnedkernels==0.16.0package asks the Kernel metadata API to enumerate build variants even when the already verified Git repository contains a validbuild/torch-cputree. The #354 fallback surrounded the earlier metadata-revision call, not this loader call.Change
ValueErroraroundkernels.get_kernel;build/**from authenticated Kernel Hub Git;mainrevision to equal the already bound immutable 40-character revision;kernels.get_local_kernel, whose local resolver checksrepo/build;Validation
finalize_kernelcall path;governed-inference-meter@dd133d351d5d77ff666ce16d452edfdfdc3f1a61andszl-governed-norm@52ebdccd8d181e2b367387353ad87484e2d9d8b3, both withbuild/torch-cpu/**variants;2670c692009764b74b7522383f921069b3e9cc1ehas a verified SSH signature and DCO trailer.Boundaries
This does not mutate model, dataset receipt, Kernel build, visibility, hardware, secrets, rulesets, or workflow policy. It does not convert a failed selfcheck into success; it gives the exact existing build a second supported local loading path and still requires its actual
selfcheck()to pass.Reopens/follows #301.
Signed-off-by: Lutar, Stephen P. stephenlutar2@gmail.com