Skip to content

feat: add per-finding spec review decision gate - #792

Merged
jflowers merged 5 commits into
unbound-force:mainfrom
jflowers:opsx/spec-review-per-finding-gate
Oct 23, 2026
Merged

jflowers merged 5 commits into
unbound-force:mainfrom
jflowers:opsx/spec-review-per-finding-gate

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Replaced the bulk spec auto-fix consent gate and the HIGH/CRITICAL
dead-stop with a per-finding interactive decision flow in the spec
review gates (Fixes #777). Every REQUEST CHANGES finding is now
presented one at a time in severity order (CRITICAL, HIGH, MEDIUM,
LOW) with its details, per-option reasoning, and a recommendation
printed as session text above and the question tool below; options
are exactly "Apply suggested fix" (any severity — a human-directed
consented edit, not an autonomous auto-fix), "Override & continue"
(requires a recorded justification), "Show more context", and
"Pause & exit", plus a bulk "Apply all remaining LOW/MEDIUM fixes"
shortcut only while the current finding is LOW/MEDIUM. After
applied fixes the review re-runs under existing iteration rules
(all reviewers, single sibling-evidence acquisition, 3-iteration
cap); findings matching a recorded override (same file and root
cause) carry forward as resolved; overrides are recorded durably
in checkpoint data (severity, description, justification) and the
final report labels override-only completion as REQUEST CHANGES
resolved by recorded overrides. Approving verdicts skip the gate;
the severity pack gains a clarifying note (human-directed
per-finding fixes vs. autonomous LOW/MEDIUM-only auto-fixes); the
spec-review exit reason string, plugin description, and formatter
goldens were updated; docs/heroes.md stale capability bullet
replaced; CHANGELOG entry added; 15 files touched (canonical
commands/pack, template/plugin strings, 5 scaffold mirrors, 3 test
files, docs page, CHANGELOG) with structural pin tests extended
in lockstep.

Closes #777

How to Test

  1. Gate structure: grep both command files
    (.opencode/commands/uf.review-council.md,
    .opencode/commands/uf.unleash.md) for >>> MANDATORY GATE
    marker pairs, all five option labels, and the session-resume
    guard; confirm no HIGH/CRITICAL dead-stop branch remains in
    Step 4 processing.
  2. Exit string: confirm "Unresolved spec review findings (pause
    or iteration cap)" in .opencode/lib/unleash-templates.ts, the
    plugin findings-param description, and both formatter test
    assertions.
  3. Scaffold drift + contract tests:
    go test -race -count=1 ./internal/scaffold/... (mirrors
    byte-identical; TestSpecReviewPerFindingGateContracts pins
    option labels, gate markers, severity order, no-autonomous-
    progression, override recording, session-resume guard,
    recommended-option labeling, auto-fix boundary, bulk-shortcut
    severity restriction, override carry-forward key,
    override-only outcome labeling).
  4. Full suite: make check (lint, test, build, coverage-gate,
    plugin-test).
  5. Live behavior: run /uf.unleash on a branch with spec
    artifacts and a REQUEST CHANGES spec review — findings appear
    one at a time in severity order as session text with the
    question tool below, recommended option first labeled
    "(Recommended)".

How to Demo

Run /uf.unleash on a branch carrying spec artifacts whose spec
review returns REQUEST CHANGES: each finding surfaces one at a
time in severity order with full context, per-option reasoning,
and a recommendation; choose "Apply suggested fix", "Override &
continue" (with justification), or "Pause & exit" to see the
per-finding flow, override carry-forward on re-runs, and the
override-only completion label in the final report.

Key Files Changed

  • .opencode/commands/uf.review-council.md (167) — per-finding
    decision gate + checkpoint contract
  • .opencode/commands/uf.unleash.md (153) — Step 4 gate aligned
    with council protocol
  • .opencode/lib/unleash-templates.ts,
    .opencode/plugins/uf-workflow/index.ts — exit reason string,
    plugin description
  • .opencode/uf/packs/severity.md — human-directed fix vs.
    autonomous auto-fix clarification
  • internal/scaffold/scaffold_test.go (167) — structural pin
    tests (13 subtests)
  • Scaffold mirrors (5 files) — commands, template, plugin, pack
  • openspec/changes/spec-review-per-finding-gate/ — proposal,
    design, spec delta, tasks
  • CHANGELOG.md, docs/heroes.md — change entry, capability
    bullet
  • .uf/dewey/learnings/ (24 files) — retrospective learnings

Known Issues

Code review closed APPROVE WITH ADVISORIES; 9 advisories recorded:

  • MEDIUM: The proposal's Capabilities section does not match the
    shipped spec delta (line 79 declares "New Capabilities: None"
    while listing Modified Capabilities that diverge from the final
    spec delta).
  • MEDIUM: The change record resolves the AGENTS.md repo
    documentation gate via a maintainer exemption ("no repo docs
    issue or website issue filed per maintainer decision",
    tasks.md task 3.3).
  • LOW: Design D1's "keeps citing that section by name" claim
    about /uf.unleash Step 4 diverges from the embedded text.
  • LOW: TestSpecReviewPerFindingGateContracts repeats the same
    dual-file assertion shape across ~10 subtests (table-driven
    refactor opportunity).
  • LOW: Issue Docs: spec review per-finding decision gate replaces auto-fix consent gate and HIGH/CRITICAL dead-stop #789 has no labels, so label-filtered duplicate
    detection does not return it.
  • LOW: Cross-Repo website documentation issue and blog
    opportunity deferred via "revisit at merge" with no durable
    tracker.
  • LOW: The per-finding gate's presentation contract (session
    text above the question tool) is pinned only in prose, not in
    tests.
  • LOW: The checkpoint-contract pin is asymmetric across the two
    commands (council pins the step marker; /uf.unleash pins only
    the overrides key).
  • LOW: The updated findings-param zod description has no test
    linkage.

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

@jflowers
jflowers requested a review from a team as a code owner October 23, 2026 02:39
- Skip the decision gate on APPROVE/APPROVE WITH ADVISORIES
  verdicts instead of only when no findings exist
- Checkpoint each human decision (per-finding choice, override,
  bulk shortcut) with a cross-iteration overrides array
- Carry recorded overrides (same file + root cause) forward as
  resolved on re-runs, so humans are never re-prompted for
  already-decided findings
- Record override-only completions in the final report and
  pipeline summary
- Mirror command updates in scaffold assets with drift tests
- Update spec-review-per-finding-gate OpenSpec artifacts and
  heroes documentation

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers force-pushed the opsx/spec-review-per-finding-gate branch from fcbae36 to ad97931 Compare October 23, 2026 10:44
@jflowers
jflowers merged commit b136bc5 into unbound-force:main Oct 23, 2026
17 checks passed
jflowers added a commit that referenced this pull request Oct 28, 2026
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 #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: #853, unbound-force/website#339)

Closes #850

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers deleted the opsx/spec-review-per-finding-gate 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.

Present Recommendations for Findings in Review Council Locally

1 participant