Repository navigation
Add interview-first sparkle-pills chat chaining and deterministic plan response - #2431
groupthinking with Codex wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
🔍 PR Validation
|
There was a problem hiding this comment.
🟡 Changes recommended
Client integration is incomplete, planning ignores video grounding, and required tools can be silently discarded.
3 open findings
What changed in this PR
Adds an interview-first sparkle-pills branch to UVAI’s chat API, returning a deterministic plan without model calls once required answers are supplied.
Changes:
- Detect sparkle intent and request interview answers.
- Generate plans from completed interviews.
- Document the API contract and add focused route tests.
| File | Description |
|---|---|
| CHAINING.md | Documents interview and plan payloads. |
| apps/web/src/lib/sparkle-pills.ts | Implements detection, answer parsing, and planning. |
| apps/web/src/app/api/chat/route.ts | Routes sparkle requests to the new handler. |
| apps/web/src/app/api/__tests__/chat-sparkle-pills-route.test.ts | Covers interview and completed-plan responses. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const sparkleResponse = resolveSparklePillsResponse({ | ||
| query: typeof query === 'string' ? query : String(query), | ||
| sparkleInterview: body.sparkleInterview, | ||
| }); |
| if (sparkleResponse) { | ||
| return NextResponse.json(sparkleResponse); |
groupthinking
left a comment
There was a problem hiding this comment.
Review at head fc4d7047: the three unresolved inline findings are substantive. The planner bypasses verified Video Pack grounding, the existing chat clients do not render or continue the interview, and the parser silently drops tools after the eighth. Please preserve pack-bound behavior, make the full two-turn flow usable, and reject or retain oversized inputs explicitly with tests.
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Implemented in |
| : []; | ||
| const query = body.query || body.message || ''; | ||
|
|
||
| if (!packBinding) { |
There was a problem hiding this comment.
The if (!packBinding) guard in POST /api/chat makes the sparkle-pills interview-first flow unreachable from every production client, since all three clients always send a video_id that yields a non-null pack binding — leaving the sparkle interview UI in StudioIdeChat.tsx and emit-app-builder-sandbox.ts dead in production.
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
groupthinking
left a comment
There was a problem hiding this comment.
Review at exact head 35cff33a416af0eb1351f50dc4d7e550a6a1a88e: the canonical issue #2428 links the GitHub Next Sparkle Pills article, whose core behavior is filling *(...) template slots while deterministic code preserves the surrounding text verbatim. This PR instead asks for automation triggers and tools, then returns an intake -> validate -> run actions workflow plan. Its API and tests do not take a template, parse or fill slots, validate slot values, or prove literal text is preserved. The Studio chat remains pack-bound and does not reach this planner. Please align the interview and implementation with the article and the user-selected template use case, including tests for unchanged literal text and missing or invalid slot values. The specific use case is still pending from Hayden, so do not substitute a guessed example as the product requirement. The current passing CI verifies the alternate workflow behavior; this PR remains changes requested and should stay open.

Canonical issue
Linked by system automation.
Outcome
This PR adds an interview-first path for “sparkle pills” requests so the system asks clarifying questions before proposing a workflow. When required answers are provided on the unbound API path, it returns a deterministic, action-oriented plan without invoking model providers. Current Studio clients send a Video Pack binding, so they remain on grounded chat and cannot reach that planner. The full product flow is still under review.
Scope
requiresInterview: trueplus targeted clarifying questions when required fields are missing.provider: "sparkle-pills-planner"and a structured operational plan once interview fields are complete.CHAINING.mdwith request/response schema and runtime behavior.{ "query": "Build me a system for using sparkle pills", "sparkleInterview": { "useCase": "Manage weekday focus sessions", "trigger": "Start each weekday at 08:30", "tools": ["Google Calendar", "Slack"], "constraints": "No notifications after 21:00", "successSignal": "5 sessions completed per week" } }Risk
Sparkle detection could match unintended prompts. The current pack-bound Studio flow does not reach the deterministic planner, and a plan without Video Pack grounding would not meet the product contract.
Revert the sparkle branch in
apps/web/src/app/api/chat/route.tsand removeapps/web/src/lib/sparkle-pills.ts.Verification
Head SHA:
35cff33a416af0eb1351f50dc4d7e550a6a1a88e(includes currentmainto restore the security scan input).npm@10.8.0 ci --ignore-scripts, focused route and Studio interview tests (7 passed), ESLint on changed files, type check, web production build, andgit diff --checkpassed.Production evidence
No live production Studio end-to-end proof. The deterministic planner is currently reachable only for API requests without a Video Pack binding; current Studio clients send a binding.
Agent handoff
Security dependency evidence