Repository navigation
feat(unleash): automatic tier routing with risk floors and issue resolution - #784
Conversation
Route /uf.unleash between speckit, openspec, and a new quick tier when no spec has been committed. Adds the tier-routing rubric skill, issue-ref resolution, route decision tool, and quick-tier gates.
/uf.unleash now picks the workflow when no spec exists yet: Speckit for large scopes, OpenSpec for smaller ones, or a lightweight quick tier for trivial fixes and chores. - uf_unleash_route_decision tool: validates the route (no routing around tier-named branches), enforces a clean tree, creates quick/<name> branches, and checkpoints the tier-routing decision - branch gate accepts quick/* (no artifact prerequisites); ON_MAIN and UNRECOGNIZED_BRANCH now carry routing messages instead of STOPs - detect_resume: quick tier forces clarify/plan/tasks/spec-review done and derives implement from the checkpoint claim; feature_dir optional - tier-routing skill: rubric, risk floors (security/auth/data-loss/ public-API never route below openspec), issue-ref resolution, and the announcement format - uf.unleash: routing step (1a), per-tier orchestration with gate re-run verification, quick pipeline skipping spec-artifact steps - uf.finale: quick/* branches; threads the route-decision issue number into the PR body (Closes #N) with precedence over .openspec.yaml - review council: quick branches review in code mode - write_unleash_summary: feature_dir optional for the quick tier Tests: 926 passing (33 files). openspec validate passes for unleash-tier-routing and the amended unleash-deterministic-tools.
Review iterations for the unleash-tier-routing change: - Enforce quick-tier risk floors mechanically: ROUTE_RISK_FLOOR rejects a quick decision carrying any risk signal before any git access, so MUST-level floors live in code, not prose - Extract uf_unleash_resolve_issue with an injected gh runner (#NNN and issue-URL detection, fail-closed envelopes); trim duplicated description-gathering prose to the skill - Thread the originating issue number end-to-end and re-key the tier-routing checkpoint under the feature branch so /uf.finale emits Closes #N on routed branches - Make the quick pre-flight gate durable across resumes (both the implement and quick-pre-flight claims required) - Fix stale /uf.unleash Step 8 references (review council is Step 6) in the template and AGENTS.md - Document the three-tier model in AGENTS.md, docs/, README, QUICKSTART; add CHANGELOG entry - Reconcile sibling change unleash-deterministic-tools artifacts and record the archive-order constraint - Pin behaviors with table-driven tests (route decision, resolve-issue, resume, finale state-reader); 978 plugin tests green Assisted-by: glm-5 Generated with AI assistance (glm-5)
a6b0b76 to
94ff439
Compare
jflowers
left a comment
There was a problem hiding this comment.
Review Council Verdict: APPROVE WITH ADVISORIES
Four Divisor personas (architect, curator, guard, testing) completed structured reviews; the adversary run failed on a transient provider error and cast no vote. All four successful runs returned APPROVE WITH ADVISORIES. All 17 CI checks pass or skip. Findings: 3 MEDIUM, 9 LOW — no CRITICAL or HIGH.
Recurring themes:
- Prescribed terminal output rendered as prose (determinism gate, DE-003) — tracked via #782 for two blocks, untracked for one
- Risk floors vs AGENTS.md "What requires a spec" boundary gap
- Tier-conditional command paragraphs without explicit tier markers
- Byte-identical scaffold mirrors multiply every command/skill edit
All 12 findings are attached as inline comments. Dispatch artifact: .uf/artifacts/dispatch/43cfc023-3081-43c2-b616-b3c663596c27.json.
This review was generated by /uf.review-pr (AI-assisted).
| ``` | ||
|
|
||
| For Quick mode: | ||
|
|
There was a problem hiding this comment.
MEDIUM · architect · determinism
This step prescribes new terminal output as prose: the Step 2 "For Quick mode:" status display, the "implement ✗ (gate pending)" rendering rule, and the tier-routing skill's Phase 5 announcement format. The established precedent routes prescribed output through formatter tools (format_unleash_exit / format_unleash_demo), which this change extends for the quick tier. design.md records the DE-003 tension, but the renderer extraction carries no tracked issue number — task 12.5 notes it only as a design risk, unlike the sibling deferrals tracked in #780/#782. Consider extending #782 (or filing a tracking issue) and recording the reference in the design risk note and task 12.5, or routing these blocks through a formatter now.
| failure, emit the envelope's error and **STOP**. Then run | ||
| the pre-flight gate below. | ||
|
|
||
| Run the `pre-flight` skill in `hard-gate` mode — the |
There was a problem hiding this comment.
MEDIUM · guard · intent-fidelity
This quick pre-flight hard-gate paragraph follows the **If WORKFLOW_TIER = quick** block (line 650) as a top-level paragraph without its own tier marker, unlike the explicit markers at lines 344, 450, 477, and 500. Its scope is visible only through adjacency and the "quick-tier equivalent" phrase, so a linear execution for the speckit or openspec tiers can read the blocking "If any check fails, EXIT" as unconditional. The trailing continuation at 693–694 ("On failure ... STOP. Then proceed directly to Step 6") also has an ambiguous antecedent. An explicit **If WORKFLOW_TIER = quick**: prefix (or nesting inside the quick block) plus a scoped continuation fixes the read; the byte-identical scaffold mirror needs the same edit.
| choose the heavier one: under-routing a large change loses | ||
| gates, while over-routing a small one only adds ceremony. | ||
|
|
||
| ## Phase 4: Apply the risk floors (escalate only) |
There was a problem hiding this comment.
MEDIUM · guard · governance-consistency
The Phase 4 risk floors (lines 106–111: security-sensitive, auth, data-loss, public-API-breaking) do not subsume the AGENTS.md "What requires a spec" classes (new features, signature-changing refactors, multi-function test additions, agent changes, CI changes, data-model changes). A small-looking change in those classes carries no floor signal and remains autonomously routable to the spec-less quick tier, which conflicts with the "All non-trivial changes MUST be preceded by a spec workflow" mandate at the boundary between the two texts. ROUTE_RISK_FLOOR enforcement inherits the gap because its risk_signals vocabulary knows only the four floor signals. Adding the spec-required classes to Phase 4 and the tool vocabulary — or amending the AGENTS.md list to state its interaction with quick routing — closes it; the scaffold mirror carries the same text.
| // No .openspec.yaml — field stays null. | ||
| } | ||
|
|
||
| // Tier-routing issue number (unleash-tier-routing). The route |
There was a problem hiding this comment.
LOW · architect · dry
This reader re-derives the uf-workflow writeState contract inline — the .uf/progress/${sanitizeSlug(branch)}/uf.unleash.json path and a hand-rolled ProgressState guard — instead of sharing a helper in .opencode/lib/. The e2e connecting test pins the contract, and the extraction is tracked in #782, which contains the risk. Folding this reader into the #782 extraction removes the duplication.
| | Bug fix or small task | OpenSpec | `/opsx-propose` | | ||
| | New feature (3+ stories) | Speckit | `/speckit.specify` | | ||
| | "Handle everything" | Either | `/uf.unleash` | | ||
| | Trivial fix, chore, or docs | Quick | `/uf.unleash` | |
There was a problem hiding this comment.
LOW · curator · documentation-completeness
The "Which Workflow?" table row for the quick tier ("Trivial fix, chore, or docs") and the matching AGENTS.md row describe the tier without its risk floors; neither "security-sensitive" nor "risk floor" appears anywhere in docs/usage.md. An engineer choosing a tier from these tables alone can route a security-sensitive fix to the spec-less quick tier. The floors are documented only in agent-facing surfaces and website#315, and #772 covers AGENTS/CHANGELOG/website but not this table. A one-line floor note here closes the gap.
|
|
||
| 3. **Announce the decision** — autonomous, no confirmation | ||
| gate: the tier, the change name, and the rationale, per | ||
| the skill's announcement format. |
There was a problem hiding this comment.
LOW · architect · convention-compliance
Step 1a.1 declares skill Phase 1 the "single source" for description-gathering rules while restating the full procedure: the $ARGUMENTS rule, the uf_unleash_resolve_issue call shape, the ISSUE_RESOLVE_FAILED/ISSUE_RESOLVE_ERROR codes, and the one-question rule. Step 1a.4 and skill Phases 4/5 likewise duplicate the route-decision call shape and the ROUTE_RISK_FLOOR re-route. With the byte-identical scaffold mirror, each contract change now requires four synchronized edits. Trimming these to pointers, or dropping the single-source sentence, reduces the surface.
| design.md and specs/unleash/spec.md are amended to reference | ||
| `uf_unleash_route_decision`; that change MUST archive after | ||
| this one lands. | ||
| - Content coverage: blog assessed — no (capability announcement |
There was a problem hiding this comment.
LOW · curator · content-pipeline
The blog assessment records "no" as "deferred to release notes / CHANGELOG", but no open blog-labeled issue covers tier routing and no release-checklist hook triggers re-evaluation — #742 is gated on #716 and #423 covers CI. "One command from idea to demo" is a strong release-time blog candidate, and nothing currently prompts the evaluation. A tracking issue or a release-checklist line preserves the opportunity.
| For Quick mode: | ||
|
|
||
| ``` | ||
| Detected: Quick mode — routed change <change_name> |
There was a problem hiding this comment.
LOW · guard · constitution-alignment
The quick-mode resumability display (lines 312–326) and the skill Phase 5 announcement (SKILL.md 127–133) are prose templates, while DE-003 requires new instructions to be executable tooling where feasible. The deferral is documented in design.md Risks, tracked in #782, and captured in learning determinism-20261020T172445, and the templates are small and stable — recording it LOW to keep the deferral bounded to these blocks. Include both in the #782 template migration.
| let routedBranch = branch | ||
| if (input.tier === "quick") { | ||
| exec(["checkout", "-b", `quick/${input.change_name}`], cwd) | ||
| // Read back to verify the switch took effect and to anchor the |
There was a problem hiding this comment.
LOW · testing · assertion-depth
The comment at lines 1145–1146 states the post-checkout read-back exists partly "to verify the switch took effect", but routedBranch at line 1147 is never compared against quick/${input.change_name} — there is no fail-closed check and no mismatch error path, and a detached HEAD returns "HEAD" unnoticed. The read-back serves its real purpose (checkpoint anchoring), but the claimed verification is unimplemented, and the test fake mirrors only the happy path. Implementing the comparison with a mismatch test, or correcting the comment and pinning the current behavior, aligns the code with its stated intent.
| contracts); `openspec validate unleash-tier-routing` valid | ||
| with only the house-norm long-text warnings already accepted | ||
| at 7.x. Coverage criterion recorded per Constitution IV: | ||
| 94.61% statements (round-1 verification measurement) anchors |
There was a problem hiding this comment.
LOW · testing · coverage-strategy
Task 9.6 records the coverage criterion as "94.61% statements (round-1)", but the freshest measured value is 94.58% (task 10.7), and the final rounds (11.8, 12.6, +13 tests) record no new measurement. The acceptance evidence is stale, and the criterion exceeds the last measured value. A final make plugin-test coverage pass recorded in task 12.6, with the delta against 9.6, refreshes the evidence.
Summary
/uf.unleash now routes every change to the right workflow tier
automatically instead of stopping on main or unrecognized branches.
A tier-routing skill applies the rubric (quick / OpenSpec / Speckit
by scope signals) with mechanical risk floors (security-sensitive,
auth, data-loss, or public-API-breaking signals reject the quick
tier with an actionable escalation). Two new tested tools back it:
uf_unleash_route_decision(durable decision recording,quick/<name> branch creation, floor enforcement) and
uf_unleash_resolve_issue(#NNN and issue-URL resolution behindan injectable gh runner, fail-closed on gh failures, untrusted
bodies passed through as data only). The quick tier runs
spec-less with full quality gates and a both-claims resume
derivation (implement AND quick-pre-flight), review councils run
in code mode, and the resolved issue number threads through to
the PR body (
Closes #N, route-decision state taking precedenceover
.openspec.yaml). The pending sibling changeunleash-deterministic-toolswas reconciled and itsarchive-order constraint recorded; repo and website documentation
were de-staled to the three-tier model (website PR
unbound-force/website#315, merge pending).
How to Test
How to Demo
main, run/uf.unleash fix the readme typo— instead ofSTOP, the route decision applies the tier-routing rubric and
creates
quick/fix-the-readme-typowith full quality gates./uf.unleash add OAuth login— the security-sensitiverisk floor rejects the quick tier with an actionable
escalation to OpenSpec (ROUTE_RISK_FLOOR).
/uf.unleash fix #NNN— the issue number resolves viathe injected gh runner, threads through checkpoint state, and
the eventual
/uf.finalePR body emits a closing reference.Key Files Changed
.opencode/commands/uf.unleash.md(+348) — tier routing, riskfloors, issue resolution, stale Step 6/8 fixes
.opencode/plugins/uf-workflow/index.ts(+718) — newuf_unleash_route_decisionanduf_unleash_resolve_issuetools, checkpoint re-keying, resume gates
.opencode/skills/tier-routing/SKILL.md(new, +143) —routing rubric
.opencode/plugins/uf-finale/index.ts(+37) —originating-issue precedence
.opencode/lib/branch-classification.ts,.opencode/lib/unleash-templates.tsunleash-route-decision.test.ts(new, +690),unleash-resolve-issue.test.ts(new, +519),uf-finale.test.ts(+354),unleash-resume.test.ts(+292)internal/scaffold/assets/opencode/(drift-protected, in sync)
openspec/changes/unleash-tier-routing/(proposal, design,spec, tasks) + sibling
unleash-deterministic-toolsreconciliation
AGENTS.md,README.md,QUICKSTART.md,CHANGELOG.md,docs/.uf/dewey/learnings/70 files changed, +5883 / −320.
Known Issues
all findings resolved, but no approving artifact was recorded
for the spec-review gate.
addressed in this PR).
tracked in Add a coverage gate for the TypeScript plugin suite (deferred from unleash-tier-routing) #780.
This PR was generated by /uf.finale (AI-assisted).