waxwing/manage.sh
pyr0ball 5f5cb99db6 feat: bootstrap Waxwing Phase 1 scaffold
Plant registry, grow event calendar, and gardening knowledge base
populated via cf-harvest ingest endpoint. All 23 tests passing.

Stack:
- FastAPI + SQLite (cf-core migrations) on port 8522
- Vue 3 + Vite + Pinia SPA on port 8521
- 5 SQL migrations: locations → plants → grow_events, knowledge_sources → knowledge_facts
- Earthy green theme (--color-primary: #4a7c59) matching CF theme system

Knowledge ingest contract:
- POST /api/v1/knowledge/ingest — idempotent on fact_hash (sha256 of type+payload+video_path)
- 8 fact types: companion_planting, soil_amendment, propagation, pest_diagnosis,
  harvest_timing, instruction, medicinal, history_context
- Partial batch failure: malformed facts collected in rejected[], valid facts inserted
- Re-ingesting same video batch: facts_skipped_duplicate > 0, no duplicates

Wired views: RegistryView (plant CRUD), KnowledgeView (facts + type filter chips)
Stub views: CalendarView, SettingsView
2026-06-10 00:03:41 -07:00

69 lines
1.9 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
SERVICE=waxwing
WEB_PORT=8521
API_PORT=8522
COMPOSE_FILE="compose.yml"
OVERRIDE_FLAG=""
[[ -f "compose.override.yml" ]] && OVERRIDE_FLAG="-f compose.override.yml"
usage() {
echo "Usage: $0 {start|stop|restart|status|logs|open|build|test|update}"
echo ""
echo " start Build (if needed) and start all services"
echo " stop Stop and remove containers"
echo " restart Stop then start"
echo " status Show running containers"
echo " logs [svc] Follow logs (api | web — defaults to all)"
echo " open Open web UI in browser"
echo " build Rebuild Docker images without cache"
echo " test Run pytest test suite"
echo " update git pull + rebuild + restart"
exit 1
}
cmd="${1:-help}"
shift || true
case "$cmd" in
start)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG up -d --build
echo "Waxwing running → http://localhost:${WEB_PORT}"
;;
stop)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG down
;;
restart)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG down
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG up -d --build
echo "Waxwing running → http://localhost:${WEB_PORT}"
;;
status)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG ps
;;
logs)
svc="${1:-}"
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG logs -f ${svc}
;;
open)
xdg-open "http://localhost:${WEB_PORT}" 2>/dev/null \
|| open "http://localhost:${WEB_PORT}" 2>/dev/null \
|| echo "Open http://localhost:${WEB_PORT} in your browser"
;;
build)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG build --no-cache
;;
test)
conda run -n cf python -m pytest tests/ -v
;;
update)
git pull
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG up -d --build
echo "Waxwing updated → http://localhost:${WEB_PORT}"
;;
*)
usage
;;
esac