buildBootstrapPromptForKindV2 is the kind-aware dispatcher with first- run awareness for playbook runs. When isFirstRun=true on a playbook run, a richer "capture-aggressive" prompt is emitted that nudges the session to harvest scripts, edge cases, and decision rules back into the live playbook brief
(slug, kind, playbookSlug string, isFirstRun bool)
| 750 | } |
| 751 | playbookSlug := task.PlaybookSlug.String |
| 752 | var runCount int |
| 753 | if err := db.QueryRow( |
| 754 | `SELECT COUNT(*) FROM tasks WHERE playbook_slug = ? AND kind = 'playbook_run' AND archived_at IS NULL`, |
| 755 | playbookSlug, |
| 756 | ).Scan(&runCount); err != nil { |
| 757 | fmt.Fprintf(os.Stderr, "warning: count playbook runs: %v\n", err) |
| 758 | } |
| 759 | return playbookSlug, runCount <= 1 |
| 760 | } |
no test coverage detected