{"kind":"automation_playbook_catalog","count":2,"version_policy":"immutable_semver","list_policy":"latest_version_per_template","playbooks":[{"kind":"automation_playbook","id":"error-to-draft-pr","version":"4.0.0","latest":true,"title":"Error to pull request","description":"Turn a trusted, unhandled production case into one policy-bound pull request. Human provider review is the default; optional provider-managed auto-merge requires a separate exact grant after trusted readiness proof.","trigger_kind":"unhandled_cases","output_kind":"pull_request","locked_invariants":{"enabled":false,"required_trust":"customer_posthog","runner_mode":"draft_only","allowed_actions":["draft_pr","escalate"],"approval_required_for":[],"default_code_delivery":{"mode":"review_required"},"supported_code_delivery_modes":["review_required","auto_merge"],"review_required_authority":"one draft PR under its exact one-time grant; human review and merge remain in the git provider","auto_merge_authority":"one ready PR grant followed by trusted exact readiness proof and a distinct one-time provider-managed auto-merge grant and receipt","provider_auto_merge_constraints":"required checks and branch protection must exactly match policy; direct merge, force merge, and bypass are forbidden","pull_request_authority":"explicit automation enablement plus an exact one-time PR-creation grant","materiality_authority":"deterministic server policy over active lifecycle, event_count, and last_seen_at; all checks must pass","forbidden_actions":["direct_merge","force_merge","merge_bypass","deploy","rollback","direct_push"],"verification":"exact trusted deploy recurrence outcome plus approved traffic sample","telemetry_instruction_authority":"none"},"render_request_schema":{"type":"object","additionalProperties":false,"required":["version","bindings","readiness_assertions"],"properties":{"version":{"const":"4.0.0"},"bindings":{"type":"object","additionalProperties":false,"required":["automation_id","name","runner","execution","trigger","scope","budgets","traffic_sample_event","verification","escalation"],"properties":{"automation_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,99}$"},"name":{"type":"string","minLength":1,"maxLength":200},"runner":{"type":"object","additionalProperties":false,"required":["provider","repository","default_branch"],"properties":{"provider":{"enum":["codex","claude_code","github_actions","custom"]},"repository":{"type":"string","format":"uri","pattern":"^[Hh][Tt][Tt][Pp][Ss]://(?![^/?#]*@)","maxLength":500,"description":"Absolute HTTPS repository URL without embedded credentials."},"default_branch":{"type":"string","minLength":1,"maxLength":200},"environment":{"type":"string","minLength":1,"maxLength":100}}},"execution":{"oneOf":[{"type":"object","additionalProperties":false,"required":["provider"],"properties":{"provider":{"const":"codex"}}},{"type":"object","additionalProperties":false,"required":["provider"],"properties":{"provider":{"const":"claude_code"}}},{"type":"object","additionalProperties":false,"required":["provider","github_actions"],"properties":{"provider":{"const":"github_actions"},"github_actions":{"type":"object","additionalProperties":false,"required":["workflow_file","job_id","environment_name","invocation"],"properties":{"workflow_file":{"type":"string","minLength":1,"maxLength":500},"job_id":{"type":"string","minLength":1,"maxLength":200},"environment_name":{"type":"string","minLength":1,"maxLength":200},"invocation":{"type":"object","additionalProperties":false,"required":["executable","argv"],"properties":{"executable":{"type":"string","minLength":1,"maxLength":500},"argv":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":500,"pattern":"^[^\\u0000-\\u001F\\u007F]*$"}}}}}}}},{"type":"object","additionalProperties":false,"required":["provider","custom"],"properties":{"provider":{"const":"custom"},"custom":{"type":"object","additionalProperties":false,"required":["management_surface","credential_destination","invocation"],"properties":{"management_surface":{"type":"string","minLength":1,"maxLength":500},"credential_destination":{"type":"string","minLength":1,"maxLength":1000},"invocation":{"type":"object","additionalProperties":false,"required":["executable","argv"],"properties":{"executable":{"type":"string","minLength":1,"maxLength":500},"argv":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":500,"pattern":"^[^\\u0000-\\u001F\\u007F]*$"}}}}}}}}],"x-agentry-runtime-constraints":["execution.provider must exactly match runner.provider"]},"code_delivery":{"oneOf":[{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"const":"review_required"}}},{"type":"object","additionalProperties":false,"required":["mode","merge_method","required_status_checks","provider_managed","branch_protection_required","bypass_forbidden"],"properties":{"mode":{"const":"auto_merge"},"merge_method":{"enum":["squash","merge","rebase"]},"required_status_checks":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":200}},"provider_managed":{"const":true,"default":true},"branch_protection_required":{"const":true,"default":true},"bypass_forbidden":{"const":true,"default":true}}}],"default":{"mode":"review_required"}},"trigger":{"type":"object","additionalProperties":false,"required":["max_cases_per_sweep","cooldown_seconds","materiality"],"properties":{"max_cases_per_sweep":{"type":"integer","minimum":1,"maximum":100},"cooldown_seconds":{"type":"integer","minimum":60,"maximum":604800},"materiality":{"type":"object","additionalProperties":false,"required":["minimum_event_count","maximum_last_seen_age_seconds"],"properties":{"minimum_event_count":{"type":"integer","minimum":1,"maximum":1000000000},"maximum_last_seen_age_seconds":{"type":"integer","minimum":60,"maximum":31622400}},"description":"Conjunctive server-evaluated gate. Missing, stale, future, or below-threshold provider evidence fails closed; text and model judgment have no authority."}}},"scope":{"type":"object","additionalProperties":false,"required":["allowed_paths","test_commands","max_files_changed","max_changed_lines"],"properties":{"allowed_paths":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":500}},"test_commands":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"string","minLength":1,"maxLength":500}},"max_files_changed":{"type":"integer","minimum":1,"maximum":100},"max_changed_lines":{"type":"integer","minimum":1,"maximum":10000}}},"budgets":{"type":"object","additionalProperties":false,"required":["max_runs_per_day","max_prs_per_day","max_attempts_per_case_revision","max_turns_per_run","max_runtime_seconds","max_cost_usd_per_run"],"properties":{"max_runs_per_day":{"type":"integer","minimum":1,"maximum":1000},"max_prs_per_day":{"type":"integer","minimum":1,"maximum":100},"max_attempts_per_case_revision":{"type":"integer","minimum":1,"maximum":20},"max_turns_per_run":{"type":"integer","minimum":1,"maximum":500},"max_runtime_seconds":{"type":"integer","minimum":60,"maximum":86400},"max_cost_usd_per_run":{"type":"number","exclusiveMinimum":0,"maximum":10000}}},"traffic_sample_event":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\s\\u0000-\\u001F\\u007F]+$","description":"Exact approved and observed traffic event; no default."},"verification":{"type":"object","additionalProperties":false,"required":["observation_window_seconds","max_wait_seconds","min_sample_size"],"properties":{"observation_window_seconds":{"type":"integer","minimum":60,"maximum":2592000},"max_wait_seconds":{"type":"integer","minimum":60,"maximum":2592000,"description":"Must be at least observation_window_seconds."},"min_sample_size":{"type":"integer","minimum":1,"maximum":10000000}},"x-agentry-runtime-constraints":["max_wait_seconds >= observation_window_seconds"]},"escalation":{"type":"object","additionalProperties":false,"required":["destination","instructions"],"properties":{"destination":{"type":"string","minLength":1,"maxLength":500},"instructions":{"type":"string","minLength":1,"maxLength":2000}}}},"notes":["allowed_paths and test_commands must be non-empty exact arrays","code_delivery defaults to review_required; auto_merge must explicitly name merge_method and non-empty exact required_status_checks","explicit owner enablement authorizes bounded PR creation; every provider effect still needs its own exact one-time grant","review_required creates a draft PR for human provider review and merge","auto_merge creates a ready PR, then requires trusted readiness proof before a distinct provider-managed auto-merge grant and receipt; direct/force merge and bypass are forbidden","every PR receipt must pass the exact deterministic trigger.materiality policy; free text and runner/model judgment cannot make a case material","traffic_sample_event must be an approved and observed signal-map event; there is no default","all error-run budgets are required and exact; max_prs_per_day is positive","execution.provider must exactly match runner.provider"]},"readiness_assertions":{"type":"object","additionalProperties":false,"required":["repository_pull_request_access_confirmed","ci_proof_callback_configured","deploy_ingest_configured"],"properties":{"repository_pull_request_access_confirmed":{"type":"boolean"},"ci_proof_callback_configured":{"type":"boolean"},"deploy_ingest_configured":{"type":"boolean"},"provider_auto_merge_access_confirmed":{"type":"boolean","default":false,"description":"Required true only for code_delivery.mode=auto_merge."},"branch_protection_required_checks_confirmed":{"type":"boolean","default":false,"description":"Required true only for code_delivery.mode=auto_merge."}}}},"forbidden_override_fields":["enabled","allowed_actions","mode","merge","deploy","rollback","verification.blueprint_id","data_boundary"]},"run_output_schema":{"type":"object","additionalProperties":false,"required":["run_id","status","code_delivery","pull_request","provider_proof","auto_merge_receipt","deploy","verification"],"properties":{"run_id":{"type":"string"},"status":{"enum":["draft_pr_opened","verifying","succeeded","failed","escalated","cancelled"]},"code_delivery":{"oneOf":[{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"const":"review_required"}}},{"type":"object","additionalProperties":false,"required":["mode","merge_method","required_status_checks","provider_managed","branch_protection_required","bypass_forbidden"],"properties":{"mode":{"const":"auto_merge"},"merge_method":{"enum":["squash","merge","rebase"]},"required_status_checks":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":200}},"provider_managed":{"const":true,"default":true},"branch_protection_required":{"const":true,"default":true},"bypass_forbidden":{"const":true,"default":true}}}],"default":{"mode":"review_required"}},"pull_request":{"description":"One pre-authorized PR bound to the exact delivery mode, draft/ready state, branch, head SHA, and PR-creation grant."},"provider_proof":{"description":"Trusted CI observation bound to the exact PR-creation grant subject and head SHA; auto_merge additionally proves exact passed checks, enforced branch protection, no bypass, and auto-merge still disabled."},"auto_merge_receipt":{"description":"Null for review_required. For auto_merge, the immutable receipt for the separate one-time provider-managed auto-merge grant and exact provider effect."},"deploy":{"description":"Trusted CI deploy bound to the proven source commit and automation run."},"verification":{"type":"object","required":["outcome","sample","passed"],"properties":{"outcome":{"description":"Exact case recurrence aggregate after the trusted deploy."},"sample":{"description":"Approved real-traffic aggregate for the same deploy and check window."},"passed":{"type":"boolean"}}}},"authority":"server-owned grant/run history plus trusted CI/deploy proof and an immutable provider-effect receipt; runner summaries are evidence only"},"related_operations":[{"operation_id":"put_automation_contract","method":"PUT","path":"/v1/projects/:project_id/automation-contract"},{"operation_id":"create_project_credential","method":"POST","path":"/v1/projects/:project_id/credentials"},{"operation_id":"issue_automation_triggers","method":"POST","path":"/v1/projects/:project_id/automation-triggers/issue"},{"operation_id":"claim_case","method":"POST","path":"/v1/cases/:case_id/claims"},{"operation_id":"start_automation_run","method":"POST","path":"/v1/projects/:project_id/automation-runs"},{"operation_id":"authorize_draft_pr","method":"POST","path":"/v1/automation-runs/:run_id/actions/draft-pr/authorize"},{"operation_id":"consume_draft_pr_grant","method":"POST","path":"/v1/automation-runs/:run_id/actions/draft-pr/consume"},{"operation_id":"record_automation_pr_proof","method":"POST","path":"/v1/automation-runs/:run_id/pr-proof"},{"operation_id":"authorize_auto_merge","method":"POST","path":"/v1/automation-runs/:run_id/actions/auto-merge/authorize"},{"operation_id":"consume_auto_merge_grant","method":"POST","path":"/v1/automation-runs/:run_id/actions/auto-merge/consume"},{"operation_id":"record_deploy","method":"POST","path":"/v1/deploys/"},{"operation_id":"verify_automation_run","method":"POST","path":"/v1/automation-runs/:run_id/verify"},{"operation_id":"update_automation_run","method":"PATCH","path":"/v1/automation-runs/:run_id"}],"latest_version":"4.0.0","available_versions":["4.0.0"],"endpoints":{"detail":"/v1/automation-playbooks/error-to-draft-pr?version=4.0.0","render":"/v1/projects/:project_id/automation-playbooks/error-to-draft-pr/render"},"template_hash":"3be7d2fbb67766ae0b344867a5cd423b8d29485dcd495ac9730e7b130e154721"},{"kind":"automation_playbook","id":"weekly-funnel-review","version":"2.0.0","latest":true,"title":"Weekly funnel review","description":"Compare exact adjacent periods for a 2–20 step approved, observed funnel and record a private typed report of evidence and hypotheses.","trigger_kind":"schedule","output_kind":"funnel_review","locked_invariants":{"enabled":false,"report_kind":"funnel_review","allowed_actions":["record_report","escalate"],"forbidden_actions":["draft_pr","change_code","publish","send","merge","deploy"],"required_approved_events":"2..20 ordered distinct events","analysis_claims":"evidence and hypotheses only; never infer causality","telemetry_instruction_authority":"none"},"render_request_schema":{"type":"object","additionalProperties":false,"required":["version","bindings","readiness_assertions"],"properties":{"version":{"const":"2.0.0"},"bindings":{"type":"object","additionalProperties":false,"required":["automation_id","name","runner","execution","schedule","funnel","budgets","escalation"],"properties":{"automation_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,99}$"},"name":{"type":"string","minLength":1,"maxLength":200},"runner":{"type":"object","additionalProperties":false,"required":["provider"],"properties":{"provider":{"enum":["codex","claude_code","github_actions","custom"]},"environment":{"type":"string","minLength":1,"maxLength":100}},"description":"A report runner needs no repository checkout or code-write authority."},"execution":{"oneOf":[{"type":"object","additionalProperties":false,"required":["provider"],"properties":{"provider":{"const":"codex"}}},{"type":"object","additionalProperties":false,"required":["provider"],"properties":{"provider":{"const":"claude_code"}}},{"type":"object","additionalProperties":false,"required":["provider","github_actions"],"properties":{"provider":{"const":"github_actions"},"github_actions":{"type":"object","additionalProperties":false,"required":["workflow_file","job_id","environment_name","invocation"],"properties":{"workflow_file":{"type":"string","minLength":1,"maxLength":500},"job_id":{"type":"string","minLength":1,"maxLength":200},"environment_name":{"type":"string","minLength":1,"maxLength":200},"invocation":{"type":"object","additionalProperties":false,"required":["executable","argv"],"properties":{"executable":{"type":"string","minLength":1,"maxLength":500},"argv":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":500,"pattern":"^[^\\u0000-\\u001F\\u007F]*$"}}}}}}}},{"type":"object","additionalProperties":false,"required":["provider","custom"],"properties":{"provider":{"const":"custom"},"custom":{"type":"object","additionalProperties":false,"required":["management_surface","credential_destination","invocation"],"properties":{"management_surface":{"type":"string","minLength":1,"maxLength":500},"credential_destination":{"type":"string","minLength":1,"maxLength":1000},"invocation":{"type":"object","additionalProperties":false,"required":["executable","argv"],"properties":{"executable":{"type":"string","minLength":1,"maxLength":500},"argv":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":500,"pattern":"^[^\\u0000-\\u001F\\u007F]*$"}}}}}}}}],"x-agentry-runtime-constraints":["execution.provider must exactly match runner.provider"]},"schedule":{"type":"object","additionalProperties":false,"required":["cron","timezone","start_window_seconds"],"properties":{"cron":{"type":"string","minLength":5,"maxLength":200,"description":"Conservative five-field cron expression validated by isValidCronExpression.","x-agentry-runtime-validator":"isValidCronExpression"},"timezone":{"type":"string","minLength":1,"maxLength":100,"description":"IANA time-zone name validated by Intl.DateTimeFormat.","x-agentry-runtime-validator":"isValidTimeZone"},"start_window_seconds":{"type":"integer","minimum":60,"maximum":86400}}},"funnel":{"type":"object","additionalProperties":false,"required":["events","period_days","minimum_sample_size"],"properties":{"events":{"type":"array","minItems":2,"maxItems":20,"items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\s\\u0000-\\u001F\\u007F]+$","description":"Approved event in exact funnel order."}},"period_days":{"type":"integer","minimum":1,"maximum":90},"minimum_sample_size":{"type":"integer","minimum":1,"maximum":100000}},"x-agentry-runtime-constraints":["events must contain 2–20 pairwise-distinct names in funnel order"]},"budgets":{"type":"object","additionalProperties":false,"required":["max_runs_per_day","max_turns_per_run","max_runtime_seconds","max_cost_usd_per_run"],"properties":{"max_runs_per_day":{"type":"integer","minimum":1,"maximum":1000},"max_turns_per_run":{"type":"integer","minimum":1,"maximum":500},"max_runtime_seconds":{"type":"integer","minimum":60,"maximum":86400},"max_cost_usd_per_run":{"type":"number","exclusiveMinimum":0,"maximum":10000}},"description":"Report-only caller budgets. The rendered policy locks max_prs_per_day=0 and max_attempts_per_case_revision=1."},"escalation":{"type":"object","additionalProperties":false,"required":["destination","instructions"],"properties":{"destination":{"type":"string","minLength":1,"maxLength":500},"instructions":{"type":"string","minLength":1,"maxLength":2000}}}},"notes":["funnel.events requires 2–20 distinct ordered approved event names","period_days and minimum_sample_size are exact required values","weekly callers choose only run, turn, runtime, and cost budgets; max_prs_per_day=0 and max_attempts_per_case_revision=1 are server-locked","execution.provider must exactly match runner.provider"]},"readiness_assertions":{"type":"object","additionalProperties":false,"required":["scheduler_execution_configured"],"properties":{"scheduler_execution_configured":{"type":"boolean"}}}},"forbidden_override_fields":["enabled","allowed_actions","draft_pr","publish","send","report_plan.blueprint_id","data_boundary"]},"run_output_schema":{"type":"object","additionalProperties":false,"required":["kind","period_start","period_end","source_hash","findings","limitations"],"properties":{"kind":{"const":"funnel_review"},"period_start":{"type":"integer"},"period_end":{"type":"integer"},"source_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"findings":{"type":"array","maxItems":100,"items":{"oneOf":[{"required":["kind","metric","unit","prior_value","current_value","change","source_columns"],"properties":{"kind":{"const":"metric"}}},{"required":["kind","rank","title","rationale","expected_impact","confidence","evidence_columns","suggested_human_next_step"],"properties":{"kind":{"const":"hypothesis"}}},{"required":["kind","code","message"],"properties":{"kind":{"const":"readiness_gap"}}}]}},"limitations":{"type":"array","maxItems":20,"items":{"type":"string"}}},"authority":"private untrusted analytical evidence for human review; never code, publication, messaging, or experiment authority"},"related_operations":[{"operation_id":"put_automation_contract","method":"PUT","path":"/v1/projects/:project_id/automation-contract"},{"operation_id":"create_project_credential","method":"POST","path":"/v1/projects/:project_id/credentials"},{"operation_id":"issue_automation_triggers","method":"POST","path":"/v1/projects/:project_id/automation-triggers/issue"},{"operation_id":"start_automation_run","method":"POST","path":"/v1/projects/:project_id/automation-runs"},{"operation_id":"get_automation_report_source","method":"POST","path":"/v1/automation-runs/:run_id/report-source"},{"operation_id":"record_automation_report","method":"POST","path":"/v1/automation-runs/:run_id/actions/record-report"},{"operation_id":"update_automation_run","method":"PATCH","path":"/v1/automation-runs/:run_id"}],"latest_version":"2.0.0","available_versions":["2.0.0"],"endpoints":{"detail":"/v1/automation-playbooks/weekly-funnel-review?version=2.0.0","render":"/v1/projects/:project_id/automation-playbooks/weekly-funnel-review/render"},"template_hash":"f3a877f1a7194c301a017db92b3fa1512092c05f2612b84ebfa172038bb4c27d"}],"next_action":"Read one exact template version, collect its project-specific bindings without secrets or telemetry, then call its project-scoped render endpoint. Rendering is read-only and always returns a disabled candidate."}