Trace the history of a decision topic. Use when the user asks "why did we change X?", "what decided Y?", "show me the decision lineage for Z", or uses /tentaqles:decision-lineage.
Answer "why did we change X?" by searching decisions semantically and traversing the full supersession lineage.
The user's query / topic is: $ARGUMENTS
python -c "
import sys, json
sys.path.insert(0, '${CLAUDE_PLUGIN_ROOT}')
from tentaqles.manifest.loader import load_manifest
from tentaqles.memory.store import MemoryStore
import os
cwd = os.getcwd()
manifest = load_manifest(cwd)
client_root = manifest.get('_client_root', cwd) if manifest else cwd
store = MemoryStore(client_root)
topic = '$ARGUMENTS'
# 1. Semantic search for the most relevant active decision.
hits = store.search_memory(topic, limit=5)
decision_hits = [h for h in hits if h['type'] == 'decision']
if not decision_hits:
print('No decisions found related to:', topic)
store.close()
sys.exit(0)
# 2. Take the top-scoring decision and traverse its lineage.
top = decision_hits[0]
print(f'## Best match (score {top[\"score\"]:.3f})')
print(f' {top[\"text\"][:120]}')
print()
lineage = store.get_decision_lineage(top['id'])
chain = lineage.get('chain', [])
if len(chain) <= 1:
print('No supersession history — this decision has never changed.')