Skip to content

fix(commands): add mandatory gate to uf.triage-issue Phase 4 - #485

Merged
jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/triage-mandatory-gate
Aug 20, 2026
Merged

jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/triage-mandatory-gate

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Adds a >>> MANDATORY GATE: HUMAN CONFIRMATION REQUIRED <<<
block to Phase 4 of the uf.triage-issue command.

During triage of issue #465, the agent executed all Phase 4
mutations autonomously -- posting a triage comment and creating
4 child issues -- without pausing for user confirmation. The
root cause: Phase 4 was labeled "(Interactive)" but lacked an
explicit mandatory gate marker. Other commands
(uf.review-council Step 7f, uf.finale Steps 2/5) use this
marker pattern successfully to enforce hard stops.

The gate includes a session-resume guard, requires displaying
the triage summary before proceeding, offers Proceed/Skip
options via the question tool, and reiterates the
gh api --input <tmpfile> injection safety requirement at the
mutation boundary.

Fixes #473

How to Test

  1. Run /uf.triage-issue <N> on any open issue
  2. Verify the agent stops at Phase 4 entry with a mandatory
    gate prompt displaying the triage summary
  3. Select "Proceed" -- confirm mutations execute with per-step
    confirmations (labels, comment, child issues)
  4. On a separate test, select "Skip" -- confirm only the
    artifact is written and no GitHub mutations occur
  5. Run make test -- verify all 20 packages pass including
    the drift-detection test for scaffold file sync

How to Demo

  1. Open any GitHub issue in the repository
  2. Run /uf.triage-issue <issue-number>
  3. Observe the 5-agent triage assessment (Phase 2) and
    classification (Phase 3) execute normally
  4. At Phase 4 entry, observe the mandatory gate prompt with
    the triage summary displayed above it
  5. The question tool presents two options:
    • "Proceed -- execute triage actions"
    • "Skip -- write artifact only"
  6. Selecting "Proceed" continues to per-action confirmations
    for labels, comments, and child issues
  7. Selecting "Skip" jumps directly to artifact generation

Key Files Changed

.opencode/commands/

  • uf.triage-issue.md -- 38-line mandatory gate block inserted
    at Phase 4 entry (between heading and 4.1)

internal/scaffold/assets/opencode/commands/

  • uf.triage-issue.md -- identical sync copy of the above

openspec/changes/triage-mandatory-gate/

  • .openspec.yaml -- change metadata
  • proposal.md -- motivation and what changes
  • design.md -- 5 design decisions, risks, non-goals
  • specs/mandatory-gate.md -- delta spec with 6 scenarios
  • tasks.md -- 3 task groups, all complete

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

@jflowers
jflowers requested a review from a team as a code owner August 14, 2026 20:05
@jflowers jflowers self-assigned this Aug 14, 2026
@jflowers jflowers added the next-release Targeted for inclusion in next release but can be deferred if needed label Aug 14, 2026
@jflowers jflowers moved this to Ready for Review 👀 in Unbound Force Planning Aug 14, 2026

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: fix(commands): add mandatory gate to uf.triage-issue Phase 4

Walkthrough

File Change
.opencode/commands/uf.triage-issue.md +38 lines: mandatory gate block between Phase 4 heading and 4.1 — session-resume guard, summary pre-condition, question tool confirmation, Skip path, mutation safety reiteration
internal/scaffold/assets/opencode/commands/uf.triage-issue.md Identical gate block; drift-detection test continues to pass
openspec/changes/triage-mandatory-gate/.openspec.yaml New OpenSpec manifest
openspec/changes/triage-mandatory-gate/design.md Design doc: context, goals/non-goals, 5 decisions, 2 risks
openspec/changes/triage-mandatory-gate/proposal.md Proposal: why/what/capabilities/impact/constitution alignment
openspec/changes/triage-mandatory-gate/specs/mandatory-gate.md Spec: 4 ADDED requirements with Given/When/Then, 1 MODIFIED
openspec/changes/triage-mandatory-gate/tasks.md 3 tasks (all checked), spec/code review passed

Issue Coverage

All 4 acceptance criteria from #473 are satisfied:

  • >>> MANDATORY GATE <<< marker at Phase 4 entry
  • Compressed-context resume guard
  • Temp file + --input reiterated at mutation boundary
  • Phase 4.1 summary displayed before any mutation

Findings

The core implementation is correct and complete — gate placement, session-resume guard, question tool options, Skip path, mutation safety reiteration, and file sync are all properly executed. Three documentation-only issues require resolution:

[MEDIUM] A1 — Design/implementation drift: END MANDATORY GATE closing marker (inline comment on design.md)

[MEDIUM] A2 — Missing CHANGELOG.md entry

This PR changes observable agent behavior in a user-facing command: agents now stop and require explicit human confirmation at Phase 4 entry. The CHANGELOG.md Unreleased section has no entry for this change. Per AGENTS.md:

"MUST file a documentation impact: CHANGELOG.md for change entries"

Prior behavioral changes to uf.triage-issue (label gates, namespace prefix) all have CHANGELOG.md entries.

[MEDIUM] A3 — Missing website documentation issue

AGENTS.md and the constitution require:

"MUST file a documentation issue against the current repo for user-facing changes before PR merge."

This is a user-facing behavioral change (mandatory confirmation gate). Issue #202 predates this PR and covers the AskUserQuestion gates from #391, not the new mandatory gate pattern. A new documentation issue should be filed.

Verdict

REQUEST CHANGES — Three MEDIUM documentation-only fixes. The underlying bug fix is sound.

- Adding an `>>> END MANDATORY GATE <<<` closing marker
(the entire remainder of Phase 4 is gated; closing markers
are used in `uf.finale` for conditional gates that have
ungated content following them)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[MEDIUM] A1 — Design/implementation drift

This Non-Goals bullet states:

Adding an >>> END MANDATORY GATE <<< closing marker (the entire remainder of Phase 4 is gated; closing markers are used in uf.finale for conditional gates that have ungated content following them)

But the implementation does include >>> END MANDATORY GATE <<< in both command files (.opencode/commands/uf.triage-issue.md line 249 and the scaffold copy). The closing marker is arguably the correct choice — it's consistent with the uf.review-council.md pattern — but this design doc now actively misrepresents what was built.

Suggested fix: Either remove this Non-Goals bullet, or restructure it to explain the rationale for including the closing marker (e.g., pattern consistency with uf.review-council).

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.

Fixed — removed the contradictory Non-Goals bullet entirely.

The >>> END MANDATORY GATE <<< closing marker was added for pattern consistency with uf.review-council.md. The design doc no longer claims otherwise.

Commit: 8d98e8c

@em-redhat em-redhat moved this from Ready for Review 👀 to In Review 🏁 in Unbound Force Planning Aug 18, 2026
jflowers added a commit to jflowers/unbound-force that referenced this pull request Aug 18, 2026
- Remove contradictory Non-Goals bullet about END MANDATORY
  GATE closing marker (design.md said it wouldn't be added,
  but implementation includes it for pattern consistency)
- Add CHANGELOG.md entry for user-facing behavioral change
- Filed documentation issue unbound-force#525

Addresses: review by @em-redhat on PR unbound-force#485
@jflowers

Copy link
Copy Markdown
Contributor Author

Addressed all three feedback items from @em-redhat:

A1 (design/implementation drift): Removed the contradictory Non-Goals bullet about >>> END MANDATORY GATE <<< closing marker. The implementation includes it for pattern consistency with uf.review-council.md; the design doc no longer claims otherwise.

A2 (CHANGELOG): Added entry under ## Unreleased / ### Changed describing the mandatory gate behavioral change.

A3 (documentation issue): Filed #525 per AGENTS.md documentation gate.

Commit: 8d98e8c

@jflowers
jflowers requested a review from em-redhat August 18, 2026 18:09

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-Review: fix(commands): add mandatory gate to uf.triage-issue Phase 4

Prior Review Status

All three findings from the prior REQUEST_CHANGES review have been addressed in commit 8d98e8c:

Finding Status
A1 — design.md Non-Goals contradiction (END MANDATORY GATE listed as non-goal but present in implementation) RESOLVED — contradictory bullet removed
A2 — Missing CHANGELOG.md entry RESOLVED — 8-line entry added to Unreleased/Changed
A3 — Missing website documentation issue RESOLVED — Issue #525 filed and linked

Walkthrough

File Change
.opencode/commands/uf.triage-issue.md +38: mandatory gate block at Phase 4 entry
CHANGELOG.md +8: Unreleased/Changed entry for mandatory gate
internal/scaffold/assets/opencode/commands/uf.triage-issue.md +38: identical gate block (scaffold sync)
openspec/changes/triage-mandatory-gate/ +5 files: OpenSpec change artifacts (proposal, design, specs, tasks, manifest)

Issue Coverage

All 4 acceptance criteria from #473 remain satisfied:

  • >>> MANDATORY GATE <<< marker at Phase 4 entry
  • Compressed-context resume guard
  • Temp file + --input reiterated at mutation boundary
  • Phase 4.1 summary displayed before any mutation

Remaining Blocker: Merge Conflicts

The branch has merge conflicts (mergeable: CONFLICTING). CI has not run on the HEAD commit (8d98e8c) and cannot run until conflicts are resolved.

Path to merge: Rebase or merge main into the branch, resolve conflicts, push — triggering a fresh CI run. Once CI passes green on the resolved commit, this PR is ready for APPROVE without further review rounds.

Verdict

COMMENT — All prior findings resolved. Implementation is sound. Withholding APPROVE only because CI has not verified the HEAD commit due to merge conflicts. Ready for approval once conflicts are resolved and CI passes.

This review was generated by /uf.review-pr (AI-assisted).

Phase 4 was labeled "(Interactive)" but lacked an explicit
>>> MANDATORY GATE <<< marker. During triage of issue unbound-force#465,
the agent executed all Phase 4 mutations autonomously --
posting comments and creating child issues without user
confirmation.

- Insert 38-line mandatory gate block at Phase 4 entry
  with session-resume guard, question tool confirmation,
  proceed/skip branching, and --input safety reiteration
- Sync identical content to scaffold canonical copy
- Add OpenSpec change artifacts (proposal, design, specs,
  tasks)

Fixes unbound-force#473

Assisted-by: claude-opus
Generated with AI assistance (claude-opus)
- Remove contradictory Non-Goals bullet about END MANDATORY
  GATE closing marker (design.md said it wouldn't be added,
  but implementation includes it for pattern consistency)
- Add CHANGELOG.md entry for user-facing behavioral change
- Filed documentation issue unbound-force#525

Addresses: review by @em-redhat on PR unbound-force#485
@jflowers
jflowers force-pushed the opsx/triage-mandatory-gate branch from 8d98e8c to 6191935 Compare August 20, 2026 15:04
@em-redhat
em-redhat self-requested a review August 20, 2026 15:17

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review: APPROVE

All three prior REQUEST_CHANGES findings confirmed resolved in the rebased diff:

Finding Status
A1 — design.md Non-Goals contradiction (END MANDATORY GATE) RESOLVED — contradictory bullet removed
A2 — Missing CHANGELOG.md entry RESOLVED — 8-line entry added under Unreleased/Changed
A3 — Missing documentation issue RESOLVED — Issue #525 filed and OPEN

All 4 acceptance criteria from #473 satisfied. CI passes cleanly on the rebased HEAD. Branch is CLEAN and MERGEABLE.

The implementation correctly follows the established mandatory gate pattern (uf.review-council Step 7f), includes session-resume guards, maintains file sync between both command copies, and properly handles the Skip path.

[LOW] Issue #525 appears filed in unbound-force/unbound-force rather than unbound-force/website — for an internal agent command file this may be the correct interpretation. Not blocking.

This review was generated by /uf.review-pr (AI-assisted).

@jflowers
jflowers merged commit 60b6bb3 into unbound-force:main Aug 20, 2026
15 checks passed
@jflowers
jflowers deleted the opsx/triage-mandatory-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

next-release Targeted for inclusion in next release but can be deferred if needed

Projects

Status: In Review 🏁

Development

Successfully merging this pull request may close these issues.

uf.triage-issue: Phase 4 lacks mandatory pause before mutations — agent can bypass interactive confirmation gates

2 participants