diff --git a/.gitignore b/.gitignore index 9cb54d3..3160867 100755 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,6 @@ storage/backups/ Miki-Bug-workspace/** !Miki-Bug-workspace/ !Miki-Bug-workspace/AGENT_GIT.MD + +# Local mirrored historical material (not versioned) +_legacy-vault/ diff --git a/docs/ai/restart/CONTINUITA-STORICO-DAY0.md b/docs/ai/restart/CONTINUITA-STORICO-DAY0.md new file mode 100644 index 0000000..14fe7aa --- /dev/null +++ b/docs/ai/restart/CONTINUITA-STORICO-DAY0.md @@ -0,0 +1,51 @@ +# Continuita Storico -> Day-0 + +Data aggiornamento: 11-03-2026 + +## Perche questo file + +Garantire che nulla del lavoro storico venga perso nel passaggio a Day-0, senza sporcare il nuovo Git. + +## Principio operativo + +1. Codice e release: solo repository Day-0 (`netgescon-day0`). +2. Materiale storico operativo/personale: mirror locale in `_legacy-vault` (git ignored). +3. Verita di distribuzione: branch `main` di `michele/netgescon-day0`. + +## Come sincronizzare lo storico nel Day-0 + +```bash +cd /home/michele/netgescon/netgescon-day0 +bash scripts/ops/netgescon-day0-legacy-sync.sh +``` + +Output atteso: + +- cartella: `/home/michele/netgescon/netgescon-day0/_legacy-vault` +- indice: `_legacy-vault/INDEX-LEGACY-VAULT.txt` + +## Cosa viene importato nel vault + +1. `Miki-Bug-workspace/` +2. `docs/ai/` +3. `docs/00-IMPORT/` +4. `docs/incidents/` +5. `incoming/` +6. `CREDENZIALI_UI_LOCALI_20260311_121500.md` (se presente) + +## Come riprendere in una nuova sessione agent + +1. Chiedi all'agent di leggere: + - `docs/ai/restart/START-HERE-NETGESCON-DAY0.md` + - `docs/ai/restart/HANDOFF_AGENT_OPERATIVO_20260311.md` + - `docs/ai/restart/CONTINUITA-STORICO-DAY0.md` +2. Se serve contesto storico extra, usare `_legacy-vault/`. +3. Le modifiche da rilasciare devono restare nel tree principale Day-0, non nel vault. + +## Checklist anti-perdita + +- [ ] Backup locale presente +- [ ] Backup esterno presente +- [ ] `git status` pulito in Day-0 prima di release +- [ ] Sync vault eseguita almeno una volta al giorno durante migrazione +- [ ] Handoff aggiornato in `docs/ai/restart/` diff --git a/scripts/ops/netgescon-day0-legacy-sync.sh b/scripts/ops/netgescon-day0-legacy-sync.sh new file mode 100755 index 0000000..0cfeb73 --- /dev/null +++ b/scripts/ops/netgescon-day0-legacy-sync.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Mirrors historical/local materials from legacy workspace into Day-0 local vault. +# The vault is intentionally git-ignored in Day-0. + +SOURCE_DIR="/home/michele/netgescon/netgescon-laravel" +TARGET_DIR="/home/michele/netgescon/netgescon-day0/_legacy-vault" + +usage() { + cat <<'EOF' +Usage: + bash scripts/ops/netgescon-day0-legacy-sync.sh [--source ] [--target ] +EOF +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --source) SOURCE_DIR="$2"; shift 2 ;; + --target) TARGET_DIR="$2"; shift 2 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; exit 1 ;; + esac +done + +mkdir -p "$TARGET_DIR" + +sync_dir() { + local rel="$1" + if [[ -d "$SOURCE_DIR/$rel" ]]; then + mkdir -p "$TARGET_DIR/$rel" + rsync -a --delete "$SOURCE_DIR/$rel/" "$TARGET_DIR/$rel/" + echo "SYNC_DIR $rel" + else + echo "SKIP_DIR $rel" + fi +} + +sync_file() { + local rel="$1" + if [[ -f "$SOURCE_DIR/$rel" ]]; then + mkdir -p "$TARGET_DIR/$(dirname "$rel")" + cp -f "$SOURCE_DIR/$rel" "$TARGET_DIR/$rel" + echo "SYNC_FILE $rel" + else + echo "SKIP_FILE $rel" + fi +} + +# Historical/context sources for continuity. +sync_dir "Miki-Bug-workspace" +sync_dir "docs/ai" +sync_dir "docs/00-IMPORT" +sync_dir "docs/incidents" +sync_dir "incoming" + +sync_file "CREDENZIALI_UI_LOCALI_20260311_121500.md" +sync_file "netgescon-day0.code-workspace" + +# Create a compact index for quick lookup. +index="$TARGET_DIR/INDEX-LEGACY-VAULT.txt" +{ + echo "Legacy Vault Index" + echo "Generated: $(date '+%Y-%m-%d %H:%M:%S')" + echo "Source: $SOURCE_DIR" + echo "Target: $TARGET_DIR" + echo + find "$TARGET_DIR" -maxdepth 4 -type d | sort +} > "$index" + +echo "DONE" +echo "INDEX: $index"