用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/AzureFoxStudios/wabi --skill wabidb-engine-integration命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | wabidb-engine-integration |
| description | Integrate WabiDB engine into wabi-server and close the assault queue gaps. |
| version | 0.1.0 |
| author | Hermes |
| platforms | ["linux"] |
| metadata | {"hermes":{"tags":["WabiDB","Integration","Projections","Persistence"]}} |
This skill captures the current state of the WabiDB engine integration into wabi-server and the assault queue gaps (projection-less handlers, persistence policy, event log replay). It provides the exact steps to close those gaps and complete the integration.
/var/home/Ronin/wabi/core/crates/wabidb//var/home/Ronin/wabi/core/crates/wabi-server/WABIDB_ROOT_KEY env var set for engine bootstrapInvoke through the terminal tool from the Wabi monorepo root:
cd /var/home/Ronin/wabi
cargo test -p wabidb --lib # 656 tests
cargo test -p wabi-server # 44 tests
core/crates/wabi-server/src/adapter/mod.rs (1416 lines, 40 methods)core/crates/wabidb/src/engine/mod.rs (654 lines, 14 projections)core/crates/wabidb/src/projections/ (14 handlers)core/crates/wabidb/src/domain/mod.rs (567 lines)core/crates/wabidb/src/sequencer/mod.rs (800+ lines, 8 tests)The adapter has methods that write events but have no projection handler:
ban_user / unban_user → bans index, no handlermute_user / unmute_user → mutes index, no handlerdeafen_user / undeafen_user → deafens index, no handlertouch_user → users index, should update last_seen_microsupsert_channel_retention → channel_retention index, no handlerupsert_member_role → member_roles index, no handlerremove_channel_member → no handler (never cleans up channel_members index)Fix: Add projection handlers in core/crates/wabidb/src/projections/:
# Create new projection files
write_file(path="core/crates/wabidb/src/projections/bans.rs", content="...")
write_file(path="core/crates/wabidb/src/projections/mutes.rs", content="...")
write_file(path="core/crates/wabidb/src/projections/deafens.rs", content="...")
write_file(path="core/crates/wabidb/src/projections/member_roles.rs", content="...")
write_file(path="core/crates/wabidb/src/projections/channel_retention.rs", content="...")
Register them in engine/mod.rs build_dispatch_table():
use crate::projections::bans::BansProjection;
use crate::projections::mutes::MutesProjection;
use crate::projections::deafens::DeafensProjection;
use crate::projections::member_roles::MemberRolesProjection;
use crate::projections::channel_retention::ChannelRetentionProjection;
let handlers: Vec<Arc<dyn Projection>> = vec![
// ... existing handlers
Arc::new(BansProjection),
Arc::new(MutesProjection),
Arc::new(DeafensProjection),
Arc::new(MemberRolesProjection),
Arc::new(ChannelRetentionProjection),
];
Phase 1: Add persistence policy projection
Sessionpersistence_policies indexPhase 2: Write filter in sequencer
Off-policy streamspolicy: PersistencePolicy to CommandCommitPhase 3: Event log replay on startup
engine::open()Fix:
// core/crates/wabidb/src/domain/mod.rs
pub enum PersistencePolicy {
Session, // Default: persist to disk
Off, // Skip disk write
}
// core/crates/wabidb/src/sequencer/types.rs
pub struct CommandCommit {
// ... existing fields
pub policy: PersistencePolicy,
}
// core/crates/wabidb/src/sequencer/mod.rs
if commit.policy == PersistencePolicy::Off {
// Skip disk write, dispatch to projections only
}
open():// core/crates/wabidb/src/engine/mod.rs
pub async fn open(config: WabiDbConfig) -> Result<Self> {
// ... existing steps 1-7
// 8. Replay event log to rebuild projections
self._replay_segments().await?;
}
Current: open() initializes empty ProjectionState → all data disappears on restart.
Fix: Add replay logic:
// core/crates/wabidb/src/engine/replay.rs
pub async fn replay_segments(&self) -> Result<()> {
// Read segments, rebuild projections from commit index
}
Call it from open():
// core/crates/wabidb/src/engine/mod.rs
impl WabiDbEngine {
pub async fn open(config: WabiDbConfig) -> Result<Self> {
// ... steps 1-7
// 8. Replay event log
let mut engine = Self { ... };
engine.replay_segments().await?;
Ok(engine)
}
}
Run the full test suite:
cd /var/home/Ronin/wabi
cargo test -p wabidb --lib # Should show 656+ tests
cargo test -p wabi-server # Should show 44+ tests
cargo check -p wabi-server # Should be clean
Mark the assault queue cards as done:
hermes kanban complete wabidb-projection-less-handlers
hermes kanban complete wabidb-persistence-policy
hermes kanban complete wabidb-event-log-replay
(channel_id, message_id)) to avoid collisions.mkdir/open — use MIRIFLAGS="-Zmiri-disable-isolation" for full test runs.*_SECRET to *_KEY or *_PWD.cd /var/home/Ronin/wabi
cargo test -p wabidb --lib 2>&1 | tail -3 # Should show "656 passed"
cargo test -p wabi-server 2>&1 | tail -3 # Should show "44 passed"
The skill is ready when all assault queue gaps are closed and the test suite passes.