Skip to content

fix(loop): WS-B — don't trap the model in the hollow-app state (completion-phase flag)#148

Merged
agjs merged 3 commits into
mainfrom
feat/wsb-completion-checkpoint
Jul 20, 2026
Merged

fix(loop): WS-B — don't trap the model in the hollow-app state (completion-phase flag)#148
agjs merged 3 commits into
mainfrom
feat/wsb-completion-checkpoint

Conversation

@agjs

@agjs agjs commented Jul 20, 2026

Copy link
Copy Markdown
Owner

WS-B's near-green checkpoint was reverting the model's legitimate completion work (building the create/edit/delete UI the completeness guards demand) as if it were a spray — reproduced in 3 live builds (1→22/27/37 error spike → rollback → thrash).

Fix

A persistent completionPhase flag: ENTER when every remaining error is completion-class (unused i18n keys / not reachable — clear only by ADDING code), STAY through the mixed-error spike as the model wires the UI, EXIT when no completion error remains or green. While set: no rollback, the near-green banner flips from 'don't create files' to 'build the missing UI', and no checkpoint is captured. judge excluded (can reject existing code). Pure isCompletionClass/nextCompletionPhase + settleGate integration tests; 31 near-green tests green; existing WS-B behavior unchanged for fixable errors.

Reviews

3 panel rounds (banner-contradiction + judge-breadth + spike-persistence findings all addressed). Live capstone (build7) pending an OrbStack restart.

agjs added 3 commits July 20, 2026 00:25
…tion-class errors)

Reproduced in THREE live builds (build3/4/5): the model reaches ~1 error where the
remaining error clears ONLY by adding code — an unused i18n key it declared
(i18n-locale-keys-used), an unreachable feature (reachability), or the hollow-app
judge. WS-B locked that hollow state as the near-green best; when the model then made
the completeness-guard-DEMANDED CRUD-UI edit (form + buttons + toasts to wire the keys),
the count transiently spiked (1→22/27/37) and count-only shouldRollback REVERTED the
legitimate completion work back to the list-only page. The model re-did it → sprayed →
reverted again (bounded to 3, then confused: 'I changed these but they got reverted').

Fix: classify completion-class errors (isCompletionClass / allCompletionClass, pure +
unit-tested) and, in nearGreenCheckpointStep, when EVERY remaining error is
completion-class, CLEAR any checkpoint and don't capture — the model must add code, so a
transient spike from that is progress, not a spray. Clearing (not just skipping) also
drops an earlier compile-state checkpoint so the spray isn't reverted to that either.
WS-B resumes normally once errors are fixable-in-place again (a mixed state with any
fixable error still checkpoints). settleGate integration test + pure-fn tests; existing
WS-B loop/rollback behavior unchanged (non-completion errors).
… judge (panel findings)

Panel found #61 (suppress rollback for a hollow completion state) was INCOMPLETE and
too broad:
- nearGreenBanner ALSO traps: at near-green it tells the model 'smallest change, do NOT
  create files, add features/routes' — the exact opposite of what a completion-class
  error (wire i18n keys → build the create/edit/delete UI) requires. Now when every
  remaining error is completion-class, the banner flips to 'BUILD the missing UI; the
  count will rise as you add files — that's progress, not a regression to undo'. So both
  levers (rollback + banner) stand down together for a genuine completion state.
- 'judge' DROPPED from completion-class: the quality judge can reject defects in EXISTING
  code (fixable in place), so it's not a reliable add-only signal and would falsely
  disable WS-B. Kept reachability + i18n-locale-keys-used (add-only in this stack; the
  i18n-destructive-delete guard forbids the removal shortcut).
Clearing the checkpoint at a completion state is safe: the fixable errors it protected are
already resolved (the current state has none), so it is stale. Tests: banner completion
cases + judge-excluded; existing WS-B loop/banner behavior unchanged for fixable errors.
… (panel round 2)

The panel showed the prior #61 fix was still incomplete: nearGreenRollbackStep runs
BEFORE the checkpoint clear, and both the rollback and the 'undo' banner keyed on a
PER-CYCLE all-completion check — which flips false the instant the model starts adding
the demanded UI (the spike is MIXED: new compile errors + the shrinking i18n error). So
rollback re-armed and the banner reverted to REGRESSION/UNDO mid-add — the same thrash.

Fix: a PERSISTENT state.completionPhase flag, advanced once at the top of settleGate via
nextCompletionPhase(prev, errors): ENTER when all errors are completion-class, STAY while
ANY completion error remains (the whole spike), EXIT when none remain (wiring done → WS-B
re-engages) or green. While set: nearGreenRollbackStep returns early (no revert), the
banner says 'build it', and checkpointStep clears/skips. Reset at the drive boundary.
Pure nextCompletionPhase + a spike-suppression integration test (6 mixed errors past the
threshold → 0 rollbacks, phase held, file not reverted). 31 near-green tests green.
@agjs
agjs merged commit 017a102 into main Jul 20, 2026
8 checks passed
@agjs
agjs deleted the feat/wsb-completion-checkpoint branch July 20, 2026 20:29
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