гих хук и сохранение изменений в контексте стори

This commit is contained in:
2026-01-31 00:32:36 +03:00
parent 5ce6335ad8
commit 20af12f47d
17 changed files with 695 additions and 40 deletions

View File

@@ -20,16 +20,15 @@ if [ -z "$STORY" ]; then
exit 0
fi
# Run index (changed files only: previous commit -> HEAD)
# Run index: all changes in the story (main..HEAD), not per-commit
if command -v rag-agent >/dev/null 2>&1; then
rag-agent index --changed --base-ref HEAD~1 --head-ref HEAD --story "$STORY"
rag-agent index --changed --base-ref main --head-ref HEAD --story "$STORY"
elif [ -n "${VIRTUAL_ENV}" ]; then
rag-agent index --changed --base-ref HEAD~1 --head-ref HEAD --story "$STORY"
rag-agent index --changed --base-ref main --head-ref HEAD --story "$STORY"
else
# Try repo venv or python -m
if [ -f "venv/bin/rag-agent" ]; then
venv/bin/rag-agent index --changed --base-ref HEAD~1 --head-ref HEAD --story "$STORY"
venv/bin/rag-agent index --changed --base-ref main --head-ref HEAD --story "$STORY"
else
PYTHONPATH=src python -m rag_agent.cli index --changed --base-ref HEAD~1 --head-ref HEAD --story "$STORY" 2>/dev/null || true
PYTHONPATH=src python -m rag_agent.cli index --changed --base-ref main --head-ref HEAD --story "$STORY" 2>/dev/null || true
fi
fi