BUG: HTTP apply_seed uses bundled() instead of discover() — external seeds silently fail #201

Open
opened 2026-05-24 06:07:43 +00:00 by toasterson · 0 comments
Owner

Severity: P0 — External seed packs never applied via HTTP API

Root Cause

src/bin/akhomed.rs:357 — the HTTP apply_seed handler initializes SeedRegistry::bundled() which only exposes 3 compiled-in packs (identity, ontology, common-sense). External packs in ~/.local/share/akh-medu/seeds/ are invisible.

The status/list handler at src/bin/akhomed.rs:1684 correctly uses SeedRegistry::discover(&seeds_dir) so the status shows 5 packs, but only 3 can actually be applied.

Secondary: CLI redb lock contention

CLI akh seed apply creates fresh Engine::new(config) (src/main.rs:962) which opens the same redb file already held by the running daemon → exclusive lock blocks → SIGKILL.

Files

  • src/bin/akhomed.rs:357 — apply_seed handler: SeedRegistry::bundled() should be SeedRegistry::discover(&seeds_dir)
  • src/main.rs:962 — CLI creates new Engine on already-locked redb file
  • src/seeds/mod.rs:232-245 — is_seed_applied silently returns false on symbol resolution error

Fix

One-line fix (CRITICAL): Change SeedRegistry::bundled() to SeedRegistry::discover(&seeds_dir) at src/bin/akhomed.rs:357.

Secondary: Auto-apply seeds on workspace creation. Make is_seed_applied log warnings instead of silently returning false. Add triple dedup in KnowledgeGraph::insert_triple.

## Severity: P0 — External seed packs never applied via HTTP API ## Root Cause `src/bin/akhomed.rs:357` — the HTTP apply_seed handler initializes `SeedRegistry::bundled()` which only exposes 3 compiled-in packs (identity, ontology, common-sense). External packs in `~/.local/share/akh-medu/seeds/` are invisible. The status/list handler at `src/bin/akhomed.rs:1684` correctly uses `SeedRegistry::discover(&seeds_dir)` so the status shows 5 packs, but only 3 can actually be applied. ## Secondary: CLI redb lock contention CLI `akh seed apply` creates fresh `Engine::new(config)` (`src/main.rs:962`) which opens the same redb file already held by the running daemon → exclusive lock blocks → SIGKILL. ## Files - `src/bin/akhomed.rs:357` — apply_seed handler: `SeedRegistry::bundled()` should be `SeedRegistry::discover(&seeds_dir)` - `src/main.rs:962` — CLI creates new Engine on already-locked redb file - `src/seeds/mod.rs:232-245` — is_seed_applied silently returns false on symbol resolution error ## Fix **One-line fix (CRITICAL):** Change `SeedRegistry::bundled()` to `SeedRegistry::discover(&seeds_dir)` at `src/bin/akhomed.rs:357`. **Secondary:** Auto-apply seeds on workspace creation. Make is_seed_applied log warnings instead of silently returning false. Add triple dedup in KnowledgeGraph::insert_triple.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
toasterson/akh-medu#201
No description provided.