现状
foreshadowing_store.cpp, secret_store.cpp, world_store.cpp, agent_store.cpp, narrative_store.cpp 各自在匿名命名空间中复制了以下函数:
execute_bound(Statement&)
rollback_no_throw(SqliteDb&)
write_json(path, json)
read_json(path)
ensure_world_exists(WorldStore&, world_id)
当前取舍
每个函数 3-10 行,保持文件自包含、独立可编译。不引入新的共享 internal header,避免为几行代码增加模块边界。
升级触发条件
当 store 文件超过 10 个时,提取到 detail/internal_helpers.hpp。
现状
foreshadowing_store.cpp,secret_store.cpp,world_store.cpp,agent_store.cpp,narrative_store.cpp各自在匿名命名空间中复制了以下函数:execute_bound(Statement&)rollback_no_throw(SqliteDb&)write_json(path, json)read_json(path)ensure_world_exists(WorldStore&, world_id)当前取舍
每个函数 3-10 行,保持文件自包含、独立可编译。不引入新的共享 internal header,避免为几行代码增加模块边界。
升级触发条件
当 store 文件超过 10 个时,提取到
detail/internal_helpers.hpp。