Skip to content

Implement issue #143 Q&A pattern design — bubble protocol + trigger gate #148

@virtualian

Description

@virtualian

Context

Implements the design recommended in reports/20260421-issue-143-askuserquestion-pai-design.md (delivered in PR for #143).

Design summary: keep direct AskUserQuestion calls in CC (13 existing sites untouched), add PAI-level trigger-consistency machinery where it's actually missing.

Work items (from §8 of the report)

  1. Algorithm edit — add ENUMERATE→OFFER sub-step at OBSERVE exit in `PAI/Algorithm/LATEST`. Must include: enumeration directive, commit-with-rationale escape, free-text / subjective-decision exclusion, and a worked example block. ~300-500 words.

  2. NATIVE format edit — add `❓ OPEN_CHOICES:` line to the NATIVE output format in `PAI/CLAUDE.md`. Non-empty content must be paired with an `AskUserQuestion` invocation in the same turn.

  3. Steering rule edit — rewrite `AISTEERINGRULES.md:64` with concrete trigger list (6 net-new targets from §5) and a worked example. One bullet replacement.

  4. New protocol doc — create `PAI/PROTOCOLS/qa-contract.md`. Required sections: Request schema, Response schema, Carrier A (subagent return-value), Carrier B (DA→user AskUserQuestion mapping), Invariants (one asker, batching ≤4 questions, null-iff-allow-cancel), Non-CC harness stub note. ~150-250 lines.

  5. Delegation-system edit — add "User-choice bubbling" subsection to `PAI/THEDELEGATIONSYSTEM.md` referencing (4). Include an anti-pattern example.

  6. Remaining runtime probe — launch Task subagents of type Architect, Engineer, Plan (one each) with tool-introspection prompt; record AskUserQuestion availability per type. Decides whether §4.3(a) (direct invocation) is viable for any specific subagent type. ~5-10 minutes.

  7. Pack policy note — add a one-line rule to `PAI/SKILLSYSTEM.md` (or equivalent) stating packs must use the bubble protocol or only call AskUserQuestion when running in the primary DA context. Replaces the propagation risk that was row 14 of the coupling table. Define done-state.

Effort

Single-author PR: ~1 engineering day (revised from initial 0.5 day per critique). All seven items are prompt/doc edits plus the short probe — no runtime code changes.

Non-goals

No wrapper skill, no rename of `AskUserQuestion`, no new tool, no non-CC adapter code, no changes to existing hooks, no edits to the 13 existing call sites.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsRelated to agent spawning, delegation, and communicationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions