Skip to content

fix(review-pr): finalize dispatch via consolidate_dispatch with provenance - #915

Merged
jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/review-pr-consolidate-dispatch
Nov 2, 2026
Merged

jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/review-pr-consolidate-dispatch

Conversation

@jflowers

@jflowers jflowers commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #906

/uf.review-pr now finalizes review dispatches with exactly one consolidate_dispatch call carrying provenance from the frozen PR input context (branch/commit from head_ref/head_sha), bounded mechanical-rejection retry (max 2, assessment data immutable), presentation-only grouping/severity, and proposals and warnings sourced from the consolidate result. The scaffold mirror is synced byte-identical; content/contract/golden test gates are extended; uf.review-council.md §3 dedup prose is tidied to presentation-only; and a CHANGELOG entry with spec traceability was added.

Why

Hand-rebuilt finalize_review_dispatch payloads drifted from the finalizer's schema and caused repeated rejections — the #906 defect class (three consecutive rejections in a real review run before the payload passed through unchanged). The dispatch-finalize-determinism change moved /uf.review-council, /uf.triage-issue, and /uf.address-feedback to a single consolidate_dispatch call with provenance; this change moves /uf.review-pr to the same contract.

How to Verify

  • make check
  • go test ./internal/scaffold/ -run TestConsolidateDispatchFinalizationContractGates -count=1
  • openspec validate review-pr-consolidate-dispatch

Test Results

  • make check exit 0 — Go suite + plugin suite (1664 tests, 95.82% statements coverage > 94% floor), council-review-action pipeline 91 pass, global coverage ratchet 88.5% ≥ 80%

Review

  • Spec review: APPROVE WITH ADVISORIES (2 iterations)
  • Code review: APPROVE WITH ADVISORIES (1 iteration — 9 advisory findings: 2 MEDIUM, 7 LOW, recorded in the dispatch artifact; follow-up candidates: CHANGELOG docs-issue citation, FR-014 test pins, docs-issue labels)

Notes

…nance

Replace the manual finalize_review_dispatch payload assembly in
/uf.review-pr with exactly one consolidate_dispatch call per
finalization attempt. Hand-rebuilt payloads drifted from the
finalizer's schema and caused repeated rejections (the unbound-force#906
defect class).

- Resolve provenance (branch/commit) only from the Step 2 frozen
  PR input context (head_ref/head_sha); workflow_id "uf.review-pr"
- Bounded mechanical-rejection retry (max 2), classified from the
  structured response alone; assessment data immutable on retry;
  exhausted retries fail closed to INCONCLUSIVE
- Source lesson proposals and consolidation warnings from the
  finalization result's top-level arrays
- Grouping/severity are presentation-only in the GitHub review
  comment and terminal report — same tidy applied to
  /uf.review-council §3 dedup prose
- Sync scaffold mirror byte-identical; extend content-gate,
  contract, and golden test gates; CHANGELOG entry with spec
  traceability
- Include seven Dewey learnings captured during the workflow

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers jflowers self-assigned this Nov 2, 2026
@jflowers
jflowers requested a review from a team as a code owner November 2, 2026 05:03

@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: APPROVE WITH ADVISORIES

5 reviewers · 5 successful runs · 9 advisory findings (4 MEDIUM, 5 LOW) · 0 CRITICAL · 0 HIGH · CI green

This change replaces /uf.review-pr's hand-assembled finalize_review_dispatch payload with exactly one consolidate_dispatch call carrying frozen-context provenance, marks cross-persona grouping presentation-only, mirrors both command files into the scaffold, and gates the new contract with content-pin tests. The reviewer council (adversary, architect, curator, guard, testing) finds the change sound: no blocking verdicts, no security findings, and every finding is an advisory documentation, spec-record, or test-fidelity gap.

The strongest theme: the change's own shipped learnings codify artifact-discipline standards its artifacts predate and don't yet satisfy —

  • Docs-gate traceability (MEDIUM): the CHANGELOG entry and proposal Impact bullet record the filed docs issues without threading their numbers (#908, unbound-force/website#367), and both issues carry no docs label — the tracking is undiscoverable by label and untraceable from the change record.
  • Spec-record gaps (MEDIUM): the §5 rewrite silently reverses the deleted §5a all-skip carve-out with no corresponding FR-013..016 requirement or scenario, and FR-014 ships with zero content-gate pins while FR-013/FR-015 are pinned exhaustively.
  • Test fidelity (MEDIUM): the new golden CONSOLIDATE_SITES case derives workflow_id "uf.review-council" while the documented call specifies "uf.review-pr" — the site's distinguishing argument is never exercised.

Remaining advisories cover design.md's read-path description vs. the actual embedded-mirror-only gate, the stale golden inventory header count (14 enumerated vs 15 exercised sites, pre-existing), and the unpinned fail-closed retry consequences. All are non-blocking; details in the inline comments.

Dispatch artifact: .uf/artifacts/dispatch/03384e15-cbec-45d3-b9c4-12cf735dd3c7.json (correlation_id 03384e15-cbec-45d3-b9c4-12cf735dd3c7, workflow_id uf.review-pr). Four lesson proposals from the reviewers are stored to Dewey.

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

Comment thread CHANGELOG.md
now attributes the finalization `consolidate_dispatch` site
(`uf.review-pr.md:527`) instead of the removed
`finalize_review_dispatch` site. (Spec:
openspec/changes/review-pr-consolidate-dispatch/, Fixes: #906)

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 — The docs-gate traceability chain for this change is incomplete. This entry's trailing reference ends at "(Spec: openspec/changes/review-pr-consolidate-dispatch/, Fixes: #906)" with no Docs references, while 14 prior user-facing entries carry "(... Docs: #NNN, unbound-force/website#NNN)" — including the direct sibling precedent dispatch-finalize-determinism ("Docs: #717", line 1070). Issue #908 carries no labels, so the label-scoped search gh issue list --label docs cannot surface it (the docs label is the discovery key this PR's own learning documents), and website#367 lacks the docs label. The proposal's Impact Docs bullet names both issues without their numbers. Net effect: the docs tracking is undiscoverable by label and untraceable from the change record. Both issues were filed at ~04:07Z, before the docs-gate learning codifying the file-then-record two-step was captured at 04:53Z, and the artifacts were never retro-fitted. Consider threading "Docs: #908, unbound-force/website#367" into this trailing reference and the proposal Impact bullet, and labeling both issues docs.

command, mode, input context, change profile, plan, coverage, and
every run, and `consolidate_dispatch` reads it directly.

If the dispatch was all-skip — the Section 4c summary reports zero

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] intent-drift — The §5 rewrite silently reverses the deleted §5a all-skip carve-out. The old section classified an all-skip dispatch (zero completed, zero failed, no session) as "a valid outcome, not a retrieval failure" that must not fail closed over the absent dispatch session; this text routes the same case through the fail-closed path to INCONCLUSIVE. The user-visible outcome is unchanged (INCONCLUSIVE either way) and the new wording matches the review-council §5 precedent, but the reversal appears in no FR-013..016 requirement or scenario — only design D2 and task 1.1 record it, while the proposal claims "no change to verdict semantics". The requirements delta is the contract of record; consider adding a scenario to the dispatch-finalization delta that explicitly supersedes the old carve-out.

readonly metadataOverrides: Record<string, unknown>
}> = [
{ site: "uf.review-council.md:424", command: "review-council", mode: "code", metadataOverrides: {} },
{ site: "uf.review-pr.md:527", command: "review-council", mode: "code", metadataOverrides: {} },

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-fidelity — This site's documented workflow_id is never exercised. The new CONSOLIDATE_SITES entry derives workflow_id: uf.${command} = "uf.review-council", but the documented call at uf.review-pr.md:527 (FR-013, pinned at scaffold_test.go:670) specifies "workflow_id": "uf.review-pr". The case's argument profile is identical to the uf.review-council.md:424 case, so the suite executes the same profile twice and "uf.review-pr" appears in no exercised argument. Consider an optional per-site workflowId override on the CONSOLIDATE_SITES entry type (defaulting to the derived value) set to "uf.review-pr" here while keeping command: "review-council" — extending the command union instead would model a session command uf.review-pr never dispatches with.

// scoped to the Finalize Dispatch section boundaries because
// "first deduplicate" legitimately remains in Section 6's
// presentation-only prose. Absence is asserted both raw and
// whitespace-normalized so line-wrapped reintroductions fail

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] spec-coverage — FR-014 ships with zero pins. FR-016's enumeration mandates pins for the FR-013 and FR-015 contracts only; this test matches that enumeration exactly, leaving FR-014 (single-source proposals and warnings) with no presence or absence assertions. Consequence: the removed §5a no-provenance retrieval pattern ("call consolidate_dispatch exactly once WITHOUT provenance") is reintroducible from git history with no failing check. The command-contracts learning shipped in this PR documents the same gap. Consider an absence pin for the no-provenance retrieval phrasing in uf.review-pr.md, mirroring the §5b/§5 prohibitions already pinned.

tested. The new assertions follow the existing content-gate
precedent in `internal/scaffold/scaffold_test.go`
(`TestQuestionToolPresentationContractGates`,
`TestSpecReviewPerFindingGateContracts`), which reads the

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] spec-record-accuracy — D5 describes a different read path than the code implements. D5 states the precedent gate "reads the canonical .opencode/commands/ sources and their embedded mirrors through one read path" (tasks.md 3.1 likewise), but TestConsolidateDispatchFinalizationContractGates reads the embedded mirrors only, via assetContent (embed.FS); canonical coverage is transitive through TestEmbeddedAssets_MatchSource, and the dual-read pattern lives in command_contract_test.go's assertCommandCopies. The enforced contract is identical — the record-vs-code drift is the class the change's own scaffold-content-gates learning warns against. Consider rewording D5 and task 3.1 to name the actual read path.

@@ -60,10 +60,10 @@ import { withBun } from "./helpers/bun-runtime.js"
// - review-dispatch: 14 sites -- plan_review_dispatch x7 (uf.unleash.md:665

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-accuracy — The inventory header count is still stale. The header enumerates 14 review-dispatch sites while the describe-block title and the suite exercise 15 — capture_review_diff (uf.unleash.md:620) remains unenumerated. The counts refreshed here (consolidate_dispatch ×4, finalize_review_dispatch ×1) are correct; the exhaustiveness claim is not. Pre-existing partial-refresh defect recorded in the seam-verification learning; no test surfaces it.

})
})

t.Run("uf.review-pr bounded mechanical retry policy", func(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 — The fail-closed consequences are unpinned. This subtest pins the retry bound and default-deny classification, but not the sentences that follow bound exhaustion: "fail closed to INCONCLUSIVE" and "Never store improvised lessons" in the rewritten §5. The fail-closed path is the highest-consequence behavior in the new prose — rewording it to permit unbounded retry or improvised lesson storage would not fail any test. Optional hardening beyond the FR-016 mandate: one presence fragment ("fail closed to INCONCLUSIVE") closes it.

Comment thread CHANGELOG.md
now attributes the finalization `consolidate_dispatch` site
(`uf.review-pr.md:527`) instead of the removed
`finalize_review_dispatch` site. (Spec:
openspec/changes/review-pr-consolidate-dispatch/, Fixes: #906)

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 (flagged independently by architect and guard; one root cause) — The filed docs-issue numbers never enter the record. Both documentation issues are filed (the hard gates pass), but this entry and the proposal's Impact Docs bullet name them without numbers (#908, unbound-force/website#367), so traceability exists only via GitHub keyword search. Twenty-six prior entries carry the "(Docs: #N, unbound-force/website#N)" footer, and the docs-gate learning shipped in this PR prescribes exactly this file-then-record two-step. The issues were filed after these artifacts were authored and neither was revisited. Threading the numbers into this trailing reference closes the gap.

@jflowers
jflowers merged commit 06aa022 into unbound-force:main Nov 2, 2026
17 checks passed
@jflowers
jflowers deleted the opsx/review-pr-consolidate-dispatch 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.

uf.review-pr: manual finalize_review_dispatch payload assembly causes repeated finalizer rejections

1 participant