Implement Missing Info Extraction & User Notification
Hey guys! Let's dive into implementing a super cool feature for our repo: 'Missing Info' structured extraction with user-friendly notifications. This is all about making our issue triage process smoother and ensuring we gather all the necessary information from the get-go. Think of it as building a smart assistant that gently nudges users to provide those crucial details. So, buckle up, and let’s get this done!
Context: The Big Picture
So, where are we starting? Well, the good news is that we already have some fantastic groundwork laid out. We've got the prompt infrastructure humming away under src/prompts/select-labels/
, and we even have a missing-info system prompt chilling at src/prompts/select-labels/system-prompt-missing-info.ts
. But, we want to crank this up a notch!
Our main goal here is to make the 'missing info' prompt more deterministic and machine-parseable. We’re talking about an output that includes a snappy summary, structured repro fields, a clear list of missing fields, and up to five targeted questions. Imagine how much easier triaging will be when we have all this info neatly laid out!
Now, when our system detects missing info (and it will, oh yes!), it’s going to apply the s/needs-info
and/or s/needs-repro
labels. But we’re not stopping there. We'll also post or update a single, super-friendly comment asking for the minimal set of items needed. And here’s the kicker – this comment will be idempotent, meaning it updates in place instead of creating a gazillion duplicates. Awesome, right?
Tasks & Code Snippets: Getting Down to Business
Alright, let’s break this down into actionable tasks. We've got some code snippets to get you started, so no need to stare at a blank screen.
1. Update the System Prompt
First things first, we need to replace the current missing-info prompt with our spiffy new deterministic version. This is where the magic begins!
export const systemPromptMissingInfo = `
You are an expert triage assistant who evaluates if issue reports contain sufficient information to reproduce and diagnose reported problems.
...
`
This new prompt will be our guiding star, ensuring we get consistent and useful outputs every time.
2. Reusable Comment Builder
Next up, we’re going to add a builder with a hidden marker for upsert. This is crucial for that idempotent comment action we talked about. We don't want comment chaos, do we?
export function buildNeedsInfoComment(data: MissingInfoPayload): string {
// ...
}
This builder will craft the perfect comment, tailored to the specific missing info.
3. Handler for Comment and Labels
Now, let’s get those comments and labels in sync! We need handlers that can upsert comments using our marker and apply/remove labels as needed.
export async function upsertNeedsInfoComment(...)
export async function syncNeedsInfoLabels(...)
These handlers are the workhorses of our notification system, ensuring everything is in its rightful place.
Integration Notes: Tying It All Together
So, how do we make this all work together? Glad you asked!
We need to wire the missing-info prompt into our triage flow, referencing the template in src/prompts/select-labels/index.ts
. Think of this as connecting the brain to the body.
Here’s the game plan after the model responds:
- If labels are present, upsert the comment and sync those labels. It’s all about keeping things consistent.
- If nothing is missing (yay!), remove the
s/needs-info
ands/needs-repro
labels. Cleanliness is next to godliness, right? - Remember, our comment builder is idempotent via the marker. No duplicate comments allowed!
This integration will make sure our new feature fits seamlessly into the existing workflow.
Edge Cases & Acceptance Criteria: Nitty-Gritty Details
Let’s talk edge cases. Because, you know, the devil’s in the details.
- No links? No problem. Omit the links block. Simple as that.
- Model asking for platform info or a repo link when it’s already there? Nope. Our model should be smart enough to avoid redundant questions.
- Questions limit: We’re capping it at five questions. Quality over quantity, my friends.
- Questions should be specific to the issue. No generic inquiries here.
- Redact secrets in tips if logs are requested. Safety first!
- Labels used: We’re sticking with
s/needs-info
ands/needs-repro
(but we’re open to updates if needed).
And now, the acceptance criteria. This is how we know we’ve nailed it:
- The updated prompt compiles and is referenced by the 'missing-info' template. No broken links here.
- Idempotency: single comment per issue, updated not duplicated. We can’t stress this enough!
These criteria will ensure our feature is robust and reliable.
Example Model Output: What Success Looks Like
To give you a taste of what we’re aiming for, here’s an example of the model output:
{
"summary": "Crash when opening settings on Windows 11",
"repro": { "has_clear_description": true, "has_steps": false, "has_code": false, "links": [] },
"missing": ["steps", "code"],
"questions": ["Share a minimal repository or zip that reproduces the crash.", "List the exact steps from app launch to the crash (clicks/menus)."],
"labels": [{"label": "s/needs-info", "reason": "Steps to reproduce are missing."}, {"label": "s/needs-repro", "reason": "No minimal reproducer provided."}]
}
This is the kind of structured, actionable output we’re striving for. Clean, clear, and ready to roll!
Conclusion: Let’s Make Some Magic
So there you have it, folks! We’ve laid out the plan for implementing 'Missing Info' structured extraction and user notification. It’s a big task, but with these steps and your awesome skills, we’re going to make our issue triage process smoother and more efficient. Let’s get this done!
Remember, the goal is to create a system that not only identifies missing information but also guides users to provide it in a friendly and efficient way. By focusing on idempotency, clear communication, and structured output, we can significantly improve our workflow and ensure that no issue falls through the cracks. Let’s dive in and make some magic happen!
I’m super stoked to see how this turns out. Let’s collaborate, share insights, and make this the best missing-info system ever. Happy coding!
Please use the code and requirements above to implement missing info extraction, structured triage, and user notification as described.