Skip to content

fix(review-dispatch): derive verdict from persona votes (issue #764) - #779

Merged
jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:opsx/fix-dispatch-verdict-derivation
Oct 20, 2026
Merged

jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:opsx/fix-dispatch-verdict-derivation

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Fixed the deterministic verdict-derivation disagreement between
consolidate_dispatch and finalize_review_dispatch (issue #764):
the emitter now derives workflow_result.value and verdict from
calculatedWorkflowValue — the same vote-based, per-run derivation
the finalizer validates with — instead of the severity ladder over
consolidated findings. One derivation shared by emission and
validation makes disagreement structurally impossible.

Previously, feedback split panels (a zero-findings ACCEPT run plus
findings-bearing runs), triage split-majority panels, and
zero-success panels were rejected with identical value-mismatch
errors on every retry — burning the mechanical-retry budget and
failing closed INCONCLUSIVE with no persisted artifact (observed on
PR #761). They now finalize on the first attempt per the documented
strictest-rule semantics. verdict_reason and advisories remain
severity-derived; council and test-review outputs are unchanged
(both derivations agree there).

Implementation: WorkflowValueInput structural input type and
SeverityLadderVerdict type tightening in the plugin, byte-identical
scaffold mirror, four regression tests, CHANGELOG entry,
documentation issues filed (#778 in-repo, unbound-force/website#316
cross-repo), and the OpenSpec delta adding FR-009..FR-012 to the
dispatch-finalization capability.

Closes #764

How to Test

Run make plugin-test — the full vitest suite must pass (892/892
tests), including the four new regression tests in
.opencode/test/consolidate-dispatch.test.ts:

  • "finalizes a split address-feedback panel via internal
    finalization and an unmodified payload"
  • "finalizes a split-majority triage panel via internal finalization
    and an unmodified payload"
  • "keeps council mixed-severity panel output identical to the
    severity-derived behavior"
  • "finalizes a zero-successful-runs panel as INCONCLUSIVE instead of
    a value-mismatch rejection"

Run make check for CI parity — go vet, golangci-lint, Go tests
with race detector (including the internal/scaffold drift tests
that verify the plugin and its scaffold mirror are byte-identical),
go build, coverage-gate, and the plugin suite. Each new test
verifies the TC-001 property: it failed against the pre-fix plugin
with exactly the issue #764 rejection (workflow_result.value is AUTHOR-DECIDES; expected ACCEPT) and passes against the fixed
plugin.

How to Demo

  1. Open .opencode/test/consolidate-dispatch.test.ts — the four
    new regression tests encode the previously unfinalizable panel
    shapes as on-disk session fixtures.
  2. Run make plugin-test (or target the file with vitest) — the
    split-panel cases finalize ACCEPT/APPROVE through the
    internal-finalize path on the first attempt.
  3. To see the defect live, revert
    .opencode/plugins/review-dispatch/index.ts to main and
    re-run: the same tests fail with workflow_result.value is AUTHOR-DECIDES; expected ACCEPT — the exact PR fix(commands): document actual review-dispatch data flows (#735) #761 rejection.

Key Files Changed

  • .opencode/plugins/review-dispatch/index.ts (68 lines) —
    consolidate_dispatch payload construction: verdict from
    calculatedWorkflowValue, WorkflowValueInput type,
    SeverityLadderVerdict tightening
  • .opencode/test/consolidate-dispatch.test.ts (+466) — feedback
    split, triage split-majority, council non-regression, zero-success
    regression tests
  • internal/scaffold/assets/opencode/plugins/review-dispatch/index.ts
    (68 lines) — byte-identical scaffold mirror (drift tests enforce)
  • CHANGELOG.md — Fixed entry
  • openspec/changes/fix-dispatch-verdict-derivation/ — proposal,
    design, spec delta (FR-009..FR-012), tasks
  • .uf/dewey/learnings/ (11 files) — retrospective learnings from
    the change workflow

Known Issues

Review gates returned APPROVE WITH ADVISORIES (spec review iteration
2; code review 3/4 reviewers — architect timed out, retryable).
Advisories recorded and consented, not blocking:

  • MEDIUM — Constitution Alignment in the proposal assesses only
    Principles I-IV; constitution v1.4.0 has six. Principles V
    (Security by Default) and VI (Deterministic Execution) go
    unassessed — omitting VI forfeits the change's strongest alignment
    evidence. Substance aligns; the gate artifact is incomplete.
  • MEDIUM — FR-011 states the council/test-review invariance as
    universal ("both derivations agree on every input"). The claim is
    false on review-dispatch: failed child run with accepted submissions bricks consolidate_dispatch finalization #751-contaminated panels (failed runs' findings enter the
    severity ladder but not the vote count); design.md and the
    regression test scope it correctly, and review-dispatch: failed child run with accepted submissions bricks consolidate_dispatch finalization #751 is tracked separately.
  • LOW — calculatedWorkflowValue is called with a fixed
    advisories: []; the fixed-point invariant is documented only in
    a code comment, with no compile-time guard against a future
    advisory-dependent voting branch.
  • LOW — Task 4.1 in tasks.md attributes scaffold drift tests to
    make plugin-test; they are Go tests run by make test /
    make check. Task-record accuracy only; verification substance
    unaffected.
  • Spec-gate-only LOW advisories (lone [P] marker on task 2.1,
    FR-012 pinning the severity-derived verdict_reason quirk, a
    74-char line in tasks.md) were consented and remain in the spec
    artifacts.

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

@jflowers
jflowers requested a review from a team as a code owner October 20, 2026 15:56

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

Council Review: REQUEST CHANGES

Note: The council verdict is REQUEST CHANGES. GitHub does not allow requesting changes on one's own PR, so this review posts as a COMMENT.

4/4 reviewer runs succeeded (adversary: APPROVE WITH ADVISORIES, architect: APPROVE, curator: REQUEST CHANGES, guard: APPROVE; envoy/herald/scribe/sre/testing skipped by dispatch policy). All 17 CI checks pass on 84b0626.

The code fix is sound: deriving workflow_result.value and verdict from calculatedWorkflowValue — the same vote-based function the finalizer validates with — makes emitter/validator disagreement structurally impossible, and the four regression tests pin the previously unfinalizable panel shapes. Adversary, architect, and guard raise no blocking code findings.

Two HIGH documentation-accuracy findings block the merge. Both concern spec artifacts whose defects the change's own shipped learnings declare and prescribe fixes for, without the artifact text being amended:

  • [HIGH] proposal.md:109 — Constitution Alignment assesses only Principles I-IV of the six active v1.4.0 principles; the Compliance Review gate requires all-principle assessment. Principle VI (Deterministic Execution) is this change's strongest alignment citation.
  • [HIGH] spec.md:77 (FR-011) — the "equals on every input" / "outputs unchanged" invariance claim is false on #751-contaminated panels; rescope to the clean input class and name #751 as the tracked exception before the delta archives into a governing MUST.

Also recorded:

  • [MEDIUM] tasks.md:74 — task 4.1 attributes scaffold drift tests to make plugin-test; they are Go tests under make test/make check.
  • [LOW] .opencode/plugins/review-dispatch/index.ts — the D3 fixed-point invariant (advisories: [] safety) is maintained by convention rather than type-checkable; documented in design.md and the call-site comment.

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

validation defect, not verdict derivation), #746/#760 (dispatch
session collision), #763 (`diff_path` documentation).

## Constitution Alignment

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.

[HIGH] documentation-completeness: The Constitution Alignment section assesses only Principles I-IV; the org constitution is v1.4.0 with six active principles, and its Compliance Review rule requires the planning-phase Constitution Check gate to verify alignment with ALL active principles (proposal.md:109; tasks.md task 4.3 likewise verifies only I-IV).

Principles V (Security by Default) and VI (Deterministic Execution) receive no assessment. The change's own shipped learnings declare this defect — constitution-20261020T001445-jay-flowers.md states proposals assessing only I-IV fail the Compliance Review gate's all-principles requirement, and openspec-20261020T113857-jay-flowers.md records this proposal as the observed instance — yet the artifact ships unamended alongside them.

Assessing Principle VI also captures the change's strongest alignment citation: sharing one derivation function between emitter and validator is Deterministic Execution verbatim. Peer post-amendment changes (e.g., fix-triage-issue-dispatch-docs) assess all six principles.

— divisor-curator


### Requirement: Council Output Preservation

FR-011: The change to verdict derivation MUST NOT alter

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.

[HIGH] documentation-accuracy: FR-011 states the council/test-review invariance as universal — "the vote-based value equals the severity-ladder value on every input" and "emitted payloads MUST remain identical to the previous severity-derived behavior" (spec.md:77-81). The claim is false on #751-contaminated panels: deduplicateFindings has no status filter, so a failed run's findings enter the old severity ladder but not the vote count. Those panels also previously failed closed with no artifact, so "identical to the previous behavior" has no referent there.

The change's own learning (review-dispatch-20261020T001450-jay-flowers.md) prescribes the correction: state the invariance over the clean input class and name #751 as the tracked exception. design.md and the council regression-test comment already scope it to successful runs' findings; only the FR-011 requirement text carries the false universal. Once this delta archives into openspec/specs/, it becomes a permanently false governing MUST. The same claim propagates into the CHANGELOG entry and issue #778's body.

— divisor-curator

findings; consolidation MUST finalize with verdict
INCONCLUSIVE instead of a value-mismatch rejection

## 4. Verification

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] documentation-accuracy: Task 4.1 attributes scaffold drift tests to make plugin-test (tasks.md:74). The drift tests are Go tests (internal/scaffold/scaffold_test.go — TestEmbeddedAssets_MatchSource / TestCanonicalSources_AreEmbedded) run by make test / make check; the vitest make plugin-test suite contains no drift tests, per the change's own scaffold-parity-20261020T113858-jay-flowers.md learning.

The verification substance is unaffected — task 4.2 ran make check — but tasks.md is the artifact future changes copy for drift-test verification wording. Amend the task text to name the correct suite.

— divisor-curator

…d-force#764)

consolidate_dispatch derived workflow_result.value and verdict from
a severity ladder over consolidated findings while
finalize_review_dispatch validated them with the vote-based
calculatedWorkflowValue. On split panels (feedback: a successful
zero-findings ACCEPT run plus findings-bearing runs; triage:
split-majority persona votes) both rules fire, so finalization was
deterministically rejected and retry budgets burned to
INCONCLUSIVE with no artifact (observed on PR unbound-force#761).

- Derive payload workflow_result.value and verdict in
  consolidate_dispatch from calculatedWorkflowValue; keep
  computeVerdict for verdict_reason and advisory content only
- Sync the scaffold mirror asset byte-identical (parity tests)
- Pin regression tests for feedback split-panel, triage
  split-majority, and zero-successful-runs internal finalization
- Add openspec change artifacts and CHANGELOG entry

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers force-pushed the opsx/fix-dispatch-verdict-derivation branch from 84b0626 to 2be29b0 Compare October 20, 2026 18:00
@jflowers
jflowers merged commit 9780fd5 into unbound-force:main Oct 20, 2026
17 checks passed
@jflowers
jflowers deleted the opsx/fix-dispatch-verdict-derivation 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.

review-dispatch: consolidate_dispatch verdict derivation contradicts finalizer strictest-rule validation — feedback split panels can never finalize

1 participant