prefect server in zig

add production readiness gap analysis

documents missing features for production use:
- tier 1: concurrency limits, automations, artifacts, event filtering
- tier 2: graceful shutdown, log persistence, auth, ui endpoints
- tier 3: background services, mutation endpoints, task rules

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+67
+67
docs/production-readiness.md
··· 1 + # production readiness 2 + 3 + gaps between zig prefect-server and python prefect server, prioritized by production impact. 4 + 5 + ## tier 1: critical (blocks core workflows) 6 + 7 + ### concurrency limits (v2 API) 8 + lease-based slot management for controlling task parallelism. python has full `/api/v2/concurrency_limits/` with increment/decrement, renewal, TTL. without this, cannot enforce global rate limits across distributed workers. 9 + 10 + ### automations 11 + trigger-action systems responding to events (run deployments, send notifications, pause flows). python has full CRUD, trigger validation, resource ownership. without this, limited to scheduled/polling execution only - no reactive workflows. 12 + 13 + ### artifacts 14 + store output data from runs (models, datasets, reports). python has full lifecycle plus latest artifact queries. without this, cannot track workflow outputs or implement MLOps pipelines. 15 + 16 + ### event filtering & querying 17 + python has `POST /api/events/filter` with pagination and `POST /api/events/count-by/{countable}` for analytics. zig has websocket backfill only. without this, cannot query historical events or build dashboards. 18 + 19 + ## tier 2: high (impacts observability & control) 20 + 21 + ### graceful shutdown 22 + drain in-flight requests, flush pending events, clean up state. without this, forceful termination loses events and corrupts state. 23 + 24 + ### log persistence 25 + python stores logs in database with filter endpoint. zig is in-memory only. without this, logs lost on restart, no audit trail. 26 + 27 + ### flow/task run state endpoints 28 + python has `/api/flow_run_states/{id}` and filter endpoints. zig only has implicit state access. without this, cannot query state history or build state-transition dashboards. 29 + 30 + ### rate limiting & auth 31 + python has request limiting, CSRF protection, basic auth. zig has none. without this, no protection against floods or unauthorized access. 32 + 33 + ### ui endpoints 34 + python has `/api/ui/flows/`, `/api/ui/flow_runs/`, etc. with optimized queries. without this, UI falls back to raw API with poor UX. 35 + 36 + ## tier 3: medium (operational needs) 37 + 38 + ### background services 39 + python has: `late_runs`, `foreman`, `cancellation_cleanup`, `pause_expirations`, `task_run_recorder`. zig has scheduler and event persisters only. 40 + 41 + ### flow/run mutation endpoints 42 + python has PATCH/DELETE for flows and flow_runs. zig lacks these - immutable-only API. 43 + 44 + ### task run orchestration rules 45 + python has `CacheRetrieval`, `CacheInsertion`, `PreventRunningTasksFromStoppedFlows`, `RetryFailedTasks`. zig has none. 46 + 47 + ### remaining flow run rules 48 + `HandleFlowTerminalStateTransitions`, `HandlePausingFlows`, `HandleResumingPausedFlows` not implemented. 49 + 50 + ## recommended priority 51 + 52 + **mvp production:** 53 + 1. concurrency limits v2 54 + 2. event filtering 55 + 3. graceful shutdown 56 + 4. log persistence 57 + 58 + **beta:** 59 + 5. automations 60 + 6. artifacts 61 + 7. background services 62 + 8. mutation endpoints 63 + 64 + **hardening:** 65 + 9. rate limiting & auth 66 + 10. ui endpoints 67 + 11. telemetry