Skip to content

feat(recipes): add KIOU_HOOK_ID_ALLOW env filter for consumers - #12

Merged
tkgstrator merged 1 commit into
masterfrom
feat/consumer-site-filter
Jul 1, 2026
Merged

feat(recipes): add KIOU_HOOK_ID_ALLOW env filter for consumers#12
tkgstrator merged 1 commit into
masterfrom
feat/consumer-site-filter

Conversation

@tkgstrator

Copy link
Copy Markdown
Contributor

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 __oslogstring fragment at 0x826FFF8..0x8270020 and tools.patch_macho fails 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_ALLOW env variable and, when set, filter SITES to just the listed hook ids before handing them to build_exports. Empty / unset → keep every site (existing behaviour). Typo in the allow-list → clean ValueError at import so the failure mode is loud.

KIOU_HOOK_ID_ALLOW=KIOU_HOOK_ID_SET_TARGET_FRAMERATE,KIOU_HOOK_ID_NSS_SETHASHSIZE,...
python -m tools.patch_macho ...

Test plan

  • python -m tools.check_recipes clean
  • ruff check recipes/ tools/ clean
  • KiouForge follow-up sets KIOU_HOOK_ID_ALLOW for its 17 sites → make deploy completes without the __oslogstring collision.

🤖 Generated with Claude Code

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
tkgstrator merged commit 36a3ad1 into master Jul 1, 2026
4 checks passed
@tkgstrator
tkgstrator deleted the feat/consumer-site-filter branch July 1, 2026 16:53
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant