refactor: group KEB sources into category subdirectories - #34
Merged
Conversation
Flatten the 24-file Sources/KiouEngineBridge/ root into category dirs (Hooks/, Inject/, Csa/, Settings/, Meta/, Chinlan/) and drop the now- redundant Category_ filename prefixes. Tweak.m and Internal.h stay at the root. Server_CSA.m folds into Csa/Server.m; ChinlanDispatcher.m into Chinlan/Dispatcher.m. Behavior is unchanged: hooks link by symbol (InstallXXXHook declared in Internal.h), not by filename, and the Makefile collects sources via a recursive find. Add -ISources/KiouEngineBridge to CFLAGS so bare quote imports resolve from any subdir, and rewrite the renamed-header imports (Settings/Persistence.h, Csa/Convert.h, Csa/Engine.h) to root-relative paths. Update the live docs (csa_protocol, csa_compatibility, cave_kinds) and the CSA-convert test docstring to the new paths; historical docs under docs/plans and docs/archive are left as point-in-time snapshots. Verified locally with both 'make jailed' and 'make chinlan' (strict -Wl,-undefined,error link) and pytest (85 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Reorganizes Sources/KiouEngineBridge/ from a flat layout into category subdirectories (Hooks/Inject/Csa/Settings/Meta/Chinlan) and updates build/include paths and documentation to match, so headers can be imported consistently from any subdirectory.
Changes:
- Move/rename source files into category subdirectories and update
#importpaths accordingly (e.g.Settings/Persistence.h,Csa/Convert.h). - Add
-I$(TWEAK_SOURCES_DIR)to$(TWEAK_NAME)_CFLAGSso quote-imports resolve from any subdir. - Update docs and the CSA convert expectations test docstring to reference the new paths.
Reviewed changes
Copilot reviewed 18 out of 29 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_csa_convert_expectations.py | Updates docstring references to new Csa/Convert.{h,m} paths. |
| Sources/KiouEngineBridge/Tweak.m | Updates settings header import path to Settings/Persistence.h. |
| Sources/KiouEngineBridge/Settings/UI.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Settings/Persistence.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Settings/Persistence.h | New/moved settings API header under Settings/. |
| Sources/KiouEngineBridge/Meta/Emitter.m | New/moved meta emitter implementation under Meta/. |
| Sources/KiouEngineBridge/Inject/Resign.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Inject/Move.m | New/moved move injection implementation under Inject/. |
| Sources/KiouEngineBridge/Hooks/OnlineObserve.m | New/moved online snapshot/result hooks under Hooks/. |
| Sources/KiouEngineBridge/Hooks/MatchModeObserve.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Hooks/MatchingFilterObserve.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Hooks/LowLevelObserve.m | New/moved low-level observation hooks under Hooks/. |
| Sources/KiouEngineBridge/Hooks/GrpcLogging.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Hooks/GameStateStoreObserve.m | New/moved GameStateStore hooks under Hooks/. |
| Sources/KiouEngineBridge/Hooks/GameOrchestratorObserve.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Hooks/BackToTitleSuppress.m | New/moved hook module under Hooks/. |
| Sources/KiouEngineBridge/Hooks/AfkSuppress.m | New/moved hook module under Hooks/. |
| Sources/KiouEngineBridge/Hooks/AccountObserve.m | Updates settings header import path. |
| Sources/KiouEngineBridge/Csa/Server.m | New/moved CSA TCP server transport under Csa/. |
| Sources/KiouEngineBridge/Csa/GameInfo.m | Updates CSA header imports to Csa/.... |
| Sources/KiouEngineBridge/Csa/Engine.m | Updates CSA header import path to Csa/Engine.h. |
| Sources/KiouEngineBridge/Csa/Engine.h | Updates CSA convert header import path. |
| Sources/KiouEngineBridge/Csa/Convert.m | Updates convert header import path. |
| Sources/KiouEngineBridge/Csa/Convert.h | New/moved CSA conversion API header under Csa/. |
| Sources/KiouEngineBridge/Chinlan/Dispatcher.m | New/moved chinlan dispatcher under Chinlan/. |
| Makefile | Adds include search path for Sources/KiouEngineBridge so imports work across subdirs. |
| docs/research/cave_kinds.md | Updates referenced source paths to new directory layout. |
| docs/csa_protocol.md | Updates “source of truth” and inline references to new CSA file paths. |
| docs/csa_compatibility.md | Updates conversion/hook path references to new layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Reorganize the flat
Sources/KiouEngineBridge/(24 files) into category subdirectories and drop the redundantCategory_filename prefixes:Tweak.mandInternal.hstay at the root. TheObserve/Suppressrole suffixes are kept.Why
24 flat files with
Category_prefixes that duplicate what a directory would say. Grouping makes the layout scannable.Behavior
Unchanged. Hooks link by symbol (
InstallXXXHook, declared inInternal.h), not by filename, and the Makefile collects sources via a recursivefind. Added-ISources/KiouEngineBridgeto CFLAGS so bare quote imports resolve from any subdir; rewrote the three renamed-header imports to root-relative paths.Live docs (
csa_protocol,csa_compatibility,research/cave_kinds) and the CSA-convert test docstring updated to the new paths. Historicaldocs/plans/anddocs/archive/left as point-in-time snapshots (they already reference removed files likeUsi_Engine.m).Test plan
make jailed— builds cleanmake chinlan— builds clean (strict-Wl,-undefined,errorlink)uv run pytest tests/test_csa_convert_expectations.py— 85 passed🤖 Generated with Claude Code