Skip to content

feat(studio): trim fix prompts to the subject and its direct references - #191

Merged
yordis merged 1 commit into
mainfrom
yordis/feat-studio-fix-prompt-scope
Oct 19, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/feat-studio-fix-prompt-scope

Conversation

@yordis

@yordis yordis commented Oct 19, 2026 •

Copy link
Copy Markdown
Member
  • A fix prompt embedded the whole storyboard around a finding, costing the agent context and time on entities unrelated to the repair.
  • Everything beyond the direct references stays reachable as ids to fetch, so nothing needed for the repair is lost.

Closes #115


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Studio-only prompt assembly for validation repair agents; behavior is covered by expanded unit tests with no auth or data-path changes.

Overview
Validation fix prompts are smaller: embedded definitions now cover only the finding subject and its direct references, not every slice on a relevant storyboard or second-hop entities (e.g. commands behind command slices).

Storyboards still appear in full with ordered slice ids; slices and definitions that are loaded but omitted from the JSON snapshot are listed under References to fetch (loadedButOmitted). Prompt copy tells agents to fetch slice/event definitions for temporal findings instead of assuming they are inlined.

Tests assert omitted entities (like command:shop/place-order@1), distant storyboard slices as fetch ids only, and one-hop reference boundaries.

Reviewed by Cursor Bugbot for commit 2f65acd. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3cdd94f-1446-4bca-87fb-fd95cb6924ff
📥 Commits

Reviewing files that changed from the base of the PR and between af7a5ee and 2f65acd.

📒 Files selected for processing: 2
  • tsworkspace/webapps/studio/src/lib/validation-context.test.ts
  • tsworkspace/webapps/studio/src/lib/validation-context.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The validation prompt now includes the subject and its direct references. Storyboard slice IDs remain listed, while slice definitions and other loaded-but-omitted definitions are left for fetching when needed.

Changes

Validation prompt context

Layer / File(s) Summary
Direct-reference prompt context
tsworkspace/webapps/studio/src/lib/validation-context.ts, tsworkspace/webapps/studio/src/lib/validation-context.test.ts
The builder resolves direct references from the issue subject and selected moment, and skips resolving storyboard slice references. The prompt asks for relevant slice and event definitions to be fetched. Tests cover omitted loaded definitions, retained storyboard slice IDs, and exclusion of references beyond one hop.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: enilsen16

Merge Risk: ⚪ Minimal · up to 2f65a

The prompt keeps direct context and leaves omitted definitions fetchable by ID. No merge-blocking issue is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: limiting fix prompts to the subject and its direct references.
Description check Passed The description directly explains the prompt-trimming change and the behavior for references beyond the direct references.
Linked Issues check Passed The changes satisfy #115. validationFixPrompt keeps the issue subject and expands only its direct references. It keeps storyboard slice order in orderedSlices and records storyboard slice definiti…
Out of Scope Changes check Passed The changes stay within #115. The source changes trim validation prompt context and update temporal and fetch guidance. The test changes verify the new focused snapshot behavior. No unrelated product …
Full details: Linked Issues check

Explanation

The changes satisfy #115. validationFixPrompt keeps the issue subject and expands only its direct references. It keeps storyboard slice order in orderedSlices and records storyboard slice definitions for fetch instead of embedding them. The prompt lists omitted and missing identities under References to fetch. Tests cover omitted unrelated definitions, distant storyboard slices, and exclusion of references beyond one hop.

Full details: Out of Scope Changes check

Explanation

The changes stay within #115. The source changes trim validation prompt context and update temporal and fetch guidance. The test changes verify the new focused snapshot behavior. No unrelated product behavior or unrelated files are changed.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the prompt at dawn,
It keeps the direct paths, then hops along.
Slice IDs wait in tidy rows,
While distant details stay enclosed.
Fetch what the finding needs to know,
And let the extra context go.

Comment @coderabbitai help to get the list of available commands.

@yordis
yordis merged commit 2b25b1f into main Oct 19, 2026
28 checks passed
@yordis
yordis deleted the yordis/feat-studio-fix-prompt-scope branch October 19, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix prompts carry the whole storyboard; trim to the subject plus one hop

1 participant