Files
reflector/scripts/ralph/prompt_plan.md
Igor Loskutov 316f7b316d feat: add WebVTT context generation to chat WebSocket endpoint
- Import topics_to_webvtt_named and recordings controller
- Add _get_is_multitrack helper function
- Generate WebVTT context on WebSocket connection
- Add get_context message type to retrieve WebVTT
- Maintain backward compatibility with echo for other messages
- Add test fixture and test for WebVTT context generation

Implements task fn-1.2: WebVTT context generation for transcript chat
2026-01-12 18:24:47 -05:00

2.3 KiB

You are running one Ralph plan gate iteration.

Inputs:

  • EPIC_ID={{EPIC_ID}}
  • PLAN_REVIEW={{PLAN_REVIEW}}
  • REQUIRE_PLAN_REVIEW={{REQUIRE_PLAN_REVIEW}}

Steps:

  1. Re-anchor:
    • scripts/ralph/flowctl show {{EPIC_ID}} --json
    • scripts/ralph/flowctl cat {{EPIC_ID}}
    • git status
    • git log -10 --oneline

Ralph mode rules (must follow):

  • If PLAN_REVIEW=rp: use flowctl rp wrappers (setup-review, select-add, prompt-get, chat-send).
  • If PLAN_REVIEW=codex: use flowctl codex wrappers (plan-review with --receipt).
  • Write receipt via bash heredoc (no Write tool) if REVIEW_RECEIPT_PATH set.
  • If any rule is violated, output <promise>RETRY</promise> and stop.
  1. Plan review gate:

    • If PLAN_REVIEW=rp: run /flow-next:plan-review {{EPIC_ID}} --review=rp
    • If PLAN_REVIEW=codex: run /flow-next:plan-review {{EPIC_ID}} --review=codex
    • If PLAN_REVIEW=export: run /flow-next:plan-review {{EPIC_ID}} --review=export
    • If PLAN_REVIEW=none:
      • If REQUIRE_PLAN_REVIEW=1: output <promise>RETRY</promise> and stop.
      • Else: set ship and stop: scripts/ralph/flowctl epic set-plan-review-status {{EPIC_ID}} --status ship --json
  2. The skill will loop internally until <verdict>SHIP</verdict>:

    • First review uses --new-chat
    • If NEEDS_WORK: skill fixes plan, re-reviews in SAME chat (no --new-chat)
    • Repeats until SHIP
    • Only returns to Ralph after SHIP or MAJOR_RETHINK
  3. IMMEDIATELY after SHIP verdict, write receipt (for rp mode):

    mkdir -p "$(dirname '{{REVIEW_RECEIPT_PATH}}')"
    ts="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
    cat > '{{REVIEW_RECEIPT_PATH}}' <<EOF
    {"type":"plan_review","id":"{{EPIC_ID}}","mode":"rp","timestamp":"$ts"}
    EOF
    

    For codex mode, receipt is written automatically by flowctl codex plan-review --receipt. CRITICAL: Copy EXACTLY. The "id":"{{EPIC_ID}}" field is REQUIRED. Missing id = verification fails = forced retry.

  4. After SHIP:

    • scripts/ralph/flowctl epic set-plan-review-status {{EPIC_ID}} --status ship --json
    • stop (do NOT output promise tag)
  5. If MAJOR_RETHINK (rare):

    • scripts/ralph/flowctl epic set-plan-review-status {{EPIC_ID}} --status needs_work --json
    • output <promise>FAIL</promise> and stop
  6. On hard failure, output <promise>FAIL</promise> and stop.

Do NOT output <promise>COMPLETE</promise> in this prompt.