{
  "protocol": "wkap-wow-intake-flow",
  "version": "v0.2",
  "latest_url": "https://wkap.ai/specs/wow-intake-flow-latest.json",
  "crm_spec_url": "https://wkap.ai/specs/wow-crm-latest.json",
  "goal": "Make every agent behave like the same intake program during Daily WoW data collection while still accepting natural conversation as input.",
  "market_date_rule": {
    "timezone": "America/New_York",
    "default": "Use the current US trading date at packet preparation time.",
    "off_hours": "Before the next US trading session opens, use the most recent US trading date unless the user explicitly asks to prepare the next session's packet.",
    "weekend_or_holiday": "Roll research into the next US trading date unless the user explicitly asks for a catch-up packet for the most recent trading date."
  },
  "scheduling": {
    "autonomous_supported": "During setup, if Codex scheduled automations or an equivalent autonomous scheduler are available, create or update an active recurring automation named WKAP Daily WoW for the active workspace. Each scheduled run must invoke the installed WKAP WoW skill and the latest specs it references.",
    "autonomous_not_supported": "Run the workflow when the user says daily WoW, and at the start of the first agent session on a US market day when recent research context is available.",
    "default_codex_automation_name": "WKAP Daily WoW",
    "no_silent_cron_promise": true,
    "setup_status_report_required_fields": [
      "install_verified",
      "journal_path",
      "automation_status",
      "schedule_summary",
      "fallback_trigger"
    ]
  },
  "submission": {
    "channel": "email",
    "to": "ledger@wkap.ai",
    "subject_template": "Daily WoW Packet - {market_date} - {investor_id_or_agent_label}",
    "body_format": "Markdown with one fenced YAML block.",
    "canonical_artifact": "The fenced YAML block is canonical and must contain top-level packet:.",
    "attachments": "Optional and non-canonical unless a later spec defines them.",
    "reconcile": [
      "receipt_email",
      "public_wkap_url"
    ]
  },
  "artifact_integrity": {
    "record_requested_and_resolved_urls": true,
    "recommended_fields": [
      "skill_url_requested",
      "skill_url_resolved",
      "packet_spec_url_requested",
      "packet_spec_url_resolved",
      "skill_content_sha256",
      "packet_spec_content_sha256"
    ]
  },
  "states": {
    "setup": {
      "required_action": "install_skill_prepare_private_journal_and_configure_supported_scheduling",
      "required_outputs": [
        "install_verified",
        "journal_path",
        "automation_status",
        "schedule_summary",
        "fallback_trigger"
      ],
      "next": [
        "collecting_reading_log"
      ]
    },
    "collecting_reading_log": {
      "required_action": "collect top daily investment readings from user activity and agent-found sources",
      "limits": {
        "max_reading_items": 10
      },
      "next": [
        "draft_options"
      ]
    },
    "draft_options": {
      "required_action": "generate exactly 3 WoW choices from today's readings and existing CRM state",
      "allowed_option_kinds": [
        "new_wow_signal",
        "existing_wow_status_update"
      ],
      "latency_slo": {
        "target_seconds_when_recent_context_available": 10,
        "hard_limit_seconds": 30,
        "timeout_behavior": "show_best_available_3_option_slate_and_mark_deeper_research_pending",
        "invalid_if": [
          "first_choice_slate_takes_more_than_30_seconds",
          "full_packet_generation_blocks_initial_choice_slate"
        ]
      },
      "type_mix_rule": {
        "force_one_from_each_wow_type": false,
        "repeated_wow_types_allowed": true,
        "selection_basis": "highest_value_for_today_evidence_and_crm_state"
      },
      "display_contract": {
        "exact_visible_options": 3,
        "prompt_template": "Pick one WoW: 1, 2, 3, or pass.",
        "user_must_not_be_required_to_choose_by_wow_id": true,
        "wow_id_hidden_by_default": true,
        "required_visible_fields": [
          "option_number",
          "visible_type_label",
          "plain_english_title",
          "why_worth_watching"
        ],
        "invalid_if": [
          "fewer_or_more_than_3_options",
          "any_option_missing_visible_type_label",
          "any_option_missing_plain_english_title",
          "any_option_missing_why_worth_watching",
          "scoreable_signal_missing_invalidate_test",
          "scoreable_signal_missing_resolve_by",
          "scoreable_signal_missing_resolution_source",
          "user_is_required_to_choose_by_wow_id"
        ]
      },
      "next": [
        "awaiting_user_choice"
      ]
    },
    "awaiting_user_choice": {
      "prompt_template": "Pick one WoW: 1, 2, 3, or pass.",
      "accepted_inputs": [
        "1",
        "2",
        "3",
        "pass",
        "natural language equivalent"
      ],
      "normalization_required": true,
      "next": [
        "awaiting_selection_reason",
        "awaiting_pass_fields"
      ]
    },
    "awaiting_selection_reason": {
      "prompt_template": "Why did you select this WoW?",
      "required_fields": [
        "reason_for_selection"
      ],
      "forbidden_fields": [
        "reason_for_pass",
        "closest_rejected_wow",
        "missing_evidence"
      ],
      "next": [
        "ready_to_submit"
      ]
    },
    "awaiting_pass_fields": {
      "prompt_template": "Which of today's 3 WoWs came closest, why pass, and what evidence is missing?",
      "required_fields": [
        "closest_rejected_wow",
        "reason_for_pass",
        "missing_evidence"
      ],
      "closest_rejected_wow_rule": "must be one of today's 3 wow_id values",
      "next": [
        "ready_to_submit"
      ]
    },
    "ready_to_submit": {
      "required_action": "immediately acknowledge completed user choice, then generate structured Daily WoW Packet, validate it against CRM and intake specs, save privately, submit publicly",
      "completion_rule": "the user's selection/pass plus required reason completes the Daily WoW Packet",
      "user_wait_policy": {
        "immediate_acknowledgement_required": true,
        "user_must_not_wait_for_packet_generation_or_send": true,
        "foreground_response": "Choice accepted. I will save, submit, and reconcile this in the background.",
        "background_steps": [
          "generate_packet",
          "validate_packet",
          "save_private_journal",
          "submit_to_wkap_ledger",
          "reconcile_receipt_and_public_url"
        ]
      },
      "next": [
        "submission_in_progress",
        "submitted",
        "not_submitted_format_error"
      ]
    },
    "submission_in_progress": {
      "required_action": "continue packet generation, private save, public submission, and reconciliation without blocking the user",
      "next": [
        "submitted",
        "not_submitted_format_error"
      ]
    },
    "submitted": {
      "required_action": "reconcile receipt, public WKAP URL, raw email artifact, proof state, and local private CRM files",
      "next": [
        "verified"
      ]
    },
    "verified": {
      "required_action": "record public URL and lifecycle effects in private journal"
    },
    "user_no_reply": {
      "required_action": "save private daily draft only; submit nothing publicly"
    },
    "not_submitted_format_error": {
      "required_action": "save private error and ask only for missing/invalid required fields"
    }
  },
  "normalization_rules": {
    "agent_may_map_natural_language_choice_to_option": true,
    "agent_may_not_invent_required_user_reason": true,
    "agent_may_not_choose_for_user": true,
    "agent_asks_smallest_missing_question": true,
    "agent_must_not_replace_pass_with_private_keep_decision": true
  },
  "submission_rules": {
    "daily_public_work_is_done_only_when_packet_is_published_on_wkap_ledger": true,
    "valid_completed_daily_choice_should_be_submitted": true,
    "agent_does_not_decide_valid_packet_is_too_weak_to_publish": true
  }
}
