feat(submodule): atualizar submodulo .agent na branch master ao iniciar sessao

This commit is contained in:
Luiz Silva 2026-10-08 11:15:14 -03:00
parent b1c4c5c42e
commit 29e5bc979e
14 changed files with 306 additions and 13 deletions

View file

@ -30,6 +30,28 @@ echo -e "${AZUL}${NEGRITO}======================================================
TOTAL_ERROS=0
TOTAL_AVISOS=0
# 0. Validar Submódulo .agent e tracking da branch master
echo -e "\n${NEGRITO}[0/6] Submódulo .agent (Sincronização & Branch Master)${RESET}"
if [ -f "$ROOT_DIR/.gitmodules" ]; then
if grep -q '\[submodule "\.agent"\]' "$ROOT_DIR/.gitmodules"; then
echo -e " ${VERDE}✓${RESET} Submódulo .agent configurado em .gitmodules."
SUBMODULE_BRANCH=$(git -C "$ROOT_DIR" config -f .gitmodules submodule..agent.branch 2>/dev/null || true)
if [ "$SUBMODULE_BRANCH" = "master" ]; then
echo -e " ${VERDE}✓${RESET} Submódulo configurado para rastrear branch: ${NEGRITO}master${RESET}"
else
echo -e " ${AMARELO}⚠${RESET} Submódulo .agent não possui 'branch = master' configurado no .gitmodules."
echo -e " Execute: git submodule set-branch --branch master .agent"
TOTAL_AVISOS=$((TOTAL_AVISOS + 1))
fi
else
echo -e " ${VERMELHO}✗${RESET} Entrada do submódulo .agent não encontrada em .gitmodules."
TOTAL_ERROS=$((TOTAL_ERROS + 1))
fi
else
echo -e " ${AMARELO}⚠${RESET} Arquivo .gitmodules não encontrado na raiz."
fi
# 1. Validar memorias-ia/modulo.yml (Pilar 6 - Identidade)
MODULO_YML="$ROOT_DIR/memorias-ia/modulo.yml"
echo -e "\n${NEGRITO}[1/6] Identidade do Módulo (memorias-ia/modulo.yml)${RESET}"