feat(recipes): add KIOU_HOOK_ID_ALLOW env filter for consumers - #12
Merged
Conversation
Consumers that don't ship every KIOU-Hook site — for example KiouForge,
which only wants the 17 sites relevant to it and does not include the
KiouEditor UI/kifu unlock caves — can now set
KIOU_HOOK_ID_ALLOW=KIOU_HOOK_ID_SET_TARGET_FRAMERATE,KIOU_HOOK_ID_...
as an environment variable when running `tools.patch_macho`. Only sites
whose hook_id_name matches the comma-separated allow-list get patched
into the CAVE_REGION; the rest are silently skipped.
Motivation: with all 34 caves patched, the last two rows on 1.0.2
(HomeUtilityPresenter.ctor at cave 33 and UIButtonBase.OnPointerClick
at cave 34) collide with the `__oslogstring` fragment at
0x826FFF8..0x8270020, and `tools.patch_macho` fails the zero-fill
check. Consumers that don't need those two sites shouldn't have to pay
for the collision.
The filter validates that every id in KIOU_HOOK_ID_ALLOW appears in
the version's SITES list, so a typo raises a clear ValueError instead
of silently dropping to zero patched sites.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
tkgstrator
added a commit
that referenced
this pull request
Jul 27, 2026
Consumers that don't ship every KIOU-Hook site — for example KiouForge,
which only wants the 17 sites relevant to it and does not include the
KiouEditor UI/kifu unlock caves — can now set
KIOU_HOOK_ID_ALLOW=KIOU_HOOK_ID_SET_TARGET_FRAMERATE,KIOU_HOOK_ID_...
as an environment variable when running `tools.patch_macho`. Only sites
whose hook_id_name matches the comma-separated allow-list get patched
into the CAVE_REGION; the rest are silently skipped.
Motivation: with all 34 caves patched, the last two rows on 1.0.2
(HomeUtilityPresenter.ctor at cave 33 and UIButtonBase.OnPointerClick
at cave 34) collide with the `__oslogstring` fragment at
0x826FFF8..0x8270020, and `tools.patch_macho` fails the zero-fill
check. Consumers that don't need those two sites shouldn't have to pay
for the collision.
The filter validates that every id in KIOU_HOOK_ID_ALLOW appears in
the version's SITES list, so a typo raises a clear ValueError instead
of silently dropping to zero patched sites.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Motivation
Consumers that don't ship every KIOU-Hook site — KiouForge only wants 17 sites, not the 17 KiouEditor UI/kifu unlock caves — can't currently opt out. With all 34 caves patched, the last two rows on 1.0.2 (
HomeUtilityPresenter.ctor@ cave 33,UIButtonBase.OnPointerClick@ cave 34) collide with the__oslogstringfragment at0x826FFF8..0x8270020andtools.patch_machofails its zero-fill check. Consumers that don't need those two sites shouldn't have to pay for the collision.Fix
Read an optional
KIOU_HOOK_ID_ALLOWenv variable and, when set, filterSITESto just the listed hook ids before handing them tobuild_exports. Empty / unset → keep every site (existing behaviour). Typo in the allow-list → cleanValueErrorat import so the failure mode is loud.Test plan
python -m tools.check_recipescleanruff check recipes/ tools/cleanKIOU_HOOK_ID_ALLOWfor its 17 sites →make deploycompletes without the__oslogstringcollision.🤖 Generated with Claude Code