workspace-v1/devtools/scripts/validation/validate-project-structure.sh
rckrdmrd fa13a9760d chore: Configurar arquitectura de subrepositorios
Cambios principales:
- Actualizar .gitmodules: gamilit usa HTTPS (github.com)
- Actualizar .gitignore: ignorar proyectos con repos en Gitea
- Crear SUBREPOSITORIOS.md: documentacion de arquitectura de repos
- Actualizar submodulo gamilit: sincronizado con workspace desarrollo

Proyectos removidos del tracking (4050 archivos):
- erp-suite, erp-core, erp-construccion, erp-clinicas
- erp-retail, erp-mecanicas-diesel, erp-vidrio-templado
- trading-platform, betting-analytics, inmobiliaria-analytics
- platform_marketing_content

Estos proyectos tienen repositorios independientes en Gitea:
http://72.60.226.4:3000/rckrdmrd/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 05:27:54 -06:00

131 lines
4.4 KiB
Bash
Executable File

#!/bin/bash
# =============================================================================
# validate-project-structure.sh
# Validar estructura de proyecto segun estandar EPIC-011
# Sistema: NEXUS v3.4 + SIMCO
# =============================================================================
set -e
PROJECT_PATH="${1:-.}"
PROJECT_NAME=$(basename "$PROJECT_PATH")
# Colores
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
ERRORS=0
WARNINGS=0
echo "=============================================="
echo "Validando: $PROJECT_NAME"
echo "Ruta: $PROJECT_PATH"
echo "=============================================="
echo ""
# -----------------------------------------------------------------------------
# Funcion para verificar existencia
# -----------------------------------------------------------------------------
check_exists() {
local path="$1"
local type="$2" # "dir" o "file"
local required="$3" # "required" o "recommended"
local name="$4"
if [ "$type" = "dir" ]; then
if [ -d "$path" ]; then
echo -e "${GREEN}[OK]${NC} $name"
return 0
fi
else
if [ -f "$path" ]; then
echo -e "${GREEN}[OK]${NC} $name"
return 0
fi
fi
if [ "$required" = "required" ]; then
echo -e "${RED}[ERROR]${NC} Falta: $name"
((ERRORS++)) || true
return 1
else
echo -e "${YELLOW}[WARN]${NC} Recomendado: $name"
((WARNINGS++)) || true
return 0
fi
}
# -----------------------------------------------------------------------------
# Validacion de orchestration/
# -----------------------------------------------------------------------------
echo "--- Verificando orchestration/ ---"
check_exists "$PROJECT_PATH/orchestration" "dir" "required" "orchestration/"
check_exists "$PROJECT_PATH/orchestration/00-guidelines" "dir" "required" "orchestration/00-guidelines/"
# Archivos obligatorios en 00-guidelines
echo ""
echo "--- Archivos obligatorios ---"
check_exists "$PROJECT_PATH/orchestration/00-guidelines/CONTEXTO-PROYECTO.md" "file" "required" "CONTEXTO-PROYECTO.md"
check_exists "$PROJECT_PATH/orchestration/00-guidelines/HERENCIA-SIMCO.md" "file" "required" "HERENCIA-SIMCO.md"
check_exists "$PROJECT_PATH/orchestration/00-guidelines/PROJECT-STATUS.md" "file" "required" "PROJECT-STATUS.md"
# Inventarios
echo ""
echo "--- Inventarios ---"
check_exists "$PROJECT_PATH/orchestration/inventarios" "dir" "required" "orchestration/inventarios/"
check_exists "$PROJECT_PATH/orchestration/inventarios/MASTER_INVENTORY.yml" "file" "recommended" "MASTER_INVENTORY.yml"
# Trazas (recomendado)
echo ""
echo "--- Trazas ---"
check_exists "$PROJECT_PATH/orchestration/trazas" "dir" "recommended" "orchestration/trazas/"
# README
echo ""
echo "--- Documentacion ---"
check_exists "$PROJECT_PATH/orchestration/README.md" "file" "recommended" "orchestration/README.md"
check_exists "$PROJECT_PATH/docs/_MAP.md" "file" "recommended" "docs/_MAP.md"
# -----------------------------------------------------------------------------
# Validar contenido de HERENCIA-SIMCO.md
# -----------------------------------------------------------------------------
echo ""
echo "--- Validando rutas en HERENCIA-SIMCO.md ---"
HERENCIA_FILE="$PROJECT_PATH/orchestration/00-guidelines/HERENCIA-SIMCO.md"
if [ -f "$HERENCIA_FILE" ]; then
# Verificar que no tenga rutas obsoletas (workspace sin -v1)
if grep -q "/home/isem/workspace/" "$HERENCIA_FILE" 2>/dev/null; then
if ! grep -q "workspace-v1" "$HERENCIA_FILE" 2>/dev/null; then
echo -e "${RED}[ERROR]${NC} Rutas obsoletas encontradas en HERENCIA-SIMCO.md"
((ERRORS++)) || true
else
echo -e "${GREEN}[OK]${NC} Rutas correctas en HERENCIA-SIMCO.md"
fi
else
echo -e "${GREEN}[OK]${NC} Sin rutas obsoletas en HERENCIA-SIMCO.md"
fi
else
echo -e "${YELLOW}[SKIP]${NC} HERENCIA-SIMCO.md no existe"
fi
# -----------------------------------------------------------------------------
# Resumen
# -----------------------------------------------------------------------------
echo ""
echo "=============================================="
echo "RESUMEN: $PROJECT_NAME"
echo "=============================================="
echo -e "Errores: ${RED}$ERRORS${NC}"
echo -e "Warnings: ${YELLOW}$WARNINGS${NC}"
echo ""
if [ $ERRORS -eq 0 ]; then
echo -e "${GREEN}Estado: PASS${NC}"
exit 0
else
echo -e "${RED}Estado: FAIL${NC}"
exit 1
fi