refactor: remove legacy responder + agent_ux, add Gitea integration tests

Legacy removal:
- DELETE src/brain/responder.rs (900 lines) — replaced by orchestrator
- DELETE src/agent_ux.rs (184 lines) — UX moved to transport bridges
- EXTRACT chat_blocking() to src/brain/chat.rs (standalone utility)
- sync.rs: uses ConversationRegistry directly (no responder)
- main.rs: holds ToolRegistry + Personality directly (no Responder wrapper)
- research.rs: progress updates via tracing (no AgentProgress)

Gitea integration testing:
- docker-compose: added Gitea service with healthcheck
- bootstrap-gitea.sh: creates admin, org, mirrors 6 real repos from
  src.sunbeam.pt (sol, cli, proxy, storybook, admin-ui, mistralai-client-rs)
- PAT provisioning for SDK testing without Vault
- code_index/gitea.rs: fixed directory listing (direct API calls instead
  of SDK's single-object parser), proper base64 file decoding

New integration tests:
- Gitea: list_repos, get_repo, get_file, directory listing, code indexing
- Web search: SearXNG query with result verification
- Conversation registry: lifecycle + send_message round-trip
- Evaluator: rule matching (DM, own message)
- gRPC bridge: event filtering, tool call mapping, thinking→status
This commit is contained in:
2026-03-24 11:45:43 +00:00
parent ec55984fd8
commit 495c465a01
15 changed files with 578 additions and 901 deletions

86
dev/bootstrap-gitea.sh Executable file
View File

@@ -0,0 +1,86 @@
#!/bin/bash
## Bootstrap Gitea for local dev/testing.
## Creates admin user, org, and mirrors public repos from src.sunbeam.pt.
## Run after: docker compose -f docker-compose.dev.yaml up -d gitea
set -euo pipefail
GITEA="http://localhost:3000"
ADMIN_USER="sol"
ADMIN_PASS="solpass123"
ADMIN_EMAIL="sol@sunbeam.local"
SOURCE="https://src.sunbeam.pt"
echo "Waiting for Gitea..."
until curl -sf "$GITEA/api/v1/version" >/dev/null 2>&1; do
sleep 2
done
echo "Gitea is ready."
# Create admin user via container CLI (can't use API without existing admin)
echo "Creating admin user..."
docker compose -f docker-compose.dev.yaml exec -T --user git gitea \
gitea admin user create \
--username "$ADMIN_USER" --password "$ADMIN_PASS" \
--email "$ADMIN_EMAIL" --admin --must-change-password=false 2>/dev/null || true
echo "Admin user ready."
# Create studio org
echo "Creating studio org..."
curl -sf -X POST "$GITEA/api/v1/orgs" \
-H 'Content-Type: application/json' \
-u "$ADMIN_USER:$ADMIN_PASS" \
-d '{"username":"studio","full_name":"Sunbeam Studios","visibility":"public"}' \
> /dev/null 2>&1 || true
# Mirror repos from src.sunbeam.pt (public, no auth needed)
REPOS=(
"sol"
"cli"
"proxy"
"storybook"
"admin-ui"
"mistralai-client-rs"
)
for repo in "${REPOS[@]}"; do
echo "Migrating studio/$repo from src.sunbeam.pt..."
curl -sf -X POST "$GITEA/api/v1/repos/migrate" \
-H 'Content-Type: application/json' \
-u "$ADMIN_USER:$ADMIN_PASS" \
-d "{
\"clone_addr\": \"$SOURCE/studio/$repo.git\",
\"repo_name\": \"$repo\",
\"repo_owner\": \"studio\",
\"service\": \"gitea\",
\"mirror\": false
}" > /dev/null 2>&1 && echo "$repo" || echo " $repo (already exists or failed)"
done
# Create a PAT for the admin user (for SDK testing without Vault)
echo "Creating admin PAT..."
PAT=$(curl -sf -X POST "$GITEA/api/v1/users/$ADMIN_USER/tokens" \
-H 'Content-Type: application/json' \
-u "$ADMIN_USER:$ADMIN_PASS" \
-d '{"name":"sol-dev-pat","scopes":["read:repository","write:repository","read:user","read:organization","read:issue","write:issue","read:notification"]}' \
2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha1',json.load(sys.stdin).get('token','')))" 2>/dev/null || echo "")
if [ -z "$PAT" ]; then
# Token might already exist — try to get it
PAT="already-provisioned"
echo " PAT already exists (or creation failed)"
else
echo " PAT: ${PAT:0:8}..."
fi
echo ""
echo "Gitea bootstrap complete."
echo " Admin: $ADMIN_USER / $ADMIN_PASS"
echo " Org: studio"
echo " Repos: ${REPOS[*]}"
echo " URL: $GITEA"
if [ "$PAT" != "already-provisioned" ] && [ -n "$PAT" ]; then
echo ""
echo "Add to .env:"
echo " GITEA_PAT=$PAT"
fi