Files
arnes/scripts/start.sh
rikrdo 3ff9b70e4c 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.
2026-05-17 23:25:35 +02:00

174 lines
4.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
ask() {
local prompt="$1"; local def="${2:-}"; local val
if [ -n "$def" ]; then
read -r -p "$prompt [$def]: " val || true
echo "${val:-$def}"
else
read -r -p "$prompt: " val || true
echo "$val"
fi
}
echo "=== ARNES start wizard ==="
echo "Mode: clone arnes-fork, put your app folder inside, run this wizard."
PROJECT_NAME="$(ask 'Project name' 'my-project')"
PROJECT_DESC="$(ask 'Project description' 'Project using ARNES template')"
APP_DIR="$(ask 'App directory (relative)' 'app')"
STACK_CHOICE="$(ask 'Stack preset (1=default Flask+MariaDB+Skeleton, 2=custom)' '1')"
if [ "$STACK_CHOICE" = "2" ]; then
BACKEND="$(ask 'Backend stack' 'python/flask')"
DB="$(ask 'Database' 'mariadb')"
CSSFW="$(ask 'CSS framework' 'skeleton')"
else
BACKEND="python/flask"
DB="mariadb"
CSSFW="skeleton"
fi
TEST_CMD="$(ask 'Test command' 'make test')"
LINT_CMD="$(ask 'Lint command (optional)' '')"
MODEL_MODE="$(ask 'Model mode (lean/balanced/power)' 'lean')"
ADD_BOOTSTRAP="$(ask 'Create bootstrap ticket F-001 now? (y/n)' 'y')"
mkdir -p "$APP_DIR"
if [ "$CSSFW" = "skeleton" ]; then
mkdir -p "$APP_DIR/static/css" "$APP_DIR/static/images"
cp -n defaults/flask-skeleton/static/css/normalize.css "$APP_DIR/static/css/normalize.css" || true
cp -n defaults/flask-skeleton/static/css/skeleton.css "$APP_DIR/static/css/skeleton.css" || true
cp -n defaults/flask-skeleton/static/images/favicon.png "$APP_DIR/static/images/favicon.png" || true
fi
cat > harness/project.config.json <<JSON
{
"project_name": "$PROJECT_NAME",
"project_description": "$PROJECT_DESC",
"app_dir": "$APP_DIR",
"stack": {
"backend": "$BACKEND",
"database": "$DB",
"css": "$CSSFW"
},
"commands": {
"test": "$TEST_CMD",
"lint": "$LINT_CMD"
},
"model_mode": "$MODEL_MODE"
}
JSON
cat > scripts/verify.local.sh <<'SH'
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
if [ ! -f "harness/project.config.json" ]; then
echo "[LOCAL] missing harness/project.config.json"
exit 1
fi
APP_DIR=$(python3 - <<'PY'
import json
from pathlib import Path
cfg=json.loads(Path('harness/project.config.json').read_text())
print(cfg.get('app_dir','app'))
PY
)
TEST_CMD=$(python3 - <<'PY'
import json
from pathlib import Path
cfg=json.loads(Path('harness/project.config.json').read_text())
print(cfg.get('commands',{}).get('test',''))
PY
)
LINT_CMD=$(python3 - <<'PY'
import json
from pathlib import Path
cfg=json.loads(Path('harness/project.config.json').read_text())
print(cfg.get('commands',{}).get('lint',''))
PY
)
if [ ! -d "$APP_DIR" ]; then
echo "[LOCAL] app dir not found: $APP_DIR"
exit 1
fi
echo "[LOCAL] app dir OK: $APP_DIR"
if [ -n "$LINT_CMD" ]; then
echo "[LOCAL] lint: $LINT_CMD"
bash -lc "$LINT_CMD"
fi
if [ -n "$TEST_CMD" ]; then
echo "[LOCAL] test: $TEST_CMD"
bash -lc "$TEST_CMD"
fi
echo "[LOCAL] OK"
SH
chmod +x scripts/verify.local.sh
python3 - <<PY
import json
from pathlib import Path
from datetime import date
b=Path('backlog/features.json')
data=json.loads(b.read_text(encoding='utf-8'))
data['project']='$PROJECT_NAME'
data['description']='$PROJECT_DESC'
features=data.get('features',[])
if '$ADD_BOOTSTRAP'.lower().startswith('y') and not features:
features.append({
'id':'F-001',
'title':'Bootstrap ARNES on project',
'description':'Setup ARNES pipeline and run first complete feature cycle.',
'acceptance':['verify.sh is green','runtime status works','first feature closes with gates'],
'status':'pending',
'created_at':str(date.today()),
'gates':{'review':False,'security':False,'qa':False}
})
data['features']=features
b.write_text(json.dumps(data,indent=2,ensure_ascii=False)+'\n',encoding='utf-8')
PY
cat > work/current.md <<EOF
# Current session
- Feature in progress: _none_
- Orchestrator: _leader_
## Plan
- Pick one pending feature.
- Run ./scripts/verify.sh
- Set runtime status.
## Next step
- Use python3 scripts/new_ticket.py to create first real ticket.
EOF
python3 scripts/agent_status.py reset >/dev/null || true
echo ""
echo "Done. Project configured."
echo "- Config: harness/project.config.json"
echo "- Local checks: scripts/verify.local.sh"
echo "- Ticket tool: python3 scripts/new_ticket.py"
echo "- Verify: ./scripts/verify.sh"
echo "- Runtime: python3 scripts/agent_status.py show"