@hustle-together/api-dev-tools 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hooks/enforce-interview.py +64 -1
- package/package.json +1 -1
|
@@ -259,9 +259,72 @@ Reset the interview and ask with options based on research."""
|
|
|
259
259
|
}))
|
|
260
260
|
sys.exit(0)
|
|
261
261
|
|
|
262
|
-
#
|
|
262
|
+
# Check 6: FINAL USER CONFIRMATION - must confirm interview is complete
|
|
263
|
+
user_question_asked_final = interview.get("user_question_asked", False)
|
|
264
|
+
user_completed = interview.get("user_completed", False)
|
|
263
265
|
decisions = interview.get("decisions", {})
|
|
264
266
|
|
|
267
|
+
if not user_completed or not user_question_asked_final:
|
|
268
|
+
decision_summary = _build_decision_summary(decisions)
|
|
269
|
+
missing = []
|
|
270
|
+
if not user_question_asked_final:
|
|
271
|
+
missing.append("Final confirmation question (AskUserQuestion not used)")
|
|
272
|
+
if not user_completed:
|
|
273
|
+
missing.append("User hasn't confirmed interview complete")
|
|
274
|
+
|
|
275
|
+
print(json.dumps({
|
|
276
|
+
"permissionDecision": "deny",
|
|
277
|
+
"reason": f"""❌ BLOCKED: Interview needs FINAL USER CONFIRMATION.
|
|
278
|
+
|
|
279
|
+
Questions asked: {len(questions)}
|
|
280
|
+
Structured questions: {actual_structured}
|
|
281
|
+
User final confirmation: {user_completed}
|
|
282
|
+
|
|
283
|
+
MISSING:
|
|
284
|
+
{chr(10).join(f" • {m}" for m in missing)}
|
|
285
|
+
|
|
286
|
+
═══════════════════════════════════════════════════════════
|
|
287
|
+
⚠️ GET USER CONFIRMATION BEFORE PROCEEDING
|
|
288
|
+
═══════════════════════════════════════════════════════════
|
|
289
|
+
|
|
290
|
+
REQUIRED STEPS:
|
|
291
|
+
|
|
292
|
+
1. SHOW interview summary to user:
|
|
293
|
+
┌───────────────────────────────────────────────────────┐
|
|
294
|
+
│ INTERVIEW COMPLETE │
|
|
295
|
+
│ │
|
|
296
|
+
│ Your decisions: │
|
|
297
|
+
{chr(10).join(f" │ • {line:<49} │" for line in decision_summary.split(chr(10))[:8]) if decision_summary else " │ (no decisions recorded yet) │"}
|
|
298
|
+
│ │
|
|
299
|
+
│ These will guide the schema, tests, and implementation│
|
|
300
|
+
│ │
|
|
301
|
+
│ All correct? [Y] │
|
|
302
|
+
│ Change an answer? [n] ____ │
|
|
303
|
+
└───────────────────────────────────────────────────────┘
|
|
304
|
+
|
|
305
|
+
2. USE AskUserQuestion:
|
|
306
|
+
question: "Interview decisions correct? Ready to proceed?"
|
|
307
|
+
options: [
|
|
308
|
+
{{"value": "confirm", "label": "Yes, proceed to schema creation"}},
|
|
309
|
+
{{"value": "change", "label": "No, I want to change [which question]"}},
|
|
310
|
+
{{"value": "add", "label": "Add another question about [topic]"}}
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
3. If user says "change" or "add":
|
|
314
|
+
• Ask which question/topic
|
|
315
|
+
• Re-ask with AskUserQuestion
|
|
316
|
+
• Update decisions
|
|
317
|
+
• LOOP BACK and show updated summary
|
|
318
|
+
|
|
319
|
+
4. If user says "confirm":
|
|
320
|
+
• Set interview.user_question_asked = true
|
|
321
|
+
• Set interview.user_completed = true
|
|
322
|
+
• Set interview.status = "complete"
|
|
323
|
+
|
|
324
|
+
WHY: User must approve their decisions before they drive implementation."""
|
|
325
|
+
}))
|
|
326
|
+
sys.exit(0)
|
|
327
|
+
|
|
265
328
|
if decisions:
|
|
266
329
|
# Build a reminder of what the user decided
|
|
267
330
|
decision_summary = _build_decision_summary(decisions)
|
package/package.json
CHANGED