{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/patricia-app/json-schema/patricia-app-cron-job-create-response-schema.json",
  "title": "CronJobCreateResponse",
  "description": "The create reply: the row, plus how the thing just created resolves its connections.\n\nSeparate from the update reply because the field belongs to CREATION. On the shared model an\nedit receipt would report a task creation that did not happen.\n\n``None`` for a REMINDER. A reminder never enters an agent run, so it uses no connections at all\nand the note would describe behaviour that does not occur. This varies by the KIND of row, never\nby what the caller can see: copy that changed with connection state would disclose that a hidden\nconnection exists, which is the one thing this note must not do.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/patricia-app-openapi.json#/components/schemas/CronJobCreateResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid",
      "title": "Tenant Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "require_write_approval": {
      "type": "boolean",
      "title": "Require Write Approval",
      "default": false
    },
    "schedule": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule"
    },
    "local_schedule": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Local Schedule"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone"
    },
    "run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Run At"
    },
    "kind_code": {
      "$ref": "#/$defs/CronKind"
    },
    "delivery_conversation_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Delivery Conversation Id"
    },
    "delivery_channel_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Delivery Channel Id"
    },
    "delivery_destination_kind": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "dm",
            "channel",
            "unknown_channel"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Delivery Destination Kind"
    },
    "billing_skip_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "no_credits",
            "subscription_inactive"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Billing Skip Reason"
    },
    "delivery_channel_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Delivery Channel Name"
    },
    "created_by_actor_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By Actor Id"
    },
    "built_in_template_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Built In Template Key"
    },
    "follow_up_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Follow Up Count"
    },
    "edit_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Edit Path"
    },
    "viewer_may_change_instructions": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Viewer May Change Instructions"
    },
    "client": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClientLabel"
        },
        {
          "type": "null"
        }
      ]
    },
    "space_choice": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClientLabel"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_approve_level": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "read_only",
            "read_and_write"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Auto Approve Level"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "instructions": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instructions"
    },
    "instructions_author_actor_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instructions Author Actor Id"
    },
    "prompt": {
      "type": "string",
      "title": "Prompt"
    },
    "condition_script": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Condition Script"
    },
    "enabled": {
      "type": "boolean",
      "title": "Enabled"
    },
    "model": {
      "type": "string",
      "title": "Model"
    },
    "cost_tier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cost Tier"
    },
    "locked_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Locked By"
    },
    "lease_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lease Expires At"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Run At"
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Run At"
    },
    "last_skip_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Skip Reason"
    },
    "last_skipped_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Skipped At"
    },
    "run_count": {
      "type": "integer",
      "title": "Run Count"
    },
    "max_runs": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Runs"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "connection_scope_note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Connection Scope Note"
    },
    "creation_offer": {
      "anyOf": [
        {
          "$ref": "#/$defs/CreationAttemptStatus"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "id",
    "tenant_id",
    "name",
    "kind_code",
    "prompt",
    "enabled",
    "model",
    "run_count",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "ClientLabel": {
      "oneOf": [
        {
          "$ref": "#/$defs/NamedClientLabel"
        },
        {
          "$ref": "#/$defs/OtherWorkLabel"
        }
      ]
    },
    "CreationApprovedPermission": {
      "properties": {
        "grant_id": {
          "type": "string",
          "format": "uuid",
          "title": "Grant Id"
        },
        "tier": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ],
          "title": "Tier"
        },
        "candidate_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Candidate Id"
        },
        "instruction": {
          "type": "string",
          "title": "Instruction"
        },
        "tool_names": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Tool Names"
        },
        "external_account_id": {
          "type": "string",
          "title": "External Account Id"
        },
        "verified_principal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Verified Principal"
        },
        "fields": {
          "items": {
            "$ref": "#/$defs/CreationCandidateField"
          },
          "type": "array",
          "title": "Fields"
        },
        "reads": {
          "items": {
            "$ref": "#/$defs/CreationApprovedRead"
          },
          "type": "array",
          "title": "Reads"
        },
        "max_occurrences": {
          "type": "integer",
          "title": "Max Occurrences"
        },
        "max_actions": {
          "type": "integer",
          "title": "Max Actions"
        },
        "max_writes_per_run": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Writes Per Run"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires At"
        },
        "lines": {
          "items": {
            "$ref": "#/$defs/CreationCandidateLine"
          },
          "type": "array",
          "title": "Lines"
        },
        "repeat_scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "occurrence"
            },
            {
              "type": "null"
            }
          ],
          "title": "Repeat Scope"
        },
        "repeat_disclosure": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Repeat Disclosure"
        }
      },
      "type": "object",
      "required": [
        "grant_id",
        "tier",
        "candidate_id",
        "instruction",
        "tool_names",
        "external_account_id",
        "verified_principal",
        "fields",
        "reads",
        "max_occurrences",
        "max_actions",
        "max_writes_per_run",
        "expires_at"
      ],
      "title": "CreationApprovedPermission",
      "description": "The creator's live standing permission, separate from prepared details."
    },
    "CreationApprovedRead": {
      "properties": {
        "provider": {
          "type": "string",
          "title": "Provider"
        },
        "external_account_id": {
          "type": "string",
          "title": "External Account Id"
        },
        "principal_key": {
          "type": "string",
          "title": "Principal Key"
        },
        "source": {
          "type": "string",
          "title": "Source"
        }
      },
      "type": "object",
      "required": [
        "provider",
        "external_account_id",
        "principal_key",
        "source"
      ],
      "title": "CreationApprovedRead"
    },
    "CreationAttemptStatus": {
      "properties": {
        "attempt_id": {
          "type": "string",
          "format": "uuid",
          "title": "Attempt Id"
        },
        "source_kind": {
          "type": "string",
          "enum": [
            "task_cron",
            "event_trigger"
          ],
          "title": "Source Kind"
        },
        "source_id": {
          "type": "string",
          "format": "uuid",
          "title": "Source Id"
        },
        "state": {
          "type": "string",
          "enum": [
            "unclaimed",
            "claimed",
            "completed",
            "failed",
            "superseded"
          ],
          "title": "State"
        },
        "outcome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome"
        },
        "candidate_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Candidate Id"
        },
        "permission_active": {
          "type": "boolean",
          "title": "Permission Active",
          "default": false
        },
        "approved_permission": {
          "anyOf": [
            {
              "$ref": "#/$defs/CreationApprovedPermission"
            },
            {
              "type": "null"
            }
          ]
        },
        "review": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "available",
                "unavailable",
                "expired"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Review"
        }
      },
      "type": "object",
      "required": [
        "attempt_id",
        "source_kind",
        "source_id",
        "state",
        "outcome",
        "candidate_id"
      ],
      "title": "CreationAttemptStatus",
      "description": "One permission-setup attempt for a saved task."
    },
    "CreationAudienceView": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "none",
            "fixed_list",
            "email_sender"
          ],
          "title": "Kind"
        },
        "approved_recipients": {
          "items": {
            "prefixItems": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "array",
            "maxItems": 2,
            "minItems": 2
          },
          "type": "array",
          "title": "Approved Recipients"
        }
      },
      "type": "object",
      "required": [
        "kind"
      ],
      "title": "CreationAudienceView"
    },
    "CreationCandidateAccount": {
      "properties": {
        "provider": {
          "type": "string",
          "title": "Provider"
        },
        "external_account_id": {
          "type": "string",
          "title": "External Account Id"
        },
        "verified_principal": {
          "type": "string",
          "title": "Verified Principal"
        },
        "connection_generation": {
          "type": "integer",
          "title": "Connection Generation"
        }
      },
      "type": "object",
      "required": [
        "provider",
        "external_account_id",
        "verified_principal",
        "connection_generation"
      ],
      "title": "CreationCandidateAccount"
    },
    "CreationCandidateField": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "mode": {
          "type": "string",
          "title": "Mode"
        },
        "role": {
          "type": "string",
          "title": "Role"
        },
        "cardinality": {
          "type": "string",
          "title": "Cardinality"
        },
        "element_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Element Type"
        },
        "fixed": {
          "type": "boolean",
          "title": "Fixed"
        },
        "value": {
          "$ref": "#/$defs/JsonValue"
        },
        "provider_names": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/CreationCandidateProviderName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Names"
        },
        "pin_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pin Reason"
        },
        "max_items": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Items"
        }
      },
      "type": "object",
      "required": [
        "name",
        "mode",
        "role",
        "cardinality",
        "element_type",
        "fixed",
        "pin_reason",
        "max_items"
      ],
      "title": "CreationCandidateField"
    },
    "CreationCandidateLine": {
      "properties": {
        "line_id": {
          "type": "string",
          "title": "Line Id"
        },
        "tool_name": {
          "type": "string",
          "title": "Tool Name"
        },
        "tool_ref": {
          "type": "string",
          "title": "Tool Ref"
        },
        "account": {
          "$ref": "#/$defs/CreationCandidateAccount"
        },
        "fields": {
          "items": {
            "$ref": "#/$defs/CreationCandidateField"
          },
          "type": "array",
          "title": "Fields"
        },
        "call_cap": {
          "type": "integer",
          "title": "Call Cap"
        },
        "item_cap": {
          "type": "integer",
          "title": "Item Cap"
        },
        "item_binding": {
          "$ref": "#/$defs/CreationItemBindingView"
        },
        "normalization_changes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Normalization Changes"
        },
        "risk_tier": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Risk Tier"
        },
        "kind": {
          "type": "string",
          "enum": [
            "ordinary",
            "critical",
            "send"
          ],
          "title": "Kind",
          "default": "ordinary"
        },
        "audience": {
          "anyOf": [
            {
              "$ref": "#/$defs/CreationAudienceView"
            },
            {
              "type": "null"
            }
          ]
        },
        "critical_explanation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Critical Explanation"
        },
        "line_review_digest": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line Review Digest"
        }
      },
      "type": "object",
      "required": [
        "line_id",
        "tool_name",
        "tool_ref",
        "account",
        "fields",
        "call_cap",
        "item_cap",
        "item_binding"
      ],
      "title": "CreationCandidateLine"
    },
    "CreationCandidateProviderName": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time",
          "title": "Observed At"
        },
        "provenance": {
          "type": "string",
          "const": "gmail_list_labels_at_setup",
          "title": "Provenance"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "observed_at",
        "provenance"
      ],
      "title": "CreationCandidateProviderName"
    },
    "CreationCandidateRead": {
      "properties": {
        "account": {
          "$ref": "#/$defs/CreationCandidateAccount"
        },
        "principal_key": {
          "type": "string",
          "title": "Principal Key"
        },
        "source": {
          "type": "string",
          "title": "Source"
        }
      },
      "type": "object",
      "required": [
        "account",
        "principal_key",
        "source"
      ],
      "title": "CreationCandidateRead"
    },
    "CreationItemBindingView": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "none",
            "selected_target",
            "source_item"
          ],
          "title": "Kind"
        },
        "target_argument": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Target Argument"
        },
        "resource_namespace": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resource Namespace"
        },
        "read": {
          "anyOf": [
            {
              "$ref": "#/$defs/CreationCandidateRead"
            },
            {
              "type": "null"
            }
          ]
        },
        "read_tool_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Read Tool Ref"
        },
        "read_schema_fingerprint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Read Schema Fingerprint"
        },
        "extractor_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extractor Code"
        },
        "extractor_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extractor Version"
        },
        "projection_fingerprint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Projection Fingerprint"
        },
        "toolkit_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Toolkit Version"
        }
      },
      "type": "object",
      "required": [
        "kind"
      ],
      "title": "CreationItemBindingView"
    },
    "CronKind": {
      "type": "string",
      "enum": [
        "reminder",
        "task"
      ],
      "title": "CronKind",
      "description": "What a fired ``CronJob`` does (plan 02 §6).\n\n``reminder`` pings the originating conversation with the stored message (no\nagent run); ``task`` runs the stored prompt as a scheduled agent action and\ndelivers the result back to that conversation."
    },
    "JsonValue": {},
    "NamedClientLabel": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "client",
          "title": "Kind",
          "default": "client"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "archived": {
          "type": "boolean",
          "title": "Archived"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "name",
        "archived"
      ],
      "title": "NamedClientLabel"
    },
    "OtherWorkLabel": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "other_work",
          "title": "Kind",
          "default": "other_work"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "OtherWorkLabel"
    }
  }
}