Skip to content

feat(commands): apply question-tool presentation contract to 22 decision gates - #854

Merged
jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:opsx/question-tool-presentation-contract
Oct 28, 2026
Merged

jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:opsx/question-tool-presentation-contract

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Closes #850

Applies the question-tool presentation contract (introduced for
/uf.review-council in PR #792) to all 22 human-facing decision
gates across the three sibling commands:

  • /uf.triage-issue — 8 gates
  • /uf.address-feedback — 6 gates
  • /uf.review-pr — 8 gates

Each upgraded gate now:

  • prints its decision content as plain session text above the
    question tool (visibility directive — printed text and question
    tool present the same details and options)
  • includes per-option reasoning (what each choice does and when it
    fits) and an advisory recommendation grounded in the command's own
    assessment data
  • 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 now printed before their posting
questions.

A new structural pin test (TestQuestionToolPresentationContractGates
in internal/scaffold/scaffold_test.go) pins the shared contract
fragments, 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, plugin
    tests; verified pre-finale)
  • go test ./internal/scaffold/ -count=1 — green, including:
    • TestQuestionToolPresentationContractGates (new pin test:
      contract fragments, option inventories, gate counts 8/6/8)
    • scaffold drift tests (mirror parity)
  • openspec validate question-tool-presentation-contract — valid
    (only the intentional originating_issue key warning)
  • Mirror parity verified via cmp: the three
    .opencode/commands/uf.*.md files are byte-identical to their
    internal/scaffold/assets/opencode/commands/ mirrors

How to Demo

Run /uf.triage-issue <N> (or /uf.address-feedback <PR> /
/uf.review-pr <PR>) with the scaffolded commands and trigger any
decision 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.yaml

Total: 9 files changed, +1618/−152 (plus the new spec directory).

No unresolved /uf.review-council findings — council returned
APPROVE.


This PR was generated by /uf.finale (AI-assisted).

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
jflowers requested a review from a team as a code owner October 28, 2026 17:45

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

  1. 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.
  2. Documentation (.opencode/commands/uf.triage-issue.md:512) — the fail-closed clause cites unqualified FR numbers that become ambiguous after OpenSpec archival.
  3. 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.
  4. Test coverage (internal/scaffold/scaffold_test.go:356) — contractFragments omits 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"]`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@jflowers
jflowers merged commit 13f6e6a into unbound-force:main Oct 28, 2026
17 checks passed
@jflowers
jflowers deleted the opsx/question-tool-presentation-contract branch November 15, 2026 21:37
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.

Apply the question-tool presentation contract to uf.triage-issue, uf.address-feedback, and uf.review-pr

1 participant