Repository navigation
feat(commands): apply question-tool presentation contract to 22 decision gates - #854
Conversation
Upgrade every human-facing question gate in /uf.triage-issue (8), /uf.address-feedback (6), and /uf.review-pr (8) to the presentation contract PR unbound-force#792 introduced for /uf.review-council: each gate prints its decision content as plain session text above the question tool (visibility directive), adds per-option reasoning and an advisory recommendation grounded in the command's own assessment data, and presents the recommended option first, labeled "(Recommended)". - Presentation only: option sets, MANDATORY GATE markers, session-resume guards, and CRITICAL RULEs are unchanged; no gate is weakened, bypassed, or disabled - Composed reply comments (/uf.address-feedback 4.5) and the triage comment (/uf.triage-issue 4.3) are printed before their posting questions - Sync the three scaffold mirrors byte-identical - Add structural pin test TestQuestionToolPresentationContractGates asserting the shared contract fragments, per-gate option inventories, and per-command gate counts (8/6/8) - Ship the openspec change artifacts and CHANGELOG entry (docs: unbound-force#853, unbound-force/website#339) Closes unbound-force#850 Assisted-by: glm-5 Generated with AI assistance (glm-5)
jflowers
left a comment
There was a problem hiding this comment.
Review Verdict: APPROVE WITH ADVISORIES
The Divisor review council dispatched 5 personas (adversary, architect, curator, guard, testing); all 5 succeeded and approved. Four LOW-severity advisories remain after deduplication; no blocking findings. CI is fully green (17 checks: 11 pass, 2 neutral, 4 skipped — no failures). Mirror parity between .opencode/commands/uf.*.md and internal/scaffold/assets/opencode/commands/ verified byte-identical.
What this PR does
Applies the question-tool presentation contract (from #792) to all 22 decision gates across uf.triage-issue (8), uf.address-feedback (6), and uf.review-pr (8): each gate now prints the decision content with per-option reasoning, an advisory recommendation, and a fail-closed clause as session text, then presents the question tool with the recommended option first and labeled "(Recommended)". Option sets, MANDATORY GATE markers, session-resume guards, and CRITICAL RULEs are unchanged. TestQuestionToolPresentationContractGates pins the contract structure across all three command assets and their mirrors.
Advisories (all LOW — none blocking)
- Consistency (
.opencode/commands/uf.review-pr.md:162) — the presentation-only array-order sentence appears at 9 of 22 gates; parallel gates are treated differently because design D2's criterion is judgment-based. - Documentation (
.opencode/commands/uf.triage-issue.md:512) — the fail-closed clause cites unqualified FR numbers that become ambiguous after OpenSpec archival. - Assertion depth (
internal/scaffold/scaffold_test.go:560) — the legacy-phrasing negative pin is case-sensitive; the removed text also had a lowercase mid-sentence form. - Test coverage (
internal/scaffold/scaffold_test.go:356) —contractFragmentsomits the fail-closed clause (a deliberate, documented omission per FR-010/design D4).
Details in the inline comments.
This review was generated by /uf.review-pr (AI-assisted).
| the same options, the recommended option FIRST and | ||
| labeled "(Recommended)": | ||
| `["Wait for checks to complete", "Proceed with | ||
| available results"]`. |
There was a problem hiding this comment.
This Step 3 gate omits the clarifying sentence that the static array order is presentation-only, while the structurally parallel Step 7 gate in this file carries it and the uf.triage-issue Phase 4 gate (lines 518–520) carries it too. The sentence appears at 9 of the 22 upgraded gates, and the scaffold mirrors repeat the split. The root cause is design D2's criterion — "gates where static array order most diverges" — which is judgment-based, so a future gate edit cannot determine mechanically whether to include the sentence. A deterministic rule (include at every gate, or at every gate whose array order is not already recommended-first) or a per-gate presence/absence pin in TestQuestionToolPresentationContractGates would make the choice auditable. Advisory only (LOW) — no action required in this PR.
| material dissent or uncertainty. | ||
| If the assessment data does not ground any option, the | ||
| gate MUST say so, present the trade-off, and still ask | ||
| the full option set (fail-closed, per FR-006/FR-012) |
There was a problem hiding this comment.
The fail-closed clause cites spec-internal requirement numbers without a path qualifier. Once this OpenSpec change archives, bare "FR-006/FR-012" references become ambiguous — FR-NNN numbering restarts per capability under openspec/specs/ and archived changes. The clause is self-contained normative text ("the gate MUST say so, present the trade-off, and still ask the full option set"), so the citation is provenance-only; qualifying it — e.g., "per FR-006/FR-012 of the question-tool-presentation spec" — keeps the reference resolvable after archival. Advisory only (LOW).
| }) | ||
|
|
||
| t.Run("legacy bare-options phrasing absent", func(t *testing.T) { | ||
| legacy := "Use the **question tool** with options" |
There was a problem hiding this comment.
The negative pin matches the legacy phrasing case-sensitively: strings.Contains at line 568 checks only the capitalized form Use the **question tool** with options. The removed text also used a lowercase mid-sentence form (the pre-PR uf.address-feedback 3.2 and uf.review-pr Step 3 read "use the question tool with options"), so a reintroduced lowercase variant passes both this check and the wrapped-lines check at line 571 unless it also carries a backtick option array, which the array-count tripwire at line 552 catches. Checking a lowercase variant (or normalizing both sides through strings.ToLower) closes the residual gap. Advisory only (LOW).
| return strings.Join(strings.Fields(s), " ") | ||
| } | ||
|
|
||
| contractFragments := []string{ |
There was a problem hiding this comment.
contractFragments pins the shared D2 contract elements but omits the fail-closed clause — the one contract element without mechanical drift protection. The clause tail ("fail-closed, per FR-006/FR-012") sits on a single line once per gate, so a fragment such as fail-closed, per FR-006 combined with a per-gate strings.Count would pin it. FR-010 and design D4 document this omission deliberately ("its deletion relies on review"), so the test matches the current spec; extending the fragment list is a candidate for a follow-up spec change rather than an edit here. Advisory only (LOW).
Summary
Closes #850
Applies the question-tool presentation contract (introduced for
/uf.review-councilin PR #792) to all 22 human-facing decisiongates across the three sibling commands:
/uf.triage-issue— 8 gates/uf.address-feedback— 6 gates/uf.review-pr— 8 gatesEach upgraded gate now:
question tool (visibility directive — printed text and question
tool present the same details and options)
fits) and an advisory recommendation grounded in the command's own
assessment data
Presentation only: option sets, MANDATORY GATE markers,
session-resume guards, and CRITICAL RULEs are unchanged — no gate is
weakened, bypassed, or disabled. Composed reply comments
(
/uf.address-feedback§4.5) and the triage comment(
/uf.triage-issue§4.3) are now printed before their postingquestions.
A new structural pin test (
TestQuestionToolPresentationContractGatesin
internal/scaffold/scaffold_test.go) pins the shared contractfragments, per-gate option inventories, and per-command gate counts
(8/6/8) across the three command assets — closing the #792 advisory
gap that the presentation contract was pinned only in prose.
Spec artifacts:
openspec/changes/question-tool-presentation-contract/Documentation tracked in #853 and unbound-force/website#339.
How to Test
make check— green (vet, test, build, coverage gate, plugintests; verified pre-finale)
go test ./internal/scaffold/ -count=1— green, including:TestQuestionToolPresentationContractGates(new pin test:contract fragments, option inventories, gate counts 8/6/8)
openspec validate question-tool-presentation-contract— valid(only the intentional
originating_issuekey warning)cmp: the three.opencode/commands/uf.*.mdfiles are byte-identical to theirinternal/scaffold/assets/opencode/commands/mirrorsHow to Demo
Run
/uf.triage-issue <N>(or/uf.address-feedback <PR>//uf.review-pr <PR>) with the scaffolded commands and trigger anydecision gate: the decision content prints as plain session text
above the question tool, options carry per-option reasoning, and the
recommended option appears first labeled "(Recommended)". Option
sets and blocking semantics are identical to before.
Key Files Changed
.opencode/commands/uf.triage-issue.md(+237/−20).opencode/commands/uf.review-pr.md(+232/−29).opencode/commands/uf.address-feedback.md(+191/−27)internal/scaffold/assets/opencode/commands/uf.{triage-issue,review-pr,address-feedback}.md— byte-identical mirror sync of the three commands
internal/scaffold/scaffold_test.go(+281/−0, new pin test)CHANGELOG.md(+17/−0, entry under Changed)openspec/changes/question-tool-presentation-contract/— proposal,design, tasks, spec delta,
.openspec.yamlTotal: 9 files changed, +1618/−152 (plus the new spec directory).
No unresolved
/uf.review-councilfindings — council returnedAPPROVE.
This PR was generated by /uf.finale (AI-assisted).