Repository navigation
feat(rebase-pr): port resolve-branch-conflict command as /uf.rebase-pr - #857
Conversation
Port the verified personal global command resolve-branch-conflict into the UF command set as /uf.rebase-pr per issue unbound-force#851. Spec review council approved at iteration 2 (APPROVE WITH ADVISORIES, 3 recorded advisories honored during implementation). openspec validate passes. Spec: openspec/changes/port-uf-rebase-pr/
Full port of the verified personal global command into the UF command set per openspec/changes/port-uf-rebase-pr (issue unbound-force#851): six phases, ^[1-9][0-9]*$ argument validation, nine guardrails, D2 git plugin tool mapping (git_fetch/git_rebase/git_rebase_abort), and the D3 upstream-verified force-push-with-lease strategy. Marks phase 1 tasks complete in tasks.md.
- Copy canonical .opencode/commands/uf.rebase-pr.md to the scaffold assets (byte-identical, tool-owned) per task 2.1 - Register opencode/commands/uf.rebase-pr.md in expectedAssetPaths, commands count comment 11 -> 12, per task 2.2 - Shift TestRunInit_FreshDir count range [70-74] -> [71-75] (76 embedded assets after registration); drift detection green (go test -race -count=1 ./internal/scaffold/...) and full make check green
- AGENTS.md: PR Review Commands table row and Project Structure slash-commands count 32 -> 33 (task 3.1) - docs/usage.md: Quick Reference row (task 3.2) - docs/architecture.md: Review Commands row (task 3.3) - CHANGELOG.md: Unreleased -> Added port-uf-rebase-pr entry with (Spec: openspec/changes/port-uf-rebase-pr/, Fixes: unbound-force#851) per spec-review advisory (task 3.4) Docs-line references to be appended once task 4.4 files the documentation-gate issues.
Task 4.2: make check green (lint, go test -race -count=1, build, coverage-gate, plugin-test 1263 tests / 95.35% statements). Task 4.3: confirmed .local-sources/ is git-excluded and appears in no commit, artifact, or scaffold mirror (design D9). Task 4.4: filed the documentation-gate issues — unbound-force#856 (per-surface dispositions; tutorial unbound-force#855) and unbound-force/website#340 (website sync) — and recorded both numbers in the CHANGELOG entry and proposal.md Impact section. Spec: openspec/changes/port-uf-rebase-pr/
ef457dc to
8134c16
Compare
jflowers
left a comment
There was a problem hiding this comment.
Review: APPROVE WITH ADVISORIES
The review council ran 5 personas: 4 succeeded (architect, curator, guard, testing — each returning APPROVE WITH ADVISORIES) and 1 failed (adversary — child session error, excluded per RD-FR-025). All 17 CI checks pass, skip, or report neutral; none fail.
Advisories
1. Stale CHANGELOG-format pins — MEDIUM (architect, curator, guard)
The delta spec's Documentation-updates requirement (spec.md:397), tasks.md task 3.4, and proposal.md's Impact bullet pin the CHANGELOG closing line as (Spec: …) + (Docs: #856, unbound-force/website#340) without Fixes: #851, while the shipped CHANGELOG.md entry correctly includes all three elements. .openspec.yaml records originating_issue: 851, and five shipped precedents carry Fixes: #NNN in the pinned closing line when an originating issue exists. Design D1 designates the delta spec as the sanctioned fallback for re-deriving the entry, so the stale pin re-seeds the format iteration 2 corrected. Recommended: add Fixes: #851 to all three pin texts before archive.
2. No content-presence tests for safety-critical command phrases — MEDIUM (testing) + LOW (architect)
The command's regression protection consists of mirror parity, asset registration, and deployment counts. None assert content presence, so symmetric degradation — dropping guardrail text from both the canonical command and its scaffold mirror — passes every gate. The command bounds destructive git operations (force-push history rewrite), the risk class the repo's stronger same-file precedent covers (TestSpecReviewPerFindingGateContracts and siblings pin site-unique phrases via assetContent() + strings.Contains). Spec Requirements 8-10 currently lack executable verification. Recommended: pin tests for the load-bearing phrases (--force-with-lease never --force; never push to base/protected branches; no-merge/no-approve; ^[1-9][0-9]*$ validation; <protect> delimiters; session-resume guard; git_rebase_abort off-ramp).
3. DE-001 deferral revisit condition recorded as prose only — LOW (architect, guard)
Design D2 bounds the remaining raw-bash prose with a revisit condition that has no owner, trigger, or tracked follow-up issue, and no issue number appears anywhere in the change. The deferral itself is sanctioned; the revisit path is the gap. Proposal Principle VI reads an unqualified PASS without counting the concession. Recommended: file or reference a tracked follow-up issue and cite it in design D2.
Inline comments carry the per-file details.
This review was generated by /uf.review-pr (AI-assisted).
| `docs/architecture.md` Review Commands table, and a | ||
| `port-uf-rebase-pr:` entry in `CHANGELOG.md` under | ||
| "## Unreleased" → "### Added" carrying | ||
| "(Spec: openspec/changes/port-uf-rebase-pr/)" and, once |
There was a problem hiding this comment.
This requirement pins the CHANGELOG closing line as (Spec: openspec/changes/port-uf-rebase-pr/) + (Docs: #856, unbound-force/website#340) only, but the shipped CHANGELOG.md entry closes with Fixes: #851 included. .openspec.yaml records originating_issue: 851, and five shipped precedents (review-voice-pack #657, spec-review-per-finding-gate #777, ts-plugin-coverage-gate #780, spawn-subtask-classification-params #830, fix-review-dispatch-correlation-release #794) pin Fixes: #NNN in the closing line when an originating issue exists. The same stale pin appears in tasks.md task 3.4 and proposal.md's Impact bullet. Design D1 designates this delta spec as the sanctioned fallback for re-deriving the CHANGELOG entry, so the incomplete pin re-seeds the format that spec-review iteration 2 corrected — and after archive the spec becomes canonical precedent. MEDIUM — cross-artifact-consistency (divisor-architect). Recommended: add Fixes: #851 to all three pin texts before archive.
| `docs/architecture.md` Review Commands table, and a | ||
| `port-uf-rebase-pr:` entry in `CHANGELOG.md` under | ||
| "## Unreleased" → "### Added" carrying | ||
| "(Spec: openspec/changes/port-uf-rebase-pr/)" and, once |
There was a problem hiding this comment.
The pin here and its siblings (tasks.md task 3.4, lines 86-88; proposal.md Impact bullet, lines 117-118) describe a two-element closing line, while the shipped CHANGELOG.md entry carries all three elements. A search for Fixes across the change directory returns zero matches. The change's own learnings (.uf/dewey/learnings/spec-authoring-20261028T202231-jay-flowers.md, …T202238-jay-flowers.md) document this defect class and prescribe correcting the pins before archive. MEDIUM — documentation-completeness (divisor-curator). Recommended: align the three pin texts with the shipped entry.
| `docs/architecture.md` Review Commands table, and a | ||
| `port-uf-rebase-pr:` entry in `CHANGELOG.md` under | ||
| "## Unreleased" → "### Added" carrying | ||
| "(Spec: openspec/changes/port-uf-rebase-pr/)" and, once |
There was a problem hiding this comment.
Iteration 2 corrected the shipped CHANGELOG entry, but the correction does not reach the pin artifacts: this requirement, tasks.md task 3.4 (tasks.md:86), and proposal.md:118 ("with Spec and Docs issue references"). MEDIUM — cross-artifact-consistency (divisor-guard). Recommended: add Fixes: #<originating_issue> to all three pin texts in this PR so the archived spec does not carry the incomplete format forward as canonical precedent.
| "opencode/commands/uf.constitution-check.md", | ||
| "opencode/commands/uf.finale.md", | ||
| "opencode/commands/uf.init.md", | ||
| "opencode/commands/uf.rebase-pr.md", |
There was a problem hiding this comment.
This registration is the deepest content check the new command receives: mirror parity (TestEmbeddedAssets_MatchSource), list membership here, and deployment counts. None assert content presence, so dropping safety-critical guardrail text from both the canonical command and its scaffold mirror passes every gate. The command bounds destructive git operations — force-push history rewrite to PR head branches — and this file carries stronger precedent for exactly that risk class: TestSpecReviewPerFindingGateContracts (scaffold_test.go:163), TestUnleashCommand_ToolRoutingContracts (:325), TestDivisorGuard_DelegationDisciplineSpawnParameters (:3826), and TestDeterminismPack_DE008SpawnToolParameters (:3879) pin site-unique phrases via assetContent() + strings.Contains subtests. Spec Requirements 8-10 (bounded force-push, post-push verification, command file conventions) have no executable verification while the mechanism exists in this file. MEDIUM — regression-protection (divisor-testing). Recommended: pin tests asserting the load-bearing phrases — --force-with-lease, never --force; MUST NOT push to BASE_REMOTE/main/protected branches; no-merge/no-approve; the ^[1-9][0-9]*$ validation contract; the <protect> delimiters; the session-resume guard; the git_rebase_abort off-ramp.
| `git status`, staging, `git rebase --continue`, and the | ||
| checkout fallback — no plugin tools exist for those, and | ||
| adding them is out of scope (Non-Goal). The exception is | ||
| bounded by a revisit condition: extraction is revisited |
There was a problem hiding this comment.
D2 bounds the remaining raw-bash prose (argument validation, remote-URL matching, gh existence checks) with a revisit condition — extraction when a second command needs the same remote-resolution or conflict-staging seam — but the condition lives only in this prose, with no owner, trigger, or tracked issue. The command ships as a tool-owned scaffold asset, so the deferral deploys to every uf init repo. The deferral itself is sanctioned (it matches the uf.review-pr.md command shape, and plugin tools are an explicit Non-Goal); the revisit path is the gap. LOW — determinism-debt (divisor-architect). Recommended: record the revisit condition as a tracked follow-up issue cited here.
| `git status`, staging, `git rebase --continue`, and the | ||
| checkout fallback — no plugin tools exist for those, and | ||
| adding them is out of scope (Non-Goal). The exception is | ||
| bounded by a revisit condition: extraction is revisited |
There was a problem hiding this comment.
The DE-001 deferral's revisit condition has no trigger, owner, or tracked follow-up issue, and no issue number appears anywhere in the change. The repo's determinism pattern requires deferrals recorded as a named follow-up change or tracked issue, and requires the Constitution Alignment section to count each prose-procedure concession — proposal Principle VI currently reads an unqualified PASS. LOW — determinism-governance (divisor-guard). Recommended: file or reference a tracked follow-up issue and cite it in D2; optionally qualify Principle VI with the counted concession.
| Do NOT merge, approve, or close the PR. This command only makes the | ||
| PR ready to merge with a rebase once it is approved. | ||
|
|
||
| ## Guardrails |
There was a problem hiding this comment.
The Guardrails section's load-bearing phrases — <protect> delimiters, session-resume guard, ^[1-9][0-9]*$ validation contract, --force-with-lease never --force, never-push-base, no-merge/no-approve — receive only drift-parity and registration protection, which verifies canonical/mirror equality rather than content presence. Symmetric degradation (dropping guardrail text from both copies) passes every test. The repo carries a stronger sanctioned precedent for pinning site-unique phrases in command markdown; this command bounds destructive git operations, the case that precedent targets. LOW — structural-protection (divisor-architect). Recommended: see the testing reviewer's comment on scaffold_test.go — the same-file pin-test precedent applies here.
Summary
Ports the verified personal global command
resolve-branch-conflict.mdintothe UF command set as
/uf.rebase-pr <PR_NUMBER>— a slash command thatrebases a conflicted PR's head branch onto its base branch and force-pushes
with lease, so the PR can be merged with a rebase once approved.
.opencode/commands/uf.rebase-pr.md: full port followinguf.review-pr.mdconventions — YAML frontmatter,<protect>block,session-resume guard,
^[1-9][0-9]*$argument validation before any toolcall, six execution phases (prerequisites, PR fetch/gating, checkout and
rebase, conflict resolution, push, verify), and a nine-rule guardrails
section.
fork-aware BASE_REMOTE/HEAD_REMOTE resolution by matching
git remote -vURLs against the PR's base/head repos — never assumes
origin.git_fetch,git_rebase,git_rebase_abort,git_push_force_with_lease) per determinism packDE-001; resolves only flagged conflicts while preserving the PR author's
intent (fail-closed on ambiguity, rebase-abort off-ramp); pushes only to
the head branch with
--force-with-lease; re-verifies mergeability viagh; never merges, approves, or closes the PR.internal/scaffold/assets/opencode/commands/uf.rebase-pr.mdwithexpectedAssetPathsregistration souf initdeploys the command to everyscaffolded repo (drift tests green).
AGENTS.md(PR Review Commands row; command count32 → 33),
docs/usage.md,docs/architecture.md, andCHANGELOG.md;docs-gate issues docs: /uf.rebase-pr ported command (port-uf-rebase-pr) #856 (per-surface dispositions) and
docs: sync /uf.rebase-pr command reference (port-uf-rebase-pr) website#340 (website sync) filed before merge.
Reviews: spec review APPROVE WITH ADVISORIES (iteration 2); code review
APPROVE WITH ADVISORIES (4 of 5 personas, divisor-adversary excluded per
RD-FR-025).
Closes #851
How to Test
Verification status:
make checkgreen at implement HEAD 3d0cf6d7(pre-rebase; the rebase onto latest
mainhad zero file overlap) — lintclean (go vet + golangci-lint), Go tests with
-race -count=1, build,scope-based coverage gate, TypeScript plugin suite 1263 tests at 95.35%
statements (94% floor). CI on this PR re-validates at the rebased head.
.opencode/commands/uf.rebase-pr.md— confirm thefrontmatter description, protect block, session-resume guard, the
^[1-9][0-9]*$argument pre-validation, the six phases, and thenine-rule guardrails.
go test -race -count=1 ./internal/scaffold/...— drift detection asserts the mirror is byte-identical to the canonical
command and
expectedAssetPathslists the new asset.make check./uf.rebase-pr <PR_NUMBER>against an open PR whose base has moved — itfetches PR metadata via
gh, stops if the PR is CLOSED/MERGED or alreadyMERGEABLE + CLEAN, checks out the head branch, resolves
BASE_REMOTE/HEAD_REMOTE from
git remote -v, rebases onto<BASE_REMOTE>/<BASE_BRANCH>, walks only flagged conflicts (STOP +git rebase --abortoff-ramp on ambiguity), pushes--force-with-leaseto the head branch only, and reports the re-checked
mergeable/mergeStateStatuswithout merging or approving.How to Demo
In a scaffolded repo with an open PR whose base branch has moved ahead,
run
/uf.rebase-pr <PR_NUMBER>: the command validates the argument, checksprerequisites, fetches and gates on PR state, checks out the head branch,
resolves the base/head remotes from
git remote -v, rebases onto the base,walks any flagged conflicts (fail-closed with an abort off-ramp),
force-pushes with lease to the head branch only, and reports the
re-checked mergeability — it never merges, approves, or closes the PR.
Key Files Changed
.opencode/commands/uf.rebase-pr.md(+235) — the ported commandinternal/scaffold/assets/opencode/commands/uf.rebase-pr.md(+235) —byte-identical scaffold mirror, registered in
expectedAssetPathsinternal/scaffold/scaffold_test.go,cmd/unbound-force/main_test.go—drift/registration tests and embedded-asset-count updates
openspec/changes/port-uf-rebase-pr/— proposal, design, delta spec,tasks,
.openspec.yaml(originating_issue: 851)AGENTS.md,docs/usage.md,docs/architecture.md,CHANGELOG.md—documentation surfaces
.uf/dewey/learnings/— 11 learnings captured during the workflow(spec review, code review, retrospective)
24 files changed, +1700/−7.
Known Issues
Code review returned APPROVE WITH ADVISORIES — six non-blocking advisories
(full text in
.uf/artifacts/dispatch/1750f856-4d75-4d45-9ec0-8eca8355ef0c.json):(argument-validation regex, BASE_REMOTE/HEAD_REMOTE URL matching,
which ghchecks, fixedgit_fetch→git_rebasesequence) not yetextracted into executable tools — accepted trade-off (verified-source
fidelity, YAGNI on single-call-site tools), no bounding trigger recorded.
the
Fixes: #851element; the shipped entry correctly carries it perrepo convention.
Fixes: #851element exists in the shipped CHANGELOG entry butis not prescribed in the change's own spec artifacts.
proposal.mdImpact → Files omitscmd/unbound-force/main_test.go(modified mechanically for the 76th embedded asset).
^[1-9][0-9]*$pre-validation to"uf.review-pr.md conventions"; that regex is not literally present in
uf.review-pr.md.(registration, mirror parity, and deployment count are tested).
This PR was generated by /uf.finale (AI-assisted).