Skip to content

Commit cd05c04

Browse files
authored
Merge pull request #105 from hua7450/improve-user-checkpoints
Improve user checkpoints with structured AskUserQuestion
2 parents 7698b71 + db0d89a commit cd05c04

File tree

4 files changed

+673
-238
lines changed

4 files changed

+673
-238
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve user checkpoints with structured AskUserQuestion across commands

commands/backdate-program.md

Lines changed: 104 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,58 @@ subagent_type: "general-purpose", team_name: "{st}-{prog}-backdate", name: "cons
366366

367367
### Regulatory Checkpoint 1
368368

369-
Read ONLY `/tmp/{st}-{prog}-impl-summary.md`. Present to user:
370-
- Number of files affected, date entries to add
371-
- Any Tier B/C items (require user confirmation before proceeding)
372-
- Source gaps or unresolved conflicts
373-
- **Stop here if `--research-only`**
369+
Read ONLY `/tmp/{st}-{prog}-impl-summary.md`. Present a brief overview:
370+
371+
```
372+
## {STATE_FULL} {PROGRAM} — Research Complete
373+
374+
**Parameters**: {N} files, {M} date entries to add
375+
**Earliest date**: {YYYY-MM-DD} → backdating to {TARGET_YEAR}
376+
**Source gaps**: {count, if any}
377+
```
378+
379+
Then walk through decisions one at a time using `AskUserQuestion`:
380+
381+
**Decision 1: Proceed with implementation?**
382+
383+
```
384+
AskUserQuestion:
385+
Question: "Proceed with backdating {N} parameter files?"
386+
Options:
387+
- "Yes, proceed" (default/recommended)
388+
- "Show me more details first"
389+
- "Stop here (research only)"
390+
```
391+
392+
**Decision 2: Tier B/C items** (only if impl-summary lists any)
393+
394+
For each Tier B/C item, ask separately:
395+
396+
```
397+
AskUserQuestion:
398+
Question: "{Description of Tier B/C item}"
399+
Description: "{Brief context — e.g., 'New parameter needed for provision X, not in current implementation'}"
400+
Options:
401+
- "Include — implement this change" (recommended if Tier B)
402+
- "Skip — defer to follow-up PR"
403+
- "Need more info"
404+
```
405+
406+
**Decision 3: Source gaps** (only if impl-summary lists any)
407+
408+
```
409+
AskUserQuestion:
410+
Question: "How to handle {N} source gap(s)?"
411+
Description: |
412+
{List each gap, e.g.:
413+
- No PDF found for 2003-2007 period
414+
- Two sources disagree on 2010 value}
415+
Options:
416+
- "Proceed — use best available data" (recommended)
417+
- "Pause — let me find the missing sources"
418+
```
419+
420+
**Stop here if `--research-only`.**
374421

375422
---
376423

@@ -437,10 +484,58 @@ Write SHORT summary (max 15 lines) to /tmp/{st}-{prog}-phase2-summary.md."
437484

438485
### Regulatory Checkpoint 2
439486

440-
Read ONLY `/tmp/{st}-{prog}-phase2-summary.md`. Present to user:
441-
- Broken URLs, generic refs, missing subsections count
442-
- Unused parameters, zero-sentinels, missing provisions count
443-
- **Formula fixes require user confirmation** before implementation
487+
Read ONLY `/tmp/{st}-{prog}-phase2-summary.md`. Present a brief overview:
488+
489+
```
490+
## Audit Results
491+
492+
**References**: {N} broken URLs, {M} generic refs, {P} missing subsections
493+
**Formulas**: {X} unused params, {Y} zero-sentinels, {Z} missing provisions
494+
```
495+
496+
Then walk through decisions using `AskUserQuestion`:
497+
498+
**Decision 1: Reference fixes**
499+
500+
```
501+
AskUserQuestion:
502+
Question: "Apply {N} reference fixes? (broken URLs, missing page numbers, generic citations)"
503+
Options:
504+
- "Yes, fix all" (default/recommended)
505+
- "Show me the list first"
506+
- "Skip reference fixes"
507+
```
508+
509+
**Decision 2: Formula fixes** (only if audit found formula issues)
510+
511+
Ask for each formula fix category separately:
512+
513+
```
514+
AskUserQuestion:
515+
Question: "Fix {X} unused parameters? (parameters exist but no formula reads them)"
516+
Options:
517+
- "Yes, wire them into formulas" (recommended)
518+
- "Skip — defer to follow-up"
519+
- "Show me which ones"
520+
```
521+
522+
```
523+
AskUserQuestion:
524+
Question: "Fix {Y} zero-sentinel anti-patterns? (value=0 used instead of explicit in_effect boolean)"
525+
Options:
526+
- "Yes, refactor to in_effect pattern" (recommended)
527+
- "Skip — cosmetic, defer"
528+
```
529+
530+
```
531+
AskUserQuestion:
532+
Question: "Implement {Z} missing provisions? (regulations found but not yet coded)"
533+
Description: "{Brief list of missing provisions}"
534+
Options:
535+
- "Yes, implement all"
536+
- "Let me pick which ones"
537+
- "Skip — defer to follow-up PR"
538+
```
444539

445540
---
446541

commands/encode-policy-v2.md

Lines changed: 79 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,37 +171,93 @@ After consolidator completes, read ONLY:
171171

172172
## Phase 2: Scope Review (USER CHECKPOINT)
173173

174-
Present to user:
174+
This phase walks the user through scope decisions one at a time using `AskUserQuestion` with structured options. Do NOT dump all requirements at once.
175+
176+
### Step 2A: Show Summary
177+
178+
Display a brief overview (from scope-summary.md):
175179

176180
```
177181
## {STATE} {PROGRAM} — Scope Review
178182
179183
**Complexity**: {Simple/Complex} ({N} requirements)
180184
**Reference impl**: {path}
185+
```
181186

187+
Then list requirements grouped by tag. Example:
188+
189+
```
182190
### Requirements Found ({N} total):
183-
REQ-001: [ELIGIBILITY] Income <= 261% FPL (entry) — OAR 461-155-0180
184-
REQ-002: [ELIGIBILITY] Income <= 300% FPL (transitional) — OAR 461-155-0180
185-
REQ-003: [RESOURCE] Assets <= $1M — OAR 461-160-0015
186-
REQ-004: [DEMOGRAPHIC] Child under 13 (under 19 if disabled) — OAR 461-120-0510
187-
REQ-005: [IMMIGRATION] Child must be US citizen or qualified immigrant — 8 USC 1612
188-
REQ-006: [BENEFIT] Co-payment 0%/2%/5%/7% by FPL tier — OAR 461-155-0150
189-
REQ-007: [BENEFIT] Co-payment capped at 7% of income (federal) — 45 CFR 98.45
190-
REQ-008: [EXEMPTION] RI Works families get $0 co-payment — DHS Policy Manual
191-
REQ-009: [NOT-MODELED] 20 hrs/week work activity requirement — OAR 461-135-0400
192-
...
193191
194-
Implement all? Or exclude any? (e.g., "Skip REQ-009, REQ-010")
192+
**Eligibility** ({X})
193+
REQ-001: Income <= 261% FPL (entry) — OAR 461-155-0180
194+
REQ-002: Income <= 300% FPL (transitional) — OAR 461-155-0180
195+
196+
**Benefit Calculation** ({X})
197+
REQ-006: Co-payment 0%/2%/5%/7% by FPL tier — OAR 461-155-0150
198+
REQ-007: Co-payment capped at 7% of income — 45 CFR 98.45
199+
200+
**Not Modeled** ({X})
201+
REQ-009: 20 hrs/week work activity requirement — OAR 461-135-0400
195202
```
196203

197-
Wait for user response via AskUserQuestion.
204+
### Step 2B: Key Decisions (One at a Time)
205+
206+
For each key decision point identified in the scope summary, ask the user ONE question at a time using `AskUserQuestion`.
198207

199-
User can say:
200-
- "All" — implement everything (except NOT-MODELED)
201-
- "Skip REQ-009, REQ-010" — orchestrator records exclusions
202-
- Any other guidance
208+
**Decision 1: Overall scope**
209+
210+
```
211+
AskUserQuestion:
212+
Question: "Implement all {N} simulatable requirements? ({M} NOT-MODELED items will be excluded automatically)"
213+
Options:
214+
- "Yes, implement all" (default/recommended)
215+
- "Let me pick which to skip"
216+
```
203217

204-
Write the decision to `/tmp/{PREFIX}-scope-decision.md`:
218+
If user picks "Let me pick which to skip", present each questionable requirement group:
219+
220+
```
221+
AskUserQuestion:
222+
Question: "Include {TAG} requirements?"
223+
Description: |
224+
REQ-XXX: {description}
225+
REQ-YYY: {description}
226+
Options:
227+
- "Yes, include all" (default)
228+
- "Skip these"
229+
- "Let me pick individually"
230+
```
231+
232+
**Decision 2+: Program-specific complexity decisions**
233+
234+
If the scope summary identifies key decision points (e.g., provider rates, simplified vs full approach), ask each as a separate question:
235+
236+
```
237+
AskUserQuestion:
238+
Question: "{Decision description}"
239+
Description: "{Brief context — e.g., 'Provider rates have ~240 rate cells. Implementing now adds complexity.'}"
240+
Options:
241+
- "{Option A}" (recommended if applicable)
242+
- "{Option B}"
243+
- "{Option C if needed}"
244+
```
245+
246+
Examples of program-specific decisions:
247+
- "Provider rates have ~240 rate cells — implement now or defer?"
248+
- "Defer to follow-up PR" (recommended)
249+
- "Implement now"
250+
- "TANF approach — simplified or full?"
251+
- "Simplified (eligibility + benefit amount)" (recommended)
252+
- "Full (all components)"
253+
- "13 income types have no PE equivalent — how to handle?"
254+
- "Map to closest existing variables" (recommended)
255+
- "Create new variables for each"
256+
- "Skip unmappable income types"
257+
258+
### Step 2C: Write Scope Decision
259+
260+
After all questions are answered, write the decision to `/tmp/{PREFIX}-scope-decision.md`:
205261

206262
```markdown
207263
## Scope Decision for {STATE} {PROGRAM}
@@ -213,7 +269,11 @@ REQ-002: [ELIGIBILITY] Income <= 300% FPL (transitional)
213269

214270
### Excluded
215271
REQ-009: [NOT-MODELED] 20 hrs/week work activity — Reason: not simulatable
216-
REQ-010: [BENEFIT] Provider payment rates — Reason: user excluded
272+
REQ-010: [BENEFIT] Provider payment rates — Reason: user deferred
273+
274+
### Key Decisions
275+
- Provider rates: deferred to follow-up PR
276+
- Income variable gaps: map to closest existing variables
217277

218278
### User Notes
219279
{any additional guidance from user}

0 commit comments

Comments
 (0)