---
id: w2/m5/t005
title: Acceptance — recorded → triggered → live; failed image reads failed
worker: worker2
status: done
estimate: 25m
depends_on: [w2/m5/t003, w2/m5/t004]
---

## Objective

Prove the agent poll-loop end-to-end on the mock cluster: creating a service records deploy #1; `POST …/deploys` triggers deploy #2 which an agent polls to `live` via `get_deploy`; a service with a broken image yields a deploy that truthfully reads `failed`.

## Context

- Mock cluster (`bash scripts/mock-cluster.sh`) with `BEX_CP_DB_URI` pointing at a local Postgres (CNPG `bex-db` or a dev container).
- Health gating semantics from docs/ADR004-deployment.md decide `live` vs `failed`.

## Steps

1. Create (w2/m4) → assert one deploy row → `live`.
2. Trigger → poll `get_deploy` until `live`; assert two entries, newest-first.
3. Deploy a nonexistent image tag → deploy ends `failed` within the gating window.

## Files

- Feature test files; a script or test notes under the milestone if the live check is manual.

## Acceptance criteria

- [ ] All three scenarios pass against a real cluster; statuses never lie (no `live` without healthy pods).

## Out of scope

- Build-from-git deploys (w1/m5).
