Skip to content

Add open_questions_gate scenario exercising mapping-form scripted gates - #485

Merged
PolyphonyRequiem merged 1 commit into
mainfrom
feat/open-questions-gate-scenario
May 19, 2026
Merged

Add open_questions_gate scenario exercising mapping-form scripted gates#485
PolyphonyRequiem merged 1 commit into
mainfrom
feat/open-questions-gate-scenario

Conversation

@PolyphonyRequiem

Copy link
Copy Markdown
Owner

What

Adds tests/harness/scenarios/open_questions_gate_answer_loop_then_abort/scenario.yaml — the first scenario to exercise the AB#3212 scripted-gate infrastructure's mapping form (gate value + additional_input payload).

Why

AB#3239 PR #482 shipped the first scripted-gate scenario (plan_level_closed_unmerged_acknowledges_via_gate), which used the string shorthand form. AB#3212 PR #483 added the mapping form so gates declaring prompt_for: X can carry an additional_input payload. Nothing exercised that path until now. open_questions_gate.answer declares prompt_for: answers — the canonical proving ground.

Path covered (plan-level.yaml)

depth_guard -> guidance_loader -> root_resolver -> type_loader
  -> ancestor_chain -> state_detector (state=not_started)
  -> architect (call #1: 1 high-severity open_question)
  -> research_loop_counter -> open_questions_policy
  -> open_questions_counter (iter 0 < cap; question gates)
  -> open_questions_gate (scripted=answer + additional_input.answers)
  -> architect (call #2: open_questions cleared by operator answer)
  -> research_loop_counter -> open_questions_policy
  -> open_questions_counter (no gating questions remain)
  -> ensure_plan_branch (returns error envelope)
  -> ensure_plan_branch_error_gate (scripted=abort, string shorthand)
  -> terminal_abort_run -> $end

The architect answer-loop round-trip (gate answer route -> back to architect -> open_questions cleared) is the headline behaviour; the ensure_plan_branch_error_gate abort is just the clean terminal so we don't have to drive the rest of the plan-PR lifecycle.

Why this scenario is worth its weight

  • Only mapping-form coverage we have. Without it, scripted-gate additional_input is shipped but untested.
  • Round-trip proof. The fake provider returns scripted output feat: Phase Detection, Routing Engine, and Command Implementations (PG-3) AB#2593 AB#2594 #2 only because the gate's answer route navigates back to architect — proving the gate routing actually fired.
  • Two scripted gates in one scenario. Mapping form (open_questions_gate) AND string form (ensure_plan_branch_error_gate). With AB#3212 strict_gates=true, a typo in either name fails the scenario loudly.

Results

  • Local single-scenario run: passed in 10.5 s.
  • Local full Pester suite: 13/13 passing in 231.7 s.
  • Zero direct git, zero LLM calls, all polyphony verbs faked through the shim.

Notes

  • ensure_plan_branch returns error to short-circuit the downstream chain. In real runs, ensure_plan_branch_error_gate would more typically be hit on transient git failure — the abort path was already there; we just walked it.
  • AB#3210 (pre_coder_branch_mismatch_gate) shipped in PR test(harness): pre_coder_branch_mismatch_gate abort scenario (AB#3210) #484. AB#3211 (squash_coverage_mismatch_gate) remains blocked on a per-scenario tmp git init fixture — separate ADO item to follow.

Closes: AB#3239 follow-up coverage of open_questions_gate mapping form.
Refs: AB#3212 (scripted-gate infrastructure), AB#3239 (initial closed_unmerged scenario).

AB#3239 follow-up. Adds tests/harness/scenarios/
open_questions_gate_answer_loop_then_abort/scenario.yaml — the first
scenario to exercise the AB#3212 scripted-gate infrastructure's
mapping form (gate value + additional_input payload).

Path covered in plan-level.yaml:
  depth_guard ... state_detector(not_started)
    -> architect#1 (1 high-severity open_question)
    -> open_questions_counter -> open_questions_gate
       (scripted=answer + additional_input.answers)
    -> architect#2 (open_questions cleared)
    -> ensure_plan_branch (returns error envelope)
    -> ensure_plan_branch_error_gate (scripted=abort, string form)
    -> terminal_abort_run -> $end

Doubles as the proof for both gate-script forms in one scenario:
mapping form (open_questions_gate) and string shorthand
(ensure_plan_branch_error_gate). With AB#3212 strict_gates=true,
typos in either name would fail loudly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PolyphonyRequiem
PolyphonyRequiem merged commit f41555e into main May 19, 2026
1 check passed
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.

1 participant