Skip to content

feat(unleash): auto-fix failing checks at blocking gates - #815

Merged
jflowers merged 9 commits into
unbound-force:mainfrom
jflowers:unleash-build-test-fix-loop
Oct 25, 2026
Merged

jflowers merged 9 commits into
unbound-force:mainfrom
jflowers:unleash-build-test-fix-loop

Conversation

@jflowers

@jflowers jflowers commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A failing build/test check at a blocking gate in /uf.unleash
(quick-tier pre-flight, implement phase checkpoints, and Step 6
pre-flight branch-caused failures) previously halted the pipeline
and waited for a human to fix it. The agent that wrote the code is
the right owner of the repair, so the pipeline now runs a
build/test fix loop first:

  • Delegates the fix to cobalt-crush-dev via prompt-only
    uf_delegate_command (with task_classification per the
    determinism contract), then re-runs the pre-flight skill in
    the calling gate's mode using the exact detected commands
  • On pass: a phase checkpoint re-records its verdict green
    (superseding the failed record, inventory carries forward),
    the quick gate records quick-pre-flight, and Step 6 proceeds
    to its dispatch
  • Exit paths fire only when failures persist after 3 iterations;
    all exit call blocks (implement-phase-checkpoint,
    code-review-preflight) are unchanged
  • Guardrails now scope build/test exits to failures "that persist
    after the fix loop's 3 iterations"
  • Pre-existing and environmental failures never enter the loop;
    the session-resume guard's never-re-run rule still applies to
    green verdicts

The scaffold asset mirror is updated byte-identically, a pin test
guards the fix loop in scaffold_test.go, and a CHANGELOG entry
is included.

How to Test

  • go test -race -count=1 ./internal/scaffold/... — pins and
    drift tests (verifies the embedded asset matches the deployed
    command)
  • cmp .opencode/commands/uf.unleash.md internal/scaffold/assets/opencode/commands/uf.unleash.md —
    byte-identity
  • Behavioral: run a quick-tier /uf.unleash change with an
    induced failing test and observe the fix loop repair it before
    the gate exits

How to Demo

Run /uf.unleash <small change> on a quick/* branch, break one
test deliberately, and watch the pre-flight gate route through the
build/test fix loop (delegated fix + re-run) instead of pausing
for a human. Exhausting 3 iterations still renders the
implement-phase-checkpoint exit.

Documentation

Key Files Changed

  • .opencode/commands/uf.unleash.md (102) — fix-loop block +
    gate rewiring
  • internal/scaffold/assets/opencode/commands/uf.unleash.md
    (102) — byte-identical scaffold mirror
  • internal/scaffold/scaffold_test.go (19) — pin test for the
    fix loop
  • CHANGELOG.md (17) — unleash-build-test-fix-loop entry

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

@jflowers
jflowers requested a review from a team as a code owner October 24, 2026 14:49
@jflowers jflowers self-assigned this Oct 24, 2026
@jflowers
jflowers force-pushed the unleash-build-test-fix-loop branch from ad7a0eb to 0f7cd24 Compare October 24, 2026 16:51

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

Divisor Council Review — REQUEST CHANGES

Note: The council verdict is REQUEST CHANGES. GitHub does not allow the author's account to submit a REQUEST_CHANGES event on their own PR, so this review posts as a comment carrying the full verdict and findings.

PR #815 reviewed at head ad7a0ebb (base 2b67a1db, main). 5-persona dispatch: 4 successful (architect, curator, guard, testing), 1 failed (adversary — retryable child-session error, did not vote). All 17 CI checks pass (11 pass, 4 skipped, 2 neutral). Full artifact: .uf/artifacts/dispatch/a3a36ab0-f496-4c1b-9462-31b3c0494ba3.json.

Blocking (HIGH)

  1. Documentation gate unsatisfied (curator, corroborated by guard and architect): This is a user-facing workflow change — /uf.unleash blocking gates now auto-repair for up to 3 delegated iterations before halting — scaffolded into consumer projects via uf init. The constitution's Cross-Repo Documentation rule requires a tracking issue in unbound-force/website before merge, and the AGENTS.md gate requires a companion docs issue in this repo. Neither exists (verified via issue searches in both repos; no references in the PR body or CHANGELOG). Fix: file both issues and reference them from the PR body and CHANGELOG entry, per repo practice (#772 + website #314, #791 + website #317).

  2. Spec-workflow governance gap (guard): A non-trivial pipeline-behavior change landed outside every governance path — no openspec/changes/ entry, no quick-tier route decision; the branch name matches no tier convention, so /uf.unleash tier routing never ran. Every prior unleash behavior change went through OpenSpec. The implementation is faithful and well-executed (exact-command re-verification, preserved fail-closed exits, byte-identical mirror, pin test) — the gap is the missing planning record. Fix: add the OpenSpec change artifacts (or document the route decision) before merge.

Advisories (MEDIUM/LOW — inline)

  • Quick-tier gate entry condition omits the pre-existing/environmental exclusion filter the loop block declares (architect, MEDIUM)
  • 3-iteration budget is conversation-scoped; a resumed session re-enters with a fresh budget (architect, MEDIUM)
  • Pin subtest asserts phrase presence, not per-gate wiring — phase-checkpoint wiring is unpinned (testing, MEDIUM)
  • New fix-loop uf_delegate_command call site lacks a delegation-shape pin (testing, MEDIUM)
  • command_path token in the Step 5 span makes the negative pin punctuation-dependent (testing, LOW)
  • Unfiled docs issue (architect LOW, guard MEDIUM — same root cause as blocking #1)

Verdict

REQUEST CHANGES — both blockers are pre-merge formalities (issue filings and planning record), not implementation defects. Persona verdicts: architect APPROVE WITH ADVISORIES, curator REQUEST CHANGES, guard REQUEST CHANGES, testing APPROVE WITH ADVISORIES.

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

Comment thread CHANGELOG.md Resolved
Comment thread .opencode/commands/uf.unleash.md Resolved
Comment thread .opencode/commands/uf.unleash.md Resolved
Comment thread CHANGELOG.md Resolved
Comment thread internal/scaffold/scaffold_test.go Resolved
Comment thread .opencode/commands/uf.unleash.md Resolved
Comment thread internal/scaffold/scaffold_test.go Resolved
Comment thread CHANGELOG.md Resolved
Comment thread .opencode/commands/uf.unleash.md Resolved
A failing build/test check at a blocking gate (quick-tier
pre-flight, implement phase checkpoints, Step 6 pre-flight
branch-caused failures) previously halted the pipeline and
waited for a human. The agent that wrote the code is the
right owner of the repair, so the pipeline now runs a
build/test fix loop first:

- Delegate the fix to cobalt-crush-dev (prompt-only
  uf_delegate_command with task_classification per the
  determinism contract), then re-run the pre-flight skill
  in the calling gate's mode with the exact detected
  commands
- On pass: a phase checkpoint re-records its verdict green
  (superseding the failed record), the quick gate records
  quick-pre-flight, Step 6 proceeds to its dispatch
- Exit paths fire only when failures persist after 3
  iterations; all exit call blocks are unchanged
- Guardrails scope build/test exits to failures that
  persist after the fix loop's 3 iterations

Scaffold mirror updated byte-identically; pin test added
for the fix loop in scaffold_test.go.

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers force-pushed the unleash-build-test-fix-loop branch from 0f7cd24 to 9dfc566 Compare October 25, 2026 13:56
…-loop budget

Wire causality classification into the quick-tier gate
entry (matching the phase checkpoint and Step 6 rules):
only change-caused or unknown-origin failures enter the
build/test fix loop; pre-existing and environmental
failures are recorded in the checkpoint inventory and
the gate treats them as green.

Make the 3-iteration budget durable across sessions:
the phase checkpoint schema and the quick gate's
quick-pre-flight data both record the iteration count,
incrementing after each delegated attempt and resuming
from the recorded value so the budget is 3 total
attempts, never 3 more per resume.

Strengthen the scaffold pins: per-gate wiring phrases
(quick gate, phase checkpoint, Step 6 each pinned
distinctly), a durable-budget pin, a dedicated
fix-loop delegation-shape pin (uf_delegate_command,
prompt-only, task_classification, no command_path), and
the per-task command_path negative assertion scoped to
the per-task delegation block instead of the whole
implement step.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
…x loop

Add the OpenSpec change record for the /uf.unleash
build/test fix loop (PR unbound-force#815): proposal, design
decisions (causality-filtered loop entry, quick-gate
classification wiring, durable cross-session budget,
prompt-only delegation, green supersession, per-site
pin phrases), unleash spec deltas, and completed task
list. Artifacts are retroactive -- the implementation
landed on a branch matching no tier convention before
this change record existed.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
…sues

Update the unleash-build-test-fix-loop CHANGELOG entry
to match the implemented behavior: causality
classification at gate entry, the loop restricted to
change-caused and unknown-origin failures, and the
3-iteration budget recorded as durable gate checkpoint
data spanning sessions. Reference the companion
documentation issues unbound-force#819
and unbound-force/website#322 and the retroactive
OpenSpec change record.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
Store the 14 lesson proposals harvested from the Tier 2
Divisor dispatches for PR unbound-force#815 feedback (items 3, 5, 6,
7, 9): span-pin scoping and negative-assertion coupling
in scaffold pin tests, per-gate wiring phrase
convention, delegation-shape pins for prompt-only call
sites, and durable cross-session workflow state in
checkpoint data.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
Address review-council advisories on the fix-loop changes:
- Add a labeled causality classification contract at the top of the
  fix-loop block and reference it by name from the quick-tier gate,
  resolving the dangling "classification contract" reference.
- Wire the durable iteration budget into Step 6's code-review-preflight
  checkpoint (data.iteration recorded and read back on resume) so the
  cross-session budget claim holds at every named gate.
- Extend scaffold pins: quick-tier whole-change delegation shape,
  per-site budget phrases, causality-filter prose, supersession and
  deterministic re-run phrases, checkpoint_step negative on the
  fix-loop delegation pin; scope the per-task command_path negative
  to the per-task delegation block only.
- Record the -race flag in the openspec verification task.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
The checkpoint tool persists only number, verdict, and inventory
from the structured phase object (zod strip mode), so the iteration
count recorded inside phase: was silently dropped on every call.
Move the budget to the free-form data parameter as gate-distinct
top-level keys -- data.fixLoopQuick (quick gate), data.fixLoopPhase[N]
(phase checkpoints), data.fixLoopPreflight (Step 6 preflight) --
which round-trip through get_progress and cannot collide across
gates. Name the keys in the loop block, resume rule, phase schema,
Step 6 bullet, spec, design, proposal, and tasks.

Also add the fail-closed line to the causality classification
contract (hard-gate mode classifies unverifiable baselines as
change-caused), quote the shipped pin phrases in tasks.md, add the
content-coverage line to proposal.md, and extend the scaffold
budget pins with the data-key pins and an "iteration:" seam
negative proving the count no longer rides the phase object.

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
The quick gate's only checkpoint step, quick-pre-flight, is a
completion claim: resume detection derives implement-done from
it, so persisting the fix-loop budget there would falsely
signal a passed gate mid-loop, while deferring the write leaves
the budget unrecorded at exhaustion. Both halves of that
conflict resolved:

- quick-pre-flight stays success-only and carries only the
  failure inventory; it remains the gate's only completion
  claim
- a new budget-only quick-fix-budget step records
  data.fixLoopQuick after every delegated attempt and at
  exhaustion, is read back on resume, and never signals gate
  completion
- loop step 4, the resume paragraph, and the spec's store
  enumeration name the budget-only step alongside the phase
  checkpoint's data.fixLoopPhase[N] and Step 6's
  data.fixLoopPreflight keys
- spec adds the completion-claim-separation MUST and a
  budget-writes-do-not-complete scenario; design records the
  checkpoint-semantics asymmetry that motivated the split

Advisory fixes from council iteration 3: website#322 labeled
docs; proposal Principle VI reworded to declare per-call
classification with judgment as the usual case; tasks 2.5/2.6
added for the quick-tier delegation pin and exit-half pins;
design records the DE-004 line delta (+176/-13 per copy);
scaffold_test gains five site-unique exit-half pins (fail-closed
rule, phase supersession, phase exhaustion exit, Step 6
persistence stop, Guardrails exit-list edit).

Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
Addresses PR unbound-force#815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
@jflowers
jflowers merged commit da044a4 into unbound-force:main Oct 25, 2026
17 checks passed
jflowers added a commit that referenced this pull request Oct 25, 2026
…-loop budget

Wire causality classification into the quick-tier gate
entry (matching the phase checkpoint and Step 6 rules):
only change-caused or unknown-origin failures enter the
build/test fix loop; pre-existing and environmental
failures are recorded in the checkpoint inventory and
the gate treats them as green.

Make the 3-iteration budget durable across sessions:
the phase checkpoint schema and the quick gate's
quick-pre-flight data both record the iteration count,
incrementing after each delegated attempt and resuming
from the recorded value so the budget is 3 total
attempts, never 3 more per resume.

Strengthen the scaffold pins: per-gate wiring phrases
(quick gate, phase checkpoint, Step 6 each pinned
distinctly), a durable-budget pin, a dedicated
fix-loop delegation-shape pin (uf_delegate_command,
prompt-only, task_classification, no command_path), and
the per-task command_path negative assertion scoped to
the per-task delegation block instead of the whole
implement step.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
…x loop

Add the OpenSpec change record for the /uf.unleash
build/test fix loop (PR #815): proposal, design
decisions (causality-filtered loop entry, quick-gate
classification wiring, durable cross-session budget,
prompt-only delegation, green supersession, per-site
pin phrases), unleash spec deltas, and completed task
list. Artifacts are retroactive -- the implementation
landed on a branch matching no tier convention before
this change record existed.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
…sues

Update the unleash-build-test-fix-loop CHANGELOG entry
to match the implemented behavior: causality
classification at gate entry, the loop restricted to
change-caused and unknown-origin failures, and the
3-iteration budget recorded as durable gate checkpoint
data spanning sessions. Reference the companion
documentation issues #819
and unbound-force/website#322 and the retroactive
OpenSpec change record.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
Store the 14 lesson proposals harvested from the Tier 2
Divisor dispatches for PR #815 feedback (items 3, 5, 6,
7, 9): span-pin scoping and negative-assertion coupling
in scaffold pin tests, per-gate wiring phrase
convention, delegation-shape pins for prompt-only call
sites, and durable cross-session workflow state in
checkpoint data.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
Address review-council advisories on the fix-loop changes:
- Add a labeled causality classification contract at the top of the
  fix-loop block and reference it by name from the quick-tier gate,
  resolving the dangling "classification contract" reference.
- Wire the durable iteration budget into Step 6's code-review-preflight
  checkpoint (data.iteration recorded and read back on resume) so the
  cross-session budget claim holds at every named gate.
- Extend scaffold pins: quick-tier whole-change delegation shape,
  per-site budget phrases, causality-filter prose, supersession and
  deterministic re-run phrases, checkpoint_step negative on the
  fix-loop delegation pin; scope the per-task command_path negative
  to the per-task delegation block only.
- Record the -race flag in the openspec verification task.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
The checkpoint tool persists only number, verdict, and inventory
from the structured phase object (zod strip mode), so the iteration
count recorded inside phase: was silently dropped on every call.
Move the budget to the free-form data parameter as gate-distinct
top-level keys -- data.fixLoopQuick (quick gate), data.fixLoopPhase[N]
(phase checkpoints), data.fixLoopPreflight (Step 6 preflight) --
which round-trip through get_progress and cannot collide across
gates. Name the keys in the loop block, resume rule, phase schema,
Step 6 bullet, spec, design, proposal, and tasks.

Also add the fail-closed line to the causality classification
contract (hard-gate mode classifies unverifiable baselines as
change-caused), quote the shipped pin phrases in tasks.md, add the
content-coverage line to proposal.md, and extend the scaffold
budget pins with the data-key pins and an "iteration:" seam
negative proving the count no longer rides the phase object.

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
jflowers added a commit that referenced this pull request Oct 25, 2026
The quick gate's only checkpoint step, quick-pre-flight, is a
completion claim: resume detection derives implement-done from
it, so persisting the fix-loop budget there would falsely
signal a passed gate mid-loop, while deferring the write leaves
the budget unrecorded at exhaustion. Both halves of that
conflict resolved:

- quick-pre-flight stays success-only and carries only the
  failure inventory; it remains the gate's only completion
  claim
- a new budget-only quick-fix-budget step records
  data.fixLoopQuick after every delegated attempt and at
  exhaustion, is read back on resume, and never signals gate
  completion
- loop step 4, the resume paragraph, and the spec's store
  enumeration name the budget-only step alongside the phase
  checkpoint's data.fixLoopPhase[N] and Step 6's
  data.fixLoopPreflight keys
- spec adds the completion-claim-separation MUST and a
  budget-writes-do-not-complete scenario; design records the
  checkpoint-semantics asymmetry that motivated the split

Advisory fixes from council iteration 3: website#322 labeled
docs; proposal Principle VI reworded to declare per-call
classification with judgment as the usual case; tasks 2.5/2.6
added for the quick-tier delegation pin and exit-half pins;
design records the DE-004 line delta (+176/-13 per copy);
scaffold_test gains five site-unique exit-half pins (fail-closed
rule, phase supersession, phase exhaustion exit, Step 6
persistence stop, Guardrails exit-list edit).

Addresses PR #815 review feedback from @jflowers.

Signed-off-by: Jay Flowers <[email protected]>
Assisted-by: glm-5
@jflowers
jflowers deleted the unleash-build-test-fix-loop branch November 15, 2026 21:38
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.

1 participant