From dbd9af42e9fac60035ed1cf9723524ce861e6c33 Mon Sep 17 00:00:00 2001 From: gaurav0107 Date: Sun, 7 Jun 2026 19:06:44 +0530 Subject: [PATCH 1/4] docs(spec): playground messages redesign Captures the brainstormed design for the playground redesign: - prompt_version.template -> template_messages jsonb (replace, with one release of legacy column for safe deploy/rollback) - system + human messages only for v1; AI/tools/output_schema deferred - Jinja {{ var }} substitution kept; no f-string selector - single prompt panel; compare deferred to its own iteration - save creates a new version always; "New prompt..." entry in the picker handles the unloaded case - empty variables render as empty string Spec covers schema migration, request/response contracts, web composer rewrite, dispatcher changes, error semantics, testing strategy, and a 4-step rollout that lets each PR land independently. Signed-off-by: Gaurav Dubey Signed-off-by: gaurav0107 --- ...-07-playground-messages-redesign-design.md | 276 ++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 docs/superpowers/specs/2026-06-07-playground-messages-redesign-design.md diff --git a/docs/superpowers/specs/2026-06-07-playground-messages-redesign-design.md b/docs/superpowers/specs/2026-06-07-playground-messages-redesign-design.md new file mode 100644 index 0000000..d1cb62f --- /dev/null +++ b/docs/superpowers/specs/2026-06-07-playground-messages-redesign-design.md @@ -0,0 +1,276 @@ +# Playground messages redesign + +**Status:** Draft +**Owner:** mia +**Date:** 2026-06-07 + +## Why + +The playground today asks the user to compose a single text template and +fill `{{ var }}` placeholders. That doesn't match how modern chat models +are actually called: a typed list of messages where the system prompt and +the user turn are separate things. The reference UX +([LangSmith's playground][langsmith-pg]) shows what we want — typed +messages, an Inputs panel that fills detected variables, save-as-prompt +with versioning. PR #10 made the model picker honor configured +credentials but left the playground's data shape untouched. + +[langsmith-pg]: https://docs.langchain.com/langsmith/playground + +## Decisions (locked in brainstorm) + +| # | Topic | Decision | +|---|---|---| +| 1 | Storage shape | Replace `prompt_version.template text` with `template_messages jsonb`. Backfill rewrites every existing row to `[{role: "human", content: