# Plan: Implement TTL Heartbeat Service Registration (`implement_ttl_heartbeat`) ## Phase 1: Container Environment Preparation [x] [checkpoint: 51b8fce] - [x] Task: Update `Dockerfile` to install `curl` and `jq` (f7fe258) - [x] Task: Verify `litefs.yml` points to `entrypoint.sh` (should already be correct) (verified) - [x] Task: Conductor - User Manual Verification 'Phase 1: Container Environment Preparation' (Protocol in workflow.md) ## Phase 2: Script Implementation [x] [checkpoint: 139016f] - [x] Task: Refactor `entrypoint.sh` with the TTL Heartbeat logic (d977301) - [x] Implement `register_service` with TTL check definition - [x] Implement `pass_ttl` loop - [x] Implement robust `stop_app` and signal trapping - [x] Ensure correct Primary/Replica detection logic (LiteFS 0.5: Primary = No `.primary` file) - [x] Task: Conductor - User Manual Verification 'Phase 2: Script Implementation' (Protocol in workflow.md) ## Phase 3: Deployment and Verification [ ] - [ ] Task: Commit changes and push to Gitea to trigger build - [ ] Task: Monitor Gitea build completion - [ ] Task: Deploy updated Nomad job (forcing update if necessary) - [ ] Task: Verify "Clean" state in Consul (only one primary registered) - [ ] Task: Verify Failover/Stop behavior (immediate deregistration vs TTL expiry) - [ ] Task: Conductor - User Manual Verification 'Phase 3: Deployment and Verification' (Protocol in workflow.md)