Parent
Epic: #43
Problem
The terraphim KG is global (~/.config/terraphim/kg/). When working on multiple book titles, KG entries from one title should not interfere with another. Need a mechanism to activate/deactivate per-title entries.
Proposed Solution
Script: publishing/scripts/switch-title.sh <slug>
Directory Structure
~/.config/terraphim/kg/
bun.md # global (always active)
bun_install.md # global
Terraphim AI.md # global
publishing/ # publishing-specific
context-graphs-for-engineers/
context graph.md
decision trace.md
...
title-2-slug/
...
.active-title # marker: current slug
switch-title.sh Behavior
- Read current active title from
~/.config/terraphim/kg/.active-title
- If different from requested slug:
- Remove symlinks from previous title's entries in the KG root
- Create symlinks for new title's entries:
kg/publishing/<slug>/*.md -> kg/
- Update
.active-title marker file
- Rebuild Aho-Corasick automata:
terraphim-agent graph --role "Publishing Editor"
- Report: "Switched from to , N entries activated"
Alternative (simpler)
Instead of symlinks, the role config (#45) already points to kg/publishing/. If terraphim-agent scans subdirectories recursively, no switching is needed -- just update .active-title for the ${ACTIVE_TITLE_DIR} haystack substitution.
Need to verify: does terraphim-agent scan kg/publishing/ recursively or only the root?
Dependencies
Parent
Epic: #43
Problem
The terraphim KG is global (
~/.config/terraphim/kg/). When working on multiple book titles, KG entries from one title should not interfere with another. Need a mechanism to activate/deactivate per-title entries.Proposed Solution
Script:
publishing/scripts/switch-title.sh <slug>Directory Structure
switch-title.sh Behavior
~/.config/terraphim/kg/.active-titlekg/publishing/<slug>/*.md->kg/.active-titlemarker fileterraphim-agent graph --role "Publishing Editor"Alternative (simpler)
Instead of symlinks, the role config (#45) already points to
kg/publishing/. If terraphim-agent scans subdirectories recursively, no switching is needed -- just update.active-titlefor the${ACTIVE_TITLE_DIR}haystack substitution.Need to verify: does terraphim-agent scan
kg/publishing/recursively or only the root?Dependencies
${ACTIVE_TITLE_DIR}from.active-titlekg/publishing/<slug>/