{"spec_id":"agent-execution-lifecycle-hooks","title":"Spec: Agent Execution Lifecycle Hooks","summary":"Adopt a hook-first execution pattern for Coherence agent tasks so task lifecycle transitions are emitted through a consistent internal interface. This brings the same orchestration clarity seen in oh-my-opencode (centralized lifecycle events + safe listeners) while keeping Coherence execution deterministic and observable.","potential_value":0.0,"actual_value":1.0,"estimated_cost":0.0,"actual_cost":1.0,"value_gap":0.0,"cost_gap":1.0,"estimated_roi":0.0,"actual_roi":1.0,"idea_id":"agent-cli","process_summary":"Add an execution lifecycle hook surface that can dispatch named lifecycle events for a task.; Ensure hook listener failures never break task execution or change task terminal status.; Emit lifecycle telemetry events during task execution (`claimed`, `execution_started`, `finalized`, plus block/validatio; Add configurable lifecycle subscribers (`runtime` and `jsonl`) that can be enabled/disabled via environment setting.; Add a compact lifecycle summary query endpoint for recent lifecycle events.","pseudocode_summary":null,"implementation_summary":"api/app/services/agent_execution_hooks.py (register_lifecycle_hook(), dispatch_lifecycle_event()); api/app/services/agent_execution_hooks_config.py (hook configuration); api/app/services/agent_execution_task_flow.py (_emit_lifecycle_event())","created_by_contributor_id":null,"updated_by_contributor_id":null,"created_at":"2026-04-09T03:10:08.801506Z","updated_at":"2026-04-09T03:10:08.801506Z","content_path":"specs/agent-execution-lifecycle-hooks.md","content_hash":"f0055d182472b793","workspace_id":"coherence-network"}