53 lines
1.6 KiB
Bash
Executable File
53 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
TOPIC_FILE="docs/ai/procedure/current-topic.txt"
|
|
TOPIC_ARG="${1:-}"
|
|
|
|
if [[ -n "$TOPIC_ARG" ]]; then
|
|
TOPIC="$TOPIC_ARG"
|
|
elif [[ -f "$TOPIC_FILE" ]]; then
|
|
TOPIC="$(head -n 1 "$TOPIC_FILE")"
|
|
else
|
|
TOPIC="Filo Logico Contabilita"
|
|
fi
|
|
|
|
mkdir -p docs/ai/procedure docs/ai/restart/compact-summaries
|
|
|
|
echo "[1/6] Aggiorno summary ultime 2 chat (full + compact)..."
|
|
python3 scripts/ai/summarize_latest_two_chats.py
|
|
|
|
echo "[2/6] Aggiorno brief di ripartenza..."
|
|
bash scripts/ai/restart_brief.sh "$TOPIC" > docs/ai/procedure/LAST_RESTART_BRIEF.txt
|
|
|
|
echo "[3/6] Aggiorno summary day/week..."
|
|
bash scripts/ai/save_periodic_summary.sh "$TOPIC" both
|
|
|
|
echo "[4/6] Aggiorno checkpoint continuity..."
|
|
bash scripts/ai/continuity_auto.sh --threshold=150 --topic="$TOPIC" --note="Auto realign $(date +%F)"
|
|
|
|
echo "[5/6] Aggiorno control tower governance..."
|
|
python3 scripts/ai/governance_sync.py
|
|
|
|
echo "[6/7] Aggiorno bootstrap stato..."
|
|
TS="$(date '+%Y-%m-%d %H:%M:%S')"
|
|
cat > docs/ai/procedure/LAST_AUTORUN.md <<EOF
|
|
# Last Auto Realign
|
|
|
|
- Timestamp: $TS
|
|
- Topic: $TOPIC
|
|
- Restart brief: docs/ai/procedure/LAST_RESTART_BRIEF.txt
|
|
- Recovery latest 2: docs/ai/LATEST_2_CHATS_RECOVERY.md
|
|
- Compact summaries: docs/ai/restart/compact-summaries/
|
|
- Direction snapshot: docs/ai/control-tower/DIRECTION_SNAPSHOT.md
|
|
- Open bugs master: docs/ai/control-tower/OPEN_BUGS_MASTER.md
|
|
- Daily summary: docs/ai/summaries/daily/$(date +%F).md
|
|
- Weekly summary: docs/ai/summaries/weekly/$(date +%G-W%V).md
|
|
EOF
|
|
|
|
echo "[7/7] Completato."
|
|
echo "Output principale: docs/ai/procedure/LAST_AUTORUN.md"
|