[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CCX6C9PQXRSSN0YEVEWB98":3,"skill-same:01M6CCX6C9PQXRSSN0YEVEWB98":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M6CCX6C9PQXRSSN0YEVEWB98","rust-logic-audit",null,"Deep logic bug review for Rust codebases. Portable engine for logic chain analysis including: (1) Topology Reconnaissance, (2) Context Alignment, (3) Semantic Invariant checking, (4) Connectivity & Wiring audit, (5) Control flow simulation, (6) Red-teaming, (7) Five-layer automated verification (L1-L5). Trigger: \u002Frust-logic-audit [module|commit] [--strict]","rootazero\u002FAleph","rootazero","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F124485722?v=4","01M6CCWSEZCM9XS2W4R9XR5YGH","01M6CCWSK4WJ6D0W8VRJNSZZKA",4,"MIT","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frust-logic-audit\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"rust","audit","rust logic audit","review","commit","verification","topology","flow","reconnaissance","analysis","simulation","red-teaming","engine","context","bug","alignment","2026-11-10 10:12:30",false,"---\nname: rust-logic-audit\ndescription: >\n  Deep logic bug review for Rust codebases. Portable engine for logic chain\n  analysis including: (1) Topology Reconnaissance, (2) Context Alignment,\n  (3) Semantic Invariant checking, (4) Connectivity & Wiring audit,\n  (5) Control flow simulation, (6) Red-teaming, (7) Five-layer automated verification (L1-L5).\n  Trigger: \u002Frust-logic-audit [module|commit] [--strict]\n---\n\n# Rust Logic Audit — Five-Layer Defense System\n\nThis skill is a portable, deep-audit engine for Rust logic chains. It provides both semantic AI analysis (L3) and integrates with automated verification layers (L1, L2, L4, L5).\n\n## Portability & Integration\n\nThis skill is designed to be **portable**. It carries its own execution engine in `.\u002FScripts\u002Flogic-audit.sh`.\n- **Integrated Mode**: If the project has a `justfile` with matching tasks (e.g., `test-kani`), it will use those.\n- **Standalone Mode**: If running in a raw Rust project, it falls back to standard `cargo` commands.\n\n### Commands\n- **AI Audit**: `\u002Frust-logic-audit`\n- **Automated Pipeline**: `just audit-logic` or `.\u002FScripts\u002Flogic-audit.sh`\n\n\n| Layer | Method | Coverage | Command |\n|-------|--------|----------|---------|\n| **L1** | proptest (property-based) | 77 tests across 9 files — invariant violations, boundary errors | `just test-proptest` |\n| **L2** | loom (concurrency) | 21 tests across 5 modules — deadlocks, data races, atomics bugs | `just test-loom` |\n| **L3** | AI semantic audit (this skill) | Logic bugs, state errors, design flaws, wiring gaps | `\u002Frust-logic-audit` |\n\nRun all layers together: `just test-logic`.\n\nFollow the five phases below strictly and in order.\n\n## Arguments\n\nParse the user's input:\n- No args → review uncommitted changes (`git diff` + `git diff --cached`)\n- Module name (e.g., `dispatcher`, `gateway`) → review that module's recent changes\n- Commit hash → review that specific commit (`git show \u003Chash>`)\n- `--all` flag → full repo scan (all modules under `core\u002Fsrc\u002F`)\n- `--strict` flag → lower the Warning threshold (report more potential issues)\n\n## Scope Management\n\nBefore starting the five phases, assess scope and choose a batch strategy.\n\n**Estimate scope:**\n\n| Input type | Measure with |\n|-----------|-------------|\n| Uncommitted changes | `git diff --stat` |\n| Commit | `git show --stat \u003Chash>` |\n| Module | `find core\u002Fsrc\u002F\u003Cmodule> -name '*.rs' \\| wc -l` |\n| `--all` | All 63 modules under `core\u002Fsrc\u002F` (~1200 .rs files) |\n\n**Choose strategy:**\n\n| Scope | Strategy |\n|-------|----------|\n| ≤ 10 changed files | **Single pass** — run five phases directly |\n| 11-30 changed files | **Module batching** — group by module, run phases per batch |\n| > 30 files or `--all` | **Subagent dispatch** — parallel subagents per module |\n\n### Module batching (medium scope)\n\n1. Group changed files by module using the Phase 1 module→doc mapping\n2. Run all five phases for each module batch sequentially\n3. Track cross-module concerns (see below) across batches\n4. After all batches: merge findings into one consolidated report\n\n### Subagent dispatch (large scope)\n\n1. **Tier 1 — high-risk modules** (review first):\n   agent_loop, dispatcher, gateway, memory, poe, exec, resilience, extension, thinker\n2. **Tier 2**: all remaining `core\u002Fsrc\u002F` directories\n3. Dispatch one subagent per module. For tiny modules (≤ 5 files), group 3-4 into one subagent\n4. Each subagent prompt: module name, reference doc path (from Phase 1 table), full five-phase instructions, flags\n5. Collect all subagent reports → produce consolidated summary\n\n### Cross-module tracking\n\nThese issues only surface when comparing findings across batches — actively track them:\n\n- **Lock hierarchy violations** spanning modules (e.g., gateway holds Level 2 while calling memory at Level 1)\n- **Error context loss** at module boundaries (`map_err` strips inner context)\n- **Shared state inconsistency** — same data accessed from different modules with different lock patterns\n- **API contract drift** — caller assumes invariant the callee doesn't guarantee\n- **Wiring gaps across module boundaries** — module A exposes new `pub fn` but no module B calls it; trait implemented but never dyn-dispatched; event defined but never subscribed\n- **Registration inconsistency** — feature code exists in module A but registration (tool map, handler dispatch, provider factory) is missing in module B\n\n## Phase 1: Context Alignment\n\nBefore reading any code, establish what \"correct\" means:\n\n1. **Identify the target module** from the diff\u002Fcommit\n2. **Read the reference doc** using this mapping:\n\n| Module | Reference Doc |\n|--------|--------------|\n| agent_loop | docs\u002Freference\u002FAGENT_SYSTEM.md |\n| dispatcher | docs\u002Freference\u002FAGENT_SYSTEM.md |\n| gateway | docs\u002Freference\u002FGATEWAY.md |\n| memory | docs\u002Freference\u002FMEMORY_SYSTEM.md |\n| poe | docs\u002Fplans\u002F2026-02-01-poe-architecture-design.md |\n| tools | docs\u002Freference\u002FTOOL_SYSTEM.md |\n| exec | docs\u002Freference\u002FSECURITY.md |\n| extension | docs\u002Freference\u002FEXTENSION_SYSTEM.md |\n| domain | docs\u002Freference\u002FDOMAIN_MODELING.md |\n\n3. **Extract business invariants** from the doc (state machine rules, data constraints, ordering guarantees)\n4. **Read the change intent** from commit message or PR description\n\n## Phase 2: Semantic Invariant Checking\n\nFor each changed function, check:\n\n### State Machine Legality\n- Find all `enum` types used in the changed code\n- Enumerate all variant transitions in `match` arms\n- Flag any transition that skips intermediate states\n- Flag any `_ => {}` that silently swallows new variants\n\n### Error Propagation\n- Trace every `?` operator — does the caller handle the error type correctly?\n- Check `map_err` chains — is context preserved or silently lost?\n- On error paths: is cleanup\u002Frollback performed? Are resources released?\n\n### unwrap\u002Fpanic Audit\n- Flag every `.unwrap()`, `.expect()`, `panic!()`, `unreachable!()`\n- For each: is it in a test-only path, or could it trigger in production?\n- Rate: SAFE (proven by type system), RISKY (depends on runtime state), CRITICAL (user-facing path)\n\n### Lock & Concurrency Analysis\n\n**Imports check:**\n- Verify sync primitives import from `crate::sync_primitives`, NOT directly from `std::sync`\n- Exceptions: `OnceLock`, `LazyLock`, `Once`, `Weak`, `AtomicU8`, `std::sync::mpsc` (not in sync_primitives)\n- Exception: static `AtomicU64`\u002F`AtomicU32` (loom's `new()` is not `const fn`, must use `std::sync::atomic`)\n- Exception: types that interface with external crate APIs (e.g., `rhai::Locked` requires `std::sync::RwLock`)\n\n**Lock hierarchy** (defined in `core\u002Fsrc\u002Fsync_primitives.rs`):\n- Level 0: StateDatabase (resilience\u002Fdatabase)\n- Level 1: MemoryStore (memory\u002F)\n- Level 2: ToolRegistry, ChannelRegistry (tool_metadata\u002F, gateway\u002F)\n- Level 3: UI state, progress monitors\n- Flag any code that acquires locks out of order\n\n**Lock scope:**\n- Find all `Mutex::lock()`, `RwLock::read()`, `RwLock::write()`\n- Check: is the guard held across an `.await` point? (deadlock risk with std::sync::Mutex)\n- Check: are multiple locks acquired? If so, is the order consistent across all call sites?\n\n**Atomic operations:**\n- Check ordering (`Relaxed` vs `SeqCst` vs `Acquire`\u002F`Release`) — is it strong enough?\n- Check TOCTOU patterns: load → check → store with separate critical sections is a race\n- Flag unprotected read-modify-write sequences (should use `fetch_add`, `compare_exchange`, etc.)\n\n**Loom test coverage** (21 tests across 5 modules):\n\n| Module | Test file | # | Tests |\n|--------|-----------|---|-------|\n| tool_metadata | `tool_metadata\u002Floom_concurrency.rs` | 4 | registry R\u002FW, pause\u002Fresume flags, atomic counter, progress snapshot |\n| gateway | `gateway\u002Floom_concurrency.rs` | 5 | seq counter, connection state, request ID, chunk reset, run limit TOCTOU |\n| agent_loop | `agent_loop\u002Floom_concurrency.rs` | 3 | anchor store, state flags, Arc ref counting |\n| memory | `memory\u002Floom_concurrency.rs` | 5 | singleton init, compression trigger, timestamps, metrics, provider swap |\n| resilience | `resilience\u002Floom_concurrency.rs` | 4 | lane counter, token budget, per-task seq, mutex contention |\n\nIf the reviewed code touches concurrency patterns in these modules, check if existing loom tests cover the change. If not, suggest adding a loom test.\n\n### Connectivity & Wiring Analysis\n\n**Critical insight**: A perfectly correct function that is never called is still a bug — it means the feature doesn't exist at runtime. Check for \"dead logic at the seams.\"\n\n#### Entry Point Audit\n- **Main \u002F binary entry points**: Is the new module\u002Ffunction reachable from `main()`, `lib.rs`, or the appropriate binary `main.rs`?\n- **Plugin\u002Fextension registration**: If adding a plugin, tool, or extension — is it registered in the plugin manifest, tool registry, or extension loader? (Common gap: code exists but not in `register_plugins()` or equivalent)\n- **Gateway handlers**: New JSON-RPC or WebSocket handlers must be added to the router dispatch table. Check `handlers\u002Fmod.rs` or router setup code.\n- **Event subscribers**: New event handlers must subscribe to the event bus. Is `event_bus.subscribe(handler)` called?\n- **Background task spawning**: New daemons or loops must be spawned in the system bootstrap (e.g., `tokio::spawn(daemon_task)`).\n\n#### Visibility Traps\n- **`pub` functions with no callers**: A `pub fn` in a module that is never called from outside — compiler won't warn because it's `pub`. Check if it should be `pub(crate)` or if callers are missing.\n- **`pub(crate)` in leaf modules**: If a module is only used internally, `pub(crate)` functions that are uncalled indicate dead code.\n- **Trait implementations**: A type implements a trait, but is the trait used anywhere? E.g., `impl MyTrait for Foo {}` but no `dyn MyTrait` or `\u003CT: MyTrait>` bounds reference `Foo`.\n- **Unused associated functions**: `impl Foo { pub fn new_feature() {} }` — is `new_feature()` ever invoked?\n\n#### Registration Patterns (Aleph-Specific)\n\nCheck these registries when reviewing related code:\n\n| Component | Registry Location | What to verify |\n|-----------|-------------------|----------------|\n| Built-in tools | `builtin_tools\u002Fmod.rs` or `tool_server` registration | Tool is added to the tool map |\n| Gateway handlers | `gateway\u002Fhandlers\u002Fmod.rs` | Handler enum variant + dispatch match arm |\n| Channel interfaces | `gateway\u002Finterfaces\u002Fmod.rs` | Channel type registered in factory\u002Floader |\n| MCP tools | MCP client initialization | Tool schema registered with MCP server |\n| Memory providers | Memory system initialization | Provider added to provider enum\u002Ffactory |\n| LLM providers | `providers\u002Fmod.rs` | Provider registered in provider resolution |\n| Sandbox drivers | `sandbox\u002Fmod.rs` | Driver registered in driver selection logic |\n| Compression strategies | `compressor\u002Fmod.rs` | Strategy added to strategy selector |\n| Event handlers | Event bus initialization | Handler subscribed to relevant event topic |\n\n#### Cross-Module Wiring\n- **Service composition**: If module A depends on module B's new feature, does A's factory\u002Fconstructor pass the new dependency?\n- **Configuration wiring**: New config fields must be: (1) defined in config struct, (2) parsed from file\u002Fenv, (3) passed to the component that uses it.\n- **Feature flags**: Code behind `#[cfg(feature = \"...\")]` — is the feature enabled in any build configuration? Is the feature gate tested in CI?\n- **WASM exports**: New WASM-facing functions need `#[wasm_bindgen]` and must be exported from the WASM module boundary.\n\n#### Diagnostic Commands\nUse these to detect wiring gaps:\n\n```bash\n# Find pub functions with no callers (requires cargo-udeps or manual audit)\n# Check for unused dependencies that might indicate orphaned features\ncargo udeps\n\n# Build with aggressive dead code warnings\nRUSTFLAGS=\"-W dead_code\" cargo check -p alephcore\n\n# Check if feature-gated code compiles\ncargo check -p alephcore --features \"feature-name\"\n```\n\n**Red flags**:\n- A commit adding a module but no changes to any registry, router, or main loop\n- `pub fn` added with no corresponding caller in the same PR\n- Trait impl added but no usage in `dyn` or generic contexts\n- New enum variant in a registry type but no match arm handling it\n- Event type defined but no subscriber\n- Config struct field added but never read\n\n### Type Coercion\n- Find all `as` casts — can they truncate or overflow?\n- Prefer `try_into()` or `From` implementations\n\n## Phase 3: Control Flow Simulation\n\nFor each changed function, mentally execute it:\n\n### Branch Coverage\n- List every `if\u002Felse`, `match`, and `?` branch\n- For each: what happens on the \"other\" path?\n- Flag: `if condition { do_something() }` with no `else` — is the implicit else correct?\n\n### Loop Boundaries\n- What happens when the collection is empty?\n- What happens when the collection has millions of items?\n- Is there a guaranteed termination condition?\n\n### Option\u002FResult Chains\n- Trace `.map().and_then().unwrap_or()` chains\n- Where does `None` propagate to? Is the final default value correct?\n\n### Async Ordering\n- For `tokio::spawn` or `join_all`: does the order of completion matter?\n- For channels: can messages arrive out of order? Is that handled?\n\n## Phase 4: Red-teaming\n\nSwitch to attacker mindset:\n\n1. **Malicious inputs**: What if the input is:\n   - Empty string \u002F zero-length slice\n   - Extremely long string (> 1MB)\n   - Invalid UTF-8 (if accepting bytes)\n   - NaN or Infinity (for floats)\n   - Negative numbers where positive expected\n   - Null\u002FNone where Some expected\n\n2. **Abnormal timing**:\n   - Network timeout mid-operation\n   - Two identical requests arrive simultaneously\n   - Component crashes between step 1 and step 2 of a multi-step operation\n\n3. **Generate test suggestions**: Write 3-5 concrete test cases (as Rust code snippets) that target the most likely failure modes discovered above.\n\n## Phase 5: Automated Verification (L1 + L2)\n\nIf the reviewed code touches any of these, run automated tests:\n\n| Code changed | Run command | What it verifies |\n|-------------|-------------|------------------|\n| Concurrency (Mutex, RwLock, atomics, Arc) | `just test-loom` | 21 loom tests across 5 modules |\n| Business logic, data structures, parsing | `just test-proptest` | 77 proptest tests across 9 files |\n| Both or unclear | `just test-logic` | All proptest + loom tests |\n\n**Proptest coverage** (77 tests across 9 files):\n\n| Module | Test files |\n|--------|-----------|\n| agent_loop | `proptest_decision.rs` (10), `proptest_state.rs` (10) |\n| dispatcher | `agent_types\u002Fproptest_graph.rs` (8), `agent_types\u002Fproptest_task.rs` (7) |\n| gateway | `proptest_channel.rs` (7), `proptest_protocol.rs` (7) |\n| memory | `proptest_enums.rs` (7) |\n| poe | `proptest_types.rs` (11), `proptest_budget.rs` (10) |\n\nReport the test results in the findings section. If a loom or proptest test fails, escalate to **Critical**.\n\nIf the change introduces a NEW concurrency pattern not covered by existing loom tests, add a **[Suggested Test]** with a loom test template:\n\n```rust\n#[test]\nfn loom_new_pattern_name() {\n    loom::model(|| {\n        \u002F\u002F Setup shared state using loom::sync types\n        let shared = Arc::new(Mutex::new(initial_state));\n\n        \u002F\u002F Spawn threads to exercise the pattern\n        let t1 = loom::thread::spawn(move || { \u002F* ... *\u002F });\n\n        \u002F\u002F Join and verify invariants\n        t1.join().unwrap();\n        \u002F\u002F assert!(...)\n    });\n}\n```\n\nNew loom tests go in `core\u002Fsrc\u002F\u003Cmodule>\u002Floom_concurrency.rs`, gated with `#[cfg(all(test, feature = \"loom\"))]` in the module's `mod.rs`.\n\n## Report Format\n\nOutput the report in this exact format:\n\n```markdown\n# Logic Review Report\n**Module**: \u003Cmodule name>\n**Scope**: \u003Cwhat was reviewed>\n**Date**: \u003Ctoday>\n**Mode**: \u003Cnormal|strict>\n\n## Findings\n\n### [Critical] \u003Ctitle>\n- **Location**: `file:line`\n- **Trigger condition**: \u003Chow to trigger>\n- **Expected behavior**: \u003Cwhat should happen>\n- **Actual behavior**: \u003Cwhat actually happens>\n- **Suggested fix**: \u003Chow to fix>\n\n### [Warning] \u003Ctitle>\n- **Location**: `file:line`\n- **Risk**: \u003Cwhat could go wrong>\n- **Current impact**: \u003Clow\u002Fmedium\u002Fhigh>\n- **Suggestion**: \u003Cwhat to do>\n\n### [Suggested Test] \u003Ctitle>\n\\```rust\n#[test]\nfn test_name() {\n    \u002F\u002F test code\n}\n\\```\n\n## Summary\n| Level | Count |\n|-------|-------|\n| Critical | N |\n| Warning | N |\n| Suggested Test | N |\n```\n\nFor batched reviews, append cross-module section and batch summary:\n\n```markdown\n## Cross-Module Findings\n\n### [Critical] \u003Ctitle spanning modules>\n- **Modules**: `module_a\u002Ffile.rs` → `module_b\u002Ffile.rs`\n- **Risk**: \u003Cdescription>\n- **Suggested fix**: \u003Chow to fix>\n\n## Batch Summary\n| Module | Critical | Warning | Suggested Test |\n|--------|----------|---------|----------------|\n| gateway | 2 | 5 | 3 |\n| dispatcher | 0 | 3 | 1 |\n| ... | ... | ... | ... |\n| **Cross-module** | **1** | **0** | **0** |\n| **Total** | **N** | **N** | **N** |\n```\n\n## Quality Bar\n\n- **Critical**: Must be filed. The code WILL produce wrong results under described conditions.\n- **Warning**: Should be addressed. The code MIGHT produce wrong results under edge conditions, or is fragile to future changes.\n- **Suggested Test**: Nice to have. A test that would increase confidence in the logic.\n\nIn `--strict` mode: lower the bar for Warning (include more \"might be a problem\" items).\n\n## Known Bug Patterns\n\nPatterns confirmed by full-codebase review — always check for these:\n\n- **UTF-8 byte slicing**: `&s[..n]` panics on multi-byte chars — use `s.get(..n)`, `char_indices()`, `strip_suffix()`\n- **Lock poisoning**: `lock().unwrap()` cascades panics — use `.unwrap_or_else(|e| e.into_inner())`\n- **SQL filter injection**: LanceDB DataFusion filters built via `format!()` — must escape with `escape_sql_string()`\n- **`expect()`\u002F`unwrap()` on user-facing paths**: home_dir, timestamps, HTTP clients — use fallbacks\n- **`static mut`**: unsound in Rust — use `OnceLock` or `Lazy`\n- **HashMap iteration order**: non-deterministic for security rules — sort explicitly\n- **Orphaned logic**: `pub fn` or trait impl added but no caller \u002F no `dyn` usage — feature exists in source but not at runtime. Always verify the \"last mile\" wiring to registries, routers, event buses, or main loops\n- **Partial registration**: New enum variant or handler added but missing from the dispatch `match` or factory function — compiles but silently unreachable\n\n## Aleph-Specific Invariants\n\nProject-specific rules to always check:\n\n1. **R1 Brain-Limb Separation**: No platform-specific APIs (AppKit, Vision, windows-rs) in `core\u002Fsrc\u002F`\n2. **DAG Acyclicity**: Any code touching TaskGraph must preserve the no-cycle invariant\n3. **POE Budget Monotonicity**: `current_attempt` and `tokens_used` must only increase\n4. **Session Key Determinism**: Same input must always route to the same session\n5. **Memory Namespace Isolation**: Facts in namespace A must never leak to namespace B queries\n6. **Approval Flow Integrity**: exec approval cannot be bypassed by crafted tool names\n7. **Gateway Auth State Machine**: Connection must authenticate before any RPC call succeeds\n8. **Sync Primitives Import Rule**: Use `crate::sync_primitives` for `Arc`, `Mutex`, `RwLock`, and atomics — never `std::sync` directly (except documented exceptions: static atomics, OnceLock, external API interop)\n9. **Lock Hierarchy Compliance**: Acquire locks in Level 0→1→2→3 order; reverse acquisition is a deadlock risk\n10. **TOCTOU Prevention**: Check-then-act on shared state must happen within the same lock scope (see gateway\u002Fexecution_engine TOCTOU fix as reference)\n11. **Wiring Completeness**: Every new `pub fn`, trait impl, handler, tool, provider, or event type must have a verified caller \u002F registration \u002F subscriber. Unwired code is dead code — even if it compiles\n","# Rust Logic Audit — Five-Layer Defense System\n\nThis skill is a portable, deep-audit engine for Rust logic chains. It provides both semantic AI analysis (L3) and integrates with automated verification layers (L1, L2, L4, L5).\n\n## Portability & Integration\n\nThis skill is designed to be **portable**. It carries its own execution engine in `.\u002FScripts\u002Flogic-audit.sh`.\n- **Integrated Mode**: If the project has a `justfile` with matching tasks (e.g., `test-kani`), it will use those.\n- **Standalone Mode**: If running in a raw Rust project, it falls back to standard `cargo` commands.\n\n### Commands\n- **AI Audit**: `\u002Frust-logic-audit`\n- **Automated Pipeline**: `just audit-logic` or `.\u002FScripts\u002Flogic-audit.sh`\n\n\n| Layer | Method | Coverage | Command |\n|-------|--------|----------|---------|\n| **L1** | proptest (property-based) | 77 tests across 9 files — invariant violations, boundary errors | `just test-proptest` |\n| **L2** | loom (concurrency) | 21 tests across 5 modules — deadlocks, data races, atomics bugs | `just test-loom` |\n| **L3** | AI semantic audit (this skill) | Logic bugs, state errors, design flaws, wiring gaps | `\u002Frust-logic-audit` |\n\nRun all layers together: `just test-logic`.\n\nFollow the five phases below strictly and in order.\n\n## Arguments\n\nParse the user's input:\n- No args → review uncommitted changes (`git diff` + `git diff --cached`)\n- Module name (e.g., `dispatcher`, `gateway`) → review that module's recent changes\n- Commit hash → review that specific commit (`git show \u003Chash>`)\n- `--all` flag → full repo scan (all modules under `core\u002Fsrc\u002F`)\n- `--strict` flag → lower the Warning threshold (report more potential issues)\n\n## Scope Management\n\nBefore starting the five phases, assess scope and choose a batch strategy.\n\n**Estimate scope:**\n\n| Input type | Measure with |\n|-----------|-------------|\n| Uncommitted changes | `git diff --stat` |\n| Commit | `git show --stat \u003Chash>` |\n| Module | `find core\u002Fsrc\u002F\u003Cmodule> -name '*.rs' \\| wc -l` |\n| `--all` | All 63 modules under `core\u002Fsrc\u002F` (~1200 .rs files) |\n\n**Choose strategy:**\n\n| Scope | Strategy |\n|-------|----------|\n| ≤ 10 changed files | **Single pass** — run five phases directly |\n| 11-30 changed files | **Module batching** — group by module, run phases per batch |\n| > 30 files or `--all` | **Subagent dispatch** — parallel subagents per module |\n\n### Module batching (medium scope)\n\n1. Group changed files by module using the Phase 1 module→doc mapping\n2. Run all five phases for each module batch sequentially\n3. Track cross-module concerns (see below) across batches\n4. After all batches: merge findings into one consolidated report\n\n### Subagent dispatch (large scope)\n\n1. **Tier 1 — high-risk modules** (review first):\n   agent_loop, dispatcher, gateway, memory, poe, exec, resilience, extension, thinker\n2. **Tier 2**: all remaining `core\u002Fsrc\u002F` directories\n3. Dispatch one subagent per module. For tiny modules (≤ 5 files), group 3-4 into one subagent\n4. Each subagent prompt: module name, reference doc path (from Phase 1 table), full five-phase instructions, flags\n5. Collect all subagent reports → produce consolidated summary\n\n### Cross-module tracking\n\nThese issues only surface when comparing findings across batches — actively track them:\n\n- **Lock hierarchy violations** spanning modules (e.g., gateway holds Level 2 while calling memory at Level 1)\n- **Error context loss** at module boundaries (`map_err` strips inner context)\n- **Shared state inconsistency** — same data accessed from different modules with different lock patterns\n- **API contract drift** — caller assumes invariant the callee doesn't guarantee\n- **Wiring gaps across module boundaries** — module A exposes new `pub fn` but no module B calls it; trait implemented but never dyn-dispatched; event defined but never subscribed\n- **Registration inconsistency** — feature code exists in module A but registration (tool map, handler dispatch, provider factory) is missing in module B\n\n## Phase 1: Context Alignment\n\nBefore reading any code, establish what \"correct\" means:\n\n1. **Identify the target module** from the diff\u002Fcommit\n2. **Read the reference doc** using this mapping:\n\n| Module | Reference Doc |\n|--------|--------------|\n| agent_loop | docs\u002Freference\u002FAGENT_SYSTEM.md |\n| dispatcher | docs\u002Freference\u002FAGENT_SYSTEM.md |\n| gateway | docs\u002Freference\u002FGATEWAY.md |\n| memory | docs\u002Freference\u002FMEMORY_SYSTEM.md |\n| poe | docs\u002Fplans\u002F2026-02-01-poe-architecture-design.md |\n| tools | docs\u002Freference\u002FTOOL_SYSTEM.md |\n| exec | docs\u002Freference\u002FSECURITY.md |\n| extension | docs\u002Freference\u002FEXTENSION_SYSTEM.md |\n| domain | docs\u002Freference\u002FDOMAIN_MODELING.md |\n\n3. **Extract business invariants** from the doc (state machine rules, data constraints, ordering guarantees)\n4. **Read the change intent** from commit message or PR description\n\n## Phase 2: Semantic Invariant Checking\n\nFor each changed function, check:\n\n### State Machine Legality\n- Find all `enum` types used in the changed code\n- Enumerate all variant transitions in `match` arms\n- Flag any transition that skips intermediate states\n- Flag any `_ => {}` that silently swallows new variants\n\n### Error Propagation\n- Trace every `?` operator — does the caller handle the error type correctly?\n- Check `map_err` chains — is context preserved or silently lost?\n- On error paths: is cleanup\u002Frollback performed? Are resources released?\n\n### unwrap\u002Fpanic Audit\n- Flag every `.unwrap()`, `.expect()`, `panic!()`, `unreachable!()`\n- For each: is it in a test-only path, or could it trigger in production?\n- Rate: SAFE (proven by type system), RISKY (depends on runtime state), CRITICAL (user-facing path)\n\n### Lock & Concurrency Analysis\n\n**Imports check:**\n- Verify sync primitives import from `crate::sync_primitives`, NOT directly from `std::sync`\n- Exceptions: `OnceLock`, `LazyLock`, `Once`, `Weak`, `AtomicU8`, `std::sync::mpsc` (not in sync_primitives)\n- Exception: static `AtomicU64`\u002F`AtomicU32` (loom's `new()` is not `const fn`, must use `std::sync::atomic`)\n- Exception: types that interface with external crate APIs (e.g., `rhai::Locked` requires `std::sync::RwLock`)\n\n**Lock hierarchy** (defined in `core\u002Fsrc\u002Fsync_primitives.rs`):\n- Level 0: StateDatabase (resilience\u002Fdatabase)\n- Level 1: MemoryStore (memory\u002F)\n- Level 2: ToolRegistry, ChannelRegistry (tool_metadata\u002F, gateway\u002F)\n- Level 3: UI state, progress monitors\n- Flag any code that acquires locks out of order\n\n**Lock scope:**\n- Find all `Mutex::lock()`, `RwLock::read()`, `RwLock::write()`\n- Check: is the guard held across an `.await` point? (deadlock risk with std::sync::Mutex)\n- Check: are multiple locks acquired? If so, is the order consistent across all call sites?\n\n**Atomic operations:**\n- Check ordering (`Relaxed` vs `SeqCst` vs `Acquire`\u002F`Release`) — is it strong enough?\n- Check TOCTOU patterns: load → check → store with separate critical sections is a race\n- Flag unprotected read-modify-write sequences (should use `fetch_add`, `compare_exchange`, etc.)\n\n**Loom test coverage** (21 tests across 5 modules):\n\n| Module | Test file | # | Tests |\n|--------|-----------|---|-------|\n| tool_metadata | `tool_metadata\u002Floom_concurrency.rs` | 4 | registry R\u002FW, pause\u002Fresume flags, atomic counter, progress snapshot |\n| gateway | `gateway\u002Floom_concurrency.rs` | 5 | seq counter, connection state, request ID, chunk reset, run limit TOCTOU |\n| agent_loop | `agent_loop\u002Floom_concurrency.rs` | 3 | anchor store, state flags, Arc ref counting |\n| memory | `memory\u002Floom_concurrency.rs` | 5 | singleton init, compression trigger, timestamps, metrics, provider swap |\n| resilience | `resilience\u002Floom_concurrency.rs` | 4 | lane counter, token budget, per-task seq, mutex contention |\n\nIf the reviewed code touches concurrency patterns in these modules, check if existing loom tests cover the change. If not, suggest adding a loom test.\n\n### Connectivity & Wiring Analysis\n\n**Critical insight**: A perfectly correct function that is never called is still a bug — it means the feature doesn't exist at runtime. Check for \"dead logic at the seams.\"\n\n#### Entry Point Audit\n- **Main \u002F binary entry points**: Is the new module\u002Ffunction reachable from `main()`, `lib.rs`, or the appropriate binary `main.rs`?\n- **Plugin\u002Fextension registration**: If adding a plugin, tool, or extension — is it registered in the plugin manifest, tool registry, or extension loader? (Common gap: code exists but not in `register_plugins()` or equivalent)\n- **Gateway handlers**: New JSON-RPC or WebSocket handlers must be added to the router dispatch table. Check `handlers\u002Fmod.rs` or router setup code.\n- **Event subscribers**: New event handlers must subscribe to the event bus. Is `event_bus.subscribe(handler)` called?\n- **Background task spawning**: New daemons or loops must be spawned in the system bootstrap (e.g., `tokio::spawn(daemon_task)`).\n\n#### Visibility Traps\n- **`pub` functions with no callers**: A `pub fn` in a module that is never called from outside — compiler won't warn because it's `pub`. Check if it should be `pub(crate)` or if callers are missing.\n- **`pub(crate)` in leaf modules**: If a module is only used internally, `pub(crate)` functions that are uncalled indicate dead code.\n- **Trait implementations**: A type implements a trait, but is the trait used anywhere? E.g., `impl MyTrait for Foo {}` but no `dyn MyTrait` or `\u003CT: MyTrait>` bounds reference `Foo`.\n- **Unused associated functions**: `impl Foo { pub fn new_feature() {} }` — is `new_feature()` ever invoked?\n\n#### Registration Patterns (Aleph-Specific)\n\nCheck these registries when reviewing related code:\n\n| Component | Registry Location | What to verify |\n|-----------|-------------------|----------------|\n| Built-in tools | `builtin_tools\u002Fmod.rs` or `tool_server` registration | Tool is added to the tool map |\n| Gateway handlers | `gateway\u002Fhandlers\u002Fmod.rs` | Handler enum variant + dispatch match arm |\n| Channel interfaces | `gateway\u002Finterfaces\u002Fmod.rs` | Channel type registered in factory\u002Floader |\n| MCP tools | MCP client initialization | Tool schema registered with MCP server |\n| Memory providers | Memory system initialization | Provider added to provider enum\u002Ffactory |\n| LLM providers | `providers\u002Fmod.rs` | Provider registered in provider resolution |\n| Sandbox drivers | `sandbox\u002Fmod.rs` | Driver registered in driver selection logic |\n| Compression strategies | `compressor\u002Fmod.rs` | Strategy added to strategy selector |\n| Event handlers | Event bus initialization | Handler subscribed to relevant event topic |\n\n#### Cross-Module Wiring\n- **Service composition**: If module A depends on module B's new feature, does A's factory\u002Fconstructor pass the new dependency?\n- **Configuration wiring**: New config fields must be: (1) defined in config struct, (2) parsed from file\u002Fenv, (3) passed to the component that uses it.\n- **Feature flags**: Code behind `#[cfg(feature = \"...\")]` — is the feature enabled in any build configuration? Is the feature gate tested in CI?\n- **WASM exports**: New WASM-facing functions need `#[wasm_bindgen]` and must be exported from the WASM module boundary.\n\n#### Diagnostic Commands\nUse these to detect wiring gaps:\n\n```bash\n# Find pub functions with no callers (requires cargo-udeps or manual audit)\n# Check for unused dependencies that might indicate orphaned features\ncargo udeps\n\n# Build with aggressive dead code warnings\nRUSTFLAGS=\"-W dead_code\" cargo check -p alephcore\n\n# Check if feature-gated code compiles\ncargo check -p alephcore --features \"feature-name\"\n```\n\n**Red flags**:\n- A commit adding a module but no changes to any registry, router, or main loop\n- `pub fn` added with no corresponding caller in the same PR\n- Trait impl added but no usage in `dyn` or generic contexts\n- New enum variant in a registry type but no match arm handling it\n- Event type defined but no subscriber\n- Config struct field added but never read\n\n### Type Coercion\n- Find all `as` casts — can they truncate or overflow?\n- Prefer `try_into()` or `From` implementations\n\n## Phase 3: Control Flow Simulation\n\nFor each changed function, mentally execute it:\n\n### Branch Coverage\n- List every `if\u002Felse`, `match`, and `?` branch\n- For each: what happens on the \"other\" path?\n- Flag: `if condition { do_something() }` with no `else` — is the implicit else correct?\n\n### Loop Boundaries\n- What happens when the collection is empty?\n- What happens when the collection has millions of items?\n- Is there a guaranteed termination condition?\n\n### Option\u002FResult Chains\n- Trace `.map().and_then().unwrap_or()` chains\n- Where does `None` propagate to? Is the final default value correct?\n\n### Async Ordering\n- For `tokio::spawn` or `join_all`: does the order of completion matter?\n- For channels: can messages arrive out of order? Is that handled?\n\n## Phase 4: Red-teaming\n\nSwitch to attacker mindset:\n\n1. **Malicious inputs**: What if the input is:\n   - Empty string \u002F zero-length slice\n   - Extremely long string (> 1MB)\n   - Invalid UTF-8 (if accepting bytes)\n   - NaN or Infinity (for floats)\n   - Negative numbers where positive expected\n   - Null\u002FNone where Some expected\n\n2. **Abnormal timing**:\n   - Network timeout mid-operation\n   - Two identical requests arrive simultaneously\n   - Component crashes between step 1 and step 2 of a multi-step operation\n\n3. **Generate test suggestions**: Write 3-5 concrete test cases (as Rust code snippets) that target the most likely failure modes discovered above.\n\n## Phase 5: Automated Verification (L1 + L2)\n\nIf the reviewed code touches any of these, run automated tests:\n\n| Code changed | Run command | What it verifies |\n|-------------|-------------|------------------|\n| Concurrency (Mutex, RwLock, atomics, Arc) | `just test-loom` | 21 loom tests across 5 modules |\n| Business logic, data structures, parsing | `just test-proptest` | 77 proptest tests across 9 files |\n| Both or unclear | `just test-logic` | All proptest + loom tests |\n\n**Proptest coverage** (77 tests across 9 files):\n\n| Module | Test files |\n|--------|-----------|\n| agent_loop | `proptest_decision.rs` (10), `proptest_state.rs` (10) |\n| dispatcher | `agent_types\u002Fproptest_graph.rs` (8), `agent_types\u002Fproptest_task.rs` (7) |\n| gateway | `proptest_channel.rs` (7), `proptest_protocol.rs` (7) |\n| memory | `proptest_enums.rs` (7) |\n| poe | `proptest_types.rs` (11), `proptest_budget.rs` (10) |\n\nReport the test results in the findings section. If a loom or proptest test fails, escalate to **Critical**.\n\nIf the change introduces a NEW concurrency pattern not covered by existing loom tests, add a **[Suggested Test]** with a loom test template:\n\n```rust\n#[test]\nfn loom_new_pattern_name() {\n    loom::model(|| {\n        \u002F\u002F Setup shared state using loom::sync types\n        let shared = Arc::new(Mutex::new(initial_state));\n\n        \u002F\u002F Spawn threads to exercise the pattern\n        let t1 = loom::thread::spawn(move || { \u002F* ... *\u002F });\n\n        \u002F\u002F Join and verify invariants\n        t1.join().unwrap();\n        \u002F\u002F assert!(...)\n    });\n}\n```\n\nNew loom tests go in `core\u002Fsrc\u002F\u003Cmodule>\u002Floom_concurrency.rs`, gated with `#[cfg(all(test, feature = \"loom\"))]` in the module's `mod.rs`.\n\n## Report Format\n\nOutput the report in this exact format:\n\n```markdown\n# Logic Review Report\n**Module**: \u003Cmodule name>\n**Scope**: \u003Cwhat was reviewed>\n**Date**: \u003Ctoday>\n**Mode**: \u003Cnormal|strict>\n\n## Findings\n\n### [Critical] \u003Ctitle>\n- **Location**: `file:line`\n- **Trigger condition**: \u003Chow to trigger>\n- **Expected behavior**: \u003Cwhat should happen>\n- **Actual behavior**: \u003Cwhat actually happens>\n- **Suggested fix**: \u003Chow to fix>\n\n### [Warning] \u003Ctitle>\n- **Location**: `file:line`\n- **Risk**: \u003Cwhat could go wrong>\n- **Current impact**: \u003Clow\u002Fmedium\u002Fhigh>\n- **Suggestion**: \u003Cwhat to do>\n\n### [Suggested Test] \u003Ctitle>\n\\```rust\n#[test]\nfn test_name() {\n    \u002F\u002F test code\n}\n\\```\n\n## Summary\n| Level | Count |\n|-------|-------|\n| Critical | N |\n| Warning | N |\n| Suggested Test | N |\n```\n\nFor batched reviews, append cross-module section and batch summary:\n\n```markdown\n## Cross-Module Findings\n\n### [Critical] \u003Ctitle spanning modules>\n- **Modules**: `module_a\u002Ffile.rs` → `module_b\u002Ffile.rs`\n- **Risk**: \u003Cdescription>\n- **Suggested fix**: \u003Chow to fix>\n\n## Batch Summary\n| Module | Critical | Warning | Suggested Test |\n|--------|----------|---------|----------------|\n| gateway | 2 | 5 | 3 |\n| dispatcher | 0 | 3 | 1 |\n| ... | ... | ... | ... |\n| **Cross-module** | **1** | **0** | **0** |\n| **Total** | **N** | **N** | **N** |\n```\n\n## Quality Bar\n\n- **Critical**: Must be filed. The code WILL produce wrong results under described conditions.\n- **Warning**: Should be addressed. The code MIGHT produce wrong results under edge conditions, or is fragile to future changes.\n- **Suggested Test**: Nice to have. A test that would increase confidence in the logic.\n\nIn `--strict` mode: lower the bar for Warning (include more \"might be a problem\" items).\n\n## Known Bug Patterns\n\nPatterns confirmed by full-codebase review — always check for these:\n\n- **UTF-8 byte slicing**: `&s[..n]` panics on multi-byte chars — use `s.get(..n)`, `char_indices()`, `strip_suffix()`\n- **Lock poisoning**: `lock().unwrap()` cascades panics — use `.unwrap_or_else(|e| e.into_inner())`\n- **SQL filter injection**: LanceDB DataFusion filters built via `format!()` — must escape with `escape_sql_string()`\n- **`expect()`\u002F`unwrap()` on user-facing paths**: home_dir, timestamps, HTTP clients — use fallbacks\n- **`static mut`**: unsound in Rust — use `OnceLock` or `Lazy`\n- **HashMap iteration order**: non-deterministic for security rules — sort explicitly\n- **Orphaned logic**: `pub fn` or trait impl added but no caller \u002F no `dyn` usage — feature exists in source but not at runtime. Always verify the \"last mile\" wiring to registries, routers, event buses, or main loops\n- **Partial registration**: New enum variant or handler added but missing from the dispatch `match` or factory function — compiles but silently unreachable\n\n## Aleph-Specific Invariants\n\nProject-specific rules to always check:\n\n1. **R1 Brain-Limb Separation**: No platform-specific APIs (AppKit, Vision, windows-rs) in `core\u002Fsrc\u002F`\n2. **DAG Acyclicity**: Any code touching TaskGraph must preserve the no-cycle invariant\n3. **POE Budget Monotonicity**: `current_attempt` and `tokens_used` must only increase\n4. **Session Key Determinism**: Same input must always route to the same session\n5. **Memory Namespace Isolation**: Facts in namespace A must never leak to namespace B queries\n6. **Approval Flow Integrity**: exec approval cannot be bypassed by crafted tool names\n7. **Gateway Auth State Machine**: Connection must authenticate before any RPC call succeeds\n8. **Sync Primitives Import Rule**: Use `crate::sync_primitives` for `Arc`, `Mutex`, `RwLock`, and atomics — never `std::sync` directly (except documented exceptions: static atomics, OnceLock, external API interop)\n9. **Lock Hierarchy Compliance**: Acquire locks in Level 0→1→2→3 order; reverse acquisition is a deadlock risk\n10. **TOCTOU Prevention**: Check-then-act on shared state must happen within the same lock scope (see gateway\u002Fexecution_engine TOCTOU fix as reference)\n11. **Wiring Completeness**: Every new `pub fn`, trait impl, handler, tool, provider, or event type must have a verified caller \u002F registration \u002F subscriber. Unwired code is dead code — even if it compiles\n",{"name":5,"description":7},"main","ad8cf9736a137eb206d78e1db13ac9d452fb27ac",".claude\u002Fskills\u002Frust-logic-audit",1,"https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph","https:\u002F\u002Fwww.heyaleph.com","https:\u002F\u002Fgithub.com\u002Frootazero","2026-11-14 12:27:44",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add rootazero\u002FAleph --skill rust-logic-audit",{"tool":53,"command":54},"bunx","bunx skills add rootazero\u002FAleph --skill rust-logic-audit",{"tool":56,"command":57},"pnpm","pnpm dlx skills add rootazero\u002FAleph --skill rust-logic-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frust-logic-audit\u002FSKILL.md",true,[61,67,73],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"Scripts\u002Flogic-audit.sh","SCRIPT","脚本",2924,"https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frust-logic-audit\u002FScripts\u002Flogic-audit.sh",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"SOURCE.md","REFERENCE","参考文档",188,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fyearn-heyanon-agent\u002FSOURCE.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"TRUST.auto.yaml",2217,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fyearn-heyanon-agent\u002FTRUST.auto.yaml",[78,86,107,118,126,131],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":34},"01M6CCYRW46NCCDBJVXWDRMCFY","invalid-yaml","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmarkdown_skills\u002Finvalid-yaml\u002FSKILL.md",[],[84,85],"invalid yaml","yaml",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":34},"01M6CCYNTM3981CQE5P8RXB6Y1","gh-pr-docker","GitHub PR operations (Aleph enhanced with Docker)","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmarkdown_skills\u002Fgh-pr-docker\u002FSKILL.md",[],[93,94,95,96,97,98,99,100,101,102,103,104,105,106],"gh pr docker","gh","gh pr","pr","docker","github","operations","view","list","write","format","repository","create","cli",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":34},"01M6CCYME2FV26WMXFJHWDC96R","echo-basic","Basic echo command (frontmatter smoke fixture)","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmarkdown_skills\u002Fecho-basic\u002FSKILL.md",[],[114,115,116,117],"echo basic","Echo","smoke","command",{"skillNo":119,"name":120,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":34},"01M6CCXQT84VNRDQE74JJXSYR8","review-results","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002Freview-results\u002Fskill.md",[],[21,124,125],"review results","results",{"skillNo":127,"name":120,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":34},"01M6CCXFTHNVKMMCP7NTMN5HBM","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002Fdocs\u002Fengineering-reports\u002Freview-results\u002Fskill.md",[],[124,125,21],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":34},"01M6CCXC4B64ACJWTQ033ECE4Y","severed-wire-audit","Find and resolve \"severed wires\" in a codebase — a producer and a consumer both exist and are fully implemented, but the connecting registration \u002F dispatch arm \u002F event subscription \u002F call site between them is missing, so a feature looks broken though both ends are done. dead-code lints CANNOT catch this: the producer isn't dead (it has tests) and the consumer connects to a stub or reads an inert config. Use when a feature \"looks unwired \u002F 没接上 \u002F 两端都在但连线断 \u002F 明明写了却调不到\"; after a refactor or middleware removal, to verify producers still reach consumers; when asked to \"审接缝 \u002F 找断线 \u002F seam audit \u002F wire audit \u002F connection audit\"; or when a method returns NOT_FOUND, a tool the model can't call, an event that never fires, or a config field nothing reads. Triages each finding into CONNECT (fix the wire) \u002F CUT (delete the dead abstraction) \u002F DECIDE (ask the human), enforces read-before-write so dead scaffolding is deleted not reconnected, and installs a grep-diff guard against regression.","https:\u002F\u002Fgithub.com\u002Frootazero\u002FAleph\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsevered-wire-audit\u002FSKILL.md",[],[138,19,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156],"severed wire audit","delete","code","verify","guard","tool","model","diff","regression","find","decide","broken","connect","ask","read","fix","use","dispatch","never"]