refactor: complete bootstrap of ARNES agent harness framework

- Add complete agent harness structure with 8 roles (leader, triager, architect, implementer, reviewer, security, qa, documenter)
- Implement strict workflow with 9 stages and mandatory gates
- Add comprehensive verification script and runtime status tracking
- Create artifact-based evidence system with contracts and schemas
- Add agent policy matrix with permissions and anti-cheat rules
- Include test suite (44 tests passing) and CI-ready structure
- Add documentation: README, HOWTO, CHECKPOINTS, templates
- Configure model routing policies and token-aware task assignment
- Add BDD/SDD specification guides and feature templates
- Include starter pack for quick project onboarding

All verification checks pass. Framework ready for production use.
This commit is contained in:
rikrdo
2026-05-17 23:25:35 +02:00
parent 622e5df382
commit 3ff9b70e4c
104 changed files with 8534 additions and 187 deletions

View File

@@ -12,6 +12,8 @@ fail() { printf "${RED}[FAIL]${NC} %s\n" "$1"; }
EXIT_CODE=0
cd "$(dirname "$0")/.." || exit 1
echo "── 1) Verificando estructura base ─────────────────────"
required=(
"AGENTS.md"
@@ -21,6 +23,9 @@ required=(
"harness/policies/governance.md"
"harness/policies/security.md"
"harness/policies/quality.md"
"harness/policies/language.md"
"harness/policies/model-routing.md"
"harness/models.profiles.yml"
"harness/contracts/handoff.md"
"harness/contracts/evidence.schema.json"
"spec/product.md"
@@ -29,6 +34,11 @@ required=(
"backlog/features.json"
"work/current.md"
"work/history.md"
"work/runtime-status.json"
"scripts/agent_status.py"
"scripts/new_ticket.py"
"scripts/start.sh"
"platforms/pi/README.md"
)
for f in "${required[@]}"; do
@@ -62,6 +72,11 @@ if not isinstance(features, list):
print('[FAIL] features debe ser una lista')
sys.exit(1)
ids = [str(f.get('id', '')).strip() for f in features]
if len(ids) != len(set(ids)):
print('[FAIL] Hay IDs de feature duplicados en backlog/features.json')
sys.exit(1)
in_progress = [f for f in features if f.get('status') == 'in_progress']
if len(in_progress) > 1:
print(f"[FAIL] Hay {len(in_progress)} features in_progress (máximo 1)")
@@ -76,7 +91,7 @@ for f in features:
if status == 'done':
d = root / 'work' / 'artifacts' / fid
req = ['reviewer.json', 'security.json', 'qa.json', 'leader-close.json']
req = ['reviewer.json', 'security.json', 'qa.json', 'leader-close.json', 'documenter.md']
missing = [name for name in req if not (d / name).is_file()]
if missing:
print(f"[FAIL] Feature {fid} done sin artefactos: {', '.join(missing)}")
@@ -106,8 +121,32 @@ print(f"[OK] backlog válido ({len(features)} features)")
PY
if [ $? -ne 0 ]; then EXIT_CODE=1; fi
python3 - <<'PY'
import json
import pathlib
import sys
path = pathlib.Path('work/runtime-status.json')
required = ['feature_id', 'stage', 'agent', 'action', 'state', 'next_agent', 'waiting_for', 'updated_at', 'timeline']
try:
data = json.loads(path.read_text(encoding='utf-8'))
except Exception as e:
print(f"[FAIL] work/runtime-status.json inválido: {e}")
sys.exit(1)
missing = [key for key in required if key not in data]
if missing:
print(f"[FAIL] work/runtime-status.json incompleto: {', '.join(missing)}")
sys.exit(1)
if not isinstance(data.get('timeline'), list):
print('[FAIL] work/runtime-status.json timeline debe ser una lista')
sys.exit(1)
print('[OK] runtime-status válido')
PY
if [ $? -ne 0 ]; then EXIT_CODE=1; fi
echo ""
echo "── 3) Verificación de tests/build (opcional auto-detect) ─"
echo "── 3) Verificación de tests/build (auto-detect) ───────"
if [ -f "Makefile" ] && grep -qE '^test:' Makefile; then
if make test; then ok "make test OK"; else fail "make test falló"; EXIT_CODE=1; fi
elif [ -f "package.json" ]; then
@@ -127,9 +166,24 @@ else
fi
echo ""
echo "── 4) Resumen ─────────────────────────────────────────"
echo "── 4) Overlay local opcional ─────────────────────────"
if [ -x "scripts/verify.local.sh" ]; then
if ./scripts/verify.local.sh; then
ok "verify.local.sh OK"
else
fail "verify.local.sh falló"
EXIT_CODE=1
fi
elif [ -f "scripts/verify.local.sh" ]; then
warn "scripts/verify.local.sh existe pero no es ejecutable"
else
warn "Sin overlay local (scripts/verify.local.sh)"
fi
echo ""
echo "── 5) Resumen ─────────────────────────────────────────"
if [ $EXIT_CODE -eq 0 ]; then
ok "Harness verificado. Puedes trabajar."
ok "Harness verificado. Template listo para adaptar a cualquier proyecto."
else
fail "Harness NO verificado. Corrige antes de continuar."
fi