Skip to content

refactor: group KEB sources into category subdirectories - #34

Merged
tkgstrator merged 1 commit into
developfrom
refactor/keb-source-layout
Jun 24, 2026
Merged

refactor: group KEB sources into category subdirectories#34
tkgstrator merged 1 commit into
developfrom
refactor/keb-source-layout

Conversation

@tkgstrator

Copy link
Copy Markdown
Contributor

What

Reorganize the flat Sources/KiouEngineBridge/ (24 files) into category subdirectories and drop the redundant Category_ filename prefixes:

Hooks/   AccountObserve.m AfkSuppress.m BackToTitleSuppress.m
         GameOrchestratorObserve.m GameStateStoreObserve.m GrpcLogging.m
         LowLevelObserve.m MatchingFilterObserve.m MatchModeObserve.m OnlineObserve.m
Inject/  Move.m Resign.m
Csa/     Convert.{h,m} Engine.{h,m} GameInfo.m Server.m   (Server.m ← Server_CSA.m)
Settings/ Persistence.{h,m} UI.m
Meta/    Emitter.m
Chinlan/ Dispatcher.m   (← ChinlanDispatcher.m)

Tweak.m and Internal.h stay at the root. The Observe/Suppress role 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 in Internal.h), not by filename, and the Makefile collects sources via a recursive find. Added -ISources/KiouEngineBridge to 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. Historical docs/plans/ and docs/archive/ left as point-in-time snapshots (they already reference removed files like Usi_Engine.m).

Test plan

  • make jailed — builds clean
  • make chinlan — builds clean (strict -Wl,-undefined,error link)
  • uv run pytest tests/test_csa_convert_expectations.py — 85 passed
  • CI builds all three flavours (jailed / chinlan / substrate)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 24, 2026 17:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #import paths accordingly (e.g. Settings/Persistence.h, Csa/Convert.h).
  • Add -I$(TWEAK_SOURCES_DIR) to $(TWEAK_NAME)_CFLAGS so 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.

@tkgstrator
tkgstrator merged commit 3a11ae0 into develop Jun 24, 2026
6 checks passed
@tkgstrator
tkgstrator deleted the refactor/keb-source-layout branch June 24, 2026 17:56
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.

2 participants