Skip to content

feat: one-call consolidate_dispatch finalization and kind-native run verdicts - #718

Merged
jflowers merged 4 commits into
unbound-force:mainfrom
jflowers:opsx/dispatch-finalize-determinism
Oct 14, 2026
Merged

jflowers merged 4 commits into
unbound-force:mainfrom
jflowers:opsx/dispatch-finalize-determinism

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

The three review commands (/uf.triage-issue, /uf.review-council,
/uf.address-feedback) previously hand-assembled ~23 KB closed
finalization payloads and transcribed them into
finalize_review_dispatch — an error-prone step responsible for
production-incident-class failures. This change makes
consolidate_dispatch finalize internally from the persisted
session when given provenance (branch, commit, workflow_id),
and emit kind-native run verdicts (triage:
VALID/INVALID/NEEDS-CLARIFICATION, feedback: ACCEPT/AUTHOR-DECIDES)
instead of generic APPROVE-family values. The three commands now
perform exactly one consolidate_dispatch call per finalization
attempt, treat the finalizer's output as authoritative, and fail
closed (INCONCLUSIVE) on non-mechanical errors or exhausted
bounded retries (max 2).

Also fixes the gh api --paginate --slurp + --jq flag
incompatibility in /uf.triage-issue §1.1 and adds a bounded
one-retry duplicate-search fallback in §1.4.

Closes #712

How to Test

  • make plugin-test — 577 tests including new triage/feedback
    internal-finalize regressions
  • make check — full gate (lint, go test -race, build,
    coverage-gate, plugin suite); coverage 94.2% stmts / 85.54%
    branches
  • go test ./internal/scaffold/ -run TestCommandContracts —
    contract clauses pin the one-call language and reject stale
    manual-assembly text
  • Mirror parity: cmp the four .opencode/ ↔
    internal/scaffold/assets/opencode/ pairs (byte-identical)
  • Functional: run /uf.triage-issue <N> on an open issue — §4.6
    issues exactly one consolidate_dispatch call with provenance
    and reports the finalizer's authoritative output

How to Demo

  1. Run /uf.triage-issue <N> on any open issue. In §4.6, observe
    a single consolidate_dispatch call whose only argument is
    the provenance {branch, commit, workflow_id: "uf.triage-issue"} — no payload assembly — followed by the
    authoritative artifact_path and review_verdict.
  2. Run /uf.review-council on a branch: §5 finalizes every
    iteration (including plan-failure and fail-closed early-stop
    paths) through one call per iteration.

Key Files Changed

  • .opencode/plugins/review-dispatch/index.ts + scaffold mirror
    — kind-native run-verdict emission, feedback totality fix,
    lossless back-projection for the payload verdict
  • .opencode/commands/uf.triage-issue.md, uf.review-council.md,
    uf.address-feedback.md + scaffold mirrors — one-call
    finalization pattern
  • .opencode/test/consolidate-dispatch.test.ts —
    internal-finalize regression tests for both kinds +
    payload-without-provenance
  • internal/scaffold/command_contract_test.go — contract
    clauses pinning the new command language
  • CHANGELOG.md, openspec/changes/dispatch-finalize-determinism/
    (proposal, design, specs, tasks), .uf/dewey/learnings/

Known Issues

Review council verdict: APPROVE WITH ADVISORIES (3 iterations;
final artifact
.uf/artifacts/dispatch/635a713e-ddcf-4bb8-9e62-2dca9f43158f.json).

  • MEDIUM (guard): uf.review-pr.md §5b still mandates manual
    finalize_review_dispatch assembly — deliberately out of this
    change's FR-002 scope; follow-up OpenSpec change candidate.
  • MEDIUM (testing): FR-004's bounded-retry language is not yet
    pinned in contract clauses (only FR-007's bound is).
  • LOW (7): retry wording not byte-normalized across the three
    commands; pre-existing workflowVerdictValue string return
    type; design decision 2 readability; two-regime boundary
    comment in the negative test; Dewey learnings AGENTS.md
    commit-scope wording gap; feedback tests don't assert the
    advisories field; internal-finalize test scaffolding
    duplication.

Six spec-review advisories (design-judgment calls) also await a
human ruling; see the artifacts under .uf/artifacts/dispatch/
and the change directory.

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

@jflowers
jflowers requested a review from a team as a code owner October 13, 2026 22:02
@jflowers jflowers self-assigned this Oct 13, 2026
Eliminate hand-transcribed finalization payloads, the incident
class behind this change: consolidate_dispatch now finalizes
internally from the persisted session when given provenance,
and runs carry kind-native verdicts (triage:
VALID/INVALID/NEEDS-CLARIFICATION, feedback:
ACCEPT/AUTHOR-DECIDES) instead of generic APPROVE-family
values.

- Plugin: hoist workflow kind above run emission; emit
  kind-native run verdicts via workflowVerdictValue; fix
  feedback totality (REQUEST CHANGES -> AUTHOR-DECIDES);
  use lossless back-projection for the payload verdict
- uf.triage-issue: rewrite S4.6 to the single-call pattern
  (authoritative finalizer output, bounded mechanical
  retry, fail-closed provenance); fix the gh api
  --slurp/--jq incompatibility in S1.1; add the bounded
  duplicate-search fallback in S1.4
- Tests: triage/feedback internal-finalize regressions,
  payload-without-provenance finalization, blocking-class
  coverage for both kinds
- Contract tests: pin one-call language; reject stale
  manual finalization text and the incompatible gh slurp
  flag
- CHANGELOG entry and spec design/tasks updates

Fixes unbound-force#712

Assisted-by: glm-5-3
Generated with AI assistance (glm-5-3)
@jflowers
jflowers force-pushed the opsx/dispatch-finalize-determinism branch from dc2eae2 to 988ccab Compare October 13, 2026 22:48

@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

Council dispatch (5 planned, 3 successful — architect APPROVE, curator and testing APPROVE WITH ADVISORIES; adversary/guard failed with retryable infra errors and did not vote) reviewed 17 files (+1609/-177) against OpenSpec change dispatch-finalize-determinism and issue #712 (all 5 acceptance criteria covered).

Advisories (non-blocking)

MEDIUM — test-coverage (.opencode/plugins/review-dispatch/index.ts:3297): advisories computation reconditioned from raw verdict to projectedVerdict; for mixed-severity feedback dispatches this changes the observable payload, but no test asserts advisories — single-severity fixtures can't distinguish the conditionings, so a revert would pass the suite. Recommend a mixed-severity feedback case (HIGH + MEDIUM/LOW) asserting the advisory appears.

LOW — regression-protection (internal/scaffold/command_contract_test.go:290): FR-004 retry bound ("at most twice", default-deny) and FR-003 verdict_reason purity are not contract-pinned.

LOW — documentation-traceability (openspec/changes/dispatch-finalize-determinism/tasks.md:92): unbound-force/website#303 exists but is untraceable from the change record (#717 placeholder unfilled, tasks.md 4.6 lacks reference, missing docs label).

LOW — content-pipeline: the incident→determinism narrative is strong Principle VI blog material; no tracking issue exists.

CI: all 14 checks pass/neutral/skip. Pre-flight: PASS (ci-aware, CI-covered).

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

const projectedVerdict = projectNativeValue(workflowResult.value)

// Build advisories for advisory-level verdicts.
const advisories = projectedVerdict === "APPROVE WITH ADVISORIES" ? buildAdvisories(consolidatedFindings) : []

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.

MEDIUM — test-coverage (divisor-testing): No test pins the advisories field after this reconditioning. For feedback-kind dispatches with mixed severities, advisories changes from [] to populated (REQUEST CHANGES projects to AUTHOR-DECIDES, which back-projects to APPROVE WITH ADVISORIES). Single-severity fixtures (LOW-only, HIGH-only) produce identical results under both conditionings. Recommend one mixed-severity feedback test (one HIGH + one MEDIUM/LOW finding) asserting the advisory appears in advisories.

}
}

func TestCommandContracts_RejectStaleManualFinalizationLanguage(t *testing.T) {

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.

LOW — regression-protection (divisor-testing): The bounded mechanical-retry policy ("retry the identical consolidate_dispatch call", "at most twice", "default-deny") and FR-003's verdict_reason purity rule ("do not summarize action completion in verdict_reason") aren't pinned by contract clauses — future edits to these gate-protected limits would pass silently.

gates untouched, no governance gate modified, artifacts
remain tool-authoritative (proposal Constitution Alignment
I-V)
- [x] 4.6 File a cross-repo documentation issue in

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.

LOW — documentation-traceability (divisor-curator): Task 4.6 is checked without recording the cross-repo website issue. Consider recording unbound-force/website#303's URL here (or completing the "to be linked" line in #717) and adding the docs label to unbound-force/website#303 so label-filtered duplicate checks surface it.

@jflowers
jflowers merged commit b58ef6d into unbound-force:main Oct 14, 2026
16 checks passed
@jflowers
jflowers deleted the opsx/dispatch-finalize-determinism branch November 15, 2026 21:36
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.

fix: correct incompatible gh api flags in uf.triage-issue

1 participant